def load(self):
log.info("[loading knowledge base from {}]".format(self.load_path))
with self.load_path.open("rt", encoding="utf8") as fp:
self.kb.update(json.load(fp))
@register("knowledge_base_entity_normalizer")
class KnowledgeBaseEntityNormalizer(Component):
Uses instance of :class:`~deeppavlov.models.seq2seq_go_bot.kb.KnowledgeBase` to normalize or to undo normalization of entities in the input utterance.
After Change
def load(self):
log.info("[loading knowledge base from {}]".format(self.load_path))
self.kb.update(json.load(self.load_path.open("rt")), primary_keys=False)
self.primary_keys = json.load(self.load_path.with_suffix(".keys.json").open("rt"))
@register("knowledge_base_entity_normalizer")