Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,14 @@
|
|
| 1 |
-
from transformers.tools.base import launch_gradio_demo
|
| 2 |
from sentiment_analysis import SentimentAnalysisTool
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from sentiment_analysis import SentimentAnalysisTool
|
| 2 |
|
| 3 |
+
# Create an instance of the tool
|
| 4 |
+
sentiment_tool = SentimentAnalysisTool()
|
| 5 |
+
|
| 6 |
+
# Launch the Gradio interface
|
| 7 |
+
if __name__ == "__main__":
|
| 8 |
+
import gradio as gr
|
| 9 |
+
|
| 10 |
+
gr.Interface(
|
| 11 |
+
fn=sentiment_tool,
|
| 12 |
+
inputs=gr.Textbox(label="Text to analyze"),
|
| 13 |
+
outputs=gr.JSON(label="Sentiment Analysis Results")
|
| 14 |
+
).launch(share=True)
|