{"id":20260169,"url":"https://github.com/sabasyed/latex-to-code","last_synced_at":"2026-05-28T13:31:50.592Z","repository":{"id":258390490,"uuid":"850024143","full_name":"SabaSyed/Latex-to-Code","owner":"SabaSyed","description":"Python codes generation from latex expressions. Using synthetic dataset and CodeT5-base model. ","archived":false,"fork":false,"pushed_at":"2024-10-16T20:39:32.000Z","size":11039,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T18:47:55.224Z","etag":null,"topics":["fine-tuning","inferencing","large-language-models","latex-to-python","llm","llm-deployment","llm-models","postprocessing","synthetic-data","t5-base","t5-model","transformer-models","transformers"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SabaSyed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-30T18:09:57.000Z","updated_at":"2024-10-16T21:02:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"346a7122-10d7-43ce-b515-bc593f99eeda","html_url":"https://github.com/SabaSyed/Latex-to-Code","commit_stats":null,"previous_names":["sabasyed/latex-to-code"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SabaSyed/Latex-to-Code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SabaSyed%2FLatex-to-Code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SabaSyed%2FLatex-to-Code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SabaSyed%2FLatex-to-Code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SabaSyed%2FLatex-to-Code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SabaSyed","download_url":"https://codeload.github.com/SabaSyed/Latex-to-Code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SabaSyed%2FLatex-to-Code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33611248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fine-tuning","inferencing","large-language-models","latex-to-python","llm","llm-deployment","llm-models","postprocessing","synthetic-data","t5-base","t5-model","transformer-models","transformers"],"created_at":"2024-11-14T11:18:15.577Z","updated_at":"2026-05-28T13:31:50.587Z","avatar_url":"https://github.com/SabaSyed.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LaTeX to Python Code Converter\n\nThis project focuses on converting mathematical expressions written in LaTeX into executable Python code. We fine-tune a pre-trained transformer-based model on a custom synthetic dataset of LaTeX expressions and their corresponding Python code.\n\nThe goal is to allow automated translation of complex mathematical formulas into Python code, making it easier for users to execute or analyze mathematical expressions programmatically.\n\n## Dataset\n\nThe dataset used for training consists of synthetic examples that pair LaTeX expressions with their equivalent Python code. The dataset contains various types of mathematical expressions including:\n\n- **Multivariable equations**\n- **Trigonometric functions**\n- **Geometric expressions**\n- **Diophantine equations**\n- **Summations**\n- **Differentiation equations**\n- **Exponential equations**\n- **Quadratic equations**\n- **Integration equations**\n- **Logarithmic equations**\n- **Algebraic equations**\n- **Derivatives**\n\n### Data Access\n\nThe training data is provided in a zipped format (`train.zip`). To use the dataset, unzip the file.\n\n## Training the Model\n\nTo fine-tune the model on the dataset, you can use the provided `train.py` script:\n\n```bash\npython train.py\n```\n\nThis will fine-tune the model using the training data, allowing the model to learn the mapping from LaTeX expressions to Python code.\n\n## Inference\n\nTo convert a LaTeX expression into Python code using the fine-tuned model, run the `inference.py` script:\n\n```bash\npython inference.py\n```\n\nThe model will output the corresponding Python code for the provided LaTeX expression.\n\n## Testing the Model on Hugging Face Space\n\nYou can also test the model on Hugging Face without installing anything. Visit our Hugging Face Space to try out the LaTeX-to-Python conversion app:\n\n[https://huggingface.co/spaces/sabssag/Latex_to_Python_CodeT5-base](#)\n\nSimply enter a LaTeX expression, and the model will generate the equivalent Python code.\n\n## Requirements\n\nTo set up the environment and install dependencies, use the provided `requirements.txt`:\n\n```bash\npip install -r requirements.txt\n```\n\n## Future Directions\n\nWe plan to improve the dataset by expanding the variety of expressions and optimizing the model for faster and more accurate conversions. Feel free to contribute by providing feedback or opening issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabasyed%2Flatex-to-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsabasyed%2Flatex-to-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsabasyed%2Flatex-to-code/lists"}