Spaces:
Running
Running
vickeee465
commited on
Commit
·
dfd4863
1
Parent(s):
7ce342c
huspacy
Browse files- interfaces/ner.py +1 -1
interfaces/ner.py
CHANGED
@@ -30,7 +30,7 @@ def build_spacy_path(language: str):
|
|
30 |
|
31 |
def named_entity_recognition(text, language):
|
32 |
model_id = build_spacy_path(language)
|
33 |
-
pipeline = spacy.load(model_id)
|
34 |
doc = pipeline(text)
|
35 |
entities = [(ent.text, ent.label_) for ent in doc.ents]
|
36 |
model_id_hf = f"huspacy/{model_id}" if model_id.startswith("hu") else f"spacy/{model_id}"
|
|
|
30 |
|
31 |
def named_entity_recognition(text, language):
|
32 |
model_id = build_spacy_path(language)
|
33 |
+
pipeline = huspacy.load() if model_id.startswith("hu") else spacy.load(model_id)
|
34 |
doc = pipeline(text)
|
35 |
entities = [(ent.text, ent.label_) for ent in doc.ents]
|
36 |
model_id_hf = f"huspacy/{model_id}" if model_id.startswith("hu") else f"spacy/{model_id}"
|