Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,9 +39,11 @@ if Run_Button == True:
|
|
| 39 |
ner_pipeline, id2label = setModel(model_checkpoint, aggregation)
|
| 40 |
output = ner_pipeline(input_text)
|
| 41 |
|
|
|
|
|
|
|
| 42 |
output_new = []
|
| 43 |
for o in output:
|
| 44 |
-
o["entity_group"] = id2label[o["entity_group"].split("_")[-1]]
|
| 45 |
output_new.append(o)
|
| 46 |
|
| 47 |
df = pd.DataFrame.from_dict(output_new)
|
|
|
|
| 39 |
ner_pipeline, id2label = setModel(model_checkpoint, aggregation)
|
| 40 |
output = ner_pipeline(input_text)
|
| 41 |
|
| 42 |
+
print(id2label)
|
| 43 |
+
|
| 44 |
output_new = []
|
| 45 |
for o in output:
|
| 46 |
+
o["entity_group"] = id2label[str(o["entity_group"].split("_")[-1])]
|
| 47 |
output_new.append(o)
|
| 48 |
|
| 49 |
df = pd.DataFrame.from_dict(output_new)
|