Hugging Face · Transformers

Classify text in two lines

Use a pipeline for a task with a default model.

from transformers import pipeline

classifier = pipeline("sentiment-analysis")
classifier("I love this library!")

Official Hugging Face documentation

More transformers commands

All transformers commands · Hugging Face cheatsheet

Was this page helpful?