Translate the image of a mathematical formula into LaTeX code.
The code in this repository comes from nougat-latex-ocr, and I just used more open-source data for training based on it.
img2latex-230K: https://zenodo.org/records/7738969
im2latex-100K: https://zenodo.org/records/56198#.V2px0jXT6eA
There are over 540,000 filtered image-equation pair.
1/50, that is, more than 10,000 data were used as the validation set, and the evaluation results are as follows:
model | token_acc ↑ | normed edit distance |
---|---|---|
pix2tex | 0.5346 | 0.10312 |
pix2tex* | 0.60 | 0.10 |
nougat-latex-based | 0.623850 | 0.06180 |
MathImg2Latex | 0.7131 | 0.3948 |
- Prepare your dataset in this format
- Change
config/base.yaml
- Run the training script
python tools/train_experiment.py --config_file config/base.yaml --phase 'train'
Please refer to examples/predict.py and examples/run_latex_ocr.py.