I tried to find information in documentation:
https://learning.rasa.com/conversational-ai-with-rasa/entities/
and in here
https://rasa.com/docs/rasa/nlu-training-data/#lookup-tables
but I can not seam to find end to end implementation
I created txt with colors in my project, in my config I wrote:
lookup_tables:
colors:
elements: "colors.txt"
in my nlu.yml:
- intent: what_colors
examples: |
- Do you like [red](colors)
- I like [blue](colors)?
- I love [green](colors)
in my stories.yml:
- story: what colors do you like
steps:
- intent: greet
- action: utter_greet
- intent: what_colors
- action: action_colors
I also have actions.py:
class ActionColors(Action):
def name(self) -> Text:
return "action_colors"
def run(self, dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
color = next(tracker.get_latest_entity_values("color"), None)
colors_names = np.loadtxt('colors.txt')
if color in colors_names:
dispatcher.utter_message(text="You choose: " + color + ".")
else:
dispatcher.utter_message(text=f"There is no color like: {color} in colors file.")
return []
in my domain I have:
entities:
- colors
and when I train, run rasa actions and rasa shell, I ask “Do you like red?” I only gets fallback response, what did I do wrong? where in documentation can I find full path to implement “lookup tables”?