Intro to Hugging Face

NLP transformers pretrained pipeline

State-of-the-art NLP in five lines

Hugging Face is the GitHub of machine-learning models. Its transformers library lets you download a pretrained model and run a real NLP task in a handful of lines — no training, no GPUs to start.

Behind one pipeline() call sits everything you've learned: tokenization, a transformer model, and decoding — bundled into a single function. You bring the text; it brings the model.

The pipeline abstraction

Watch a sentiment request flow through the pipeline — and see how much it hides: tokenize, run the model, decode the label.

What's in the ecosystem

Model Hub 500k+ models

Pretrained models for sentiment, translation, summarization, QA, image, audio — searchable and free.

pipeline() one call

The high-level API: name a task, get a ready-to-use function.

Tokenizers fast

Matching tokenizer for each model — sub-word, batched, optimized.

Datasets & Trainer fine-tune

Load datasets and fine-tune a model on your own data when the pretrained one isn't enough.

When to use what

Use a pipeline when
  • You want results today, no training
  • A pretrained model already fits your task
  • Prototyping or a one-off analysis
Go deeper when
  • Your domain is specializedfine-tune
  • You need full control of model internals
  • Latency/size constraints → distill or quantize
Where it connects

The models you call here are transformers — the architecture behind modern LLMs. Hugging Face is how most people actually run them.