textstat/resources/TextStat.py
def naiveBayesianScore(model, tokenlist, pdoc):
   """Returns the Naive Bayesian score given a model and a tokenlist.
      The score is the sum of logs of the document probability and
      the individual token probabilities in the tokenlist, taken from model.
      
      Parameters:

      model: dictionary with token - relative frequency pairs

      tokenlist: iterable list or tuple of tokens

      pdoc: float with the probability to get a document of the class that
            corresponds to the model (this is the number of documents used to
            generate the model for the class, divided by the number of all
            documents.
   """
   return log(pdoc) + sum((log(model.get(i, NAIVEBAYESIANCOUNTOFF)) for i in tokenlist))
Returns the Naive Bayesian score given a model and a tokenlist.
      The score is the sum of logs of the document probability and
      the individual token probabilities in the tokenlist, taken from model.
      
      Parameters:

      model: dictionary with token - relative frequency pairs

      tokenlist: iterable list or tuple of tokens

      pdoc: float with the probability to get a document of the class that
            corresponds to the model (this is the number of documents used to
            generate the model for the class, divided by the number of all
            documents.
   
Returns the Naive Bayesian score given a model and a tokenlist.
The score is the sum of logs of the document probability and
the individual token probabilities in the tokenlist, taken from model.



dictionary with token - relative frequency pairs

iterable list or tuple of tokens

float with the probability to get a document of the class that
corresponds to the model (this is the number of documents used to
generate the model for the class, divided by the number of all
documents.
Returns the Naive Bayesian score given a model and a tokenlist . The score is the sum of logs of the document probability and the individual token probabilities in the tokenlist taken from model . dictionary with token - relative frequency pairs iterable list or tuple of tokens float with the probability to get a document of the class that corresponds to the model ( this is the number of documents used to generate the model for the class divided by the number of all documents .
def naiveBayesianScore(model, tokenlist, pdoc):
   return log(pdoc) + sum((log(model.get(i, NAIVEBAYESIANCOUNTOFF)) for i in tokenlist))
def naiveBayesianScore ( model , tokenlist , pdoc ) : return log ( pdoc ) + sum ( ( log ( model . get ( i , NAIVEBAYESIANCOUNTOFF ) ) for i in tokenlist ) )
Returns the Naive Bayesian score given a model and a tokenlist.
Returns the Naive Bayesian score given a model and a tokenlist .
"""Returns the Naive Bayesian score given a model and a tokenlist.
      The score is the sum of logs of the document probability and
      the individual token probabilities in the tokenlist, taken from model.
      
      Parameters:

      model: dictionary with token - relative frequency pairs

      tokenlist: iterable list or tuple of tokens

      pdoc: float with the probability to get a document of the class that
            corresponds to the model (this is the number of documents used to
            generate the model for the class, divided by the number of all
            documents.
   """
model
tokenlist
pdoc