Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
# Load sentiment analysis model | |
sentiment_pipeline = pipeline("sentiment-analysis") | |
def analyze(text): | |
result = sentiment_pipeline(text)[0] | |
return f"{result['label']} (Confidence: {result['score']:.2f})" | |
# Create Gradio interface | |
gr.Interface( | |
fn=analyze, | |
inputs=gr.Textbox(placeholder="Enter crypto news headline..."), | |
outputs="text" | |
).launch() |