How to reinterpret currency names


(Enrique Schaub) #1

How can I teach my chatbot that, in my country, $ is not equal to US dollars and that “pesos” ar not necessarily mexican pesos (there are pesos argentinos, pesos colombianos, pesos chilenos)?

(Andy Heydon) #2

If a user’s location is shared with the platform then that information is used to interpret the input.

So for example if the platform knows that the user is in Argentina then $ and peso will be handled as ARS - Argentinian Pesos.

(Enrique Schaub) #3

Thanks for your advice. My laptop settings are in place, the platform still interprets “pesos” as the mexican currency, and “$” as dollars.

Is there any explicit way to share user location with the platform?
Neither context.session.UserContext nor context.session.BotUserSession seem to contain any reference to user location.
I have also found context.session.BotUserSession.lastMessage.messagePayload.meta.locale , which actually is equal to “es-419” (caribbean, consistent with interpreting “pesos” as mexican currency). I have tried to set it to “es-cl”, but it seems to be read-only.

Any suggestion on how to formally declare user location to the bot?

(Enrique Schaub) #4

Hi Andy

It´s not working properly. I have two questions:

a) Which is the correct way to tell the platform that the user is in Argentina?

b) Consider a Forex Bot that has to transform colombian pesos into argentinian pesos. How can I teach the platform not to confuse colombian pesos from mexican pesos? For instance: is there a means to transform the user utterance using Javascript, changing the phrase “colombian peso” into COP before the entity detection is started?

I’d be great if you can help me out of this

(Andy Heydon) #5


Currently if a user allows a bot to track their location then that information is passed along to the bot. However that is only available on certain channels. We will be adding a feature to allow a bot developer to define a location for the bot, which will help disambiguation in several situations.

I would like to see some example utterances for case b). The platform can understand “Colombian peso” and will identify that as COP, similarly for “Argentine peso”, however “Argentinian” is not being picked up as an alternative adjectival form, which we can add.

(Enrique Schaub) #6

Hello Andy,

the utterances is in spanish:

1.- Spanish: “Cuantos pesos argentinos son 2000 pesos colombianos”
That is: “How many pesos argentinos are 2000 pesos colombianos”.
context.entities.FromCurr should be = {“code” : “COP”, “amount” : “2000”}
context.entities.ToCurr should be = {“code” : “ARS”}

2.- Spanish: “A cuánto está el peso chileno”
which means: “How much is the peso chileno”
context.entities.FromCurr should be = {“code” : “CLP”, “amount” : “1”}
context.entities.ToCurr should be = {“code” : “zzz”}, with zzz = local currency

Regards, Enrique Schaub

(Enrique Schaub) #7

Hi Andy,

here are other user utterances:

Spanish: “cuantos pesos argentinos son 45000 pesos”
Translation: “How many pesos argentinos are 45000 pesos”, beeing “pesos” the local currency

Spanish: “cuantos pesos argentinos son $ 45000” = “How many pesos argentinos are $ 45000”. Here, “$” is the local currency sign (which the Bot translates into USD)

Best regards

Enrique Schaub

(Andy Heydon) #8

Ahh, Spanish.
There was an issue with how currencies were being identified in Spanish. That has been fixed and is currently working its way through the QA process.