The Hugging Face is a Git-backed platform for discovering, running, training, and sharing machine learning models and datasets, with a strong emphasis on open-source and reproducibility. The core libraries are: transformers (models + pipelines), tokenizers (fast tokenization), datasets (data loading/processing), and huggingface_hub (Hub interaction + versioning).
A model is a pretrained checkpoint.
A tokenizer converts raw text into tokens.
A pipeline bundles preprocessing, inference, and postprocessing for a task.
A dataset is an Arrow-backed collection of data with splits (train/validation/test).
A checkpoint is a saved snapshot of model weights/config.
A inference means running a trained model on new inputs.
A repo is a Git-backed Hub unit storing models/datasets/Spaces.
Transformers
Sentiment analysis
1 2 3 4 5 6 7 8 9 10 11 12
from transformers import pipeline
# Create a pipeline by specifying a task and model ID analyze_sentiment = pipeline( "sentiment-analysis", model="distilbert-base-uncased-finetuned-sst-2-english" )
# Run inference on input text result = analyze_sentiment("Hugging Face makes NLP workflows not easy!")