matiss commited on
Commit
52a4bf1
·
1 Parent(s): 73f6002

Add application file

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ model_path="matiss/Latvian-Twitter-Sentiment-Analysis"
5
+ sentiment_task = pipeline("sentiment-analysis", model=model_path, tokenizer=model_path)
6
+
7
+ def classify(text):
8
+ return sentiment_task(text)
9
+
10
+ demo = gr.Interface(fn=classify, inputs="text", outputs="text")
11
+ demo.launch()