OpenNlp
OpenNlp copied to clipboard
Name entity recognition not working correct for second call
When calling nameFinder.GetNames(models, "in 2005");
the second time, the tags
A dirty work-a-round is to recreate the Beam in the Find method of the MaximumEntropyNameFinder.
MaximumEntropyNameFinder.cs:
public virtual string[] Find(string[] tokens, IDictionary previousTags)
{
//Dirty hack to fix an error for a repeated call
mBeam = new NameBeamSearch(this, mBeamSize, mContextGenerator, mModel, mBeamSize);
mBestSequence = mBeam.BestSequence(tokens, new object[]{previousTags});
return mBestSequence.Outcomes.ToArray();
}
May be you can correct the issue, I do not really understand what went wrong.