vickeee465 commited on
Commit
b432ef9
·
1 Parent(s): e2f86d5
Files changed (1) hide show
  1. interfaces/ner.py +1 -1
interfaces/ner.py CHANGED
@@ -33,7 +33,7 @@ def named_entity_recognition(text, language):
33
  model_id = build_spacy_path(language)
34
  pipeline = huspacy.load() if model_id.startswith("hu") else spacy.load(model_id)
35
  doc = pipeline(text)
36
- entities = [{"entity":ent.label_, "start":ent.start_char, "end":ent.end_car} for ent in doc.ents]
37
  output = {"text":text, "entities":entities}
38
  model_id_hf = f"huspacy/{model_id}" if model_id.startswith("hu") else f"spacy/{model_id}"
39
  output_info = f'<p style="text-align: center; display: block">Prediction was made using the <a href="https://huggingface.co/{model_id_hf}">{model_id_hf}</a> model.</p>'
 
33
  model_id = build_spacy_path(language)
34
  pipeline = huspacy.load() if model_id.startswith("hu") else spacy.load(model_id)
35
  doc = pipeline(text)
36
+ entities = [{"entity":ent.label_, "start":ent.start_char, "end":ent.end_char} for ent in doc.ents]
37
  output = {"text":text, "entities":entities}
38
  model_id_hf = f"huspacy/{model_id}" if model_id.startswith("hu") else f"spacy/{model_id}"
39
  output_info = f'<p style="text-align: center; display: block">Prediction was made using the <a href="https://huggingface.co/{model_id_hf}">{model_id_hf}</a> model.</p>'