Spaces:
Sleeping
Sleeping
import gradio as gr | |
from transformers import pipeline | |
# Load pre-trained model and tokenizer from Hugging Face | |
model_name = "aubmindlab/bert-base-arabertv02-twitter" | |
sentiment_analysis = pipeline("sentiment-analysis", model=model_name) | |
def analyze_sentiment(text): | |
result = sentiment_analysis(text) | |
return result | |
# Define Gradio interface | |
iface = gr.Interface(fn=analyze_sentiment, inputs="text", outputs="text", title="Arabic Sentiment Analysis") | |
iface.launch() | |