【问题标题】:stanford corenlp Sentiment Analysis in Scala ErrorScala 错误中的 stanford corenlp 情绪分析
【发布时间】:2017-07-07 10:46:48
【问题描述】:

当我尝试在 Spark Scala 上运行以下情绪分析代码时,我收到以下错误:

import org.apache.spark.sql.functions._
import com.databricks.spark.corenlp.functions._
import sqlContext.implicits._
val input = Seq((1, "<xml>Stanford University is located in California. 
It is a great university.</xml>")).toDF("id", "text")
val output=input.select(cleanxml('text).as('doc))
.select(explode(ssplit('doc)).as('sen)).select('sen, 
tokenize('sen).as('words), ner('sen).as('nerTags), 
sentiment('sen).as('sentiment))
output.show(truncate = false)
Error :
The val output is throwing the below error:
java.lang.NoSuchMethodError: 
scala.reflect.api.JavaUniverse.runtimeMirror(Ljava/lang/ClassLoader;)
Lscala/reflect/api/JavaMirrors$JavaMirror;
at com.databricks.spark.corenlp.functions$.cleanxml(functions.scala:54)
... 54 elided

【问题讨论】:

    标签: scala stanford-nlp


    【解决方案1】:

    似乎其他人遇到了这个问题并修复了它。

    请参阅此处:https://github.com/databricks/spark-corenlp/issues/25 并尝试按照说明操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-24
      • 2015-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-11
      • 1970-01-01
      相关资源
      最近更新 更多