Text_Classify / app.py
Orawan's picture
Update app.py
f8e4306
raw
history blame
604 Bytes
import streamlit as st
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("OatNapat/finetuned_yelp")
model = AutoModelForSequenceClassification.from_pretrained("OatNapat/finetuned_yelp")
# Create a sentiment analysis pipeline with the explicit tokenizer
nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
st.title("Sentiment Analysis App")
user_input = st.text_input("ป้อนประโยคเพื่อวิเคราะห์ความรู้สึก:")