Spaces:
Sleeping
Sleeping
Commit
·
5259707
1
Parent(s):
750c247
document output
Browse files
SETUP.md
CHANGED
|
@@ -87,6 +87,210 @@ El archivo `test_document.md` contiene un documento de muestra con:
|
|
| 87 |
|
| 88 |
Puedes usar este contenido para probar la funcionalidad del Research Team.
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
|
| 91 |
### 1. Análisis de Documento (Analyzer Agent)
|
| 92 |
- Extrae claims y los clasifica por importancia
|
|
|
|
| 87 |
|
| 88 |
Puedes usar este contenido para probar la funcionalidad del Research Team.
|
| 89 |
|
| 90 |
+
## 📊 Ejemplo de Salida del Research Team
|
| 91 |
+
|
| 92 |
+
Cuando proceses un documento médico como el del ejemplo de Daratumumab, el Research Team devuelve una respuesta estructurada con análisis detallado:
|
| 93 |
+
|
| 94 |
+
```json
|
| 95 |
+
{
|
| 96 |
+
"detailed_analysis": {
|
| 97 |
+
"claims_extracted": {
|
| 98 |
+
"all_claims": [
|
| 99 |
+
{
|
| 100 |
+
"id": "claim_1",
|
| 101 |
+
"text": "Daratumumab is a human monoclonal antibody that targets CD38",
|
| 102 |
+
"type": "core",
|
| 103 |
+
"importance_score": 9,
|
| 104 |
+
"position": 1,
|
| 105 |
+
"context": "Opening statement defining the drug mechanism"
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"id": "claim_2",
|
| 109 |
+
"text": "Clinical studies have demonstrated significant efficacy in treating multiple myeloma patients",
|
| 110 |
+
"type": "core",
|
| 111 |
+
"importance_score": 8,
|
| 112 |
+
"position": 2,
|
| 113 |
+
"context": "Clinical efficacy statement"
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"id": "claim_3",
|
| 117 |
+
"text": "The POLLUX study demonstrated that daratumumab in combination with lenalidomide and dexamethasone significantly improved progression-free survival",
|
| 118 |
+
"type": "supporting",
|
| 119 |
+
"importance_score": 7,
|
| 120 |
+
"position": 3,
|
| 121 |
+
"context": "Specific study evidence"
|
| 122 |
+
}
|
| 123 |
+
],
|
| 124 |
+
"core_claims": [
|
| 125 |
+
{
|
| 126 |
+
"id": "claim_1",
|
| 127 |
+
"text": "Daratumumab is a human monoclonal antibody that targets CD38",
|
| 128 |
+
"type": "core",
|
| 129 |
+
"importance_score": 9,
|
| 130 |
+
"position": 1,
|
| 131 |
+
"context": "Opening statement defining the drug mechanism"
|
| 132 |
+
},
|
| 133 |
+
{
|
| 134 |
+
"id": "claim_2",
|
| 135 |
+
"text": "Clinical studies have demonstrated significant efficacy in treating multiple myeloma patients",
|
| 136 |
+
"type": "core",
|
| 137 |
+
"importance_score": 8,
|
| 138 |
+
"position": 2,
|
| 139 |
+
"context": "Clinical efficacy statement"
|
| 140 |
+
}
|
| 141 |
+
],
|
| 142 |
+
"total_claims_found": 3,
|
| 143 |
+
"core_claims_count": 2
|
| 144 |
+
},
|
| 145 |
+
"anchoring_results": {
|
| 146 |
+
"detailed_anchoring": [
|
| 147 |
+
{
|
| 148 |
+
"claim_id": "claim_1",
|
| 149 |
+
"claim_text": "Daratumumab is a human monoclonal antibody that targets CD38",
|
| 150 |
+
"validation_status": "validated",
|
| 151 |
+
"supporting_evidence": [
|
| 152 |
+
"CD38 is highly expressed on multiple myeloma cells",
|
| 153 |
+
"Daratumumab demonstrates potent anti-tumor activity through multiple mechanisms"
|
| 154 |
+
],
|
| 155 |
+
"anchored_references": [
|
| 156 |
+
{
|
| 157 |
+
"reference_id": "gs_claim_1_1",
|
| 158 |
+
"supporting_text": "Daratumumab (DARZALEX) is a human IgG1κ monoclonal antibody that binds specifically to CD38",
|
| 159 |
+
"relevance_score": 0.95,
|
| 160 |
+
"section": "Background"
|
| 161 |
+
}
|
| 162 |
+
],
|
| 163 |
+
"quality_assessment": "High quality evidence from peer-reviewed sources"
|
| 164 |
+
}
|
| 165 |
+
],
|
| 166 |
+
"claims_with_evidence": [
|
| 167 |
+
{
|
| 168 |
+
"claim_id": "claim_1",
|
| 169 |
+
"claim_text": "Daratumumab is a human monoclonal antibody that targets CD38",
|
| 170 |
+
"validation_status": "validated",
|
| 171 |
+
"supporting_evidence": [
|
| 172 |
+
"CD38 is highly expressed on multiple myeloma cells",
|
| 173 |
+
"Daratumumab demonstrates potent anti-tumor activity through multiple mechanisms"
|
| 174 |
+
],
|
| 175 |
+
"anchored_references": [
|
| 176 |
+
{
|
| 177 |
+
"reference_id": "gs_claim_1_1",
|
| 178 |
+
"supporting_text": "Daratumumab (DARZALEX) is a human IgG1κ monoclonal antibody that binds specifically to CD38",
|
| 179 |
+
"relevance_score": 0.95,
|
| 180 |
+
"section": "Background"
|
| 181 |
+
}
|
| 182 |
+
],
|
| 183 |
+
"quality_assessment": "High quality evidence from peer-reviewed sources"
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"claim_id": "claim_2",
|
| 187 |
+
"claim_text": "Clinical studies have demonstrated significant efficacy in treating multiple myeloma patients",
|
| 188 |
+
"validation_status": "validated",
|
| 189 |
+
"supporting_evidence": [
|
| 190 |
+
"Phase III trials showed improved overall response rates",
|
| 191 |
+
"Significant progression-free survival benefit demonstrated"
|
| 192 |
+
],
|
| 193 |
+
"anchored_references": [
|
| 194 |
+
{
|
| 195 |
+
"reference_id": "pm_claim_2_1",
|
| 196 |
+
"supporting_text": "Daratumumab significantly improved outcomes in relapsed/refractory multiple myeloma",
|
| 197 |
+
"relevance_score": 0.88,
|
| 198 |
+
"section": "Results"
|
| 199 |
+
}
|
| 200 |
+
],
|
| 201 |
+
"quality_assessment": "Strong clinical evidence from randomized controlled trials"
|
| 202 |
+
}
|
| 203 |
+
]
|
| 204 |
+
},
|
| 205 |
+
"formatted_references": {
|
| 206 |
+
"references": [
|
| 207 |
+
{
|
| 208 |
+
"id": "gs_claim_1_1",
|
| 209 |
+
"original": "Research findings about daratumumab mechanism",
|
| 210 |
+
"formatted": "Multiple Authors et al. Daratumumab mechanism of action in multiple myeloma. Hematol Oncol 2024; 42(3): 145-158.",
|
| 211 |
+
"changes_applied": "Applied J&J journal article format, added proper author citation",
|
| 212 |
+
"source_type": "journal",
|
| 213 |
+
"completion_status": "complete"
|
| 214 |
+
},
|
| 215 |
+
{
|
| 216 |
+
"id": "pm_claim_2_1",
|
| 217 |
+
"original": "Clinical efficacy research findings",
|
| 218 |
+
"formatted": "Clinical Research Team et al. Efficacy of daratumumab in multiple myeloma treatment. Blood Cancer J [Internet]. 2024 Mar 15 [cited 2024 Nov 15]; 14(1): 25. Available from: https://doi.org/10.1038/example",
|
| 219 |
+
"changes_applied": "Applied J&J journal epub format with DOI",
|
| 220 |
+
"source_type": "journal",
|
| 221 |
+
"completion_status": "complete"
|
| 222 |
+
}
|
| 223 |
+
],
|
| 224 |
+
"reference_details": [
|
| 225 |
+
{
|
| 226 |
+
"reference_id": "gs_claim_1_1",
|
| 227 |
+
"formatted_citation": "Multiple Authors et al. Daratumumab mechanism of action in multiple myeloma. Hematol Oncol 2024; 42(3): 145-158.",
|
| 228 |
+
"source_type": "journal",
|
| 229 |
+
"completion_status": "complete"
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"reference_id": "pm_claim_2_1",
|
| 233 |
+
"formatted_citation": "Clinical Research Team et al. Efficacy of daratumumab in multiple myeloma treatment. Blood Cancer J [Internet]. 2024 Mar 15 [cited 2024 Nov 15]; 14(1): 25. Available from: https://doi.org/10.1038/example",
|
| 234 |
+
"source_type": "journal",
|
| 235 |
+
"completion_status": "complete"
|
| 236 |
+
}
|
| 237 |
+
]
|
| 238 |
+
}
|
| 239 |
+
},
|
| 240 |
+
"summary_statistics": {
|
| 241 |
+
"document_metadata": {
|
| 242 |
+
"product": "daratumumab",
|
| 243 |
+
"countries": ["mexico", "brazil", "argentina"],
|
| 244 |
+
"language": "english"
|
| 245 |
+
},
|
| 246 |
+
"claims_analysis": {
|
| 247 |
+
"total_claims": 3,
|
| 248 |
+
"core_claims_count": 2
|
| 249 |
+
},
|
| 250 |
+
"claims_anchoring": {
|
| 251 |
+
"summary": {
|
| 252 |
+
"total_claims_processed": 2,
|
| 253 |
+
"successfully_validated": 2,
|
| 254 |
+
"validation_rate": 1.0,
|
| 255 |
+
"claims_summary": [
|
| 256 |
+
{
|
| 257 |
+
"claim_id": "claim_1",
|
| 258 |
+
"status": "validated",
|
| 259 |
+
"references_found": 1
|
| 260 |
+
},
|
| 261 |
+
{
|
| 262 |
+
"claim_id": "claim_2",
|
| 263 |
+
"status": "validated",
|
| 264 |
+
"references_found": 1
|
| 265 |
+
}
|
| 266 |
+
]
|
| 267 |
+
}
|
| 268 |
+
},
|
| 269 |
+
"reference_formatting": {
|
| 270 |
+
"total_references": 2
|
| 271 |
+
},
|
| 272 |
+
"processing_status": {
|
| 273 |
+
"analyzer": "completed",
|
| 274 |
+
"claim_claim_1": "completed",
|
| 275 |
+
"claim_claim_2": "completed"
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
}
|
| 279 |
+
```
|
| 280 |
+
|
| 281 |
+
### 🔍 Estructura de la Respuesta:
|
| 282 |
+
|
| 283 |
+
#### `detailed_analysis` (Contenido Principal):
|
| 284 |
+
- **`claims_extracted`**: Claims identificados y clasificados por importancia
|
| 285 |
+
- **`anchoring_results`**: Validación de evidencia para cada claim con referencias
|
| 286 |
+
- **`formatted_references`**: Referencias formateadas según guidelines J&J
|
| 287 |
+
|
| 288 |
+
#### `summary_statistics` (Información Resumida):
|
| 289 |
+
- **`document_metadata`**: Producto, países, idioma detectados
|
| 290 |
+
- **`claims_analysis`**: Conteos y métricas de claims
|
| 291 |
+
- **`claims_anchoring`**: Tasa de validación y resumen
|
| 292 |
+
- **`reference_formatting`**: Total de referencias procesadas
|
| 293 |
+
- **`processing_status`**: Estado de procesamiento por agente
|
| 294 |
|
| 295 |
### 1. Análisis de Documento (Analyzer Agent)
|
| 296 |
- Extrae claims y los clasifica por importancia
|
app.py
CHANGED
|
@@ -643,20 +643,7 @@ def get_base_html(active_section: str = "ai-generator", question_value: str = ""
|
|
| 643 |
{research_response}
|
| 644 |
</div>
|
| 645 |
|
| 646 |
-
|
| 647 |
-
<div class="api-info">
|
| 648 |
-
<h3>🔗 Available API Endpoints</h3>
|
| 649 |
-
<ul>
|
| 650 |
-
<li><strong>GET /</strong> - This HTML interface</li>
|
| 651 |
-
<li><strong>GET /docs</strong> - Interactive API documentation</li>
|
| 652 |
-
<li><strong>GET /api/hello</strong> - JSON greeting message</li>
|
| 653 |
-
<li><strong>GET /api/health</strong> - Application health check</li>
|
| 654 |
-
<li><strong>POST /ask</strong> - AI question answering (form)</li>
|
| 655 |
-
<li><strong>POST /process</strong> - Document processing (form)</li>
|
| 656 |
-
<li><strong>POST /api/generate</strong> - AI question answering (JSON API)</li>
|
| 657 |
-
<li><strong>POST /api/research/process</strong> - Document processing (JSON API)</li>
|
| 658 |
-
</ul>
|
| 659 |
-
</div>
|
| 660 |
</div>
|
| 661 |
</div>
|
| 662 |
</body>
|
|
|
|
| 643 |
{research_response}
|
| 644 |
</div>
|
| 645 |
|
| 646 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 647 |
</div>
|
| 648 |
</div>
|
| 649 |
</body>
|