如何在运行SPADE时解决错误

时间:2015-04-21 09:34:19

标签: perl parsing nlp charniak-parser

我运行SPADE包,并根据文档引用了Charniak Parser,并为spade.pl变量编辑了$CHP,但它不起作用。它仍然抛出如下异常

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.

例外情况是找不到parseIt。当我查看Charniak Parser时,它有五个文件夹:CVSecstuffDATATRAINPARSE。我没有看到parseIt。但是我在pareIt.c文件夹中找到了PARSE,所以我编辑了路径CharniakParser / PARSE / parseIt,但它仍然有错误。

2 个答案:

答案 0 :(得分:1)

您链接的说明

  

在bin /目录中编辑spade.pl;将$ CHP变量的值设置为Charniak的解析器

的目录路径

因此,如果SPADE无法找到parseIt,那么您已将$CHP设置为错误的路径。

如果没有parseIt二进制文件但你有parseIt.c那么我猜你必须构建它。查看 Charniak Parser

的文档

答案 1 :(得分:0)

以下是获取最新版本的Charniak解析器并构建它的具体步骤:

  1. 创建一个您将安装解析器的目录:(其中/path/to是您希望将解析器放入的目录 - 也许/home/Khaing在您的目录中情况下)

    shell% mkdir /path/to/bllip-parser
    shell% cd /path/to/bllip-parser/
    
  2. 下载并解压缩最新版本的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. 构建解析器:

    shell% make PARSE
    
  4. 确认parseIt已正确构建:

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

    如果您运行first-stage/PARSE/parseIt,您应该会看到其帮助菜单。

  5. 此时,您可以将$CHP设置为指向您在步骤1中创建的bllip-parser目录:将$CHP中的spade.pl更改为{{1} }}

相关问题