Add files
Signed-off-by: András Schmelczer <andras@schmelczer.dev>
This commit is contained in:
commit
889e79174b
103 changed files with 24322 additions and 0 deletions
21
good_ai/src/sus/nlp.py
Normal file
21
good_ai/src/sus/nlp.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
try:
|
||||
import en_core_web_lg
|
||||
except ImportError:
|
||||
import subprocess
|
||||
|
||||
print("Spacy model en_core_web_lg not found locally, downloading...")
|
||||
|
||||
subprocess.call(
|
||||
[
|
||||
"pip",
|
||||
"install",
|
||||
"https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.2.0/en_core_web_lg-3.2.0-py3-none-any.whl",
|
||||
]
|
||||
)
|
||||
import en_core_web_lg
|
||||
|
||||
from .external.negspacy import negation # noqa: F401 it's important to import this
|
||||
|
||||
nlp = en_core_web_lg.load()
|
||||
|
||||
nlp.add_pipe("negex")
|
||||
Loading…
Add table
Add a link
Reference in a new issue