Below is my configuration details. I am trying to use the spacy entity extractor to extract the entity “time” in actions, but not working. Can any one help or refer some examples.
I am trying to extract anything related to date from the user input. I read duckling extractor or pretrained_embeddings_spacy can extract the entities, but not sure how to get the extracted value in the actions.
I don’t want to hardcode all the possible dates what the user will provide in nlu.
- name: MemoizationPolicy
- name: KerasPolicy
- name: MappingPolicy
- what is the office hours today?
story ask open hours general - happy path
def name(self): return "action_find_office_hours" def run(self, dispatcher, tracker, domain): prediction = tracker.latest_message entity_type = prediction['entities']['entity'] print(entity_type) dispatcher.utter_message(entity_type) return [SlotSet("entity", entity_type)]
raceback (most recent call last): File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/sanic/app.py”, line 942, in handle_request response = await response File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rasa_sdk/endpoint.py”, line 86, in webhook result = await executor.run(action_call) File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/rasa_sdk/executor.py”, line 280, in run events = action(dispatcher, tracker, domain) File “/Users/XXXXXXXXXXXXXXXXBot/actions.py”, line 44, in run entity_type = prediction[‘entities’][‘entity’] IndexError: list index out of range