Application of NMT+Word alignment models for cross-lingual lexical substitution task
pip install -r requirements.txt
bash init.sh
- For example
from nmt import NMT_easy
model_name = 'opus-mt' # see https://github.com/UKPLab/EasyNMT
language = 'es'
outpath = 'test.csv'
nmt_model = NMT_easy(model_name)
nmt_semeval2010_2 = nmt_model.make_nmt(<your_df: pd.DataFrame>, language, outpath)
- Or
python3 nmt.py --df_path <path_to_df> --language <your_language> --model_name <nmt_model_name>
- For example
from alignments import Alignments
alignment_models = Alignments()
positions1, spanish_tws1 = alignment_models.model_1(df)
positions2, spanish_tws2 = alignment_models.model_2(df)