(corpus)
| 22 | |
| 23 | |
| 24 | def padding_corpus(corpus): |
| 25 | # Pad both ends of each sentence in the corpus |
| 26 | corpus_padding = [] |
| 27 | for sentence in corpus: |
| 28 | corpus_padding.append( |
| 29 | list(pad_both_ends(sentence, pad_left=True, left_pad_symbol="<s>", pad_right=True, right_pad_symbol="</s>", |
| 30 | n=2))) |
| 31 | return corpus_padding |
| 32 | |
| 33 | |
| 34 | def remap_bigram(corpus): |