dhlab.ngram.nb_ngram
¶
Module Contents¶
Functions¶
Extract N-gram frequencies from given |
|
Construct a dataframe with ngram mean frequencies per year over a given time period. |
|
Construct a dataframe with ngram mean frequencies per year over a given time period. |
API¶
- dhlab.ngram.nb_ngram.nb_ngram(terms: str, corpus: str = 'bok', smooth: int = 1, years: tuple = (1810, 2010), mode: str = 'relative', lang: str = 'nob')¶
Extract N-gram frequencies from given
terms
andyears
.lang
param is not supported for corpus=avis
and will be set to None ifavis
is passed.The
lang
param is not supported forcorpus="avis"
and will be set to None ifavis
is passed.Returns: A sorted Pandas DataFrame indexed by year, with columns for each term.
- dhlab.ngram.nb_ngram.ngram_conv_old(ngrams, smooth: int = 1, years: tuple = (1810, 2013), mode: str = 'relative') pandas.DataFrame ¶
Construct a dataframe with ngram mean frequencies per year over a given time period.
- dhlab.ngram.nb_ngram.ngram_conv(ngrams, smooth: int = 1, years: tuple = (1810, 2013), mode: str = 'relative') pandas.DataFrame ¶
Construct a dataframe with ngram mean frequencies per year over a given time period.
Args: ngrams: To be filled in. smooth: Smoothing factor for the graph visualisation. years: Tuple with start and end years for the time period of interest mode: Frequency measure.
Returns: pandas dataframe with mean values for each year