igriv commited on
Commit
d12a1b1
ยท
verified ยท
1 Parent(s): 1ea9c72

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +103 -90
README.md CHANGED
@@ -1,98 +1,111 @@
1
- # Math Question Validator with OpenAI o3
2
-
3
- A Python tool for validating mathematical questions and answers using OpenAI's o3 model, with automatic reconciliation and quality assessment.
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  ## Features
6
 
7
- - **Automated Answer Validation**: Uses OpenAI o3 model to solve math problems
8
- - **Quality Assessment**: Evaluates question clarity, difficulty, and pedagogical value
9
- - **Smart Reconciliation**: Generates detailed LaTeX documents comparing different solutions
10
- - **Batch Processing**: Handles large datasets with progress tracking
11
- - **File-based Output**: Avoids truncation issues with cloud storage by saving outputs as separate files
12
-
13
- ## Setup
14
-
15
- ### Prerequisites
16
- - Python 3.8+
17
- - OpenAI API key with o3 access
18
- - MiKTeX (optional, for PDF compilation)
19
-
20
- ### Installation
21
-
22
- 1. Clone the repository:
23
- ```bash
24
- git clone https://github.com/YOUR_USERNAME/validator.git
25
- cd validator
26
- ```
27
-
28
- 2. Install dependencies:
29
- ```bash
30
- pip install pandas openpyxl python-dotenv openai tqdm
31
- ```
32
-
33
- 3. Create `.env` file with your OpenAI API key:
34
- ```
35
- OPENAI_API_KEY=your_key_here
36
- ```
37
-
38
- ## Usage
39
-
40
- ### Basic Validation
41
- ```bash
42
- python math_validator.py
43
- ```
44
-
45
- This will:
46
- 1. Load questions from the Excel file
47
- 2. Filter for math/statistics questions
48
- 3. Assess each question's quality
49
- 4. Generate o3 model answers
50
- 5. Compare with reference answers
51
- 6. Create LaTeX reconciliation documents for mismatches
52
-
53
- ### Compile LaTeX to PDF
54
- ```bash
55
- python compile_latex.py
56
- ```
57
-
58
- ## Output Structure
59
-
60
- ```
61
- validation_results/
62
- โ””โ”€โ”€ run_YYYYMMDD_HHMMSS/
63
- โ”œโ”€โ”€ manifest.json # Index of all results
64
- โ”œโ”€โ”€ model_answers/ # Full model responses
65
- โ”‚ โ””โ”€โ”€ q_XXXX_answer.txt
66
- โ”œโ”€โ”€ latex_documents/ # Reconciliation documents
67
- โ”‚ โ””โ”€โ”€ q_XXXX_reconciliation.tex
68
- โ””โ”€โ”€ compiled_pdfs/ # Compiled PDFs (if generated)
69
- โ””โ”€โ”€ q_XXXX_reconciliation.pdf
70
- ```
71
-
72
- ## File Naming Convention
73
-
74
- Files are named using Excel row numbers for easy cross-reference:
75
- - `q_0116_reconciliation.tex` โ†’ Excel row 116
76
- - `q_0117_answer.txt` โ†’ Excel row 117
77
-
78
- ## Models Used
79
-
80
- - **o3**: Primary model for solving mathematical problems
81
- - **gpt-4o**: Quality assessment and question evaluation
82
-
83
- ## Excel Output Columns
84
-
85
- - `model_answer_file`: Path to model's answer
86
- - `answer_match`: MATCH/DIFFERENT/ERROR
87
- - `latex_file`: Path to reconciliation document
88
- - `quality_rating`: excellent/good/fair/poor
89
- - `difficulty_level`: too_easy/appropriate/too_hard/unclear
90
- - `quality_comment`: Detailed assessment
91
 
92
  ## License
93
 
94
- [Your chosen license]
95
 
96
- ## Author
97
 
98
- [Your name]
 
 
 
 
1
+ ---
2
+ title: Math Question Validator
3
+ emoji: ๐Ÿงฎ
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: gradio
7
+ sdk_version: 4.44.0
8
+ app_file: app.py
9
+ pinned: false
10
+ license: mit
11
+ ---
12
+
13
+ # Math Question Validator
14
+
15
+ A powerful web-based tool for validating mathematical questions and answers using state-of-the-art AI models.
16
 
17
  ## Features
18
 
19
+ - ๐Ÿš€ **Multiple AI Models**: Support for o3-mini, GPT-5, Claude 4, Grok 4, DeepSeek, and more
20
+ - ๐Ÿ”„ **Parallel Processing**: Process hundreds of questions simultaneously
21
+ - ๐Ÿ“Š **Detailed Analytics**: Track accuracy, timeouts, and errors in real-time
22
+ - ๐Ÿ“ **LaTeX Reconciliation**: Generate detailed comparison documents for mismatched answers
23
+ - ๐Ÿ–ผ๏ธ **Image Support**: Handle questions with diagrams and figures
24
+ - ๐Ÿ“ˆ **Progress Tracking**: Real-time statistics and progress monitoring
25
+
26
+ ## Quick Start
27
+
28
+ 1. **Upload your Excel file** containing math questions
29
+ 2. **Select models** for solving and reconciliation
30
+ 3. **Configure processing** options (parallel processes, batch size)
31
+ 4. **Start validation** and monitor progress
32
+ 5. **Download results** with detailed analysis
33
+
34
+ ## Setting Up API Keys
35
+
36
+ This app requires API keys to function. Add them in the Spaces Settings:
37
+
38
+ 1. Go to Settings โ†’ Variables and secrets
39
+ 2. Add your API keys:
40
+ - `OPENAI_API_KEY` - For OpenAI models (o3-mini, GPT-5, GPT-4o)
41
+ - `OPENROUTER_API_KEY` - For Claude, Grok, Gemini, and other models
42
+
43
+ ## Input Format
44
+
45
+ Your Excel file should have a "Data" sheet with these columns:
46
+ - `question` - The math question text
47
+ - `correct_answer` or `answer` - The reference answer
48
+ - `raw_subject` - Subject classification (optional, for filtering)
49
+ - `file_url` - Image URL if question has a diagram (optional)
50
+
51
+ ## Output
52
+
53
+ The validator generates:
54
+ - **Validated Excel file** with model answers and match results
55
+ - **LaTeX reconciliation documents** for mismatched answers
56
+ - **Model answer files** with complete solutions
57
+ - **Statistics summary** with accuracy metrics
58
+
59
+ ## Model Recommendations
60
+
61
+ ### For Best Accuracy
62
+ - Solver: o3-mini
63
+ - Reconciliation: gpt-4o
64
+
65
+ ### For Speed
66
+ - Solver: gpt-4o
67
+ - Reconciliation: gpt-4o
68
+ - Use 4-6 parallel processes
69
+
70
+ ### For Cost-Effectiveness
71
+ - Solver: Claude 3.5 Sonnet
72
+ - Reconciliation: Claude 3.5 Sonnet
73
+
74
+ ## Advanced Features
75
+
76
+ ### Parallel Processing
77
+ - Automatically splits large datasets across multiple processes
78
+ - Merges results seamlessly
79
+ - Optimal for 100+ questions
80
+
81
+ ### Custom Ranges
82
+ - Process specific question ranges
83
+ - Useful for testing or resuming interrupted runs
84
+
85
+ ### LaTeX Compilation
86
+ - Optional PDF generation from LaTeX reconciliation documents
87
+ - Requires pdflatex (not available in HF Spaces)
88
+
89
+ ## Limitations
90
+
91
+ - Maximum file size: 200MB
92
+ - Image support requires URLs (local images not supported in HF Spaces)
93
+ - LaTeX PDF compilation not available (use .tex files locally)
94
+
95
+ ## Support
96
+
97
+ For issues or questions:
98
+ - Check the Configuration tab in the app
99
+ - Review error messages in the output log
100
+ - Ensure API keys are correctly set
 
 
101
 
102
  ## License
103
 
104
+ MIT License - Free to use and modify
105
 
106
+ ## Credits
107
 
108
+ Built with:
109
+ - Gradio for the web interface
110
+ - OpenAI, Anthropic, and other AI providers for models
111
+ - pandas for data processing