Skip to content

msdkhairi/math2latex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

math2latex is a tool that converts math images to LaTeX format. It provides a convenient way to convert handwritten or scanned math equations into LaTeX code, making it easier to incorporate them into documents or use them in mathematical typesetting.

Visualization of the task of math2latex

Installation

To use math2latex, follow these steps:

  1. Clone the repository:

    git clone https://github.com/msdkhairi/math2latex.git
  2. Navigate to the project directory:

    cd math2latex
  3. Install the required dependencies:

    pip install -r requirements.txt

Usage

To prepare the data for conversion, run the following command in the root directory of the repository:

python math2latex/data/prepare_data.py --dataset-dir "dataset"

This will create a dataset folder with all the dataset files inside --dataset-dir directory.

Training

The configuration for the training process can be found in the math2latex/config/config.py file. To train the model, run the following command in the root directory of the repository:

python math2latex/train.py

This will train the model using the dataset and save the trained model in each epoch in the runs directory.

Test

To test the model, run the following command in the root directory of the repository:

python math2latex/test.py

This will test the model using the test dataset and print the BLEU score, Edit Distance and Exact Match of the model.

Demo

To run the demo, run the following command in the root directory of the repository:

python demo.py

This command runs a demo of the tool, allowing you to see its functionality in action.

License

math2latex is licensed under the MIT License. See the LICENSE file for more details.

About

Convert Math Images to Corresponding Latex

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages