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:31 UTC

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

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