Create app.py
Browse files12345678910111213import gradio as grfrom transformers import pipelinefrom transformers import AutoTokenizer, AutoModelForSequenceClassification
#Defining the classify function which takes text as input and returns the label of the sentimentdef classify(text): # Initializing the pipeline for sentiment analysis cls = pipeline('text-classification', model='RJuro/dk_emotion_bert_in_class') # Predicting the sentiment label for the input text return cls(text)[0]['label']
#Creating the Gradio interface with input textbox and output textgr.Interface(fn=classify, inputs=["textbox"], outputs="text").launch()app.pyAdded+13