def save_pos_stats(self, path=get_wd() + '/data/pos_stats.pickle'):
     with open(path, 'wb') as file:
         pickle.dump((self.pos_counter, self.pos_counter_m), file)
 def load_pos_stats(self, path=get_wd() + '/data/pos_stats.pickle'):
     with open(path, 'rb') as file:
         self.pos_counter, self.pos_counter_m = pickle.load(file)
 def load_rejected(self, path=get_wd() + '/data/rejected.pickle'):
     with open(path, 'rb') as file:
         self.rejected = pickle.load(file)
 def save_rejected(self, path=get_wd() + '/data/rejected.pickle'):
     with open(path, 'wb') as file:
         pickle.dump(self.rejected, file)
 def load_lexicon(self, path=get_wd() + '/data/lexicon.pickle'):
     with open(path, 'rb') as file:
         self.lexicon = pickle.load(file)
 def save_lexicon(self, path=get_wd() + '/data/lexicon.pickle'):
     with open(path, 'wb') as file:
         pickle.dump(self.lexicon, file)
예제 #7
0
    def _save_record(self, path=get_wd() + '/data/annotated.pickle'):
        if self.cur.id not in self.annotated:
            self.annotated[self.cur.id] = self.cur.tags

        with open(path, 'wb') as file:
            pickle.dump(self.annotated, file)