So i'm creating a chatbot, where users can ask faq's and place orders for items for loans. One bit i'm struggling with is how to pair paramaters and values when a user makes an order for multiple things in one sentence.
So for example:
User wants to order 5 items with varying quanititys:
"I'd like to order 3 phones, 2 cases, 3 power cables, 1 screen protector, and 1 bluetooth speaker".
I'd like it to do this and associate the quantity with the item. so something like:
3 - Phones
2 - Cases
3 - Power cables
1 - Screen protector
1 - Bluetooth speaker
Thanks!
One way to pair the amount and a product together would be by using composite entities.
https://cloud.google.com/dialogflow/docs/entities-developer#developer_composite
Composite entities allow you to pair to values together in a single entity. So in your case you could have a composite entity named order, which contains an amount (Number) entity and a product entity.
By giving the appropriate sample utterances, you can train your agent to recognize this order entity and by checking the "Is List" option in the parameters you should be able to get multiple orders and have their product with the paired amount in a single entity.
Hope that this helps.
Related
I would like to ask a question on how to correctly display single or multiple transactions if a user has more than one purchase from different stores in day. If a user bought once it will display "single" and if the user bought more than once it will display "multiple"
For reference, column F is for determining if the user bought more than once, 0= first transaction and 1= other transactions. If a user has only 0 and no 1s then it is considered single transaction only. I tried using this formula in column H:
=IF(COUNTIF(A$2:A2,A2)=1,
IF(COUNTIFS(A$2:A2,A2,D$2:D2,D2)>1,
OFFSET(A$2,MATCH(A2&D2,$A$2:A2&A2&$D$2:D2,0)-1,1),
MAX(IF($A1:A$2=A2,$F1:F$2))+1))
but, it was not showing the result I want.
If I understand your question correctly, it should be possible to use SUMPRODUCT to accomplish this.
Try: =IF(SUMPRODUCT(--(A:A=A2),--(D:D=D2))>1,"mutiple","single")
I'm trying to categorize my service requests based on key words which can be found either in the request description or request solution. My list of keywords is independent from my database. So I can't come up with the code necessary to lookup various text strings from one table in the columns of another (non-related) table.
My first table (called Comp_build) has 4 columns (each for Installs, Instructions, Security, and Troubleshoot) and below is a sample of it with keywords
Install Troubleshoot Security Instructions
request error Security driven create automated
onboarding fail package
deploy
My second table (called Comp_determination) has 3 columns: Category (calculated column), SR Description, SR Solution
I've played around with:
SWITCH
TRUE
IF
FIND
SEARCH
SUMX
CALCULATE
This is the closest I've been able to find (https://powerpivotpro.com/2014/01/containsx-finding-if-a-value-in-table-1-has-a-matching-value-in-table-2/) but the results aren't consistent. it seems to work correctly if I'm looking up my install keywords but if I try with security keywords, my entire column Category is populated with "Security"
category = IF(SUMX(comp_build,FIND(comp_build[Install],comp_determination[SR Description],,0))>0,"Installations","")
I want to identify all cases bases on keywords and assign them a request category. Since we receive essentially 4 major categories of requests, I have keywords for each category - located in a separate table and each in their column. Additionally, I can search for the key words in two places - either in the request description or the request solution.
I get the "relationships between tables may be needed" message in Excel 2016 PowerPivot. I suspect this is because I've got a many-to-many relationship, but lack experience to be sure. I'll be happy to read up on it if someone can help me put a name on the problem.
The data that I'm analyzing looks like this:
Units - Instances of a product. E.g. the computer was produced 100 times = 100 units. Each unit has ONE ProductID, and a UnitID (unique). Units have e.g. a production time.
Products - Each product can consist of several items. A product could be computer xyz = "laptop xyz, driver CD, manual, power brick, 2 chocolates and mains cable". Each product has a unique ProductID and an PackListID. Several products can have the same PackListID.
PackList - Unique PackListIDs
CompositeList - for each PackListID, this can contain several ItemIDs and number included in packing list (e.g. 2 pieces of chocolate)
Items - line items for a product packing list, e.g. "manual for computer xyz"
I want to answer the question: How many (compositelist.number) line items of each Items have been included in units produced on a particular date (units.date).
I read the data by SQL from a existing application/database server. I cannot influence how the data is structured :(
I've imported my data and connected as follows:
Unit.ProductID -> Product.ProductID (each product can have many units)
Product.PackListID -> PackList.PackListID (bridge table)
PackList.PackListID -> CompositeList.PackListID (each packlist can have many composite-rows)
CompositeList.ItemID -> Items.ItemID (each composite-list refers to one item)
If I filter by PackListID, the result is a correct list of line items with sums.
Now I'd like to multiply that with the number of times that packlist has been produced on a particular day...
My pivot looks like this:
Filter: Production date, filter to a particular date
Rows: Items.text
Values: Sum of compositelist.number
I would love to see the number of line items used in production on a certain day, e.g. 15 manuals and 32 mains cables.
Unfortunately I get the message "Relationships between tables may be needed".
I need to create an excel database for a simulation with about 1000 users. Each user has a shopping list with between 0-100 items.
I have separately created a random list of shopping items with 300 items in total.
What I would like to know is how do I randomly assign shopping items to each user without repeating the item twice in each users shoppig bag (users can only have carrots for example appear once in their shopping bag) and given that each user might have different number of items in their shopping bag? Thank you for your help, Sue
This is exactly like shuffling and dealing playing cards (with 300 items rather than 52 cards):
For each player
randomize the items
pick a random number of samples
assign that user those samples
repeat for the next user
Using this approach, a given user cannot have any item repeated (just like a user cannot be dealt 2 3-of-hearts). Therefore, removing duplicates is not an issue.
This can easily be simulated in Excel.
I have a view with column totals.
What I want is to sort the totals-column in a Xpages-view or repeat-control.
I am able to get the totals to display but cannot sort them.
Any suggestions?
Not very clean. I wouldn't do that in production - for performance reasons - it's a brute force solution, but it should work for fair amount of categories (up to few hundreds).
Assume the view can be used for category lookups (similar to show single category). Then all you need is list of categories in correct order - based on totals and not alphabetical order. Therefore, in first cycle, loop through all categories (use NotesNavigator with cache) and store them as pair of values - (category, totals). It may be Map[String,Double] or Set[Category] where Category is POJO with category and totals attributes. In both cases you will need your own Comparator. If your categories are hierarchical, use only top level category (sorting of tree structure is more complicated).
For example:
Australia (5)
Brazilia (10)
Chile (7)
will sort as
Brazilia (10)
Chile (7)
Australia (5)
Cache this collection in viewScope (assuming totals are "static" for short period of time, user will need to reload the page to get updated data).
Feed this collection to repeater with simple data table (or view or repeater) showing only selected category.
GUI will be a bit odd with pagers (pager for categories and pager for content of category), but you will handle this, I hope.
It's probably better to ask can this type of sorting or resorting be done in Notes rather than can it be done in XPages. If it can be done in Notes then you should be able to do the same in XPages - sometimes automatically.
XPages can only do so much with the view datasource. So if the datasource can't sort the categories by the totals then you won't be able to do this in XPages. At least not out of the box.
You might be able to do something with repeats - doing a lookup of the datasource, retrieving all documents under a certain category that has the highest total before moving on to the next category in the sequence - but it likely to become pretty complicated and not worth it in the end.
Sorry if it's not the answer you're looking for.
I will try to clarify it.
There is an categorized view. Category is for example Company name.
In the view is a column with totals, so the category has also a total.
The wish is that this categorized view will show the company category, who has the highest total at the top of the view, without losing the categorization