A sequence-to-sequence neural machine translation model that translates German text to English, built using PyTorch with LSTM encoder-decoder architecture.
This model implements the classic seq2seq architecture from
Sutskever et al. (2014) for German-English translation:
1# This is a custom PyTorch model, not a Transformers model
2# Download the files and use with the provided inference script
3
4import requests
5from pathlib import Path
6
7# Download model files
8base_url = "https://huggingface.co/sumitdotml/seq2seq-de-en/resolve/main"
9files = ["best_model.pt", "german_tokenizer.pkl", "english_tokenizer.pkl"]
10
11for file in files:
12 response = requests.get(f"{base_url}/{file}")
13 Path(file).write_bytes(response.content)
14 print(f"Downloaded {file}")
1# Interactive mode
2python inference.py --interactive
3
4# Single translation
5python inference.py --sentence "Hallo, wie geht es dir?" --verbose
6
7# Demo mode
8python inference.py
1# Full training pipeline
2python scripts/data_preparation.py # Download WMT19 data
3python src/data/tokenization.py # Build vocabularies
4python scripts/train.py # Train model
5
6# For full dataset training, modify data_preparation.py:
7# use_full_dataset = True # Line 133-134
1@misc{seq2seq-de-en,
2 author = {sumitdotml},
3 title = {German-English Seq2Seq Translation Model},
4 year = {2025},
5 url = {https://huggingface.co/sumitdotml/seq2seq-de-en},
6 note = {PyTorch implementation of sequence-to-sequence translation}
7}
MIT License - See repository for full license text.
For questions about this model or training code, please open an issue in the
GitHub repository.