TASK_1 / app.py
bobo-dada's picture
Update app.py
9ed15f8 verified
Raw
History Blame Contribute Delete
671 Bytes
from transformers import pipeline ##
import gradio as gr ## to get all librarioies
sentiment = pipeline("sentiment-analysis") ## this my model
def get_sentiment(text): ## this mt function at model
sent = sentiment(text)[0]['label']
score = sentiment(text)[0]['score']
return sent, score
interface = gr.Interface(fn = get_sentiment, inputs=gr.Textbox(label="Enter the review"), outputs = [gr.Textbox(label = "Sentiment :"), gr.Textbox(label = "Score :")])
## my interface app to use my function
if __name__ =="__main__": ## running my app on hugging face
interface.launch()