美文网首页
stanford parser生成依存树使用记录

stanford parser生成依存树使用记录

作者: best___me | 来源:发表于2017-10-01 15:11 被阅读0次

下载了parser包,https://nlp.stanford.edu/software/lex-parser.shtml#Download

我下载的是stanford-parser-full-2016-10-31

解压之后运行下面的命令,即可生成依存树

java -mx1g -cp stanford-parser.jar edu.stanford.nlp.parser.lexparser.LexicalizedParser -maxLength 100 -retainTmpSubcategories -outputFormat "typedDependencies" -sentences newline  ./edu/stanford/nlp/models/lexparser/englishFactored.ser.gz  test.txt > output.txt

-cp stanford-parser.jar是为了使用jar中的LexicalizedParser类

-outputFormat "typedDependencies" 输出如下格式

-sentences newline 是为了按行处理文件

englishFactored.ser.gz刚开始运行该命令一直找不到这个文件,就把stanford-parser-3.7.0-models.jar解压之后 写上该文件的路径即可

相关文章

网友评论

      本文标题:stanford parser生成依存树使用记录

      本文链接:https://www.haomeiwen.com/subject/frcaextx.html