atz21 commited on
Commit
a86ae44
·
verified ·
1 Parent(s): a413e10

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -9,7 +9,13 @@ from reportlab.lib.pagesizes import A4
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 ----------
 
9
  genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
10
 
11
  # ---------- PROMPTS ----------
12
+ TRANSCRIPTION_PROMPT = """ Transcribe the PDF into a clean, question-wise format. While doing so, ensure the following:
13
+
14
+ Exclude any text that has been cut, striked, or crossed out (since these may represent student mistakes).
15
+
16
+ Clearly distinguish between a "step cut" and when variables cancel out during a step.
17
+
18
+ Present the transcription neatly without including unnecessary markings. """
19
  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. """
20
 
21
  # ---------- HELPER: Save to PDF ----------