Emanuela Boros commited on
Commit
3211c85
·
1 Parent(s): 786620d

update for visualization

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -17,9 +17,13 @@ get_completion = pipeline(
17
 
18
 
19
  def ner(input):
20
- output = get_completion(input)
21
- print(output)
22
- return {"text": input, "entities": output}
 
 
 
 
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(