๐Ÿ“

Text AI Pre-trained Model Catalog โ€” 12 Things You Can Do in 3 Lines of Code

From sentiment analysis to code generation โ€” model list and difficulty for HuggingFace one-liners

All you need is pip install transformers and 3 lines.

Common Structure

from transformers import pipeline
pipe = pipeline("task", model="model_name")
result = pipe("input text")

Tasks by Difficulty

โ˜…โ˜†โ˜†โ˜†โ˜† Sentiment Analysis:

pipe = pipeline("sentiment-analysis")
pipe("I love this!")  # โ†’ POSITIVE 0.9998

โ˜…โ˜†โ˜†โ˜†โ˜† Translation:

pipe = pipeline("translation", model="Helsinki-NLP/opus-mt-en-ja")
pipe("Hello")  # โ†’ ใ“ใ‚“ใซใกใฏ

โ˜…โ˜…โ˜†โ˜†โ˜† Summarization, QA, Text Generation, NER, Similarity

โ˜…โ˜…โ˜…โ˜†โ˜† Zero-shot Classification, Code Generation, Chatbot

Model Catalog

Task Model Size GPU?
Sentiment distilbert-sst-2 260MB No
Translation opus-mt-* 300MB No
Summarization bart-large-cnn 1.6GB No
QA distilbert-squad 260MB No
Text gen gpt2 500MB No
Code gen codegen-350M 700MB Rec
Chat DialoGPT-medium 1.5GB Rec

All CPU-runnable. GPU only needed for 7B+ models.

Key Concepts

1

Sentiment (โ˜…โ˜†โ˜†โ˜†โ˜†) โ€” pipeline("sentiment-analysis") for positive/negative in one line

2

Translation (โ˜…โ˜†โ˜†โ˜†โ˜†) โ€” Helsinki-NLP/opus-mt-{src}-{tgt} for 200+ language pairs

3

Summary/QA/NER (โ˜…โ˜…โ˜†โ˜†โ˜†) โ€” text understanding tasks with BART, DistilBERT, etc.

4

Text generation (โ˜…โ˜…โ˜†โ˜†โ˜†) โ€” experience autoregressive generation on CPU with GPT-2 (500MB)

5

Code gen/chatbot (โ˜…โ˜…โ˜…โ˜†โ˜†) โ€” prompt engineering intro with CodeGen, DialoGPT

Use Cases

AI intro โ€” first AI inference experience with 3-line sentiment analysis Prototyping โ€” combine translation + summarization + NER for news analysis tool Model selection guide โ€” recommended models and size/quality trade-offs per task