Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,9 +25,10 @@ nlp = spacy.load(spacy_model)
|
|
| 25 |
# Add the NER pipeline from grc_ner_trf if the selected model is grc_proiel_trf or grc_perseus_trf
|
| 26 |
if spacy_model in ["grc_proiel_trf", "grc_perseus_trf"]:
|
| 27 |
ner = spacy.load("grc_ner_trf")
|
| 28 |
-
for pipe_name
|
| 29 |
-
|
| 30 |
-
|
|
|
|
| 31 |
doc = nlp(text)
|
| 32 |
|
| 33 |
def get_html(html: str):
|
|
|
|
| 25 |
# Add the NER pipeline from grc_ner_trf if the selected model is grc_proiel_trf or grc_perseus_trf
|
| 26 |
if spacy_model in ["grc_proiel_trf", "grc_perseus_trf"]:
|
| 27 |
ner = spacy.load("grc_ner_trf")
|
| 28 |
+
for pipe_name in ner.pipe_names:
|
| 29 |
+
if pipe_name not in nlp.pipe_names:
|
| 30 |
+
nlp.add_pipe(pipe_name, source=ner)
|
| 31 |
+
|
| 32 |
doc = nlp(text)
|
| 33 |
|
| 34 |
def get_html(html: str):
|