diff --git a/flair/embeddings.py b/flair/embeddings.py index 936ae5a34d..b5fce0d5ab 100644 --- a/flair/embeddings.py +++ b/flair/embeddings.py @@ -738,6 +738,15 @@ def __init__(self, model: str, use_cache: bool = False, cache_directory: Path = base_path = 'https://s3.eu-central-1.amazonaws.com/alan-nlp/resources/embeddings-v0.4/language_model_es_backward_long/lm-es-backward.pt' model = cached_path(base_path, cache_dir=cache_dir) + # Pubmed forward + elif model.lower() == 'pubmed-forward': + base_path = 'https://s3.eu-central-1.amazonaws.com/alan-nlp/resources/embeddings-v0.4.1/pubmed-2015-fw-lm.pt' + model = cached_path(base_path, cache_dir=cache_dir) + # Spanish backward + elif model.lower() == 'pubmed-backward': + base_path = 'https://s3.eu-central-1.amazonaws.com/alan-nlp/resources/embeddings-v0.4.1/pubmed-2015-bw-lm.pt' + model = cached_path(base_path, cache_dir=cache_dir) + elif not Path(model).exists(): raise ValueError(f'The given model "{model}" is not available or is not a valid path.')