Iterate over sentences from .txt file.

text8corpus(file, max_sentence_length = 10000L)

Arguments

file

Path to .txt file.

max_sentence_length

Maximum length of sentence to scan.

Examples

file <- datapath('testcorpus.txt') # example file readLines(file) # what it looks like
#> [1] "computer human interface" #> [2] "computer response survey system time user" #> [3] "interface system user eps" #> [4] "human system system eps" #> [5] "response time user" #> [6] "trees" #> [7] "trees graph" #> [8] "trees graph minors" #> [9] "survey graph minors"
(sentences <- text8corpus(file))
#> <gensim.models.word2vec.Text8Corpus>