File size: 339 Bytes
52a4bf1
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
import gradio as gr
from transformers import pipeline

model_path="matiss/Latvian-Twitter-Sentiment-Analysis"
sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)

def classify(text):
    return sentiment_task(text)

demo = gr.Interface(fn=classify, inputs="text", outputs="text")
demo.launch()