上次使用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一下!
本文介绍了如何通过调整Stanford Parser的参数来正确处理特殊格式的输入文本,避免因分隔符导致的句子误分割问题,并提供了保留原有分词的方法。
3309

被折叠的 条评论
为什么被折叠?



