{"id":13910476,"url":"https://github.com/vburckhardt/markdown-llm-corrector","last_synced_at":"2025-03-16T09:33:39.209Z","repository":{"id":216859958,"uuid":"742382780","full_name":"vburckhardt/markdown-llm-corrector","owner":"vburckhardt","description":" Tool for correcting spelling and improving the style of markdown files using Language Model (LLM) and WatsonX","archived":false,"fork":false,"pushed_at":"2024-05-21T17:02:49.000Z","size":374,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T07:31:15.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vburckhardt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-01-12T10:56:22.000Z","updated_at":"2024-06-01T01:02:51.000Z","dependencies_parsed_at":"2024-01-24T13:43:31.480Z","dependency_job_id":"c061552a-32c9-4cb9-8039-c6a5575a6424","html_url":"https://github.com/vburckhardt/markdown-llm-corrector","commit_stats":null,"previous_names":["vburckhardt/markdown-llm-corrector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vburckhardt%2Fmarkdown-llm-corrector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vburckhardt%2Fmarkdown-llm-corrector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vburckhardt%2Fmarkdown-llm-corrector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vburckhardt%2Fmarkdown-llm-corrector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vburckhardt","download_url":"https://codeload.github.com/vburckhardt/markdown-llm-corrector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243810599,"owners_count":20351554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-07T00:01:27.952Z","updated_at":"2025-03-16T09:33:38.861Z","avatar_url":"https://github.com/vburckhardt.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Markdown LLM Corrector\n\nThis tool processes markdown files, correcting errors and inconsistencies using Large Language Model (LLM).\n\nWhile still undergoing refinement, the tool produces relatively 'usable' results, as demonstrated in the samples section below.\n\n## LLM Model\n\nThe current version leverages the LLAMA 2-70B chat model through IBM WatsonX.\nThe tool is built using [Langchain](https://python.langchain.com/docs/get_started/introduction). The design based on Langchain makes it easy to target other LLMs in the future.\n\n## Samples\n\nSome samples of original markdown files and their automated correction are available under the [samples](./samples/) directory.\n\n## Usage\n\n### Prerequisites\n\nEnsure you have valid IBM Cloud API key and WatsonX project ID set as environment variables.\n\n- Set IBM_CLOUD_API_KEY: Your [IBM Cloud API Key](https://cloud.ibm.com/docs/account?topic=account-userapikey\u0026interface=ui#create_user_key).\n- Set PROJECT_ID: Your Watson Machine Learning [Project ID](https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-project-id.html?context=wx).\n\nEnsure you have [markdownlint](https://www.npmjs.com/package/markdownlint) installed on the machine running this tool. Prior to passing the content to the LLM, the markdown structure is corrected using markdownlint.\n\n### Clone the Repo\n\nClone the `markdown-llm-corrector` repo locally. In a terminal, run:\n\n```bash\ngit clone https://github.com/vburckhardt/markdown-llm-corrector.git\n```\n\n### Install Python Dependencies\n\nTo install, run the following command:\n\n```\npip install -r ./requirements.txt\n```\n\n### Usage\n\nTo use the tool, run the following command:\n\n#### Run with a Single Markdown File\n\n```bash\npython main.py --input_file path/to/your/markdown_file.md\n```\n\n#### Run with a Directory of Markdown Files\n\n```bash\npython main.py --input_dir path/to/directory/containing/markdown_files\n```\n\n#### GitHub Repository\n\nYou can specify a GitHub repository using the `--repo_org` and `--repo_name` flags:\n\n- --repo_org: Specify the GitHub organization of the repository.\n- --repo_name: Specify the name of the GitHub repository.\n\nThe tool opens a PR with the corrected MD files.\n\n```bash\npython main.py --repo_org ORG_NAME --repo_name REPO_NAME\n```\n\n### Options\n\n- `--repo_org`: Specify the GitHub organization of the repository.\n- `--repo_name`: Specify the GitHub repository name.\n- `--input_file`: Provide a path to a single input markdown file.\n- `--input_dir`: Provide a path to a directory containing markdown files.\n- `--working_dir`: Set a working directory for operations. Defaults to a randomly generated directory name.\n\n### Description\n\nThis tool leverages IBM Watson's LLM model to correct Markdown files. It can be utilized to correct a single file or a directory of files. If run on a GitHub repository, it can also create a pull request with the corrected files.\n\n### Contributing\n\nContributions are welcome! Please open a pull request with your proposed changes.\n\n### License\n\nThis project is licensed under the Apache 2 License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvburckhardt%2Fmarkdown-llm-corrector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvburckhardt%2Fmarkdown-llm-corrector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvburckhardt%2Fmarkdown-llm-corrector/lists"}