spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject spark git commit: [SPARK-18374][ML] Incorrect words in StopWords/english.txt
Date Tue, 06 Dec 2016 21:12:29 GMT
Repository: spark
Updated Branches:
  refs/heads/master 1ef6b296d -> fac5b75b7

[SPARK-18374][ML] Incorrect words in StopWords/english.txt

## What changes were proposed in this pull request?

Currently English stop words list in MLlib contains only the argumented words after removing
all the apostrophes, so "wouldn't" become "wouldn" and "t". Yet by default Tokenizer and RegexTokenizer
don't split on apostrophes or quotes.

Adding original form to stop words list to match the behavior of Tokenizer and StopwordsRemover.
Also remove "won" from list.

see more discussion in the jira:

## How was this patch tested?
existing ut

Author: Yuhao <>
Author: Yuhao Yang <>

Closes #16103 from hhbyyh/addstopwords.


Branch: refs/heads/master
Commit: fac5b75b74b2d76b6314c69be3c769f1f321688c
Parents: 1ef6b29
Author: Yuhao <>
Authored: Wed Dec 7 05:12:24 2016 +0800
Committer: Sean Owen <>
Committed: Wed Dec 7 05:12:24 2016 +0800

 .../spark/ml/feature/stopwords/english.txt      | 80 +++++++++++++-------
 .../ml/feature/StopWordsRemoverSuite.scala      |  2 +-
 2 files changed, 55 insertions(+), 27 deletions(-)
diff --git a/mllib/src/main/resources/org/apache/spark/ml/feature/stopwords/english.txt b/mllib/src/main/resources/org/apache/spark/ml/feature/stopwords/english.txt
index d075cc0..d6094d7 100644
--- a/mllib/src/main/resources/org/apache/spark/ml/feature/stopwords/english.txt
+++ b/mllib/src/main/resources/org/apache/spark/ml/feature/stopwords/english.txt
@@ -125,29 +125,57 @@ just
\ No newline at end of file
diff --git a/mllib/src/test/scala/org/apache/spark/ml/feature/StopWordsRemoverSuite.scala
index 957cf58..5262b14 100755
--- a/mllib/src/test/scala/org/apache/spark/ml/feature/StopWordsRemoverSuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/ml/feature/StopWordsRemoverSuite.scala
@@ -45,7 +45,7 @@ class StopWordsRemoverSuite
     val dataSet = Seq(
       (Seq("test", "test"), Seq("test", "test")),
-      (Seq("a", "b", "c", "d"), Seq("b", "c")),
+      (Seq("a", "b", "c", "d"), Seq("b", "c", "d")),
       (Seq("a", "the", "an"), Seq()),
       (Seq("A", "The", "AN"), Seq()),
       (Seq(null), Seq(null)),

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message