You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@predictionio.apache.org by do...@apache.org on 2017/05/04 18:25:23 UTC

[1/9] incubator-predictionio-template-text-classifier git commit: Changed tokenizer to use Apache Luce StandardAnalyzer for non-western languages

Repository: incubator-predictionio-template-text-classifier
Updated Branches:
  refs/heads/master 7bff41178 -> b24325a39


Changed tokenizer to use Apache Luce StandardAnalyzer for non-western languages


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/2bcbdae6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/2bcbdae6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/2bcbdae6

Branch: refs/heads/master
Commit: 2bcbdae63326873d996da9b4e1aa9afd952ecd67
Parents: 3d609f8
Author: Sebastiaan de Man <se...@gmail.com>
Authored: Sun Oct 30 21:31:48 2016 +0100
Committer: Sebastiaan de Man <se...@gmail.com>
Committed: Sun Oct 30 21:31:48 2016 +0100

----------------------------------------------------------------------
 src/main/scala/Preparator.scala | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/2bcbdae6/src/main/scala/Preparator.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Preparator.scala b/src/main/scala/Preparator.scala
index c990944..fd043d6 100644
--- a/src/main/scala/Preparator.scala
+++ b/src/main/scala/Preparator.scala
@@ -11,6 +11,14 @@ import org.apache.spark.mllib.linalg.Vectors
 import org.apache.spark.mllib.regression.LabeledPoint
 import org.apache.spark.rdd.RDD
 
+import org.apache.lucene.analysis.standard.StandardAnalyzer
+import org.apache.lucene.analysis.tokenattributes.CharTermAttribute
+import org.apache.lucene.util.Version
+
+import java.io.StringReader
+
+import scala.collection.mutable
+
 /** Define Preparator parameters. Recall that for our data
   * representation we are only required to input the n-gram window
   * components.
@@ -62,9 +70,28 @@ class TFHasher(
 
   private val hasher = new HashingTF(numFeatures = numFeatures)
 
+/** Use Lucene StandardAnalyzer to tokenize text **/
+ def tokenize(content: String): Seq[String] = {
+    val tReader = new StringReader(content)
+    val analyzer = new StandardAnalyzer(Version.LATEST)
+    val tStream = analyzer.tokenStream("contents", tReader)
+    val term = tStream.addAttribute(classOf[CharTermAttribute])
+    tStream.reset()
+
+    val result = mutable.ArrayBuffer.empty[String]
+    while (tStream.incrementToken()) {
+      val termValue = term.toString
+      
+        result += term.toString
+      
+    }
+    result
+}
+
+
   /** Hashing function: Text -> term frequency vector. */
   def hashTF(text: String): Vector = {
-    val newList : Array[String] = text.split(" ")
+    val newList : Array[String] = tokenize(text)
     .sliding(nGram)
     .map(_.mkString)
     .toArray


[2/9] incubator-predictionio-template-text-classifier git commit: Filter out stop words from vectorization

Posted by do...@apache.org.
Filter out stop words from vectorization

As per the discussion described in :
https://github.com/apache/incubator-predictionio-template-text-classifier/pull/8 . We implement a
filter for stop words and they are added to the constructor of TFHasher during vectorization of
words.


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/1a316143
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/1a316143
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/1a316143

Branch: refs/heads/master
Commit: 1a316143f169bc7804604d0914b380381dfb9fa1
Parents: 7bff411
Author: Natu Lauchande <nl...@gmail.com>
Authored: Mon Dec 5 17:36:04 2016 +0200
Committer: Natu Lauchande <nl...@gmail.com>
Committed: Tue Dec 6 04:04:47 2016 +0200

----------------------------------------------------------------------
 src/main/scala/Preparator.scala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/1a316143/src/main/scala/Preparator.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Preparator.scala b/src/main/scala/Preparator.scala
index c8b35d0..1681acc 100644
--- a/src/main/scala/Preparator.scala
+++ b/src/main/scala/Preparator.scala
@@ -26,7 +26,7 @@ class Preparator(pp: PreparatorParams)
 
   def prepare(sc: SparkContext, td: TrainingData): PreparedData = {
 
-    val tfHasher = new TFHasher(pp.numFeatures, pp.nGram)
+    val tfHasher = new TFHasher(pp.numFeatures, pp.nGram, td.stopWords)
 
     // Convert trainingdata's observation text into TF vector
     // and then fit a IDF model
@@ -57,7 +57,8 @@ class Preparator(pp: PreparatorParams)
 
 class TFHasher(
   val numFeatures: Int,
-  val nGram: Int
+  val nGram: Int,
+  val stopWords:Set[String]
 ) extends Serializable {
 
   private val hasher = new HashingTF(numFeatures = numFeatures)
@@ -65,6 +66,7 @@ class TFHasher(
   /** Hashing function: Text -> term frequency vector. */
   def hashTF(text: String): Vector = {
     val newList : Array[String] = text.split(" ")
+    .filterNot(stopWords.contains(_))
     .sliding(nGram)
     .map(_.mkString)
     .toArray


[6/9] incubator-predictionio-template-text-classifier git commit: Merge branch 'STOP_WORDS' of https://github.com/nlauchande/incubator-predictionio-template-text-classifier

Posted by do...@apache.org.
Merge branch 'STOP_WORDS' of https://github.com/nlauchande/incubator-predictionio-template-text-classifier


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/3d2baf55
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/3d2baf55
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/3d2baf55

Branch: refs/heads/master
Commit: 3d2baf5544491d7c0cc33cf83c6e32374e5d70d7
Parents: 5c45ef9 1a31614
Author: Donald Szeto <do...@apache.org>
Authored: Thu May 4 10:46:57 2017 -0700
Committer: Donald Szeto <do...@apache.org>
Committed: Thu May 4 10:46:57 2017 -0700

----------------------------------------------------------------------
 src/main/scala/Preparator.scala | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/3d2baf55/src/main/scala/Preparator.scala
----------------------------------------------------------------------
diff --cc src/main/scala/Preparator.scala
index 9441257,1681acc..8a5cb5c
--- a/src/main/scala/Preparator.scala
+++ b/src/main/scala/Preparator.scala
@@@ -70,28 -63,10 +71,29 @@@ class TFHasher
  
    private val hasher = new HashingTF(numFeatures = numFeatures)
  
 +/** Use Lucene StandardAnalyzer to tokenize text **/
 + def tokenize(content: String): Seq[String] = {
 +    val tReader = new StringReader(content)
 +    val analyzer = new StandardAnalyzer(Version.LATEST)
 +    val tStream = analyzer.tokenStream("contents", tReader)
 +    val term = tStream.addAttribute(classOf[CharTermAttribute])
 +    tStream.reset()
 +
 +    val result = mutable.ArrayBuffer.empty[String]
 +    while (tStream.incrementToken()) {
 +      val termValue = term.toString
-       
++
 +        result += term.toString
-       
++
 +    }
 +    result
 +}
 +
 +
    /** Hashing function: Text -> term frequency vector. */
    def hashTF(text: String): Vector = {
 -    val newList : Array[String] = text.split(" ")
 +    val newList : Array[String] = tokenize(text)
+     .filterNot(stopWords.contains(_))
      .sliding(nGram)
      .map(_.mkString)
      .toArray
@@@ -104,7 -79,7 +106,7 @@@ class TFIDFModel
    val hasher: TFHasher,
    val idf: IDFModel
  ) extends Serializable {
--  
++
    /** trasform text to tf-idf vector. */
    def transform(text: String): Vector = {
      // Map(n-gram -> document tf)


[4/9] incubator-predictionio-template-text-classifier git commit: Bump to PIO 0.11.0-incubating and enhance sbt configuration

Posted by do...@apache.org.
Bump to PIO 0.11.0-incubating and enhance sbt configuration


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/653d4034
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/653d4034
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/653d4034

Branch: refs/heads/master
Commit: 653d403402af2553e256993abc21d072973470f3
Parents: 7bff411
Author: Naoki Takezoe <ta...@gmail.com>
Authored: Wed May 3 21:41:29 2017 +0900
Committer: Naoki Takezoe <ta...@gmail.com>
Committed: Wed May 3 21:41:29 2017 +0900

----------------------------------------------------------------------
 build.sbt                | 2 +-
 project/assembly.sbt     | 2 +-
 project/build.properties | 1 +
 3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/653d4034/build.sbt
----------------------------------------------------------------------
diff --git a/build.sbt b/build.sbt
index deeffa8..594c0de 100644
--- a/build.sbt
+++ b/build.sbt
@@ -5,6 +5,6 @@ organization := "org.apache.predictionio"
 scalaVersion := "2.10.5"
 
 libraryDependencies ++= Seq(
-  "org.apache.predictionio" %% "apache-predictionio-core" % "0.10.0-incubating" % "provided",
+  "org.apache.predictionio" %% "apache-predictionio-core" % "0.11.0-incubating" % "provided",
   "org.apache.spark"        %% "spark-core"               % "1.4.1" % "provided",
   "org.apache.spark"        %% "spark-mllib"              % "1.4.1" % "provided")

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/653d4034/project/assembly.sbt
----------------------------------------------------------------------
diff --git a/project/assembly.sbt b/project/assembly.sbt
index 20861f2..e17409e 100644
--- a/project/assembly.sbt
+++ b/project/assembly.sbt
@@ -1 +1 @@
-addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0")
\ No newline at end of file
+addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.4")

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/653d4034/project/build.properties
----------------------------------------------------------------------
diff --git a/project/build.properties b/project/build.properties
new file mode 100644
index 0000000..64317fd
--- /dev/null
+++ b/project/build.properties
@@ -0,0 +1 @@
+sbt.version=0.13.15


[8/9] incubator-predictionio-template-text-classifier git commit: Merge branch 'update-pio_0.11.0' of https://github.com/takezoe/incubator-predictionio-template-text-classifier

Posted by do...@apache.org.
Merge branch 'update-pio_0.11.0' of https://github.com/takezoe/incubator-predictionio-template-text-classifier


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/6b89e6e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/6b89e6e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/6b89e6e5

Branch: refs/heads/master
Commit: 6b89e6e5eeabde5916b5a1d29e70aa27a498fefe
Parents: b25cca2 653d403
Author: Donald Szeto <do...@apache.org>
Authored: Thu May 4 10:49:08 2017 -0700
Committer: Donald Szeto <do...@apache.org>
Committed: Thu May 4 10:49:08 2017 -0700

----------------------------------------------------------------------
 build.sbt                | 2 +-
 project/assembly.sbt     | 2 +-
 project/build.properties | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



[3/9] incubator-predictionio-template-text-classifier git commit: Create build.properties

Posted by do...@apache.org.
Create build.properties

Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/7d550ce9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/7d550ce9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/7d550ce9

Branch: refs/heads/master
Commit: 7d550ce98adbc0a774aa9c79d7ede232b5ba968d
Parents: 7bff411
Author: kanwarpartapsingh <kp...@gmail.com>
Authored: Fri Apr 7 13:28:15 2017 +0530
Committer: GitHub <no...@github.com>
Committed: Fri Apr 7 13:28:15 2017 +0530

----------------------------------------------------------------------
 project/build.properties | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/7d550ce9/project/build.properties
----------------------------------------------------------------------
diff --git a/project/build.properties b/project/build.properties
new file mode 100644
index 0000000..43b8278
--- /dev/null
+++ b/project/build.properties
@@ -0,0 +1 @@
+sbt.version=0.13.11


[7/9] incubator-predictionio-template-text-classifier git commit: Merge branch 'patch-1' of https://github.com/kanwarpartapsingh/incubator-predictionio-template-text-classifier

Posted by do...@apache.org.
Merge branch 'patch-1' of https://github.com/kanwarpartapsingh/incubator-predictionio-template-text-classifier


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/b25cca24
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/b25cca24
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/b25cca24

Branch: refs/heads/master
Commit: b25cca24e9eeee9a4240ecb64c804e2d29a09f57
Parents: 3d2baf5 7d550ce
Author: Donald Szeto <do...@apache.org>
Authored: Thu May 4 10:48:02 2017 -0700
Committer: Donald Szeto <do...@apache.org>
Committed: Thu May 4 10:48:02 2017 -0700

----------------------------------------------------------------------
 project/build.properties | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------



[9/9] incubator-predictionio-template-text-classifier git commit: 6.0 release

Posted by do...@apache.org.
6.0 release


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/b24325a3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/b24325a3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/b24325a3

Branch: refs/heads/master
Commit: b24325a39b396d73c4b99aa300ec49848df4d33e
Parents: 6b89e6e
Author: Donald Szeto <do...@apache.org>
Authored: Thu May 4 11:24:55 2017 -0700
Committer: Donald Szeto <do...@apache.org>
Committed: Thu May 4 11:24:55 2017 -0700

----------------------------------------------------------------------
 README.md                        | 11 ++++++++++-
 build.sbt                        |  9 +++------
 engine.json                      |  2 +-
 src/main/scala/DataSource.scala  |  2 +-
 src/main/scala/Engine.scala      |  2 +-
 src/main/scala/Evaluation.scala  |  2 +-
 src/main/scala/LRAlgorithm.scala |  2 +-
 src/main/scala/NBAlgorithm.scala |  2 +-
 src/main/scala/Preparator.scala  |  5 ++---
 src/main/scala/Serving.scala     |  2 +-
 10 files changed, 22 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index fb40df2..7acee7a 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,18 @@
 # Text Classification Engine
 
-Look at the following [tutorial](https://docs.prediction.io/demo/textclassification/) for a Quick Start guide and implementation details.
+Look at the following
+[tutorial](http://predictionio.incubator.apache.org/demo/textclassification/)
+for a Quick Start guide and implementation details.
 
 # Release Information
 
+## Version 6.0
+
+- Use Apache Lucene as tokenizer
+- Add stopwords filter
+- Rename Scala package name
+- Update SBT version
+
 ## Version 5.0 **First Apache Version**
 
 - Major changes to namespace to reflect donation to the Apache Software Foundation.

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/build.sbt
----------------------------------------------------------------------
diff --git a/build.sbt b/build.sbt
index 594c0de..782ca74 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,10 +1,7 @@
-name := "org.template.textclassification"
-
-organization := "org.apache.predictionio"
-
-scalaVersion := "2.10.5"
+name := "org.example.textclassification"
 
 libraryDependencies ++= Seq(
   "org.apache.predictionio" %% "apache-predictionio-core" % "0.11.0-incubating" % "provided",
   "org.apache.spark"        %% "spark-core"               % "1.4.1" % "provided",
-  "org.apache.spark"        %% "spark-mllib"              % "1.4.1" % "provided")
+  "org.apache.spark"        %% "spark-mllib"              % "1.4.1" % "provided",
+  "org.apache.lucene"        % "lucene-core"              % "6.5.1")

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/engine.json
----------------------------------------------------------------------
diff --git a/engine.json b/engine.json
index a6158ba..6192129 100644
--- a/engine.json
+++ b/engine.json
@@ -1,7 +1,7 @@
 {
   "id": "default",
   "description": "Default settings",
-  "engineFactory": "org.template.textclassification.TextClassificationEngine",
+  "engineFactory": "org.example.textclassification.TextClassificationEngine",
   "datasource": {
     "params": {
       "appName": "MyTextApp"

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/src/main/scala/DataSource.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/DataSource.scala b/src/main/scala/DataSource.scala
index d8bbf01..80b6344 100644
--- a/src/main/scala/DataSource.scala
+++ b/src/main/scala/DataSource.scala
@@ -1,4 +1,4 @@
-package org.template.textclassification
+package org.example.textclassification
 
 import org.apache.predictionio.controller.PDataSource
 import org.apache.predictionio.controller.EmptyEvaluationInfo

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/src/main/scala/Engine.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Engine.scala b/src/main/scala/Engine.scala
index dece797..16d47ac 100644
--- a/src/main/scala/Engine.scala
+++ b/src/main/scala/Engine.scala
@@ -1,4 +1,4 @@
-package org.template.textclassification
+package org.example.textclassification
 
 import org.apache.predictionio.controller.IEngineFactory
 import org.apache.predictionio.controller.Engine

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/src/main/scala/Evaluation.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Evaluation.scala b/src/main/scala/Evaluation.scala
index 9850ae8..979d976 100644
--- a/src/main/scala/Evaluation.scala
+++ b/src/main/scala/Evaluation.scala
@@ -1,4 +1,4 @@
-package org.template.textclassification
+package org.example.textclassification
 
 import org.apache.predictionio.controller.AverageMetric
 import org.apache.predictionio.controller.Evaluation

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/src/main/scala/LRAlgorithm.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/LRAlgorithm.scala b/src/main/scala/LRAlgorithm.scala
index 3bc1373..e056cf9 100644
--- a/src/main/scala/LRAlgorithm.scala
+++ b/src/main/scala/LRAlgorithm.scala
@@ -1,4 +1,4 @@
-package org.template.textclassification
+package org.example.textclassification
 
 import org.apache.predictionio.controller.P2LAlgorithm
 import org.apache.predictionio.controller.Params

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/src/main/scala/NBAlgorithm.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/NBAlgorithm.scala b/src/main/scala/NBAlgorithm.scala
index 1cd01fc..9a408c5 100644
--- a/src/main/scala/NBAlgorithm.scala
+++ b/src/main/scala/NBAlgorithm.scala
@@ -1,4 +1,4 @@
-package org.template.textclassification
+package org.example.textclassification
 
 import org.apache.predictionio.controller.P2LAlgorithm
 import org.apache.predictionio.controller.Params

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/src/main/scala/Preparator.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Preparator.scala b/src/main/scala/Preparator.scala
index 8a5cb5c..1f4d51d 100644
--- a/src/main/scala/Preparator.scala
+++ b/src/main/scala/Preparator.scala
@@ -1,4 +1,4 @@
-package org.template.textclassification
+package org.example.textclassification
 
 import org.apache.predictionio.controller.PPreparator
 import org.apache.predictionio.controller.Params
@@ -13,7 +13,6 @@ import org.apache.spark.rdd.RDD
 
 import org.apache.lucene.analysis.standard.StandardAnalyzer
 import org.apache.lucene.analysis.tokenattributes.CharTermAttribute
-import org.apache.lucene.util.Version
 
 import java.io.StringReader
 
@@ -74,7 +73,7 @@ class TFHasher(
 /** Use Lucene StandardAnalyzer to tokenize text **/
  def tokenize(content: String): Seq[String] = {
     val tReader = new StringReader(content)
-    val analyzer = new StandardAnalyzer(Version.LATEST)
+    val analyzer = new StandardAnalyzer()
     val tStream = analyzer.tokenStream("contents", tReader)
     val term = tStream.addAttribute(classOf[CharTermAttribute])
     tStream.reset()

http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/b24325a3/src/main/scala/Serving.scala
----------------------------------------------------------------------
diff --git a/src/main/scala/Serving.scala b/src/main/scala/Serving.scala
index 58c6330..2f69b73 100644
--- a/src/main/scala/Serving.scala
+++ b/src/main/scala/Serving.scala
@@ -1,4 +1,4 @@
-package org.template.textclassification
+package org.example.textclassification
 
 import org.apache.predictionio.controller.LServing
 


[5/9] incubator-predictionio-template-text-classifier git commit: Merge branch 'master' of https://github.com/sebas00/incubator-predictionio-template-text-classifier

Posted by do...@apache.org.
Merge branch 'master' of https://github.com/sebas00/incubator-predictionio-template-text-classifier


Project: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/commit/5c45ef9b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/tree/5c45ef9b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/diff/5c45ef9b

Branch: refs/heads/master
Commit: 5c45ef9b08c13ab626e3ac8a862e64a911f51eab
Parents: 7bff411 2bcbdae
Author: Donald Szeto <do...@apache.org>
Authored: Thu May 4 10:43:47 2017 -0700
Committer: Donald Szeto <do...@apache.org>
Committed: Thu May 4 10:43:47 2017 -0700

----------------------------------------------------------------------
 src/main/scala/Preparator.scala | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-predictionio-template-text-classifier/blob/5c45ef9b/src/main/scala/Preparator.scala
----------------------------------------------------------------------