Emanuela Boros
commited on
Commit
·
3211c85
1
Parent(s):
786620d
update for visualization
Browse files
app.py
CHANGED
@@ -17,9 +17,13 @@ get_completion = pipeline(
|
|
17 |
|
18 |
|
19 |
def ner(input):
|
20 |
-
|
21 |
-
print(
|
22 |
-
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
demo = gr.Interface(
|
|
|
17 |
|
18 |
|
19 |
def ner(input):
|
20 |
+
entities = get_completion(input)
|
21 |
+
print(entities)
|
22 |
+
for entity in entities:
|
23 |
+
entity["entity"] = entity["type"]
|
24 |
+
entity.pop("type")
|
25 |
+
print("After:", entities)
|
26 |
+
return {"text": input, "entities": entities}
|
27 |
|
28 |
|
29 |
demo = gr.Interface(
|