The following project is a tool to extract equations from the research papers (images, PDFs, etc.) and convert it into latex code.
This project is heavily utilizes the following projects:
- ScanSSD: Scanning Single Shot Detector for Math in Document Images
- ScanSSD (fork)
- pix2tex - LaTeX OCR
Credit goes to the authors of the above projects, @MaliParag, @lukas-blecher, @jjdredd.
paper2tex.ipynb
is the main notebook. It contains the code to extract equations from the paper. The notebook is self explanatory.
Extracted equations are in boxes with yellow border. In top left corner of each box, there is a number which is the id of the equation, and on the top right corner.
The extracted equations are:
$$\text{id:}0 \Rightarrow {\frac{1}{N}}\sum_{i=1}^{N}\ell(\mathbf{x}_{i},\Theta)$$ $$\text{id:}1 \Rightarrow \Theta_{2}\leftarrow\Theta_{2}-\frac{\alpha}{m}\sum_{i=1}^{m}\frac{\partial F_{2}({\bf x}_{i},\Theta_{2})}{\partial\Theta_{2}}$$ $$\text{id:}2 \Rightarrow \ell=F_{2}(F_{1}(\mathbf{u},\Theta_{1}),\Theta_{2})$$ $$\text{id:}3 \Rightarrow {\frac{1}{m}}{\frac{\partial\ell(\mathbf{x}_{i},\Phi)}{\partial\Theta}}$$ $$\text{id:}4 \Rightarrow \ell=F_{2}(\cdot)$$
- Add a notebook to extract equations from the paper.
- Implement a GPU version of the code.
- Upload it to the
colab
- Find a way to use inference
LaTeX-OCR
in batch mode. - Detect paper borders