Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
def get_sentiment(Review, satisfied):
|
| 5 |
+
# Get sentiment from LLM
|
| 6 |
+
if satisfied:
|
| 7 |
+
Sentiment = 'Positive'
|
| 8 |
+
else:
|
| 9 |
+
Sentiment = np.random.choice(['Positive', 'Negative'])
|
| 10 |
+
return Sentiment
|
| 11 |
+
|
| 12 |
+
demo = gr.Interface(fn=get_sentiment, inputs=["textbox", 'checkbox'], outputs="textbox")
|
| 13 |
+
|
| 14 |
+
if __name__ == "__main__":
|
| 15 |
+
demo.launch()
|