count_stems

WikipediaPage.count_stems(sentences, inflections=None)

Count the number of stems in a list of sentences.

An optional parameter allows to provide an inflections dictionary in order to register them. It can be usefull when looking for the most used form of a stem to produce more readable outputs.

This function use a dummy normalizer (self.normalize) that take a tokenized sentences using the Punkt NTLK parser and apply a simple word normalization process (lowercase, stemmization, lemmatization).

Parameters:
  • sentences (list) –
  • inflections (dict, optional) –
Returns:

stems

Return type:

dict