π§ English β French Translation Model
This model translates English sentences into French.
It was trained on custom data using a Seq2Seq Transformer architecture in PyTorch.
π Usage
import torch
model = TransformerMT(
vocab_size_src=VOCAB_SIZE,
vocab_size_tgt=VOCAB_SIZE,
d_model=D_MODEL,
n_layers=NUM_LAYERS,
n_heads=N_HEADS,
d_ff=D_FF,
dropout=DROPOUT
)
ckpt = torch.load(transformer_en_fr.pth, map_location=DEVICE)
model.load_state_dict(ckpt["model"])
model.eval()
sentence = "how are you today"
output = beam_search(model, sentence, beam_size=4, max_len=100)
print(output)
π Files
transformer_en_fr.pthβ trained model checkpoint
π License
MIT License
π€ Author
Ahmed Osama Zahran Trained and published as part of a personal NLP project.