while extracting duration with duckling how can we get the second normalized value instade of the first value?
I’m having the same problem. Did you find a solution to this?
@_daisy Sorry I dont know how to post a code
- data = tracker.latest_message[“entities”]
- print(‘1>’, data)
- #If there are other entities in the list, it will be filtered to return only entities of type “duration”
- data = list(filter( lambda entity: entity[‘entity’] == “duration”, tracker.latest_message[“entities”] ))
- print(‘2>’, data)
- if data:
- normalized = data[0][“additional_info”][“normalized”]
- print(‘3>’, normalized[“value”], normalized[“unit”])
- dispatcher.utter_message(text=f"{normalized[‘value’]} {normalized[‘unit’]}")
- else:
- dispatcher.utter_message(text=“Entity not found”)