def train(self, sentences, min_eojeol_count=1): if self.verbose: print('[Noun Extractor] counting eojeols') eojeol_counter = EojeolCounter(sentences, min_eojeol_count, max_length=self.l_max_length + self.r_max_length) self._num_of_eojeols = eojeol_counter._count_sum self._num_of_covered_eojeols = 0 if self.verbose: print('[Noun Extractor] complete eojeol counter -> lr graph') self.lrgraph = eojeol_counter.to_lrgraph( self.l_max_length, self.r_max_length) if self.verbose: print('[Noun Extractor] has been trained.')
def train(self, sentences, min_eojeol_count=1): if self.verbose: print('[Noun Extractor] counting eojeols') eojeol_counter = EojeolCounter(sentences, min_eojeol_count, max_length=self.l_max_length + self.r_max_length, filtering_checkpoint=self.eojeol_counter_filtering_checkpoint, verbose=self.verbose) self._num_of_eojeols = eojeol_counter._count_sum self._num_of_covered_eojeols = 0 if self.verbose: print('[Noun Extractor] complete eojeol counter -> lr graph') self.lrgraph = eojeol_counter.to_lrgraph( self.l_max_length, self.r_max_length) if self.verbose: print('[Noun Extractor] has been trained. mem={} Gb'.format( '%.3f'%get_process_memory()))
def train(self, sentences): if self.verbose: print('[Noun Extractor] counting eojeols') eojeol_counter = EojeolCounter(sentences, self.min_eojeol_count, max_length=self.l_max_length + self.r_max_length, filtering_checkpoint=self.eojeol_counter_filtering_checkpoint, verbose=self.verbose) self._num_of_eojeols = eojeol_counter._count_sum self._num_of_covered_eojeols = 0 if self.verbose: print('[Noun Extractor] complete eojeol counter -> lr graph') self.lrgraph = eojeol_counter.to_lrgraph( self.l_max_length, self.r_max_length) if self.verbose: print('[Noun Extractor] has been trained. mem={} Gb'.format( '%.3f'%get_process_memory()))