Spaces:
Sleeping
Sleeping
Commit
·
d03cf89
1
Parent(s):
05c441e
app.py
CHANGED
|
@@ -235,8 +235,18 @@ objetivo_keywords = {
|
|
| 235 |
"condicionamento": ["resistência", "resistencia", "condicionamento", "endurance", "cardio", "alta repetiçao", "repetições altas"],
|
| 236 |
"explosividade": ["explosivo", "explosividade", "pliometria", "saltar", "sprints", "potência", "potencia"]
|
| 237 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 238 |
|
| 239 |
-
def detectar_objetivo(texto: str) -> str:
|
| 240 |
texto = texto.lower()
|
| 241 |
for objetivo, termos in objetivo_keywords.items():
|
| 242 |
for termo in termos:
|
|
@@ -383,10 +393,12 @@ def responder(prompt: str):
|
|
| 383 |
print(f"max_fitness: {max_fitness:.3f} | conceito_matches: {concept_matches} | kw_matches: {kw_matches} | bonus: {keyword_bonus:.3f} | score: {score:.3f}")
|
| 384 |
print("Músculos detectados:", musculos_alvo)
|
| 385 |
|
| 386 |
-
|
| 387 |
-
print("
|
|
|
|
|
|
|
|
|
|
| 388 |
|
| 389 |
-
treino, custo = montar_treino(musculos_alvo, budget=60, objetivo=objetivo)
|
| 390 |
|
| 391 |
print("Treino montado (custo total =", custo, "de 35):\n")
|
| 392 |
for t in treino:
|
|
|
|
| 235 |
"condicionamento": ["resistência", "resistencia", "condicionamento", "endurance", "cardio", "alta repetiçao", "repetições altas"],
|
| 236 |
"explosividade": ["explosivo", "explosividade", "pliometria", "saltar", "sprints", "potência", "potencia"]
|
| 237 |
}
|
| 238 |
+
def detectar_objetivos(texto: str) -> list[str]:
|
| 239 |
+
texto = texto.lower()
|
| 240 |
+
objetivos_detectados = []
|
| 241 |
+
for objetivo, termos in objetivo_keywords.items():
|
| 242 |
+
for termo in termos:
|
| 243 |
+
if termo in texto:
|
| 244 |
+
objetivos_detectados.append(objetivo)
|
| 245 |
+
break
|
| 246 |
+
if not objetivos_detectados:
|
| 247 |
+
return ["hipertrofia"] # padrão
|
| 248 |
+
return objetivos_detectados
|
| 249 |
|
|
|
|
| 250 |
texto = texto.lower()
|
| 251 |
for objetivo, termos in objetivo_keywords.items():
|
| 252 |
for termo in termos:
|
|
|
|
| 393 |
print(f"max_fitness: {max_fitness:.3f} | conceito_matches: {concept_matches} | kw_matches: {kw_matches} | bonus: {keyword_bonus:.3f} | score: {score:.3f}")
|
| 394 |
print("Músculos detectados:", musculos_alvo)
|
| 395 |
|
| 396 |
+
objetivos = detectar_objetivos(prompt_norm)
|
| 397 |
+
print("Objetivos detectados:", objetivos)
|
| 398 |
+
|
| 399 |
+
treino, custo = montar_treino(musculos_alvo, budget=60, objetivos=objetivos)
|
| 400 |
+
|
| 401 |
|
|
|
|
| 402 |
|
| 403 |
print("Treino montado (custo total =", custo, "de 35):\n")
|
| 404 |
for t in treino:
|