Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from transformers import pipeline | |
| # โหลดโมเดล | |
| classifier = pipeline("text-classification", model="ongaunjie/distilbert-cloths-sentiment") | |
| # ฟังก์ชันสำหรับการวิเคราะห์รีวิว | |
| def analyze_sentiment(text): | |
| return classifier(text) | |
| # สร้าง UI ด้วย Gradio | |
| iface = gr.Interface(fn=analyze_sentiment, inputs="text", outputs="json", | |
| title="Clothing Sentiment Analyzer", | |
| description="Analyze the sentiment of clothing product reviews.") | |
| iface.launch() |