Vishwambhar Reddy Yennam (DA24M027)
This project implements and compares sequence-to-sequence (Seq2Seq) models for the task of transliterating Romanized Telugu text into native Telugu script. The project explores both vanilla Seq2Seq models and Seq2Seq models with attention mechanisms, leveraging PyTorch and Weights & Biases (wandb) for experiment tracking and hyperparameter sweeps.
├── notebooks/
│ ├── seq2seq.ipynb # Vanilla Seq2Seq model (no attention)
│ └── seq2seqattention.ipynb # Seq2Seq model with Bahdanau attention
├── predictions/
│ ├── predictions_vanilla.csv # Predictions from vanilla Seq2Seq model
│ └── predictions_attention.csv # Predictions from attention-based model
├── Visualizations/
│ ├── attention_heatmaps_grid.png # Attention heatmap visualizations
│ └── connectivity_visualizations_grid.png # Connectivity visualizations
├── README.md
- seq2seq.ipynb: Implements a character-level Seq2Seq model (RNN/GRU/LSTM) for transliteration. Includes data preprocessing, model definition, training, evaluation, and wandb sweeps for hyperparameter optimization.
- seq2seqattention.ipynb: Extends the vanilla model by adding Bahdanau (additive) attention, allowing the decoder to focus on relevant parts of the input sequence. Also includes visualizations of attention weights and connectivity.
- The models are trained and evaluated on the Dakshina Telugu dataset, specifically the
te.translit.sampled.train.tsvandte.translit.sampled.dev.tsvfiles. - Data is preprocessed at the character level, and vocabularies are built for both source (Romanized) and target (Telugu) scripts.
- predictions_vanilla.csv and predictions_attention.csv: Each file contains three columns:
input(Romanized word),prediction(model output in Telugu), andtarget(ground truth in Telugu). These files allow for direct comparison between model predictions and true transliterations. - Visualizations: PNG files in the
Visualizations/directory show attention heatmaps and model connectivity, providing insight into model behavior and interpretability.
- The project uses Weights & Biases (wandb) for experiment tracking, logging, and hyperparameter sweeps. Sweep configurations are defined in the notebooks, and results can be visualized on the wandb dashboard.
- Install dependencies (in your Python environment):
- torch
- pandas
- matplotlib
- seaborn
- wandb
- (and other standard scientific Python libraries)
- Download the Dakshina dataset and update the dataset paths in the notebooks if needed.
- Run the notebooks in order:
notebooks/seq2seq.ipynbfor the vanilla modelnotebooks/seq2seqattention.ipynbfor the attention-based model
- View predictions and visualizations in the respective output folders.
- Track experiments and sweeps on your wandb account (set up your API key as shown in the notebooks).
- The attention-based Seq2Seq model generally outperforms the vanilla model, as seen in the prediction outputs and validation accuracy tracked by wandb.
- Visualizations help interpret which parts of the input the model attends to during transliteration.