You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@opennlp.apache.org by fr...@gmail.com on 2012/01/02 23:20:05 UTC

open nlp error


i have errors using openNLp you can tell me why ??

this is the code:

InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");

TokenNameFinderModel model = new TokenNameFinderModel(modelIn);

modelIn.close();
NameFinderME nameFinder = new NameFinderME(model);
String[] split = input.split(" ");
Span nameSpans[] = nameFinder.find(split);

nameFinder.clearAdaptiveData();

if (nameSpans == null || nameSpans.length == 0)
return;

for (Span span : nameSpans)
{
StringBuilder buf = new StringBuilder();

for (int i = span.getStart(); i < span.getEnd(); i++)
{
buf.append(split[i]);
if(i<span.getEnd()-1)
buf.append(" ");

}
System.out.println(buf.toString());
}


this is the error :



(class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)


-- 
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Re: open nlp error

Posted by fr...@gmail.com.
please i still have the same error you can help me ?  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  

> On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> >  
> > i have errors using openNLp you can tell me why ??
> >  
> > this is the code:
> >  
> > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
>  
> ^^^ Here you are missing an opening quote character
> >  
> > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> >  
> > modelIn.close();
> ^^^ You don't need to close the input stream. The
> TokenNameFinderModel should be taking care of that.
> > NameFinderME nameFinder = new NameFinderME(model);
> > String[] split = input.split(" ");
> > Span nameSpans[] = nameFinder.find(split);
> >  
> > nameFinder.clearAdaptiveData();
> ^^^ This should be done before the nameFinder.find() call or not at all.
> >  
> > if (nameSpans == null || nameSpans.length == 0)
> > return;
> >  
> > for (Span span : nameSpans)
> > {
> > StringBuilder buf = new StringBuilder();
> >  
> > for (int i = span.getStart(); i < span.getEnd(); i++)
> > {
> > buf.append(split[i]);
> > if(i<span.getEnd()-1)
> >  
>  
> ^^^ This if statement would probably be better with (i !=
> span.getEnd()) instead.
> > buf.append(" ");
> >  
> > }
> > System.out.println(buf.toString());
> > }
> >  
> >  
> > this is the error :
> >  
> >  
> >  
> > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> >  
>  
> What version of OpenNLP are you using and did the download of the model
> succeed?
>  
> Thanks,
> James
>  
>  



Re: open nlp error

Posted by fr...@gmail.com.
ok thx for reply i try it right now

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  

> You need to include the maxcent-3.0.0.jar file to your project as well.
>  
> James
>  
> On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > i have still the same error  
> >  
> > Im using open-nlp-tools1.50.jar and 1.5 models  
> >  
> > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> >  
> > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> >  
> > NameFinderME nameFinder = new NameFinderME(model);
> > String[] split = input.split(" ");
> > Span nameSpans[] = nameFinder.find(split);
> >  
> > if (nameSpans == null || nameSpans.length == 0)
> > return;
> >  
> > for (Span span : nameSpans)
> > {
> > StringBuilder buf = new StringBuilder();
> >  
> > for (int i = span.getStart(); i < span.getEnd(); i++)
> > {
> > buf.append(split[i]);
> > if(i != span.getEnd())
> > buf.append(" ");
> >  
> > }
> > System.out.println(buf.toString());
> > }
> >  
> >  
> >  
> > you can link me to the models maybe i wrong the page i suppose is this:
> > http://opennlp.sourceforge.net/models-1.5/
> > and version this:
> > http://sourceforge.net/projects/opennlp/
> >  
> > error:  
> > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> >  
> >  
> >  
> > --  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> >  
> > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > >  
> > > > i have errors using openNLp you can tell me why ??
> > > >  
> > > > this is the code:
> > > >  
> > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > >  
> > >  
> > >  
> > > ^^^ Here you are missing an opening quote character
> > > >  
> > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > >  
> > > > modelIn.close();
> > > >  
> > >  
> > > ^^^ You don't need to close the input stream. The
> > > TokenNameFinderModel should be taking care of that.
> > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > String[] split = input.split(" ");
> > > > Span nameSpans[] = nameFinder.find(split);
> > > >  
> > > > nameFinder.clearAdaptiveData();
> > > >  
> > >  
> > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > >  
> > > > if (nameSpans == null || nameSpans.length == 0)
> > > > return;
> > > >  
> > > > for (Span span : nameSpans)
> > > > {
> > > > StringBuilder buf = new StringBuilder();
> > > >  
> > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > {
> > > > buf.append(split[i]);
> > > > if(i<span.getEnd()-1)
> > > >  
> > > >  
> > >  
> > >  
> > > ^^^ This if statement would probably be better with (i !=
> > > span.getEnd()) instead.
> > > > buf.append(" ");
> > > >  
> > > > }
> > > > System.out.println(buf.toString());
> > > > }
> > > >  
> > > >  
> > > > this is the error :
> > > >  
> > > >  
> > > >  
> > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > >  
> > > >  
> > >  
> > >  
> > > What version of OpenNLP are you using and did the download of the model
> > > succeed?
> > >  
> > > Thanks,
> > > James
> > >  
> > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by fr...@gmail.com.
you saved me man   ... i was getting crazy with this error OMG you saved me from a suicide  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  

> You need to include the maxcent-3.0.0.jar file to your project as well.
>  
> James
>  
> On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > i have still the same error  
> >  
> > Im using open-nlp-tools1.50.jar and 1.5 models  
> >  
> > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> >  
> > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> >  
> > NameFinderME nameFinder = new NameFinderME(model);
> > String[] split = input.split(" ");
> > Span nameSpans[] = nameFinder.find(split);
> >  
> > if (nameSpans == null || nameSpans.length == 0)
> > return;
> >  
> > for (Span span : nameSpans)
> > {
> > StringBuilder buf = new StringBuilder();
> >  
> > for (int i = span.getStart(); i < span.getEnd(); i++)
> > {
> > buf.append(split[i]);
> > if(i != span.getEnd())
> > buf.append(" ");
> >  
> > }
> > System.out.println(buf.toString());
> > }
> >  
> >  
> >  
> > you can link me to the models maybe i wrong the page i suppose is this:
> > http://opennlp.sourceforge.net/models-1.5/
> > and version this:
> > http://sourceforge.net/projects/opennlp/
> >  
> > error:  
> > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> >  
> >  
> >  
> > --  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> >  
> > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > >  
> > > > i have errors using openNLp you can tell me why ??
> > > >  
> > > > this is the code:
> > > >  
> > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > >  
> > >  
> > >  
> > > ^^^ Here you are missing an opening quote character
> > > >  
> > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > >  
> > > > modelIn.close();
> > > >  
> > >  
> > > ^^^ You don't need to close the input stream. The
> > > TokenNameFinderModel should be taking care of that.
> > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > String[] split = input.split(" ");
> > > > Span nameSpans[] = nameFinder.find(split);
> > > >  
> > > > nameFinder.clearAdaptiveData();
> > > >  
> > >  
> > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > >  
> > > > if (nameSpans == null || nameSpans.length == 0)
> > > > return;
> > > >  
> > > > for (Span span : nameSpans)
> > > > {
> > > > StringBuilder buf = new StringBuilder();
> > > >  
> > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > {
> > > > buf.append(split[i]);
> > > > if(i<span.getEnd()-1)
> > > >  
> > > >  
> > >  
> > >  
> > > ^^^ This if statement would probably be better with (i !=
> > > span.getEnd()) instead.
> > > > buf.append(" ");
> > > >  
> > > > }
> > > > System.out.println(buf.toString());
> > > > }
> > > >  
> > > >  
> > > > this is the error :
> > > >  
> > > >  
> > > >  
> > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > >  
> > > >  
> > >  
> > >  
> > > What version of OpenNLP are you using and did the download of the model
> > > succeed?
> > >  
> > > Thanks,
> > > James
> > >  
> > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by fr...@gmail.com.
and i didn't any training... and i think that if those models were trained on Conll or Muc7 i suppose he should recognize 11:00 or 11.00 i m wrong ?  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 18.15, Aliaksandr Autayeu ha scritto:  

> A couple of examples:
>  
> 12.23 pm
> 12:23 pm
> 0:23
> 0.23
>  
> AFAIK, . is an italian separator for hours and minutes, while pm is an
> american postfix. So, to me, 12.23 pm is mixing italian and american time
> formats. And probably 12 and 24 hours format as well. The sentence looks
> funny too. Why there is time in the middle, and why there is no date nearby
> time. I doubt that it is important that Pierre will join on 12.23 rather
> than say 1 July and I guess that joyful reunion will happen anyway
> somewhere between the noon and 13:00, give or take half an hour, given the
> location :) This makes the sentence a bit unnatural, that's why the model
> might not have seen this kind of things.
>  
> To improve chances of your text to be recognized as time, you should follow
> the format of the text the model was trained on.
>  
> Aliaksandr
>  
> On Wed, Jan 4, 2012 at 5:55 PM, <francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)> wrote:
>  
> > something still is wrong ... on this example: "Pierre Vinken , Italy,
> > Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"
> > work good on person and location but dose not recognize date and time
> > 12.23 pm why ??? what is the format that text should follow ??
> >  
> > --
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 17.45,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:
> >  
> > > ok i have found the problem it work ;)
> > >  
> > > --
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >  
> > >  
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.23,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > >  
> > > > becuz with this example : Pierre Vinken , 61 years old , will join the
> > board as a nonexecutive director Nov. 29 . it recognize just Pierre Vinken
> > as name... and nothing else .. i used all other models and dose not get
> > Nov. 29 as Date (en-ner-date.bin) why ?
> > > >  
> > > > --
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > > >  
> > > > > james i can use en-ner-organization.bin instead of
> > en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it
> > will recognize organizations instead of persons ?
> > > > >  
> > > > > --
> > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >  
> > > > >  
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > > > >  
> > > > > > ok i fix it
> > > > > >  
> > > > > > --
> > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > >  
> > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >  
> > > > > >  
> > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha
> > scritto:
> > > > > >  
> > > > > > > I goofed on the if () change for the test. If you look carefully
> > there
> > > > > > > is a trailing space in your output.... Shoot.
> > > > > > >  
> > > > > > > James
> > > > > > >  
> > > > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) wrote:
> > > > > > > > work properly thank you very much
> > > > > > > >  
> > > > > > > > --
> > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > >  
> > > > > > > >  
> > > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James
> > Kosin ha scritto:
> > > > > > > >  
> > > > > > > > > You need to include the maxcent-3.0.0.jar file to your
> > project as well.
> > > > > > > > >  
> > > > > > > > > James
> > > > > > > > >  
> > > > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > wrote:
> > > > > > > > > > i have still the same error
> > > > > > > > > >  
> > > > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models
> > > > > > > > > >  
> > > > > > > > > > InputStream modelIn = new
> > FileInputStream("en-ner-person.bin");
> > > > > > > > > >  
> > > > > > > > > > TokenNameFinderModel model = new
> > TokenNameFinderModel(modelIn);
> > > > > > > > > >  
> > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > >  
> > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > return;
> > > > > > > > > >  
> > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > {
> > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > >  
> > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > {
> > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > if(i != span.getEnd())
> > > > > > > > > > buf.append(" ");
> > > > > > > > > >  
> > > > > > > > > > }
> > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > }
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > you can link me to the models maybe i wrong the page i
> > suppose is this:
> > > > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > > > and version this:
> > > > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > > > >  
> > > > > > > > > > error:
> > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > Bad type in putfield/putstatic
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > --
> > > > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James
> > Kosin ha scritto:
> > > > > > > > > >  
> > > > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > wrote:
> > > > > > > > > > > >  
> > > > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > > > >  
> > > > > > > > > > > > this is the code:
> > > > > > > > > > > >  
> > > > > > > > > > > > InputStream modelIn = new
> > FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > > > >  
> > > > > > > > > > > > TokenNameFinderModel model = new
> > TokenNameFinderModel(modelIn);
> > > > > > > > > > > >  
> > > > > > > > > > > > modelIn.close();
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > > >  
> > > > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ This should be done before the nameFinder.find()
> > call or not at all.
> > > > > > > > > > > >  
> > > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > > return;
> > > > > > > > > > > >  
> > > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > > {
> > > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > > >  
> > > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > > {
> > > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > > > buf.append(" ");
> > > > > > > > > > > >  
> > > > > > > > > > > > }
> > > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > > }
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > this is the error :
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > Bad type in putfield/putstatic
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > What version of OpenNLP are you using and did the
> > download of the model
> > > > > > > > > > > succeed?
> > > > > > > > > > >  
> > > > > > > > > > > Thanks,
> > > > > > > > > > > James
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by fr...@gmail.com.
http://opennlp.sourceforge.net/models-1.5/ dose not say ner on what models has been trained why?

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 18.29, francesco.tangari.inf@gmail.com ha scritto:  

> and if i write "Pierre Vinken , Italy, Milan, 11.00 now today tomorrow 61 years old"  it recognize locations , persons, and today and tomorrow and now  and dose not get 11.00 ... :(  
>  
> --  
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>  
>  
> Il giorno mercoledì 4 gennaio 2012, alle ore 18.15, Aliaksandr Autayeu ha scritto:  
>  
> > A couple of examples:
> >  
> > 12.23 pm
> > 12:23 pm
> > 0:23
> > 0.23
> >  
> > AFAIK, . is an italian separator for hours and minutes, while pm is an
> > american postfix. So, to me, 12.23 pm is mixing italian and american time
> > formats. And probably 12 and 24 hours format as well. The sentence looks
> > funny too. Why there is time in the middle, and why there is no date nearby
> > time. I doubt that it is important that Pierre will join on 12.23 rather
> > than say 1 July and I guess that joyful reunion will happen anyway
> > somewhere between the noon and 13:00, give or take half an hour, given the
> > location :) This makes the sentence a bit unnatural, that's why the model
> > might not have seen this kind of things.
> >  
> > To improve chances of your text to be recognized as time, you should follow
> > the format of the text the model was trained on.
> >  
> > Aliaksandr
> >  
> > On Wed, Jan 4, 2012 at 5:55 PM, <francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)> wrote:
> >  
> > > something still is wrong ... on this example: "Pierre Vinken , Italy,
> > > Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"
> > > work good on person and location but dose not recognize date and time
> > > 12.23 pm why ??? what is the format that text should follow ??
> > >  
> > > --
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >  
> > >  
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.45,
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:
> > >  
> > > > ok i have found the problem it work ;)
> > > >  
> > > > --
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.23,
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > ha scritto:
> > > >  
> > > > > becuz with this example : Pierre Vinken , 61 years old , will join the
> > > board as a nonexecutive director Nov. 29 . it recognize just Pierre Vinken
> > > as name... and nothing else .. i used all other models and dose not get
> > > Nov. 29 as Date (en-ner-date.bin) why ?
> > > > >  
> > > > > --
> > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > >  
> > > >  
> > >  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >  
> > > > >  
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17,
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > ha scritto:
> > > > >  
> > > > > > james i can use en-ner-organization.bin instead of
> > > en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it
> > > will recognize organizations instead of persons ?
> > > > > >  
> > > > > > --
> > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >  
> > > > > >  
> > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11,
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > ha scritto:
> > > > > >  
> > > > > > > ok i fix it
> > > > > > >  
> > > > > > > --
> > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > >  
> > > > > > >  
> > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha
> > > scritto:
> > > > > > >  
> > > > > > > > I goofed on the if () change for the test. If you look carefully
> > > there
> > > > > > > > is a trailing space in your output.... Shoot.
> > > > > > > >  
> > > > > > > > James
> > > > > > > >  
> > > > > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) wrote:
> > > > > > > > > work properly thank you very much
> > > > > > > > >  
> > > > > > > > > --
> > > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James
> > > Kosin ha scritto:
> > > > > > > > >  
> > > > > > > > > > You need to include the maxcent-3.0.0.jar file to your
> > > project as well.
> > > > > > > > > >  
> > > > > > > > > > James
> > > > > > > > > >  
> > > > > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:francesco.tangari.inf@gmail.com)
> > > wrote:
> > > > > > > > > > > i have still the same error
> > > > > > > > > > >  
> > > > > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models
> > > > > > > > > > >  
> > > > > > > > > > > InputStream modelIn = new
> > > FileInputStream("en-ner-person.bin");
> > > > > > > > > > >  
> > > > > > > > > > > TokenNameFinderModel model = new
> > > TokenNameFinderModel(modelIn);
> > > > > > > > > > >  
> > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > >  
> > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > return;
> > > > > > > > > > >  
> > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > {
> > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > >  
> > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > {
> > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > if(i != span.getEnd())
> > > > > > > > > > > buf.append(" ");
> > > > > > > > > > >  
> > > > > > > > > > > }
> > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > }
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > you can link me to the models maybe i wrong the page i
> > > suppose is this:
> > > > > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > > > > and version this:
> > > > > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > > > > >  
> > > > > > > > > > > error:
> > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > > Bad type in putfield/putstatic
> > > > > > > > > > > at
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > at
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > at
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > at
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > at
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > --
> > > > > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James
> > > Kosin ha scritto:
> > > > > > > > > > >  
> > > > > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:francesco.tangari.inf@gmail.com)
> > > wrote:
> > > > > > > > > > > > >  
> > > > > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > > > > >  
> > > > > > > > > > > > > this is the code:
> > > > > > > > > > > > >  
> > > > > > > > > > > > > InputStream modelIn = new
> > > FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > > > > >  
> > > > > > > > > > > > > TokenNameFinderModel model = new
> > > TokenNameFinderModel(modelIn);
> > > > > > > > > > > > >  
> > > > > > > > > > > > > modelIn.close();
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > > > >  
> > > > > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > ^^^ This should be done before the nameFinder.find()
> > > call or not at all.
> > > > > > > > > > > > >  
> > > > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > > > return;
> > > > > > > > > > > > >  
> > > > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > > > {
> > > > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > > > >  
> > > > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > > > {
> > > > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > > > > buf.append(" ");
> > > > > > > > > > > > >  
> > > > > > > > > > > > > }
> > > > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > > > }
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > > this is the error :
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > > Bad type in putfield/putstatic
> > > > > > > > > > > > > at
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > > at
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > > > at
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > > > at
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > > > at
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > > LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > What version of OpenNLP are you using and did the
> > > download of the model
> > > > > > > > > > > > succeed?
> > > > > > > > > > > >  
> > > > > > > > > > > > Thanks,
> > > > > > > > > > > > James
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> > >  
> >  
> >  
> >  
> >  
>  
>  


Re: open nlp error

Posted by fr...@gmail.com.
and if i write "Pierre Vinken , Italy, Milan, 11.00 now today tomorrow 61 years old"  it recognize locations , persons, and today and tomorrow and now  and dose not get 11.00 ... :(  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 18.15, Aliaksandr Autayeu ha scritto:  

> A couple of examples:
>  
> 12.23 pm
> 12:23 pm
> 0:23
> 0.23
>  
> AFAIK, . is an italian separator for hours and minutes, while pm is an
> american postfix. So, to me, 12.23 pm is mixing italian and american time
> formats. And probably 12 and 24 hours format as well. The sentence looks
> funny too. Why there is time in the middle, and why there is no date nearby
> time. I doubt that it is important that Pierre will join on 12.23 rather
> than say 1 July and I guess that joyful reunion will happen anyway
> somewhere between the noon and 13:00, give or take half an hour, given the
> location :) This makes the sentence a bit unnatural, that's why the model
> might not have seen this kind of things.
>  
> To improve chances of your text to be recognized as time, you should follow
> the format of the text the model was trained on.
>  
> Aliaksandr
>  
> On Wed, Jan 4, 2012 at 5:55 PM, <francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)> wrote:
>  
> > something still is wrong ... on this example: "Pierre Vinken , Italy,
> > Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"
> > work good on person and location but dose not recognize date and time
> > 12.23 pm why ??? what is the format that text should follow ??
> >  
> > --
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 17.45,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:
> >  
> > > ok i have found the problem it work ;)
> > >  
> > > --
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >  
> > >  
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.23,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > >  
> > > > becuz with this example : Pierre Vinken , 61 years old , will join the
> > board as a nonexecutive director Nov. 29 . it recognize just Pierre Vinken
> > as name... and nothing else .. i used all other models and dose not get
> > Nov. 29 as Date (en-ner-date.bin) why ?
> > > >  
> > > > --
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > > >  
> > > > > james i can use en-ner-organization.bin instead of
> > en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it
> > will recognize organizations instead of persons ?
> > > > >  
> > > > > --
> > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >  
> > > > >  
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > > > >  
> > > > > > ok i fix it
> > > > > >  
> > > > > > --
> > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > >  
> > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >  
> > > > > >  
> > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha
> > scritto:
> > > > > >  
> > > > > > > I goofed on the if () change for the test. If you look carefully
> > there
> > > > > > > is a trailing space in your output.... Shoot.
> > > > > > >  
> > > > > > > James
> > > > > > >  
> > > > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) wrote:
> > > > > > > > work properly thank you very much
> > > > > > > >  
> > > > > > > > --
> > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > >  
> > > > > > > >  
> > > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James
> > Kosin ha scritto:
> > > > > > > >  
> > > > > > > > > You need to include the maxcent-3.0.0.jar file to your
> > project as well.
> > > > > > > > >  
> > > > > > > > > James
> > > > > > > > >  
> > > > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > wrote:
> > > > > > > > > > i have still the same error
> > > > > > > > > >  
> > > > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models
> > > > > > > > > >  
> > > > > > > > > > InputStream modelIn = new
> > FileInputStream("en-ner-person.bin");
> > > > > > > > > >  
> > > > > > > > > > TokenNameFinderModel model = new
> > TokenNameFinderModel(modelIn);
> > > > > > > > > >  
> > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > >  
> > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > return;
> > > > > > > > > >  
> > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > {
> > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > >  
> > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > {
> > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > if(i != span.getEnd())
> > > > > > > > > > buf.append(" ");
> > > > > > > > > >  
> > > > > > > > > > }
> > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > }
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > you can link me to the models maybe i wrong the page i
> > suppose is this:
> > > > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > > > and version this:
> > > > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > > > >  
> > > > > > > > > > error:
> > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > Bad type in putfield/putstatic
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > --
> > > > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James
> > Kosin ha scritto:
> > > > > > > > > >  
> > > > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > wrote:
> > > > > > > > > > > >  
> > > > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > > > >  
> > > > > > > > > > > > this is the code:
> > > > > > > > > > > >  
> > > > > > > > > > > > InputStream modelIn = new
> > FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > > > >  
> > > > > > > > > > > > TokenNameFinderModel model = new
> > TokenNameFinderModel(modelIn);
> > > > > > > > > > > >  
> > > > > > > > > > > > modelIn.close();
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > > >  
> > > > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ This should be done before the nameFinder.find()
> > call or not at all.
> > > > > > > > > > > >  
> > > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > > return;
> > > > > > > > > > > >  
> > > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > > {
> > > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > > >  
> > > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > > {
> > > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > > > buf.append(" ");
> > > > > > > > > > > >  
> > > > > > > > > > > > }
> > > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > > }
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > this is the error :
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > Bad type in putfield/putstatic
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > What version of OpenNLP are you using and did the
> > download of the model
> > > > > > > > > > > succeed?
> > > > > > > > > > >  
> > > > > > > > > > > Thanks,
> > > > > > > > > > > James
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by fr...@gmail.com.
ok i get it now.

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 18.44, Aliaksandr Autayeu ha scritto:  

> The sense - no. The format - probably yes. And if the date and time often
> go together that is learned, making time alone an infrequent occasion, and
> thus less probable. From the front page of reuters.com (http://reuters.com) - "as head of
> watchdog 12:18pm EST CLEVELAND - President". Notice "12:18pm", not
> "12.18pm" (dot) and not "12.18 pm" (extra space).
>  
> Aliaksandr
>  
> On Wed, Jan 4, 2012 at 6:20 PM, <francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)> wrote:
>  
> > you are sure that the model take in consideration the sense of the time?
> > the sentence dose not make sense it was just a couple of words together...
> >  
> > --
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 18.15, Aliaksandr Autayeu ha
> > scritto:
> >  
> > > A couple of examples:
> > >  
> > > 12.23 pm
> > > 12:23 pm
> > > 0:23
> > > 0.23
> > >  
> > > AFAIK, . is an italian separator for hours and minutes, while pm is an
> > > american postfix. So, to me, 12.23 pm is mixing italian and american time
> > > formats. And probably 12 and 24 hours format as well. The sentence looks
> > > funny too. Why there is time in the middle, and why there is no date
> > >  
> >  
> > nearby
> > > time. I doubt that it is important that Pierre will join on 12.23 rather
> > > than say 1 July and I guess that joyful reunion will happen anyway
> > > somewhere between the noon and 13:00, give or take half an hour, given
> > >  
> >  
> > the
> > > location :) This makes the sentence a bit unnatural, that's why the model
> > > might not have seen this kind of things.
> > >  
> > > To improve chances of your text to be recognized as time, you should
> > follow
> > > the format of the text the model was trained on.
> > >  
> > > Aliaksandr
> > >  
> > > On Wed, Jan 4, 2012 at 5:55 PM, <francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))> wrote:
> > >  
> > > > something still is wrong ... on this example: "Pierre Vinken , Italy,
> > > > Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"
> > > > work good on person and location but dose not recognize date and time
> > > > 12.23 pm why ??? what is the format that text should follow ??
> > > >  
> > > > --
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.45,
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) ha scritto:
> > > >  
> > > > > ok i have found the problem it work ;)
> > > > >  
> > > > > --
> > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >  
> > > > >  
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.23,
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > ha scritto:
> > > > >  
> > > > > > becuz with this example : Pierre Vinken , 61 years old , will join
> > the
> > > > board as a nonexecutive director Nov. 29 . it recognize just Pierre
> > >  
> >  
> > Vinken
> > > > as name... and nothing else .. i used all other models and dose not get
> > > > Nov. 29 as Date (en-ner-date.bin) why ?
> > > > > >  
> > > > > > --
> > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)))
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >  
> > > > > >  
> > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17,
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > ha scritto:
> > > > > >  
> > > > > > > james i can use en-ner-organization.bin instead of
> > > > en-ner-person.bin in my code ? ( the code i pasted on our conversation
> > > >  
> > >  
> >  
> > ) it
> > > > will recognize organizations instead of persons ?
> > > > > > >  
> > > > > > > --
> > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)))
> > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > >  
> > > > > > >  
> > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11,
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > ha scritto:
> > > > > > >  
> > > > > > > > ok i fix it
> > > > > > > >  
> > > > > > > > --
> > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)))
> > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > >  
> > > > > > > >  
> > > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James
> > Kosin ha
> > > > scritto:
> > > > > > > >  
> > > > > > > > > I goofed on the if () change for the test. If you look
> > carefully
> > > > there
> > > > > > > > > is a trailing space in your output.... Shoot.
> > > > > > > > >  
> > > > > > > > > James
> > > > > > > > >  
> > > > > > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))) wrote:
> > > > > > > > > > work properly thank you very much
> > > > > > > > > >  
> > > > > > > > > > --
> > > > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)))
> > > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James
> > > > Kosin ha scritto:
> > > > > > > > > >  
> > > > > > > > > > > You need to include the maxcent-3.0.0.jar file to your
> > > > project as well.
> > > > > > > > > > >  
> > > > > > > > > > > James
> > > > > > > > > > >  
> > > > > > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))(mailto:
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > wrote:
> > > > > > > > > > > > i have still the same error
> > > > > > > > > > > >  
> > > > > > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models
> > > > > > > > > > > >  
> > > > > > > > > > > > InputStream modelIn = new
> > > > FileInputStream("en-ner-person.bin");
> > > > > > > > > > > >  
> > > > > > > > > > > > TokenNameFinderModel model = new
> > > > TokenNameFinderModel(modelIn);
> > > > > > > > > > > >  
> > > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > > >  
> > > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > > return;
> > > > > > > > > > > >  
> > > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > > {
> > > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > > >  
> > > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > > {
> > > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > > if(i != span.getEnd())
> > > > > > > > > > > > buf.append(" ");
> > > > > > > > > > > >  
> > > > > > > > > > > > }
> > > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > > }
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > you can link me to the models maybe i wrong the page i
> > > > suppose is this:
> > > > > > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > > > > > and version this:
> > > > > > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > > > > > >  
> > > > > > > > > > > > error:
> > > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > opennlp/model/GenericModelReader, method: checkModelType signature:
> > ()V)
> > > > Bad type in putfield/putstatic
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > --
> > > > > > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > > > > > > > Inviato con Sparrow (
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > http://www.sparrowmailapp.com/?sig)
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James
> > > > Kosin ha scritto:
> > > > > > > > > > > >  
> > > > > > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))(mailto:
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) (mailto:
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > wrote:
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > this is the code:
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > InputStream modelIn = new
> > > > FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > TokenNameFinderModel model = new
> > > > TokenNameFinderModel(modelIn);
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > modelIn.close();
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > > ^^^ This should be done before the nameFinder.find()
> > > > call or not at all.
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > > > > return;
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > > > > {
> > > > > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd();
> > i++)
> > > > > > > > > > > > > > {
> > > > > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > > ^^^ This if statement would probably be better with
> > (i !=
> > > > > > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > > > > > buf.append(" ");
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > }
> > > > > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > > > > }
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > this is the error :
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > >  
> > > > > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > opennlp/model/GenericModelReader, method: checkModelType signature:
> > ()V)
> > > > Bad type in putfield/putstatic
> > > > > > > > > > > > > > at
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > > > at
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > > > > at
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > > > > at
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > > > > at
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > > > LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > > > > > at
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> > OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > >  
> > > > > > > > > > > > > What version of OpenNLP are you using and did the
> > > > download of the model
> > > > > > > > > > > > > succeed?
> > > > > > > > > > > > >  
> > > > > > > > > > > > > Thanks,
> > > > > > > > > > > > > James
> > > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by Aliaksandr Autayeu <al...@autayeu.com>.
The sense - no. The format - probably yes. And if the date and time often
go together that is learned, making time alone an infrequent occasion, and
thus less probable. From the front page of reuters.com - "as head of
watchdog 12:18pm EST CLEVELAND - President". Notice  "12:18pm", not
"12.18pm" (dot) and not  "12.18 pm" (extra space).

Aliaksandr

On Wed, Jan 4, 2012 at 6:20 PM, <fr...@gmail.com> wrote:

> you are sure that the model take in consideration the sense of the time?
> the sentence dose not make sense it was just a couple of words together...
>
> --
> francesco.tangari.inf@gmail.com
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> Il giorno mercoledì 4 gennaio 2012, alle ore 18.15, Aliaksandr Autayeu ha
> scritto:
>
> > A couple of examples:
> >
> > 12.23 pm
> > 12:23 pm
> > 0:23
> > 0.23
> >
> > AFAIK, . is an italian separator for hours and minutes, while pm is an
> > american postfix. So, to me, 12.23 pm is mixing italian and american time
> > formats. And probably 12 and 24 hours format as well. The sentence looks
> > funny too. Why there is time in the middle, and why there is no date
> nearby
> > time. I doubt that it is important that Pierre will join on 12.23 rather
> > than say 1 July and I guess that joyful reunion will happen anyway
> > somewhere between the noon and 13:00, give or take half an hour, given
> the
> > location :) This makes the sentence a bit unnatural, that's why the model
> > might not have seen this kind of things.
> >
> > To improve chances of your text to be recognized as time, you should
> follow
> > the format of the text the model was trained on.
> >
> > Aliaksandr
> >
> > On Wed, Jan 4, 2012 at 5:55 PM, <francesco.tangari.inf@gmail.com(mailto:
> francesco.tangari.inf@gmail.com)> wrote:
> >
> > > something still is wrong ... on this example: "Pierre Vinken , Italy,
> > > Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"
> > > work good on person and location but dose not recognize date and time
> > > 12.23 pm why ??? what is the format that text should follow ??
> > >
> > > --
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >
> > >
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.45,
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) ha scritto:
> > >
> > > > ok i have found the problem it work ;)
> > > >
> > > > --
> > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >
> > > >
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.23,
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > ha scritto:
> > > >
> > > > > becuz with this example : Pierre Vinken , 61 years old , will join
> the
> > > board as a nonexecutive director Nov. 29 . it recognize just Pierre
> Vinken
> > > as name... and nothing else .. i used all other models and dose not get
> > > Nov. 29 as Date (en-ner-date.bin) why ?
> > > > >
> > > > > --
> > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) (mailto:
> > > > >
> > > >
> > >
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com))
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >
> > > > >
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17,
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > ha scritto:
> > > > >
> > > > > > james i can use en-ner-organization.bin instead of
> > > en-ner-person.bin in my code ? ( the code i pasted on our conversation
> ) it
> > > will recognize organizations instead of persons ?
> > > > > >
> > > > > > --
> > > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) (mailto:
> > > > > >
> > > > >
> > > >
> > >
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com))
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >
> > > > > >
> > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11,
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > ha scritto:
> > > > > >
> > > > > > > ok i fix it
> > > > > > >
> > > > > > > --
> > > > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) (mailto:
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com))
> > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > >
> > > > > > >
> > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James
> Kosin ha
> > > scritto:
> > > > > > >
> > > > > > > > I goofed on the if () change for the test. If you look
> carefully
> > > there
> > > > > > > > is a trailing space in your output.... Shoot.
> > > > > > > >
> > > > > > > > James
> > > > > > > >
> > > > > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com(mailto:
> francesco.tangari.inf@gmail.com) (mailto:
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)) wrote:
> > > > > > > > > work properly thank you very much
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com))
> > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James
> > > Kosin ha scritto:
> > > > > > > > >
> > > > > > > > > > You need to include the maxcent-3.0.0.jar file to your
> > > project as well.
> > > > > > > > > >
> > > > > > > > > > James
> > > > > > > > > >
> > > > > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com(mailto:
> francesco.tangari.inf@gmail.com)(mailto:
> > > francesco.tangari.inf@gmail.com) (mailto:
> francesco.tangari.inf@gmail.com)
> > > wrote:
> > > > > > > > > > > i have still the same error
> > > > > > > > > > >
> > > > > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models
> > > > > > > > > > >
> > > > > > > > > > > InputStream modelIn = new
> > > FileInputStream("en-ner-person.bin");
> > > > > > > > > > >
> > > > > > > > > > > TokenNameFinderModel model = new
> > > TokenNameFinderModel(modelIn);
> > > > > > > > > > >
> > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > >
> > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > return;
> > > > > > > > > > >
> > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > {
> > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > >
> > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > {
> > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > if(i != span.getEnd())
> > > > > > > > > > > buf.append(" ");
> > > > > > > > > > >
> > > > > > > > > > > }
> > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > you can link me to the models maybe i wrong the page i
> > > suppose is this:
> > > > > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > > > > and version this:
> > > > > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > > > > >
> > > > > > > > > > > error:
> > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > opennlp/model/GenericModelReader, method: checkModelType signature:
> ()V)
> > > Bad type in putfield/putstatic
> > > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > at
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > --
> > > > > > > > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > francesco.tangari.inf@gmail.com) (mailto:
> francesco.tangari.inf@gmail.com)
> > > > > > > > > > > Inviato con Sparrow (
> http://www.sparrowmailapp.com/?sig)
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James
> > > Kosin ha scritto:
> > > > > > > > > > >
> > > > > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com(mailto:
> francesco.tangari.inf@gmail.com)(mailto:
> > > francesco.tangari.inf@gmail.com) (mailto:
> francesco.tangari.inf@gmail.com)
> > > wrote:
> > > > > > > > > > > > >
> > > > > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > > > > >
> > > > > > > > > > > > > this is the code:
> > > > > > > > > > > > >
> > > > > > > > > > > > > InputStream modelIn = new
> > > FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > > > > >
> > > > > > > > > > > > > TokenNameFinderModel model = new
> > > TokenNameFinderModel(modelIn);
> > > > > > > > > > > > >
> > > > > > > > > > > > > modelIn.close();
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > > > >
> > > > > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > ^^^ This should be done before the nameFinder.find()
> > > call or not at all.
> > > > > > > > > > > > >
> > > > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > > > return;
> > > > > > > > > > > > >
> > > > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > > > {
> > > > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > > > >
> > > > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd();
> i++)
> > > > > > > > > > > > > {
> > > > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > ^^^ This if statement would probably be better with
> (i !=
> > > > > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > > > > buf.append(" ");
> > > > > > > > > > > > >
> > > > > > > > > > > > > }
> > > > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > > > }
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > this is the error :
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > >
> > > > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > opennlp/model/GenericModelReader, method: checkModelType signature:
> ()V)
> > > Bad type in putfield/putstatic
> > > > > > > > > > > > > at
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > > at
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > > > at
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > > > at
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > > > at
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > > LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > > > > at
> OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > >
> > > > > > > > > > > > What version of OpenNLP are you using and did the
> > > download of the model
> > > > > > > > > > > > succeed?
> > > > > > > > > > > >
> > > > > > > > > > > > Thanks,
> > > > > > > > > > > > James
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
> >
>
>
>

Re: open nlp error

Posted by fr...@gmail.com.
you are sure that the model take in consideration the sense of the time? the sentence dose not make sense it was just a couple of words together...  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 18.15, Aliaksandr Autayeu ha scritto:  

> A couple of examples:
>  
> 12.23 pm
> 12:23 pm
> 0:23
> 0.23
>  
> AFAIK, . is an italian separator for hours and minutes, while pm is an
> american postfix. So, to me, 12.23 pm is mixing italian and american time
> formats. And probably 12 and 24 hours format as well. The sentence looks
> funny too. Why there is time in the middle, and why there is no date nearby
> time. I doubt that it is important that Pierre will join on 12.23 rather
> than say 1 July and I guess that joyful reunion will happen anyway
> somewhere between the noon and 13:00, give or take half an hour, given the
> location :) This makes the sentence a bit unnatural, that's why the model
> might not have seen this kind of things.
>  
> To improve chances of your text to be recognized as time, you should follow
> the format of the text the model was trained on.
>  
> Aliaksandr
>  
> On Wed, Jan 4, 2012 at 5:55 PM, <francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)> wrote:
>  
> > something still is wrong ... on this example: "Pierre Vinken , Italy,
> > Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"
> > work good on person and location but dose not recognize date and time
> > 12.23 pm why ??? what is the format that text should follow ??
> >  
> > --
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 17.45,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:
> >  
> > > ok i have found the problem it work ;)
> > >  
> > > --
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >  
> > >  
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.23,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > >  
> > > > becuz with this example : Pierre Vinken , 61 years old , will join the
> > board as a nonexecutive director Nov. 29 . it recognize just Pierre Vinken
> > as name... and nothing else .. i used all other models and dose not get
> > Nov. 29 as Date (en-ner-date.bin) why ?
> > > >  
> > > > --
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > > >  
> > > > > james i can use en-ner-organization.bin instead of
> > en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it
> > will recognize organizations instead of persons ?
> > > > >  
> > > > > --
> > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >  
> > > > >  
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11,
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > ha scritto:
> > > > >  
> > > > > > ok i fix it
> > > > > >  
> > > > > > --
> > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > >  
> > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >  
> > > > > >  
> > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha
> > scritto:
> > > > > >  
> > > > > > > I goofed on the if () change for the test. If you look carefully
> > there
> > > > > > > is a trailing space in your output.... Shoot.
> > > > > > >  
> > > > > > > James
> > > > > > >  
> > > > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)) wrote:
> > > > > > > > work properly thank you very much
> > > > > > > >  
> > > > > > > > --
> > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com))
> > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > >  
> > > > > > > >  
> > > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James
> > Kosin ha scritto:
> > > > > > > >  
> > > > > > > > > You need to include the maxcent-3.0.0.jar file to your
> > project as well.
> > > > > > > > >  
> > > > > > > > > James
> > > > > > > > >  
> > > > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > wrote:
> > > > > > > > > > i have still the same error
> > > > > > > > > >  
> > > > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models
> > > > > > > > > >  
> > > > > > > > > > InputStream modelIn = new
> > FileInputStream("en-ner-person.bin");
> > > > > > > > > >  
> > > > > > > > > > TokenNameFinderModel model = new
> > TokenNameFinderModel(modelIn);
> > > > > > > > > >  
> > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > >  
> > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > return;
> > > > > > > > > >  
> > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > {
> > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > >  
> > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > {
> > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > if(i != span.getEnd())
> > > > > > > > > > buf.append(" ");
> > > > > > > > > >  
> > > > > > > > > > }
> > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > }
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > you can link me to the models maybe i wrong the page i
> > suppose is this:
> > > > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > > > and version this:
> > > > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > > > >  
> > > > > > > > > > error:
> > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > Bad type in putfield/putstatic
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > at
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > --
> > > > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James
> > Kosin ha scritto:
> > > > > > > > > >  
> > > > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)(mailto:
> > francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > wrote:
> > > > > > > > > > > >  
> > > > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > > > >  
> > > > > > > > > > > > this is the code:
> > > > > > > > > > > >  
> > > > > > > > > > > > InputStream modelIn = new
> > FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > > > >  
> > > > > > > > > > > > TokenNameFinderModel model = new
> > TokenNameFinderModel(modelIn);
> > > > > > > > > > > >  
> > > > > > > > > > > > modelIn.close();
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > > >  
> > > > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ This should be done before the nameFinder.find()
> > call or not at all.
> > > > > > > > > > > >  
> > > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > > return;
> > > > > > > > > > > >  
> > > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > > {
> > > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > > >  
> > > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > > {
> > > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > > > buf.append(" ");
> > > > > > > > > > > >  
> > > > > > > > > > > > }
> > > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > > }
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > this is the error :
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > >  
> > > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> > checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > > java.lang.VerifyError: (class:
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> > Bad type in putfield/putstatic
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > > at
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> > LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > >  
> > > > > > > > > > > What version of OpenNLP are you using and did the
> > download of the model
> > > > > > > > > > > succeed?
> > > > > > > > > > >  
> > > > > > > > > > > Thanks,
> > > > > > > > > > > James
> > > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > >  
> > > > >  
> > > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by Aliaksandr Autayeu <al...@autayeu.com>.
A couple of examples:

12.23 pm
12:23 pm
0:23
0.23

AFAIK, . is an italian separator for hours and minutes, while pm is an
american postfix. So, to me, 12.23 pm is mixing italian and american time
formats. And probably 12 and 24 hours format as well.  The sentence looks
funny too. Why there is time in the middle, and why there is no date nearby
time. I doubt that it is important that Pierre will join on 12.23 rather
than say 1 July and I guess that joyful reunion will happen anyway
somewhere between the noon and 13:00, give or take half an hour, given the
location :) This makes the sentence a bit unnatural, that's why the model
might not have seen this kind of things.

To improve chances of your text to be recognized as time, you should follow
the format of the text the model was trained on.

Aliaksandr

On Wed, Jan 4, 2012 at 5:55 PM, <fr...@gmail.com> wrote:

> something still is wrong ... on this example: "Pierre Vinken , Italy,
> Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"
>  work good on person and location but  dose not recognize date and time
>  12.23 pm  why ??? what is the format that text should follow ??
>
> --
> francesco.tangari.inf@gmail.com
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> Il giorno mercoledì 4 gennaio 2012, alle ore 17.45,
> francesco.tangari.inf@gmail.com ha scritto:
>
> > ok i have found the problem it work ;)
> >
> > --
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >
> >
> > Il giorno mercoledì 4 gennaio 2012, alle ore 17.23,
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> ha scritto:
> >
> > > becuz with this example : Pierre Vinken , 61 years old , will join the
> board as a nonexecutive director Nov. 29 .  it recognize just Pierre Vinken
> as name... and nothing else .. i used all other models and dose not get
> Nov. 29 as Date (en-ner-date.bin)  why ?
> > >
> > > --
> > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >
> > >
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17,
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> ha scritto:
> > >
> > > > james i can use en-ner-organization.bin  instead of
> en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it
> will recognize organizations instead of persons ?
> > > >
> > > > --
> > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >
> > > >
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11,
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> ha scritto:
> > > >
> > > > > ok  i fix it
> > > > >
> > > > > --
> > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >
> > > > >
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha
> scritto:
> > > > >
> > > > > > I goofed on the if () change for the test. If you look carefully
> there
> > > > > > is a trailing space in your output.... Shoot.
> > > > > >
> > > > > > James
> > > > > >
> > > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) wrote:
> > > > > > > work properly thank you very much
> > > > > > >
> > > > > > > --
> > > > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com)
> > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > >
> > > > > > >
> > > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James
> Kosin ha scritto:
> > > > > > >
> > > > > > > > You need to include the maxcent-3.0.0.jar file to your
> project as well.
> > > > > > > >
> > > > > > > > James
> > > > > > > >
> > > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com(mailto:
> francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> wrote:
> > > > > > > > > i have still the same error
> > > > > > > > >
> > > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models
> > > > > > > > >
> > > > > > > > > InputStream modelIn = new
> FileInputStream("en-ner-person.bin");
> > > > > > > > >
> > > > > > > > > TokenNameFinderModel model = new
> TokenNameFinderModel(modelIn);
> > > > > > > > >
> > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > >
> > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > return;
> > > > > > > > >
> > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > {
> > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > >
> > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > {
> > > > > > > > > buf.append(split[i]);
> > > > > > > > > if(i != span.getEnd())
> > > > > > > > > buf.append(" ");
> > > > > > > > >
> > > > > > > > > }
> > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > }
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > you can link me to the models maybe i wrong the page i
> suppose is this:
> > > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > > and version this:
> > > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > > >
> > > > > > > > > error:
> > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > java.lang.VerifyError: (class:
> opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> Bad type in putfield/putstatic
> > > > > > > > > at
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > at
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > at
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > at
> opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > at
> opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > francesco.tangari.inf@gmail.com (mailto:
> francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James
> Kosin ha scritto:
> > > > > > > > >
> > > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com(mailto:
> francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> wrote:
> > > > > > > > > > >
> > > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > > >
> > > > > > > > > > > this is the code:
> > > > > > > > > > >
> > > > > > > > > > > InputStream modelIn = new
> FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > > >
> > > > > > > > > > > TokenNameFinderModel model = new
> TokenNameFinderModel(modelIn);
> > > > > > > > > > >
> > > > > > > > > > > modelIn.close();
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > > >
> > > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ^^^ This should be done before the nameFinder.find()
> call or not at all.
> > > > > > > > > > >
> > > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > > return;
> > > > > > > > > > >
> > > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > > {
> > > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > > >
> > > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > > {
> > > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > > buf.append(" ");
> > > > > > > > > > >
> > > > > > > > > > > }
> > > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > this is the error :
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > (class: opennlp/model/GenericModelReader, method:
> checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > > java.lang.VerifyError: (class:
> opennlp/model/GenericModelReader, method: checkModelType signature: ()V)
> Bad type in putfield/putstatic
> > > > > > > > > > > at
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > > at
> opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > > at
> opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > > at
> opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > > at
> LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > What version of OpenNLP are you using and did the
> download of the model
> > > > > > > > > > succeed?
> > > > > > > > > >
> > > > > > > > > > Thanks,
> > > > > > > > > > James
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> >
>
>

Re: open nlp error

Posted by fr...@gmail.com.
something still is wrong ... on this example: "Pierre Vinken , Italy, Milan, 12.23 pm, 61 years old , will join the board as a nonexecutive"  work good on person and location but  dose not recognize date and time  12.23 pm  why ??? what is the format that text should follow ??  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 17.45, francesco.tangari.inf@gmail.com ha scritto:  

> ok i have found the problem it work ;)
>  
> --  
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>  
>  
> Il giorno mercoledì 4 gennaio 2012, alle ore 17.23, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:  
>  
> > becuz with this example : Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .  it recognize just Pierre Vinken as name... and nothing else .. i used all other models and dose not get Nov. 29 as Date (en-ner-date.bin)  why ?
> >  
> > --  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 17.17, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:  
> >  
> > > james i can use en-ner-organization.bin  instead of en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it will recognize organizations instead of persons ?  
> > >  
> > > --  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >  
> > >  
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:  
> > >  
> > > > ok  i fix it  
> > > >  
> > > > --  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha scritto:  
> > > >  
> > > > > I goofed on the if () change for the test. If you look carefully there
> > > > > is a trailing space in your output.... Shoot.
> > > > >  
> > > > > James
> > > > >  
> > > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > work properly thank you very much
> > > > > >  
> > > > > > --  
> > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >  
> > > > > >  
> > > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  
> > > > > >  
> > > > > > > You need to include the maxcent-3.0.0.jar file to your project as well.
> > > > > > >  
> > > > > > > James
> > > > > > >  
> > > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > > > i have still the same error  
> > > > > > > >  
> > > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models  
> > > > > > > >  
> > > > > > > > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> > > > > > > >  
> > > > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > > > >  
> > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > String[] split = input.split(" ");
> > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > >  
> > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > return;
> > > > > > > >  
> > > > > > > > for (Span span : nameSpans)
> > > > > > > > {
> > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > >  
> > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > {
> > > > > > > > buf.append(split[i]);
> > > > > > > > if(i != span.getEnd())
> > > > > > > > buf.append(" ");
> > > > > > > >  
> > > > > > > > }
> > > > > > > > System.out.println(buf.toString());
> > > > > > > > }
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > you can link me to the models maybe i wrong the page i suppose is this:
> > > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > > and version this:
> > > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > > >  
> > > > > > > > error:  
> > > > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > --  
> > > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > > >  
> > > > > > > >  
> > > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> > > > > > > >  
> > > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > > > > >  
> > > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > > >  
> > > > > > > > > > this is the code:
> > > > > > > > > >  
> > > > > > > > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > > >  
> > > > > > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > > > > > >  
> > > > > > > > > > modelIn.close();
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > > >  
> > > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > > > > > > > >  
> > > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > > return;
> > > > > > > > > >  
> > > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > > {
> > > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > > >  
> > > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > > {
> > > > > > > > > > buf.append(split[i]);
> > > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > > > span.getEnd()) instead.
> > > > > > > > > > buf.append(" ");
> > > > > > > > > >  
> > > > > > > > > > }
> > > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > > }
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > this is the error :
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > What version of OpenNLP are you using and did the download of the model
> > > > > > > > > succeed?
> > > > > > > > >  
> > > > > > > > > Thanks,
> > > > > > > > > James
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> >  
>  


Re: open nlp error

Posted by fr...@gmail.com.
ok i have found the problem it work ;)

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 17.23, francesco.tangari.inf@gmail.com ha scritto:  

> becuz with this example : Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .  it recognize just Pierre Vinken as name... and nothing else .. i used all other models and dose not get Nov. 29 as Date (en-ner-date.bin)  why ?
>  
> --  
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>  
>  
> Il giorno mercoledì 4 gennaio 2012, alle ore 17.17, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:  
>  
> > james i can use en-ner-organization.bin  instead of en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it will recognize organizations instead of persons ?  
> >  
> > --  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 02.11, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:  
> >  
> > > ok  i fix it  
> > >  
> > > --  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >  
> > >  
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha scritto:  
> > >  
> > > > I goofed on the if () change for the test. If you look carefully there
> > > > is a trailing space in your output.... Shoot.
> > > >  
> > > > James
> > > >  
> > > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > work properly thank you very much
> > > > >  
> > > > > --  
> > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >  
> > > > >  
> > > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  
> > > > >  
> > > > > > You need to include the maxcent-3.0.0.jar file to your project as well.
> > > > > >  
> > > > > > James
> > > > > >  
> > > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > > i have still the same error  
> > > > > > >  
> > > > > > > Im using open-nlp-tools1.50.jar and 1.5 models  
> > > > > > >  
> > > > > > > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> > > > > > >  
> > > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > > >  
> > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > String[] split = input.split(" ");
> > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > >  
> > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > return;
> > > > > > >  
> > > > > > > for (Span span : nameSpans)
> > > > > > > {
> > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > >  
> > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > {
> > > > > > > buf.append(split[i]);
> > > > > > > if(i != span.getEnd())
> > > > > > > buf.append(" ");
> > > > > > >  
> > > > > > > }
> > > > > > > System.out.println(buf.toString());
> > > > > > > }
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > you can link me to the models maybe i wrong the page i suppose is this:
> > > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > > and version this:
> > > > > > > http://sourceforge.net/projects/opennlp/
> > > > > > >  
> > > > > > > error:  
> > > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > --  
> > > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > > >  
> > > > > > >  
> > > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> > > > > > >  
> > > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > > > >  
> > > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > > >  
> > > > > > > > > this is the code:
> > > > > > > > >  
> > > > > > > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > > >  
> > > > > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > > > > >  
> > > > > > > > > modelIn.close();
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > > String[] split = input.split(" ");
> > > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > > >  
> > > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > > > > > > >  
> > > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > > return;
> > > > > > > > >  
> > > > > > > > > for (Span span : nameSpans)
> > > > > > > > > {
> > > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > > >  
> > > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > > {
> > > > > > > > > buf.append(split[i]);
> > > > > > > > > if(i<span.getEnd()-1)
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > > span.getEnd()) instead.
> > > > > > > > > buf.append(" ");
> > > > > > > > >  
> > > > > > > > > }
> > > > > > > > > System.out.println(buf.toString());
> > > > > > > > > }
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > this is the error :
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > What version of OpenNLP are you using and did the download of the model
> > > > > > > > succeed?
> > > > > > > >  
> > > > > > > > Thanks,
> > > > > > > > James
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > >  
> > >  
> >  
>  


Re: open nlp error

Posted by fr...@gmail.com.
becuz with this example : Pierre Vinken , 61 years old , will join the board as a nonexecutive director Nov. 29 .  it recognize just Pierre Vinken as name... and nothing else .. i used all other models and dose not get Nov. 29 as Date (en-ner-date.bin)  why ?

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 17.17, francesco.tangari.inf@gmail.com ha scritto:  

> james i can use en-ner-organization.bin  instead of en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it will recognize organizations instead of persons ?  
>  
> --  
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>  
>  
> Il giorno mercoledì 4 gennaio 2012, alle ore 02.11, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) ha scritto:  
>  
> > ok  i fix it  
> >  
> > --  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha scritto:  
> >  
> > > I goofed on the if () change for the test. If you look carefully there
> > > is a trailing space in your output.... Shoot.
> > >  
> > > James
> > >  
> > > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > work properly thank you very much
> > > >  
> > > > --  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  
> > > >  
> > > > > You need to include the maxcent-3.0.0.jar file to your project as well.
> > > > >  
> > > > > James
> > > > >  
> > > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > i have still the same error  
> > > > > >  
> > > > > > Im using open-nlp-tools1.50.jar and 1.5 models  
> > > > > >  
> > > > > > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> > > > > >  
> > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > >  
> > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > String[] split = input.split(" ");
> > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > >  
> > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > return;
> > > > > >  
> > > > > > for (Span span : nameSpans)
> > > > > > {
> > > > > > StringBuilder buf = new StringBuilder();
> > > > > >  
> > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > {
> > > > > > buf.append(split[i]);
> > > > > > if(i != span.getEnd())
> > > > > > buf.append(" ");
> > > > > >  
> > > > > > }
> > > > > > System.out.println(buf.toString());
> > > > > > }
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > you can link me to the models maybe i wrong the page i suppose is this:
> > > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > > and version this:
> > > > > > http://sourceforge.net/projects/opennlp/
> > > > > >  
> > > > > > error:  
> > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > --  
> > > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > > >  
> > > > > >  
> > > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> > > > > >  
> > > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > > >  
> > > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > > >  
> > > > > > > > this is the code:
> > > > > > > >  
> > > > > > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > ^^^ Here you are missing an opening quote character
> > > > > > > >  
> > > > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > > > >  
> > > > > > > > modelIn.close();
> > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > ^^^ You don't need to close the input stream. The
> > > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > > String[] split = input.split(" ");
> > > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > > >  
> > > > > > > > nameFinder.clearAdaptiveData();
> > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > > > > > >  
> > > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > > return;
> > > > > > > >  
> > > > > > > > for (Span span : nameSpans)
> > > > > > > > {
> > > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > > >  
> > > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > > {
> > > > > > > > buf.append(split[i]);
> > > > > > > > if(i<span.getEnd()-1)
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > > span.getEnd()) instead.
> > > > > > > > buf.append(" ");
> > > > > > > >  
> > > > > > > > }
> > > > > > > > System.out.println(buf.toString());
> > > > > > > > }
> > > > > > > >  
> > > > > > > >  
> > > > > > > > this is the error :
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > > >  
> > > > > > > >  
> > > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > What version of OpenNLP are you using and did the download of the model
> > > > > > > succeed?
> > > > > > >  
> > > > > > > Thanks,
> > > > > > > James
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > >  
> > > >  
> > >  
> > >  
> > >  
> > >  
> >  
> >  
>  


Re: open nlp error

Posted by fr...@gmail.com.
james i can use en-ner-organization.bin  instead of en-ner-person.bin in my code ? ( the code i pasted on our conversation ) it will recognize organizations instead of persons ?  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 02.11, francesco.tangari.inf@gmail.com ha scritto:  

> ok  i fix it  
>  
> --  
> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>  
>  
> Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha scritto:  
>  
> > I goofed on the if () change for the test. If you look carefully there
> > is a trailing space in your output.... Shoot.
> >  
> > James
> >  
> > On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > work properly thank you very much
> > >  
> > > --  
> > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > >  
> > >  
> > > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  
> > >  
> > > > You need to include the maxcent-3.0.0.jar file to your project as well.
> > > >  
> > > > James
> > > >  
> > > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > i have still the same error  
> > > > >  
> > > > > Im using open-nlp-tools1.50.jar and 1.5 models  
> > > > >  
> > > > > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> > > > >  
> > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > >  
> > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > String[] split = input.split(" ");
> > > > > Span nameSpans[] = nameFinder.find(split);
> > > > >  
> > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > return;
> > > > >  
> > > > > for (Span span : nameSpans)
> > > > > {
> > > > > StringBuilder buf = new StringBuilder();
> > > > >  
> > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > {
> > > > > buf.append(split[i]);
> > > > > if(i != span.getEnd())
> > > > > buf.append(" ");
> > > > >  
> > > > > }
> > > > > System.out.println(buf.toString());
> > > > > }
> > > > >  
> > > > >  
> > > > >  
> > > > > you can link me to the models maybe i wrong the page i suppose is this:
> > > > > http://opennlp.sourceforge.net/models-1.5/
> > > > > and version this:
> > > > > http://sourceforge.net/projects/opennlp/
> > > > >  
> > > > > error:  
> > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > >  
> > > > >  
> > > > >  
> > > > > --  
> > > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com)
> > > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > > >  
> > > > >  
> > > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> > > > >  
> > > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > > >  
> > > > > > > i have errors using openNLp you can tell me why ??
> > > > > > >  
> > > > > > > this is the code:
> > > > > > >  
> > > > > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > ^^^ Here you are missing an opening quote character
> > > > > > >  
> > > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > > >  
> > > > > > > modelIn.close();
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > > > ^^^ You don't need to close the input stream. The
> > > > > > TokenNameFinderModel should be taking care of that.
> > > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > > String[] split = input.split(" ");
> > > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > > >  
> > > > > > > nameFinder.clearAdaptiveData();
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > > > > >  
> > > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > > return;
> > > > > > >  
> > > > > > > for (Span span : nameSpans)
> > > > > > > {
> > > > > > > StringBuilder buf = new StringBuilder();
> > > > > > >  
> > > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > > {
> > > > > > > buf.append(split[i]);
> > > > > > > if(i<span.getEnd()-1)
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > ^^^ This if statement would probably be better with (i !=
> > > > > > span.getEnd()) instead.
> > > > > > > buf.append(" ");
> > > > > > >  
> > > > > > > }
> > > > > > > System.out.println(buf.toString());
> > > > > > > }
> > > > > > >  
> > > > > > >  
> > > > > > > this is the error :
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > > >  
> > > > > > >  
> > > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > What version of OpenNLP are you using and did the download of the model
> > > > > > succeed?
> > > > > >  
> > > > > > Thanks,
> > > > > > James
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > >  
> > >  
> >  
> >  
> >  
> >  
>  
>  


Re: open nlp error

Posted by fr...@gmail.com.
ok  i fix it  

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 02.09, James Kosin ha scritto:  

> I goofed on the if () change for the test. If you look carefully there
> is a trailing space in your output.... Shoot.
>  
> James
>  
> On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > work properly thank you very much
> >  
> > --  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  
> >  
> > > You need to include the maxcent-3.0.0.jar file to your project as well.
> > >  
> > > James
> > >  
> > > On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > i have still the same error  
> > > >  
> > > > Im using open-nlp-tools1.50.jar and 1.5 models  
> > > >  
> > > > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> > > >  
> > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > >  
> > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > String[] split = input.split(" ");
> > > > Span nameSpans[] = nameFinder.find(split);
> > > >  
> > > > if (nameSpans == null || nameSpans.length == 0)
> > > > return;
> > > >  
> > > > for (Span span : nameSpans)
> > > > {
> > > > StringBuilder buf = new StringBuilder();
> > > >  
> > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > {
> > > > buf.append(split[i]);
> > > > if(i != span.getEnd())
> > > > buf.append(" ");
> > > >  
> > > > }
> > > > System.out.println(buf.toString());
> > > > }
> > > >  
> > > >  
> > > >  
> > > > you can link me to the models maybe i wrong the page i suppose is this:
> > > > http://opennlp.sourceforge.net/models-1.5/
> > > > and version this:
> > > > http://sourceforge.net/projects/opennlp/
> > > >  
> > > > error:  
> > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > >  
> > > >  
> > > >  
> > > > --  
> > > > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > > > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> > > >  
> > > >  
> > > > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> > > >  
> > > > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > > > >  
> > > > > > i have errors using openNLp you can tell me why ??
> > > > > >  
> > > > > > this is the code:
> > > > > >  
> > > > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > > ^^^ Here you are missing an opening quote character
> > > > > >  
> > > > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > > > >  
> > > > > > modelIn.close();
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > > ^^^ You don't need to close the input stream. The
> > > > > TokenNameFinderModel should be taking care of that.
> > > > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > > > String[] split = input.split(" ");
> > > > > > Span nameSpans[] = nameFinder.find(split);
> > > > > >  
> > > > > > nameFinder.clearAdaptiveData();
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > > > >  
> > > > > > if (nameSpans == null || nameSpans.length == 0)
> > > > > > return;
> > > > > >  
> > > > > > for (Span span : nameSpans)
> > > > > > {
> > > > > > StringBuilder buf = new StringBuilder();
> > > > > >  
> > > > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > > > {
> > > > > > buf.append(split[i]);
> > > > > > if(i<span.getEnd()-1)
> > > > > >  
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > > ^^^ This if statement would probably be better with (i !=
> > > > > span.getEnd()) instead.
> > > > > > buf.append(" ");
> > > > > >  
> > > > > > }
> > > > > > System.out.println(buf.toString());
> > > > > > }
> > > > > >  
> > > > > >  
> > > > > > this is the error :
> > > > > >  
> > > > > >  
> > > > > >  
> > > > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > > > >  
> > > > > >  
> > > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > > > What version of OpenNLP are you using and did the download of the model
> > > > > succeed?
> > > > >  
> > > > > Thanks,
> > > > > James
> > > > >  
> > > > >  
> > > > >  
> > > > >  
> > > >  
> > > >  
> > > >  
> > > >  
> > >  
> > >  
> > >  
> > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by James Kosin <ja...@gmail.com>.
I goofed on the if () change for the test.  If you look carefully there
is a trailing space in your output....  Shoot.

James

On 1/3/2012 8:04 PM, francesco.tangari.inf@gmail.com wrote:
> work properly thank you very much
>
> --  
> francesco.tangari.inf@gmail.com
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  
>
>> You need to include the maxcent-3.0.0.jar file to your project as well.
>>  
>> James
>>  
>> On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
>>> i have still the same error  
>>>  
>>> Im using open-nlp-tools1.50.jar and 1.5 models  
>>>  
>>> InputStream modelIn = new FileInputStream("en-ner-person.bin");
>>>  
>>> TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
>>>  
>>> NameFinderME nameFinder = new NameFinderME(model);
>>> String[] split = input.split(" ");
>>> Span nameSpans[] = nameFinder.find(split);
>>>  
>>> if (nameSpans == null || nameSpans.length == 0)
>>> return;
>>>  
>>> for (Span span : nameSpans)
>>> {
>>> StringBuilder buf = new StringBuilder();
>>>  
>>> for (int i = span.getStart(); i < span.getEnd(); i++)
>>> {
>>> buf.append(split[i]);
>>> if(i != span.getEnd())
>>> buf.append(" ");
>>>  
>>> }
>>> System.out.println(buf.toString());
>>> }
>>>  
>>>  
>>>  
>>> you can link me to the models maybe i wrong the page i suppose is this:
>>> http://opennlp.sourceforge.net/models-1.5/
>>> and version this:
>>> http://sourceforge.net/projects/opennlp/
>>>  
>>> error:  
>>> (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
>>> java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
>>> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
>>> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
>>> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
>>> at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
>>> at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
>>>  
>>>  
>>>  
>>> --  
>>> francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
>>> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>>>  
>>>  
>>> Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
>>>  
>>>> On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
>>>>>  
>>>>> i have errors using openNLp you can tell me why ??
>>>>>  
>>>>> this is the code:
>>>>>  
>>>>> InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
>>>>>  
>>>>  
>>>>  
>>>> ^^^ Here you are missing an opening quote character
>>>>>  
>>>>> TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
>>>>>  
>>>>> modelIn.close();
>>>>>  
>>>>  
>>>> ^^^ You don't need to close the input stream. The
>>>> TokenNameFinderModel should be taking care of that.
>>>>> NameFinderME nameFinder = new NameFinderME(model);
>>>>> String[] split = input.split(" ");
>>>>> Span nameSpans[] = nameFinder.find(split);
>>>>>  
>>>>> nameFinder.clearAdaptiveData();
>>>>>  
>>>>  
>>>> ^^^ This should be done before the nameFinder.find() call or not at all.
>>>>>  
>>>>> if (nameSpans == null || nameSpans.length == 0)
>>>>> return;
>>>>>  
>>>>> for (Span span : nameSpans)
>>>>> {
>>>>> StringBuilder buf = new StringBuilder();
>>>>>  
>>>>> for (int i = span.getStart(); i < span.getEnd(); i++)
>>>>> {
>>>>> buf.append(split[i]);
>>>>> if(i<span.getEnd()-1)
>>>>>  
>>>>>  
>>>>  
>>>>  
>>>> ^^^ This if statement would probably be better with (i !=
>>>> span.getEnd()) instead.
>>>>> buf.append(" ");
>>>>>  
>>>>> }
>>>>> System.out.println(buf.toString());
>>>>> }
>>>>>  
>>>>>  
>>>>> this is the error :
>>>>>  
>>>>>  
>>>>>  
>>>>> (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
>>>>> java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
>>>>> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
>>>>> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
>>>>> at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
>>>>> at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
>>>>> at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
>>>>> at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
>>>>>  
>>>>>  
>>>>  
>>>>  
>>>> What version of OpenNLP are you using and did the download of the model
>>>> succeed?
>>>>  
>>>> Thanks,
>>>> James
>>>>  
>>>>  
>>>>  
>>>  
>>>  
>>  
>>  
>>  
>
>


Re: open nlp error

Posted by fr...@gmail.com.
work properly thank you very much

--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno mercoledì 4 gennaio 2012, alle ore 01.56, James Kosin ha scritto:  

> You need to include the maxcent-3.0.0.jar file to your project as well.
>  
> James
>  
> On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > i have still the same error  
> >  
> > Im using open-nlp-tools1.50.jar and 1.5 models  
> >  
> > InputStream modelIn = new FileInputStream("en-ner-person.bin");
> >  
> > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> >  
> > NameFinderME nameFinder = new NameFinderME(model);
> > String[] split = input.split(" ");
> > Span nameSpans[] = nameFinder.find(split);
> >  
> > if (nameSpans == null || nameSpans.length == 0)
> > return;
> >  
> > for (Span span : nameSpans)
> > {
> > StringBuilder buf = new StringBuilder();
> >  
> > for (int i = span.getStart(); i < span.getEnd(); i++)
> > {
> > buf.append(split[i]);
> > if(i != span.getEnd())
> > buf.append(" ");
> >  
> > }
> > System.out.println(buf.toString());
> > }
> >  
> >  
> >  
> > you can link me to the models maybe i wrong the page i suppose is this:
> > http://opennlp.sourceforge.net/models-1.5/
> > and version this:
> > http://sourceforge.net/projects/opennlp/
> >  
> > error:  
> > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> >  
> >  
> >  
> > --  
> > francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com)
> > Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
> >  
> >  
> > Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
> >  
> > > On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> > > >  
> > > > i have errors using openNLp you can tell me why ??
> > > >  
> > > > this is the code:
> > > >  
> > > > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
> > > >  
> > >  
> > >  
> > > ^^^ Here you are missing an opening quote character
> > > >  
> > > > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> > > >  
> > > > modelIn.close();
> > > >  
> > >  
> > > ^^^ You don't need to close the input stream. The
> > > TokenNameFinderModel should be taking care of that.
> > > > NameFinderME nameFinder = new NameFinderME(model);
> > > > String[] split = input.split(" ");
> > > > Span nameSpans[] = nameFinder.find(split);
> > > >  
> > > > nameFinder.clearAdaptiveData();
> > > >  
> > >  
> > > ^^^ This should be done before the nameFinder.find() call or not at all.
> > > >  
> > > > if (nameSpans == null || nameSpans.length == 0)
> > > > return;
> > > >  
> > > > for (Span span : nameSpans)
> > > > {
> > > > StringBuilder buf = new StringBuilder();
> > > >  
> > > > for (int i = span.getStart(); i < span.getEnd(); i++)
> > > > {
> > > > buf.append(split[i]);
> > > > if(i<span.getEnd()-1)
> > > >  
> > > >  
> > >  
> > >  
> > > ^^^ This if statement would probably be better with (i !=
> > > span.getEnd()) instead.
> > > > buf.append(" ");
> > > >  
> > > > }
> > > > System.out.println(buf.toString());
> > > > }
> > > >  
> > > >  
> > > > this is the error :
> > > >  
> > > >  
> > > >  
> > > > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > > > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > > > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > > > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > > > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > > > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> > > >  
> > > >  
> > >  
> > >  
> > > What version of OpenNLP are you using and did the download of the model
> > > succeed?
> > >  
> > > Thanks,
> > > James
> > >  
> > >  
> > >  
> >  
> >  
>  
>  
>  



Re: open nlp error

Posted by James Kosin <ja...@gmail.com>.
You need to include the maxcent-3.0.0.jar file to your project as well.

James

On 1/3/2012 7:31 AM, francesco.tangari.inf@gmail.com wrote:
> i have still the same error   
>
> Im using open-nlp-tools1.50.jar and 1.5 models  
>
> InputStream modelIn = new FileInputStream("en-ner-person.bin");
>
>         TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
>
>         NameFinderME nameFinder = new NameFinderME(model);
>         String[] split = input.split(" ");
>         Span nameSpans[] = nameFinder.find(split);
>
>          
>         if (nameSpans == null || nameSpans.length == 0)
>         return;
>
>         for (Span span : nameSpans)
>         {
>         StringBuilder buf = new StringBuilder();
>
>         for (int i = span.getStart(); i < span.getEnd(); i++)
>         {
>             buf.append(split[i]);
>             if(i != span.getEnd())
>                 buf.append(" ");
>
>         }
>             System.out.println(buf.toString());
>         }
>
>
>
> you can link me to the models maybe i wrong the page i suppose is this:
> http://opennlp.sourceforge.net/models-1.5/
> and version this:
> http://sourceforge.net/projects/opennlp/
>
> error:  
> (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
>         at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
>         at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
>         at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
>         at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
>         at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
>
>
>
> --  
> francesco.tangari.inf@gmail.com
> Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)
>
>
> Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  
>
>> On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
>>>  
>>> i have errors using openNLp you can tell me why ??
>>>  
>>> this is the code:
>>>  
>>> InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
>>  
>> ^^^ Here you are missing an opening quote character
>>>  
>>> TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
>>>  
>>> modelIn.close();
>> ^^^ You don't need to close the input stream. The
>> TokenNameFinderModel should be taking care of that.
>>> NameFinderME nameFinder = new NameFinderME(model);
>>> String[] split = input.split(" ");
>>> Span nameSpans[] = nameFinder.find(split);
>>>  
>>> nameFinder.clearAdaptiveData();
>> ^^^ This should be done before the nameFinder.find() call or not at all.
>>>  
>>> if (nameSpans == null || nameSpans.length == 0)
>>> return;
>>>  
>>> for (Span span : nameSpans)
>>> {
>>> StringBuilder buf = new StringBuilder();
>>>  
>>> for (int i = span.getStart(); i < span.getEnd(); i++)
>>> {
>>> buf.append(split[i]);
>>> if(i<span.getEnd()-1)
>>>  
>>  
>> ^^^ This if statement would probably be better with (i !=
>> span.getEnd()) instead.
>>> buf.append(" ");
>>>  
>>> }
>>> System.out.println(buf.toString());
>>> }
>>>  
>>>  
>>> this is the error :
>>>  
>>>  
>>>  
>>> (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
>>> java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
>>> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
>>> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
>>> at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
>>> at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
>>> at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
>>> at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
>>>  
>>  
>> What version of OpenNLP are you using and did the download of the model
>> succeed?
>>  
>> Thanks,
>> James
>>  
>>  
>
>


Re: open nlp error

Posted by fr...@gmail.com.
i have still the same error   

Im using open-nlp-tools1.50.jar and 1.5 models  

InputStream modelIn = new FileInputStream("en-ner-person.bin");

        TokenNameFinderModel model = new TokenNameFinderModel(modelIn);

        NameFinderME nameFinder = new NameFinderME(model);
        String[] split = input.split(" ");
        Span nameSpans[] = nameFinder.find(split);

         
        if (nameSpans == null || nameSpans.length == 0)
        return;

        for (Span span : nameSpans)
        {
        StringBuilder buf = new StringBuilder();

        for (int i = span.getStart(); i < span.getEnd(); i++)
        {
            buf.append(split[i]);
            if(i != span.getEnd())
                buf.append(" ");

        }
            System.out.println(buf.toString());
        }



you can link me to the models maybe i wrong the page i suppose is this:
http://opennlp.sourceforge.net/models-1.5/
and version this:
http://sourceforge.net/projects/opennlp/

error:  
(class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
        at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
        at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
        at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
        at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
        at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)



--  
francesco.tangari.inf@gmail.com
Inviato con Sparrow (http://www.sparrowmailapp.com/?sig)


Il giorno martedì 3 gennaio 2012, alle ore 04.30, James Kosin ha scritto:  

> On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com (mailto:francesco.tangari.inf@gmail.com) wrote:
> >  
> > i have errors using openNLp you can tell me why ??
> >  
> > this is the code:
> >  
> > InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
>  
> ^^^ Here you are missing an opening quote character
> >  
> > TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
> >  
> > modelIn.close();
> ^^^ You don't need to close the input stream. The
> TokenNameFinderModel should be taking care of that.
> > NameFinderME nameFinder = new NameFinderME(model);
> > String[] split = input.split(" ");
> > Span nameSpans[] = nameFinder.find(split);
> >  
> > nameFinder.clearAdaptiveData();
> ^^^ This should be done before the nameFinder.find() call or not at all.
> >  
> > if (nameSpans == null || nameSpans.length == 0)
> > return;
> >  
> > for (Span span : nameSpans)
> > {
> > StringBuilder buf = new StringBuilder();
> >  
> > for (int i = span.getStart(); i < span.getEnd(); i++)
> > {
> > buf.append(split[i]);
> > if(i<span.getEnd()-1)
> >  
>  
> ^^^ This if statement would probably be better with (i !=
> span.getEnd()) instead.
> > buf.append(" ");
> >  
> > }
> > System.out.println(buf.toString());
> > }
> >  
> >  
> > this is the error :
> >  
> >  
> >  
> > (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> > at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> > at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> > at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> > at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> > at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
> >  
>  
> What version of OpenNLP are you using and did the download of the model
> succeed?
>  
> Thanks,
> James
>  
>  



Re: open nlp error

Posted by James Kosin <ja...@gmail.com>.
On 1/2/2012 5:20 PM, francesco.tangari.inf@gmail.com wrote:
>
> i have errors using openNLp you can tell me why ??
>
> this is the code:
>
> InputStream modelIn = new FileInputStream(NLPModel/en-ner-person.bin");
                                                                                       
^^^  Here you are missing an opening quote character
>
> TokenNameFinderModel model = new TokenNameFinderModel(modelIn);
>
> modelIn.close();
    ^^^ You don't need to close the input stream.  The
TokenNameFinderModel should be taking care of that.
> NameFinderME nameFinder = new NameFinderME(model);
> String[] split = input.split(" ");
> Span nameSpans[] = nameFinder.find(split);
>
> nameFinder.clearAdaptiveData();
    ^^^ This should be done before the nameFinder.find() call or not at all.
>
> if (nameSpans == null || nameSpans.length == 0)
> return;
>
> for (Span span : nameSpans)
> {
> StringBuilder buf = new StringBuilder();
>
> for (int i = span.getStart(); i < span.getEnd(); i++)
> {
> buf.append(split[i]);
> if(i<span.getEnd()-1)
    ^^^ This if statement would probably be better with (i !=
span.getEnd()) instead.
> buf.append(" ");
>
> }
> System.out.println(buf.toString());
> }
>
>
> this is the error :
>
>
>
> (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
> at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
> at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
> at opennlp.tools.namefind.TokenNameFinderModel.<init>(TokenNameFinderModel.java:67)
> at LangProcessing.processingWithOpenNLP(LangProcessing.java:237)
> at OpenNLPJUnitTest.testHello(OpenNLPJUnitTest.java:33)
>
>
What version of OpenNLP are you using and did the download of the model
succeed?

Thanks,
James