Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rchongo2019
Contributor
Contributor

data science - Python

Hi everbody. I have a final job of the text mining module, and I am in difficulties to solve the problem proposed, so I requested a support to follow up the work in python:

The objective is to program a function that receives as input a user text and returns the text fragments (chunks) that refer to the meals and quantities that you have requested. It is not necessary, nor is it the objective of this exercise, to build a classifier of intention prior to this function, but simply a function that we presuppose receives a phrase with the intention 'Order_food'. Nor is it objective to normalize the output (eg, it is not necessary to convert 'three' to '3' or 'pizzas' to 'pizza'). It is, therefore, an exercise of minimums.

Por ejemplo: “quiero 3 bocadillos de anchoas y 2 pizzas” →
 
     {comida:'bocadillo', ingrediente:'anchoas', cantidad:3},
     {comida:'pizza', ingrediente:'null', cantidad:2}
 

Therefore, the output of the function will be an array with dictionaries of 2 elements (food and quantity). When an amount is not detected, its value will be set to '1' as the default value.

best regards.

3 Replies
JordyWegman
Partner - Master
Partner - Master

Hi,

What is the problem here? Do you want to get the results back in Qlik? Do you want interaction for the user?

Jordy

Climber

Work smarter, not harder
rchongo2019
Contributor
Contributor
Author

For this exercise one is going to imagine that one works for a company of food shipments, present in all the national territory, with thousands of orders every day. This company has a historical file with all the requests for food that customers have made through the chat on their website in recent months. They need to analyze in real time what foods the users are asking for and what ingredients they had, since in the chain of food stock it is necessary to make a forecast so as not to run out of cooked dishes. It has been calculated that the impact on sales each time one of the dishes is no longer available is 7% of losses in that week, due to the abandonment of the website of orders by the customer. Therefore, it is vitally important to be able to automatically make estimates in this regard.

I want an algorithm that takes what the user typed and returns the result in the form:
Por ejemplo: “quiero 3 bocadillos de anchoas y 2 pizzas” →
     {comida:'bocadillo', ingrediente:'anchoas', cantidad:3},
     {comida:'pizza', ingrediente:'null', cantidad:2}
 

 

JordyWegman
Partner - Master
Partner - Master

Yes I get the issue and what you are trying to solve. But you are talking about Python. What has Qlik Sense to do with this? 

You can make your algorithm in Python, get the results, write them in a txt file and reload this in Qlik Sense. Depending on the amount of data and the speed of the algorithm, you can schedule this every 5 minutes for example.

But I don't think you want this formula in Qlik Sense.

Jordy

Climber

Work smarter, not harder