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
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]
def get_vocab(self): content = util.read_content() vocab = sorted(set(content.split(' '))) # remove empty strings return [item for item in vocab if item]
def get_vocab(self): content = util.read_content() vocab = sorted(set(content.split(' '))) return [item for item in vocab if item]