CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
huggingface

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: huggingface/notebooks
Path: blob/main/course/zh-CN/chapter1/section10.ipynb
Views: 2555
Kernel: Unknown Kernel

章末小测验

Install the Transformers, Datasets, and Evaluate libraries to run this notebook.

!pip install datasets evaluate transformers[sentencepiece]
from transformers import pipeline ner = pipeline("ner", grouped_entities=True) ner("My name is Sylvain and I work at Hugging Face in Brooklyn.")
from transformers import pipeline filler = pipeline("fill-mask", model="bert-base-cased") result = filler("...")
from transformers import pipeline classifier = pipeline("zero-shot-classification") result = classifier("This is a course about the Transformers library")