Update app.py
Browse files
app.py
CHANGED
|
@@ -35,6 +35,39 @@ def get_team_news(team: str, sport: str = "football"):
|
|
| 35 |
headlines = [h.text for h in soup.select("h3")[:5]]
|
| 36 |
return " ".join(headlines)
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
@app.get("/soccer-predictions")
|
| 39 |
def soccer_predictions():
|
| 40 |
today = date.today().isoformat()
|
|
|
|
| 35 |
headlines = [h.text for h in soup.select("h3")[:5]]
|
| 36 |
return " ".join(headlines)
|
| 37 |
|
| 38 |
+
@app.get("/")
|
| 39 |
+
def root():
|
| 40 |
+
return {
|
| 41 |
+
"title": "Sports Predictor API",
|
| 42 |
+
"description": "AI-powered sports predictions for soccer and NBA games",
|
| 43 |
+
"version": "1.0.0",
|
| 44 |
+
"endpoints": {
|
| 45 |
+
"root": "/",
|
| 46 |
+
"soccer_predictions": "/soccer-predictions",
|
| 47 |
+
"nba_predictions": "/nba-predictions",
|
| 48 |
+
"docs": "/docs",
|
| 49 |
+
"redoc": "/redoc",
|
| 50 |
+
"openapi": "/openapi.json"
|
| 51 |
+
},
|
| 52 |
+
"features": [
|
| 53 |
+
"Soccer match predictions (EPL, LaLiga, Bundesliga)",
|
| 54 |
+
"NBA game predictions",
|
| 55 |
+
"News sentiment analysis",
|
| 56 |
+
"AI-powered reasoning",
|
| 57 |
+
"Real-time data from APIs"
|
| 58 |
+
],
|
| 59 |
+
"models_used": {
|
| 60 |
+
"sentiment_analysis": "valhalla/distilbart-mnli-12-1",
|
| 61 |
+
"reasoning": "google/flan-t5-base",
|
| 62 |
+
"similarity": "sentence-transformers/all-MiniLM-L6-v2"
|
| 63 |
+
},
|
| 64 |
+
"data_sources": {
|
| 65 |
+
"soccer": "Football-data.org API",
|
| 66 |
+
"nba": "Balldontlie API",
|
| 67 |
+
"news": "Google News scraping"
|
| 68 |
+
}
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
@app.get("/soccer-predictions")
|
| 72 |
def soccer_predictions():
|
| 73 |
today = date.today().isoformat()
|