nltk.classify.BinaryMaxentFeatureEncoding.__init__

BinaryMaxentFeatureEncoding.__init__(labels, mapping, unseen_features=False, alwayson_features=False)[source]
Parameters:
  • labels – A list of the “known labels” for this encoding.
  • mapping – A dictionary mapping from (fname,fval,label) tuples to corresponding joint-feature indexes. These indexes must be the set of integers from 0...len(mapping). If mapping[fname,fval,label]=id, then self.encode(..., fname:fval, ..., label)[id] is 1; otherwise, it is 0.
  • unseen_features – If true, then include unseen value features in the generated joint-feature vectors.
  • alwayson_features – If true, then include always-on features in the generated joint-feature vectors.