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

Function vocab

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

Source from the content-addressed store, hash-verified

40
41
42def vocab(corpus):
43 # Create a vocabulary list from the corpus
44 voc_list = []
45 for sentence in corpus:
46 for word in sentence:
47 voc_list.append(word)
48 return Vocabulary(voc_list, unk_cutoff=3)
49
50
51def prediction(train, prefix):

Callers 1

predictionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected