nltk.classify.tadm module

nltk.classify.tadm.call_tadm(args)[source]

Call the tadm binary with the given arguments.

nltk.classify.tadm.config_tadm(bin=None)[source]
nltk.classify.tadm.encoding_demo()[source]
nltk.classify.tadm.names_demo()[source]
nltk.classify.tadm.parse_tadm_weights(paramfile)[source]

Given the stdout output generated by tadm when training a model, return a numpy array containing the corresponding weight vector.

nltk.classify.tadm.write_tadm_file(train_toks, encoding, stream)[source]

Generate an input file for tadm based on the given corpus of classified tokens.

Parameters
  • train_toks (list(tuple(dict, str))) – Training data, represented as a list of pairs, the first member of which is a feature dictionary, and the second of which is a classification label.

  • encoding (TadmEventMaxentFeatureEncoding) – A feature encoding, used to convert featuresets into feature vectors.

  • stream (stream) – The stream to which the tadm input file should be written.