ClearTK/cleartk

MalletCrfStringOutcomeClassifier drops the last feature when classifying

Opened this issue · 3 comments

Original issue 412 created by ClearTK on 2014-12-19T03:30:24.000Z:

What steps will reproduce the problem?
Run MalletCrfStringOutcomeClassifier.classify method on a list of list of features and observe the output instance after it is processed by the transducer's pipe.

What is the expected output?
All the list of features processed by the pipe are passed to the transducer.

What do you see instead?
The last feature in each list of features is interpreted as a class/target because the pipe.targetProcessing field is set to true (default) as for training. The end results is that this last feature is dropped and never sent to the transducer.

What version of the product are you using? On what operating system?
This is affecting the version 2.0 of cleartk-ml.

The main function in cc.mallet.fst.SimpleTagger

Comment #1 originally posted by ClearTK on 2014-12-19T03:33:25.000Z:

I sent to fast...

The main function in cc.mallet.fst.SimpleTagger is a good place to see how the pipe is used when classifying.

Comment #2 originally posted by ClearTK on 2014-12-22T15:11:26.000Z:

<empty>

My workaround, which could turn into a fix, is by adding:
this.transducer.getInputPipe().setTargetProcessing(false);
right after reading the transducer in the classifier builder.