What algorithm I need to find n-grams?

前端 未结 7 462
無奈伤痛
無奈伤痛 2020-12-04 16:56

What algorithm is used for finding ngrams?

Supposing my input data is an array of words and the size of the ngrams I want to find, what algorithm I should use?

相关标签:
7条回答
  • 2020-12-04 17:52

    Have a look at https://cran.r-project.org/web/packages/ngram/vignettes/ngram-guide.pdf

    Here is a quick example. It's quite fast look at the benchmark of the vignette.

    require(ngram)
    
    "hi i am ig" %>% ngram(n = 2) %>% get.ngrams()
    
    0 讨论(0)
提交回复
热议问题