How jasonwei20/eda_nlp works
This repository implements Easy Data Augmentation (EDA) for labeled text-classification data, alongside paper experiments and dataset preparation. The main user workflow reads label–sentence rows, applies configurable text edits, and writes augmented rows; experiments then prepare data, train classifiers, and evaluate results. The graph preserves the four documented edit techniques and the experiment families. Some subsystem links are based on the SOURCE INDEX or README rather than full excerpts, so unsampled implementation details are not inferred.
Main entry points: methods.py Shared experiment methods · eda.py EDA generation · augment.py Augmentation CLI · a_2_train_eval.py Experiment A
Components 26
EDA augmentation
- Augmentation CLI
code/augment.py - EDA generation
code/eda.py - Synonym replacement
code/eda.py - Random insertion
code/eda.py - Random swap
code/eda.py - Random deletion
code/eda.py
Dataset preparation
- Dataset cleaning
preprocess - SST label and split
preprocess/sst1_clean.py - Text normalization
preprocess/utils.py - BG dataset cleaner
preprocess/bg_clean.py
Research experiments
- Shared experiment methods
experiments/methods.py - Experiment augmentation
experiments/nlp_aug.py - Experiment A
experiments/a_2_train_eval.py - A configuration
experiments/a_config.py - Experiment B
experiments/b_2_train_eval.py - B configuration
experiments/b_config.py - Experiment C
experiments/c_2_train_eval.py - C configuration
experiments/c_config.py - Experiment D
experiments/d_1_train_models.py - CNN and RNN experiments
experiments/e_2_cnn_aug.py - E configuration
experiments/e_config.py
Modeling and analysis
- Embedding visualization
experiments/d_2_tsne.py
Other components
- Dataset user
- Labeled text
data - NLTK WordNet
- Augmented rows
Connections 23
- Dataset user → Augmentation CLI: runs
README.md - Labeled text → Augmentation CLI: provides rows
README.md - Augmentation CLI → EDA generation: calls
code/augment.py - EDA generation → Synonym replacement: applies
README.md - EDA generation → Random insertion: applies
README.md - EDA generation → Random swap: applies
README.md - EDA generation → Random deletion: applies
README.md - Synonym replacement → NLTK WordNet: looks up synonyms
code/eda.py - Random insertion → NLTK WordNet: looks up synonyms
code/eda.py - EDA generation → Augmented rows: writes rows
- Dataset cleaning → Text normalization: uses
preprocess/bg_clean.py - SST label and split → Text normalization: uses
preprocess/sst1_clean.py - Experiment A → Shared experiment methods: imports methods
experiments/a_2_train_eval.py - Experiment A → A configuration: imports config
experiments/a_2_train_eval.py - Experiment B → Shared experiment methods: uses methods
experiments/b_2_train_eval.py - Experiment B → B configuration: uses config
experiments/b_2_train_eval.py - Experiment C → Shared experiment methods: imports methods
experiments/c_2_train_eval.py - Experiment C → C configuration: imports config
experiments/c_2_train_eval.py - Shared experiment methods → Experiment augmentation: imports augmentation
experiments/methods.py - Experiment D → Shared experiment methods: uses methods
experiments/d_1_train_models.py - Embedding visualization → Shared experiment methods: imports methods
experiments/d_2_tsne.py - CNN and RNN experiments → Shared experiment methods: uses methods
experiments/e_2_cnn_aug.py - CNN and RNN experiments → E configuration: uses config
experiments/e_2_cnn_aug.py