【问题标题】:Change pos tag separator in Stanford NLP Maxent Tagger using C#使用 C# 在斯坦福 NLP Maxent Tagger 中更改 pos 标签分隔符
【发布时间】:2018-09-24 15:15:22
【问题描述】:

按照本页https://sergey-tihon.github.io/Stanford.NLP.NET/StanfordPOSTagger.html 上的说明,我已将斯坦福 POS 标记与 C# 一起使用。

结果是:

A/DT Part-Of-Speech/NNP Tagger/NNP -LRB-/-LRB- POS/NNP Tagger/ (…etc…)

我想将标签分隔符从斜杠字符 (/) 更改为下划线 (_)。

我查看了属性文件

wsj-0-18-bidirectional-dissim.tagger.props

而且它已经有了这一行:tagSeparator = _

根据本页答案edit config file in stanford pos tagger 以及此页面上的示例https://sergey-tihon.github.io/Stanford.NLP.NET/StanfordCoreNLP.html 看来我应该能够通过添加以下代码来更改标记器的属性:

var props = new Properties();
props.setProperty("tagSeparator", "_");

但是这种方法不起作用,因为第一行无法编译,给出语法错误:

'Properties' 是一个命名空间,但用作类型

我还没有找到将分隔符更改为下划线的方法。

感谢所有帮助。

【问题讨论】:

    标签: c# stanford-nlp pos-tagger


    【解决方案1】:

    尝试重写

    var props = new Properties();
    

    作为

    var props = new java.util.Properties();
    

    它应该可以工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多