stanford parser使用参数

来源:互联网 发布:yum 安装mysql 5.6 编辑:程序博客网 时间:2024/05/18 01:45

上次使用stanford parser解析conll shared task中英文句子的时候,就遇到了句子被其中的分隔符“.”分成两句的情况,上次没有解决。现在回头做实验,才查到可以指定参数,告诉parser按照每一行来切分句子。

官网的FAQ上原句是If you want to give the parser one sentence per line, include the option -sentences newline in your invocation of LexicalizedParser。

    修改lexparser.sh中,添加-sentence newline参数,便可以避免一行的句子被拆分,如 What is the full form of .com ?

    如果要保留句子原有的分词,添加-tokenized参数,这样.com就不会被分为两个词了

在使用stanforde pos tagger的时候,也有这样的情况,参数是-sentenceDelimiter newline 。

    小mark一下!

原创粉丝点击