Ok, but are you sure you used matching names? The exception states
it-pos-maxent.bin,
which object did you map to it?

Jörn

On Wed, Jun 7, 2017 at 3:22 PM, Damiano Porta <[email protected]>
wrote:

> Hi Jorn! Yes
>
>         <dependency>
>             <groupId>org.apache.opennlp</groupId>
>             <artifactId>opennlp-tools</artifactId>
>             <version>1.8.0</version>
>         </dependency>
>
> Do i need others dependencies too?
>
>
>
> 2017-06-07 14:53 GMT+02:00 Joern Kottmann <[email protected]>:
>
> > This should be working. Did you test with 1.8.0?
> >
> > Jörn
> >
> > On Mon, Jun 5, 2017 at 3:43 PM, Damiano Porta <[email protected]>
> > wrote:
> >
> > > Hello,
> > > i am using the POSTaggerFeatureGenerator via generators.xml
> > >
> > > <tokenpos model="postagger.bin" />
> > >
> > > during the training i add this model in the resources doing:
> > >
> > >         HashMap<String, Object> map = new HashMap<>();
> > >         map.put("postagger.bin", myPostaggerModel);
> > >
> > >
> > >          factory = new TokenNameFinderFactory(
> > >                IOUtils.toByteArray(in),
> > >                map,
> > >                new BioCodec()
> > >          );
> > >
> > > I get this error:
> > >
> > > java.lang.IllegalStateException: Missing serializer for
> > it-pos-maxent.bin
> > > at opennlp.tools.util.model.BaseModel.serialize(BaseModel.java:589)
> > > at com.damiano.nlp.ner.trainer.Trainer.<init>(Trainer.java:187)
> > > at com.damiano.nlp.ner.trainer.Trainer.main(Trainer.java:44)
> > > 2017-06-05 15:37:35 INFO  Trainer:192 - java.lang.IllegalStateExceptio
> n:
> > > Missing serializer for postagger.bin
> > >
> > > Do i have to change the extension of the file?
> > >
> > > Thanks
> > >
> >
>

Reply via email to