nadzo's picture
Update app.py
27cda04 verified
raw
history blame
633 Bytes
import gradio as gr
from transformers import pipeline
# Load the crypto-specific sentiment model
sentiment_pipeline = pipeline(
"text-classification",
model="ElKulako/cryptobert", # Crypto-optimized model
tokenizer="ElKulako/cryptobert"
)
def analyze(text):
result = sentiment_pipeline(text)[0]
return {"label": result["label"], "score": result["score"]}
gr.Interface(
fn=analyze,
inputs=gr.Textbox(placeholder="Enter crypto news headline..."),
outputs=gr.JSON(),
title="Crypto-Specific Sentiment Analysis",
flagging_mode="never"
).launch(
server_name="0.0.0.0",
server_port=7860
)