Exemplo n.º 1
0
 def load_topics(self):
     if not os.path.isfile(self.topics_path):
         # download the wizard of wikipedia data
         build(self.opt)
     with open(self.topics_path) as f:
         self.data = json.load(f)
     self.seen_topics = self.data['train']
     self.unseen_topics = self.data['valid'] + self.data['test']
Exemplo n.º 2
0
def load_topics():
    opt = {}
    add_datapath_and_model_args(opt)
    build(opt)

    topics_path = os.path.join(
        opt['datapath'],
        'wizard_of_wikipedia',
        'topic_splits.json',
    )

    return sorted(json.load(open(topics_path, 'rb'))["train"])