Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -462,7 +462,7 @@ Example: If a quote starts at word 300, timestamp would be [02:00] (300 words /
|
|
| 462 |
marked_transcript += word + " "
|
| 463 |
transcript = marked_transcript
|
| 464 |
|
| 465 |
-
prompt_template = """Analyze this teaching content with strict evaluation criteria. Score 1
|
| 466 |
|
| 467 |
Transcript:
|
| 468 |
{transcript}
|
|
@@ -474,107 +474,121 @@ Required JSON structure:
|
|
| 474 |
{{
|
| 475 |
"Concept Assessment": {{
|
| 476 |
"Subject Matter Accuracy": {{
|
| 477 |
-
"Score": 1, # Score 1 ONLY if NO
|
| 478 |
"Citations": ["[MM:SS] Quote demonstrating accuracy or error"]
|
| 479 |
}},
|
| 480 |
"First Principles Approach": {{
|
| 481 |
-
"Score": 1, # Score 1 ONLY if
|
| 482 |
"Citations": ["[MM:SS] Quote showing fundamental concept explanation"]
|
| 483 |
}},
|
| 484 |
"Examples and Business Context": {{
|
| 485 |
-
"Score": 1, # Score 1 ONLY if
|
| 486 |
"Citations": ["[MM:SS] Quote containing practical example"]
|
| 487 |
}},
|
| 488 |
"Cohesive Storytelling": {{
|
| 489 |
-
"Score": 1, # Score 1 ONLY if
|
| 490 |
"Citations": ["[MM:SS] Quote showing topic transition or connection"]
|
| 491 |
}},
|
| 492 |
"Engagement and Interaction": {{
|
| 493 |
-
"Score": 1, # Score 1 ONLY if
|
| 494 |
"Citations": ["[MM:SS] Quote showing audience engagement"]
|
| 495 |
}},
|
| 496 |
"Professional Tone": {{
|
| 497 |
-
"Score": 1, # Score 1 ONLY if consistently professional
|
| 498 |
"Citations": ["[MM:SS] Quote demonstrating tone"]
|
| 499 |
}}
|
| 500 |
}},
|
| 501 |
"Code Assessment": {{
|
| 502 |
"Depth of Explanation": {{
|
| 503 |
-
"Score": 1, # Score 1 ONLY if code
|
| 504 |
"Citations": ["[MM:SS] Quote showing detailed code explanation"]
|
| 505 |
}},
|
| 506 |
"Output Interpretation": {{
|
| 507 |
-
"Score": 1, # Score 1 ONLY if code outputs are explained with their significance
|
| 508 |
"Citations": ["[MM:SS] Quote demonstrating output explanation"]
|
| 509 |
}},
|
| 510 |
"Breaking down Complexity": {{
|
| 511 |
-
"Score": 1, # Score 1 ONLY if complex concepts are broken into
|
| 512 |
"Citations": ["[MM:SS] Quote showing concept breakdown"]
|
| 513 |
}}
|
| 514 |
}}
|
| 515 |
}}
|
| 516 |
|
| 517 |
-
Strict Evaluation Criteria:
|
| 518 |
|
| 519 |
Concept Assessment:
|
| 520 |
-
1. Subject Matter Accuracy
|
| 521 |
-
-
|
| 522 |
-
-
|
| 523 |
-
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
-
|
| 532 |
-
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
-
|
| 537 |
-
-
|
| 538 |
-
-
|
| 539 |
-
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
-
|
| 543 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 544 |
- Clear checks for understanding
|
| 545 |
- Interactive elements in presentation
|
|
|
|
| 546 |
|
| 547 |
-
6. Professional Tone
|
| 548 |
-
-
|
| 549 |
-
-
|
| 550 |
- Clear and confident delivery
|
| 551 |
-
- Appropriate
|
|
|
|
| 552 |
|
| 553 |
Code Assessment:
|
| 554 |
-
1. Depth of Explanation
|
| 555 |
-
-
|
| 556 |
-
- Implementation details
|
| 557 |
-
-
|
| 558 |
-
-
|
| 559 |
-
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
-
|
| 563 |
-
- Error cases covered
|
| 564 |
- Expected vs actual results discussed
|
|
|
|
|
|
|
| 565 |
|
| 566 |
-
3. Breaking down Complexity
|
| 567 |
-
-
|
| 568 |
- Step-by-step explanation of difficult concepts
|
| 569 |
- Clear progression in complexity
|
| 570 |
- Logical organization of technical content
|
|
|
|
| 571 |
|
| 572 |
Important:
|
| 573 |
-
- Score 1 ONLY if ALL criteria for that category are met
|
|
|
|
| 574 |
- Each citation must include exact timestamp and relevant quote
|
| 575 |
-
- Citations
|
| 576 |
-
- Be strict and objective in scoring
|
| 577 |
-
-
|
|
|
|
| 578 |
|
| 579 |
return prompt_template.format(
|
| 580 |
transcript=transcript,
|
|
|
|
| 462 |
marked_transcript += word + " "
|
| 463 |
transcript = marked_transcript
|
| 464 |
|
| 465 |
+
prompt_template = """Analyze this teaching content with extremely strict evaluation criteria. Score 1 ONLY if ALL requirements are FULLY met with NO exceptions.
|
| 466 |
|
| 467 |
Transcript:
|
| 468 |
{transcript}
|
|
|
|
| 474 |
{{
|
| 475 |
"Concept Assessment": {{
|
| 476 |
"Subject Matter Accuracy": {{
|
| 477 |
+
"Score": 1, # Score 1 ONLY if ALL technical information is 100% accurate with NO errors or oversimplifications
|
| 478 |
"Citations": ["[MM:SS] Quote demonstrating accuracy or error"]
|
| 479 |
}},
|
| 480 |
"First Principles Approach": {{
|
| 481 |
+
"Score": 1, # Score 1 ONLY if EVERY concept is built from fundamentals with clear progression
|
| 482 |
"Citations": ["[MM:SS] Quote showing fundamental concept explanation"]
|
| 483 |
}},
|
| 484 |
"Examples and Business Context": {{
|
| 485 |
+
"Score": 1, # Score 1 ONLY if 3+ relevant, detailed real-world examples are provided
|
| 486 |
"Citations": ["[MM:SS] Quote containing practical example"]
|
| 487 |
}},
|
| 488 |
"Cohesive Storytelling": {{
|
| 489 |
+
"Score": 1, # Score 1 ONLY if ALL transitions are smooth with explicit connections between topics
|
| 490 |
"Citations": ["[MM:SS] Quote showing topic transition or connection"]
|
| 491 |
}},
|
| 492 |
"Engagement and Interaction": {{
|
| 493 |
+
"Score": 1, # Score 1 ONLY if 3+ different engagement techniques are used effectively
|
| 494 |
"Citations": ["[MM:SS] Quote showing audience engagement"]
|
| 495 |
}},
|
| 496 |
"Professional Tone": {{
|
| 497 |
+
"Score": 1, # Score 1 ONLY if language is consistently professional with NO casual expressions
|
| 498 |
"Citations": ["[MM:SS] Quote demonstrating tone"]
|
| 499 |
}}
|
| 500 |
}},
|
| 501 |
"Code Assessment": {{
|
| 502 |
"Depth of Explanation": {{
|
| 503 |
+
"Score": 1, # Score 1 ONLY if EVERY code concept includes what, why, and implementation details
|
| 504 |
"Citations": ["[MM:SS] Quote showing detailed code explanation"]
|
| 505 |
}},
|
| 506 |
"Output Interpretation": {{
|
| 507 |
+
"Score": 1, # Score 1 ONLY if ALL code outputs are explained with their significance and error cases
|
| 508 |
"Citations": ["[MM:SS] Quote demonstrating output explanation"]
|
| 509 |
}},
|
| 510 |
"Breaking down Complexity": {{
|
| 511 |
+
"Score": 1, # Score 1 ONLY if ALL complex concepts are broken into clear, logical sub-components
|
| 512 |
"Citations": ["[MM:SS] Quote showing concept breakdown"]
|
| 513 |
}}
|
| 514 |
}}
|
| 515 |
}}
|
| 516 |
|
| 517 |
+
Extremely Strict Evaluation Criteria:
|
| 518 |
|
| 519 |
Concept Assessment:
|
| 520 |
+
1. Subject Matter Accuracy (Must meet ALL):
|
| 521 |
+
- Zero factual errors or technical inaccuracies
|
| 522 |
+
- No oversimplifications that could lead to misconceptions
|
| 523 |
+
- All technical terms used with precise definitions
|
| 524 |
+
- Complete and accurate explanations of all concepts
|
| 525 |
+
- Clear distinction between facts and opinions
|
| 526 |
+
|
| 527 |
+
2. First Principles Approach (Must meet ALL):
|
| 528 |
+
- Every concept explicitly built from fundamental principles
|
| 529 |
+
- Clear progression from basic to advanced concepts
|
| 530 |
+
- No assumptions about prior knowledge
|
| 531 |
+
- Each building block thoroughly explained
|
| 532 |
+
- Logical sequence of concept introduction
|
| 533 |
+
|
| 534 |
+
3. Examples and Business Context (Must meet ALL):
|
| 535 |
+
- Minimum 3 detailed, relevant real-world examples
|
| 536 |
+
- Each example directly tied to concept being taught
|
| 537 |
+
- Clear business value explanation for each example
|
| 538 |
+
- Practical implementation considerations discussed
|
| 539 |
+
- Industry-specific applications highlighted
|
| 540 |
+
|
| 541 |
+
4. Cohesive Storytelling (Must meet ALL):
|
| 542 |
+
- Explicit connections between all related concepts
|
| 543 |
+
- Clear narrative thread throughout presentation
|
| 544 |
+
- Smooth transitions between all topics
|
| 545 |
+
- No unexplained topic jumps
|
| 546 |
+
- Consistent story arc from start to finish
|
| 547 |
+
|
| 548 |
+
5. Engagement and Interaction (Must meet ALL):
|
| 549 |
+
- Minimum 3 different engagement techniques used
|
| 550 |
+
- Direct audience involvement opportunities
|
| 551 |
- Clear checks for understanding
|
| 552 |
- Interactive elements in presentation
|
| 553 |
+
- Varied teaching methods demonstrated
|
| 554 |
|
| 555 |
+
6. Professional Tone (Must meet ALL):
|
| 556 |
+
- Zero casual or colloquial expressions
|
| 557 |
+
- Consistent technical vocabulary
|
| 558 |
- Clear and confident delivery
|
| 559 |
+
- Appropriate level of formality
|
| 560 |
+
- No filler words or hesitations
|
| 561 |
|
| 562 |
Code Assessment:
|
| 563 |
+
1. Depth of Explanation (Must meet ALL):
|
| 564 |
+
- Every code concept explains what, why, and how
|
| 565 |
+
- Implementation details thoroughly covered
|
| 566 |
+
- Design decisions explicitly justified
|
| 567 |
+
- Performance implications discussed
|
| 568 |
+
- Best practices highlighted
|
| 569 |
+
|
| 570 |
+
2. Output Interpretation (Must meet ALL):
|
| 571 |
+
- All code outputs explained with significance
|
| 572 |
+
- Error cases and edge cases covered
|
| 573 |
- Expected vs actual results discussed
|
| 574 |
+
- Output validation methods explained
|
| 575 |
+
- Debugging approaches covered
|
| 576 |
|
| 577 |
+
3. Breaking down Complexity (Must meet ALL):
|
| 578 |
+
- All complex concepts divided into clear sub-components
|
| 579 |
- Step-by-step explanation of difficult concepts
|
| 580 |
- Clear progression in complexity
|
| 581 |
- Logical organization of technical content
|
| 582 |
+
- Dependencies and relationships explained
|
| 583 |
|
| 584 |
Important:
|
| 585 |
+
- Score 1 ONLY if ALL criteria for that category are fully met
|
| 586 |
+
- ANY missing element results in a score of 0
|
| 587 |
- Each citation must include exact timestamp and relevant quote
|
| 588 |
+
- Citations must clearly demonstrate how criteria are/aren't met
|
| 589 |
+
- Be extremely strict and objective in scoring
|
| 590 |
+
- When in doubt, score 0
|
| 591 |
+
- No partial credit - all requirements must be met for a score of 1"""
|
| 592 |
|
| 593 |
return prompt_template.format(
|
| 594 |
transcript=transcript,
|