简体   繁体   English

错误:对象 Stemmer 不是包 org.apache.spark.mllib.feature 的成员

[英]error: object Stemmer is not a member of package org.apache.spark.mllib.feature

Importing the package org.apache.spark.mllib.feature.Stemmer in Spark-shell using Scala returns the following error: :47: error: object Stemmer is not a member of package org.apache.spark.mllib.feature import org.apache.spark.mllib.feature.Stemmer使用 Scala 在 Spark-shell 中导入包 org.apache.spark.mllib.feature.Stemmer 返回以下错误::47: error: object Stemmer is not a member of package org.apache.spark.mllib.feature import org。 apache.spark.mllib.feature.Stemmer

I am trying to use stemming to my words using:我正在尝试使用以下方法对我的话进行词干提取:

val stemmer_product_title = new Stemmer()
  .setInputCol("ngrams")
  .setOutputCol("stemmed")
  .setLanguage("English")

Here ngrams is a 1-gram transformed text.这里 ngrams 是一个 1-gram 转换的文本。 Could anyone help me with this please?有人可以帮我吗? I would be grateful.我将感激不尽。

Add the following dependency to your pom.xml将以下依赖项添加到您的pom.xml

<dependency>
    <groupId>com.github.master</groupId>
    <artifactId>spark-stemming_2.10</artifactId>
    <version>0.2.0</version>
</dependency>

or to your build.sbt或者你的build.sbt

libraryDependencies += "com.github.master" %% "spark-stemming" % "0.2.1"

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么import…RandomForest给出“对象RandomForest不是包org.apache.spark.mllib.tree的成员”? - Why does import …RandomForest give “object RandomForest is not a member of package org.apache.spark.mllib.tree”? 在 Intellij 中运行 Spark 时出错:“object apache is not a member of package org” - Error in running Spark in Intellij : "object apache is not a member of package org" 错误:对象DataFrame不是包org.apache.spark.sql的成员 - error: object DataFrame is not a member of package org.apache.spark.sql Maven 构建错误(Scala + Spark):object apache 不是 ZEFE90A8E604A7C8DBB7D88 的成员 - Maven build ERROR (Scala + Spark):object apache is not a member of package org sbt 错误:object spark 不是 package org.ZB6EFD606D118D0F62066E31ZCC19 的成员 - sbt error: object spark is not a member of package org.apache 对象StreamingContext不是包org.apache.spark的成员[错误]导入org.apache.spark.StreamingContext - object StreamingContext is not a member of package org.apache.spark [error] import org.apache.spark.StreamingContext (Spark)对象{name}不是包org.apache.spark.ml的成员 - (Spark) object {name} is not a member of package org.apache.spark.ml XGBoost4J-Spark 错误 - 对象 dmlc 不是包 org.apache.spark.ml 的成员 - XGBoost4J-Spark Error - object dmlc is not a member of package org.apache.spark.ml Spark-shell错误对象映射不是包org.apache.spark.streaming.rdd的成员 - Spark-shell Error object map is not a member of package org.apache.spark.streaming.rdd 错误:对象StreamingContext不是包的成员org.apache.spark.streaming import org.apache.spark.streaming.StreamingContext - error: object StreamingContext is not a member of package org.apache.spark.streaming import org.apache.spark.streaming.StreamingContext
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM