Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/8436#discussion_r38146311
--- Diff: docs/ml-features.md ---
@@ -306,16 +306,88 @@ regexTokenizer = RegexTokenizer(inputCol="sentence",
outputCol="words", pattern=
</div>
</div>
+## StopWordsRemover
+[Stop words](https://en.wikipedia.org/wiki/Stop_words) are words which
+should be excluded from the input, typically because the words appear
+frequently and don't carry as much meaning.
+
+`StopWordsRemover` takes as input a sequence of strings (e.g. the output
+of a [Tokenizer](ml-features.html#tokenizer)) and drops all the stop
+words from the input sequences. The list of stopwords is specified by
+the `stopWords` parameter. We provide a list of stop words created by
+the [Glasgow Information Retrieval
+Group](http://ir.dcs.gla.ac.uk/resources/linguistic_utils/stop_words) in
+`StopWords.EnglishStopWords`, which is used by default.
+
+<div class="codetabs">
+
+<div data-lang="scala" markdown="1">
+
+[`StopWordsRemover`](api/scala/index.html#org.apache.spark.ml.feature.StopWordsRemover)
+takes an input column name, an output column name, a list of stop words,
+and a boolean indicating if the matches should be case sensitive (false
+by default).
+
+{% highlight scala %}
+import org.apache.spark.ml.feature.StopWordsRemover
+
+val remover = new StopWordsRemover()
+ .setInputCol("raw")
+ .setOutputCol("filtered")
+val dataSet = sqlContext.createDataFrame(Seq(
+ (Seq("I", "saw", "the", "red", "baloon")),
+ (Seq("Mary", "had", "a", "little", "lamb"))
+).map(Tuple1.apply)).toDF("raw")
+
+remover.transform(dataSet).show()
--- End diff --
It is useful to show the result, as in the user guide of `StringIndexer`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]