emanuelaboros commited on
Commit
ac886a9
·
1 Parent(s): 464c568

update app

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -23,11 +23,11 @@ def prepare_entities_for_highlight(text, results):
23
  for entity in entity_list:
24
  # Appending each entity's word, start and end for highlighting, including the entity label and score
25
  entities.append(
26
- (
27
- entity["start"],
28
- entity["end"],
29
- f"{entity['entity']} ({entity['score']:.2f}%)",
30
- )
31
  )
32
 
33
  return {"text": text, "entities": entities}
@@ -60,9 +60,10 @@ def ner_app_interface():
60
  "In the year 1789, King Louis XVI, ruler of France, convened the Estates-General at the Palace of Versailles."
61
  ]
62
  ],
 
63
  )
64
 
65
- interface.launch()
66
 
67
 
68
  # Run the app
 
23
  for entity in entity_list:
24
  # Appending each entity's word, start and end for highlighting, including the entity label and score
25
  entities.append(
26
+ {
27
+ "start": entity["start"],
28
+ "end": entity["end"],
29
+ "label": f"{entity['entity']} ({entity['score']:.2f}%)",
30
+ }
31
  )
32
 
33
  return {"text": text, "entities": entities}
 
60
  "In the year 1789, King Louis XVI, ruler of France, convened the Estates-General at the Palace of Versailles."
61
  ]
62
  ],
63
+ live=False,
64
  )
65
 
66
+ interface.launch(share=True)
67
 
68
 
69
  # Run the app