Skip to content

Commit

Permalink
Merge pull request #3505 from flairNLP/update_models_for_v14
Browse files Browse the repository at this point in the history
Update models for v0.14.0
  • Loading branch information
alanakbik committed Jul 23, 2024
2 parents d94b890 + fc94c51 commit 832f56e
Showing 1 changed file with 10 additions and 42 deletions.
52 changes: 10 additions & 42 deletions flair/models/sequence_tagger_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,6 @@ def _fetch_model(model_name) -> str:
"chunk": "flair/chunk-english",
"chunk-fast": "flair/chunk-english-fast",
# Language-specific NER models
"ar-ner": "megantosh/flair-arabic-multi-ner",
"ar-pos": "megantosh/flair-arabic-dialects-codeswitch-egy-lev",
"da-ner": "flair/ner-danish",
"de-ner": "flair/ner-german",
"de-ler": "flair/ner-german-legal",
Expand All @@ -691,37 +689,13 @@ def _fetch_model(model_name) -> str:
}

hu_path: str = "https://nlp.informatik.hu-berlin.de/resources/models"
hunflair_paper_path = hu_path + "/hunflair_smallish_models"
hunflair_main_path = hu_path + "/hunflair_allcorpus_models"

hu_model_map = {
# English NER models
"ner": "/".join([hu_path, "ner", "en-ner-conll03-v0.4.pt"]),
"ner-pooled": "/".join([hu_path, "ner-pooled", "en-ner-conll03-pooled-v0.5.pt"]),
"ner-fast": "/".join([hu_path, "ner-fast", "en-ner-fast-conll03-v0.4.pt"]),
"ner-ontonotes": "/".join([hu_path, "ner-ontonotes", "en-ner-ontonotes-v0.4.pt"]),
"ner-ontonotes-fast": "/".join([hu_path, "ner-ontonotes-fast", "en-ner-ontonotes-fast-v0.4.pt"]),
# Multilingual NER models
"ner-multi": "/".join([hu_path, "multi-ner", "quadner-large.pt"]),
"multi-ner": "/".join([hu_path, "multi-ner", "quadner-large.pt"]),
"ner-multi-fast": "/".join([hu_path, "multi-ner-fast", "ner-multi-fast.pt"]),
# English POS models
"upos": "/".join([hu_path, "upos", "en-pos-ontonotes-v0.4.pt"]),
"upos-fast": "/".join([hu_path, "upos-fast", "en-upos-ontonotes-fast-v0.4.pt"]),
"pos": "/".join([hu_path, "pos", "en-pos-ontonotes-v0.5.pt"]),
"pos-fast": "/".join([hu_path, "pos-fast", "en-pos-ontonotes-fast-v0.5.pt"]),
# Multilingual POS models
"pos-multi": "/".join([hu_path, "multi-pos", "pos-multi-v0.1.pt"]),
"multi-pos": "/".join([hu_path, "multi-pos", "pos-multi-v0.1.pt"]),
"pos-multi-fast": "/".join([hu_path, "multi-pos-fast", "pos-multi-fast.pt"]),
"multi-pos-fast": "/".join([hu_path, "multi-pos-fast", "pos-multi-fast.pt"]),
# English SRL models
"frame": "/".join([hu_path, "frame", "en-frame-ontonotes-v0.4.pt"]),
"frame-fast": "/".join([hu_path, "frame-fast", "en-frame-ontonotes-fast-v0.4.pt"]),
"frame-large": "/".join([hu_path, "frame-large", "frame-large.pt"]),
# English chunking models
"chunk": "/".join([hu_path, "chunk", "en-chunk-conll2000-v0.4.pt"]),
"chunk-fast": "/".join([hu_path, "chunk-fast", "en-chunk-conll2000-fast-v0.4.pt"]),
# Danish models
"da-pos": "/".join([hu_path, "da-pos", "da-pos-v0.1.pt"]),
"da-ner": "/".join([hu_path, "NER-danish", "da-ner-v0.1.pt"]),
Expand All @@ -730,13 +704,14 @@ def _fetch_model(model_name) -> str:
"de-pos-tweets": "/".join([hu_path, "de-pos-tweets", "de-pos-twitter-v0.1.pt"]),
"de-ner": "/".join([hu_path, "de-ner", "de-ner-conll03-v0.4.pt"]),
"de-ner-germeval": "/".join([hu_path, "de-ner-germeval", "de-ner-germeval-0.4.1.pt"]),
"de-ler": "/".join([hu_path, "de-ner-legal", "de-ner-legal.pt"]),
"de-ner-legal": "/".join([hu_path, "de-ner-legal", "de-ner-legal.pt"]),
# Arabic models
"ar-ner": "/".join([hu_path, "arabic", "ar-ner.pt"]),
"ar-pos": "/".join([hu_path, "arabic", "ar-pos.pt"]),
# French models
"fr-ner": "/".join([hu_path, "fr-ner", "fr-ner-wikiner-0.4.pt"]),
# Dutch models
"nl-ner": "/".join([hu_path, "nl-ner", "nl-ner-bert-conll02-v0.8.pt"]),
"nl-ner-rnn": "/".join([hu_path, "nl-ner-rnn", "nl-ner-conll02-v0.5.pt"]),
"nl-ner-rnn": "/".join([hu_path, "nl-ner-rnn", "nl-ner-conll02-v0.14.0.pt"]),
# Malayalam models
"ml-pos": "https://raw.githubusercontent.com/qburst/models-repository/master/FlairMalayalamModels/malayalam-xpos-model.pt",
"ml-upos": "https://raw.githubusercontent.com/qburst/models-repository/master/FlairMalayalamModels/malayalam-upos-model.pt",
Expand All @@ -748,20 +723,13 @@ def _fetch_model(model_name) -> str:
"pucpr-flair-clinical-pos-tagging-best-model.pt",
]
),
# Keyphase models
"keyphrase": "/".join([hu_path, "keyphrase", "keyphrase-en-scibert.pt"]),
"negation-speculation": "/".join([hu_path, "negation-speculation", "negation-speculation-model.pt"]),
"negation-speculation": "/".join([hu_path, "negation-speculation-v14", "negation-speculation-v0.14.0.pt"]),
# Biomedical models
"hunflair-paper-cellline": "/".join([hunflair_paper_path, "cellline", "hunflair-celline-v1.0.pt"]),
"hunflair-paper-chemical": "/".join([hunflair_paper_path, "chemical", "hunflair-chemical-v1.0.pt"]),
"hunflair-paper-disease": "/".join([hunflair_paper_path, "disease", "hunflair-disease-v1.0.pt"]),
"hunflair-paper-gene": "/".join([hunflair_paper_path, "gene", "hunflair-gene-v1.0.pt"]),
"hunflair-paper-species": "/".join([hunflair_paper_path, "species", "hunflair-species-v1.0.pt"]),
"hunflair-cellline": "/".join([hunflair_main_path, "cellline", "hunflair-celline-v1.0.pt"]),
"hunflair-chemical": "/".join([hunflair_main_path, "huner-chemical", "hunflair-chemical-full-v1.0.pt"]),
"hunflair-disease": "/".join([hunflair_main_path, "huner-disease", "hunflair-disease-full-v1.0.pt"]),
"hunflair-gene": "/".join([hunflair_main_path, "huner-gene", "hunflair-gene-full-v1.0.pt"]),
"hunflair-species": "/".join([hunflair_main_path, "huner-species", "hunflair-species-full-v1.1.pt"]),
"hunflair-cellline": "/".join([hunflair_main_path, "huner-cellline", "hunflair-cellline.pt"]),
"hunflair-chemical": "/".join([hunflair_main_path, "huner-chemical", "hunflair-chemical.pt"]),
"hunflair-disease": "/".join([hunflair_main_path, "huner-disease", "hunflair-disease.pt"]),
"hunflair-gene": "/".join([hunflair_main_path, "huner-gene", "hunflair-gene.pt"]),
"hunflair-species": "/".join([hunflair_main_path, "huner-species", "hunflair-species.pt"]),
}

cache_dir = Path("models")
Expand Down

0 comments on commit 832f56e

Please sign in to comment.