简体   繁体   中英

How to solve the errors when I run SPADE

I run the SPADE package and I referenced the Charniak Parser according to the documentation and edited spade.pl for the $CHP variable, but it did not work. It still throws an exception as follows

sh: 1: /home/khaing/Downloads/CharniakParser/parseIt: not found
system /home/khaing/Downloads/CharniakParser/parseIt -LEn /home/khaing/Downloads/CharniakParser/DATA/ /home/khaing/Documents/test.txt > /home/khaing/Documents/test.txt.chp failed: 32512 at /home/khaing/Downloads/SPADE/bin/spade.pl line 38.

The exception is that parseIt is not found. When I review the Charniak Parser, it has five folders: CVS , ecstuff , DATA , TRAIN and PARSE . I did not see parseIt . But I found pareIt.c in PARSE folder so I edited the path CharniakParser/PARSE/parseIt but it still has errors.

The instructions that you link to say

Edit spade.pl in the bin/ directory; set the value for the $CHP variable to the directory path for Charniak's parser

So if SPADE cannot find parseIt then you have set $CHP to the wrong path.

If there is no parseIt binary but you have parseIt.c then I would guess that you have to build it. Check the documentation for the Charniak Parser

Here are concrete steps to obtain the latest version of the Charniak parser and build it:

  1. Make a directory where you'll install the parser: (where /path/to is the directory you'd like to put the parser in -- maybe /home/Khaing in your case)

     shell% mkdir /path/to/bllip-parser shell% cd /path/to/bllip-parser/ 
  2. Download and extract the latest version of the Charniak Parser:

     shell% wget https://github.com/BLLIP/bllip-parser/archive/master.zip shell% unzip master.zip shell% mv bllip-parser-master/* bllip-parser-master/.* . shell% rmdir bllip-parser-master 
  3. Build the parser:

     shell% make PARSE 
  4. Confirm that parseIt was built correctly:

     shell% ls first-stage/PARSE/parseIt first-stage/PARSE/parseIt 

    If you run first-stage/PARSE/parseIt you should see its help menu.

  5. At this point, you can set $CHP to point inside the bllip-parser directory you made in step 1: Change $CHP in spade.pl to /path/to/bllip-parser/first-stage/PARSE/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM