DD0101 commited on
Commit
66db8e5
1 Parent(s): a50611e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -59,6 +59,10 @@ def ner(text):
59
  output = my_classifier(text)
60
  for entity in output:
61
  entity['entity'] = entity.pop('entity_group')
 
 
 
 
62
 
63
  return {'text': text, 'entities': output}
64
 
@@ -70,7 +74,7 @@ examples = ['Tôi cần thuê à tôi muốn bay một chuyến khứ hồi từ
70
  ]
71
 
72
  demo = gr.Interface(ner,
73
- gr.Textbox(label='Text', placeholder="Enter sentence here..."),
74
  outputs=gr.HighlightedText(label='Highlighted Output'),
75
  examples=examples,
76
  title="Disfluency Detection",
 
59
  output = my_classifier(text)
60
  for entity in output:
61
  entity['entity'] = entity.pop('entity_group')
62
+
63
+ text = text.replace("_", " ")
64
+ text = text.replace(" , ", ", ").replace(" . ", ". ")
65
+
66
 
67
  return {'text': text, 'entities': output}
68
 
 
74
  ]
75
 
76
  demo = gr.Interface(ner,
77
+ gr.Textbox(label='Sentence', placeholder="Enter your sentence here..."),
78
  outputs=gr.HighlightedText(label='Highlighted Output'),
79
  examples=examples,
80
  title="Disfluency Detection",