From afc18c7479e0d454b002f05d463b4f8778de02e1 Mon Sep 17 00:00:00 2001 From: Rob Wilkes Date: Thu, 25 Jan 2018 10:22:34 +1100 Subject: [PATCH] Fix. Issue #55. Treat entities and synonyms as strings when building entity_map. --- api_ai/schema_handlers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api_ai/schema_handlers.py b/api_ai/schema_handlers.py index deffd28..2b62332 100644 --- a/api_ai/schema_handlers.py +++ b/api_ai/schema_handlers.py @@ -194,9 +194,9 @@ def build_user_says(self, intent): mapping = {} for a in [a for a in annotations if a]: for annotation, entity in a.items(): - mapping.update({annotation:entity}) + mapping.update({str(annotation):str(entity)}) for synonym in self.get_synonyms(annotation, entity): - mapping.update({synonym:entity}) + mapping.update({str(synonym):str(entity)}) for phrase in [p for p in phrases if p]: if phrase != '':