[ 
https://issues.apache.org/jira/browse/OPENNLP-1092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Joern Kottmann closed OPENNLP-1092.
-----------------------------------
    Resolution: Fixed

Thanks for reporting this, we added a test to ensure this works.

> PosTagger serialization in namefinder model
> -------------------------------------------
>
>                 Key: OPENNLP-1092
>                 URL: https://issues.apache.org/jira/browse/OPENNLP-1092
>             Project: OpenNLP
>          Issue Type: Bug
>          Components: Name Finder
>    Affects Versions: 1.8.0, 1.8.1
>         Environment: Ubuntu 16.04 - Intel Core i7 6700k - Openjdk version 
> 1.8.0_131
>            Reporter: Damiano Porta
>            Assignee: Joern Kottmann
>             Fix For: 1.8.1
>
>
> I am getting an error during the serialization of the post tagger inside a 
> name finder model.
> The error is: *java.lang.IllegalStateException: Missing serializer for 
> postagger.bin*
> I am having this problem via API and via cmd NameFinderTrainer tool.
> The command is:
> *opennlp TokenNameFinderTrainer -data /home/damiano/corpus.train -lang it 
> -model /home/damiano/model.bin -featuregen /home/damiano/test.xml 
> -sequenceCodec BIO -resources 
> /home/damiano/lavoro/java/Parser/src/main/resources/*
> {code}
> The output is:
> Writing name finder model ... Compressed 885605 parameters to 94030
> 3451 outcome patterns
> Exception in thread "main" java.lang.IllegalStateException: Missing 
> serializer for postagger.bin
>       at opennlp.tools.util.model.BaseModel.serialize(BaseModel.java:592)
>       at opennlp.tools.cmdline.CmdLineUtil.writeModel(CmdLineUtil.java:182)
>       at 
> opennlp.tools.cmdline.namefind.TokenNameFinderTrainerTool.run(TokenNameFinderTrainerTool.java:188)
>       at opennlp.tools.cmdline.CLI.main(CLI.java:244)
> {code}
> My generators.xml is:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <generators>
>     <cache>
>         <generators>
>             <window prevLength="4" nextLength="2">
>                 <tokenclass />
>             </window>
>             <window prevLength="4" nextLength="2">
>                 <token />
>             </window> 
>             <!-- Pos Tagger -->                
>             <window prevLength="4" nextLength="2">
>                 <tokenpos model="postagger.bin" />
>             </window> 
>             <definition />
>             <prevmap />
>             <bigram />
>             <sentence begin="true" end="false" />          
>         </generators>
>     </cache>
> </generators>
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to