I have edited the transfer_money_form with an additional OTP number (numerical), however, duckling captures the OTP and overwrites the amount-of-money slot as well.
Example:
Person: Transfer 5000 to John (Bot sets slots amount-of-money: 5000 and PERSON: John)
Bot: Please enter OTP
Person: 1234 (Bot sets both amount-of-money and OTP slots to 1234)
Bot: OTP correct. Transfered $1234 to John
This happens because both slots are filled with ‘number’ duckling entity.
are you using the duckling amount-of-money extractor? Usually the amount-of-money won’t extract simply numbers out of text unless a currency is mentioned in the pattern.
in the form, you can even specify which intents to exclude with respect to slot mappings
take a look at this exmaple - Forms
the not_intent is something you can specify for the amount-of -money slot so that it avoids the capturing OTP intent.
Any available solutions? we want to avoid overwritting the amount-of-money (can be filled with number entity) when user inputs the otp (filled by number entity)
As far i remember the duckling parser for amount-of-money, i find it surprising that an ordinary number without any currency mentioned is being picked up by amount-of-money.
have you provided tagged examples for amount-of-money in the training data?
duckling works in haskell with a very strong regex pattern to extract currency patterns and it does not require training examples. if you have given training examples for the same, you are not “training” a duckling extractor but DIET which maybe is filling the slot instead. try removing all tagged examples of duckling amount-of-money from the training examples.
p.s i wrote the amount of money extractor in duckling for dutch 2 years ago so as far as i know, amount-of-money can’t just pick numbers in random, it does not have a regex for that
Hello souvikg10, please note that the amount-of-money slot in the financial demo example, can be filled with duckling amount-of-money enitity or number enitity. please check the domain file I have provided.
This behaviour is needed so you do not need to provide a currency.
i understand. then perhaps the creators of the demo could help @akelad.
I can’t think of any other way to implement this. sorry
personally coming from a financial industry, i would never imagine a number being considered amount of money because it adds a huge level of randomness to a field which is considered very highly in banking - “Money”. i think amount-of-money should only look for patterns where the user indicates currency and thus in duckling rules, this has been strictly maintained. in our case, we guided the user to input the currency or currency symbols if you don’t control the UI and added further validation steps. numbers are very random and can occur in multiple scenarios and thus i would refrain from using numbers as part of the enttiy extraction for amount of money.