Changed keyerror. Replaced index with end and entity with entity_group
#1
by
Shashank14
- opened
README.md
CHANGED
|
@@ -47,12 +47,12 @@ def clean_output(outputs):
|
|
| 47 |
last_idx = 0
|
| 48 |
# make to sub group by position
|
| 49 |
for output in outputs:
|
| 50 |
-
if output["
|
| 51 |
current.append(output)
|
| 52 |
else:
|
| 53 |
results.append(current)
|
| 54 |
current = [output, ]
|
| 55 |
-
last_idx = output["
|
| 56 |
if len(current)>0:
|
| 57 |
results.append(current)
|
| 58 |
|
|
@@ -72,7 +72,7 @@ def clean_output(outputs):
|
|
| 72 |
word=new_str,
|
| 73 |
start = min(starts),
|
| 74 |
end = max(ends),
|
| 75 |
-
entity = c[0]['
|
| 76 |
))
|
| 77 |
return strings
|
| 78 |
def entity_table(pipeline, **pipeline_kw):
|
|
|
|
| 47 |
last_idx = 0
|
| 48 |
# make to sub group by position
|
| 49 |
for output in outputs:
|
| 50 |
+
if output["end"]-1==last_idx:
|
| 51 |
current.append(output)
|
| 52 |
else:
|
| 53 |
results.append(current)
|
| 54 |
current = [output, ]
|
| 55 |
+
last_idx = output["end"]
|
| 56 |
if len(current)>0:
|
| 57 |
results.append(current)
|
| 58 |
|
|
|
|
| 72 |
word=new_str,
|
| 73 |
start = min(starts),
|
| 74 |
end = max(ends),
|
| 75 |
+
entity = c[0]['entity_group']
|
| 76 |
))
|
| 77 |
return strings
|
| 78 |
def entity_table(pipeline, **pipeline_kw):
|