home << dhlab reference << dhlab.ngram.nb_ngram
ngram_conv#
from dhlab.ngram.nb_ngram import ngram_conv
- ngram_conv(ngrams, smooth=1, years=(1810, 2013), mode='relative')[source]#
Construct a dataframe with ngram mean frequencies per year over a given time period.
- Parameters:
ngrams – TODO: FIll in appropriate type and description.
smooth – Smoothing factor for the graph visualisation.
years – Tuple with start and end years for the time period of interest
mode – Frequency measure. Defaults to ‘relative’.
- Returns:
pandas dataframe with mean values for each year