TharinduDR / TransQuest

Transformer based translation quality estimation
Apache License 2.0
107 stars 16 forks source link

Loading Pre-trained models #9

Closed kpister closed 3 years ago

kpister commented 3 years ago

How do you load one of the pre-trained models? I've been able to run various trainings with the example scripts, but I'd like to try the pre-trained models to save some time.

If I understand correctly, when I set the MODEL_NAME and MODEL_TYPE, I'm only specifying the predictor and not the estimator itself, and the models linked above are the estimator models. Is that right?

Also, the pretrained models page mentions en-* and *-en models, but there aren't any links. Are those available?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

TharinduDR commented 3 years ago

Thank you very much for checking out TransQuest. Download the pretrained models and extract them. Then load them with the following code.

model = QuestModel("xlmroberta", path, num_labels=1, use_cuda=torch.cuda.is_available(), args=transformer_config)

"path" should be pointed to the directory where the files are.

You can download the multilingual model for sentence-level DA from this link - https://drive.google.com/file/d/1-DexYIw7m-9rDcBKVSrwQgLu0r-vCk6s/view?usp=sharing. If you are interested in the direction of the source and target, consider the following models too.

English to Any - https://drive.google.com/file/d/1-QDwFza-DRhiqGUHD1eQLJq-tVA9Lz0-/view?usp=sharing Any to English - https://drive.google.com/file/d/1-XQF3llRc0XTTaEePnfRW0grog0Y4BYu/view?usp=sharing

I have not yet updated the documents.

kpister commented 3 years ago

Thanks! I was able to get everything running with this advice.