Spaces:
Sleeping
Sleeping
File size: 396 Bytes
6abdba3 ba6e3c0 f07cc92 3173d64 f07cc92 3173d64 f07cc92 4034762 ba6e3c0 4034762 6abdba3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import pandas as pd
from transformers import pipeline
import gradio as gr
# Initialize sentiment analysis pipeline
sentiment_pipeline = pipeline('sentiment-analysis')
def analyze_text(text):
sentiment = sentiment_pipeline(text)[0]
return sentiment['label']
iface = gr.Interface(fn=analyze_text, inputs=gr.inputs.Textbox(lines=13, label="Enter Text"), outputs="text")
iface.launch()
|