Chris4K commited on
Commit
e607aa8
·
1 Parent(s): d25649c

Update ner_tool.py

Browse files
Files changed (1) hide show
  1. ner_tool.py +1 -2
ner_tool.py CHANGED
@@ -1,5 +1,3 @@
1
- # Updated NamedEntityRecognitionTool in ner_tool.py
2
-
3
  from transformers import pipeline
4
  from transformers import Tool
5
 
@@ -36,6 +34,7 @@ class NamedEntityRecognitionTool(Tool):
36
  start = entity.get("start", -1)
37
  end = entity.get("end", -1)
38
 
 
39
  entity_text = text[start:end].strip()
40
 
41
  if label.startswith("I-PER"):
 
 
 
1
  from transformers import pipeline
2
  from transformers import Tool
3
 
 
34
  start = entity.get("start", -1)
35
  end = entity.get("end", -1)
36
 
37
+ # Extract the complete entity text
38
  entity_text = text[start:end].strip()
39
 
40
  if label.startswith("I-PER"):