Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,8 +9,8 @@ from reportlab.lib.pagesizes import A4
|
|
| 9 |
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
| 10 |
|
| 11 |
# ---------- PROMPTS ----------
|
| 12 |
-
TRANSCRIPTION_PROMPT = """ ... """
|
| 13 |
-
GRADING_PROMPT = """ ... """
|
| 14 |
|
| 15 |
# ---------- HELPER: Save to PDF ----------
|
| 16 |
def save_as_pdf(text, filename="output.pdf"):
|
|
|
|
| 9 |
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
| 10 |
|
| 11 |
# ---------- PROMPTS ----------
|
| 12 |
+
TRANSCRIPTION_PROMPT = """ Persona: You are an expert transcriptionist specializing in scientific and mathematical documents. Your primary goal is to convert handwritten mathematical work into a perfectly formatted, machine-readable Markdown document using LaTeX for all mathematical notation. Rules: - Transcribe exactly what is written, do not correct errors. - Use $...$ for inline math, $$...$$ for block math. - Ignore struck-through text. - Preserve structure: bold for Q numbers (**1.**), step-by-step math with \\begin{align*}. - If a symbol is ambiguous, mark as [x?]. Output must be a clean Markdown string. """
|
| 13 |
+
GRADING_PROMPT = """ You are an official examiner. Grade the student transcription using the question paper and the official marking scheme. Rules: 1. Apply marks exactly as per the markscheme (M1, A1, etc.). 2. M marks must be earned before A marks. 3. Justify each awarded or withheld mark with clear reasoning. 4. Classify all errors as Conceptual Error, Silly Mistake, or None. 5. Follow dependency between M and A strictly. 6. Do not give marks outside the markscheme. Output must be a structured grading report with reasoning. """
|
| 14 |
|
| 15 |
# ---------- HELPER: Save to PDF ----------
|
| 16 |
def save_as_pdf(text, filename="output.pdf"):
|