wiraindrak commited on
Commit
53c2635
·
1 Parent(s): c0d80b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -1,7 +1,7 @@
1
  from transformers import pipeline
2
 
3
  import gradio as gr
4
- from gradio.mix import Parallel
5
 
6
  pretrained_sentiment = "w11wo/indonesian-roberta-base-sentiment-classifier"
7
  pretrained_ner = "cahya/bert-base-indonesian-NER"
@@ -33,16 +33,14 @@ def ner(text):
33
  return {"text": text, "entities": output}
34
 
35
  sentiment_demo = gr.Interface(
36
- fn=sentiment_analysis,
37
- inputs=gr.Textbox(placeholder="Enter a sentence here..."),
38
  outputs="label",
39
- interpretation="default",
40
- examples=[examples])
41
 
42
  ner_demo = gr.Interface(ner,
43
- gr.Textbox(placeholder="Enter sentence here..."),
44
- gr.HighlightedText(),
45
- examples=examples)
46
 
47
  if __name__ == "__main__":
48
- Parallel(sentiment_demo, ner_demo).launch()
 
 
 
1
  from transformers import pipeline
2
 
3
  import gradio as gr
4
+ from gradio.mix import Series
5
 
6
  pretrained_sentiment = "w11wo/indonesian-roberta-base-sentiment-classifier"
7
  pretrained_ner = "cahya/bert-base-indonesian-NER"
 
33
  return {"text": text, "entities": output}
34
 
35
  sentiment_demo = gr.Interface(
36
+ fn=sentiment_analysis,
 
37
  outputs="label",
38
+ interpretation="default")
 
39
 
40
  ner_demo = gr.Interface(ner,
41
+ gr.HighlightedText())
 
 
42
 
43
  if __name__ == "__main__":
44
+ Series(sentiment_demo, ner_demo,
45
+ inputs=gr.Textbox(placeholder="Enter sentence here..."),
46
+ examples=[examples]).launch()