stanford-nlp - 如何使用StanfordCoreNLP实现中文Penn Treebank(s-expression)到CONLL格式的转换?
问题描述
我有 Penn Treebank (s-expression) 格式的中国选区树库,我想获取 conll 格式的数据。我知道 StanfordCoreNLP 可以使用这个命令转换英文数据
java -mx1g edu.stanford.nlp.trees.ud.UniversalDependenciesConverter -treeFile treebank > treebank.conllu
而且我也知道 StanfordCoreNLP 支持使用命令选择中文语言模型
java -mx3g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -props StanfordCoreNLP-chinese.properties -file chinese.txt -outputFormat text
当我使用命令时
java -mx3g -cp "*" edu.stanford.nlp.trees.ud.UniversalDependenciesConverter -props StanfordCoreNLP-chinese.properties -treeFile chtb_0001.nw > chtb_0001_nw.conllu
没有任何变化,在这种情况下,StanfordCoreNLP 工具仍然选择英文模型而不是中文模型。我无法从 StanfordCoreNLP 的主页获得更多详细信息。所以我想从 StackoverFlow 获得帮助。
解决方案
我认为这会起作用:
java -Xmx1g edu.stanford.nlp.trees.international.pennchinese.UniversalChineseGrammaticalStructure -treeFile ctb_example.txt -checkConnected -basic -keepPunct -conllx
推荐阅读
- swift - Swift 中 MSAL 和 AD B2C 的登录问题
- java - 可以克隆 WebDriver 实例以便在测试用例中同时执行一些步骤
- google-sheets - 多个子句不起作用 - NOT 以
- django - django 模板标签作为另一个模板标签的参数传递
- ajax - Laravel Ajax 无法在 url 中传递参数,但可以使用常量
- php - Docker-compose 卷更改更新缓慢(如何修复)
- c# - Android Emulator 无法在 Visual Studio 2017 中启动
- python - 在渲染模板中绘制类属性
- c# - HttpResponse 的内容长度与纯文本不匹配
- excel - 如何修复 VBA 代码中的“需要对象”错误?