Spaces:
Running
Running
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() |