本文介绍了使用CoreNLP的法语依赖项解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在遵循链接中的示例.我已经从此处.当我这样称呼时,

I am following the example in this link. I have downloaded the french jar from here. When I call it as follows,

java -mx1g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -props StanfordCoreNLP-french.properties -annotators tokenize,ssplit,pos,depparse -file french.txt -outputFormat conllu

java -mx1g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -props StanfordCoreNLP-french.properties -annotators tokenize,ssplit,pos,depparse -file french.txt -outputFormat conllu

我总是看到它加载了英语dep-parser模型而不是法语.

I always see it loads a english dep-parser model instead of french.

Loading depparse model file: edu/stanford/nlp/models/parser/nndep/english_UD.gz ...PreComputed 100000, Elapsed Time: 1.341 (s)

Loading depparse model file: edu/stanford/nlp/models/parser/nndep/english_UD.gz ...PreComputed 100000, Elapsed Time: 1.341 (s)

这是一个错误吗?

推荐答案

更新-我发现默认属性文件未指定depparse模型.所以现在我给它自己的配置文件,现在它可以工作了.

Update -- I found that the default properties file does not specify a depparse model. So now I give it my own config file and now it works.

annotators = tokenize, ssplit, pos, depparse, parse

tokenize.language = fr

pos.model = edu/stanford/nlp/models/pos-tagger/french/french.tagger

parse.model = edu/stanford/nlp/models/lexparser/frenchFactored.ser.gz

depparse.model = edu/stanford/nlp/models/parser/nndep/UD_French.gz

这篇关于使用CoreNLP的法语依赖项解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!