RasaHQ / pokedex-demo

Rasa Demo for a digital assistant for pokemon
Apache License 2.0
36 stars 39 forks source link

[New Feature] Translating Pokemon Names #8

Closed koaning closed 3 years ago

koaning commented 4 years ago

Feature Did you know that snorlax is called ronflex in France? Japanese names also tend to be different. It would be a nice feature if our system could also detect these names.

Example

Example 1

User> What is the English name of ronflex
Bot> Ronflex is also known as Snorlax in English.

Example 2

User> Is ronfelx a pokmon that exists?
Bot> I don't recall ronfelx, are you sure it is spelled correctly?
User> Oh, I meant ronflex. 
Bot> Ah! 
Bot> Ronflex, also known in english as Snorlax, is ... <pokedex entry>
juandes commented 4 years ago

Heyo! How would you approach this problem? Is there a particular feature of Rasa you have in mind?

Thanks :)

koaning commented 4 years ago

That's a really good question. For starters we'd need to have the data available for it. Something tells me that eventually something "knowledge-base"-like should be used here but since that part of the Rasa library is currently experimental a custom action might be best for now. This could be a nice use-case for entitiy groups but I'm not 100% sure.

Take this example from the documentation;

I want to fly from [Berlin]{"entity": "city", "role": "departure"} 
to [San Francisco]{"entity": "city", "role": "destination"}.

In this flight example it makes 100% sense to add a role to the entity. The pokemon analogy might be something like;

Please translate [Snorlax](pokemon_name) 
from [English]{"entity": "language", "role": "departure"}
to [French]{"entity": "language", "role": "destination"}

But I wonder if it's more natural for a user to ask.

What is the [English](language) name of [Ronflex](pokemon_name)?
What is the [French](language) name of [Snorlax](pokemon_name)?

The latter is something that we would need to fix with a custom python action and we'd need to check all the names in all the languages (this data needs to be added to our json). This can be quite involved but still feels relatively straightforward.

I'm open to ideas though. I should also admit that I may not know enough about pokemon translations. @EmmaWightman you might know more.

juandes commented 4 years ago

Your last example seems to be using the knowledge base approach. Is this your intention?

koaning commented 4 years ago

@juandes this is true, but you can also have a custom action handle the found entities/intents. The notation that I use there also applies for entities in general and these can also be picked up by custom actions.

The knowledge base approach in the long term seems like the end-goal but I know that the research team is still experimenting with that feature so I prefer not to learn on it too much for now.

You can find a custom action example that uses the found intents here. Something like this might work for the short term.