Dyula to French Translation
---
language:
- dy
- fr
- multilingual
tags:
- translation
- pytorch
model-index:
- name: Koleshjr/dyu-fr-joeynmt-316-epochs_2_layers_5heads_128_300_plateau_2000_7_45_20_93
results: [0.2347]
- name: Koleshjr/dyu-fr-joeynmt-316-epochs_2_layers_8heads_128_384_plateau_2000_7_95_21_48
results: [0.2363]
---
# koleshjr/dyu-fr-joeynmt
An example of a machine translation model that translates Dyula to French using the JoeyNMT framework.
This following example is based on this Github repo that was kindly created by data354.
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Usage
### Load and use for inference
```python
import torch
from joeynmt.config import load_config, parse_global_args
from joeynmt.prediction import predict, prepare
from huggingface_hub import snapshot_download
# Download model
snapshot_download(
repo_id="Koleshjr/dyu-fr-joeynmt-316-epochs_2_layers_5heads_128_300_plateau_2000_7_45_20_93",
local_dir="/path/to/save/locally"
)
# Define model interface
class JoeyNMTModel:
'''
JoeyNMTModel which load JoeyNMT model for inference.
:param config_path: Path to YAML config file
:param n_best: return this many hypotheses, list:
'''
Translate the given sentence.
:param sentence: Sentence to be translated
:return:
- translations: (list of str) possible translations of the sentence.
'''
self.test_data.set_item(sentence.strip())
translations, _, _ = self._translate_data()
assert len(translations) == len(self.test_data) * self.args.test.n_best
self.test_data.reset_cache()
return translations
# Load model
config_path = "/path/to/lean_model/config_local.yaml" # Change this to the path to your model congig file
model = JoeyNMTModel(config_path=config_path, n_best=1)
# Translate
model.translate(sentence="i tɔgɔ bi cogodɔ")
```
## Training procedure
### Training hyperpa …