File size: 488 Bytes
2b6e329
3dc3bad
3f7db2d
 
2b6e329
 
3dc3bad
 
2b6e329
 
 
 
 
5f0a36f
 
2b6e329
 
3dc3bad
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr

import transformers

from transformers import pipeline

sentiment= pipeline("sentiment-analysis")

def get_sentiment(input_text):
  texte= sentiment(input_text)
  result=texte[0]['label']
  return result

iface=gr.Interface(title='Sentiment Analysis',
                   fn=get_sentiment,
                       inputs='text',
                       outputs='text',
                       description="Get Sentiment Negative/Positive for giving input")
iface.launch()