Answers for "extract n grams from text python"

0

extract n grams from text python

from nltk import ngrams

sentence = 'this is a foo bar sentences and i want to ngramize it'

n = 6
sixgrams = ngrams(sentence.split(), n)

for grams in sixgrams:
  print grams
Posted by: Guest on August-08-2020

Code answers related to "extract n grams from text python"

Python Answers by Framework

Browse Popular Code Answers by Language