Spaces:
Sleeping
Sleeping
jossy-gutierrez commited on
Commit ·
2bca106
1
Parent(s): 6ef07fe
Actualizar modelos Pydantic
Browse files- app/models.py +2 -2
- requirements.txt +14 -0
app/models.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
Pydantic models for request/response validation
|
| 3 |
"""
|
| 4 |
from pydantic import BaseModel, Field
|
| 5 |
-
from typing import Optional, List, Dict
|
| 6 |
|
| 7 |
|
| 8 |
class AnalysisRequest(BaseModel):
|
|
@@ -50,7 +50,7 @@ class EnhancedSentimentResult(BaseModel):
|
|
| 50 |
confianza: float = Field(..., ge=0, le=1, description="Confidence score")
|
| 51 |
modelo_usado: str = Field(..., description="Model used")
|
| 52 |
emocion_predominante: str = Field(..., description="Predominant emotion detected")
|
| 53 |
-
palabras_clave: List[Dict[str,
|
| 54 |
alertas: List[Dict[str, str]] = Field(..., description="Alerts detected")
|
| 55 |
|
| 56 |
class Config:
|
|
|
|
| 2 |
Pydantic models for request/response validation
|
| 3 |
"""
|
| 4 |
from pydantic import BaseModel, Field
|
| 5 |
+
from typing import Optional, List, Dict, Any
|
| 6 |
|
| 7 |
|
| 8 |
class AnalysisRequest(BaseModel):
|
|
|
|
| 50 |
confianza: float = Field(..., ge=0, le=1, description="Confidence score")
|
| 51 |
modelo_usado: str = Field(..., description="Model used")
|
| 52 |
emocion_predominante: str = Field(..., description="Predominant emotion detected")
|
| 53 |
+
palabras_clave: List[Dict[str, Any]] = Field(..., description="Key words found")
|
| 54 |
alertas: List[Dict[str, str]] = Field(..., description="Alerts detected")
|
| 55 |
|
| 56 |
class Config:
|
requirements.txt
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Core API framework
|
| 2 |
+
fastapi==0.109.0
|
| 3 |
+
uvicorn[standard]==0.27.0
|
| 4 |
+
pydantic==2.5.3
|
| 5 |
+
pydantic-settings==2.1.0
|
| 6 |
+
python-dotenv==1.0.0
|
| 7 |
+
|
| 8 |
+
# ML/NLP - Hugging Face Transformers (FREE & Open Source)
|
| 9 |
+
transformers==4.37.0
|
| 10 |
+
torch==2.1.2
|
| 11 |
+
sentencepiece==0.1.99
|
| 12 |
+
|
| 13 |
+
# Utilities
|
| 14 |
+
python-multipart==0.0.6
|