Api.ai intent hierarchy and duplicates - machine-learning

Suppose we have the follow scenario
how much does debit card cost?
what is the expiration date? (refers to debit card)
how can I have a new one? (refers to debit card)
how much does credit card cost?
what is the expiration date? (refers to credit card)
how can I have a new one? (refers to credit card)
I've configured intents as below
Debit card cost
Debit card expiration date
Debit card new
Credit card cost
Credit card expiration date
Credit card new
In this way i'm able to reply to questions 1 and 4 but not 2, 3, 5 and 6.
I've, also, tried to use the context (https://docs.api.ai/docs/concept-contexts), but i think it doesn't help us.
Can you show me, please, a solution to implement the above scenario?

Aside: Your question should have provided a link to your prior api.ai discussion to provide more context. Also, your question, as stated, was misleading as you did not provide all relevant variant phrases for each of your intents. For example, you should have stated that intent #2 supported phrases like "what is the expiration date for the debit card" (without needing a prior invocation of intent #1). In future, please provide all relevant details.
Contexts are the correct way to handle this.
For example:
Give the intent for #1 an output context of "debit".
Give the intent for #4 an output context of "credit".
Give the intents for #2 and #3 the input and output context of "debit".
Give the intents for #5 and #6 an input and output context of "credit".

Related

Flutter: Using the iOS Promotional Offers

I am having some hard time trying to use iOS subscriptions promotional offers.
I was able to retrieve the discounts list from the productDetails after casting it to AppStoreProductDetails.
if (Platform.isIOS) {
List<SKProductDiscountWrapper> discounts = (productDetails as AppStoreProductDetails).skProduct.discounts;
}
However I have two problems
1 - discount object has no identifier, which makes it complicated to get a specific discount especially if a subscription has more than one offer
2 - How to apply the the discount when making the purchase?
_inAppPurchase.buyNonConsumable(purchaseParam: purchaseParam);
PurchaseParam (also AppStorePurchaseParam) doesn't take discounts as params, where should we then use those discount objects?
any help or hint would be welcome. Thanks.

what's the best way to unpivot a data to create a structured data base in google sheets

The best approach to understand what i need is taking a look at the sample spreadsheet
https://docs.google.com/spreadsheets/d/1AyqCMvbjUt3nlqvE2ZLbmPfixwh_i1nIl9HMTn4pETY/edit?usp=sharing
What i need is unpivot the data:
1st date payment
xx months depending on the months entered in Col G (here i need to round the amount of the monthly payments, and in the last payment adjust the amount, so i don't get cents in the monthly payments divided)
last date payment
i believe the best way is generate a data base ordered correctly, from there know in which date every client has a due date for his payment
The way im entering the data is as the sample sheet shows from A:J
And my expected result is in range L:P
any help on this please will be very much appreciated
This is probably best handled by breaking the problem in 2 parts. Monthly payments and First/Last Payments. I've laid out one possible solution on your sheet in a tab called MK.Idea.
I used a SPLIT(FLATTEN( technique to generate both sets of cashflows and then a simple query to stack and order them.
This formula generated the monthly flows:
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN('S1'!A2:A&"|"&'S1'!B2:B&"|"&MROUND(('S1'!D2:D-'S1'!E2:E-'S1'!I2:I)/'S1'!G2:G,100)&"|"&EDATE('S1'!H2:H,SEQUENCE(1,MAX('S1'!G2:G),0))&"|"&EDATE('S1'!H2:H,'S1'!G2:G)&"|"&"Monthly "&SEQUENCE(1,MAX('S1'!G2:G),1)),"|",0,0),"select Col4,Col1,Col2,Col6,Col3 where Col4<Col5"))

I am trying to find credit cards using FTK

I am doing an assignment where we have to find 5 voyager credit cards using an image file given to us by our professor. The credit cards all start with 8699 and end with 1-5. We are using FTK 1.81.6
8699\d{11}[1-5]
This is what I came up with to find them but when I search I get no results.

Rails + Sessions: Safe to store partial credit card info in session?

I am working on a checkout and I want it so that on the "order summary" page, the user will see their credit card info like Card Number: ************1111, Expiration Date: 12/15. I'm not saving the credit card info since that's against standards, so I'm thinking I could save the last 4 digits of the user's credit card info + the expiration date in my session when the user inputs it on the billing information page so that on the "order summary" page it'll show.
Is this against e-commerce standards?
Do it. You are allowed to print "Card Number: ******1111" on a piece of paper, and that's permanent and leakable. Hence you are allowed to store only those 4 characters in your database, and print them at need.
The expiration date, however, IS sensitive (BC it participates in authorization), so lose it.
(2 years working with payment gateways experience here...)

Quickbooks: Adding a negative value to an invoice using the QBDSK

Is there any way to add a line item containing a negative amount to an existing invoice?
I'm using QBSDK7 and QB Enterprise. (and if it matters .Net 3.5)
What we're attempting to do is automate the way we're creating invoices. We're already pulling in employee's time and applying it to the correct invoices, but when we go to add credits (just a negative amount on a line item on the invoice) using
InvoiceLineMod.Amount.SetValue(-1234)
it fails with the error "Transaction must be positive"
I've also tried adding a Service Item with a negative amount and giving it a positive quantity and I get the same result.
This seems like such a no-brainer as we have been doing this manually for the last 10 years. I'm guessing there is artificial restriction on this.
Some things to consider:
Credit Memos are no good as we need to display exact details of the reduction on the same page.
We don't have payments to apply yet in most cases.
This need to be done before any retainers are applied.
Any help would be greatly appreciated.
Can you show the complete code you're using to modify the invoice? Can you also show the exact error message you're getting?
It is possible, though to do you need to make sure that you're using a Discount Item as your ItemRef type (a Service Item will not work), and you need to make sure that the transaction as a whole is for a positive amount.
Sometimes our app has to adjust an invoice down with a negative number. I have been able to add negative line items using the following code. I have to set a quantity and a rate, instead of setting the amount.
IInvoiceLineAdd ila = ia.ORInvoiceLineAddList.Append().InvoiceLineAdd;
ila.ItemRef.ListID.SetValue(GetQBID(JobKey));
ila.Desc.SetValue("Adjustment");
ila.Quantity.SetValue(1);
ila.ORRatePriceLevel.Rate.SetValue(-1.00);
Quickbooks doesn't allow you to post an invoice with a negative balance. If you try to do it through the UI, it prompts you to create a credit memo instead. (And vice-versa if you try it with a credit memo.)
You can enter negative quantities and/or prices into the line items, but the total of the invoice has to be >= 0 or it won't post (i.e., add other line items that offset the negative amounts).
The solution is to use credit memos. Your client-side processing will be more complicated, but it's the only choice with Quickbooks.

Resources