tongchangD / bert_for_corrector

基于bert进行中文文本纠错
225 stars 49 forks source link

why AttributeError: 'BertCorrector' object has no attribute 'split_2_short_text' ? #1

Open dwgpf opened 4 years ago

tongchangD commented 4 years ago

The split_2_short_text core code is as follows: def split_2_short_text(text, include_symbol=False): """ Long sentences are divided into short sentences :param text: str :param include_symbol: bool :return: (sentence, idx) """ result = [] blocks = re_han.split(text) start_idx = 0 for blk in blocks: if not blk: continue if include_symbol: result.append((blk, start_idx)) else: if re_han.match(blk): result.append((blk, start_idx)) start_idx += len(blk) return result

tongchangD commented 4 years ago

you can see in code

dwgpf commented 4 years ago

thanks a lot