mimno / Mallet

MALLET is a Java-based package for statistical natural language processing, document classification, clustering, topic modeling, information extraction, and other machine learning applications to text.
https://mimno.github.io/Mallet/
Other
990 stars 344 forks source link

Not clear if `trainingProportions` may be `null` #193

Closed dscorbett closed 3 years ago

dscorbett commented 3 years ago

The third parameter of CRFTrainerByLabelLikelihood#train(InstanceList, int, double[]) is documented as follows: https://github.com/mimno/Mallet/blob/12487de1aa6433bdcf5af0ee0a17b368e64c7acf/src/cc/mallet/fst/CRFTrainerByLabelLikelihood.java#L182-L184 “If non-null” implies that setting it to null is a valid alternative. However, doing so induces a NullPointerException. Either the method should treat null like new double[] {1.0} or the documentation should clarify that null is not allowed.

mimno commented 3 years ago

I removed the reference to non-null values and fixed a bug in display (calling a proportion a percent). Could you check that this works?

dscorbett commented 3 years ago

This works. Thanks!