Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature/adding scispacy version number #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cv_py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import scispacy

__title__ = "cv-py"

__scispacy_version__ = scispacy.__version__

__compatible__ = {
"cord19_cdcs": "~0.2.3",
"en_core_sci_sm": __scispacy_version__,
"en_core_sci_md": __scispacy_version__,
"en_core_sci_lg": __scispacy_version__,
"en_ner_craft_md": __scispacy_version__,
"en_ner_jnlpba_md": __scispacy_version__,
"en_ner_bc5cdr_md": __scispacy_version__,
"en_ner_bionlp13cg_md": __scispacy_version__,
"en_core_sci_scibert": __scispacy_version__
}
__release__ = True
15 changes: 3 additions & 12 deletions cv_py/resources/datapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import subprocess
import sys
from cv_py import __compatible__
from cv_py import __compatible__, __scispacy_version__
import argparse
import re
from pathlib import Path
Expand All @@ -15,7 +15,6 @@
import requests
import semantic_version as sv


__all__ = ["load"]


Expand All @@ -40,17 +39,9 @@ def get_filename(datapackage="cord19_cdcs"):
f"https://github.com/{repo}/releases/download/v{v}/cord19-cdcs-{v}.tar.gz"
)
return fname
elif datapackage in [ # Sci-spaCy
"en_core_sci_sm",
"en_core_sci_md",
"en_core_sci_lg",
"en_ner_craft_md",
"en_ner_jnlpba_md",
"en_ner_bc5cdr_md",
"en_ner_bionlp13cg_md",
]:
else:
fname = (
f"https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v0.2.4/{datapackage}-0.2.4.tar.gz"
f"https://s3-us-west-2.amazonaws.com/ai2-s2-scispacy/releases/v{__scispacy_version__}/{datapackage}-{__scispacy_version__}.tar.gz"
)
return fname

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ pyarrow = "^3.0.0"
scikit-learn = "^0.24.1"
dask = {extras = ["complete"], version = "^2.13.0"}

#necessary to download the correct scispacy language models
scispacy = "^0.4.4"

# A list of optional dependencies, choosable by module
## Spacy ecosystem
textacy = { version = "^0.10.0", optional = true}
scispacy = { version = "^0.2.4", optional = true}

## flair ecosystem
flair = { version = "^0.4.5", optional = true}
Expand Down