MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / padding_corpus

Function padding_corpus

Text_Predication/text_prediction.py:24–31  ·  view source on GitHub ↗
(corpus)

Source from the content-addressed store, hash-verified

22
23
24def 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
34def remap_bigram(corpus):

Callers 1

predictionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected