mohd43's picture
Update app.py
7f61b34 verified
raw
history blame
No virus
443 Bytes
from transformers import pipeline
import gradio as gr
pipeline = pipeline("text-classification" , model = "ProsusAI/finbert")
def predict(input_text):
predictions = pipeline(input_text )
return predictions[0]
gradio_app = gr.Interface(
predict,
inputs=gr.Textbox(label="Write a text"),
outputs=gr.Textbox(label="output a text"),
title="Financial Sentiment Analysis",
live=True,
allow_flagging="never",
)
gradio_app.launch()