nadzo's picture
Update app.py
4c37e0c verified
raw
history blame
489 Bytes
import gradio as gr
from transformers import pipeline
# Use a financial/crypto-specific model
sentiment_pipeline = pipeline(
"sentiment-analysis",
model="mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis"
)
def analyze(text):
result = sentiment_pipeline(text)[0]
return f"{result['label']} (Confidence: {result['score']:.2f})"
gr.Interface(
fn=analyze,
inputs=gr.Textbox(placeholder="Enter crypto news headline..."),
outputs="text"
).launch()