Spaces:
Sleeping
Sleeping
Update ner_tool.py
Browse files- 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"):
|