Jacobo commited on
Commit
15ffe15
·
verified ·
1 Parent(s): 4869be9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
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, pipe in ner.pipeline:
29
- nlp.add_pipe(pipe, name=pipe_name, source=ner)
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):