Basque_EU_Euskera_Translator / helsinki_models.py
AItool's picture
Update helsinki_models.py
947679a verified
# Scraped from https://huggingface.co/Helsinki-NLP
# Scrape code:
# console.log(Array.from(document.getElementsByClassName("text-md truncate font-mono text-black dark:group-hover/repo:text-yellow-500 group-hover/repo:text-indigo-600 text-smd")).map(element => element.innerHTML));
helsinki_models = [
"Helsinki-NLP/opus-mt-tc-big-eu-itc",
"Helsinki-NLP/opus-mt-euq-en",
"Helsinki-NLP/opus-mt-eu-ru",
"Helsinki-NLP/opus-mt-eu-es",
"Helsinki-NLP/opus-mt-eu-en",
"Helsinki-NLP/opus-mt-eu-de",
"Helsinki-NLP/opus-mt-en-euq",
"Helsinki-NLP/opus-mt-en-euq",
"Helsinki-NLP/opus-mt-en-eu",
"Helsinki-NLP/opus-mt-de-eu",
"Helsinki-NLP/opus-mt-ru-eu",
"Helsinki-NLP/opus-mt-es-eu"
]
def get_clearly_formatted_language_directions():
# Clearly formatted language directions only
# Helsinki-NLP/opus-mt-tc-base-bat-zle is ignored
# Helsinki-NLP/opus-mt-tc-fr-en is accepted due to clarity of source language being fr and target language being en
language_directions = [model.split("Helsinki-NLP/opus-mt-")[1] for model in helsinki_models
if (len(model.split("-"))<6 and
"opus-mt" in model and
len(model.split("_")) == 1)
and len(model) < len("Helsinki-NLP/opus-mt-src-trg")]
return language_directions