Skip to content

Commit

Permalink
Merge pull request #519 from zalandoresearch/GH-518-pubmed-flair
Browse files Browse the repository at this point in the history
Added PubMed embeddings computed by @jessepeng
  • Loading branch information
Alan Akbik authored Feb 19, 2019
2 parents 4d4a3a4 + cb0a2d1 commit aaa8a2f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flair/embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.')

Expand Down

0 comments on commit aaa8a2f

Please # to comment.