Zephyrnet Logo

Voice Recognition Bakery Solution

Date:

Project set up

I follow through the follow guilde to set up my voice kit, including the API credential for Google Voice to text.

Scraping data

Here is where I get all my data, and I use Beautiful4 to retrieve necessary information such as Date, Quantity, Product, Customer, and Dayref to store into panda dataframe. I also clean the data here by coverting all the DayRef cells display ‘#N/A’ to ‘yesterday’, lowercase all the letters, and remove parenthesis.

Orders Dataframe

Transform Speech to Text

I call Google Speech to Text API to convert the speech to text, however for this project, there are a lot of product names and customer names which aren’t standard english words, so I have to pass these non-standard product names and customer names to the API as hint words so it can recognize them better.

Intent Classification Model

Currently the model will classify query into one of four categories. These four categories are:

  • productOrder: what is mini croissant order for tomorrow?
  • who: Who gets 10 plain croissants today?
  • quantity: How many baguettes does Novo get today?
Common Prefix for customerOrder:
['what is ', 'tell me about ', 'I want to know ', 'do you know ']
Common Prefix for productOrder:
[‘what is ‘, ‘tell me about ‘, ‘I want to know ‘, ‘do you know ‘, ‘can you tell me ‘]
Common Prefix for who:
['who ', 'tell me who ', 'I want to know who ', 'do you know who ']
Common Prefix for quantity:
['how many ', 'tell me how many ']

Entity Extraction

At first I was thinkg using Spacy to train a custom model for entity extraction, however I found that it’s not necessary since our data set it small so I can retrieve all the possible customer and product names and use that to check if query contains product or customer. However this method sometimes doesn’t work when the speech recognition fail to translate to text.

Input: How many bacon date scone does cornercopia get today?
Recognized: How many bacon date scone does cornucopia get today?

Find the correct data to Respond

After the model classify the query into one of the four buckets. The program extract the entity from the query. If it can’t extract any entity, it will just respond with “I do not understand, please ask me another question”, otherwise it will create filters based on these entities and get the correct result back from dataframe.

Q: what is scout order for tomorrow?
Intent: customerOrder
Entity: {Time: tomorrow, Customer: Scout}
Response: Scout gets 38 morning bun 20 mini croissant 15 ham and cheese croissant 15 chocolate croissant tomorrow.

Coinsmart. Beste Bitcoin-Börse in Europa
Source: https://chatbotslife.com/voice-recognition-bakery-solution-1cdb06cf636e?source=rss—-a49517e4c30b—4

spot_img

Latest Intelligence

spot_img