Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -458,22 +458,12 @@ Do not create new timestamps."""
|
|
| 458 |
timestamp_instruction = """Generate timestamps based on word position:
|
| 459 |
1. Count words from start of transcript
|
| 460 |
2. Calculate time: (word_count / 150) minutes
|
| 461 |
-
3. Format as [MM:SS]
|
| 462 |
-
Example: If a quote starts at word 300, timestamp would be [02:00] (300 words / 150 words per minute)"""
|
| 463 |
-
|
| 464 |
-
# Add word position markers
|
| 465 |
-
words = transcript.split()
|
| 466 |
-
marked_transcript = ""
|
| 467 |
-
for i, word in enumerate(words):
|
| 468 |
-
if i % 150 == 0:
|
| 469 |
-
minutes = i // 150
|
| 470 |
-
marked_transcript += f"\n[{minutes:02d}:00] "
|
| 471 |
-
marked_transcript += word + " "
|
| 472 |
-
transcript = marked_transcript
|
| 473 |
|
| 474 |
-
|
| 475 |
|
| 476 |
Score 1 ONLY if ALL requirements are met with clear evidence. Score 0 if ANY requirement is not fully met.
|
|
|
|
| 477 |
|
| 478 |
Transcript:
|
| 479 |
{transcript}
|
|
@@ -481,39 +471,81 @@ Transcript:
|
|
| 481 |
Timestamp Instructions:
|
| 482 |
{timestamp_instruction}
|
| 483 |
|
| 484 |
-
Required JSON
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 485 |
|
| 486 |
-
|
| 487 |
|
| 488 |
Subject Matter Accuracy:
|
| 489 |
β Score 1 if ALL:
|
| 490 |
-
-
|
| 491 |
-
-
|
| 492 |
-
-
|
| 493 |
β Score 0 if ANY:
|
| 494 |
-
- Contains technical
|
| 495 |
-
- Uses imprecise
|
| 496 |
-
-
|
| 497 |
|
| 498 |
First Principles Approach:
|
| 499 |
β Score 1 if ALL:
|
| 500 |
- Starts with fundamental concepts
|
| 501 |
- Builds complexity systematically
|
| 502 |
-
-
|
| 503 |
β Score 0 if ANY:
|
| 504 |
-
-
|
|
|
|
| 505 |
- Missing logical progression
|
| 506 |
-
- Unclear connections between concepts
|
| 507 |
|
| 508 |
Examples and Business Context:
|
| 509 |
β Score 1 if ALL:
|
| 510 |
-
-
|
| 511 |
-
-
|
| 512 |
-
-
|
| 513 |
β Score 0 if ANY:
|
| 514 |
-
-
|
| 515 |
-
-
|
| 516 |
-
- Examples don't
|
| 517 |
|
| 518 |
Cohesive Storytelling:
|
| 519 |
β Score 1 if ALL:
|
|
@@ -521,68 +553,65 @@ Cohesive Storytelling:
|
|
| 521 |
- Logical topic transitions
|
| 522 |
- Consistent theme throughout
|
| 523 |
β Score 0 if ANY:
|
| 524 |
-
- Disjointed
|
| 525 |
- Abrupt topic changes
|
| 526 |
-
-
|
| 527 |
|
| 528 |
Engagement and Interaction:
|
| 529 |
β Score 1 if ALL:
|
| 530 |
-
-
|
| 531 |
-
-
|
| 532 |
-
-
|
| 533 |
β Score 0 if ANY:
|
| 534 |
-
- Minimal audience interaction
|
| 535 |
- One-way lecture style
|
| 536 |
-
-
|
|
|
|
| 537 |
|
| 538 |
Professional Tone:
|
| 539 |
β Score 1 if ALL:
|
| 540 |
-
-
|
| 541 |
-
-
|
| 542 |
-
- Clear and
|
| 543 |
β Score 0 if ANY:
|
| 544 |
-
-
|
| 545 |
-
-
|
| 546 |
-
-
|
| 547 |
-
|
| 548 |
-
Code Assessment Criteria:
|
| 549 |
|
| 550 |
Depth of Explanation:
|
| 551 |
β Score 1 if ALL:
|
| 552 |
-
- Explains code purpose
|
| 553 |
- Covers implementation details
|
| 554 |
-
-
|
| 555 |
β Score 0 if ANY:
|
| 556 |
- Surface-level explanation
|
| 557 |
-
- Missing
|
| 558 |
-
- No
|
| 559 |
|
| 560 |
Output Interpretation:
|
| 561 |
β Score 1 if ALL:
|
| 562 |
-
-
|
| 563 |
-
-
|
| 564 |
-
-
|
| 565 |
β Score 0 if ANY:
|
| 566 |
- Unclear output expectations
|
| 567 |
-
- No error handling
|
| 568 |
-
-
|
| 569 |
|
| 570 |
Breaking down Complexity:
|
| 571 |
β Score 1 if ALL:
|
| 572 |
-
-
|
| 573 |
-
-
|
| 574 |
-
-
|
| 575 |
β Score 0 if ANY:
|
| 576 |
- Overwhelming complexity
|
| 577 |
-
- Missing steps
|
| 578 |
-
-
|
| 579 |
-
|
| 580 |
-
Important
|
| 581 |
-
- Each
|
| 582 |
-
-
|
| 583 |
-
-
|
| 584 |
-
-
|
| 585 |
-
- Different criteria can receive different scores based on evidence"""
|
| 586 |
|
| 587 |
return prompt_template.format(
|
| 588 |
transcript=transcript,
|
|
|
|
| 458 |
timestamp_instruction = """Generate timestamps based on word position:
|
| 459 |
1. Count words from start of transcript
|
| 460 |
2. Calculate time: (word_count / 150) minutes
|
| 461 |
+
3. Format as [MM:SS]"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 462 |
|
| 463 |
+
prompt_template = """Analyze this teaching content with strict standards. Each criterion must meet specific requirements for a passing score.
|
| 464 |
|
| 465 |
Score 1 ONLY if ALL requirements are met with clear evidence. Score 0 if ANY requirement is not fully met.
|
| 466 |
+
You MUST provide specific citations with timestamps [MM:SS] for each assessment point.
|
| 467 |
|
| 468 |
Transcript:
|
| 469 |
{transcript}
|
|
|
|
| 471 |
Timestamp Instructions:
|
| 472 |
{timestamp_instruction}
|
| 473 |
|
| 474 |
+
Required JSON response format:
|
| 475 |
+
{{
|
| 476 |
+
"Concept Assessment": {{
|
| 477 |
+
"Subject Matter Accuracy": {{
|
| 478 |
+
"Score": 0 or 1,
|
| 479 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 480 |
+
}},
|
| 481 |
+
"First Principles Approach": {{
|
| 482 |
+
"Score": 0 or 1,
|
| 483 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 484 |
+
}},
|
| 485 |
+
"Examples and Business Context": {{
|
| 486 |
+
"Score": 0 or 1,
|
| 487 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 488 |
+
}},
|
| 489 |
+
"Cohesive Storytelling": {{
|
| 490 |
+
"Score": 0 or 1,
|
| 491 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 492 |
+
}},
|
| 493 |
+
"Engagement and Interaction": {{
|
| 494 |
+
"Score": 0 or 1,
|
| 495 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 496 |
+
}},
|
| 497 |
+
"Professional Tone": {{
|
| 498 |
+
"Score": 0 or 1,
|
| 499 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 500 |
+
}}
|
| 501 |
+
}},
|
| 502 |
+
"Code Assessment": {{
|
| 503 |
+
"Depth of Explanation": {{
|
| 504 |
+
"Score": 0 or 1,
|
| 505 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 506 |
+
}},
|
| 507 |
+
"Output Interpretation": {{
|
| 508 |
+
"Score": 0 or 1,
|
| 509 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 510 |
+
}},
|
| 511 |
+
"Breaking down Complexity": {{
|
| 512 |
+
"Score": 0 or 1,
|
| 513 |
+
"Citations": ["[MM:SS] Exact quote showing evidence"]
|
| 514 |
+
}}
|
| 515 |
+
}}
|
| 516 |
+
}}
|
| 517 |
|
| 518 |
+
Scoring Criteria:
|
| 519 |
|
| 520 |
Subject Matter Accuracy:
|
| 521 |
β Score 1 if ALL:
|
| 522 |
+
- Demonstrates deep technical knowledge
|
| 523 |
+
- Uses precise terminology
|
| 524 |
+
- Explains concepts accurately
|
| 525 |
β Score 0 if ANY:
|
| 526 |
+
- Contains technical errors
|
| 527 |
+
- Uses imprecise terminology
|
| 528 |
+
- Misrepresents concepts
|
| 529 |
|
| 530 |
First Principles Approach:
|
| 531 |
β Score 1 if ALL:
|
| 532 |
- Starts with fundamental concepts
|
| 533 |
- Builds complexity systematically
|
| 534 |
+
- Shows clear concept relationships
|
| 535 |
β Score 0 if ANY:
|
| 536 |
+
- Skips fundamental concepts
|
| 537 |
+
- Presents concepts randomly
|
| 538 |
- Missing logical progression
|
|
|
|
| 539 |
|
| 540 |
Examples and Business Context:
|
| 541 |
β Score 1 if ALL:
|
| 542 |
+
- Provides 2+ relevant examples
|
| 543 |
+
- Links to business applications
|
| 544 |
+
- Shows practical value
|
| 545 |
β Score 0 if ANY:
|
| 546 |
+
- Lacks concrete examples
|
| 547 |
+
- Missing business context
|
| 548 |
+
- Examples don't support learning
|
| 549 |
|
| 550 |
Cohesive Storytelling:
|
| 551 |
β Score 1 if ALL:
|
|
|
|
| 553 |
- Logical topic transitions
|
| 554 |
- Consistent theme throughout
|
| 555 |
β Score 0 if ANY:
|
| 556 |
+
- Disjointed presentation
|
| 557 |
- Abrupt topic changes
|
| 558 |
+
- Lacks coherent flow
|
| 559 |
|
| 560 |
Engagement and Interaction:
|
| 561 |
β Score 1 if ALL:
|
| 562 |
+
- Asks engaging questions
|
| 563 |
+
- Encourages participation
|
| 564 |
+
- Responds to audience
|
| 565 |
β Score 0 if ANY:
|
|
|
|
| 566 |
- One-way lecture style
|
| 567 |
+
- No audience interaction
|
| 568 |
+
- Ignores engagement opportunities
|
| 569 |
|
| 570 |
Professional Tone:
|
| 571 |
β Score 1 if ALL:
|
| 572 |
+
- Maintains formal language
|
| 573 |
+
- Speaks confidently
|
| 574 |
+
- Clear and articulate
|
| 575 |
β Score 0 if ANY:
|
| 576 |
+
- Uses casual language
|
| 577 |
+
- Shows uncertainty
|
| 578 |
+
- Unclear delivery
|
|
|
|
|
|
|
| 579 |
|
| 580 |
Depth of Explanation:
|
| 581 |
β Score 1 if ALL:
|
| 582 |
+
- Explains code purpose
|
| 583 |
- Covers implementation details
|
| 584 |
+
- Discusses alternatives
|
| 585 |
β Score 0 if ANY:
|
| 586 |
- Surface-level explanation
|
| 587 |
+
- Missing key details
|
| 588 |
+
- No alternative approaches
|
| 589 |
|
| 590 |
Output Interpretation:
|
| 591 |
β Score 1 if ALL:
|
| 592 |
+
- Explains expected results
|
| 593 |
+
- Covers error cases
|
| 594 |
+
- Discusses performance
|
| 595 |
β Score 0 if ANY:
|
| 596 |
- Unclear output expectations
|
| 597 |
+
- No error handling
|
| 598 |
+
- Ignores performance
|
| 599 |
|
| 600 |
Breaking down Complexity:
|
| 601 |
β Score 1 if ALL:
|
| 602 |
+
- Divides complex concepts
|
| 603 |
+
- Step-by-step explanation
|
| 604 |
+
- Clear progression
|
| 605 |
β Score 0 if ANY:
|
| 606 |
- Overwhelming complexity
|
| 607 |
+
- Missing steps
|
| 608 |
+
- Unclear progression
|
| 609 |
+
|
| 610 |
+
Important:
|
| 611 |
+
- Each citation must include timestamp and exact quote
|
| 612 |
+
- Score 1 requires meeting ALL criteria
|
| 613 |
+
- Score 0 if ANY criterion not met
|
| 614 |
+
- Use specific evidence from transcript"""
|
|
|
|
| 615 |
|
| 616 |
return prompt_template.format(
|
| 617 |
transcript=transcript,
|