Spaces:
Runtime error
Runtime error
root
commited on
Commit
·
c008d93
1
Parent(s):
c2cbf3f
new demo changes
Browse files- app.py +21 -1
- requirements.txt +2 -1
- text-classification +1 -0
app.py
CHANGED
|
@@ -43,5 +43,25 @@ def classify_sentiments(text):
|
|
| 43 |
|
| 44 |
|
| 45 |
#build the Gradio app
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
#build the Gradio app
|
| 46 |
+
Instructuction = "Write an imaginary review about a product or service you might be interested in."
|
| 47 |
+
title="Text Sentiment analysis"
|
| 48 |
+
description = """Write a Good or Bad reviews of a products or services,\
|
| 49 |
+
the machine learning model is able to predict the text sentiment"""
|
| 50 |
+
article = """
|
| 51 |
+
- Click submit button to test sentiment analysis prediction
|
| 52 |
+
- Click clear button to refresh text
|
| 53 |
+
"""
|
| 54 |
+
|
| 55 |
+
gr.Interface(classify_sentiments,
|
| 56 |
+
'text',
|
| 57 |
+
'label',
|
| 58 |
+
title = title,
|
| 59 |
+
description = description,
|
| 60 |
+
Instruction = Instructuction,
|
| 61 |
+
article = article,
|
| 62 |
+
allow_flagging = "never",
|
| 63 |
+
live = False,
|
| 64 |
+
examples=["This has to be the best Introductory course to machine learning",
|
| 65 |
+
"I consider this training an absolute waste of time."]
|
| 66 |
+
).launch()
|
| 67 |
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
| 1 |
scipy
|
| 2 |
gradio
|
| 3 |
-
numpy
|
|
|
|
|
|
| 1 |
scipy
|
| 2 |
gradio
|
| 3 |
+
numpy
|
| 4 |
+
transformers
|
text-classification
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Subproject commit e187cc1fff0bfec15df56f125f944607154499a9
|