I am making a chatbot to ask basic questions about solar system. My main concern is how to set the entities for training phrases. example:
I have added an image below.
My main concern is how to set the entites for mass
and body
. I have made a custom entity for mass as @body_mass
and not sure how to do for planets/objects name. So that I can receive these values in backend. It is not recognizing in Diagnostic Info
The easiest way to do this would be by creating a @Property
entity which can detect "What" a user would like to know about a planet, for instance:
Then you create another set of entities called @Planet
with which you detect "Which" planet your user wants to know something about, for instance:
Then you could create one intent called "Get Planet Info intent" and put example phrases such as:
@Property
of @Planet
@Property
is @Planet
By doing this you save yourself a lot of time because you don't have to create phrases for "What is the height of Earth" and "What is the height of Mars". You just capture a sentence for the property and the planet entity and it should work for every combination in your entities.
You could even improve upon this by adding synonyms for the entities such as:
In your code all the information you have to check for is which @Property
and which @Planet
did Dialogflow detect, so it saves you from having to check for things such as Mass_Planet_A, Mass_Planet_B like you would now.