0

我无法在 stanford-spanish-corenlp-2018-10-05-models.jar 附带的西班牙语版本中设置 SUTime

在斯坦福的文件中,它说选项ner.applyNumericClassifiers = truener.useSUTime = true仅对英文版本有效,但西班牙 jar 附带一个spanish.sutime.txt,我希望它能够工作。

我试过这段代码:

Properties props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, lemma, ner");

props.setProperty("tokenize.language", "es");
...         
...
props.setProperties("sutime.rules", "edu/stanford/nlp/models/sutime/spanish.sutime.txt");

我真的不知道如何继续前进,我还没有在任何其他问题中看到这个问题,也许有人可以帮助我。

4

1 回答 1

0

西班牙语将默认运行 SUTime 3.9.2。您可以只使用这些属性:

ner.model = edu/stanford/nlp/models/ner/spanish.ancora.distsim.s512.crf.ser.gz
ner.applyNumericClassifiers = true
ner.useSUTime = true
ner.language = es

您可以通过以下方式获取默认的西班牙语属性:

Properties props = LanguageInfo.getLanguageProperties("spanish");
于 2020-04-13T22:00:02.687 回答