emanuelaboros commited on
Commit
34f241e
·
verified ·
1 Parent(s): fbdf934

Update generic_ner.py

Browse files
Files changed (1) hide show
  1. generic_ner.py +1 -3
generic_ner.py CHANGED
@@ -107,14 +107,12 @@ def get_entities(tokens, tags, confidences, text):
107
  {
108
  "entity": original_label,
109
  "score": np.average(confidences[idx : idx + len(subtree)]),
110
- "index": idx,
111
  "word": original_string,
112
  "start": entity_start_position,
113
  "end": entity_end_position,
114
- "text": text
115
  }
116
  )
117
- print(text[entity_start_position:entity_end_position], '-------', original_string)
118
  # assert (
119
  # text[entity_start_position:entity_end_position] == original_string
120
  # )
 
107
  {
108
  "entity": original_label,
109
  "score": np.average(confidences[idx : idx + len(subtree)]),
110
+ "index": (idx, idx + len(subtree)),
111
  "word": original_string,
112
  "start": entity_start_position,
113
  "end": entity_end_position,
 
114
  }
115
  )
 
116
  # assert (
117
  # text[entity_start_position:entity_end_position] == original_string
118
  # )