Spaces:
Sleeping
Sleeping
File size: 780 Bytes
363d7a5 a3dfb31 363d7a5 a3dfb31 363d7a5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import transformers
from huggingface_hub import notebook_login
from datasets import load_dataset
from transformers import AutoModelForSequenceClassification
model = AutoModelForSequenceClassification.from_pretrained("DioLiu/autotrain-koles_score2-3525195293")
from transformers import AutoTokenizer
model_checkpoint = "distilbert-base-uncased"
tokenizer = AutoTokenizer.from_pretrained("DioLiu/autotrain-koles_score2-3525195293")
from transformers import pipeline
import gradio as gr
from transformers import pipeline
classifier = pipeline("sentiment-analysis",model=model,tokenizer=tokenizer)
def get_sentiment(input_text):
return classifier(input_text)
iface = gr.Interface(fn= get_sentiment, inputs="text", outputs = ["text"], title="Sentiment Analysis")
iface.launch() |