feat: Migrate from CRF++ to Ingredient Parser (a Python package) (#5061)

This commit is contained in:
Michael Genson
2025-02-28 08:17:28 -06:00
committed by GitHub
parent ec1a9d78ac
commit b12aea8272
19 changed files with 367 additions and 592 deletions

View File

@@ -1,21 +0,0 @@
import requests
from mealie.services.parser_services import crfpp
MODEL_URL = "https://github.com/mealie-recipes/nlp-model/releases/download/v1.0.0/model.crfmodel"
def main():
"""
Install the model into the crfpp directory
"""
r = requests.get(MODEL_URL, stream=True, allow_redirects=True)
with open(crfpp.MODEL_PATH, "wb") as f:
for chunk in r.iter_content(chunk_size=1024):
if chunk:
f.write(chunk)
if __name__ == "__main__":
main()