Initial App Commit
Browse files- app.py +12 -0
- requirements.txt +1 -0
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
def greet(name):
|
| 5 |
+
return "Hello " + name + "!!"
|
| 6 |
+
|
| 7 |
+
def sentiment(intext):
|
| 8 |
+
classifier = pipeline("sentiment-analysis")
|
| 9 |
+
classifier(intext)
|
| 10 |
+
|
| 11 |
+
iface = gr.Interface(fn=sentiment, inputs="text", outputs="text")
|
| 12 |
+
iface.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
transformers
|