You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by mohd saif <sa...@gmail.com> on 2016/12/28 23:13:52 UTC
Getting ambiguity while training my model
Hi,
I am using opennlp-tool-1.6.0.
For training my model i m using
model = NameFinderME.train("en", "person", sampleStream,
TrainingParameters.defaultParams(),
null, Collections.<String, Object>emptyMap());
For this i am getting below Error:
The method train(String, String, ObjectStream<NameSample>,
TrainingParameters, AdaptiveFeatureGenerator, Map<String,Object>) is
ambiguous for the type NameFinderME
Please help me out.
2. Please tell me how to set cutoff so than i can train my model which have
n-gram frequency=1. I mean how to set cutoff with the train API.
Thanks alot...!!!
Re: Getting ambiguity while training my model
Posted by "Russ, Daniel (NIH/CIT) [E]" <dr...@mail.nih.gov>.
You are getting an error because you are passing a null in for the AdaptiveFeatureGenerator. Java doesn’t know if you are passing in and AFG or a byte[] (which makes it a different method), hence you get a message about an ambiguous signature.
You are using a depreciated method. Use the train(String,String,ObjectStream<>,TrainingParameters,TokenNameFinderFactory) method.
You can create a TokenNameFinderFactory using the default constructor, Assuming you are using BioCodec format. I believe that is <START:person>John Smith<END>
Let me know if that works for you.
On 12/28/16, 6:13 PM, "mohd saif" <sa...@gmail.com> wrote:
Hi,
I am using opennlp-tool-1.6.0.
For training my model i m using
model = NameFinderME.train("en", "person", sampleStream,
TrainingParameters.defaultParams(),
null, Collections.<String, Object>emptyMap());
For this i am getting below Error:
The method train(String, String, ObjectStream<NameSample>,
TrainingParameters, AdaptiveFeatureGenerator, Map<String,Object>) is
ambiguous for the type NameFinderME
Please help me out.
2. Please tell me how to set cutoff so than i can train my model which have
n-gram frequency=1. I mean how to set cutoff with the train API.
Thanks alot...!!!
Re: Getting ambiguity while training my model
Posted by "Russ, Daniel (NIH/CIT) [E]" <dr...@mail.nih.gov>.
Have you tried:
TrainingParameters params=TrainingParameters.defaultParams();
params.put(TrainingParameters.CUTOFF_PARAM, "1")
On 12/28/16, 6:13 PM, "mohd saif" <sa...@gmail.com> wrote:
Hi,
I am using opennlp-tool-1.6.0.
For training my model i m using
model = NameFinderME.train("en", "person", sampleStream,
TrainingParameters.defaultParams(),
null, Collections.<String, Object>emptyMap());
For this i am getting below Error:
The method train(String, String, ObjectStream<NameSample>,
TrainingParameters, AdaptiveFeatureGenerator, Map<String,Object>) is
ambiguous for the type NameFinderME
Please help me out.
2. Please tell me how to set cutoff so than i can train my model which have
n-gram frequency=1. I mean how to set cutoff with the train API.
Thanks alot...!!!