Downloads · 30 days
0
atahanuz/rnn-translator-en-tr-63M
rnn-translator-en-tr-63M is a translation model from atahanuz. Use it when you need text moved from one language to another. The card lists the license as cc-by-4.0.
An attentional RNN (bi-GRU encoder / GRU decoder) neural machine translation model that translates English → Turkish, trained with the Nematus toolkit on a ~142k-sentence news-domain parallel corpus using a joint 32k…
Downloads · 30 days
0
Access
Public
Updated May 27, 2026
Repo size
1.1 GB
Likes
0
Public
Click a slice to open those files.
.data-00000-of-00001795 MB · 75%
From the Hugging Face model README
An attentional RNN (bi-GRU encoder / GRU decoder) neural machine translation model that translates English → Turkish, trained with the Nematus toolkit on a ~142k-sentence news-domain parallel corpus using a joint 32k BPE subword vocabulary.
This is the RNN baseline (reverse direction) for the machine translation models collection. Siblings:
the stronger Transformer atahanuz/transformers-translator-en-tr-75M
and the forward RNN atahanuz/rnn-translator-tr-en-63M.
All four share the same data and the same joint BPE model.
| Toolkit | Nematus (TensorFlow), commit 49d050863bc9644b8c0a9d9ab6e54ccd30f927dd |
| Architecture | Attentional RNN — single-layer bi-GRU encoder, single-layer GRU decoder with attention (conditional GRU, dec_base_transition_depth=2) |
| Direction | English (en) → Turkish (tr) |
| Embedding size | 512 |
| Hidden / state size | 1000 |
| Dropout | none (0.0) |
| Embedding tying | none (untied) |
| Subword model | joint 32k BPE (subword-nmt) |
| Vocab caps | source 18,000 / target 24,000 |
| Parameters | ~63M |
mt_datasets_vol2 — 144,065 English–Turkish sentence pairs (news / current affairs).tokenizer.perl -l <lang> -no-escape.(BPE is identical across all four models — it is architecture- and direction-independent.)
maxlen 120, label smoothing 0.0.BLEU via multi-bleu.perl on the merged-BPE (Moses-tokenized) hypothesis vs the tokenized reference; beam 12, length-normalized.
Architecture × direction matrix (same 1,000 mirrored test pairs):
| Architecture | TR → EN | EN → TR |
|---|---|---|
| Transformer (~75M) | 42.78 | 42.04 |
| RNN (~63M) | 35.10 | 33.93 |
This model = RNN EN→TR = 33.93 (n-gram 60.1 / 39.6 / 27.9 / 20.0, BP 1.00). The Transformer beats the RNN by ~7–8 BLEU; Turkish-target (→TR) is the slightly harder direction for both architectures (agglutinative morphology).
Example
| English (input) | Model output | Reference |
|---|---|---|
The US Embassy in Bosnia and Herzegovina welcomed the offer to send soldiers to Iraq. | ABD'nin Bosna-Hersek Büyükelçiliği Irak'a asker gönderme teklifini memnuniyetle karşıladı. | ABD'nin BH Büyükelçiliği Irak'a asker gönderme teklifini memnuniyetle karşıladı. |
model.npz.* — Nematus/TensorFlow checkpoint (best-validation, update 24,400).train.bpe.en.json, train.bpe.tr.json — Nematus source/target vocabularies (referenced by model.npz.json).tr-en.bpe.codes, vocab.tr, vocab.en — the joint BPE model, used to segment new input.nematus_tf220_compat.patch — makes Nematus run on TensorFlow ≥ 2.16 / NumPy ≥ 2 / Python 3.12.git clone https://github.com/EdinburghNLP/nematus.git
cd nematus && git checkout 49d050863bc9644b8c0a9d9ab6e54ccd30f927dd
git apply /path/to/nematus_tf220_compat.patch
pip install "tensorflow>=2.16" "numpy>=2" subword-nmt sacremoses
cd ..
# 0. download this model
python3 -c "from huggingface_hub import snapshot_download; \
snapshot_download('atahanuz/rnn-translator-en-tr-63M', local_dir='en_tr_rnn')"
# 1. preprocess an English input file (one sentence per line)
perl nematus/data/tokenizer.perl -l en -no-escape < input.en > input.tok.en
subword-nmt apply-bpe -c en_tr_rnn/tr-en.bpe.codes < input.tok.en > input.bpe.en
# 2. translate — run from the model dir so the dict paths in model.npz.json resolve
cd en_tr_rnn
python3 ../nematus/nematus/translate.py -m model.npz -i ../input.bpe.en -o ../out.bpe.tr -k 12 -n -b 50
cd ..
# 3. postprocess: undo BPE, then detokenize (Turkish)
sed -E 's/(@@ )|(@@ ?$)//g' out.bpe.tr > out.tok.tr
python3 - <<'EOF'
import re
from sacremoses import MosesDetokenizer
d = MosesDetokenizer(lang='tr')
for line in open('out.tok.tr', encoding='utf-8'):
print(re.sub(r"\s*'\s*", "'", d.detokenize(line.split()))) # join Turkish suffix apostrophes
EOF
multi-bleu.perl BLEU — for citable numbers use sacreBLEU on detokenized output.cc-by-4.0 placeholder — set to match your training-data terms.
Nematus; subword-nmt. GRU attentional NMT: Bahdanau et al. (2015) / Sennrich et al. (Nematus).