Spaces:
Sleeping
Sleeping
File size: 444 Bytes
93f6be7 482f94f 93f6be7 482f94f 93f6be7 482f94f 93f6be7 482f94f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
from transformers import pipeline
pipeline = pipeline("text-classification" , model = "ProsusAI/finbert")
def predict(input_text):
predictions = pipeline(input_text )
print(predictions)
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() |