Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from chunking import chunk_text_semantic
|
|
| 8 |
from llm import query_llm, extract_structured_data
|
| 9 |
from reporting import generate_enhanced_csv, generate_enhanced_pdf
|
| 10 |
from dashboard import generate_comprehensive_dashboard
|
| 11 |
-
from validation import validate_transcript_quality, check_data_completeness
|
| 12 |
|
| 13 |
# HuggingFace Spaces Configuration
|
| 14 |
import os
|
|
@@ -312,7 +312,6 @@ Additional Instructions:
|
|
| 312 |
summary, summary_data = generate_emergency_summary(interviewee_type)
|
| 313 |
|
| 314 |
# Validate summary quality and retry if needed
|
| 315 |
-
from validation import validate_summary_quality
|
| 316 |
summary_score, summary_issues = validate_summary_quality(
|
| 317 |
summary,
|
| 318 |
len(valid_results)
|
|
@@ -370,7 +369,6 @@ Please review findings carefully and verify against source data.
|
|
| 370 |
print(f"[Summary] ✓ Validation passed (score: {summary_score:.2f})")
|
| 371 |
|
| 372 |
# Verify consensus claims against actual data
|
| 373 |
-
from validation import verify_consensus_claims
|
| 374 |
consensus_warnings = verify_consensus_claims(summary, valid_results)
|
| 375 |
if consensus_warnings:
|
| 376 |
print(f"[Warning] Consensus verification issues: {len(consensus_warnings)} found")
|
|
@@ -635,11 +633,11 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 635 |
""")
|
| 636 |
|
| 637 |
if __name__ == "__main__":
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
-
|
| 644 |
-
|
| 645 |
-
|
|
|
|
| 8 |
from llm import query_llm, extract_structured_data
|
| 9 |
from reporting import generate_enhanced_csv, generate_enhanced_pdf
|
| 10 |
from dashboard import generate_comprehensive_dashboard
|
| 11 |
+
from validation import validate_transcript_quality, check_data_completeness, verify_consensus_claims, validate_summary_quality
|
| 12 |
|
| 13 |
# HuggingFace Spaces Configuration
|
| 14 |
import os
|
|
|
|
| 312 |
summary, summary_data = generate_emergency_summary(interviewee_type)
|
| 313 |
|
| 314 |
# Validate summary quality and retry if needed
|
|
|
|
| 315 |
summary_score, summary_issues = validate_summary_quality(
|
| 316 |
summary,
|
| 317 |
len(valid_results)
|
|
|
|
| 369 |
print(f"[Summary] ✓ Validation passed (score: {summary_score:.2f})")
|
| 370 |
|
| 371 |
# Verify consensus claims against actual data
|
|
|
|
| 372 |
consensus_warnings = verify_consensus_claims(summary, valid_results)
|
| 373 |
if consensus_warnings:
|
| 374 |
print(f"[Warning] Consensus verification issues: {len(consensus_warnings)} found")
|
|
|
|
| 633 |
""")
|
| 634 |
|
| 635 |
if __name__ == "__main__":
|
| 636 |
+
demo.queue(
|
| 637 |
+
max_size=10,
|
| 638 |
+
api_open=False
|
| 639 |
+
).launch(
|
| 640 |
+
server_name="0.0.0.0",
|
| 641 |
+
server_port=7860,
|
| 642 |
+
show_error=True
|
| 643 |
+
)
|