TorchLingo
TorchLingo is an educational PyTorch library for Neural Machine Translation (NMT). Designed for students and instructors, it provides a clean, well-documented implementation of the Transformer architecture for learning and experimentation.
Features
- 🎓 Educational Focus: Clean, readable code designed for learning
- 🔄 Transformer Architecture: Full encoder-decoder implementation with multi-head attention
- 📝 SentencePiece Tokenization: BPE and Unigram subword models
- 🔁 Back-Translation: Data augmentation for improved translation quality
- 🌍 Multilingual Support: Train a single model for multiple language pairs
- 📊 TensorBoard Integration: Monitor training progress in real-time
Installation
pip install torchlingo
For development:
pip install torchlingo[dev]
Working from a clone
The example corpus and the pretrained checkpoint are stored in Git LFS. Install it before cloning, or the two files arrive as short text pointers instead of data and the tutorials that read them will not run:
git lfs install
git clone https://github.com/BYU-Matrix-Lab/torchlingo.git
Already cloned without it? git lfs install && git lfs pull fetches them.
Documentation
For full documentation, tutorials, and API reference, visit:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the GNU Affero General Public License v3.0 - see the LICENSE file for details.
Acknowledgements
This project was initially developed by Josh Christensen as part of his undergraduate work at BYU.
"I hope that TorchLingo will be a valuable resource for students learning about neural machine translation, and that they will consider improving this project and the entire world with the knowledge they gain."
— Josh Christensen
Release files for torchlingo 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| torchlingo-0.2.0.tar.gz | 203.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| torchlingo-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 342.4 kB
Release files / torchlingo-0.2.0.tar.gz
| Download URL | torchlingo-0.2.0.tar.gz |
|---|---|
| Size | 203.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9ae278acdb5d89ba1d3504f5d9794def0c215488b89b58401acebf0f512e7071
|
|
BLAKE2b-256 checksum How to use checksums |
ba1a506c91301e327c45da16a26476acb6905fc281a6712b22e4b5c1df7758c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|
Release files / torchlingo-0.2.0-py3-none-any.whl
| Download URL | torchlingo-0.2.0-py3-none-any.whl |
|---|---|
| Size | 139.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3699d97c22b09d626df6e69115f437266d02c164a1eb10d279903ee0d32bea3a
|
|
BLAKE2b-256 checksum How to use checksums |
7cb6fb727ee05017cbe9970f924ef1ce2c1099d15a3db67d91eb82a06c7eb03b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.16
|