elm.ords.extraction.ngrams.convert_text_to_sentence_ngrams

convert_text_to_sentence_ngrams(text, n)[source]

Convert input text to a list of ngrams.

The text is first split byu sentence, after which each sentence is converted into ngrams. The ngrams for all sentences are combined and returned.

Parameters:
  • text (str) – Input text containing one or more sentences.

  • n (int) – Number of words to include per ngram.

Returns:

list – List of tuples, where each tuple is an ngram from the original text.