CoolFace
Modelpublic

AOZ2025/Machine-Translation-English-To-French

sourceHugging Facemitupdated 11mo agoView on Hugging Face
0likes
Model Card

๐Ÿง  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

python
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.