
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
ingredient-parser-nlp
Advanced tools
A Python package to parse structured information from recipe ingredient sentences
The Ingredient Parser package is a Python package for parsing structured information out of recipe ingredient sentences.

Documentation on using the package and training the model can be found at https://ingredient-parser.readthedocs.io/.
Install the package using pip
$ python -m pip install ingredient-parser-nlp
Import the parse_ingredient function and pass it an ingredient sentence.
>>> from ingredient_parser import parse_ingredient
>>> parse_ingredient("3 pounds pork shoulder, cut into 2-inch chunks")
ParsedIngredient(
name=[IngredientText(text='pork shoulder', confidence=0.999193)],
size=None,
amount=[IngredientAmount(quantity='3',
unit=<Unit('pound')>,
text='3 pounds',
confidence=0.999906,,
APPROXIMATE=False,
SINGULAR=False)],
preparation=IngredientText(text='cut into 2 inch chunks', confidence=0.999193),
comment=None,
purpose=None,
foundation_foods=[],
sentence='3 pounds pork shoulder, cut into 2-inch chunks'
)
Refer to the documentation here for the optional parameters that can be used with parse_ingredient .
The 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 Model Guide in the documentation for mode details.
The model has the following accuracy on a test data set of 20% of the total data used:
╒══════════════════════════╤══════════════════════════╕
│ Sentence-level results │ Word-level results │
╞══════════════════════════╪══════════════════════════╡
│ Accuracy: 95.27% │ Accuracy: 98.10% │
│ │ Precision (micro) 98.08% │
│ │ Recall (micro) 98.10% │
│ │ F1 score (micro) 98.09% │
╘══════════════════════════╧══════════════════════════╛
Basic
Train 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 Model Guide documentation.
Web App
The 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 in webtools for a detailed overview.
| Parser | Labeller | Trainer |
|---|---|---|
![]() | ![]() | ![]() |
Documentation
The dependencies for building the documentation are in the requirements-doc.txt file.
Contribution
Please target the develop branch for pull requests. The main branch is used for stable releases and hotfixes only.
Before committing anything, install pre-commit and run the following to install the hooks:
$ pre-commit install
Pre-commit hooks cover both the main python library code and the web app (webtools) code.
FAQs
A Python package to parse structured information from recipe ingredient sentences
We found that ingredient-parser-nlp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.