FeatureTypes class has a static variable - int offset -
which is used for assigning thisTypeId parameter proper
values. This in turn is used to generate proper
feature ids. Now, with every new instance of
FeatureGenImpl, this offset variable should be reset
to 0, otherwise it may create problems.
Consider the following case.
An application has train() and test() methods:
train() {
featureGen = new FeatureGenImpl(modelGraph, nlabels, true).
....
featureGen.write("features.txt");
}
test() {
featureGen = new FeatureGenImpl(modelGraph, nlabels, true);
featureGen.read("features.txt")
}
main() {
train();
test();
}
This code has problems as when test() is called, then
all the featureTypes will have incorrect thisTypeId
value and thus incorrect feature ids.
-amit
Logged In: YES
user_id=1283773
This static variable was removed in CRF-1.2. This bug is
invalid.
-amit