Code Monkey home page Code Monkey logo

auptitcafe-sdk's Issues

Enhance price parsing

❔ About

Prices now come in various formats:

input_strings = [
    "Plat côté Terre - 3300 F",
    "Plat côté Mer - 3300 F",
    "Plat Végétarien - 2950 Frs",
    "Suggestion du mois - 2650 Frs",
    "Suggestion du soir - 3300 F",
    "POE BANANE - 1 200F",
    "GATEAU BASQUE CHOCOLAT - 1 200F",
    "L'incontournable - 1200 F",
    "Le café gourmand - 1100 F"
]

image

... this results in manual patches :

🎯 Objective

Create a function that get the right prices.

Plats à emporter : nb de personnes

Récupérer le nombre de personnes

import re

chaine = "Risotto nerone-citrouille-noisette Prix : 1800 Frs BARQUETTE 2 PERSONNES"

# Utiliser une expression régulière pour trouver le nombre de personnes
resultat = re.search(r'(\d+)\s+PERSONNES', chaine)

if resultat:
    nombre_personnes = int(resultat.group(1))
    print("Nombre de personnes :", nombre_personnes)
else:
    print("Aucun nombre de personnes trouvé dans la chaîne.")

:balance_scale: Plats à emporter : Quantité

Hello,
Informations potentiellement intéressantes (http://auptitcafe.nc/a-emporter/) en plus du prix dans la description :

Types de quantité

ml

velouté de carotte, coco et citronnelle. 1000 F le bocal de 750 ml

pièces

Cookies aux pépites de chocolat, noisette, macadamia. 900 F les 6 pièces

g

Petits biscuit sablé au chocolat et fleur de sel. 1000 F les 200 g

:robot: Create a markdown version of the menus (textbook for `llm`) :scroll:

❔ About

HuggingFace has just announced the availability of Hugging Chat Assistant❣️:

image

The purpose of this issue it to prepare a premium quality SYSTEM prompt to improve LLM pertinence (better than csv and directives).

💡 Notice

First manual attempts have proven a tremendous improvement in LLMs answers while providing a very well redacted markdown document.

💰 Benefits & ideas

🎯 Actions

  • Implement the function that create the menu and infos items and put it altogether as a markdown file
  • Create and commit the md file on the repo so anyone can use it

✔️ DoD

From scratch on Kaggle (for example), show how to generate the menu markdown:

!pip install auptitcafe --upgrade

from auptitcafe.menus import Menus
Menus.save_to_markdown()
%%markdown
menus.md

Plats à emporter : prix

import re

chaine = """Bo Bun de boeuf, concombre, salade verte, vermicel, boeuf
 mariné sauté, sauce nioc mam, cacahuète. Prix : 1500 Frs BARQUETTE 1 PERSONNE"""

# Utiliser une expression régulière pour trouver le prix
resultat = re.search(r'Prix : (\d+) Frs', chaine)

if resultat:
    prix = int(resultat.group(1))
    print("Prix :", prix, "Frs")
else:
    print("Aucun prix trouvé dans la chaîne.")

:bomb: TypeError: 'NoneType' object is not subscriptable :bomb:

  • Plus d'image
  • Plus de recette
title : <~ à l'ardoise, du mardi 23 au 26 MAI 2023 ~>
name : <Plat côté Terre - 3300 F>
Titre plat : <Plat côté Terre>
recette : <>
Prix : <3300>
Catgory : <PLAT>
❯ ./menus.py
title : <~ à l'ardoise, du mardi 23 au 26 MAI 2023 ~>
Traceback (most recent call last):
  File "/home/adriens/./menus.py", line 21, in <module>
    image = menu.find('img')['src']
            ~~~~~~~~~~~~~~~~^^^^^^^
TypeError: 'NoneType' object is not subscriptable

img_url -> NaN

When image url is empty, send back empty content instead of NaN

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.