hllorens / otip

9 stars 6 forks source link

NullPointerException on running the code #1

Closed koustuvsinha closed 7 years ago

koustuvsinha commented 8 years ago

Hi! I tried to run the code and followed all steps for simple English tagging. I also downloaded the models in program-data/SVM and program-data/CRF++ folders. Yet I am getting this error :

java -jar "tipsem-1.0.0.jar" -t "I saw you yesterday" 
TIPSem text: I saw you yesterday

Doing action: ANNOTATECRF
------------
Info: Language not set, using default: en

File: /home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.45.06.911 Language:en
Errors found (TempEval):
    java.lang.NullPointerException (Reading line 0 /home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.45.06.911_TIPSemB_features/tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append-merged-ids)

Errors found (TempEval):
    java.lang.NullPointerException (Reading line 0)

null

Errors found (OptionHandler):
    java.lang.NullPointerException

Done in 0.00 sec!

Result:

Errors found:
    tmp2016.10.08-11.45.06.911.tml (No such file or directory)

I checked the files generated by the program and found that the file tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append-merged-ids is present by without any content. Anything I missed to install maybe because of this file not being generated?

koustuvsinha commented 8 years ago

these are the files generated :

dct.tab
tmp2016.10.08-11.45.06.911
tmp2016.10.08-11.45.06.911.e-dct-link-features
tmp2016.10.08-11.45.06.911.e-dct-link-features-annotatedWith-CRFmodel-TIPSemB_categ_e-dct_EN
tmp2016.10.08-11.45.06.911.e-main-link-features
tmp2016.10.08-11.45.06.911.e-main-link-features-annotatedWith-CRFmodel-TIPSemB_categ_e-main_EN
tmp2016.10.08-11.45.06.911.e-sub-link-features
tmp2016.10.08-11.45.06.911.e-sub-link-features-annotatedWith-CRFmodel-TIPSemB_categ_e-sub_EN
tmp2016.10.08-11.45.06.911.e-t-link-features
tmp2016.10.08-11.45.06.911.e-t-link-features-annotatedWith-CRFmodel-TIPSemB_categ_e-t_EN
tmp2016.10.08-11.45.06.911.TempEval2-features
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN-IOB2checked
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN-IOB2checked.TempEval2-features-annotatedWith-attribs
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN-IOB2checked.TempEval-classik-features
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN-IOB2checked.TempEval-classik-features-annotatedWith-CRFmodel-TIPSemB_class_event_EN
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append-merged
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append-merged-ids
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval-classik-features
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval-classik-features-annotatedWith-CRFmodel-TIPSemB_class_timex_EN
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval-normalization
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval-normalization-annotatedWith-CRFmodel-TIPSemB_timen_timex_EN
tmp2016.10.08-11.45.06.911.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval-normalization-annotatedWith-CRFmodel-TIPSemB_timen_timex_EN-normalized_values
tmp2016.10.08-11.45.06.911.treetag
tmp2016.10.08-11.45.06.911.treetag-POS2
koustuvsinha commented 8 years ago

Debug flag output :

TIPSem text: I saw you yesterday

Doing action: ANNOTATECRF
------------
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368
Info: Language not set, using default: en

File: /home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368 Language:en
Executing TREETAG
Usig Treetagger at: /home/koustuv/Downloads/TreeTagger/
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.treetag
Executing lemmaPOS2TempEval2_features
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.treetag-POS2
Recognizing TIMEX3sEXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN
Cheking IOB2...
Classifying TIMEX3sEXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked
Normalizing TIMEX3s (DCT=2016-10-08)EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval-classik-features-annotatedWith-CRFmodel-TIPSemB_class_timex_EN
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval-normalization-annotatedWith-CRFmodel-TIPSemB_timen_timex_EN
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs
Recognizing EVENTsEXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN
Cheking IOB2...
Classifying EVENTsEXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN-IOB2checked
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN-IOB2checked
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_event_EN-IOB2checked.TempEval2-features-annotatedWith-attribs
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append-merged
EXISTS? file:///home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append-merged-ids
Recognizing TLINKs
Errors found (TempEval):
    java.lang.NullPointerException (Reading line 0 /home/koustuv/Downloads/TIPSem/target/tmp2016.10.08-11.59.05.368_TIPSemB_features/tmp2016.10.08-11.59.05.368.TempEval2-features-annotatedWith-CRFmodel-TIPSemB_rec_timex_EN-IOB2checked.TempEval2-features-annotatedWith-attribs.TempEval2-features-annotatedWith-attribs-append-merged-ids)

java.lang.NullPointerException
    at com.cognitionis.tipsem.ElementFiller.simpleProcessSentence(ElementFiller.java:410)
    at com.cognitionis.tipsem.ElementFiller.get_elements(ElementFiller.java:290)
    at com.cognitionis.tipsem.TIP.annotateCRF(TIP.java:578)
    at com.cognitionis.tipsem.OptionHandler.doAction(OptionHandler.java:289)
    at com.cognitionis.tipsem.Main.main(Main.java:99)
hllorens commented 8 years ago

Hi Koustuv,

It seems that some of the pre-requisits is failing (maybe TreeTagger). Can you make sure you used the version in www.cognitionis.com/TreeTagger.tar.gz and that you made all the files executable?

From the readme: Treetagger (the new version does not work, use www.cognitionis.com/TreeTagger.tar.gz, that is a copy, the original treetagger license aplies) Test it: echo "I went to cinema yesterday." | path-to-otip/program-data/TreeTagger/tree-tagger-english NOTE: Put TreeTagger inside program-data (default location). Otherwse set TreeTagger in any path and tune program-data/config.properties file. By default renamed to example.config.properties

If that does not fix the issue, can you attach the content of the generated files?

koustuvsinha commented 8 years ago

Used your version of Treetagger. Output of echo "I went to cinema yesterday." | path-to-otip/program-data/TreeTagger/tree-tagger-english :

    reading parameters ...
    tagging ...
     finished.
I   PP  I
went    VBD go
to  TO  to
cinema  NN  cinema
yesterday   NN  yesterday
.   SENT    .

Files generated :

generated.zip

hllorens commented 8 years ago

Does TIPSem work for a different sentence? What is your exact path to TreeTagger? are all the files executable? Where have you stored the crf models models? Is crf++ properly installed and working? version?

In your attached files all the files are empty (0 bytes) and that is a typical error of a badly configured pre-requisite like TreeTagger or crf++.

hllorens commented 7 years ago

Solved using correct pre-requisites.

pathaine commented 7 years ago

I had the same error. What solved it for me was to do: chmod a+wrx -R otip/

Of course, that's not recommended if you want any of the files in that folder to be private.

thak123 commented 4 years ago

`java -jar "tipsem-1.0.0.jar" -t "He was ploughing the fields" -l en TIPSem text: He was ploughing the fields

Doing action: ANNOTATECRF

File: /media/gaurish/angela/projects/otip/target/tmp2020.06.30-11.20.28.504 Language:en Error:/media/gaurish/angela/projects/otip/target /media/gaurish/angela/projects/otip/target/tmp2020.06.30-11.20.28.504_TIPSemB_features/tmp2020.06.30-11.20.28.504.tml Done in 0.00 sec!

Result:

<?xml version="1.0" ?>

tmp2020.06.30-11.20.28.504 2020-06-30 He was ploughing the fields

`

I am running the script but the output seems to capture time expressions only and not events. I compiled using latest gcc as the older gcc is not available. Can anyone help? I have moved all the models from the linked treetagger models folder into the required destinations.

hllorens commented 4 years ago

Hi,

That is strange can you try with some more sentences and put the result here? (e.g., the example sentences in the README)

By default it should annotate timex and events.