How positivepeng/nlp-beginner-projects works
This repository is a collection of five standalone PyTorch/ML NLP examples, rather than one shared application. Their workflows cover bag-of-words and n-gram softmax classification; RNN/CNN classification; BiLSTM-CRF entity tagging; attention-capable date translation; and poetry generation. Each project has its own entry point, data preparation, and model code. The graph follows the sampled entry points and loaders; model implementations are represented by their exact tree paths, but their internal wiring was not sampled.
Main entry points: project1-ML-Sentence Classification/main.py ML workflow · project2-DL-Sentence Classification/main.py DL workflow · project3-Named Entity Recognition/main.py NER workflow · models.py BiLSTM-CRF
Components 24
Feature Classification
- ML workflow
project1-ML-Sentence Classification/main.py - Read reviews
project1-ML-Sentence Classification/data_preprocess.py - BOW / n-grams
project1-ML-Sentence Classification/feature_extraction.py - Softmax model
project1-ML-Sentence Classification/softmax_regerssion.py - Class scores
Neural Classification
- DL workflow
project2-DL-Sentence Classification/main.py - TorchText loader
project2-DL-Sentence Classification/dataloader_bytorchtext.py - Manual loader
project2-DL-Sentence Classification/dataloader_byhand.py - RNN / CNN
project2-DL-Sentence Classification/models.py - Class predictions
Entity Recognition
- NER workflow
project3-Named Entity Recognition/main.py - Tagged data loader
project3-Named Entity Recognition/dataloader.py - BiLSTM-CRF
project3-Named Entity Recognition/models.py - CRF decoder
project3-Named Entity Recognition/torchcrf/__init__.py - Entity tags
Date Translation
- Translation workflow
project4-Machine Translation/main.py - Date data loader
project4-Machine Translation/dataloader.py - Seq2Seq model
project4-Machine Translation/models.py - Normalized date
Poetry Generation
- Generation workflow
project5-Text Generation/main.py - Poetry loader
project5-Text Generation/dataloader.py - Poetry model
project5-Text Generation/models.py - Generated poem
Other components
- Example user
Connections 23
- Example user → ML workflow: starts example
- ML workflow → Read reviews: reads reviews
- ML workflow → BOW / n-grams: builds features
- ML workflow → Softmax model: trains / scores
- Softmax model → Class scores: predicts labels
- Example user → DL workflow: starts example
- DL workflow → TorchText loader: selects loader
- DL workflow → Manual loader: optional loader
- DL workflow → RNN / CNN: trains / evaluates
- RNN / CNN → Class predictions: classifies text
- Example user → NER workflow: starts example
- NER workflow → Tagged data loader: loads batches
- NER workflow → BiLSTM-CRF: trains / predicts
- BiLSTM-CRF → CRF decoder: uses decoding
- BiLSTM-CRF → Entity tags: returns tags
- Example user → Translation workflow: starts example
- Translation workflow → Date data loader: loads date pairs
- Translation workflow → Seq2Seq model: trains / translates
- Seq2Seq model → Normalized date: generates date
- Example user → Generation workflow: starts example
- Generation workflow → Poetry loader: loads poems
- Generation workflow → Poetry model: trains / generates
- Poetry model → Generated poem: generates text