Spaces:
Build error
Build error
Create app.py
Browse filesNew file added
app.py
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
classifier = pipeline('sentiment-analysis')
|
5 |
+
# classifier('We are very happy to show you the 🤗 Transformers library.')
|
6 |
+
|
7 |
+
def get_sentiment(input_text):
|
8 |
+
return classifier(input_text)
|
9 |
+
|
10 |
+
iface = gr.Interface(fn=get_sentiment,
|
11 |
+
inputs = 'text',
|
12 |
+
outputs=['text'],
|
13 |
+
title = 'ALL NLP Tasks',
|
14 |
+
description = 'Get all NLP tasks')
|
15 |
+
|
16 |
+
iface.launch(inline = False)
|