Esempio n. 1
0
 def get_vocab(self):
     content = util.read_content()  # data中所有用户输入的utterance
     vocab = sorted(set(content.split(' ')))
     # remove empty strings
     res = [item for item in vocab if item]
     # print('bow 长度', len(res))               # 60
     return res
Esempio n. 2
0
 def get_vocab(self):
     content = util.read_content()
     vocab = sorted(set(content.split(' ')))
     # remove empty strings
     #return [ item for item in vocab if item ]
     #return [ item for item in vocab if item != self.ent_type(item) ]
     responses = list(
         set([
             self.et.extract_entities(response, update=False)
             for response in vocab
         ]))
     return [item for item in responses if item]
Esempio n. 3
0
 def get_vocab(self):
     content = util.read_content()
     vocab = sorted(set(content.split(' ')))
     # remove empty strings
     return [item for item in vocab if item]
Esempio n. 4
0
    def get_vocab(self):
        content = util.read_content()
        vocab = sorted(set(content.split(' ')))

        return [item for item in vocab if item]