File size: 3,156 Bytes
d12a1b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1ea9c72
 
 
d12a1b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1ea9c72
 
 
d12a1b1
1ea9c72
d12a1b1
1ea9c72
d12a1b1
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
title: Math Question Validator
emoji: ๐Ÿงฎ
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit
---

# Math Question Validator

A powerful web-based tool for validating mathematical questions and answers using state-of-the-art AI models.

## Features

- ๐Ÿš€ **Multiple AI Models**: Support for o3-mini, GPT-5, Claude 4, Grok 4, DeepSeek, and more
- ๐Ÿ”„ **Parallel Processing**: Process hundreds of questions simultaneously
- ๐Ÿ“Š **Detailed Analytics**: Track accuracy, timeouts, and errors in real-time
- ๐Ÿ“ **LaTeX Reconciliation**: Generate detailed comparison documents for mismatched answers
- ๐Ÿ–ผ๏ธ **Image Support**: Handle questions with diagrams and figures
- ๐Ÿ“ˆ **Progress Tracking**: Real-time statistics and progress monitoring

## Quick Start

1. **Upload your Excel file** containing math questions
2. **Select models** for solving and reconciliation
3. **Configure processing** options (parallel processes, batch size)
4. **Start validation** and monitor progress
5. **Download results** with detailed analysis

## Setting Up API Keys

This app requires API keys to function. Add them in the Spaces Settings:

1. Go to Settings โ†’ Variables and secrets
2. Add your API keys:
   - `OPENAI_API_KEY` - For OpenAI models (o3-mini, GPT-5, GPT-4o)
   - `OPENROUTER_API_KEY` - For Claude, Grok, Gemini, and other models

## Input Format

Your Excel file should have a "Data" sheet with these columns:
- `question` - The math question text
- `correct_answer` or `answer` - The reference answer
- `raw_subject` - Subject classification (optional, for filtering)
- `file_url` - Image URL if question has a diagram (optional)

## Output

The validator generates:
- **Validated Excel file** with model answers and match results
- **LaTeX reconciliation documents** for mismatched answers
- **Model answer files** with complete solutions
- **Statistics summary** with accuracy metrics

## Model Recommendations

### For Best Accuracy
- Solver: o3-mini
- Reconciliation: gpt-4o

### For Speed
- Solver: gpt-4o
- Reconciliation: gpt-4o
- Use 4-6 parallel processes

### For Cost-Effectiveness
- Solver: Claude 3.5 Sonnet
- Reconciliation: Claude 3.5 Sonnet

## Advanced Features

### Parallel Processing
- Automatically splits large datasets across multiple processes
- Merges results seamlessly
- Optimal for 100+ questions

### Custom Ranges
- Process specific question ranges
- Useful for testing or resuming interrupted runs

### LaTeX Compilation
- Optional PDF generation from LaTeX reconciliation documents
- Requires pdflatex (not available in HF Spaces)

## Limitations

- Maximum file size: 200MB
- Image support requires URLs (local images not supported in HF Spaces)
- LaTeX PDF compilation not available (use .tex files locally)

## Support

For issues or questions:
- Check the Configuration tab in the app
- Review error messages in the output log
- Ensure API keys are correctly set

## License

MIT License - Free to use and modify

## Credits

Built with:
- Gradio for the web interface
- OpenAI, Anthropic, and other AI providers for models
- pandas for data processing