Table of Contents
最近打算入门 NLP,在自学 🤗 的 NLP Course,但是感觉自己过于摆烂了。于是打算边学边做笔记,争取在期末之前把本课程学完
Pipeline
- the most basic object in the 🤗 Transformers llibrary
- It can:
- feature-extraction(get a vector representing the text)
- fill-task
- ner(entity recognition)
- question-answering
- sentiment-analysis
- summarization
- text-generation
- translation
- zero-shot classification
Zero-shot Classification
- you can casually assign the labels
python
| |
Text Generation
- involves randomness
python
| |
Mask filling
python
| |
Named entity recognition
python
| |
Question answering
- answer a question using given context
- extracting answers from the context instead of generating answers
python
| |
Summarization
python
| |
Translation
python
| |
Brief intro to Transformers
General categorization
- GPT-like: auto-regressive
- BERT-like: auto-encoding
- BART/T5-like: sequence-to-sequence
Transfer Learning
Pretraning
- the act of traing a model from scratch

Fine-tuning
- training on the top of pretrained models with a dataset specific to the target task

General architecture
- Transformers model is generally composed of two blocks:
- Encoder: receives inputs and builds representations for them
- Decoder: use the outputs of encoder to generate target outputs
- Various tasks requires different blocks:
- Encoder-only: sentence classfication; NER
- Decoder-only: text generation
- Encoder-decoder models or sequence-to-sequence models: translation or summarization
Attention layer
- pay specific attention to certain words while ignoring others more or less
Original Architechture
- the encoder translate all the words
- the decoder is only allowed to translate by the past words; but later it can get all the outpus of encoer to better translate the word

Last updated on 2026-09-07
Loading comments…
Comments failed to load. Disqus may be blocked on your network.