Spaces:
Sleeping
Sleeping
Lulu commited on
app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def forecast_trend(social_buzz, purchase_history, sentiment):
|
| 4 |
+
sentiment_map = {"Positive": 1, "Neutral": 0, "Negative": -1}
|
| 5 |
+
score = (0.4 * social_buzz) + (0.4 * purchase_history) + (0.2 * sentiment_map[sentiment] * 50)
|
| 6 |
+
return f"Predicted Trend Score: {round(score, 2)}"
|
| 7 |
+
|
| 8 |
+
demo = gr.Interface(
|
| 9 |
+
fn=forecast_trend,
|
| 10 |
+
inputs=[
|
| 11 |
+
gr.Slider(0, 100, label="Social Media Buzz"),
|
| 12 |
+
gr.Slider(0, 100, label="Purchase History Strength"),
|
| 13 |
+
gr.Radio(["Positive", "Neutral", "Negative"], label="Economic Sentiment")
|
| 14 |
+
],
|
| 15 |
+
outputs="text",
|
| 16 |
+
title="FIN – Future Insights",
|
| 17 |
+
description="AI-powered tool that predicts market trends based on real-world signals"
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
demo.launch()
|