ganeshkamath89 commited on
Commit
4c721f6
1 Parent(s): fc788b6

changing the model, input examples and label

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -2,19 +2,19 @@ import gradio as gr
2
  from transformers import pipeline
3
 
4
  def generate_story(story):
5
- ner = pipeline("ner", model="dbmdz/bert-large-cased-finetuned-conll03-english")
6
  return str(ner(story))
7
 
8
  demo = gr.Interface (
9
  fn=generate_story,
10
- description="Named Entity Recognition Demo with BERT (dbmdz/bert-large-cased-finetuned-conll03-english)",
11
  examples=[
12
- ["England won the 2019 world cup vs The 2019 world cup happened in England."],
13
- ["Washington is the capital of the US vs The first president of the US was Washington."],
14
- ["My name is Ganesh Kamath and I work at AMD in Bangalore."]
15
  ],
16
  inputs=[gr.Textbox(lines=7, label="Text")],
17
- outputs=[gr.Textbox(lines=7, label="Story NER")]
18
  )
19
 
20
  demo.launch(share=True)
 
2
  from transformers import pipeline
3
 
4
  def generate_story(story):
5
+ ner = pipeline("text-classification", model="SamLowe/roberta-base-go_emotions")
6
  return str(ner(story))
7
 
8
  demo = gr.Interface (
9
  fn=generate_story,
10
+ description="Sentiment analysis multi-class with (SamLowe/roberta-base-go_emotions",
11
  examples=[
12
+ ["I am looking forward to a good maths session."],
13
+ ["Good that they broke up, not like it was going anywhere anyways."],
14
+ ["I am going to punch through his face next time he mentions notes!"]
15
  ],
16
  inputs=[gr.Textbox(lines=7, label="Text")],
17
+ outputs=[gr.Textbox(lines=7, label="Multiclass Sentiment Analysis")]
18
  )
19
 
20
  demo.launch(share=True)