{"id":17234645,"url":"https://github.com/strangetom/ingredient-parser","last_synced_at":"2026-01-31T12:03:13.272Z","repository":{"id":58090622,"uuid":"418179759","full_name":"strangetom/ingredient-parser","owner":"strangetom","description":"A tool to parse recipe ingredients into structured data","archived":false,"fork":false,"pushed_at":"2026-01-29T20:45:14.000Z","size":274479,"stargazers_count":125,"open_issues_count":2,"forks_count":19,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-30T08:53:21.042Z","etag":null,"topics":["ingredients","natural-language-processing","nlp","python","recipes"],"latest_commit_sha":null,"homepage":"https://ingredient-parser.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/strangetom.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-10-17T15:52:12.000Z","updated_at":"2026-01-25T05:00:44.000Z","dependencies_parsed_at":"2023-12-29T13:22:57.554Z","dependency_job_id":"d9311884-2ecc-4721-ac73-97dcb33006d7","html_url":"https://github.com/strangetom/ingredient-parser","commit_stats":{"total_commits":277,"total_committers":1,"mean_commits":277.0,"dds":0.0,"last_synced_commit":"ce749a9ba8358da7d1f4eaaca446d72650d2e01b"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/strangetom/ingredient-parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangetom%2Fingredient-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangetom%2Fingredient-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangetom%2Fingredient-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangetom%2Fingredient-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strangetom","download_url":"https://codeload.github.com/strangetom/ingredient-parser/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strangetom%2Fingredient-parser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28941930,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T11:39:38.044Z","status":"ssl_error","status_checked_at":"2026-01-31T11:39:27.765Z","response_time":128,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ingredients","natural-language-processing","nlp","python","recipes"],"created_at":"2024-10-15T05:29:56.017Z","updated_at":"2026-01-31T12:03:13.267Z","avatar_url":"https://github.com/strangetom.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ingredient Parser\n\nThe Ingredient Parser package is a Python package for parsing structured information out of recipe ingredient sentences.\n\n![](docs/source/_static/logos/logo_wide.png)\n\n## Documentation\n\nDocumentation on using the package and training the model can be found at https://ingredient-parser.readthedocs.io/.\n\n## Quick Start\n\nInstall the package using pip\n\n```bash\n$ python -m pip install ingredient-parser-nlp\n```\n\nImport the ```parse_ingredient``` function and pass it an ingredient sentence.\n\n```python\n\u003e\u003e\u003e from ingredient_parser import parse_ingredient\n\u003e\u003e\u003e parse_ingredient(\"3 pounds pork shoulder, cut into 2-inch chunks\")\nParsedIngredient(\n    name=[IngredientText(text='pork shoulder', confidence=0.996867, starting_index=2)],\n    size=None,\n    amount=[IngredientAmount(quantity=Fraction(3, 1),\n                             quantity_max=Fraction(3, 1),\n                             unit=\u003cUnit('pound')\u003e,\n                             text='3 pounds',\n                             confidence=0.999982,\n                             starting_index=0,\n                             unit_system=\u003cUnitSystem.US_CUSTOMARY: 'us_customary'\u003e,\n                             APPROXIMATE=False,\n                             SINGULAR=False,\n                             RANGE=False,\n                             MULTIPLIER=False,\n                             PREPARED_INGREDIENT=False)],\n\tpreparation=IngredientText(text='cut into 2 inch chunks',\n                               confidence=0.999946,\n                               starting_index=5),\n\tcomment=None,\n\tpurpose=None,\n\tfoundation_foods=[],\n\tsentence='3 pounds pork shoulder, cut into 2-inch chunks'\n)\n```\n\nRefer to the documentation [here](https://ingredient-parser.readthedocs.io/en/latest/tutorials/options.html) for the optional parameters that can be used with `parse_ingredient` .\n\n## Model\n\nThe core of the library is a sequence labelling model that is used to label each token in the sentence with the part of the sentence it belongs to. A data set of 81,000 example sentences is used to train and evaluate the model. See the [Explanation](https://ingredient-parser.readthedocs.io/en/latest/explanation/index.html) section of the documentation for more details.\n\nThe model has the following accuracy on a test data set of 20% of the total data used:\n\n```\n╒══════════════════════════╤══════════════════════════╕\n│ Sentence-level results   │ Word-level results       │\n╞══════════════════════════╪══════════════════════════╡\n│ Accuracy: 95.25%         │ Accuracy: 98.09%         │\n│                          │ Precision (micro) 98.07% │\n│                          │ Recall (micro) 98.09%    │\n│                          │ F1 score (micro) 98.08%  │\n╘══════════════════════════╧══════════════════════════╛\n```\n\n## Development\n\n**Basic**\n\nTrain and fine-tune new ingredient datasets to expand beyond the existing trained model provided in the library. The development dependencies are in the `requirements-dev.txt` file. Details on the training process can be found in the [Explanation](https://ingredient-parser.readthedocs.io/en/latest/explanation/index.html) documentation.\n\n**Web App**\n\nThe ingredient parser library provides a convenient web interface that you can run locally to access most of the library's functionality, including using the parser, browsing the database, labelling entries, and training the model(s). View the [specific README](webtools/README.md) in webtools for a detailed overview.\n\n| Parser | Labeller | Trainer |\n| :------- | :------- | :------- |\n| ![Screen shot of web parser](docs/source/_static/webtools/app.parser.screenshot.png)     | ![Screen shot of web labeller](docs/source/_static/webtools/app.labeller.screenshot.png)     | ![Screen shot of web trainer](docs/source/_static/webtools/app.trainer.screenshot.png)   |\n\n**Documentation**\n\nThe dependencies for building the documentation are in the `requirements-doc.txt` file.\n\n**Contribution**\n\nPlease target the **develop** branch for pull requests. The **main** branch is used for stable releases and hotfixes only.\n\nBefore committing anything, install [pre-commit](https://pre-commit.com/) and run the following to install the hooks:\n\n```bash\n$ pre-commit install\n```\n\nPre-commit hooks cover both the main python library code and the web app (webtools) code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrangetom%2Fingredient-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrangetom%2Fingredient-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrangetom%2Fingredient-parser/lists"}