-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Increase versions, speed & update model downloading (#10)
Co-authored-by: Nicolas Dalsass <nicolasdalsass@users.noreply.github.com> - Move FLAIR to resources_init & make non-en spaCy models optional - Upgrade to spaCy 3 & increment plugin version - Disable unused pipeline algos - divides recipe time roughly by two - Allow multi-cpu processing - on a 8 core machine, divives recipe time roughly by 3
- Loading branch information
1 parent
6fb143e
commit 99cdf91
Showing
11 changed files
with
84 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
torch==1.6.0 | ||
flair==0.6.1 | ||
flair==0.11.3 | ||
flask>=2.0,<2.1 | ||
gensim==3.8.0 | ||
flask>=1.0,<1.1 | ||
numpy==1.19.5 | ||
spacy[ja]==3.3.0 | ||
tokenizers==0.10.3; python_version == '3.6' | ||
sudachipy==0.6.0; python_version == '3.6' | ||
tqdm==4.50.0 | ||
spacy[ja]==2.3.2 | ||
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-2.3.1/es_core_news_sm-2.3.1.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/zh_core_web_sm-2.3.1/zh_core_web_sm-2.3.1.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/pl_core_news_sm-2.3.0/pl_core_news_sm-2.3.0.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/nb_core_news_sm-2.3.0/nb_core_news_sm-2.3.0.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-2.3.0/fr_core_news_sm-2.3.0.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-2.3.0/de_core_news_sm-2.3.0.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/ja_core_news_sm-2.3.0/ja_core_news_sm-2.3.0.tar.gz | ||
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.3.0/en_core_web_sm-3.3.0.tar.gz | ||
# https://github.com/explosion/spacy-models/releases/download/es_core_news_sm-3.3.0/es_core_news_sm-3.3.0.tar.gz | ||
# https://github.com/explosion/spacy-models/releases/download/zh_core_web_sm-3.3.0/zh_core_web_sm-3.3.0.tar.gz | ||
# https://github.com/explosion/spacy-models/releases/download/pl_core_news_sm-3.3.0/pl_core_news_sm-3.3.0.tar.gz | ||
# https://github.com/explosion/spacy-models/releases/download/nb_core_news_sm-3.3.0/nb_core_news_sm-3.3.0.tar.gz | ||
# https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.3.0/fr_core_news_sm-3.3.0.tar.gz | ||
# https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-3.3.0/de_core_news_sm-3.3.0.tar.gz | ||
# https://github.com/explosion/spacy-models/releases/download/ja_core_news_sm-3.3.0/ja_core_news_sm-3.3.0.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
######################## Base imports ################################# | ||
from dataiku.code_env_resources import clear_all_env_vars | ||
from dataiku.code_env_resources import set_env_path | ||
|
||
######################## Download FLAIR Models ########################### | ||
# Clear all environment variables defined by a previously run script | ||
clear_all_env_vars() | ||
|
||
# Set Flair cache directory | ||
set_env_path("FLAIR_CACHE_ROOT", "flair") | ||
|
||
from flair.models import SequenceTagger | ||
|
||
# Download pretrained model: automatically managed by Flair, | ||
# does not download anything if model is already in FLAIR_CACHE_ROOT | ||
SequenceTagger.load('flair/ner-english-fast') | ||
# Add any other models you want to download, check https://huggingface.co/flair for examples | ||
# E.g. SequenceTagger.load('flair/ner-french') | ||
# Make sure to modify the model used in recipe.py if you want to use a different model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
python-runnables/named-entity-recognition-download/runnable.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.