Add application file
Browse files
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()
|