nltk.classify.tadm module¶
- nltk.classify.tadm.parse_tadm_weights(paramfile)[source]¶
Given the stdout output generated by
tadm
when training a model, return anumpy
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.