You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by David Samuel Lim <be...@gmail.com> on 2017/01/13 01:51:20 UTC

OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Hello,

I am currently facing an issue with regards to loading a custom trained NER
model.

My project uses OpenNLP 1.6.0 and is developed using Eclipse IDE. The model
was also trained using OpenNLP 1.6.0.

However, when I try to load the model *InputStream* into a
*TokenNameFinderModel* object, I get the following error:

java.lang.IllegalArgumentException :
opennlp.tools.util.InvalidFormatException: Model version 1.6.0 is not
supported by this (1.5.3) version of OpenNLP!


Based on info I've gathered from sites like StackOverflow (such as this
<http://stackoverflow.com/questions/33250241/why-is-a-self-trained-ner-model-incompatible-with-the-version-of-opennlp>
question), I get the sense that if I want to use a custom trained model in
OpenNLP 1.6.0, it has to be trained using OpenNLP 1.5.3. However, I
personally do not think that is the case, as I have other Java projects
using OpenNLP 1.6.0, and they were able to load the model successfully.

The *.classpath* of my project also shows that the project is referencing
the OpenNLP 1.6.0 libraries.

I know the question is rather vague, but if anyone has any insight into why
this could be happening, please let me know! Help is greatly appreciated.

*To sum up: Unable to load custom trained OpenNLP Name Finder model in code
due to apparent OpenNLP version incompatibility. Model was trained in
OpenNLP 1.6.0, which my project also uses. Other projects also using 1.6.0
were able to load the model successfully.*

Regards,

David Lim

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by David Samuel Lim <be...@gmail.com>.
Hi William,

Thanks for your reply.

My project uses OpenNLP 1.6.0. I have properly referenced both the
*opennlp-tools-1.6.0.jar* and* opennlp-uima-1.6.0.jar* libraries. This is
also reflected in the* .classpath* of my project.

This error is therefore quite puzzling to me. I also have other projects
using OpenNLP 1.6.0 yet they are able to load the model successfully.

Regards,
David

On Fri, Jan 13, 2017 at 9:56 AM, William Colen <wi...@gmail.com>
wrote:

> Hi, David,
>
> from this:
>
> opennlp.tools.util.InvalidFormatException: Model version 1.6.0 is not
> supported by this (1.5.3) version of OpenNLP!
>
> I believe you created models using OpenNLP 1.6.0. You are trying to use the
> models in OpenNLP 1.5.3. Please check the version of your runtime.
>
> Regards,
> William
>
>
> 2017-01-12 23:51 GMT-02:00 David Samuel Lim <be...@gmail.com>:
>
> > Hello,
> >
> > I am currently facing an issue with regards to loading a custom trained
> NER
> > model.
> >
> > My project uses OpenNLP 1.6.0 and is developed using Eclipse IDE. The
> model
> > was also trained using OpenNLP 1.6.0.
> >
> > However, when I try to load the model *InputStream* into a
> > *TokenNameFinderModel* object, I get the following error:
> >
> > java.lang.IllegalArgumentException :
> > opennlp.tools.util.InvalidFormatException: Model version 1.6.0 is not
> > supported by this (1.5.3) version of OpenNLP!
> >
> >
> > Based on info I've gathered from sites like StackOverflow (such as this
> > <http://stackoverflow.com/questions/33250241/why-is-a-
> > self-trained-ner-model-incompatible-with-the-version-of-opennlp>
> > question), I get the sense that if I want to use a custom trained model
> in
> > OpenNLP 1.6.0, it has to be trained using OpenNLP 1.5.3. However, I
> > personally do not think that is the case, as I have other Java projects
> > using OpenNLP 1.6.0, and they were able to load the model successfully.
> >
> > The *.classpath* of my project also shows that the project is referencing
> > the OpenNLP 1.6.0 libraries.
> >
> > I know the question is rather vague, but if anyone has any insight into
> why
> > this could be happening, please let me know! Help is greatly appreciated.
> >
> > *To sum up: Unable to load custom trained OpenNLP Name Finder model in
> code
> > due to apparent OpenNLP version incompatibility. Model was trained in
> > OpenNLP 1.6.0, which my project also uses. Other projects also using
> 1.6.0
> > were able to load the model successfully.*
> >
> > Regards,
> >
> > David Lim
> >
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by William Colen <wi...@gmail.com>.
Hi, David,

from this:

opennlp.tools.util.InvalidFormatException: Model version 1.6.0 is not
supported by this (1.5.3) version of OpenNLP!

I believe you created models using OpenNLP 1.6.0. You are trying to use the
models in OpenNLP 1.5.3. Please check the version of your runtime.

Regards,
William


2017-01-12 23:51 GMT-02:00 David Samuel Lim <be...@gmail.com>:

> Hello,
>
> I am currently facing an issue with regards to loading a custom trained NER
> model.
>
> My project uses OpenNLP 1.6.0 and is developed using Eclipse IDE. The model
> was also trained using OpenNLP 1.6.0.
>
> However, when I try to load the model *InputStream* into a
> *TokenNameFinderModel* object, I get the following error:
>
> java.lang.IllegalArgumentException :
> opennlp.tools.util.InvalidFormatException: Model version 1.6.0 is not
> supported by this (1.5.3) version of OpenNLP!
>
>
> Based on info I've gathered from sites like StackOverflow (such as this
> <http://stackoverflow.com/questions/33250241/why-is-a-
> self-trained-ner-model-incompatible-with-the-version-of-opennlp>
> question), I get the sense that if I want to use a custom trained model in
> OpenNLP 1.6.0, it has to be trained using OpenNLP 1.5.3. However, I
> personally do not think that is the case, as I have other Java projects
> using OpenNLP 1.6.0, and they were able to load the model successfully.
>
> The *.classpath* of my project also shows that the project is referencing
> the OpenNLP 1.6.0 libraries.
>
> I know the question is rather vague, but if anyone has any insight into why
> this could be happening, please let me know! Help is greatly appreciated.
>
> *To sum up: Unable to load custom trained OpenNLP Name Finder model in code
> due to apparent OpenNLP version incompatibility. Model was trained in
> OpenNLP 1.6.0, which my project also uses. Other projects also using 1.6.0
> were able to load the model successfully.*
>
> Regards,
>
> David Lim
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by David Samuel Lim <be...@gmail.com>.
Hi Jörn,

Thanks for the info, I'll take note of that.

Regards,
David

On Fri, Jan 13, 2017 at 8:46 PM, Joern Kottmann <ko...@gmail.com> wrote:

> We just provide you with the jar fils and some sanity checks to ensure
> things run as they are intended to.
>
> The OpenNLP project can't promise to support all future model packages we
> will be releasing with OpenNLP verions you can get today. To make that
> clear we fail hard if a newer model is loaded.
>
> You can check which version you are running with opennlp.tools.util.Version
> class, it retrieves the version from the jar file, if it outputs some old
> version you can be sure that this version somehow ended up on your
> classpath.
>
> Jörn
>
>
> On Fri, Jan 13, 2017 at 11:45 AM, David Samuel Lim <be...@gmail.com>
> wrote:
>
> > Hi William,
> >
> > I am not using Maven.
> >
> > Regards,
> > David
> >
> > On Fri, Jan 13, 2017 at 6:39 PM, William Colen <wi...@gmail.com>
> > wrote:
> >
> > > Are you using Maven?
> > >
> > >
> > > 2017-01-13 5:32 GMT-02:00 David Samuel Lim <be...@gmail.com>:
> > >
> > > > Oops, I meant *opennlp-tools-1.5.3.jar*. My bad.
> > > >
> > > > On Fri, Jan 13, 2017 at 3:29 PM, David Samuel Lim <
> > beitrik2014@gmail.com
> > > >
> > > > wrote:
> > > >
> > > > > Hi Richard,
> > > > >
> > > > > Thanks for the reply. I've checked the classpath again and it only
> > > shows
> > > > > the referenced 1.6.0 libraries.
> > > > >
> > > > > Though, when I initially faced the issue, one strategy I tried was
> to
> > > > > reference the *opennlp-tools-1.5.0.jar* library. It didn't work,
> so I
> > > > > removed it. None of the methods I've tried so far have given me a
> > solid
> > > > > answer, not even re-training the model using 1.6.0.
> > > > >
> > > > > *> Maybe OpenNLP classes are included in some non-OpenNLP JAR as
> well
> > > > that
> > > > > you use in your project?*
> > > > >
> > > > > Sorry, I'm personally not sure what you mean by this. Could you
> > please
> > > > > clarify?
> > > > >
> > > > > Regards,
> > > > > David
> > > > >
> > > > > On Fri, Jan 13, 2017 at 3:14 PM, Richard Eckart de Castilho <
> > > > > rec@apache.org> wrote:
> > > > >
> > > > >> On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com>
> > > > wrote:
> > > > >> >
> > > > >> > *To sum up: Unable to load custom trained OpenNLP Name Finder
> > model
> > > in
> > > > >> code
> > > > >> > due to apparent OpenNLP version incompatibility. Model was
> trained
> > > in
> > > > >> > OpenNLP 1.6.0, which my project also uses. Other projects also
> > using
> > > > >> 1.6.0
> > > > >> > were able to load the model successfully.*
> > > > >>
> > > > >> Maybe you have OpenNLP twice on the classpath for some reason,
> once
> > in
> > > > >> 1.5.3
> > > > >> and once in 1.6.0. Maybe OpenNLP classes are included in some
> > > > non-OpenNLP
> > > > >> JAR
> > > > >> as well that you use in your project?
> > > > >>
> > > > >> Cheers,
> > > > >>
> > > > >> -- Richard
> > > > >>
> > > > >
> > > > >
> > > >
> > >
> >
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by Joern Kottmann <ko...@gmail.com>.
We just provide you with the jar fils and some sanity checks to ensure
things run as they are intended to.

The OpenNLP project can't promise to support all future model packages we
will be releasing with OpenNLP verions you can get today. To make that
clear we fail hard if a newer model is loaded.

You can check which version you are running with opennlp.tools.util.Version
class, it retrieves the version from the jar file, if it outputs some old
version you can be sure that this version somehow ended up on your
classpath.

Jörn


On Fri, Jan 13, 2017 at 11:45 AM, David Samuel Lim <be...@gmail.com>
wrote:

> Hi William,
>
> I am not using Maven.
>
> Regards,
> David
>
> On Fri, Jan 13, 2017 at 6:39 PM, William Colen <wi...@gmail.com>
> wrote:
>
> > Are you using Maven?
> >
> >
> > 2017-01-13 5:32 GMT-02:00 David Samuel Lim <be...@gmail.com>:
> >
> > > Oops, I meant *opennlp-tools-1.5.3.jar*. My bad.
> > >
> > > On Fri, Jan 13, 2017 at 3:29 PM, David Samuel Lim <
> beitrik2014@gmail.com
> > >
> > > wrote:
> > >
> > > > Hi Richard,
> > > >
> > > > Thanks for the reply. I've checked the classpath again and it only
> > shows
> > > > the referenced 1.6.0 libraries.
> > > >
> > > > Though, when I initially faced the issue, one strategy I tried was to
> > > > reference the *opennlp-tools-1.5.0.jar* library. It didn't work, so I
> > > > removed it. None of the methods I've tried so far have given me a
> solid
> > > > answer, not even re-training the model using 1.6.0.
> > > >
> > > > *> Maybe OpenNLP classes are included in some non-OpenNLP JAR as well
> > > that
> > > > you use in your project?*
> > > >
> > > > Sorry, I'm personally not sure what you mean by this. Could you
> please
> > > > clarify?
> > > >
> > > > Regards,
> > > > David
> > > >
> > > > On Fri, Jan 13, 2017 at 3:14 PM, Richard Eckart de Castilho <
> > > > rec@apache.org> wrote:
> > > >
> > > >> On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com>
> > > wrote:
> > > >> >
> > > >> > *To sum up: Unable to load custom trained OpenNLP Name Finder
> model
> > in
> > > >> code
> > > >> > due to apparent OpenNLP version incompatibility. Model was trained
> > in
> > > >> > OpenNLP 1.6.0, which my project also uses. Other projects also
> using
> > > >> 1.6.0
> > > >> > were able to load the model successfully.*
> > > >>
> > > >> Maybe you have OpenNLP twice on the classpath for some reason, once
> in
> > > >> 1.5.3
> > > >> and once in 1.6.0. Maybe OpenNLP classes are included in some
> > > non-OpenNLP
> > > >> JAR
> > > >> as well that you use in your project?
> > > >>
> > > >> Cheers,
> > > >>
> > > >> -- Richard
> > > >>
> > > >
> > > >
> > >
> >
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by David Samuel Lim <be...@gmail.com>.
Hi William,

I am not using Maven.

Regards,
David

On Fri, Jan 13, 2017 at 6:39 PM, William Colen <wi...@gmail.com>
wrote:

> Are you using Maven?
>
>
> 2017-01-13 5:32 GMT-02:00 David Samuel Lim <be...@gmail.com>:
>
> > Oops, I meant *opennlp-tools-1.5.3.jar*. My bad.
> >
> > On Fri, Jan 13, 2017 at 3:29 PM, David Samuel Lim <beitrik2014@gmail.com
> >
> > wrote:
> >
> > > Hi Richard,
> > >
> > > Thanks for the reply. I've checked the classpath again and it only
> shows
> > > the referenced 1.6.0 libraries.
> > >
> > > Though, when I initially faced the issue, one strategy I tried was to
> > > reference the *opennlp-tools-1.5.0.jar* library. It didn't work, so I
> > > removed it. None of the methods I've tried so far have given me a solid
> > > answer, not even re-training the model using 1.6.0.
> > >
> > > *> Maybe OpenNLP classes are included in some non-OpenNLP JAR as well
> > that
> > > you use in your project?*
> > >
> > > Sorry, I'm personally not sure what you mean by this. Could you please
> > > clarify?
> > >
> > > Regards,
> > > David
> > >
> > > On Fri, Jan 13, 2017 at 3:14 PM, Richard Eckart de Castilho <
> > > rec@apache.org> wrote:
> > >
> > >> On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com>
> > wrote:
> > >> >
> > >> > *To sum up: Unable to load custom trained OpenNLP Name Finder model
> in
> > >> code
> > >> > due to apparent OpenNLP version incompatibility. Model was trained
> in
> > >> > OpenNLP 1.6.0, which my project also uses. Other projects also using
> > >> 1.6.0
> > >> > were able to load the model successfully.*
> > >>
> > >> Maybe you have OpenNLP twice on the classpath for some reason, once in
> > >> 1.5.3
> > >> and once in 1.6.0. Maybe OpenNLP classes are included in some
> > non-OpenNLP
> > >> JAR
> > >> as well that you use in your project?
> > >>
> > >> Cheers,
> > >>
> > >> -- Richard
> > >>
> > >
> > >
> >
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by William Colen <wi...@gmail.com>.
Are you using Maven?


2017-01-13 5:32 GMT-02:00 David Samuel Lim <be...@gmail.com>:

> Oops, I meant *opennlp-tools-1.5.3.jar*. My bad.
>
> On Fri, Jan 13, 2017 at 3:29 PM, David Samuel Lim <be...@gmail.com>
> wrote:
>
> > Hi Richard,
> >
> > Thanks for the reply. I've checked the classpath again and it only shows
> > the referenced 1.6.0 libraries.
> >
> > Though, when I initially faced the issue, one strategy I tried was to
> > reference the *opennlp-tools-1.5.0.jar* library. It didn't work, so I
> > removed it. None of the methods I've tried so far have given me a solid
> > answer, not even re-training the model using 1.6.0.
> >
> > *> Maybe OpenNLP classes are included in some non-OpenNLP JAR as well
> that
> > you use in your project?*
> >
> > Sorry, I'm personally not sure what you mean by this. Could you please
> > clarify?
> >
> > Regards,
> > David
> >
> > On Fri, Jan 13, 2017 at 3:14 PM, Richard Eckart de Castilho <
> > rec@apache.org> wrote:
> >
> >> On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com>
> wrote:
> >> >
> >> > *To sum up: Unable to load custom trained OpenNLP Name Finder model in
> >> code
> >> > due to apparent OpenNLP version incompatibility. Model was trained in
> >> > OpenNLP 1.6.0, which my project also uses. Other projects also using
> >> 1.6.0
> >> > were able to load the model successfully.*
> >>
> >> Maybe you have OpenNLP twice on the classpath for some reason, once in
> >> 1.5.3
> >> and once in 1.6.0. Maybe OpenNLP classes are included in some
> non-OpenNLP
> >> JAR
> >> as well that you use in your project?
> >>
> >> Cheers,
> >>
> >> -- Richard
> >>
> >
> >
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by David Samuel Lim <be...@gmail.com>.
Hello to everyone who has responded.

I would like to thank you for your invaluable assistance. Because of your
advice, I've gained a better insight into not just OpenNLP, but Java in
general as well.

I will continue to look deeper into this field.

Once again I would like to thank William, Richard, Jörn for their help.

Regards,
David

On Sat, Jan 14, 2017 at 4:08 AM, Richard Eckart de Castilho <re...@apache.org>
wrote:

> On 13.01.2017, at 11:41, David Samuel Lim <be...@gmail.com> wrote:
> >
> > After all that has said, I have a question:
> >
> > *Why is it that when the references to the OpenNLP 1.6.0 libraries are
> > removed, the program "reverts" back to OpenNLP 1.5.3, and how do I undo
> > this? (i.e. when I re-add the 1.6.0 libraries, the program starts using
> > 1.6.0 instead of 1.5.3)*
> > Once again, thanks to all who have answered so far for their insight and
> > advice.
>
> That is because you OpenNLP classes are in multiple JARs on your classpath.
> Depending on the order in which the JARs are mentioned on the classpath,
> the one or the other version of these classes is preferred.
>
> How to fix this?
>
> a) make sure that you don't use fat JARs (cf. other mail I wrote).
> b) consider using a tool that manages your dependencies such as Maven,
>    Gradle, or Ivy. I'd personally recommend Maven. It's a bit of another
>    learning curve though.
>
> Cheers,
>
> -- Richard
>
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 13.01.2017, at 11:41, David Samuel Lim <be...@gmail.com> wrote:
> 
> After all that has said, I have a question:
> 
> *Why is it that when the references to the OpenNLP 1.6.0 libraries are
> removed, the program "reverts" back to OpenNLP 1.5.3, and how do I undo
> this? (i.e. when I re-add the 1.6.0 libraries, the program starts using
> 1.6.0 instead of 1.5.3)*
> Once again, thanks to all who have answered so far for their insight and
> advice.

That is because you OpenNLP classes are in multiple JARs on your classpath.
Depending on the order in which the JARs are mentioned on the classpath,
the one or the other version of these classes is preferred.

How to fix this? 

a) make sure that you don't use fat JARs (cf. other mail I wrote).
b) consider using a tool that manages your dependencies such as Maven,
   Gradle, or Ivy. I'd personally recommend Maven. It's a bit of another
   learning curve though.

Cheers,

-- Richard


Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by David Samuel Lim <be...@gmail.com>.
Thank you William and Richard for your help and advice.

I think I may have discovered something.

My project also references Apache Tika - the *tika-app-1.13.jar *library.
I'm not very well-versed in Tika, but it apparently has its own
implementation of the OpenNLP files.

How did I discover this?

*(Please bear with this long anecdotal post, I want to describe how I came
across this findings.)*

Firstly, I was conducting experiments to try and resolve this issue. One of
the measures I took was to create a new Eclipse project. This new project
was almost an exact replica of my old project - word-for-word, with the
same naming conventions and program structure. It also made use of the same
libraries - including the OpenNLP 1.6.0 and Apache Tika libraries.

The new program initially worked well. It could load the custom model
successfully.

I experimented on this new program and decided to remove the OpenNLP 1.6.0
library references, then re-add them. This time, the program no longer
worked, instead showing the exact same error as my old program did.

I got curious, so I decided to try something. I removed the libraries again
and observed the code. I was puzzled to see that the import statements for
the OpenNLP classes in use did not show any errors.

Then, I tried removing the reference to *tika-app-1.13.jar*. To my
surprise, the import statements for the various OpenNLP classes in use
showed errors (i.e. red underlines). At that point, I realized that it was
in part due to Tika.

True enough, upon examining the *tika-app-1.13.jar* file, I saw folders
containing OpenNLP packages and files. Given the evidence so far, I
strongly suspect that the OpenNLP version that Tika is implementing is
1.5.3. I'll investigate and experiment more throughout this week and the
next.

*(Please do excuse me; I am rather new to OpenNLP and Tika)*

After all that has said, I have a question:

*Why is it that when the references to the OpenNLP 1.6.0 libraries are
removed, the program "reverts" back to OpenNLP 1.5.3, and how do I undo
this? (i.e. when I re-add the 1.6.0 libraries, the program starts using
1.6.0 instead of 1.5.3)*
Once again, thanks to all who have answered so far for their insight and
advice.

Regards,
David

On Fri, Jan 13, 2017 at 3:32 PM, David Samuel Lim <be...@gmail.com>
wrote:

> Oops, I meant *opennlp-tools-1.5.3.jar*. My bad.
>
> On Fri, Jan 13, 2017 at 3:29 PM, David Samuel Lim <be...@gmail.com>
> wrote:
>
>> Hi Richard,
>>
>> Thanks for the reply. I've checked the classpath again and it only shows
>> the referenced 1.6.0 libraries.
>>
>> Though, when I initially faced the issue, one strategy I tried was to
>> reference the *opennlp-tools-1.5.0.jar* library. It didn't work, so I
>> removed it. None of the methods I've tried so far have given me a solid
>> answer, not even re-training the model using 1.6.0.
>>
>> *> Maybe OpenNLP classes are included in some non-OpenNLP JAR as well
>> that you use in your project?*
>>
>> Sorry, I'm personally not sure what you mean by this. Could you please
>> clarify?
>>
>> Regards,
>> David
>>
>> On Fri, Jan 13, 2017 at 3:14 PM, Richard Eckart de Castilho <
>> rec@apache.org> wrote:
>>
>>> On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com> wrote:
>>> >
>>> > *To sum up: Unable to load custom trained OpenNLP Name Finder model in
>>> code
>>> > due to apparent OpenNLP version incompatibility. Model was trained in
>>> > OpenNLP 1.6.0, which my project also uses. Other projects also using
>>> 1.6.0
>>> > were able to load the model successfully.*
>>>
>>> Maybe you have OpenNLP twice on the classpath for some reason, once in
>>> 1.5.3
>>> and once in 1.6.0. Maybe OpenNLP classes are included in some
>>> non-OpenNLP JAR
>>> as well that you use in your project?
>>>
>>> Cheers,
>>>
>>> -- Richard
>>>
>>
>>
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by David Samuel Lim <be...@gmail.com>.
Oops, I meant *opennlp-tools-1.5.3.jar*. My bad.

On Fri, Jan 13, 2017 at 3:29 PM, David Samuel Lim <be...@gmail.com>
wrote:

> Hi Richard,
>
> Thanks for the reply. I've checked the classpath again and it only shows
> the referenced 1.6.0 libraries.
>
> Though, when I initially faced the issue, one strategy I tried was to
> reference the *opennlp-tools-1.5.0.jar* library. It didn't work, so I
> removed it. None of the methods I've tried so far have given me a solid
> answer, not even re-training the model using 1.6.0.
>
> *> Maybe OpenNLP classes are included in some non-OpenNLP JAR as well that
> you use in your project?*
>
> Sorry, I'm personally not sure what you mean by this. Could you please
> clarify?
>
> Regards,
> David
>
> On Fri, Jan 13, 2017 at 3:14 PM, Richard Eckart de Castilho <
> rec@apache.org> wrote:
>
>> On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com> wrote:
>> >
>> > *To sum up: Unable to load custom trained OpenNLP Name Finder model in
>> code
>> > due to apparent OpenNLP version incompatibility. Model was trained in
>> > OpenNLP 1.6.0, which my project also uses. Other projects also using
>> 1.6.0
>> > were able to load the model successfully.*
>>
>> Maybe you have OpenNLP twice on the classpath for some reason, once in
>> 1.5.3
>> and once in 1.6.0. Maybe OpenNLP classes are included in some non-OpenNLP
>> JAR
>> as well that you use in your project?
>>
>> Cheers,
>>
>> -- Richard
>>
>
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 13.01.2017, at 08:29, David Samuel Lim <be...@gmail.com> wrote:
> 
> *> Maybe OpenNLP classes are included in some non-OpenNLP JAR as well that
> you use in your project?*
> 
> Sorry, I'm personally not sure what you mean by this. Could you please
> clarify?

Sometimes people create so-called fat JARs. That is, the build a JAR
which not only contains their code, but also the code of each and every
library that they are using. 

I have hit that problem in the past when I was using a JAR from a tool
which included a full copy of the Stanford Parser. It meant, when I added
a more recent version of the Stanford Parser to my project, unpredictable
things would happen.

Cheers,

-- Richard

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by David Samuel Lim <be...@gmail.com>.
Hi Richard,

Thanks for the reply. I've checked the classpath again and it only shows
the referenced 1.6.0 libraries.

Though, when I initially faced the issue, one strategy I tried was to
reference the *opennlp-tools-1.5.0.jar* library. It didn't work, so I
removed it. None of the methods I've tried so far have given me a solid
answer, not even re-training the model using 1.6.0.

*> Maybe OpenNLP classes are included in some non-OpenNLP JAR as well that
you use in your project?*

Sorry, I'm personally not sure what you mean by this. Could you please
clarify?

Regards,
David

On Fri, Jan 13, 2017 at 3:14 PM, Richard Eckart de Castilho <re...@apache.org>
wrote:

> On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com> wrote:
> >
> > *To sum up: Unable to load custom trained OpenNLP Name Finder model in
> code
> > due to apparent OpenNLP version incompatibility. Model was trained in
> > OpenNLP 1.6.0, which my project also uses. Other projects also using
> 1.6.0
> > were able to load the model successfully.*
>
> Maybe you have OpenNLP twice on the classpath for some reason, once in
> 1.5.3
> and once in 1.6.0. Maybe OpenNLP classes are included in some non-OpenNLP
> JAR
> as well that you use in your project?
>
> Cheers,
>
> -- Richard
>

Re: OpenNLP - Model version 1.6.0 not supported by this (1.5.3) version of OpenNLP

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 13.01.2017, at 02:51, David Samuel Lim <be...@gmail.com> wrote:
> 
> *To sum up: Unable to load custom trained OpenNLP Name Finder model in code
> due to apparent OpenNLP version incompatibility. Model was trained in
> OpenNLP 1.6.0, which my project also uses. Other projects also using 1.6.0
> were able to load the model successfully.*

Maybe you have OpenNLP twice on the classpath for some reason, once in 1.5.3
and once in 1.6.0. Maybe OpenNLP classes are included in some non-OpenNLP JAR
as well that you use in your project?

Cheers,

-- Richard