【问题标题】:How to train Stanford CoreNLP for other language sentiments?如何针对其他语言情绪训练斯坦福 CoreNLP?
【发布时间】:2014-04-16 01:56:15
【问题描述】:

我正在使用 CoreNLP 来计算给定文本的情绪。我已经成功地为英语执行了它。我需要对印地语等其他语言做同样的事情。请问我可以知道如何训练系统并将其用于其他语言吗?以下是英文代码:

Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, parse, sentiment");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
String text = "I love the display of iPhone but hate its battery life";
Annotation annotation = pipeline.process(text);
for (CoreMap sentence : annotation.get(CoreAnnotations.SentencesAnnotation.class)) {
   Tree tree = sentence.get(SentimentCoreAnnotations.AnnotatedTree.class);
   int sentiment = RNNCoreAnnotations.getPredictedClass(tree);
   System.out.println(sentiment);
}                

【问题讨论】:

  • 需要一个 PTB 格式的数据集来训练系统。我可以看到,从命令行训练可以使用:$ java -cp "*" edu.sta nford.nlp.sentiment.SentimentTraining -numHid 25 -trainPath train.txt devPath dev.txt -train -model model.ser。 gz 但是,如何将其用于其他语言?
  • 获得 PTB 文件后,我想知道是否有参数可以指示系统正在使用印地语进行训练,并且作为输入给出的文本是印地语,因此,使用印地语执行情绪分析.

标签: java stanford-nlp sentiment-analysis


【解决方案1】:

斯坦福 NLP RNTN 培训信息由mbatchkarov 提供。

一般而言,非英语情感分析仍在进行中,许多方法(尤其是那些超越词袋的方法)可能需要重新考虑,以便适用于另一种语言。例如,土耳其语或德语等凝聚性语言(即将大量单词压缩成一个大词的语言)甚至在许多文本挖掘和情感分析任务上都表现不佳。

尝试使用谷歌搜索印地语的情绪分析。我发现的一篇有趣的论文是Mittal, et al 的这篇论文。

【讨论】:

  • 感谢您的回复和指点。我会看一遍论文。
猜你喜欢
  • 1970-01-01
  • 2017-11-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多