Text_Classify / app.py
Orawan's picture
Update app.py
a8d65ab
raw
history blame
434 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)