From 59762967c0f668d039f510354f8376e7f418f38c Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 27 Oct 2015 11:25:50 -0500 Subject: [PATCH 001/118] build + formatting --- build.sbt | 3 ++- .../illinois/cs/cogcomp/saul/datamodel/DataModel.scala | 4 ++-- .../RewriteBasicModel/Classifiers.scala | 10 +++++----- .../datamodel/contextualFeaturesTest.scala | 7 +++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build.sbt b/build.sbt index 7fbf4204..5bf286d0 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,8 @@ lazy val commonSettings = Seq( "edu.illinois.cs.cogcomp" % "illinois-core-utilities" % "3.0.0", "com.gurobi" % "gurobi" % "6.0", "org.apache.commons" % "commons-math3" % "3.0", - "org.scalatest" % "scalatest_2.11" % "2.2.4" + "org.scalatest" % "scalatest_2.11" % "2.2.4", + "edu.illinois.cs.cogcomp" % "illinois-sl" % "1.3.1" ) ) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala index 47d5cd9e..ef14a893 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala @@ -1,10 +1,10 @@ package edu.illinois.cs.cogcomp.saul.datamodel +import edu.illinois.cs.cogcomp.saul.datamodel.edge.{ Edge, Link } +import edu.illinois.cs.cogcomp.saul.datamodel.node.{ JoinNode, Node } import edu.illinois.cs.cogcomp.saul.datamodel.property.features.discrete._ import edu.illinois.cs.cogcomp.saul.datamodel.property.features.real._ import edu.illinois.cs.cogcomp.saul.datamodel.property.{ EvaluatedProperty, Property } -import edu.illinois.cs.cogcomp.saul.datamodel.node.{ JoinNode, Node } -import edu.illinois.cs.cogcomp.saul.datamodel.edge.{ Edge, Link } import scala.collection.mutable.{ ListBuffer, Map => MutableMap } import scala.reflect.ClassTag diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/Classifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/Classifiers.scala index 2b22d096..73adaff9 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/Classifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/Classifiers.scala @@ -12,23 +12,23 @@ object classifiers { val parameters = new SparseAveragedPerceptron.Parameters() parameters.modelDir = "model" - object orgClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel,parameters) { + object orgClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { def label: Property[ConllRawToken] = entityType is "Org" override def feature = using(word) } - object PersonClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel,parameters) { + object PersonClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { def label: Property[ConllRawToken] = entityType is "Peop" } - object LocClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel,parameters) { + object LocClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { def label: Property[ConllRawToken] = entityType is "Loc" } - object workForClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel,parameters) { + object workForClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel, parameters) { override def label: Property[ConllRelation] = relationType is "Work_For" } - object LivesInClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel,parameters) { + object LivesInClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel, parameters) { override def label: Property[ConllRelation] = relationType is "Live_In" } } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/contextualFeaturesTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/contextualFeaturesTest.scala index 0c1e41cb..1c0d5e49 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/contextualFeaturesTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/contextualFeaturesTest.scala @@ -1,8 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.datamodel import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import org.scalatest.{FlatSpec, Matchers} -class contextualFeaturesTest extends FlatSpec with Matchers { +import org.scalatest.{ FlatSpec, Matchers } +class contextualFeaturesTest extends FlatSpec with Matchers { object TestGraph extends DataModel { val firstNames = node[String] @@ -19,8 +19,7 @@ class contextualFeaturesTest extends FlatSpec with Matchers { "finding the nodes in a window in the neighbohood" should "find the neighbors in a window" in { import TestGraph._ - getNodeWithType[String].getWithWindow(firstNames.getAllInstances.head,0,1).toSet should be(Set(Some("Dave"), Some("John"))) + getNodeWithType[String].getWithWindow(firstNames.getAllInstances.head, 0, 1).toSet should be(Set(Some("Dave"), Some("John"))) } - } From 71fda57ebf7416a3e21089cae2fc3cbbc47a4048 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 28 Oct 2015 09:21:48 -0500 Subject: [PATCH 002/118] draft ER example using SL --- .../SL_SVM/iJLIS/.GraphStructure.java.swp | Bin 0 -> 12288 bytes .../SL_SVM/iJLIS/DataGenerator.java | 83 ++ .../SL_SVM/iJLIS/ERFeatureGenerator.java | 24 + .../SL_SVM/iJLIS/ERiStructure.java | 53 + .../SL_SVM/iJLIS/ERqInstance.java | 28 + .../SL_SVM/iJLIS/GraphStructure.java | 54 + .../SL_SVM/iJLIS/Nodevalues.java | 8 + .../SL_SVM/iJLIS/QueryInstance.java | 42 + .../SL_SVM/iJLIS/Runner.java | 179 +++ .../SL_SVM/iJLIS/Runner.scala | 171 +++ .../SL_SVM/iJLIS/SUtils.java | 99 ++ .../SL_SVM/iJLIS/SimpleInference.java | 143 ++ .../SL_SVM/iJLIS/iERinference.scala | 116 ++ .../SL_SVM/iJLIS/iERjavaInference.java | 223 +++ .../SL_SVM/iJLIS/mytest.ssvm.model | Bin 0 -> 15524 bytes .../SL_SVM/iJLIS/namedata-test | 92 ++ .../SL_SVM/iJLIS/namedata-train | 274 ++++ .../EntityMentionRelation/SL_SVM/iJLIS/names | 1099 +++++++++++++++ .../SL_SVM/iJLIS2/ContainsStation.java | 24 + .../SL_SVM/iJLIS2/ERiStructurePL.java | 89 ++ .../SL_SVM/iJLIS2/ERqInstancePL.java | 48 + .../SL_SVM/iJLIS2/EntityFeatures.java | 62 + .../SL_SVM/iJLIS2/JointER$subjectto.java | 94 ++ .../SL_SVM/iJLIS2/JointER.java | 40 + .../SL_SVM/iJLIS2/Labels.scala | 37 + .../SL_SVM/iJLIS2/Labelsj.java | 12 + .../SL_SVM/iJLIS2/LocClassifier.ex | Bin 0 -> 17618 bytes .../SL_SVM/iJLIS2/LocClassifier.lc | Bin 0 -> 2620 bytes .../SL_SVM/iJLIS2/LocClassifier.test.ex | Bin 0 -> 17618 bytes .../SL_SVM/iJLIS2/OrganizationClassifier.ex | Bin 0 -> 17129 bytes .../SL_SVM/iJLIS2/OrganizationClassifier.java | 1221 ++++++++++++++++ .../SL_SVM/iJLIS2/OrganizationClassifier.lc | Bin 0 -> 3303 bytes .../iJLIS2/OrganizationClassifier.test.ex | Bin 0 -> 17129 bytes .../SL_SVM/iJLIS2/OrganizationWorkFor.java | 92 ++ .../SL_SVM/iJLIS2/PersonClassifier.ex | Bin 0 -> 17506 bytes .../SL_SVM/iJLIS2/PersonClassifier.java | 1228 +++++++++++++++++ .../SL_SVM/iJLIS2/PersonClassifier.lc | Bin 0 -> 2080 bytes .../SL_SVM/iJLIS2/PersonClassifier.test.ex | Bin 0 -> 17506 bytes .../SL_SVM/iJLIS2/PersonWorkFor.java | 90 ++ .../SL_SVM/iJLIS2/RelationFeatures.java | 63 + .../SL_SVM/iJLIS2/RunnerPL.scala | 179 +++ .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 620 +++++++++ .../iJLIS2/java/Conll04_InstanceReader.java | 205 +++ .../iJLIS2/java/Conll04_RelationReader.java | 221 +++ .../SL_SVM/iJLIS2/java/ConllRawSentence.java | 87 ++ .../SL_SVM/iJLIS2/java/ConllRawToken.java | 43 + .../SL_SVM/iJLIS2/java/ConllRelation.java | 15 + .../SL_SVM/iJLIS2/java/EntityFeatures.java | 63 + .../SL_SVM/iJLIS2/java/JointER$subjectto.java | 93 ++ .../SL_SVM/iJLIS2/java/JointER.java | 40 + .../SL_SVM/iJLIS2/java/LocClassifier.ex | Bin 0 -> 17618 bytes .../SL_SVM/iJLIS2/java/LocClassifier.java | 1220 ++++++++++++++++ .../SL_SVM/iJLIS2/java/LocClassifier.test.ex | Bin 0 -> 17618 bytes .../iJLIS2/java/OrganizationClassifier.ex | Bin 0 -> 17129 bytes .../iJLIS2/java/OrganizationClassifier.java | 1220 ++++++++++++++++ .../java/OrganizationClassifier.test.ex | Bin 0 -> 17129 bytes .../iJLIS2/java/OrganizationWorkFor.java | 93 ++ .../SL_SVM/iJLIS2/java/PersonClassifier.ex | Bin 0 -> 17506 bytes .../SL_SVM/iJLIS2/java/PersonClassifier.java | 1220 ++++++++++++++++ .../iJLIS2/java/PersonClassifier.test.ex | Bin 0 -> 17506 bytes .../SL_SVM/iJLIS2/java/PersonWorkFor.java | 93 ++ .../SL_SVM/iJLIS2/java/RelArgsClassifier.java | 90 ++ .../SL_SVM/iJLIS2/java/RelationFeatures.java | 66 + .../SL_SVM/iJLIS2/java/locLabel.java | 91 ++ .../SL_SVM/iJLIS2/java/orgLabel.java | 91 ++ .../SL_SVM/iJLIS2/java/personLabel.java | 91 ++ .../SL_SVM/iJLIS2/java/workLabel.java | 91 ++ .../SL_SVM/iJLIS2/java/work_forClassifier.ex | Bin 0 -> 9506 bytes .../iJLIS2/java/work_forClassifier.java | 1220 ++++++++++++++++ .../iJLIS2/java/work_forClassifier.test.ex | Bin 0 -> 9506 bytes .../SL_SVM/iJLIS2/orgLabel.java | 95 ++ .../SL_SVM/iJLIS2/personLabel.java | 97 ++ .../SL_SVM/iJLIS2/workLabel.java | 91 ++ .../SL_SVM/iJLIS2/work_forClassifier.ex | Bin 0 -> 9506 bytes .../SL_SVM/iJLIS2/work_forClassifier.java | 1225 ++++++++++++++++ .../SL_SVM/iJLIS2/work_forClassifier.lc | Bin 0 -> 11279 bytes .../SL_SVM/iJLIS2/work_forClassifier.test.ex | Bin 0 -> 9506 bytes .../SL_SVM/iJLIS2/work_forClassifier1.java | 37 + 78 files changed, 14485 insertions(+) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/.GraphStructure.java.swp create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERFeatureGenerator.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERiStructure.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Nodevalues.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERjavaInference.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/mytest.ssvm.model create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/namedata-test create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/namedata-train create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/names create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ContainsStation.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labelsj.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.lc create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.lc create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.lc create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_RelationReader.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/ConllRawSentence.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/ConllRawToken.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/ConllRelation.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/EntityFeatures.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/JointER$subjectto.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/JointER.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.lc create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier1.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/.GraphStructure.java.swp b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/.GraphStructure.java.swp new file mode 100644 index 0000000000000000000000000000000000000000..0e11b8284cd7cb30c389d6ef2af98461757d6e5c GIT binary patch literal 12288 zcmeI2%WfP+6oxD88c0A~1R@G5hE0#1R8Im?Bs;c@A|-M#LCB6#2w9Z7YdkgXo2$BK zVwsQ!V1W<|7I^?9kaz;vA%TT*thRXx(kXQ#Kl z{sF%v-evf_$k@-{u5NvN`R=t>#*FP{CK}4bwfyf#Mk8elDMBlB9P2dGR;Z{vGUoGU z!eE@meRZxU&Wm1iuI|btkChFq34=uHG_awJWst;mhhW+vmquF|=<6Hno53|B^TB3e z%CIPn5<@wXN21aVGC&4u11H%#7tZ(G`P-eh_{%TdBr#-w43GgbKnBPF86X2>fDAlE z28#RyyN~C6rg`Rz&GEz|$L5j_WPl8i0Wv@a$N(8217v^9JYzqB2jB`=0vEwK&;>qV;30DT75oBz1Yd#s;4^Rta;Bf}-G3MQ4o@W#)OH+r~CL)+qV-F=l;xu7XkV_u~^+v>OK_ucq? zJza`cg®Txf5$)%;HMKPr_uSWi)aorVe%o#l0)dNFTcf(^N&;?cGcdAN(;-^A*`<7Mpk?w0Nk-A%VL17pU8uO z8ef>)-oiV_@mCBKzs2?Bxv@~yt=y zX1igQUPY3h16+e%Ur}tniO9Y u;_B=xKb`uR(K_ubqpiQrnf(h^neZO~ literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java new file mode 100755 index 00000000..d73583c8 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java @@ -0,0 +1,83 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +import edu.illinois.cs.cogcomp.core.io.LineIO; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + + +public class DataGenerator { + + public DataGenerator() throws IOException{ + + // Process: generate three names + // three labels: each 0 + // if name1 contains more than one vowel: + // label it as 1 + // if name2 starts with a vowel, and name1 is labeled as 1: + // name2 gets a 1 + // if name2 is 1 and name3 has a vowel in the last place and if name1 is 0: + // name3 gets a 0 + + ArrayList names = LineIO.read("names"); + List triples = new ArrayList(); + List outlines = new ArrayList(); + for(String name : names){ + triples.add(name.toLowerCase().trim()); + + if(triples.size() == 3){ + System.out.println(triples); + + String n1 = triples.get(0); + String n2 = triples.get(1); + String n3 = triples.get(2); + + int lab1, lab2, lab3; + + if(SUtils.numVowels(n1) > 2){ + lab1 = 1; + }else{ + lab1 = 0; + } + + if(SUtils.isVowel(n2.charAt(0)) && lab1 == 1){ + lab2 = 1; + }else{ + lab2 = 0; + } + + if(SUtils.isVowel(n2.charAt(n2.length()-1)) && lab1 == 0){ + lab3 = 1; + }else{ + lab3 = 0; + } + + System.out.println("" + lab1 + lab2 + lab3 + ""); + + String out = String.format("%s %s %s %d%d%d", n1,n2,n3,lab1,lab2,lab3); + outlines.add(out); + + triples.clear(); + } + } + + + double part = 0.75; + int partInd = (int) (outlines.size() * part); + + LineIO.write("namedata-train", outlines.subList(0, partInd)); + LineIO.write("namedata-test", outlines.subList(partInd, outlines.size())); + + + + } + + + + public static void main(String[] args) throws IOException{ + DataGenerator dg = new DataGenerator(); + + } + +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERFeatureGenerator.java new file mode 100644 index 00000000..661152c7 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERFeatureGenerator.java @@ -0,0 +1,24 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + +/** + * Created by Parisa on 10/27/15. + */ +public class ERFeatureGenerator extends AbstractFeatureGenerator { + private static final long serialVersionUID = 1L; + public ERFeatureGenerator(){ + + } + public IFeatureVector getFeatureVector (IInstance x, IStructure y){ + ERqInstance mx= (ERqInstance) x; + ERiStructure my=(ERiStructure) y; + FeatureVectorBuffer fvb= new FeatureVectorBuffer(mx.fv); + //TODO tune fvb indexes + return fvb.toFeatureVector(); + } +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERiStructure.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERiStructure.java new file mode 100755 index 00000000..8cb6a76f --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERiStructure.java @@ -0,0 +1,53 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; +import java.util.ArrayList; +import java.util.List; + + +/** + * Created by parisakordjamshidi on 19/09/14. + */ +public class ERiStructure implements IStructure { + + public Boolean nodeValues; + public ERqInstance qi; + private IFeatureVector fv; + + public ERiStructure(ERqInstance qi,Boolean nodeValues) { + List feats = new ArrayList(); + this.nodeValues = nodeValues; + // List feats2=new ArrayList(); + //feats.add(tok.entType); + // do something with node names to make features + // if (nodeValues==true) + { + this.qi=qi; + this.fv =this.qi.fv; //only if the lable is one the features are considered otherwise all of them turned to zero + // nodeValues=(true); + } + // else { + // this.fv=SUtils.makeFeatures(feats); + + // nodeValues=(false); + // } + + //this.fv = FeatureVector.plus(this.qi.fv, this.fv); + } + +// @Override +// public IFeatureVector getFeatureVector() { +// List feats = new ArrayList(); +// if (nodeValues==true) +// return this.fv; +// else +// return SUtils.makeFeatures(feats); +// } + + public String toString() { return "" + this.nodeValues; } + + } + + + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java new file mode 100755 index 00000000..b5bd72f9 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java @@ -0,0 +1,28 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by parisakordjamshidi on 19/09/14. + */ +public class ERqInstance implements IInstance { + ConllRawToken q; + List nodeNames; // order matters! + IFeatureVector fv; + + public ERqInstance(ConllRawToken tok) { + q=tok; + List feats = new ArrayList(); + feats.add("Ph:"+tok.phrase); + feats.add("POS:"+tok.POS); + this.nodeNames = feats; + // do something with node names to make features + this.fv = SUtils.makeFeatures(feats); + } + +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java new file mode 100755 index 00000000..07c0d830 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java @@ -0,0 +1,54 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + + +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + +import java.util.ArrayList; +import java.util.List; + +//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; + +/** + * This is the Y instance for the prediction problem + * + * @author mayhew2 + * + */ +public class GraphStructure implements IStructure { + + public List nodeValues; + public QueryInstance qi; + private IFeatureVector fv; + + public GraphStructure(QueryInstance qi, List nodeValues) { + this.nodeValues = nodeValues; + this.qi = qi; + List feats = new ArrayList(); + + int i = 0; + for(String n : qi.nodeNames){ + feats.add("num" + i + "vow:" + SUtils.numVowels(n) + ":" + nodeValues.get(i)); + int j = 0; + for(char c : n.toCharArray()){ + feats.add("isvowpos:" + i + j + ":" + SUtils.isVowel(c) + ":" + nodeValues.get(i)); + j++; + } + i++; + } + + this.fv = SUtils.makeFeatures(feats); + //this.fv = IFeatureVector.plus(this.qi.fv, this.fv); + } + + + public IFeatureVector getFeatureVector() { + return this.fv; + } + + @Override + public String toString() { + return "[GraphStructure: " + this.nodeValues + "]"; + } + +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Nodevalues.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Nodevalues.java new file mode 100755 index 00000000..651d3be7 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Nodevalues.java @@ -0,0 +1,8 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +/** + * Created by parisakordjamshidi on 21/09/14. + */ +public class Nodevalues { + public Boolean a; +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java new file mode 100755 index 00000000..720f1483 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java @@ -0,0 +1,42 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + +import java.util.ArrayList; +import java.util.List; + +/** + * This is the X instance for the prediction problem + * + * @author mayhew2 + * + */ +public class QueryInstance implements IInstance { + + List nodeNames; // order matters! + + IFeatureVector fv; + + public QueryInstance(List nodeNames) { + this.nodeNames = nodeNames; + + List feats = new ArrayList(); + + // do something with node names to make features + + int i = 0; + for(String n : nodeNames){ + feats.add("num" + i + "vow:" + SUtils.numVowels(n)); + int j = 0; + for(char c : n.toCharArray()){ + feats.add("isvowpos:" + i + j + ":" + SUtils.isVowel(c)); + j++; + } + i++; + } + + this.fv = SUtils.makeFeatures(feats); + } + +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.java new file mode 100755 index 00000000..0e1ce7ad --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.java @@ -0,0 +1,179 @@ +/* +package ml.wolfe.examples.parisa.iJLIS; + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.indsup.inference.AbstractLossSensitiveStructureFinder; +import edu.illinois.cs.cogcomp.indsup.inference.IInstance; +import edu.illinois.cs.cogcomp.indsup.inference.IStructure; +import edu.illinois.cs.cogcomp.indsup.learning.*; +import edu.illinois.cs.cogcomp.indsup.learning.L2Loss.L2LossJLISLearner; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; + +public class Runner { + + */ +/* + * Notice that lexm is static. + *//* + + static LexManager lexm = new LexManager(); + + */ +/** + * This modifies the two lists given two it. They are initialized. + * + * @param sclist + * @param outlist + * @param fname + * @throws java.io.FileNotFoundException + *//* + + public static void readData(List sclist, List outlist, String fname) throws FileNotFoundException { + + ArrayList lines = LineIO.read(fname); + + for(String line : lines){ + List s = Arrays.asList(line.split("\\s+")); + + QueryInstance newqi = new QueryInstance(s.subList(0, 3)); + sclist.add(newqi); + GraphStructure cs = new GraphStructure(newqi, SUtils.binaryToNodeLabel(s.get(3))); + outlist.add(cs); + } + } + + public static String trainSSVM(String modelname) throws Exception { + + // First we read the data. + // X instance list + List sclist = new ArrayList(); + // Y instance (structure) + List outlist = new ArrayList(); + + String fname = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-train"; + readData(sclist, outlist, fname); + lexm.setAllowNewFeatures(false); + + // Define the problem, and give it data + StructuredProblem sp = new StructuredProblem(); + sp.input_list = sclist; + sp.output_list = outlist; + + // Create parameters + JLISParameters para = new JLISParameters(); + para.total_number_features = lexm.totalNumofFeature(); + para.c_struct = 1; + para.check_inference_opt = false; + + SimpleInference si = new SimpleInference(); + + // Actually do the learning + L2LossJLISLearner learner = new L2LossJLISLearner(); + WeightVector learned_wv = learner.trainStructuredSVM(si, sp, para); + + // Package all the parameters together + SimpleModel model = new SimpleModel(); + model.wv = learned_wv; + model.s_finder = new SimpleInference(); + model.lm = lexm; + + // This is just a way to serialize the model + JLISModelIOManager iom = new JLISModelIOManager(); + iom.saveModel(model, modelname); + + return modelname; + + } + + public static void testSequenceSSVM(String model_name) throws Exception { + // Load the model + JLISModelIOManager iom = new JLISModelIOManager(); + SimpleModel model = (SimpleModel) iom.loadModel(model_name); + Runner.lexm = model.lm; + WeightVector learned_wv = model.wv; + SimpleInference inference_proc = (SimpleInference) model.s_finder; + + // X instance list + List sclist = new ArrayList(); + // Y instance (structure) + List outlist = new ArrayList(); + + // Load the data + String fname = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-trainnamedata-test"; + readData(sclist, outlist, fname); + + // Create a problem with testing data + StructuredProblem sp = new StructuredProblem(); + sp.input_list = sclist; + sp.output_list = outlist; + + printTestACC(sp, inference_proc, learned_wv); + } + + private static void printTestACC(StructuredProblem sp, AbstractLossSensitiveStructureFinder s_finder, WeightVector ssvm_wv) throws IOException, + Exception { + + double tp = 0; + double fp = 0; + double tn = 0; + double fn = 0; + double total = 0.0; + + for (int i = 0; i < sp.input_list.size(); i++) { + + GraphStructure gold = (GraphStructure) sp.output_list.get(i); + GraphStructure prediction = (GraphStructure) s_finder.getBestStructure(ssvm_wv, sp.input_list.get(i)); + System.out.println(prediction); + + for (int j = 0; j < gold.nodeValues.size(); j++) { + SUtils.NodeLabel pred = prediction.nodeValues.get(j); + SUtils.NodeLabel goldval = gold.nodeValues.get(j); + + // got it right. + if (goldval == pred) { + if (pred == SUtils.NodeLabel.VALIANT) { + tp += 1.0; + } else { + tn += 1.0; + } + } else { // so I got the answer wrong + if (pred == SUtils.NodeLabel.VALIANT) { + fp += 1.0; + } else { + fn += 1.0; + } + } + + total += 1.0; + } + } + + double precision = tp / (tp + fp); + double recall = tp / (tp + fn); + double F1 = 2 * precision * recall / (precision + recall); + System.out.println("========================="); + System.out.println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")); +// System.out.println(String.format("COWARDLY: %4.3f %4.3f %4.3f", precision, recall, F1)); + System.out.println(String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)); + System.out.println("========================="); + System.out.println("Acc = " + (tp + tn) / total); + } + + public static void main(String[] args) throws Exception { + String modelname = "mytest.ssvm.model"; + trainSSVM(modelname); + + System.out.println("\n=== NOW TESTING ==="); + testSequenceSSVM(modelname); + + } + +} +*/ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala new file mode 100755 index 00000000..9ad96195 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala @@ -0,0 +1,171 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS + +import java.util +import java.util.{ArrayList, List} + +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew +import edu.illinois.cs.cogcomp.sl.applications.cs_multiclass._ +import edu.illinois.cs.cogcomp.sl.core._ +import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory +import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} + + +object Runner { + /** + * This modifies the two lists given two it. They are initialized. + * + // * @param sclist + // * @param outlist + // * @param fname + * @throws java.io.FileNotFoundException + */ +var lexm: Lexiconer = new Lexiconer() + /*def readX(cr:Conll04_InstanceReader):List[IInstance]={ + var i: Int = 0 + val sclist: List[IInstance]=new ArrayList[IInstance] + while (i < 100){//cr.instances.size){ + val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) + sclist.add(newqi) + i=i+1 + } + sclist + }*/ + def readXY(cr:Conll04_ReaderNew, outlist: => List[IStructure], sclist: => List[IInstance], l:Int,u:Int){ + var i: Int = l + while (i < u){//cr.instances.size){ + val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) + sclist.add(newqi) + val a: Nodevalues=new Nodevalues() + a.a=(cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) + val cs: ERiStructure = new ERiStructure(newqi, a.a) + outlist.add(cs) + i=i+1 + } + } + /*def readY(cr:Conll04_InstanceReader):List[IStructure]={ + var i: Int = 0 + val outlist: List[IStructure]=new util.ArrayList[IStructure] + while (i < 100){//cr.instances.size){ + val a: Nodevalues=new Nodevalues() + a.a=(cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) + val cs: ERiStructure = new ERiStructure(cr.instances.elementAt(i), a.a) + outlist.add(cs) + i=i+1 + } + outlist + } +*/ + + def trainSSVM(modelname: String): String = { + + + + var cr = new Conll04_ReaderNew("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp","Pair") + var sclist: List[IInstance]= new ArrayList[IInstance]//=readX(cr) + var outlist: List[IStructure] = new ArrayList[IStructure]//readY(cr) + readXY(cr,outlist,sclist,1,100) + cr=null + lexm.setAllowNewFeatures(false) + val sp: SLProblem = new SLProblem + sp.instanceList = sclist + sp.goldStructureList = outlist + val para: SLParameters = new SLParameters + para.TOTAL_NUMBER_FEATURE = lexm.getNumOfFeature + para.C_FOR_STRUCTURE = 1 + para.CHECK_INFERENCE_OPT = false + val si: iERinference = new iERinference + val model: SLModel = new SLModel + model.infSolver= si + model.featureGenerator= ERFeatureGenerator + model.lm = lexm + model.saveModel(modelname); + model.config = new util.HashMap(); + model.para=para + + // LabeledMultiClassData sp = MultiClassIOManager.readTrainingData(trainingDataPath); + model.infSolver = new iERinference; + model.featureGenerator = new MultiClassFeatureGenerator(); + val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); + model.wv = learner.train(sp); + return modelname + } + + def testSequenceSSVM(model_name: String) { + val model: SLModel = SLModel.loadModel(model_name) + Runner.lexm = model.lm + val learned_wv: WeightVector = model.wv + val inference_proc: iERinference = model.infSolver.asInstanceOf[iERinference] + var cr = new Conll04_ReaderNew("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp","Pair") + var sclist: List[IInstance]= new ArrayList[IInstance]//=readX(cr) + var outlist: List[IStructure] = new ArrayList[IStructure]//readY(cr) + readXY(cr,outlist,sclist,101,200) + cr=null + + // var sclist: List[IInstance]=readX(cr) + //var outlist: List[IStructure] = readY(cr) + // val sclist: List[IInstance] = new ArrayList[IInstance] + //val outlist: List[IStructure] = new ArrayList[IStructure] + // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-test" + //readData(sclist, outlist, fname) + val sp: SLProblem = new SLProblem + sp.instanceList = sclist + sp.goldStructureList = outlist + printTestACC(sp, inference_proc, learned_wv) + } + private def printTestACC(sp: SLProblem, s_finder: AbstractInferenceSolver, ssvm_wv: WeightVector) { + var tp: Double = 0 + var fp: Double = 0 + var tn: Double = 0 + var fn: Double = 0 + var total: Double = 0.0 + + var i: Int = 0 + while (i < sp.instanceList.size) { + val gold: ERiStructure = sp.goldStructureList.get(i).asInstanceOf[ERiStructure] + val prediction:ERiStructure = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructure] + System.out.println(prediction) + //{ + //var j: Int = 0 + // while (j < gold.nodeValues.size) { + // { + val pred: Boolean = prediction.nodeValues + val goldval: Boolean = gold.nodeValues + if (goldval == pred) { + if (pred == true) { + tp += 1.0 + } + else { + tn += 1.0 + } + } + else { + if (pred ==false) { + fp += 1.0 + } + else { + fn += 1.0 + } + } + total += 1.0 + i=i+1 + + } + val precision: Double = tp / (tp + fp) + val recall: Double = tp / (tp + fn) + val F1: Double = 2 * precision * recall / (precision + recall) + println("=========================") + println(" P R F ") + // println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")) + println(precision, recall, F1)//String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)) + println("=========================") + println("Acc = " + (tp + tn) / total) + } + + def main(args: Array[String]) { + val modelname: String = "mytest.ssvm.model" + trainSSVM(modelname) + System.out.println("\n=== NOW TESTING ===") + testSequenceSSVM(modelname) + } + +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java new file mode 100755 index 00000000..1eb14c4e --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java @@ -0,0 +1,99 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.RunnerPL; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.ArrayList; +import java.util.List; + + +public class SUtils { + + // Totally made up labels + public enum NodeLabel { + VALIANT, COWARDLY + }; + + public static List binaryToNodeLabel(String binary){ + ArrayList ret = new ArrayList(); + + for(char c : binary.toCharArray()){ + int val = Integer.parseInt(c+""); + if (val == 0){ + ret.add(NodeLabel.VALIANT); + }else{ + ret.add(NodeLabel.COWARDLY); + } + } + + return ret; + + } + + + /** + * A static method for smartly adding features to the LexManager, and creating a FeatureVector + * at the same time. + * + * @param feats + * @return + */ + public static IFeatureVector makeFeatures(List feats) { + ArrayList idxList = new ArrayList(); + ArrayList valList = new ArrayList(); + + for (String feat : feats) { + + if (!RunnerPL.lexm().containFeature(feat)) { + System.out.println("Flag of preview"+ RunnerPL.lexm().getNumOfFeature()); + System.out.print("before Flag of feature set"+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); + if(RunnerPL.lexm().isAllowNewFeatures()) + //Todo see the error of the following line + // RunnerPL.lexm().previewFeature(feat); + System.out.print("After preview flag"+RunnerPL.lexm().getNumOfFeature()); + System.out.print("Flag of after feature set"+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); + + } + if (RunnerPL.lexm().containFeature(feat)) { + + int fid = RunnerPL.lexm().getFeatureId(feat); + idxList.add(fid); + valList.add(1.); + } + } + + int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); + double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); + //Todo check waht is going on in the next two lines + return makeFeatures(feats); + //return new IFeatureVector(idx, val); + } + + + public static int numVowels(String s){ + int ret = 0; + + for(char c : s.toCharArray()){ + if(isVowel(c)){ + ret +=1; + } + } + return ret; + } + + public static boolean isVowel(char c){ + return isVowel(c+""); + } + + public static boolean isVowel(String s){ + List vowels = new ArrayList(); + vowels.add("a"); + vowels.add("e"); + vowels.add("i"); + vowels.add("o"); + vowels.add("u"); + + return vowels.contains(s); + } +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java new file mode 100755 index 00000000..51fe2244 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java @@ -0,0 +1,143 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; + +import edu.illinois.cs.cogcomp.core.datastructures.Pair; +import edu.illinois.cs.cogcomp.sl.core.AbstractInferenceSolver; +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.WeightVector; + +import java.util.ArrayList; +import java.util.List; + +//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; + +public class SimpleInference extends AbstractInferenceSolver { + + private static final long serialVersionUID = 1L; + + /** + * This is for training + */ + //@Override + public Pair getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { + + GraphStructure goldStruct = (GraphStructure) gold; + QueryInstance qi = (QueryInstance) input; + + List options = getOptions(qi); + + double max = Double.NEGATIVE_INFINITY; + double score; + GraphStructure maxC = null; + double loss; + + System.out.println(); + System.out.println(gold); + + // Now get the structure with the max: score+loss + for (GraphStructure c : options) { + score = wv.dotProduct(c.getFeatureVector()); + loss = getLoss(null, c, goldStruct); + score += loss; + + System.out.println(c); + System.out.println(c.getFeatureVector()); + System.out.println(score); + + if (score > max) { + max = score; + maxC = c; + } + } + + // Return structure with highest score+loss, and loss of this structure + return new Pair(maxC, ((double) getLoss(null, maxC, goldStruct))); + } + +// public double getHammingLoss(GraphStructure hyp, GraphStructure gold){ +// double loss = 0; +// for (int i = 0; i < hyp.nodeValues.size(); i++) { +// if (hyp.nodeValues.get(i) != gold.nodeValues.get(i)) { +// loss += 1.0; +// } +// } +// return loss; +// } + + /** + * This is for prediction. + */ + @Override + public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { + QueryInstance qi = (QueryInstance) input; + + List options = getOptions(qi); + + double max = Double.NEGATIVE_INFINITY; + double score; + GraphStructure maxC = null; + + // Now get the structure with the max: score+loss + for (GraphStructure c : options) { + score = wv.dotProduct(c.getFeatureVector()); + + if (score > max) { + max = score; + maxC = c; + } + } + + // Return structure with highest score+loss, and loss of this structure + return maxC; + } + + @Override + public IStructure getLossAugmentedBestStructure(WeightVector weightVector, IInstance iInstance, IStructure iStructure) throws Exception { + return null; + } + + @Override + public float getLoss(IInstance iInstance, IStructure gold, IStructure pred) { + float loss = 0; + ERiStructure igold= (ERiStructure) gold; + ERiStructure ipred=(ERiStructure)pred; + //for (int i = 0; i < ipred.nodeValues.size(); i++) { + // if (ipred.nodeValues.get(i) != igold.nodeValues.get(i)) { + if (ipred.nodeValues != igold.nodeValues) { + + loss += 1.0; + } + // } + return loss; + } + + /** + * Given this QueryInstance, what are the options for responses? + * This simple method just enumerates all possibilities. (in this + * contrived example there are 8 total) + * + * @param qi + * @return + */ + public List getOptions(QueryInstance qi) { + + List options = new ArrayList(); + + + // Get all combinations + for (SUtils.NodeLabel i : SUtils.NodeLabel.values()) { + for (SUtils.NodeLabel j : SUtils.NodeLabel.values()) { + for (SUtils.NodeLabel k : SUtils.NodeLabel.values()) { + List labelOptions = new ArrayList(); + labelOptions.add(i); + labelOptions.add(j); + labelOptions.add(k); + options.add(new GraphStructure(qi, labelOptions)); + } + } + } + + return options; + } + +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala new file mode 100755 index 00000000..ba0031e8 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala @@ -0,0 +1,116 @@ + +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS + +import java.util.{ArrayList, List} + +import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} +import edu.illinois.cs.cogcomp.sl.util.WeightVector + +/** + * Created by parisakordjamshidi on 20/09/14. + */ +//class iERinference { + + //object iERinference { + // private final val serialVersionUID: Long = 1L + //} +class iERinference extends AbstractInferenceSolver { + /** + * This is for training + */ + + override def getLoss(iInstance: IInstance, gold: IStructure, pred: IStructure): Float ={ + val igold: ERiStructure = gold.asInstanceOf[ERiStructure]; + val ipred: ERiStructure = pred.asInstanceOf[ERiStructure]; + var loss: Float = 0 + if (ipred.nodeValues==igold.nodeValues) + loss=0 + else + loss=1 + + loss + } + + /** + * This is for prediction. + */ + def getBestStructure(wv: WeightVector, input: IInstance): IStructure = { + val qi: ERqInstance = input.asInstanceOf[ERqInstance] + val options: List[ERiStructure] = getOptions(qi) + var max: Double = Double.NegativeInfinity + var score: Double = .0 + var maxC: ERiStructure = null + import scala.collection.JavaConversions._ + for ( c <- options) { + val a= new ERFeatureGenerator(); + val f= a.getFeatureVector(c.qi,c) + score = wv.dotProduct(f) + if (score > max) { + max = score + maxC = c + } + } + return maxC + } + + override def getLossAugmentedBestStructure(wv: WeightVector, input: IInstance, gold: IStructure): IStructure ={ + + val goldStruct: ERiStructure = gold.asInstanceOf[ERiStructure] + val qi: ERqInstance = input.asInstanceOf[ERqInstance] + val options: List[ERiStructure] = getOptions(qi) + var max: Double = Double.NegativeInfinity + var score: Double = .0 + var maxC: ERiStructure = null + var loss: Double = .0 + System.out.println + System.out.println(gold) + import scala.collection.JavaConversions._ + for (c <- options) { + val a= new ERFeatureGenerator(); + val f= a.getFeatureVector(c.qi,c) + score = wv.dotProduct(f) + loss = getLoss(null,c, goldStruct) + score += loss + System.out.println(c) + System.out.println(f) + System.out.println(score) + if (score > max) { + max = score + maxC = c + } + } +return maxC + // val a= new edu.illinois.cs.cogcomp.core.datastructures.Pair[IStructure, java.lang.Double](maxC.asInstanceOf[IStructure], new lang.Double(getLoss(maxC, goldStruct))) + + //return a + } + /** + * Given this QueryInstance, what are the options for responses? + * This simple method just enumerates all possibilities. (in this + * contrived example there are 8 total) + * + // * @param qi + // * @return + */ + def getOptions(qi: ERqInstance): List[ERiStructure] = { + val options: List[ERiStructure] = new ArrayList[ERiStructure] + //for (i <- NodeLabel.values) { + // for (j <- NodeLabel.values) { + // for (k <- NodeLabel.values) { + // val labelOptions: List[Nodevalues]= new ArrayList[Nodevalues]() + // val a:Nodevalues=new Nodevalues() + // a.a=true + //labelOptions.add(a) + //a.a=false + //labelOptions.add(a) + //labelOptions.add(k) + options.add(new ERiStructure(qi, true)) + options.add(new ERiStructure(qi, false)) + + return options + } + + + +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERjavaInference.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERjavaInference.java new file mode 100755 index 00000000..01b63a4c --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERjavaInference.java @@ -0,0 +1,223 @@ +/* +package ml.wolfe.examples.parisa.iJLIS; + +*/ +/** + * Created by parisakordjamshidi on 22/09/14. + *//* + + +import edu.illinois.cs.cogcomp.core.datastructures.Pair; +import edu.illinois.cs.cogcomp.indsup.inference.AbstractLossSensitiveStructureFinder; +import edu.illinois.cs.cogcomp.indsup.inference.IInstance; +import edu.illinois.cs.cogcomp.indsup.inference.IStructure; +import edu.illinois.cs.cogcomp.indsup.learning.WeightVector; +import gurobi.*; + +import java.util.ArrayList; +import java.util.List; +//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; + +public class iERjavaInference extends AbstractLossSensitiveStructureFinder { + + private static final long serialVersionUID = 1L; + + */ +/** + * This is for training + *//* + + @Override + + public Pair getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { +//// + ERiStructure goldStruct = (ERiStructure) gold; + ERqInstance qi = (ERqInstance) input; + Integer goldL = (((ERiStructure) gold).nodeValues) ? 1 : 0; + Double coefLos= Double.valueOf((1-2*(goldL))); +// double loss; + ERiStructure maxC = new ERiStructure((ERqInstance)input,true); + Double coef=wv.dotProduct(((ERqInstance) input).fv)+coefLos; + try{ + GRBEnv env = new GRBEnv("mip1.log"); + GRBModel model = new GRBModel(env); + //create variables + GRBVar per=model.addVar(0,1,0.0,GRB.BINARY,"per"); + // integrate the new variables + model.update(); + //Set objective maximize fn(x).per + GRBLinExpr expr= new GRBLinExpr(); + expr.addTerm(coef,per); + model.setObjective(expr,GRB.MAXIMIZE); + //add constraints + model.optimize(); + double x=per.get(GRB.DoubleAttr.X); + maxC.nodeValues=(x>0.5); + model.dispose(); + env.dispose(); + } + catch (GRBException e) + { + System.out.println("Error code: " + e.getErrorCode() + ". " + + e.getMessage()); + } + // Return structure with highest score+loss, and loss of this structure + return new Pair(maxC, getHammingLoss(maxC, goldStruct)); + } + + public Pair getLossSensitiveBestStructureback(WeightVector wv, IInstance input, IStructure gold) throws Exception { + + ERiStructure goldStruct = (ERiStructure) gold; + ERqInstance qi = (ERqInstance) input; + + List options = getOptions(qi); + + double max = Double.NEGATIVE_INFINITY; + double score; + ERiStructure maxC = null; + double loss; + + System.out.println(); + System.out.println(gold); + + // Now get the structure with the max: score+loss + for (ERiStructure c : options) { + score = wv.dotProduct(c.getFeatureVector()); + loss = getHammingLoss(c, goldStruct); + score += loss; + + System.out.println(c); + System.out.println(c.getFeatureVector()); + System.out.println(score); + + if (score > max) { + max = score; + maxC = c; + } + } + + // Return structure with highest score+loss, and loss of this structure + return new Pair(maxC, getHammingLoss(maxC, goldStruct)); + } + + public double getHammingLoss(ERiStructure hyp, ERiStructure gold){ + double loss = 0; + if (hyp.nodeValues==gold.nodeValues) + loss=0; + else + loss=1; + return loss; + } + + */ +/** + * This is for prediction. + *//* + + //@Override + public IStructure getBestStructureback(WeightVector wv, IInstance input) throws Exception { + ERqInstance qi = (ERqInstance) input; + + List options = getOptions(qi); + + double max = Double.NEGATIVE_INFINITY; + double score; + ERiStructure maxC = null; + + // Now get the structure with the max: score+loss + for (ERiStructure c : options) { + score = wv.dotProduct(c.getFeatureVector()); + + if (score > max) { + max = score; + maxC = c; + } + } + + // Return structure with highest score+loss, and loss of this structure + return maxC; + } + + @Override + public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { + + ERqInstance qi = (ERqInstance) input; + List options = getOptions(qi); + + double max = Double.NEGATIVE_INFINITY; + //double score; + ERiStructure maxC = new ERiStructure((ERqInstance)input,true); + + // Now get the structure with the max: score+loss + // for (ERiStructure c : options) { + // score = wv.dotProduct(c.getFeatureVector()); + Double coef=wv.dotProduct(((ERqInstance) input).fv); + // if (score > max) { + // max = score; + // maxC = c; + //} + //} + /*/ +/*//* + // Return structure with highest score+loss, and loss of this structure + // return maxC; + try{ + GRBEnv env = new GRBEnv("mip1.log"); + GRBModel model = new GRBModel(env); + //create variables + GRBVar per=model.addVar(0,1,0.0,GRB.BINARY,"per"); + // integrate the new variables + model.update(); + //Set objective maximize fn(x).per + GRBLinExpr expr= new GRBLinExpr(); + expr.addTerm(coef,per); + model.setObjective(expr,GRB.MAXIMIZE); + + //add constraints + model.optimize(); + double x=per.get(GRB.DoubleAttr.X); + maxC.nodeValues=(x>0.5); + model.dispose(); + env.dispose(); + } + catch (GRBException e) + { + System.out.println("Error code: " + e.getErrorCode() + ". " + + e.getMessage()); + } + return maxC; + } + */ +/** + * Given this QueryInstance, what are the options for responses? + * This simple method just enumerates all possibilities. (in this + * contrived example there are 8 total) + * + * @param qi + * @return + *//* + + public List getOptions(ERqInstance qi) { + + List options = new ArrayList(); + + + // val options: List[ERiStructure] = new ArrayList[ERiStructure] + //for (i <- NodeLabel.values) { + // for (j <- NodeLabel.values) { + // for (k <- NodeLabel.values) { + // val labelOptions: List[Nodevalues]= new ArrayList[Nodevalues]() + // val a:Nodevalues=new Nodevalues() + // a.a=true + //labelOptions.add(a) + //a.a=false + //labelOptions.add(a) + //labelOptions.add(k) + options.add(new ERiStructure(qi, true)); + options.add(new ERiStructure(qi, false)); + + return options; + } + +} +*/ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/mytest.ssvm.model b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/mytest.ssvm.model new file mode 100755 index 0000000000000000000000000000000000000000..fe8ba626ea651048a0d86ddd08fe160e9e2f3125 GIT binary patch literal 15524 zcmeHOd3Y36w!hV)vdKPzvMKOzd60BB39C{>cnraSN*qCOh@GSp0-f&I-B}bDKsMP1 z*-;QgWS31q7KdUJ5Cvs%1W{lR6hs_FX7KTR4m{qw$W`1F^YI_I8y z_PSN+UU8A#7>hD*FuydVC=@CRM~Y%8dHlafVP2%TBxP`@C>Ae`N1{c6P)c@DaY-oH zE0P}!b(=pofB*T65)Z4C#XO{k1io{~s!Emf7UQ`y$jz>%L;-%4GcT*u(?kO*ev$oe#i>~zz78MSP zKNig65$jY@!XxWX7FjDQDROCw9TjH%(>(0P{;WQMP-3dDWs^DE!VrWI5!v_y<&Rf zYST`Qm%;x&&gz6qi@jx$@{Zn)T_5V3(WhJ1<7OVxc^Xc}*=OX{(VtjvtwkD{ul;;fci2$_SZ25+0h8nUR6KRvNfr#P$49rA-iX&v20 zOs6WmX^B<%xeBzD?^6&6#e!(+;yA0qH}Js*>3DSxUE^!-TGN+?k-KMVRE+yD&Thwj zeQ82U$;mhxNZ|w8@fv0N+nEj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=ko_(EG(;WiA`gc2Thy~#-*2T2SG?To^?3VVrrlhgZ-_oNME~m2ZqYx6 zoNJ=Lq#k{A<#t^sjTnOTj(O)xCSHAA((a#z*iYZtvd78qu1wKIpStDrEvtQ@edjXt zai_baw68VRkah3gZ~3ULbwg)X8e)!0J^E{74ow-<^q?W;Dqi21eZKI9uTqhg^>DmK z{e{hktvBS{7jxSXb6d*GpN5#1hL}@^m>-7dXG8RhA?nu feats = new ArrayList(); + this.Rlables = Rlables; + this.qi=qi; + //this.fv = FeatureVector.plus(this.qi.fv, this.fv); + } + + @Override + public FeatureVector getFeatureVector() { + // List feats = new ArrayList(); + if (Rlables.E1Label().toLowerCase().contains("peop")) + fvPeop=qi.E1fv; + if (Rlables.E2Label().toLowerCase().contains("peop")) + fvPeop= FeatureVector.plus(fvPeop,qi.E2fv); + + if (Rlables.E1Label().toLowerCase().contains("org")) + fvOrg=qi.E1fv; + if (Rlables.E2Label().toLowerCase().contains("org")) + fvOrg=FeatureVector.plus(fvOrg,qi.E2fv); + + + fvOrg=fvOrg.copyWithShift(RunnerPL.lexm().totalNumofFeature()); + fv=FeatureVector.plus(fvPeop,fvOrg); + + if(Rlables.RelLabel().toLowerCase().contains("work")) + fvWorkFor=qi.Rfv; + fvWorkFor=fvWorkFor.copyWithShift(RunnerPL.lexm().totalNumofFeature()*2); + + fv=FeatureVector.plus(fv,fvWorkFor); + + return this.fv; + + + /* if (Rlables.E1Label().contains("loc")) + fvLoc=qi.E1fv; + if (Rlables.E2Label().contains("loc")) + fvLoc=FeatureVector.plus(fvLoc,qi.E2fv); + + if (Rlables.E1Label().contains("other")) + fvOther=qi.E2fv; + if (Rlables.E2Label().contains("other")) + fvOther=FeatureVector.plus(fvOther,qi.E2fv); + if (Rlables.E1Label().equalsIgnoreCase("O")) + fvO=qi.E1fv; + if (Rlables.E2Label().equalsIgnoreCase("O")) + fvO=FeatureVector.plus(fvO,qi.E2fv); + + + if (Rlables.RelLabel().contains("Live-in")) + fvLivesIn=qi.Rfv; + if (Rlables.RelLabel().contains("work-for")) + fvWorkFor=qi.Rfv;*/ + //return + + + + + } + + @Override + public String toString() { + return "[ERiStructure: " + this.Rlables + "]"; + } + + } + + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java new file mode 100755 index 00000000..c3a23bc8 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java @@ -0,0 +1,48 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.SUtils; +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + +import java.util.ArrayList; +import java.util.List; + + +/** + * Created by parisakordjamshidi on 19/09/14. + */ +public class ERqInstancePL implements IInstance { + //ConllRawToken q; + ConllRelation pair; + // List nodeNames; // order matters! + + IFeatureVector E1fv; + IFeatureVector E2fv; + IFeatureVector Rfv; + + public ERqInstancePL(ConllRelation pair) { + this.pair=pair; + List E1feats = new ArrayList(); + List E2feats=new ArrayList(); + List Rfeats=new ArrayList(); + E1feats.add("Ph:"+pair.s.sentTokens.elementAt(pair.wordId1).phrase); + E1feats.add("POS:"+pair.s.sentTokens.elementAt(pair.wordId1).POS); + E2feats.add("Ph:"+pair.s.sentTokens.elementAt(pair.wordId2).phrase); + E2feats.add("POS:"+pair.s.sentTokens.elementAt(pair.wordId2).POS); + if (pair.wordId1`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?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D8h+p)oagf)V%3ss-sQ-c<-p_%qc7euSw`LKc8mt>| zK!52;rFpVV(wEb|*C=Jh{)6zFank5FXn(_*XFH&ur7S#8=o>gjUoZESN4J39^u4a3 z?2&Bmya4rNcx(sMrNR9&A;)myhy;Pwlf|A+^ABz944S7x{IWF}`t5N3lWYwit{>ue z;hp_PW8gm4y)_%~o0c@v-yc|8wtT4iLIcNMqyCg^$6pP)Z*DsX^<&xy4H_q`ETaC# z=FvxKUZ7s<8M$sVmj?BX%XK>N`<47AY8UFC@eG{PMg0!y(D21skfYy7-MB@rP+XWQDi);sNLTiKQA2Wx_v)x&L zZFk@tkBx^e4J8Lh%y-T*GT#JqLzeh3{fe_)MAerMu76#+-orlpWS zQ6uKV`)eQbww!l2D*$)W%DH4cTe4>+!g|cPX#&gz(iPAbSN{RgSAY!~5%RddG#TQf zt4tH1zgcBG1M8b*{Xa7W_7NQU`!}iGlKp#+K%X)m`B=8|ogBawS(y%TxU^vw%sGZ5 zTLb$8x|}V~C3^E3&}VFfUtBn<333h_DvH2?`-&_cN{gycz{Gl&cE9dL7F4)(WEAeSP0{+%-%9Q={ z0{!K5LbA`6>)hDg2k*qd{aau@5cd9csCgfCUN}8e9;1I(=H9J;^L)22PQ2TDjdll% zkiOsIA$dGkvKLm9dp(lf8%^&^4=rmXZtF%{-;?L??`mEo`q%vjP)i30E`-80ya@mR zni>EAP)h*<6aW+e2mlBG)m7?5E`-80ya@mRni>EA2LJ#7000000000000000002xv eN=9jHWl&261^@s60096205t#r0PzU`0002q`ar+{ literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..a4e6b25cda129b816cb610cea687224d1005a78b GIT binary patch literal 17618 zc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ples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java new file mode 100755 index 00000000..648c8337 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java @@ -0,0 +1,1221 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000D9F8BCE43C04C054F75CACA8E2843C3ABA2D50AAA59A212515065C609991735B29A7646B348788F77644FF08DEDB2D9B7E646B0A4E40B7DE058FB0D939CA70433E3039E5CA39C034B83D37AE940C76077790301AA042DEE10FD86081D85A38D883BF7E690D745238386A3180D40F7086E6F57726E8218A52C858B55D3F88E83F07EABE0943753385430A964986031BF11E923AA1DDFB3926741F19430567D42FD76782BBD2617F51435F5D21CF8C1A7123B21CD4DB852CF08399F6FF7A295963F1EA81C1AA8C6DFB07EAA489AB27FC6F3A7E1D1EAB960842EF20ED1E217F54100000 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +//import util.ClassUtils; +//import util.ExceptionlessInputStream; +//import util.ExceptionlessOutputStream; + +//import LBJ.learn.SparseAveragedPerceptron; + +import LBJ2.classify.*; +import LBJ2.learn.*; +import LBJ2.parse.ArrayFileParser; +import LBJ2.parse.Parser; +import LBJ2.util.ClassUtils; +import LBJ2.util.ExceptionlessInputStream; +import LBJ2.util.ExceptionlessOutputStream; +import ml.wolfe.examples.parisa.ConllRawToken; +//import learn.*; +public class OrganizationClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate OrganizationClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.ex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate OrganizationClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (OrganizationClassifier) readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new ArrayFileParser("OrganizationClassifier.ex"); } + public static Parser getTestParser() { return new ArrayFileParser("OrganizationClassifier.test.ex"); } + public static boolean isTraining; + public static OrganizationClassifier instance; + + public static OrganizationClassifier getInstance() + { + loadInstance(); + return instance; + } + + private OrganizationClassifier(boolean b) + { + super(new Parameters()); + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "OrganizationClassifier"; + setEncoding(null); + setLabeler(new orgLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public OrganizationClassifier() + { + super("ml.wolfe.examples.parisa.iJLIS2.OrganizationClassifier"); + isClone = true; + } + + public OrganizationClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + public OrganizationClassifier(Parameters p, String modelPath, String lexiconPath) + { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else { + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "OrganizationClassifier"; + setLabeler(new orgLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: ml.wolfe.examples.parisa.iJLIS2.OrganizationClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = ClassUtils.getParser(testParserName, new Class[]{String.class}, new String[]{testFile}); + OrganizationClassifier classifier = new OrganizationClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "OrganizationClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof OrganizationClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public void setParameters(LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public void learn(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public FeatureVector[] classify(FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public FeatureVector classify(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public Feature featureValue(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public java.lang.String discreteValue(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public double realValue(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public void setParameters(Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public ScoreSet scores(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public void setExtractor(Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLabelLexicon(ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.lc b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.lc new file mode 100755 index 0000000000000000000000000000000000000000..efda01563773c78ba4bec164ceff89f6d887ea97 GIT binary patch literal 3303 zcmVfoJO9KQH00;mG0N7RPL;wH)000000000000#g708BzkMrmwiy;ym4l+_iV zgy@7t$ezh$lG(RpGRe#&0V9&{fmonnQI@LMNC-n12$N(IqOmLi7mk9mSW09O^a!GY zP-C$wg?YHJSSW&kr&Zz+2-Jllivoh_d-r?y(|nkNfAn;Yo_p^5-n+~1{_cG*X!-^x z&G3e*t3%gz+3L&1o~ zbfbfsv|m2i(V=nQ&}mJis;pvSuv(LU!>xnE4WWjnJA)MsGa|uyO;XvwVSaCQup$!n zmIWUQRn~-=M~x=7gZ(rf_*y9k)8xG)R9_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IflTbHrW(&;goY!I?AFn?K{ChSG0o`%eRnV<#+aUh@osYu%%iWgC?{#Y5 z)K8vge|=D%@7uP>cET}$hxgF|Ano0@LEIUm^iXf(e+I$4_TK&luN%!P;q!Pc$veFr z`l?`M9pGBTkGx;@R*RT26pq8wL(2TBdvYt}Z<&7>^2}Uw1pZF=@xhI3-+pr2xMcpmq=~y`LS5``cvsM@ zwn;EY(%+p4_ik!vBFwMU&*Zt5_S-YCo-t;mO9u!s zP3v=K3;+PW8UO%LO928D02BZS00;osRq8}BP3v=K3;+PW8UO$X000000000000000 l0000008BzkMrmwiP)h{{000000RRC2H2?qroD2W}007_#p{M`= literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..54d84a4d0fc72a4b72896c272caf5fdc26e70458 GIT binary patch literal 17129 zcmYg%dpy(q`+s%kPCB?1Ny_fHl|v%CB`m9ilJgvLRt^&)$2nx~l+=hjCWdXHIn3$9 z95O~KWM<2mG-BB@XT!`ke((GH*N=zCV}H!{-g~d>x}K-Y_ReqnW%oz|zoU-an|uDh zp98>S%NrJE4}$#`v9UwDqjsab+9v~@fk75`bUbbq)|VHeZ&*A$PL{EkLZ47muebU% zQU@E^gHn8fiqgJ&(|sba3MD7knb1-8Bc$ADDZuf&OjR$`i@tb1Yh8@x=q(%Zc@TU= zxOE!?Ge!Fz&!N+>MqqwkQ1y7VV0V|fd3>~>ZE+pi(r&6F1pc5ZAH_)TI+2==l$I3x z`aW7iS6ITH`V!FHzZA!7p(l$ruK$5cxmH*BRf-e5>-K?X`vUIAR39JXfsyrT>JUvH zPv-^50;$F<`Vsry4v9`E{81QF;!8V70tvUGW(8$B3T}UNh%9fx4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QuSO_N zC)=nC=GZm%tRlKDbE&*#xGk#pAuiVVRe-^$N3(hFmxyS01qfj8q<}g&AmHpgleFn_ z#y`|1Go_=8^#-FElch|+BMFnOTCGruzga{wm&u^%!^ zJ4InpZi68@4%K-{oCA3REpWt+^D_mgYp5D9xWXDk8Ww@f=K90^Q=#!oaS*rpFXT?Q zg3Z*K=7~uIVyOGiz`YxJJBxhOK#Bsw22=hu)gvfW;(TZdYH zymi&C95OA(G01W@K(4nv+O`7+Dab-(XcW^r;tDD0>SAFdf-;xu5N?Xq9EM9Mp+V)}2R4{*jEeE%B zTp69I`+g_`xGw+Y8qJCI4?5-v%gbe~B5$Yf@?hRq+1&BQmi)9ca{irT>4Q^`x=xd; z;(rH(mSTKHUdqUkuDMkE=w`0CV|*Uhb40OSVU4xW{a)FUf2wwz#XXVL^Sw81>acKF z3-`bKG-AFM5SuehmYXfj4|eDo+rs)pV1*SEagK{Ml4f&0Z&qKCfGHBuq_=qVKRsRA zf8@T9?H|`Rp|D%lcC$%ry1(vz+7~QA^6MC=aO7%GMJq(8xscj4De!UrQdlo+ObmR_k4%TJL z1ltRXgvgp_J(ZnXeJi)iVwU+PF-WP8gMIvYr|$lTNb)KK42=L11UwX=cLM4~e+&O8 zmZA+9uzD_o) zuf|r7h^74HJVvV;D~L8Zu+W<#(K=)oYJ2B^r0>)Jw=S(rCkBQkC)pVSycwB97!c=E fAj^Tyr$7bJ(<%bIS=m4mj6i4#q~`$*V_*OPvDf5G literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java new file mode 100755 index 00000000..c1348cc8 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java @@ -0,0 +1,92 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 + +import edu.illinois.cs.cogcomp.lbjava.infer.ParameterizedConstraint; + +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +import LBJ2.classify.FeatureVector; +import LBJ2.infer.*; +import ml.wolfe.examples.parisa.ConllRelation; + +public class OrganizationWorkFor extends ParameterizedConstraint +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + private static final OrganizationClassifier __OrganizationClassifier = new OrganizationClassifier(); + + public OrganizationWorkFor() { super("ml.wolfe.examples.parisa.iJLIS2.OrganizationWorkFor"); } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 118 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + { + boolean LBJ2$constraint$result$0; + { + boolean LBJ2$constraint$result$1; + LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); + if (LBJ2$constraint$result$1) + LBJ2$constraint$result$0 = ("" + (__OrganizationClassifier.discreteValue(t.e2))).equals("" + (true)); + else LBJ2$constraint$result$0 = true; + } + if (!LBJ2$constraint$result$0) return "false"; + } + + return "true"; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationWorkFor(ConllRelation)' defined on line 118 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "OrganizationWorkFor".hashCode(); } + public boolean equals(Object o) { return o instanceof OrganizationWorkFor; } + + public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 118 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FirstOrderConstraint __result = new FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__OrganizationClassifier, t.e2), "" + (true)); + LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..2df1c53159ef342f4cb32b7b0a7b811808d69021 GIT binary patch literal 17506 zcmYg%XFQwx`~T_Co~m-%Qj~Jq+Ky4Gijb;n!lI z$$f~yv*#{r838*jBd`(1=>4U~HEQ{i$%+!t@j)o$dj98gv_ECJAm?%X;{}gA#$-MI zXuqJ}-YEFbjq(?@*6q>Jv(3&{FY5-cVQS>o-wr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Z&@Z6}q(IP~ThAwotq* zTh(M@b$FY(I{8*OY&ObD`?&?7_|S2;Sr6Fib?=uC@H_Br0ExpY*4fCuO(-je{&GsA zt-)dmmA2EV$Ve3vl}afbxljO+uK%1xGW&f-6)Qh{dnq100xQ`y-+o@}V{bUBWyB`b z;AxB>))VV7|4?bcE&sQ?fBr?jyMO;V1)RUSTl9FP)e$Yrn6u|k6`oC)V{H^ZZ|aRc z<r+&+J5tH&|d-N3E!Uw;Jv zw~%m6-IwuQYS-020aa&S9<*D$_0qA>cfdiUna-}~gMl%5FLG+t;@RiJSRa4-W8k(u z=YGtR=XWdpetBrWZRHMLI$spH5Yy}L_S>t64;z3j{TV>K!?qNY{{ zSiZJ=ZCdyL|99rBUw10+-8Wu$&)WTsru)gw#m{GdnJ+3){=P=u<+Zx_t@U2_*WZ?A zzgzO&>-Ljhfua94Td#XpYYc3q0>`%1u8Pl{bogEA1>n-uyv0{iN;hkUR<}2;{KCKc z`HZ#GD!b-StrbZJ2BpNRnoi{xajX9AjXrO3YWvG~tIt=w3p;!}wl1vSw({P>Ye}i| zp7WfyT;m$V*YC0V(){;fpChg=_kMV@)zUNnPkewkJ4d~CQ`RGA28Jak*%<=78JR>F h5C?-G%YhCCK?TrbLIS*5*+3GEKxhi2#lh!^000P5Ns#~m literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java new file mode 100755 index 00000000..d6718bcc --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java @@ -0,0 +1,1228 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000D9F8DCA430140148F55A9D39938B91F727A8E142420280ACAE9CB84B33D9DC0B36FC0DDD3EA22EBBB342F60E5BAA8AAFA2445F24640F442A997390553EE329C9D6237A430ECF2972260B50CDC93422416827C8E30EB3528AA19748D2B54BFED11A551258DB4EF006A91E8D1EEAFDEE95D09D3D0481A5577DF230A1E2DF9CEED7692DD2065E04275E0A0374B30C371415ABBF421C19243E3F45C423FFC903ADEE08D0CF61C5F71B60B344F3139A631EAAF5DA1E71C84D67FF349224BDF2314F60D588A3DB6C2D5313F8DEE9E365B25D0E2D9302E0F7B7F9F4DF24100000 + + +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +/*import Classifier; +import SparseAveragedPerceptron; +import util.ClassUtils; +import util.ExceptionlessInputStream; +import util.ExceptionlessOutputStream;*/ + +//import LBJ.SparseAveragedPerceptron; +// +//import LBJ.LBJ2.SparseAveragedPerceptron; + +import LBJ2.classify.*; +import LBJ2.learn.*; +import LBJ2.parse.ArrayFileParser; +import LBJ2.parse.Parser; +import LBJ2.util.ClassUtils; +import LBJ2.util.ExceptionlessInputStream; +import LBJ2.util.ExceptionlessOutputStream; +import ml.wolfe.examples.parisa.ConllRawToken; + + +public class PersonClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = PersonClassifier.class.getResource("PersonClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate PersonClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = PersonClassifier.class.getResource("PersonClassifier.ex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate PersonClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (PersonClassifier) readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new ArrayFileParser("PersonClassifier.ex"); } + public static Parser getTestParser() { return new ArrayFileParser("PersonClassifier.test.ex"); } + public static boolean isTraining; + public static PersonClassifier instance; + + public static PersonClassifier getInstance() + { + loadInstance(); + return instance; + } + + private PersonClassifier(boolean b) + { + super(new Parameters()); + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "PersonClassifier"; + setEncoding(null); + setLabeler(new personLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public PersonClassifier() + { + super("ml.wolfe.examples.parisa.iJLIS2.PersonClassifier"); + isClone = true; + } + + public PersonClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + public PersonClassifier(Parameters p, String modelPath, String lexiconPath) + { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else { + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "PersonClassifier"; + setLabeler(new personLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: ml.wolfe.examples.parisa.iJLIS2.PersonClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = ClassUtils.getParser(testParserName, new Class[]{String.class}, new String[]{testFile}); + PersonClassifier classifier = new PersonClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "PersonClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof PersonClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return (Parameters) super.getParameters(); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters( SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public void setParameters( LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler( Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public void learn( FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn( FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public FeatureVector[] classify( FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public FeatureVector classify( FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public Feature featureValue( FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public java.lang.String discreteValue( FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public double realValue( FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public void setParameters( Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public ScoreSet scores( FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public void setExtractor( Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon( Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon( Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures( Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLabelLexicon(ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.lc b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.lc new file mode 100755 index 0000000000000000000000000000000000000000..50cb93aa01219d80407038b0110ac9fd0ec741c7 GIT binary patch literal 2080 zcmV+*2;cWmO9KQH00;mG0NGXQL;wH)000000000000#g708BzkMrmwi?N|$J6jcHNbnCxBShJPVz7b` zHJE6Wh;#-Cp$LlN-ykLs5F;SaDpC`ZZr<;l^X|RxGb9V{&+cD8w%bK@YmKVRf-%I@;aL$xUF+yF=1$@ zL^U|6!ar3G2v>GGdQ>o?L}r)C{>Y55Tq}4ht}idl56J#-Fuy{crBsH3oKz6(u^5nJ zZ>6qhcK(e@ZDm-F$m7GxbS0w9lqW{QO0e1h>%sz4+iT?{{NKUX%#9GkBG`agNC@h! zHsSYTzu;;*xVyciKcCEoWVBSfPD|CZinuWfrCv(Y>!$5h1?3*$ns!l~SmO`Z%50__ z_E*bybF@miCK3(>2T;>(vQj-Qa;sd)m2nr(m4uy8K4|fUSUha-5T3!S_Q!Es8jbal*VW5(f2cm}-yt4E{wlKM zHxrloNzW<6PljIAqpwS~oy|k@)hrygT}nc`+w>FplkljW;$h&anP``jzsZ{O3>-BN z+lP{$O&z44{7$?SAF4MQ@u7H8-1qB#B|nni8)=?}ud_n))l78f88eP#NhjqCS@J*W zwB%)@RX?rI&`<4V9uU8!y@OuDAwJ?Ey`+zLtd{&w`9$j=ToiW?d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Sy%G3+qjpp7H$%>5wDKn_(yt*C$(&YdwJIdkoKP}nzW&n`}t(t z{?ak?@mwk$)7G7MYo!xC7cxJzg8H`)R#n}q6+8=XHwU{o0_Xc4)^G0;yr*+*+XT4h zoqJcq?^0Unl7~@u&adUX{f*xMP)i30*!yaSpa%c|tQr6SP)h*<6aW+e2mlBG*;VR9 z*!yaSpa%c|tQr6S2LJ#7000000000000000002xvN=9jHWl&261^@s60096205t#r K0M!Qo0000%3Mfnf literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..2df1c53159ef342f4cb32b7b0a7b811808d69021 GIT binary patch literal 17506 zcmYg%XFQwx`~T_Co~m-%Qj~Jq+Ky4Gijb;n!lI z$$f~yv*#{r838*jBd`(1=>4U~HEQ{i$%+!t@j)o$dj98gv_ECJAm?%X;{}gA#$-MI zXuqJ}-YEFbjq(?@*6q>Jv(3&{FY5-cVQS>o-wrSEh0-TM4Hq`3Y-TDmgU&eAq0grW zW0B3OsErIQRm^(Nq(^y!D{1lg5W|jlLM=>`bExanuF3-~6Ng97PKt3E%pmzJyW&qW z{yMRk-Rd3k>J{=BqY4ri!d-BoiJ$p-@b{n8uh+*$2U53kOOsTh;$Qh&4`(D?K=R5u z(6<>6-ezi-ZRK{F%>?k@rWy%FBOx7eclV5wOQO7=xAH6&o?VN3a$b&U=ELWB{$0q% z1e62ydDyUS53Yazs&Hwau7(>mYW)X z%XcHz8pHBtv26aL;*@4eBXTkwlI1dcGmxF@R@;era5X={$o>*5d-)~f(w)opLJ`Qb zuDi`yJAAb*MH-WxnX=ePGRonnnD2t2a8g@!6-EY&)8gVX_(>kLmEnM_UwO|ypEF!J zEj^|6HMeKxt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gw#m{GdnJ+3){=P=u<+Zx_t@U2_*WZ?A zzgzO&>-Ljhfua94Td#XpYYc3q0>`%1u8Pl{bogEA1>n-uyv0{iN;hkUR<}2;{KCKc z`HZ#GD!b-StrbZJ2BpNRnoi{xajX9AjXrO3YWvG~tIt=w3p;!}wl1vSw({P>Ye}i| zp7WfyT;m$V*YC0V(){;fpChg=_kMV@)zUNnPkewkJ4d~CQ`RGA28Jak*%<=78JR>F h5C?-G%YhCCK?TrbLIS*5*+3GEKxhi2#lh!^000P5Ns#~m literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java new file mode 100755 index 00000000..798cbfa7 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java @@ -0,0 +1,90 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +import LBJ2.classify.FeatureVector; +import LBJ2.infer.*; +import ml.wolfe.examples.parisa.ConllRelation; + + +public class PersonWorkFor extends ParameterizedConstraint +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + private static final PersonClassifier __PersonClassifier = new PersonClassifier(); + + public PersonWorkFor() { super("ml.wolfe.examples.parisa.iJLIS2.PersonWorkFor"); } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + { + boolean LBJ2$constraint$result$0; + { + boolean LBJ2$constraint$result$1; + LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); + if (LBJ2$constraint$result$1) + LBJ2$constraint$result$0 = ("" + (__PersonClassifier.discreteValue(t.e1))).equals("" + (true)); + else LBJ2$constraint$result$0 = true; + } + if (!LBJ2$constraint$result$0) return "false"; + } + + return "true"; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "PersonWorkFor".hashCode(); } + public boolean equals(Object o) { return o instanceof PersonWorkFor; } + + public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FirstOrderConstraint __result = new FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__PersonClassifier, t.e1), "" + (true)); + LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java new file mode 100755 index 00000000..1d57e176 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java @@ -0,0 +1,63 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 + +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +import LBJ2.classify.Classifier; +import LBJ2.classify.DiscretePrimitiveStringFeature; +import LBJ2.classify.FeatureVector; +import ml.wolfe.examples.parisa.ConllRelation; + +public class RelationFeatures extends Classifier +{ + public RelationFeatures() + { + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "RelationFeatures"; + } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } + public String getOutputType() { return "discrete%"; } + + public FeatureVector classify(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 15 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FeatureVector __result; + __result = new FeatureVector(); + String __id; + String __value; + + __id = "" + (("WORD1:" + t.s.sentTokens.elementAt(t.wordId1).phrase)); + __value = "true"; + __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); + __id = "" + (("WORD2:" + t.s.sentTokens.elementAt(t.wordId2).phrase)); + __value = "true"; + __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); + return __result; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 15 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "RelationFeatures".hashCode(); } + public boolean equals(Object o) { return o instanceof RelationFeatures; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala new file mode 100755 index 00000000..4d685570 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -0,0 +1,179 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 + +import _root_.java.util + +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.SimpleModel +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.ERqInstancePL +import edu.illinois.cs.cogcomp.sl.core.{IInstance, IStructure} +import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} + + +object RunnerPL { + /** + * This modifies the two lists given two it. They are initialized. + * + // * @param sclist + // * @param outlist + // * @param fname + * @throws java.io.FileNotFoundException + */ +var lexm: Lexiconer = new Lexiconer() + /*def readX(cr:Conll04_InstanceReader):List[IInstance]={ + var i: Int = 0 + val sclist: List[IInstance]=new ArrayList[IInstance] + while (i < 100){//cr.instances.size){ + val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) + sclist.add(newqi) + i=i+1 + } + sclist + }*/ + def readXY(cr:Conll04_ReaderNew, outlist: List[IStructure], sclist: List[IInstance], l:Int,u:Int){ + + var i= l + while (i < u){//cr.instances.size){ + val newqi: ERqInstancePL = new ERqInstancePL(cr.relations.elementAt(i)) + sclist.add(newqi) + var a: Labels=new Labels() + val pair=cr.relations.elementAt(i); + a.E1Label=pair.s.sentTokens.elementAt(pair.wordId1).entType.toLowerCase(); + a.E2Label=pair.s.sentTokens.elementAt(pair.wordId2).entType.toLowerCase(); + a.RelLabel=pair.relType.toLowerCase(); + val cs: ERiStructurePL = new ERiStructurePL(newqi, a) + outlist.add(cs) + i=i+1 + } + } + /*def readY(cr:Conll04_InstanceReader):List[IStructure]={ + var i: Int = 0 + val outlist: List[IStructure]=new util.ArrayList[IStructure] + while (i < 100){//cr.instances.size){ + val a: Nodevalues=new Nodevalues() + a.a=(cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) + val cs: ERiStructure = new ERiStructure(cr.instances.elementAt(i), a.a) + outlist.add(cs) + i=i+1 + } + outlist + } +*/ + + def trainSSVM(modelname: String, cr:Conll04_ReaderNew): String = { + + var sclist: List[IInstance]= new util.ArrayList[IInstance]//=readX(cr) + var outlist: List[IStructure] = new util.ArrayList[IStructure]//readY(cr) + readXY(cr,outlist,sclist,0,10) + //cr=null + // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-train" + lexm.setAllowNewFeatures(false) + val sp: StructuredProblem = new StructuredProblem + sp.input_list = sclist + sp.output_list = outlist + val para: JLISParameters = new JLISParameters + para.total_number_features = 3*lexm.totalNumofFeature + para.c_struct = 1 + para.check_inference_opt = false + val si: iERjavaInferencePL = new iERjavaInferencePL + val learner: L2LossJLISLearner = new L2LossJLISLearner + val learned_wv: WeightVector = learner.trainStructuredSVM(si, sp, para) + val model: SimpleModel = new SimpleModel + model.wv = learned_wv + model.s_finder = new iERjavaInferencePL + model.lm = lexm + val iom: JLISModelIOManager = new JLISModelIOManager + iom.saveModel(model, modelname) + return modelname + } + + def testSequenceSSVM(model_name: String,cr:Conll04_ReaderNew) { + val iom: JLISModelIOManager = new JLISModelIOManager + val model: SimpleModel = iom.loadModel(model_name).asInstanceOf[SimpleModel] + RunnerPL.lexm = model.lm + val learned_wv: WeightVector = model.wv + val inference_proc: iERjavaInferencePL = model.s_finder.asInstanceOf[iERjavaInferencePL] + // var cr = new Conll04_RelationReader("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp") + var sclist: List[IInstance]= new util.ArrayList[IInstance]//=readX(cr) + var outlist: List[IStructure] = new util.ArrayList[IStructure]//readY(cr) + readXY(cr,outlist,sclist,11,20) + // cr=null + + // var sclist: List[IInstance]=readX(cr) + //var outlist: List[IStructure] = readY(cr) + // val sclist: List[IInstance] = new ArrayList[IInstance] + //val outlist: List[IStructure] = new ArrayList[IStructure] + // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-test" + //readData(sclist, outlist, fname) + val sp: StructuredProblem = new StructuredProblem + sp.input_list = sclist + sp.output_list = outlist + printTestACC(sp, inference_proc, learned_wv) + } + private def printTestACC(sp: StructuredProblem, s_finder: AbstractLossSensitiveStructureFinder, ssvm_wv: WeightVector) { + var tp: Double = 0 + var fp: Double = 0 + var tn: Double = 0 + var fn: Double = 0 + var total: Double = 0.0 + + var i: Int = 0 + while (i < sp.input_list.size) { + val gold: ERiStructurePL = sp.output_list.get(i).asInstanceOf[ERiStructurePL] + val prediction:ERiStructurePL = s_finder.getBestStructure(ssvm_wv, sp.input_list.get(i)).asInstanceOf[ERiStructurePL] + System.out.println(prediction) + //{ + var j: Int = 0 + + // while (j < gold.nodeValues.size) { + // { + val tempGold= gold.Rlables.LinirizLabels() + val tempPred=prediction.Rlables.LinirizLabels() + while (j getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { +//// + int blockSize= RunnerPL.lexm().totalNumofFeature(); + double[] globalWeight=wv.getWeightArray(); + double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); + double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); + double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); + WeightVector wvPer=new WeightVector(WeightPer,1); + WeightVector wvOrg=new WeightVector(WeightOrg,1); + WeightVector wvWF=new WeightVector(WeightWF,1); + // ERqInstancePL qi = (ERqInstancePL) input; + ml.wolfe.examples.parisa.iJLIS2.Labels temp=new ml.wolfe.examples.parisa.iJLIS2.Labels(); + ///// + ERiStructurePL goldStruct = (ERiStructurePL) gold; + + Integer goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("peop")) ? 1 : 0; + Double coefLosper1= Double.valueOf((1-2*(goldL))); + goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("peop")) ? 1 : 0; + Double coefLosper2= Double.valueOf((1-2*(goldL))); + goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("org")) ? 1 : 0; + Double coefLosorg1= Double.valueOf((1-2*(goldL))); + goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("org")) ? 1 : 0; + Double coefLosorg2= Double.valueOf((1-2*(goldL))); + goldL= (((ERiStructurePL) gold).Rlables.RelLabel().toLowerCase().contains("work")) ? 1 : 0; + Double coefLosWF= Double.valueOf((1-2*(goldL))); +// double loss; + ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); + Double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv)+coefLosper1; + Double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv)+coefLosper2; + Double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv)+coefLosorg1; + Double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv)+coefLosorg2; + Double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv)+coefLosWF; + + try{ + GRBEnv env = new GRBEnv("mip1.log"); + GRBModel model = new GRBModel(env); + //create variables + GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); + GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); + GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); + GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); + GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); + // integrate the new variables + model.update(); + //Set objective maximize fn(x).per + GRBLinExpr expr= new GRBLinExpr(); + expr.addTerm(coefper1,per1); + expr.addTerm(coefper2,per2); + expr.addTerm(coeforg1,org1); + expr.addTerm(coeforg2,org2); + expr.addTerm(coefWF,WF); + model.setObjective(expr,GRB.MAXIMIZE); + //add constraints + expr=new GRBLinExpr(); + expr.addTerm(1,per1); + expr.addTerm(1,org1); + model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); + + expr=new GRBLinExpr(); + expr.addTerm(1,per2); + expr.addTerm(1,org2); + model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); + + + expr=new GRBLinExpr(); + expr.addTerm(-1,per1); + expr.addTerm(1,WF); + model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); + + expr=new GRBLinExpr(); + expr.addTerm(-1,org2); + expr.addTerm(1,WF); + model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); + + model.optimize(); + double x=per1.get(GRB.DoubleAttr.X); + //addBooleanVariabl(2.0); + + java.lang.String x1=(x>0.5)? "peop":"npeop"; + x=per2.get(GRB.DoubleAttr.X); + java.lang.String x2=(x>0.5)? "peop":"npeop"; + + if (x1.equals("npeop")){ + x=org1.get(GRB.DoubleAttr.X); + x1=(x>0.5)? "org":"norg";} + if (x2.equals("npeop")){ + x=org2.get(GRB.DoubleAttr.X); + x2=(x>0.5)? "org":"norg";} + + x=WF.get(GRB.DoubleAttr.X); + java.lang.String x3=(x>0.5)? "work_for":"nwf"; + + // x=org2.get(GRB.DoubleAttr.X); + maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; + model.dispose(); + env.dispose(); + + } + catch (GRBException e) + { + System.out.println("Error code: " + e.getErrorCode() + ". " + + e.getMessage()); + } + // Return structure with highest score+loss, and loss of this structure + return new Pair(maxC, getHammingLoss(maxC, goldStruct)); + } + + public double getlocalLoss(String hyp, String gold) { + double loss = 0; + //double E2loss=0; + //double Rloss=0; + if (hyp.equals(gold)) + loss = 0; + else + loss = 1; + + //if (hyp.Rlables.E2Label().equals(gold.Rlables.E2Label())) + // E2loss=0; + //else + // E2loss=1; + + + /*if (hyp.nodeValues==gold.nodeValues) + loss=0; + else + loss=1; + */ //return ((E1loss+E2loss)/2); + return loss; + } + + public double getHammingLoss(ERiStructurePL hyp, ERiStructurePL gold){ + double E1loss = 0; + double E2loss=0; + double Rloss=0; + if (hyp.Rlables.E1Label().equals(gold.Rlables.E1Label())) + E1loss=0; + else + E1loss=1; + + if (hyp.Rlables.E2Label().equals(gold.Rlables.E2Label())) + E2loss=0; + else + E2loss=1; + + + if (hyp.Rlables.RelLabel().equals(gold.Rlables.RelLabel())) + Rloss=0; + else + Rloss=1; + + /*if (hyp.nodeValues==gold.nodeValues) + loss=0; + else + loss=1; + */ return ((E1loss+E2loss+Rloss)/3); + } + + /** + * This is for prediction. + */ + // @Override + public IStructure getBestStructureGurobiHook(WeightVector wv, IInstance input) throws Exception { //using GurobiHook + int blockSize=RunnerPL.lexm().totalNumofFeature(); + double[] globalWeight=wv.getWeightArray(); + double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); + double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); + double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); + WeightVector wvPer=new WeightVector(WeightPer,1); + WeightVector wvOrg=new WeightVector(WeightOrg,1); + WeightVector wvWF=new WeightVector(WeightWF,1); + // ERqInstancePL qi = (ERqInstancePL) input; + // List options = getOptions(qi); + + // double max = Double.NEGATIVE_INFINITY; + //double score; + ml.wolfe.examples.parisa.iJLIS2.Labels temp=new Labels(); + ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); + + + double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv); + double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv); + double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv); + double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv); + double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv); + //try + { + GurobiHook myGurobi=new GurobiHook(); + double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; + int[] vars=new int[coeff.length]; + for (int i = 0; i < coeff.length; i++) { + //System.out.println("adding: i : +" + coeff[i]); + vars[i]= myGurobi.addBooleanVariable(coeff[i]); + + } + + + // GRBEnv env = new GRBEnv("mip1.log"); + // GRBModel model = new GRBModel(env); model. + //create variables + // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); + // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); + // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); + // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); + // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); + + // integrate the new variables + // model.update(); + //Set objective maximize fn(x).per + // GRBLinExpr expr= new GRBLinExpr(); + + // expr.addTerm(coefper1,per1); + // expr.addTerm(coefper2,per2); + // expr.addTerm(coeforg1,org1); + //expr.addTerm(coeforg2,org1); + //expr.addTerm(coefWF,WF); + // model.setObjective(expr,GRB.MAXIMIZE); + // per(i)=> ~org(i) + // work-for(i,j)=>per(i)and org(j) + + //add constraints + double coeffc1[]={1,0,1,0,0}; + myGurobi.addLessThanConstraint(vars,coeffc1,1); + double coeffc2[]={0,1,0,1,0}; + myGurobi.addLessThanConstraint(vars,coeffc2,1); + double coeffc3[]={-1,0,0,0,1}; + myGurobi.addLessThanConstraint(vars,coeffc3,0); + double coeffc4[]={0,0,0,-1,1}; + myGurobi.addLessThanConstraint(vars,coeffc4,0); + + // expr=new GRBLinExpr(); + // expr.addTerm(1,per1); + // expr.addTerm(1,org1); + // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); + + //expr=new GRBLinExpr(); + //expr.addTerm(1,per2); + //expr.addTerm(1,org2); + //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); + + // expr=new GRBLinExpr(); + // expr.addTerm(-1,per1); + // expr.addTerm(1,WF); + // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); + + // expr=new GRBLinExpr(); + // expr.addTerm(-1,org2); + // expr.addTerm(1,WF); + // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); + + + // model.optimize(); + + myGurobi.setMaximize(true); + boolean solved = false; + try { + solved = myGurobi.solve(); + } catch (Exception e) { + e.printStackTrace(); + } + if (!solved) { + System.out.println("ILP solver failed"); + // System.exit(0); + } + + // read the solution + + // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); + java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; + // x=per2.get(GRB.DoubleAttr.X); + java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; + + if (x1.equals("npeop")){ + // x=org1.get(GRB.DoubleAttr.X); + x1=myGurobi.getBooleanValue(2)? "org":"norg";} + if (x2.equals("npeop")){ + // x=org2.get(GRB.DoubleAttr.X); + x2=myGurobi.getBooleanValue(3)? "org":"norg";} + // x=WF.get(GRB.DoubleAttr.X); + java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; + + // x=org2.get(GRB.DoubleAttr.X); + maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; + // model.dispose(); + // env.dispose(); + } + // catch (GRBException e) + // { + // System.out.println("Error code: " + e.getErrorCode() + ". " + + // e.getMessage()); + // } + return maxC; + } + + + + + + + public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) throws Exception { + int blockSize=RunnerPL.lexm().totalNumofFeature(); + double[] globalWeight=wv.getWeightArray(); + double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); + double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); + double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); + WeightVector wvPer=new WeightVector(WeightPer,1); + WeightVector wvOrg=new WeightVector(WeightOrg,1); + WeightVector wvWF=new WeightVector(WeightWF,1); + // ERqInstancePL qi = (ERqInstancePL) input; + // List options = getOptions(qi); + + // double max = Double.NEGATIVE_INFINITY; + //double score; + ml.wolfe.examples.parisa.iJLIS2.Labels temp=new Labels(); + ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); + + + Double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv); + Double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv); + Double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv); + Double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv); + Double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv); + try{ + GRBEnv env = new GRBEnv("mip1.log"); + GRBModel model = new GRBModel(env); + //create variables + GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); + GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); + GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); + GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); + GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); + + // integrate the new variables + model.update(); + //Set objective maximize fn(x).per + GRBLinExpr expr= new GRBLinExpr(); + expr.addTerm(coefper1,per1); + expr.addTerm(coefper2,per2); + expr.addTerm(coeforg1,org1); + expr.addTerm(coeforg2,org1); + expr.addTerm(coefWF,WF); + model.setObjective(expr,GRB.MAXIMIZE); + // per(i)=> ~org(i) + // work-for(i,j)=>per(i)and org(j) + //add constraints + expr=new GRBLinExpr(); + expr.addTerm(1,per1); + expr.addTerm(1,org1); + model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); + + expr=new GRBLinExpr(); + expr.addTerm(1,per2); + expr.addTerm(1,org2); + model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); + + expr=new GRBLinExpr(); + expr.addTerm(-1,per1); + expr.addTerm(1,WF); + model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); + + expr=new GRBLinExpr(); + expr.addTerm(-1,org2); + expr.addTerm(1,WF); + model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); + + + model.optimize(); + // read the solution + double x=per1.get(GRB.DoubleAttr.X); + java.lang.String x1=(x>0.5)? "peop":"npeop"; + x=per2.get(GRB.DoubleAttr.X); + java.lang.String x2=(x>0.5)? "peop":"npeop"; + + if (x1.equals("npeop")){ + x=org1.get(GRB.DoubleAttr.X); + x1=(x>0.5)? "org":"norg";} + if (x2.equals("npeop")){ + x=org2.get(GRB.DoubleAttr.X); + x2=(x>0.5)? "org":"norg";} + x=WF.get(GRB.DoubleAttr.X); + java.lang.String x3=(x>0.5)? "work_for":"nwf"; + + // x=org2.get(GRB.DoubleAttr.X); + maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; + model.dispose(); + env.dispose(); + } + catch (GRBException e) + { + System.out.println("Error code: " + e.getErrorCode() + ". " + + e.getMessage()); + } + return maxC; + } + @Override + public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { //using GurobiHook + int blockSize=RunnerPL.lexm().totalNumofFeature(); + double[] globalWeight=wv.getWeightArray(); + double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); + double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); + double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); + WeightVector wvPer=new WeightVector(WeightPer,1); + WeightVector wvOrg=new WeightVector(WeightOrg,1); + WeightVector wvWF=new WeightVector(WeightWF,1); + ml.wolfe.examples.parisa.iJLIS2.JointER JE=new JointER(((ERqInstancePL) input).pair); + ConllRelation head = ml.wolfe.examples.parisa.iJLIS2.JointER.findHead((ConllRelation) ((ERqInstancePL) input).pair); + ml.wolfe.examples.parisa.iJLIS2.JointER inference = (JointER) InferenceManager.get("ml.wolfe.examples.parisa.iJLIS2.JointER", head); + + if (inference == null) + { + inference = new ml.wolfe.examples.parisa.iJLIS2.JointER(head); + InferenceManager.put(inference); + } + + String result = null; + ml.wolfe.examples.parisa.iJLIS2.work_forClassifier __work_forClassifier = new ml.wolfe.examples.parisa.iJLIS2.work_forClassifier(); + try { + result = inference.valueOf(__work_forClassifier, ((ERqInstancePL) input).pair); + } + catch (Exception e) + { + System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); + e.printStackTrace(); + System.exit(1); + } + + //return result; + //JointER$subjectto JEc=new JointER$subjectto(); + //JEc.makeConstraint(((ERqInstancePL) input).pair); + //((ERqInstancePL) input).pair + // ERqInstancePL qi = (ERqInstancePL) input; + // List options = getOptions(qi); + + // double max = Double.NEGATIVE_INFINITY; + //double score; + ml.wolfe.examples.parisa.iJLIS2.Labels temp=new Labels(); + ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); +/////// + + + double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv); + double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv); + double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv); + double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv); + double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv); + //try + { + GurobiHook myGurobi=new GurobiHook(); + double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; + int[] vars=new int[coeff.length]; + for (int i = 0; i < coeff.length; i++) { + //System.out.println("adding: i : +" + coeff[i]); + vars[i]= myGurobi.addBooleanVariable(coeff[i]); + + } + + + // GRBEnv env = new GRBEnv("mip1.log"); + // GRBModel model = new GRBModel(env); model. + //create variables + // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); + // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); + // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); + // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); + // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); + + // integrate the new variables + // model.update(); + //Set objective maximize fn(x).per + // GRBLinExpr expr= new GRBLinExpr(); + + // expr.addTerm(coefper1,per1); + // expr.addTerm(coefper2,per2); + // expr.addTerm(coeforg1,org1); + //expr.addTerm(coeforg2,org1); + //expr.addTerm(coefWF,WF); + // model.setObjective(expr,GRB.MAXIMIZE); + // per(i)=> ~org(i) + // work-for(i,j)=>per(i)and org(j) + + //add constraints + double coeffc1[]={1,0,1,0,0}; + myGurobi.addLessThanConstraint(vars,coeffc1,1); + double coeffc2[]={0,1,0,1,0}; + myGurobi.addLessThanConstraint(vars,coeffc2,1); + double coeffc3[]={-1,0,0,0,1}; + myGurobi.addLessThanConstraint(vars,coeffc3,0); + double coeffc4[]={0,0,0,-1,1}; + myGurobi.addLessThanConstraint(vars,coeffc4,0); + + // expr=new GRBLinExpr(); + // expr.addTerm(1,per1); + // expr.addTerm(1,org1); + // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); + + //expr=new GRBLinExpr(); + //expr.addTerm(1,per2); + //expr.addTerm(1,org2); + //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); + + // expr=new GRBLinExpr(); + // expr.addTerm(-1,per1); + // expr.addTerm(1,WF); + // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); + + // expr=new GRBLinExpr(); + // expr.addTerm(-1,org2); + // expr.addTerm(1,WF); + // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); + + + // model.optimize(); + + myGurobi.setMaximize(true); + boolean solved = false; + try { + solved = myGurobi.solve(); + } catch (Exception e) { + e.printStackTrace(); + } + if (!solved) { + System.out.println("ILP solver failed"); + // System.exit(0); + } + + // read the solution + + // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); + java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; + // x=per2.get(GRB.DoubleAttr.X); + java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; + + if (x1.equals("npeop")){ + // x=org1.get(GRB.DoubleAttr.X); + x1=myGurobi.getBooleanValue(2)? "org":"norg";} + if (x2.equals("npeop")){ + // x=org2.get(GRB.DoubleAttr.X); + x2=myGurobi.getBooleanValue(3)? "org":"norg";} + // x=WF.get(GRB.DoubleAttr.X); + java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; + + // x=org2.get(GRB.DoubleAttr.X); + maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; + // model.dispose(); + // env.dispose(); + } + // catch (GRBException e) + // { + // System.out.println("Error code: " + e.getErrorCode() + ". " + + // e.getMessage()); + // } + return maxC; + } + /*public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + infer.FirstOrderConstraint __result = new infer.FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(PersonClassifier, t.e1), "" + (true)); + LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +*/ + /** + * Given this QueryInstance, what are the options for responses? + * This simple method just enumerates all possibilities. (in this + * contrived example there are 8 total) + * + * @param qi + * @return + */ + + +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java new file mode 100755 index 00000000..933d88fb --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java @@ -0,0 +1,205 @@ +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Vector; + + +//import jointentityrelationextraction. +//import edu.illinois.cs.cogcomp.datastruct; +import edu.illinois.cs.cogcomp.core.io.LineIO; +//import ConllRawSentence; +//import ConllReader.ConllRelation; +//import per.Conll04Reader; +//import ConllReader.ConllRawToken; +import edu.illinois.cs.cogcomp.lbjava.parse.Parser; +//import .illinois.cs.cogcomp.tutorial.Document; + +public class Conll04_InstanceReader implements Parser { + public Vector instances; + public Vector sentences; + public Vector relations; + + public String[] entityLabels,relLabels; + private int currentInstanceId; + + + public Conll04_InstanceReader(String filename){ + instances=new Vector(); + relations=new Vector(); + sentences=new Vector(); + entityLabels=new String[0]; + relLabels=new String[0]; +// } + + + //public void readData(String filename) throws Exception { + //BufferedReader br=new BufferedReader(new FileReader(filename)); + List lines = null; + try { + lines = LineIO.read(filename); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + String line; + String[] tokens; + + + ConllRawToken c=new ConllRawToken(); + + ConllRelation r; + int currSentId=0; + boolean sentEnd=false; + ConllRawSentence sent=new ConllRawSentence(currSentId); + + ArrayList entityal = new ArrayList(); + ArrayList relal = new ArrayList(); + + boolean relationSeen=false; + int sentindex = 0; + while(sentindex < lines.size()){ + line = lines.get(sentindex); + sentindex ++; + + //System.out.println(sentindex + " " + line); + if(line.isEmpty()){ + sentEnd=true; + +/* if(!sentEnd){ + currSentId++; + sentEnd=true; + + sentences.add(sent); + + sent=new ConllRawSentence(currSentId); + }*/ + continue; + } + + tokens=line.split("\t|\n"); + int s=tokens.length; + if(s==3){ + relationSeen=true; + r=new ConllRelation(); +// r.sentId1=currSentId-1; +// r.sentId2=currSentId-1; + r.wordId1=Integer.parseInt(tokens[0]); + r.wordId2=Integer.parseInt(tokens[1]); + r.relType=tokens[2]; + relations.add(r); + sent.addRelations(r); +// sentences.elementAt(sentences.size()-1).addRelations(r); + if(!relal.contains(tokens[2])){ + relal.add(tokens[2]); + } + } + else{ + //System.out.println("tokens[1]="+tokens[1]+"done"); + if(sentEnd){ + //if(!relationSeen) + { + sentences.add(sent); +/* if(currSentId < 700) + System.out.println("sid:" + currSentId); + else System.out.println("sid:" + (currSentId + 51)); + for(int ind = 0;ind < sent.sentTokens.size();ind ++) + System.out.print(sent.sentTokens.get(ind).phrase + " "); + System.out.println(); + */ + currSentId++; + } + sent=new ConllRawSentence(currSentId); + } + + c=new ConllRawToken(); + +/* if(currSentId < 700) + assert (currSentId == Integer.parseInt(tokens[0])); + else + { + assert(currSentId == Integer.parseInt(tokens[0]) - 51); + if(currSentId != Integer.parseInt(tokens[0]) - 51) + System.out.println("fuck you here"); + }*/ + + c.entType=tokens[1]; + c.sentId=currSentId; + c.wordId=Integer.parseInt(tokens[2]); + c.setPOS(tokens[4]); + c.setPhrase(tokens[5]); + + sent.addTokens(c); + if(!tokens[1].trim().equals("O")){ + instances.add(c); + sent.setCurrentTokenAsEntity(); + if(!entityal.contains(tokens[1])){ + entityal.add(tokens[1]); + } + } + + sentEnd=false; + relationSeen=false; + } + } + + entityLabels=entityal.toArray(entityLabels); + relLabels=relal.toArray(relLabels); + + } + + + public void printData(){ + System.out.println("printing total "+sentences.size()+" sentences"); + for(int i=0;i instances; + public Vector sentences; + public Vector relations; + + public String[] entityLabels,relLabels; + private int currentInstanceId; + + + public Conll04_RelationReader(String filename){ + instances=new Vector(); + relations=new Vector(); + sentences=new Vector(); + entityLabels=new String[0]; + relLabels=new String[0]; +// } + + + //public void readData(String filename) throws Exception { + //BufferedReader br=new BufferedReader(new FileReader(filename)); + List lines = null; + try { + lines = LineIO.read(filename); + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + String line; + String[] tokens; + + + ConllRawToken c=new ConllRawToken(); + + ConllRelation r; + int currSentId=0; + boolean sentEnd=false; + ConllRawSentence sent=new ConllRawSentence(currSentId); + + ArrayList entityal = new ArrayList(); + ArrayList relal = new ArrayList(); + + boolean relationSeen=false; + int sentindex = 0; + while(sentindex < lines.size()){ + line = lines.get(sentindex); + sentindex ++; + + //System.out.println(sentindex + " " + line); + if(line.isEmpty()){ + sentEnd=true; + +/* if(!sentEnd){ + currSentId++; + sentEnd=true; + + sentences.add(sent); + + sent=new ConllRawSentence(currSentId); + }*/ + continue; + } + + tokens=line.split("\t|\n"); + int s=tokens.length; + if(s==3){ + relationSeen=true; + r=new ConllRelation(); + r.sentId=currSentId; + //r.s=new ConllRawSentence(currSentId); + //r.sentId1=currSentId-1; + //r.sentId2=currSentId-1; + r.wordId1=Integer.parseInt(tokens[0]); + r.wordId2=Integer.parseInt(tokens[1]); + r.relType=tokens[2]; + relations.add(r); + // System.out.println("WORD1:"+r.s.sentTokens.elementAt(r.wordId1).phrase); + sent.addRelations(r); +// sentences.elementAt(sentences.size()-1).addRelations(r); + if(!relal.contains(tokens[2])){ + relal.add(tokens[2]); + } + } + else{ + //System.out.println("tokens[1]="+tokens[1]+"done"); + if(sentEnd){ + //if(!relationSeen) + { + sentences.add(sent); +/* if(currSentId < 700) + System.out.println("sid:" + currSentId); + else System.out.println("sid:" + (currSentId + 51)); + for(int ind = 0;ind < sent.sentTokens.size();ind ++) + System.out.print(sent.sentTokens.get(ind).phrase + " "); + System.out.println(); + */ + currSentId++; + } + sent=new ConllRawSentence(currSentId); + } + + c=new ConllRawToken(); + +/* if(currSentId < 700) + assert (currSentId == Integer.parseInt(tokens[0])); + else + { + assert(currSentId == Integer.parseInt(tokens[0]) - 51); + if(currSentId != Integer.parseInt(tokens[0]) - 51) + System.out.println("fuck you here"); + }*/ + + c.entType=tokens[1]; + c.sentId=currSentId; + c.wordId=Integer.parseInt(tokens[2]); + c.setPOS(tokens[4]); + c.setPhrase(tokens[5]); + + sent.addTokens(c); + if(!tokens[1].trim().equals("O")){ + instances.add(c); + sent.setCurrentTokenAsEntity(); + if(!entityal.contains(tokens[1])){ + entityal.add(tokens[1]); + } + } + + sentEnd=false; + relationSeen=false; + } + } + + entityLabels=entityal.toArray(entityLabels); + relLabels=relal.toArray(relLabels); + + for (int counter=0; counter sentTokens; + public Vector relations; + public int sentId; + public Vector entityIndices; + + public ConllRawSentence(int sentId){ + sentTokens = new Vector(); + relations= new Vector(); + entityIndices=new Vector(); + this.sentId=sentId; + } + + public void addTokens(ConllRawToken c){ + sentTokens.add(c); + } + + public void addRelations(ConllRelation r){ + relations.add(r); + } + + public void setCurrentTokenAsEntity(){ + entityIndices.add(sentTokens.size()-1); + } + + public Vector getEntitiesInSentence(){ + Vector entities=new Vector(); + for(int i=0;isentTokens.size()-1) break; + window[index]=sentTokens.elementAt(i+loc); +// String a=sentTokens.elementAt(i+loc).getPhrase(isLowerCase); +// window[index]="Window"+i+":"+a; + index++; + // window[index]="Window:"+a; + // index++; + } + return window; + } + + public void printEntities(){ + for(int i=0;i`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTzvwL#06ajMn`Ze=1*5>D}%srWh1Xg(lKMYrOfaU;_iMe|A{=kze-kEbhMHXb5>Z zDrPk5(PA5?k%iBUe6%Kc<7v)Q0pSq8UvOh>7mC`auT3jw?6*5;Ku*TOe!|?gDRt9d zKH5{({`mN<#>ZK_PxzMK?u$-=O?6(Irz8M{wU>X@OG5eZLL%Jt)V(pZFZpN-$DG`1`5&;3wLClD@U3FPR3MpSV)u^%UV zLSVxhJtl-ma2=O};Px!?c#PL?6A`COAo_YydjsyS;cLOke!F8Bo$YOX(?yKm`z^cw zzBBR4(z66v-xwH}Ge;MLOmd{aqMGXsl;UtEcV$gFLDths{9+feXvAoS)p7K+xckbW zyEtTM|GTg#gDZO0O-A|S3WrxGTTxJ4o4fKUO>nixp+k{kcr|R%wh7wkZ|nB-#guO)hs}ZC3tRA(Ykg^9d!e6*^LKzAtH1;C9S524u2uD^E zeZs^t)S8Phj`080$C{CawBt>k84Ab44~mHaN_B)@?sX@J#dWjaDpF+R%Z9+#jCixw z4UfNNdoHX}_(~Z*f}2$x{QJS3O;3ahX3|l)R^St@L`+7B@=RS1fPKCKDri2 z;0z5J{KV$=3+|nu_uOV_hTxT(JP`&k_`%o`cfaJ5M}bOA`D|t?fuvoL-YaU-TUDiU z(bHb-wnfZKq*Bw8)Ou~TP59s%RW3mjCmC0E~Rj&;0H5LX48O6V1?JO}*IV8PwS#Z=utMLL85$dk=EO=?N}H zOBLHYR^kxGN_dff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9TLe(6BYPl0()=Z9Vr13b^iH|;;HJWuT z5v_{%gD23Ce8Ux53gU@uXouybei^TuqP1|&4fwYJ@RA!h+Uw0sfrYY*%9We84-{K( z^QX+D+p5vy3%WiEr+Zay8gRqFDV5q~Kb?H8I8ah|78%?9TR9+*we2E&^6HRO=u|*M z7;$PD$;dj!NK3bv$-JYY1ObwYjN!Tbs7s`^M|)OjXHMK%dXv?s@?)Y`EeQi}oVb$( zoND(W4v6MkeIsme4Ozm{=bKFctLlC82DRrPIU|JsH{#D|8 zdG+sqGv}7w^{P+bT06t0e2U%nKDpxKQ_tAXDch$FT!HiwxR>f%`1QRXfUDbY?*-PV ztAmu^12_82&;0cG#v;*qQ-Na%=LK`OdGFA^Sr>f%vhu0oqL|CSE~#XvO|E-aGJC&p z|K;;pUxD*?ccyYZ>!@X$a)VEG^~uut*V-pXeScZKd~(>O>(P~ZySGfTTnZeEubz17 zXXr!ETQ{ck1XgW*otO0cVzI?p_u^L~R>w{Ew&|^W4csH#U%K~hqTbJE_ukmTkhdZ3cdzW_sTWr&2OjEbX)%TYUzr?pc zM8eg6{hs!@Zl_xdA3eNMC2A1lJKv}sbff}sXLoNMRq zY~6M5t=BK{)v5CqJ$>?D!(jFCx+4*nO{}|4@h-kMYra~$cJ;xXTlz9K%WnLBVvDgk zFfu=V*>+!bZEI6IuoeR@Gq@5NdC+Gy_X6O=`*)N7?`{6)2Y9n{?0v9HGRTF2VaZ8$ oh5&CyCJ_e2K_tj>po2(I0rXgs0B=?{kOU(TngZ!|pkWLQ0O#kO6#xJL literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java new file mode 100755 index 00000000..3e918413 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09DCA44C040148F55A9C9CD3894CF9D3DAE146DD50120A44F4E54A776A73913399E1ABB36411FDDD0EEB287D28AF8FAAC705724640D0BBD6445D07C04276B5E4136B83FB0F0490C650737E01905214467D0E1822C4A12570BB461CEB6F48639092C1587484433CF10AEBE7B784A689C15B48E71E6155FC325530B8F77C1BA6836C0993757F86859B357A47C29B851CAB601E9297589385F0FC91549EEE3840B32FF442E82B907AFE398D223D2E2B3E61AE2F26306D70734225D528BA27DB18F10325BDFF3AF561ADD7A90A3382C70D1E534E26909BB5E80D7C9C2F4607957D049CFF203A95FC0166100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class LocClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = LocClassifier.class.getResource("LocClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate LocClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = LocClassifier.class.getResource("LocClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate LocClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (LocClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.test.ex"); } + public static boolean isTraining; + public static LocClassifier instance; + + public static LocClassifier getInstance() + { + loadInstance(); + return instance; + } + + private LocClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "LocClassifier"; + setEncoding(null); + setLabeler(new locLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public LocClassifier() + { + super("LocClassifier"); + isClone = true; + } + + public LocClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public LocClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(LocClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(LocClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(LocClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "LocClassifier"; + setLabeler(new locLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: LocClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + LocClassifier classifier = new LocClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "LocClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof LocClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..8f3e067c766ae6d5460ecdbfc25a336cf3831047 GIT binary patch literal 17618 zcmYhDdmz*O`~UCimRiMKk;>`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTzvwL#06ajMn`Ze=1*5>D}%srWh1Xg(lKMYrOfaU;_iMe|A{=kze-kEbhMHXb5>Z zDrPk5(PA5?k%iBUe6%Kc<7v)Q0pSq8UvOh>7mC`auT3jw?6*5;Ku*TOe!|?gDRt9d zKH5{({`mN<#>ZK_PxzMK?u$-=O?6(Irz8M{wU>X@OG5eZLL%Jt)V(pZFZpN-$DG`1`5&;3wLClD@U3FPR3MpSV)u^%UV zLSVxhJtl-ma2=O};Px!?c#PL?6A`COAo_YydjsyS;cLOke!F8Bo$YOX(?yKm`z^cw zzBBR4(z66v-xwH}Ge;MLOmd{aqMGXsl;UtEcV$gFLDths{9+feXvAoS)p7K+xckbW zyEtTM|GTg#gDZO0O-A|S3WrxGTTxJ4o4fKUO>nixp+k{kcr|R%wh7wkZ|nB-#guO)hs}ZC3tRA(Ykg^9d!e6*^LKzAtH1;C9S524u2uD^E zeZs^t)S8Phj`080$C{CawBt>k84Ab44~mHaN_B)@?sX@J#dWjaDpF+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Q0O#kO6#xJL literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..108e5ef0ed31dac675ed95d4361fd5e0421c530b GIT binary patch literal 17129 zcmYg%dpOhm|9^GoPAYCilCnE)<&em33Ck*>@4feWKA(@%)9&_f`{njXN=okeUxOQD9eeqoOx){sRUpD6R zAo$1#n|20fiuOH$L#JVl!TkK-n(-RJ?k;ol*w@1L#dTr+Me4dz z+EVOm`)G~b;fZ@1NakhGUcs%F z#3A>;Es>i#`_cABpGGQklg`ka=^Z;OQ5unC_%*S%L=M@#ye@<*^xEDC?n-=x;aIlv zZkB{VEZ>{XO{R-(=-MQ1MgEDa0H1F>jzZFZJq%h-_ikij7Sn1j$CPDaUj&;q5Ffpe zv^9V}t`C>98i8o(<``uUDoLe-cdCB0(BCZ$zmvn|P)t`#s^*jfM1eT@6Db^vL%NRX zuLcj&^8^PJ<^-$8aHO*8m-wnZCEw@m6Uy8}T9ly7?u|1C3yhKA?waog8oFN%+|y(p z1hiJv!P<|clxaSLPB_P8ACWTel^3+^qaFDp{X=GbX(pJOHv=+3UQ5{Czt?IQD%OQ40cQ4!gIsTk}Hr#&!G?@-Zz2=49e)Tf*pUqrw z`>G%76!Nd9a2*BIU zmnCKVZRIHg{oRJVos&!m`t9D^b7z&9ce}%$?S$jBu)65os`qwr z%;9(Hr`wCQ?P5#UCgI!NEChW_LvcRFt5mcSI*)YB%M1&M#B2W$2>v+Sh(PC`Hw#ne zD>yT z%yL`xc<7jislSM9P%c?hBZdqu7&<;uBG~$juDdOg8)%yjGuJHx64C{^kC4m~@e{tUF&6}-4kerpa+H=&IqI=Gc ziw_L&Q};Xc63Hrg>6xde=YTUvA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fcv-4Ea zw%Y~&K!?nfi7C+^ieXHaF#(SxT&{YxQaRy9B{c@VdU?5;+%?j=r~~(`KE|+Tb<@Xw z$S&;^hex{)h3Y!icHR%ZwhT(1TvfJ5B5)mB`n25+~+@& zyW9&m(`H&GCJl*U9<#rtdmlg+Zo`{06Nkrq5N@omcXcd8QE8?z1$cS?#sZPu_DcOa z)at{{EA|zTX?c!ewu>Qhz5U^~JvdlV4kAmVnAH&98!L0BwA);{g6>e}jGxm6y!%r}iiN_`mW=g&L$3_L)RS0P|%B#>hcb?Tp5k ze6YI`S2HS>3Xu2wTHRDhw9SQu-4Kb^A-hn!+Xp27-%^^pv@)F-7?zx5X9)0SWD;RO hoKJx)2Rfeu6+lm`2=HcQ14%Ffp(&7_2Q-X<0RSK0;`jgn literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java new file mode 100755 index 00000000..57cb81ea --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09BCE43C04C054F75CACA8E2862C3ABA2C20596524AA4545851B14EEC8B9C099AD32BD1AC34CFB311DF506B75AB747EED89C282931C64B54E4F58E9487191DC2DE319E9D24837ED2E1F95A7260F90CDC9346245601D67D8B3AC03852E6169CE9CF37548E38291CE55E00C4748F30437DFAF0C6E8C186B48174E65577270AAB71D8F6878A7D2937A225AEB747CA3C9A33D02A5AA90CCA1059183A1C139770F4505D8EEED941B5A8F84A18A8BA0F7F94C6499D2E838E61A99E5CC1CBB41A7623B138BA9EC6E0F30E46EBAF74FB2A4BCF075C0E055C46DFB4A25D81A4B3E116B91CBC0E079D4304C1F71093AD0A51F6100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class OrganizationClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate OrganizationClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate OrganizationClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (OrganizationClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.test.ex"); } + public static boolean isTraining; + public static OrganizationClassifier instance; + + public static OrganizationClassifier getInstance() + { + loadInstance(); + return instance; + } + + private OrganizationClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "OrganizationClassifier"; + setEncoding(null); + setLabeler(new orgLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public OrganizationClassifier() + { + super("OrganizationClassifier"); + isClone = true; + } + + public OrganizationClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public OrganizationClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(OrganizationClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(OrganizationClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(OrganizationClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "OrganizationClassifier"; + setLabeler(new orgLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: OrganizationClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + OrganizationClassifier classifier = new OrganizationClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "OrganizationClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof OrganizationClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..108e5ef0ed31dac675ed95d4361fd5e0421c530b GIT binary patch literal 17129 zcmYg%dpOhm|9^GoPAYCilCnE)<&em33Ck*>@4feWKA(@%)9&_f`{njXN=okeUxOQD9eeqoOx){sRUpD6R zAo$1#n|20fiuOH$L#JVl!TkK-n(-RJ?k;ol*w@1L#dTr+Me4dz z+EVOm`)G~b;fZ@1NakhGUcs%F z#3A>;Es>i#`_cABpGGQklg`ka=^Z;OQ5unC_%*S%L=M@#ye@<*^xEDC?n-=x;aIlv zZkB{VEZ>{XO{R-(=-MQ1MgEDa0H1F>jzZFZJq%h-_ikij7Sn1j$CPDaUj&;q5Ffpe zv^9V}t`C>98i8o(<``uUDoLe-cdCB0(BCZ$zmvn|P)t`#s^*jfM1eT@6Db^vL%NRX zuLcj&^8^PJ<^-$8aHO*8m-wnZCEw@m6Uy8}T9ly7?u|1C3yhKA?waog8oFN%+|y(p z1hiJv!P<|clxaSLPB_P8ACWTel^3+^qaFDp{X=GbX(pJOHv=+3UQ5{Czt?IQD%OQ40cQ4!gIsTk}Hr#&!G?@-Zz2=49e)Tf*pUqrw z`>G%76!Nd9a2*BIU zmnCKVZRIHg{oRJVos&!m`t9D^b7z&9ce}%$?S$jBu)65os`qwr z%;9(Hr`wCQ?P5#UCgI!NEChW_LvcRFt5mcSI*)YB%M1&M#B2W$2>v+Sh(PC`Hw#ne zD>yT z%yL`xc<7jislSM9P%c?hBZdqu7&<;uBG~$juDdOg8)%yjGuJHx64C{^kC4m~@e{tUF&6}-4kerpa+H=&IqI=Gc ziw_L&Q};Xc63Hrg>6xde=YTUvA$^6)Dw{#Icvf@A{k7%9rUTUP_vxe4F0mKR;V@xl z{m<+leM`&`Z!xF5=pX!+{!oQb$Dn(Q2|qof=7X(Az8KC&%I6V{-vA}*%(jU0E=@R6 zIwS*vo@DUSg=z6&4b;*b5UBS*agVPCC&65e*&fUt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+Zo`{06Nkrq5N@omcXcd8QE8?z1$cS?#sZPu_DcOa z)at{{EA|zTX?c!ewu>Qhz5U^~JvdlV4kAmVnAH&98!L0BwA);{g6>e}jGxm6y!%r}iiN_`mW=g&L$3_L)RS0P|%B#>hcb?Tp5k ze6YI`S2HS>3Xu2wTHRDhw9SQu-4Kb^A-hn!+Xp27-%^^pv@)F-7?zx5X9)0SWD;RO hoKJx)2Rfeu6+lm`2=HcQ14%Ffp(&7_2Q-X<0RSK0;`jgn literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java new file mode 100755 index 00000000..448e033a --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java @@ -0,0 +1,93 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class OrganizationWorkFor extends ParameterizedConstraint +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + private static final OrganizationClassifier __OrganizationClassifier = new OrganizationClassifier(); + + public OrganizationWorkFor() { super("OrganizationWorkFor"); } + + public String getInputType() { return "ConllRelation"; } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + { + boolean LBJ2$constraint$result$0; + { + boolean LBJ2$constraint$result$1; + LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); + if (LBJ2$constraint$result$1) + LBJ2$constraint$result$0 = ("" + (__OrganizationClassifier.discreteValue(t.e2))).equals("" + (true)); + else LBJ2$constraint$result$0 = true; + } + if (!LBJ2$constraint$result$0) return "false"; + } + + return "true"; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "OrganizationWorkFor".hashCode(); } + public boolean equals(Object o) { return o instanceof OrganizationWorkFor; } + + public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FirstOrderConstraint __result = new FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__OrganizationClassifier, t.e2), "" + (true)); + LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1 GIT binary patch literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wbq`~EzB|NQ*r;g5Ok{k~q;^*mir4Ty(?+q=m5ixcS6mNmvN|TQ?APW&Ep4$&rXPO8B8PjEIZ>* zF#bBekk#TH^6C}x2%`!T7s6d|p^2aVwg2~7>bL8oBmJK?b4rp_qT*lqTMwltTtM>5 zI?%Tm58h^Imu}{Cm`w-p-=-P~MI#~Yad&r(lZ&IgpSSQV6r5R&dvacmY39S{c>Z0; z`Z$yW^?6voX5=)3Jhf@Hcp>TI>`9qwdm%%^9%rm86l=Y9KIw`YmA};RymAmo)s~wY zf6I40)*8d|X0dGkqT-aMOCqu}9FpZSdeV^{YgSu{xo|ZR@bRV79Si__xbGWbOvu$AF}tY3N0JfAgO zJ|#V=^)07+`i$UW00OCF_9~$9SkA;U%wws9i>v>gICuNIL>Ygb@1N_7XU|b+A5WmP zzw^~x5x7ZJT*)GT3rS-1ZOWxjp<`ymb#DFO z<6=l0H`wgJq1V48C2GFj8qDC?)T4cn9A5r*is1F89esJu7|N&;XY(w4i}Ck+Bx7qe z5pP=_|7thsa-ui0*D~yI+VH;r?iMIK!2Ls+aciCC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+3<6TASWoWSp3UDTM-!2}sf7u>d9I&)7y{Sux6Xv%SGFD-YN}<5SLyv+_e0!fCRFv9J>H)T`&bBkTpt>`SHfO(L>wC zlU6gZ$AX=8oAqP5$Q5p?YO?1+NkU+bU2KIr4bdfp4>F?J!3P6nKp2Ld_4<5FDRA{cD>iveIt>1qGh`k zq-DU`GqN2>J;6^MNc}?pySSJs8-dIdSHlhlhKChRbQy^x1>bB+)izyvhsP++4!<7a zi5v@;M;p%{62poH7;$C)dl`;*i!#zVgA~*RB*1a?<|=wGmQI}bEL`f@v`Ml3J=hdj zsbpHKu2MLGUt8 zU#`HB?Y^+UAXxG-c5`Jt=`clQzlk&v+#V6B>r|3dPiA%H2Go(k+4dj|f~ zX^vqPi3;ZN6$e&HFrBZ*4qS$7ET?;v{)I;vt;XO1^p%|JmGirvuTP;9?w>>lXnb&t5DX&zG5?$4!;`Nzi8@~c;HIJYJpdKPXM>ipW5ni%yl<#Yy8(= z0l+OJTvPXDe3#mF^-n<6nU@Fc7H_?DEc6|45NW2f>-k_{Ox}x}TD5rg`7qYUpZ*xQ zZO^$Mv*h{RO21zo+HYIAgO|=11un$&`aAhe^o_OWrZ2j>cDwOYW#BmiS@C~mYHmHT zo7=11sb1OUdo8#0^UZULbuT{MS*v#FBfnX*WI&rf1~Msa&z(X*$k1ExA0n0 z>b&PX=PlQ`2J!WKtiCk=ec0!StINF~-fXq>%>NS~;LXlauicdO$eDp*$w_vG0B=Sn i5eCG;Ajoo{gF#RM^q7zUZ&o&t1S1fd0%>s<5Dx%*;z&IJ literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java new file mode 100755 index 00000000..01529f7e --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09DCE43C04C048F55CAC98E1862CF4F45830A2DA48459041831714667DD469C6CBB2BD12024CBB3BA6F518BE86664FDC8F0AE48C80E984431F622AA68340293BD42E81B5C9F52D04C06B08B93788482C09F86DD3EB35489430770B56B06FDB324B94841E0296406A91E8D1DC5FBD30BA12B3A690D79AEAAEE3D845F094CF70E85FE35C8127AC5FD3A16DEE4995AB429BA50CAA109431B7589385F0FC91549EEE3940B32F50AD156394CF3726B203D269537B0DC2F26D06D7073039A611EA69BA53CF2819ADEEF19F2B0D6FBC40D9145E38E0FA127554C4D59324F172BC391C563D001BFF30A3599ED9C6100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class PersonClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = PersonClassifier.class.getResource("PersonClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate PersonClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = PersonClassifier.class.getResource("PersonClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate PersonClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (PersonClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.test.ex"); } + public static boolean isTraining; + public static PersonClassifier instance; + + public static PersonClassifier getInstance() + { + loadInstance(); + return instance; + } + + private PersonClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "PersonClassifier"; + setEncoding(null); + setLabeler(new personLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public PersonClassifier() + { + super("PersonClassifier"); + isClone = true; + } + + public PersonClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public PersonClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(PersonClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(PersonClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(PersonClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "PersonClassifier"; + setLabeler(new personLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: PersonClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + PersonClassifier classifier = new PersonClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "PersonClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof PersonClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1 GIT binary patch literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wbq`~EzB|NQ*r;g5Ok{k~q;^*mir4Ty(?+q=m5ixcS6mNmvN|TQ?APW&Ep4$&rXPO8B8PjEIZ>* zF#bBekk#TH^6C}x2%`!T7s6d|p^2aVwg2~7>bL8oBmJK?b4rp_qT*lqTMwltTtM>5 zI?%Tm58h^Imu}{Cm`w-p-=-P~MI#~Yad&r(lZ&IgpSSQV6r5R&dvacmY39S{c>Z0; z`Z$yW^?6voX5=)3Jhf@Hcp>TI>`9qwdm%%^9%rm86l=Y9KIw`YmA};RymAmo)s~wY zf6I40)*8d|X0dGkqT-aMOCqu}9FpZSdeV^{YgSu{xo|ZR@bRV79Si__xbGWbOvu$AF}tY3N0JfAgO zJ|#V=^)07+`i$UW00OCF_9~$9SkA;U%wws9i>v>gICuNIL>Ygb@1N_7XU|b+A5WmP zzw^~x5x7ZJT*)GT3rS-1ZOWxjp<`ymb#DFO z<6=l0H`wgJq1V48C2GFj8qDC?)T4cn9A5r*is1F89esJu7|N&;XY(w4i}Ck+Bx7qe z5pP=_|7thsa-ui0*D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{$Sv&4^}K~h|=&1 z=y@|K+3<6TASWoWSp3UDTM-!2}sf7u>d9I&)7y{Sux6Xv%SGFD-YN}<5SLyv+_e0!fCRFv9J>H)T`&bBkTpt>`SHfO(L>wC zlU6gZ$AX=8oAqP5$Q5p?YO?1+NkU+bU2KIr4bdfp4>F?J!3P6nKp2Ld_4<5FDRA{cD>iveIt>1qGh`k zq-DU`GqN2>J;6^MNc}?pySSJs8-dIdSHlhlhKChRbQy^x1>bB+)izyvhsP++4!<7a zi5v@;M;p%{62poH7;$C)dl`;*i!#zVgA~*RB*1a?<|=wGmQI}bEL`f@v`Ml3J=hdj zsbpHKu2MLGUt8 zU#`HB?Y^+UAXxG-c5`Jt=`clQzlk&v+#V6B>r|3dPiA%H2Go(k+4dj|f~ zX^vqPi3;ZN6$e&HFrBZ*4qS$7ET?;v{)I;vt;XO1^p%|JmGirvuTP;9?w>>lXnb&t5DX&zG5?$4!;`Nzi8@~c;HIJYJpdKPXM>ipW5ni%yl<#Yy8(= z0l+OJTvPXDe3#mF^-n<6nU@Fc7H_?DEc6|45NW2f>-k_{Ox}x}TD5rg`7qYUpZ*xQ zZO^$Mv*h{RO21zo+HYIAgO|=11un$&`aAhe^o_OWrZ2j>cDwOYW#BmiS@C~mYHmHT zo7=11sb1OUdo8#0^UZULbuT{MS*v#FBfnX*WI&rf1~Msa&z(X*$k1ExA0n0 z>b&PX=PlQ`2J!WKtiCk=ec0!StINF~-fXq>%>NS~;LXlauicdO$eDp*$w_vG0B=Sn i5eCG;Ajoo{gF#RM^q7zUZ&o&t1S1fd0%>s<5Dx%*;z&IJ literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java new file mode 100755 index 00000000..9bac6434 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java @@ -0,0 +1,93 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class PersonWorkFor extends ParameterizedConstraint +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + private static final PersonClassifier __PersonClassifier = new PersonClassifier(); + + public PersonWorkFor() { super("PersonWorkFor"); } + + public String getInputType() { return "ConllRelation"; } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + { + boolean LBJ2$constraint$result$0; + { + boolean LBJ2$constraint$result$1; + LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); + if (LBJ2$constraint$result$1) + LBJ2$constraint$result$0 = ("" + (__PersonClassifier.discreteValue(t.e1))).equals("" + (true)); + else LBJ2$constraint$result$0 = true; + } + if (!LBJ2$constraint$result$0) return "false"; + } + + return "true"; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "PersonWorkFor".hashCode(); } + public boolean equals(Object o) { return o instanceof PersonWorkFor; } + + public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FirstOrderConstraint __result = new FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__PersonClassifier, t.e1), "" + (true)); + LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java new file mode 100755 index 00000000..bb885a11 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java @@ -0,0 +1,90 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// discrete RelArgsClassifier(ConllRelation r) <- JointER(work_forClassifier) + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class RelArgsClassifier extends Classifier +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + + public RelArgsClassifier() + { + containingPackage = ""; + name = "RelArgsClassifier"; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "*", "*" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation head = JointER.findHead((ConllRelation) __example); + JointER inference = (JointER) InferenceManager.get("JointER", head); + + if (inference == null) + { + inference = new JointER(head); + InferenceManager.put(inference); + } + + String result = null; + + try { result = inference.valueOf(__work_forClassifier, __example); } + catch (Exception e) + { + System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); + e.printStackTrace(); + System.exit(1); + } + + return result; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "RelArgsClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof RelArgsClassifier; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java new file mode 100755 index 00000000..1cefef75 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java @@ -0,0 +1,66 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class RelationFeatures extends Classifier +{ + public RelationFeatures() + { + containingPackage = ""; + name = "RelationFeatures"; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete%"; } + + public FeatureVector classify(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + FeatureVector __result; + __result = new FeatureVector(); + String __id; + String __value; + + __id = "" + (("WORD1:" + t.s.sentTokens.elementAt(t.wordId1).phrase)); + __value = "true"; + __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); + __id = "" + (("WORD2:" + t.s.sentTokens.elementAt(t.wordId2).phrase)); + __value = "true"; + __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); + return __result; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "RelationFeatures".hashCode(); } + public boolean equals(Object o) { return o instanceof RelationFeatures; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java new file mode 100755 index 00000000..427e9b46 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000D4C814A02C034144FA234659086F20577D590D594F2013E825CFCF8629254A4EEEDA222EA606ED3ED56CC121B0713D7C066703AFEDA0981A7F76A8DE2AA8C9CFC34CB3515C1E0B7C281FA0B5A1A691E5F063C7E4E52F1F6A131B3F996F3137E6317B6F4941FD7A5450523FF18EF84D512E3B0EA6D8000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class locLabel extends Classifier +{ + public locLabel() + { + containingPackage = ""; + name = "locLabel"; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Loc", "nLoc" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'locLabel' defined on line 40 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Loc")) + { + return "Loc"; + } + else + { + return "nLoc"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "locLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof locLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java new file mode 100755 index 00000000..da2f14f2 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class orgLabel extends Classifier +{ + public orgLabel() + { + containingPackage = ""; + name = "orgLabel"; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Org", "nOrg" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'orgLabel' defined on line 64 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Org")) + { + return "Org"; + } + else + { + return "nOrg"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "orgLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof orgLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java new file mode 100755 index 00000000..2d599e25 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class personLabel extends Classifier +{ + public personLabel() + { + containingPackage = ""; + name = "personLabel"; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Per", "nPer" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'personLabel' defined on line 17 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Peop")) + { + return "Per"; + } + else + { + return "nPer"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "personLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof personLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java new file mode 100755 index 00000000..0dba1dad --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class workLabel extends Classifier +{ + public workLabel() + { + containingPackage = ""; + name = "workLabel"; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Works", "nWorks" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'workLabel' defined on line 88 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRelation t = (ConllRelation) __example; + + if (t.relType.equalsIgnoreCase("Work_For")) + { + return "Works"; + } + else + { + return "nWorks"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "workLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof workLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..56277adf24ea6a01e937e2ecbdabe4c4d36648e1 GIT binary patch literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0r5VC%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r{v@(Kj{ceRqHJKOaN%_!pnOl(Xkg&6UIrIsVG%5sdk^r`TcEO&mS5^3Ror zuJ?BPyxF+1a%1mx1B)eg*LR)#_3&TsESGQm;m)()*9E0qKeE*5>hi>$g+VKJueYjo z1Wsminx!wbTr6*O{fvh=dZ6@$m?$n%zuXZc9_J^0>F7uahNK7%s!xYO9r;x^g79Rx zC~u*|=pStn4VDfy&!n#|yCw6QUEu@@E6D-CG<-ZDq^Ca$#%RAi^E9iC;5{ZV(nbwl ze!5*D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RO=?SEmk7Q|)2P=e7*;PK1 zb8uKt7V6L7wQ<6y0>UedGzSY6nQA+}`-%Oh)OS|km6xwSgpJhs3FK#1IjeSfGX%N< zyf`4IcN3pFwE25S4@uxocE;n3k!ZuxDkJ_ye;GYn^e* zo!9-ze|;K*H22BNP`ZU!$b$Nc3!0WQo zJx#lWvVLirF4c3$=2M!^X~)pgPqPWDQFDHJ@&xyDhOgI+3*pJW%Wqsjp90<9Ypdt7 zL3lQvEC>+>Ed6T?b!$!e*fC*1Ou6}d%x9O<55~$Zo|%EM9q|E%$OCicfT^^~&xRuv zCdT!}dvx!75@i6}+tImrmmWtY$2D}&Sd!#9aKuRYvR_aU!=zvCU}dj97aNQ2rV8Mk zqMrEE75&mlP2JcY;R8YHFzm*adY($Up-g-U>E4EE9|eC0MqBK-%Su;jz7TYpj)m6a zb9_5a;4n*gtolsmz zZ#F4^s^Ujf@#oUi@0&~c9juzwGhcUv!6RBCo7b=g0$1BVxBw(`#7S$13WLPs)><6# zCt+b~AQvAX{d0%Eur9R5d|0x$fYE`LEA3*zkOJB3FUKdPUDDNIxxqvh$vwAByBt5&o~}37f~MTVO$UT^GxvA+31!)m zZ0mTa+s~GqmiM7#Js2c?gN6yx8vA&KDHP_BSM$}4rjaR65|F+|ndZ0U*{{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java new file mode 100755 index 00000000..e4fc5a2c --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09BCE43C04C054F75CACA8E2842C3ABA2D50A24755904167C6A239172912391F8C6780212EFD915BAEF10BDBA3EBA37DECB6B24640B0BC87CE85671055D77E94EA67C13486820A97E806B2878B6804821F40F10F3820CCAE36F07186F4863B092472C3144A50E4D15FDF1F244348E275715D0C315532B8BF4C9AA30780E317AAE90D0BA6FC7356BC29A851CAB601E93A3585CBD00F690549E1FB840B727FA42D25231E8F3767BCA3D06ED3B58ABCB9D08D0EBD1329A6E0EEAC5F60E71C84D6FFF8E7948E9FBD40B5382C97D1FDD7A2278CD7E748EBCC696638BDAB60A8EEF01CF3394BE6100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class work_forClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = work_forClassifier.class.getResource("work_forClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate work_forClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = work_forClassifier.class.getResource("work_forClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate work_forClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (work_forClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.test.ex"); } + public static boolean isTraining; + public static work_forClassifier instance; + + public static work_forClassifier getInstance() + { + loadInstance(); + return instance; + } + + private work_forClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "work_forClassifier"; + setEncoding(null); + setLabeler(new workLabel()); + setExtractor(new RelationFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public work_forClassifier() + { + super("work_forClassifier"); + isClone = true; + } + + public work_forClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public work_forClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(work_forClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(work_forClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(work_forClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "work_forClassifier"; + setLabeler(new workLabel()); + setExtractor(new RelationFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRelation || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRelation || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: work_forClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + work_forClassifier classifier = new work_forClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "work_forClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof work_forClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..56277adf24ea6a01e937e2ecbdabe4c4d36648e1 GIT binary patch literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0r5VC%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r{v@(Kj{ceRqHJKOaN%_!pnOl(Xkg&6UIrIsVG%5sdk^r`TcEO&mS5^3Ror zuJ?BPyxF+1a%1mx1B)eg*LR)#_3&TsESGQm;m)()*9E0qKeE*5>hi>$g+VKJueYjo z1Wsminx!wbTr6*O{fvh=dZ6@$m?$n%zuXZc9_J^0>F7uahNK7%s!xYO9r;x^g79Rx zC~u*|=pStn4VDfy&!n#|yCw6QUEu@@E6D-CG<-ZDq^Ca$#%RAi^E9iC;5{ZV(nbwl ze!5*D8dNkH#u%=Je?RlIdQmjS z9UMpG_>=@9CcxguahpNx5{3U-PROfA_gA16J;i8o$8q0HDWV&6<+(sw8~Jsw^xC6V zeK_DuVndrW>rqmsHe4UBqrex>jE(e?Lxr5vX~upY9jVfFE;LX0*qQ=5Dy@nJ4- zy^Z{~m%Kd6&=wG+W@+CTz_t{4MT6HtA$Ipz7$sDlNdC}E#zgVA$@ylGc$HdQHfQ93 zFq47gT=L2&!WQ{nZFwfK1|i$3t&O#V6u655+c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!$!e*fC*1Ou6}d%x9O<55~$Zo|%EM9q|E%$OCicfT^^~&xRuv zCdT!}dvx!75@i6}+tImrmmWtY$2D}&Sd!#9aKuRYvR_aU!=zvCU}dj97aNQ2rV8Mk zqMrEE75&mlP2JcY;R8YHFzm*adY($Up-g-U>E4EE9|eC0MqBK-%Su;jz7TYpj)m6a zb9_5a;4n*gtolsmz zZ#F4^s^Ujf@#oUi@0&~c9juzwGhcUv!6RBCo7b=g0$1BVxBw(`#7S$13WLPs)><6# zCt+b~AQvAX{d0%Eur9R5d|0x$fYE`LEA3*zkOJB3FUKdPUDDNIxxqvh$vwAByBt5&o~}37f~MTVO$UT^GxvA+31!)m zZ0mTa+s~GqmiM7#Js2c?gN6yx8vA&KDHP_BSM$}4rjaR65|F+|ndZ0U*{{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java new file mode 100755 index 00000000..6adc2e77 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java @@ -0,0 +1,95 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 + + +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + + +//import LBJ.LBJ2.Classifier; + +import LBJ2.classify.Classifier; +import LBJ2.classify.DiscretePrimitiveStringFeature; +import LBJ2.classify.Feature; +import LBJ2.classify.FeatureVector; +import ml.wolfe.examples.parisa.ConllRawToken; + + +public class orgLabel extends Classifier +{ + public orgLabel() + { + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "orgLabel"; + } + + public String getInputType() { return "ml.wolfe.examples.parisa.iJLIS2.ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Org", "nOrg" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 66 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'orgLabel' defined on line 66 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Org")) + { + return "Org"; + } + else + { + return "nOrg"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 66 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "orgLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof orgLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java new file mode 100755 index 00000000..bf4c9977 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java @@ -0,0 +1,97 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 + + +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + + +//import LBJ2.classify.Classifier; +//import LBJ2.classify.DiscretePrimitiveStringFeature; +//import LBJ2.classify.Feature; +//import LBJ2.classify.FeatureVector; + +import LBJ2.classify.Classifier; +import LBJ2.classify.DiscretePrimitiveStringFeature; +import LBJ2.classify.Feature; +import LBJ2.classify.FeatureVector; +import ml.wolfe.examples.parisa.ConllRawToken; + +public class personLabel extends Classifier +{ + public personLabel() + { + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "personLabel"; + } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Per", "nPer" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 21 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'personLabel' defined on line 21 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Peop")) + { + return "Per"; + } + else + { + return "nPer"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 21 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "personLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof personLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java new file mode 100755 index 00000000..0c85cc8d --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +// F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +//import LBJ.Classifier; + +import LBJ2.classify.Classifier; +import LBJ2.classify.DiscretePrimitiveStringFeature; +import LBJ2.classify.Feature; +import LBJ2.classify.FeatureVector; +import ml.wolfe.examples.parisa.ConllRelation; + +public class workLabel extends Classifier +{ + public workLabel() + { + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "workLabel"; + } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Works", "nWorks" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 91 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'workLabel' defined on line 91 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRelation t = (ConllRelation) __example; + + if (t.relType.equalsIgnoreCase("Work_For")) + { + return "Works"; + } + else + { + return "nWorks"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 91 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "workLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof workLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..a9a59b507cc240665647f3831400debe88a80992 GIT binary patch literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0sTIO%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r@Dsef#U|u5bS5V~8IA;_WY^2lDHwqUl~1uG2iwSJIuO?qi0tBx$@BU z-fo{a8#h*N?7ePavBd8Bu9LqW{_CCP@{K>-dG`Cdpp@%JmKt4Mp189xXvOaJR<(}6 z$!t!u^re=I<*lxt@f1f7l)exX#YO6uJ7UD+{G=}(9Vx+(6v09D=`g4xzv@O1o(vb| zEp!&sKLum zw<$z}iYCJt!?p15XP%a?032N6R!-0}AML=%JeI^*uZ0gZeEjt);NcQy4JBTAf2cR2 zK9_k^J40b%8lpCVs$FA;yT#81s~8*L;ch56=b3nL0`a>F5E?#?^*V_Y@eaJ@qj0FF zAgcYtNUwk@l+rT+Bo}(1_;_K88LXYBu-MlorJi!_c^TG4KFqxQqa3?MzQay^s#~># z%(;v_~MzdkzR7BkaK)WwQ~&CLv}T+K0Z~5(dK1plg}hR%muEu zk>B=`mq!`e0)o^m?HdEwmIAM6@H!~O?j8%HgsKzCA9~4{D89R#Zw851sl{b;Mh*xw z8A#40uZ$vWk?+-(XA)}=vaQeCbSLYa4G#6dgS`IR9NT;5G^~^k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examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java new file mode 100755 index 00000000..a53cf58c --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java @@ -0,0 +1,1225 @@ + + +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +//import LBJ.SparseAveragedPerceptron; +//import util.ClassUtils; +//import util.ExceptionlessInputStream; +//import util.ExceptionlessOutputStream; + +//import LBJ.SparseAveragedPerceptron; + +//import LBJ.LBJ2.SparseAveragedPerceptron; + +import LBJ2.classify.*; +import LBJ2.learn.*; +import LBJ2.parse.ArrayFileParser; +import LBJ2.parse.Parser; +import LBJ2.util.ClassUtils; +import LBJ2.util.ExceptionlessInputStream; +import LBJ2.util.ExceptionlessOutputStream; +import ml.wolfe.examples.parisa.ConllRelation; + + +public class work_forClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = work_forClassifier.class.getResource("work_forClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate work_forClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = work_forClassifier.class.getResource("work_forClassifier.ex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate work_forClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (work_forClassifier) readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new ArrayFileParser("work_forClassifier.lc"); } + public static Parser getTestParser() { return new ArrayFileParser("work_forClassifier.test.ex"); } + public static boolean isTraining; + public static work_forClassifier instance; + + public static work_forClassifier getInstance() + { + loadInstance(); + return instance; + } + + private work_forClassifier(boolean b) + { + super(new Parameters()); + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "work_forClassifier"; + setEncoding(null); + setLabeler(new workLabel()); + setExtractor(new RelationFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public work_forClassifier() + { + super("ml.wolfe.examples.parisa.iJLIS2.work_forClassifier"); + isClone = true; + } + + public work_forClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + public work_forClassifier(Parameters p, String modelPath, String lexiconPath) + { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else { + containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; + name = "work_forClassifier"; + setLabeler(new workLabel()); + setExtractor(new RelationFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRelation || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRelation || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: ml.wolfe.examples.parisa.iJLIS2.work_forClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = ClassUtils.getParser(testParserName, new Class[]{String.class}, new String[]{testFile}); + work_forClassifier classifier = new work_forClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "work_forClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof work_forClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public void setParameters(LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public void learn(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public FeatureVector[] classify(FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public FeatureVector classify(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public Feature featureValue(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public java.lang.String discreteValue(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public double realValue(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public void setParameters(Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public ScoreSet scores(FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public void setExtractor(Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLabelLexicon(ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.lc b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.lc new file mode 100755 index 0000000000000000000000000000000000000000..6ab4bbf57626fc5024e8f066b4d31bf76dcf955a GIT binary patch literal 11279 zcmY*mF-L=Xf-K}32WFVf^i38+XX0s<<%*CZ+;NR=icB?2Oy2uKe^ zdI#xJ1EB;65R(u>`t_T+Gxxi@KhBxinKNf+=j^l3oX6bs_zA!f-oHL=xovRde;Lo; z{r$WD8NKjy-L*dzXgSr?CVBou${Xt&1(y}N^J95qzx?n#p(lxQeodKYN zy-#7*mr8jdyee`Q26oTSpZzkM`Qf$nzi$32OZU}}XB|(8{W(bIu!+*l@TKmCr3jDK zI&`@M5}%{PVglQ^VCK%Uki;Ekw4`Kyz9eNM=7z}aaw>v?ANtH)cq17PwFV)a`i6c< zDvdxjX#LCdGrch*_CMsLHKd>CySze~B`LH6cV*#%r3Hgqrl7=Nlbi`p2R;7jJuT(9-dMM0|)Tvi%D-)=pIA3K<1bDLZRtVKM zf1YDBaeWCP#hXdNquasUN1;DfK`sv4b8fn&YZYp zH*KL_Cpnu>)9CpcbHU8%$6flFAqoIBQ4T~Ei~6RaZ_F}^?m1#df58D*T56||?A%7% zma8qMZ5sN9^iGB02`%0K$sY2kZvgssTJui}??f-O8P>V5r!Ew3;@u*ktMr#BmUD&O z)?j4SzQQqIVP~Ui^Ml*eZ`4u7GHLV}>xV-Eyg+3KewWrDnz>umqq06uu3l_2zT&xX;y;)?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KfENO4LE+6ceON-AaWsQ>TgyM`+!FyyYI_W28PP5^k6s6NL?9aF zu3Jw^I+iUJvPypqayPa6eG~H>7yE#h)Rv4HWu2IvM#s>PznD)+u>3y+`$!)NN&nFV zZ>TZvXoJ4?Q~KE&br%wk_}`DoBpLP#PvNDbrvLn92w@0W_{{J7pwUl=GwZ57`?40q zA1m8%ab@rDh)MtMip%2FG8ZWg`HyMq{M~d21_=kVIb3#6kS_D7!c8O-Vs6UAo2csV zmaK5(2w&onBj%<@j{%PSKNau)j{T2{_y4#5tLZg2J^9c71djf7)xT@k-@}d^`9ILo B%8dX3 literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..683d677bbf2ddf7436f50bc5935917449bea3dbb GIT binary patch literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0sTIO%gU%u?}?hs-3)u(Sj`u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r@Ds<^MXn>zn`i7^26&`0S;eJ%4JhByQO8S4OX3%(o-O4zq6J=$Vy&t~_+T zugB-j#*LL5`>q>UEU~-3>*TM8|9WS+eB%#yp8dWqDCPQ*rAAkmC+;i^TCsb*Rjng% zGMm#ZeW`83a#z>Sc#5M3OJ9hI;v)6S9Wml@UecG&&XizCir}F7bQsi;U-cjeSB8u7 z7CMan(H_xY=}_}b`s%V>)X?Rp z+Z3W9MU!ES;ad3jGf&G`01hs3D<|lgk9J^W9!p}Z*TM%HKK^utrRg4WVzXuA=c_tp3K>V%(gock}eNN&;yaRXnC>-i3 zi0b$-(kGw_rSwby$%P&$K3<^{94m z9FgNw5{Q@pdmqPb2C+*N{%biQuO8iBfm-ww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2m2^Xy_!82+4bwgf{tk?`*m0MYuGD-X=ro-Rt;gqh zcAP*yOzw3;J#ZifiJpZmXZrqvQyaM_=a3+cTczOjCS_2S)L}UB(`6Jv@t@{b#8)*- za6f>@VjPL|2Pk%P=3IJ*Hz|gCRQn7gco?0NLh0H@+dfSGl)vC;o4A1aaUs3g zr2MIh7g5EVOH;pZF6DKyYF5vD-4OIV=Ct9wwiv>dpWUs#*pOkh>SBL2m*-B|iE!^6b5Pg=& z<{5^OuYPes*Ea5%^W(7c0H)16HBEQGu%))`ao4ShFGk5?s7H~`%+#?>Bh#Kb7{KWi zoFryPSnE#JI)|LCr6slG)9kG$KAI%=-ZJfW{8W3o-dqcswjFLdAgr6Yzr#-`%a&wY z$3s1Sw&b+D4<+ltAn6-4Opw;t$16;sFps>NuWmGrOnH)k^f$^hzb(&xO%|=PpH5=>I Date: Tue, 17 Nov 2015 00:28:59 -0600 Subject: [PATCH 003/118] modified the ILP version of ER --- .../cs/cogcomp/saul/datamodel/DataModel.scala | 4 +- .../IndenpendentTraining.scala | 6 +- .../entityRelationClassifiers.scala | 9 +- .../SL_SVM/iJLIS/GraphStructure.java | 54 - .../SL_SVM/iJLIS/Runner.scala | 14 +- .../SL_SVM/iJLIS/SUtils.java | 1 - .../SL_SVM/iJLIS/SimpleInference.java | 143 -- .../SL_SVM/iJLIS2/ERiStructurePL.java | 74 +- .../SL_SVM/iJLIS2/ERqInstancePL.java | 14 +- .../SL_SVM/iJLIS2/EntityFeatures.java | 9 +- .../SL_SVM/iJLIS2/JointER$subjectto.java | 16 +- .../SL_SVM/iJLIS2/JointER.java | 16 +- .../SL_SVM/iJLIS2/Labels.scala | 8 +- .../SL_SVM/iJLIS2/OrganizationWorkFor.java | 10 +- .../SL_SVM/iJLIS2/RelationFeatures.java | 8 +- .../SL_SVM/iJLIS2/RunnerPL.scala | 92 +- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 211 ++- .../iJLIS2/java/Conll04_InstanceReader.java | 205 --- .../iJLIS2/java/Conll04_RelationReader.java | 221 --- .../SL_SVM/iJLIS2/java/ConllRawSentence.java | 87 -- .../SL_SVM/iJLIS2/java/ConllRawToken.java | 43 - .../SL_SVM/iJLIS2/java/ConllRelation.java | 15 - .../SL_SVM/iJLIS2/java/EntityFeatures.java | 63 - .../SL_SVM/iJLIS2/java/JointER$subjectto.java | 93 -- .../SL_SVM/iJLIS2/java/JointER.java | 40 - .../SL_SVM/iJLIS2/java/LocClassifier.ex | Bin 17618 -> 0 bytes .../SL_SVM/iJLIS2/java/LocClassifier.java | 1220 ----------------- .../SL_SVM/iJLIS2/java/LocClassifier.test.ex | Bin 17618 -> 0 bytes .../iJLIS2/java/OrganizationClassifier.ex | Bin 17129 -> 0 bytes .../iJLIS2/java/OrganizationClassifier.java | 1220 ----------------- .../java/OrganizationClassifier.test.ex | Bin 17129 -> 0 bytes .../iJLIS2/java/OrganizationWorkFor.java | 93 -- .../SL_SVM/iJLIS2/java/PersonClassifier.ex | Bin 17506 -> 0 bytes .../SL_SVM/iJLIS2/java/PersonClassifier.java | 1220 ----------------- .../iJLIS2/java/PersonClassifier.test.ex | Bin 17506 -> 0 bytes .../SL_SVM/iJLIS2/java/PersonWorkFor.java | 93 -- .../SL_SVM/iJLIS2/java/RelArgsClassifier.java | 90 -- .../SL_SVM/iJLIS2/java/RelationFeatures.java | 66 - .../SL_SVM/iJLIS2/java/locLabel.java | 91 -- .../SL_SVM/iJLIS2/java/orgLabel.java | 91 -- .../SL_SVM/iJLIS2/java/personLabel.java | 91 -- .../SL_SVM/iJLIS2/java/workLabel.java | 91 -- .../SL_SVM/iJLIS2/java/work_forClassifier.ex | Bin 9506 -> 0 bytes .../iJLIS2/java/work_forClassifier.java | 1220 ----------------- .../iJLIS2/java/work_forClassifier.test.ex | Bin 9506 -> 0 bytes .../SL_SVM/iJLIS2/orgLabel.java | 10 +- .../SL_SVM/iJLIS2/workLabel.java | 11 +- .../SL_SVM/iJLIS2/work_forClassifier.java | 26 +- 48 files changed, 207 insertions(+), 6882 deletions(-) delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_RelationReader.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/ConllRawSentence.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/ConllRawToken.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/ConllRelation.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/EntityFeatures.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/JointER$subjectto.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/JointER.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.test.ex diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala index 25d8edc6..5a1a9a1f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala @@ -5,11 +5,9 @@ import edu.illinois.cs.cogcomp.saul.datamodel.node.{ JoinNode, Node } import edu.illinois.cs.cogcomp.saul.datamodel.property.features.discrete._ import edu.illinois.cs.cogcomp.saul.datamodel.property.features.real._ import edu.illinois.cs.cogcomp.saul.datamodel.property.{ EvaluatedProperty, Property } -<<<<<<< HEAD -======= + import edu.illinois.cs.cogcomp.saul.datamodel.node.{ JoinNode, Node } import edu.illinois.cs.cogcomp.saul.datamodel.edge.{ SymmetricEdge, AsymmetricEdge, Edge, Link } ->>>>>>> cd5ea66a9de3dac0b85e15b0cad3ba0540a0b3f6 import scala.collection.mutable.{ ListBuffer, Map => MutableMap } import scala.reflect.ClassTag diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala index 6bd5110b..1005f26f 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala @@ -27,20 +27,20 @@ object indenpendentTraining extends App { personClassifier.test(tokens.getAllInstances) orgClassifier.learn(it) orgClassifier.test(tokens.getAllInstances) -<<<<<<< HEAD + LocClassifier.learn(it) LocClassifier.test(tokens.getAllInstances) workForClassifier.learn(it) workForClassifier.test(pairs.getAllInstances) LivesInClassifier.learn(it) LivesInClassifier.test(pairs.getAllInstances) -======= + locationClassifier.learn(it) locationClassifier.test(tokens.getAllInstances) // workForClassifier.learn(it) // workForClassifier.test() // LivesInClassifier.learn(it) // LivesInClassifier.test() ->>>>>>> cd5ea66a9de3dac0b85e15b0cad3ba0540a0b3f6 + } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala index 40de2360..8c4611a8 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala @@ -10,14 +10,13 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBas object entityRelationClassifiers { val parameters = new SparseAveragedPerceptron.Parameters() - parameters.modelDir = "model" + //parameters.modelDir = "model" object orgClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { def label: Property[ConllRawToken] = entityType is "Org" override def feature = using(word) } -<<<<<<< HEAD:saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/Classifiers.scala object PersonClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { def label: Property[ConllRawToken] = entityType is "Peop" } @@ -30,7 +29,8 @@ object entityRelationClassifiers { override def label: Property[ConllRelation] = relationType is "Work_For" } object LivesInClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel, parameters) { -======= + override def label: Property[ConllRelation] = relationType is "Work_For"} + object personClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel) { def label: Property[ConllRawToken] = entityType is "Peop" } @@ -43,8 +43,7 @@ object entityRelationClassifiers { override def label: Property[ConllRelation] = relationType is "Work_For" } object livesInClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel) { ->>>>>>> cd5ea66a9de3dac0b85e15b0cad3ba0540a0b3f6:saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala - override def label: Property[ConllRelation] = relationType is "Live_In" + override def label: Property[ConllRelation] = relationType is "Live_In" } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java deleted file mode 100755 index 07c0d830..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/GraphStructure.java +++ /dev/null @@ -1,54 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; - - -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; - -import java.util.ArrayList; -import java.util.List; - -//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; - -/** - * This is the Y instance for the prediction problem - * - * @author mayhew2 - * - */ -public class GraphStructure implements IStructure { - - public List nodeValues; - public QueryInstance qi; - private IFeatureVector fv; - - public GraphStructure(QueryInstance qi, List nodeValues) { - this.nodeValues = nodeValues; - this.qi = qi; - List feats = new ArrayList(); - - int i = 0; - for(String n : qi.nodeNames){ - feats.add("num" + i + "vow:" + SUtils.numVowels(n) + ":" + nodeValues.get(i)); - int j = 0; - for(char c : n.toCharArray()){ - feats.add("isvowpos:" + i + j + ":" + SUtils.isVowel(c) + ":" + nodeValues.get(i)); - j++; - } - i++; - } - - this.fv = SUtils.makeFeatures(feats); - //this.fv = IFeatureVector.plus(this.qi.fv, this.fv); - } - - - public IFeatureVector getFeatureVector() { - return this.fv; - } - - @Override - public String toString() { - return "[GraphStructure: " + this.nodeValues + "]"; - } - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala index 9ad96195..3814cc13 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala @@ -11,14 +11,7 @@ import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} object Runner { - /** - * This modifies the two lists given two it. They are initialized. - * - // * @param sclist - // * @param outlist - // * @param fname - * @throws java.io.FileNotFoundException - */ + var lexm: Lexiconer = new Lexiconer() /*def readX(cr:Conll04_InstanceReader):List[IInstance]={ var i: Int = 0 @@ -57,9 +50,6 @@ var lexm: Lexiconer = new Lexiconer() */ def trainSSVM(modelname: String): String = { - - - var cr = new Conll04_ReaderNew("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp","Pair") var sclist: List[IInstance]= new ArrayList[IInstance]//=readX(cr) var outlist: List[IStructure] = new ArrayList[IStructure]//readY(cr) @@ -76,7 +66,7 @@ var lexm: Lexiconer = new Lexiconer() val si: iERinference = new iERinference val model: SLModel = new SLModel model.infSolver= si - model.featureGenerator= ERFeatureGenerator + // model.featureGenerator= ERFeatureGenerator model.lm = lexm model.saveModel(modelname); model.config = new util.HashMap(); diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java index 1eb14c4e..d06fcbf1 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java @@ -1,5 +1,4 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; - import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.RunnerPL; import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; import org.apache.commons.lang3.ArrayUtils; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java deleted file mode 100755 index 51fe2244..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SimpleInference.java +++ /dev/null @@ -1,143 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; - -import edu.illinois.cs.cogcomp.core.datastructures.Pair; -import edu.illinois.cs.cogcomp.sl.core.AbstractInferenceSolver; -import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.WeightVector; - -import java.util.ArrayList; -import java.util.List; - -//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; - -public class SimpleInference extends AbstractInferenceSolver { - - private static final long serialVersionUID = 1L; - - /** - * This is for training - */ - //@Override - public Pair getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { - - GraphStructure goldStruct = (GraphStructure) gold; - QueryInstance qi = (QueryInstance) input; - - List options = getOptions(qi); - - double max = Double.NEGATIVE_INFINITY; - double score; - GraphStructure maxC = null; - double loss; - - System.out.println(); - System.out.println(gold); - - // Now get the structure with the max: score+loss - for (GraphStructure c : options) { - score = wv.dotProduct(c.getFeatureVector()); - loss = getLoss(null, c, goldStruct); - score += loss; - - System.out.println(c); - System.out.println(c.getFeatureVector()); - System.out.println(score); - - if (score > max) { - max = score; - maxC = c; - } - } - - // Return structure with highest score+loss, and loss of this structure - return new Pair(maxC, ((double) getLoss(null, maxC, goldStruct))); - } - -// public double getHammingLoss(GraphStructure hyp, GraphStructure gold){ -// double loss = 0; -// for (int i = 0; i < hyp.nodeValues.size(); i++) { -// if (hyp.nodeValues.get(i) != gold.nodeValues.get(i)) { -// loss += 1.0; -// } -// } -// return loss; -// } - - /** - * This is for prediction. - */ - @Override - public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { - QueryInstance qi = (QueryInstance) input; - - List options = getOptions(qi); - - double max = Double.NEGATIVE_INFINITY; - double score; - GraphStructure maxC = null; - - // Now get the structure with the max: score+loss - for (GraphStructure c : options) { - score = wv.dotProduct(c.getFeatureVector()); - - if (score > max) { - max = score; - maxC = c; - } - } - - // Return structure with highest score+loss, and loss of this structure - return maxC; - } - - @Override - public IStructure getLossAugmentedBestStructure(WeightVector weightVector, IInstance iInstance, IStructure iStructure) throws Exception { - return null; - } - - @Override - public float getLoss(IInstance iInstance, IStructure gold, IStructure pred) { - float loss = 0; - ERiStructure igold= (ERiStructure) gold; - ERiStructure ipred=(ERiStructure)pred; - //for (int i = 0; i < ipred.nodeValues.size(); i++) { - // if (ipred.nodeValues.get(i) != igold.nodeValues.get(i)) { - if (ipred.nodeValues != igold.nodeValues) { - - loss += 1.0; - } - // } - return loss; - } - - /** - * Given this QueryInstance, what are the options for responses? - * This simple method just enumerates all possibilities. (in this - * contrived example there are 8 total) - * - * @param qi - * @return - */ - public List getOptions(QueryInstance qi) { - - List options = new ArrayList(); - - - // Get all combinations - for (SUtils.NodeLabel i : SUtils.NodeLabel.values()) { - for (SUtils.NodeLabel j : SUtils.NodeLabel.values()) { - for (SUtils.NodeLabel k : SUtils.NodeLabel.values()) { - List labelOptions = new ArrayList(); - labelOptions.add(i); - labelOptions.add(j); - labelOptions.add(k); - options.add(new GraphStructure(qi, labelOptions)); - } - } - } - - return options; - } - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java index 5a52c5bd..85532514 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java @@ -1,7 +1,8 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 - +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; import edu.illinois.cs.cogcomp.sl.core.IStructure; /** @@ -11,14 +12,14 @@ public class ERiStructurePL implements IStructure { public Labels Rlables; public ERqInstancePL qi; - private FeatureVector fvPeop=new FeatureVector(new int[0] , new double[0]); - private FeatureVector fvOrg=new FeatureVector(new int[0] , new double[0]); - private FeatureVector fvLoc=new FeatureVector(new int[0] , new double[0]); - private FeatureVector fvOther=new FeatureVector(new int[0] , new double[0]); - private FeatureVector fvO=new FeatureVector(new int[0] , new double[0]); - private FeatureVector fvWorkFor=new FeatureVector(new int[0] , new double[0]); - private FeatureVector fvLivesIn=new FeatureVector(new int[0] , new double[0]); - private FeatureVector fv; + public FeatureVectorBuffer fvPeop=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvOrg=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvLoc=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvOther=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvO=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvWorkFor=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvLivesIn=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fv; public ERiStructurePL(ERqInstancePL qi, Labels Rlables) { // List feats = new ArrayList(); @@ -26,59 +27,6 @@ public ERiStructurePL(ERqInstancePL qi, Labels Rlables) { this.qi=qi; //this.fv = FeatureVector.plus(this.qi.fv, this.fv); } - - @Override - public FeatureVector getFeatureVector() { - // List feats = new ArrayList(); - if (Rlables.E1Label().toLowerCase().contains("peop")) - fvPeop=qi.E1fv; - if (Rlables.E2Label().toLowerCase().contains("peop")) - fvPeop= FeatureVector.plus(fvPeop,qi.E2fv); - - if (Rlables.E1Label().toLowerCase().contains("org")) - fvOrg=qi.E1fv; - if (Rlables.E2Label().toLowerCase().contains("org")) - fvOrg=FeatureVector.plus(fvOrg,qi.E2fv); - - - fvOrg=fvOrg.copyWithShift(RunnerPL.lexm().totalNumofFeature()); - fv=FeatureVector.plus(fvPeop,fvOrg); - - if(Rlables.RelLabel().toLowerCase().contains("work")) - fvWorkFor=qi.Rfv; - fvWorkFor=fvWorkFor.copyWithShift(RunnerPL.lexm().totalNumofFeature()*2); - - fv=FeatureVector.plus(fv,fvWorkFor); - - return this.fv; - - - /* if (Rlables.E1Label().contains("loc")) - fvLoc=qi.E1fv; - if (Rlables.E2Label().contains("loc")) - fvLoc=FeatureVector.plus(fvLoc,qi.E2fv); - - if (Rlables.E1Label().contains("other")) - fvOther=qi.E2fv; - if (Rlables.E2Label().contains("other")) - fvOther=FeatureVector.plus(fvOther,qi.E2fv); - if (Rlables.E1Label().equalsIgnoreCase("O")) - fvO=qi.E1fv; - if (Rlables.E2Label().equalsIgnoreCase("O")) - fvO=FeatureVector.plus(fvO,qi.E2fv); - - - if (Rlables.RelLabel().contains("Live-in")) - fvLivesIn=qi.Rfv; - if (Rlables.RelLabel().contains("work-for")) - fvWorkFor=qi.Rfv;*/ - //return - - - - - } - @Override public String toString() { return "[ERiStructure: " + this.Rlables + "]"; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java index c3a23bc8..9f4f6a56 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java @@ -1,8 +1,10 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.SUtils; import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; import java.util.ArrayList; @@ -17,9 +19,9 @@ public class ERqInstancePL implements IInstance { ConllRelation pair; // List nodeNames; // order matters! - IFeatureVector E1fv; - IFeatureVector E2fv; - IFeatureVector Rfv; + FeatureVectorBuffer E1fv; + FeatureVectorBuffer E2fv; + FeatureVectorBuffer Rfv; public ERqInstancePL(ConllRelation pair) { this.pair=pair; @@ -36,10 +38,10 @@ public ERqInstancePL(ConllRelation pair) { //System.out.println(RunnerPL.lexm().totalNumofFeature()); // do something with node names to make features - this.E1fv = SUtils.makeFeatures(E1feats); + this.E1fv = (FeatureVectorBuffer) SUtils.makeFeatures(E1feats); - this.E2fv = SUtils.makeFeatures(E2feats); - this.Rfv= SUtils.makeFeatures(Rfeats); + this.E2fv = (FeatureVectorBuffer) SUtils.makeFeatures(E2feats); + this.Rfv= (FeatureVectorBuffer) SUtils.makeFeatures(Rfeats); } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java index 8c92d2ab..9b1020fc 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java @@ -4,10 +4,11 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import LBJ2.classify.Classifier; -import LBJ2.classify.DiscretePrimitiveStringFeature; -import LBJ2.classify.FeatureVector; -import ml.wolfe.examples.parisa.ConllRawToken; + +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; +import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; public class EntityFeatures extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java index 05cadd37..f2e7cc27 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java @@ -3,18 +3,16 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import LBJ2.classify.FeatureVector; -import LBJ2.infer.FirstOrderConjunction; -import LBJ2.infer.FirstOrderConstant; -import LBJ2.infer.FirstOrderConstraint; -import LBJ2.infer.ParameterizedConstraint; -import ml.wolfe.examples.parisa.ConllRelation; + +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; public class JointER$subjectto extends ParameterizedConstraint { - private static final ml.wolfe.examples.parisa.iJLIS2.PersonWorkFor __PersonWorkFor = new ml.wolfe.examples.parisa.iJLIS2.PersonWorkFor(); - private static final ml.wolfe.examples.parisa.iJLIS2.OrganizationWorkFor __OrganizationWorkFor = new ml.wolfe.examples.parisa.iJLIS2.OrganizationWorkFor(); + private static final PersonWorkFor __PersonWorkFor = new PersonWorkFor(); + private static final OrganizationWorkFor __OrganizationWorkFor = new OrganizationWorkFor(); public JointER$subjectto() { super("ml.wolfe.examples.parisa.iJLIS2.JointER$subjectto"); } @@ -63,7 +61,7 @@ public FeatureVector[] classify(Object[] examples) public int hashCode() { return "JointER$subjectto".hashCode(); } public boolean equals(Object o) { return o instanceof JointER$subjectto; } - public FirstOrderConstraint makeConstraint(Object __example) + public Constraint makeConstraint(Object __example) { if (!(__example instanceof ConllRelation)) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java index 07c19a17..10cba718 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java @@ -5,13 +5,15 @@ //import LBJ.infer.GurobiHook; //import LBJ.infer.ILPInference; -import LBJ2.infer.GurobiHook; -import LBJ2.learn.Learner; -import LBJ2.learn.Normalizer; -import LBJ2.learn.Softmax; -import ml.wolfe.examples.parisa.ConllRelation; -public class JointER extends LBJ2.infer.ILPInference +import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; +import edu.illinois.cs.cogcomp.lbjava.infer.ILPInference; +import edu.illinois.cs.cogcomp.lbjava.learn.Learner; +import edu.illinois.cs.cogcomp.lbjava.learn.Normalizer; +import edu.illinois.cs.cogcomp.lbjava.learn.Softmax; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; + +public class JointER extends ILPInference { public static ConllRelation findHead(ConllRelation t) { @@ -23,7 +25,7 @@ public JointER() { } public JointER(ConllRelation head) { super(head, new GurobiHook()); - constraint = new ml.wolfe.examples.parisa.iJLIS2.JointER$subjectto().makeConstraint(head); + constraint = new JointER$subjectto().makeConstraint(head); } public String getHeadType() { return "ml.wolfe.examples.parisa.ConllRelation"; } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala index b3111cd5..5f87ef64 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala @@ -4,11 +4,11 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJ * Created by parisakordjamshidi on 23/09/14. */ class Labels { - var E1Label:java.lang.String=""; - var E2Label:java.lang.String=""; - var RelLabel:java.lang.String=""; + var E1Label:String=""; + var E2Label:String=""; + var RelLabel:String=""; // val labels: util.ArrayList[String]=new util.ArrayList[String] -def set(x:java.lang.String,y:java.lang.String,z:java.lang.String) { +def set(x:String,y:String,z:String) { E1Label=x; E2Label=y; RelLabel=z; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java index c1348cc8..007e1b10 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java @@ -1,12 +1,14 @@ // Modifying this comment will cause the next execution of LBJ2 to overwrite this file. // F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.lbjava.infer.*; + -import edu.illinois.cs.cogcomp.lbjava.infer.ParameterizedConstraint; -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import LBJ2.classify.FeatureVector; -import LBJ2.infer.*; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.OrganizationClassifier; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; import ml.wolfe.examples.parisa.ConllRelation; public class OrganizationWorkFor extends ParameterizedConstraint diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java index 1d57e176..a5620079 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java @@ -3,10 +3,10 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import LBJ2.classify.Classifier; -import LBJ2.classify.DiscretePrimitiveStringFeature; -import LBJ2.classify.FeatureVector; -import ml.wolfe.examples.parisa.ConllRelation; +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; +import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; public class RelationFeatures extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index 4d685570..b4464da1 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -1,36 +1,19 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 -import _root_.java.util - +import java.util +import java.util.List import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.SimpleModel -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.ERqInstancePL -import edu.illinois.cs.cogcomp.sl.core.{IInstance, IStructure} +import edu.illinois.cs.cogcomp.sl.core._ +import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} object RunnerPL { /** * This modifies the two lists given two it. They are initialized. - * - // * @param sclist - // * @param outlist - // * @param fname - * @throws java.io.FileNotFoundException */ var lexm: Lexiconer = new Lexiconer() - /*def readX(cr:Conll04_InstanceReader):List[IInstance]={ - var i: Int = 0 - val sclist: List[IInstance]=new ArrayList[IInstance] - while (i < 100){//cr.instances.size){ - val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) - sclist.add(newqi) - i=i+1 - } - sclist - }*/ - def readXY(cr:Conll04_ReaderNew, outlist: List[IStructure], sclist: List[IInstance], l:Int,u:Int){ - +def readXY(cr:Conll04_ReaderNew, outlist: =>List[IStructure], sclist: => List[IInstance], l:Int,u:Int){ var i= l while (i < u){//cr.instances.size){ val newqi: ERqInstancePL = new ERqInstancePL(cr.relations.elementAt(i)) @@ -45,19 +28,7 @@ var lexm: Lexiconer = new Lexiconer() i=i+1 } } - /*def readY(cr:Conll04_InstanceReader):List[IStructure]={ - var i: Int = 0 - val outlist: List[IStructure]=new util.ArrayList[IStructure] - while (i < 100){//cr.instances.size){ - val a: Nodevalues=new Nodevalues() - a.a=(cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) - val cs: ERiStructure = new ERiStructure(cr.instances.elementAt(i), a.a) - outlist.add(cs) - i=i+1 - } - outlist - } -*/ + def trainSSVM(modelname: String, cr:Conll04_ReaderNew): String = { @@ -67,31 +38,34 @@ var lexm: Lexiconer = new Lexiconer() //cr=null // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-train" lexm.setAllowNewFeatures(false) - val sp: StructuredProblem = new StructuredProblem - sp.input_list = sclist - sp.output_list = outlist - val para: JLISParameters = new JLISParameters - para.total_number_features = 3*lexm.totalNumofFeature - para.c_struct = 1 - para.check_inference_opt = false + val sp: SLProblem = new SLProblem + sp.instanceList = sclist + sp.goldStructureList = outlist + val para: SLParameters = new SLParameters + para.TOTAL_NUMBER_FEATURE = 3*lexm.getNumOfFeature + para.C_FOR_STRUCTURE = 1 + para.CHECK_INFERENCE_OPT = false val si: iERjavaInferencePL = new iERjavaInferencePL - val learner: L2LossJLISLearner = new L2LossJLISLearner - val learned_wv: WeightVector = learner.trainStructuredSVM(si, sp, para) - val model: SimpleModel = new SimpleModel - model.wv = learned_wv - model.s_finder = new iERjavaInferencePL + val model: SLModel = new SLModel + + model.infSolver= new iERjavaInferencePL model.lm = lexm - val iom: JLISModelIOManager = new JLISModelIOManager - iom.saveModel(model, modelname) + model.saveModel(modelname); + model.config = new util.HashMap(); + model.para=para + model.featureGenerator= new ERFeatureGenerator + val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); + // val learned_wv: WeightVector = learner.trainStructuredSVM(si, sp, para) + model.wv = learner.train(sp) return modelname } def testSequenceSSVM(model_name: String,cr:Conll04_ReaderNew) { - val iom: JLISModelIOManager = new JLISModelIOManager - val model: SimpleModel = iom.loadModel(model_name).asInstanceOf[SimpleModel] + // val iom: JLISModelIOManager = new JLISModelIOManager + val model: SLModel = SLModel.loadModel(model_name) RunnerPL.lexm = model.lm val learned_wv: WeightVector = model.wv - val inference_proc: iERjavaInferencePL = model.s_finder.asInstanceOf[iERjavaInferencePL] + val inference_proc: iERjavaInferencePL = model.infSolver.asInstanceOf[iERjavaInferencePL] // var cr = new Conll04_RelationReader("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp") var sclist: List[IInstance]= new util.ArrayList[IInstance]//=readX(cr) var outlist: List[IStructure] = new util.ArrayList[IStructure]//readY(cr) @@ -104,12 +78,12 @@ var lexm: Lexiconer = new Lexiconer() //val outlist: List[IStructure] = new ArrayList[IStructure] // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-test" //readData(sclist, outlist, fname) - val sp: StructuredProblem = new StructuredProblem - sp.input_list = sclist - sp.output_list = outlist + val sp: SLProblem = new SLProblem + sp.instanceList = sclist + sp.goldStructureList= outlist printTestACC(sp, inference_proc, learned_wv) } - private def printTestACC(sp: StructuredProblem, s_finder: AbstractLossSensitiveStructureFinder, ssvm_wv: WeightVector) { + private def printTestACC(sp: SLProblem, s_finder: AbstractInferenceSolver, ssvm_wv: WeightVector) { var tp: Double = 0 var fp: Double = 0 var tn: Double = 0 @@ -117,9 +91,9 @@ var lexm: Lexiconer = new Lexiconer() var total: Double = 0.0 var i: Int = 0 - while (i < sp.input_list.size) { - val gold: ERiStructurePL = sp.output_list.get(i).asInstanceOf[ERiStructurePL] - val prediction:ERiStructurePL = s_finder.getBestStructure(ssvm_wv, sp.input_list.get(i)).asInstanceOf[ERiStructurePL] + while (i < sp.instanceList.size) { + val gold: ERiStructurePL = sp.goldStructureList.get(i).asInstanceOf[ERiStructurePL] + val prediction:ERiStructurePL = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructurePL] System.out.println(prediction) //{ var j: Int = 0 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java index fe665279..388796e4 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java @@ -1,45 +1,36 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -/** - * Created by parisakordjamshidi on 22/09/14. - */ - - -import LBJ2.infer.GurobiHook; -import LBJ2.infer.InferenceManager; -import edu.illinois.cs.cogcomp.core.datastructures.Pair; -import edu.illinois.cs.cogcomp.indsup.inference.AbstractLossSensitiveStructureFinder; -import edu.illinois.cs.cogcomp.indsup.inference.IInstance; -import edu.illinois.cs.cogcomp.indsup.inference.IStructure; -import edu.illinois.cs.cogcomp.indsup.learning.WeightVector; +import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; +import edu.illinois.cs.cogcomp.lbjava.infer.InferenceManager; +import edu.illinois.cs.cogcomp.lbjava.learn.Learner; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.ERiStructure; +import edu.illinois.cs.cogcomp.sl.core.AbstractInferenceSolver; +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; +import edu.illinois.cs.cogcomp.sl.util.WeightVector; import gurobi.*; -import ml.wolfe.examples.parisa.ConllRelation; +import javafx.util.Pair; import java.util.Arrays; -//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; -public class iERjavaInferencePL extends AbstractLossSensitiveStructureFinder { +public class iERjavaInferencePL extends AbstractInferenceSolver { private static final long serialVersionUID = 1L; - /** - * This is for training - */ - @Override public Pair getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { -//// - int blockSize= RunnerPL.lexm().totalNumofFeature(); - double[] globalWeight=wv.getWeightArray(); - double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); - double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); - double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); - WeightVector wvPer=new WeightVector(WeightPer,1); - WeightVector wvOrg=new WeightVector(WeightOrg,1); - WeightVector wvWF=new WeightVector(WeightWF,1); - // ERqInstancePL qi = (ERqInstancePL) input; - ml.wolfe.examples.parisa.iJLIS2.Labels temp=new ml.wolfe.examples.parisa.iJLIS2.Labels(); - ///// + + int blockSize= RunnerPL.lexm().getNumOfFeature(); + float[] globalWeight=wv.getWeightArray(); + float[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); + float[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); + float[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); + + WeightVector wvPer=new WeightVector(new WeightVector(WeightPer),1); + WeightVector wvOrg=new WeightVector(new WeightVector(WeightOrg),1); + WeightVector wvWF=new WeightVector(new WeightVector(WeightWF),1); ERiStructurePL goldStruct = (ERiStructurePL) gold; Integer goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("peop")) ? 1 : 0; @@ -52,13 +43,14 @@ public Pair getLossSensitiveBestStructure(WeightVector wv, I Double coefLosorg2= Double.valueOf((1-2*(goldL))); goldL= (((ERiStructurePL) gold).Rlables.RelLabel().toLowerCase().contains("work")) ? 1 : 0; Double coefLosWF= Double.valueOf((1-2*(goldL))); -// double loss; + Labels temp=new Labels(); + ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); - Double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv)+coefLosper1; - Double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv)+coefLosper2; - Double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv)+coefLosorg1; - Double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv)+coefLosorg2; - Double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv)+coefLosWF; + Double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosper1; + Double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosper2; + Double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosorg1; + Double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosorg2; + Double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv)+coefLosWF; try{ GRBEnv env = new GRBEnv("mip1.log"); @@ -131,40 +123,21 @@ public Pair getLossSensitiveBestStructure(WeightVector wv, I e.getMessage()); } // Return structure with highest score+loss, and loss of this structure - return new Pair(maxC, getHammingLoss(maxC, goldStruct)); + return new Pair(maxC, ((double) getLoss(((IInstance) maxC.qi), maxC, goldStruct))); } - public double getlocalLoss(String hyp, String gold) { - double loss = 0; - //double E2loss=0; - //double Rloss=0; - if (hyp.equals(gold)) - loss = 0; - else - loss = 1; - - //if (hyp.Rlables.E2Label().equals(gold.Rlables.E2Label())) - // E2loss=0; - //else - // E2loss=1; - - - /*if (hyp.nodeValues==gold.nodeValues) - loss=0; - else - loss=1; - */ //return ((E1loss+E2loss)/2); - return loss; - } + @Override + public float getLoss(IInstance iInstance, IStructure iStructure, IStructure iStructure1) { - public double getHammingLoss(ERiStructurePL hyp, ERiStructurePL gold){ - double E1loss = 0; - double E2loss=0; - double Rloss=0; + float E1loss = 0; + float E2loss=0; + float Rloss=0; + ERiStructurePL hyp= ((ERiStructurePL) iStructure); + ERiStructurePL gold=((ERiStructurePL) iStructure1); if (hyp.Rlables.E1Label().equals(gold.Rlables.E1Label())) - E1loss=0; + E1loss=0; else - E1loss=1; + E1loss=1; if (hyp.Rlables.E2Label().equals(gold.Rlables.E2Label())) E2loss=0; @@ -176,24 +149,21 @@ public double getHammingLoss(ERiStructurePL hyp, ERiStructurePL gold){ Rloss=0; else Rloss=1; - - /*if (hyp.nodeValues==gold.nodeValues) - loss=0; - else - loss=1; - */ return ((E1loss+E2loss+Rloss)/3); - } - - /** + return ((E1loss+E2loss+Rloss)/3); + } + /** * This is for prediction. */ - // @Override - public IStructure getBestStructureGurobiHook(WeightVector wv, IInstance input) throws Exception { //using GurobiHook - int blockSize=RunnerPL.lexm().totalNumofFeature(); - double[] globalWeight=wv.getWeightArray(); - double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); - double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); - double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); + + + @Override + public IStructure getLossAugmentedBestStructure(WeightVector wv, IInstance input, IStructure iStructure) throws Exception { + + int blockSize=RunnerPL.lexm().getNumOfFeature(); + WeightVector globalWeight=new WeightVector(wv.getWeightArray()); + WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); + WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); + WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); WeightVector wvPer=new WeightVector(WeightPer,1); WeightVector wvOrg=new WeightVector(WeightOrg,1); WeightVector wvWF=new WeightVector(WeightWF,1); @@ -202,15 +172,15 @@ public IStructure getBestStructureGurobiHook(WeightVector wv, IInstance input) t // double max = Double.NEGATIVE_INFINITY; //double score; - ml.wolfe.examples.parisa.iJLIS2.Labels temp=new Labels(); + Labels temp=new Labels(); ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); - double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv); - double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv); - double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv); - double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv); - double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv); + double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); + double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); + double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); + double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); + double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); //try { GurobiHook myGurobi=new GurobiHook(); @@ -326,11 +296,11 @@ public IStructure getBestStructureGurobiHook(WeightVector wv, IInstance input) t public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) throws Exception { - int blockSize=RunnerPL.lexm().totalNumofFeature(); - double[] globalWeight=wv.getWeightArray(); - double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); - double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); - double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); + int blockSize=RunnerPL.lexm().getNumOfFeature(); + WeightVector globalWeight=new WeightVector(wv.getWeightArray()); + WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); + WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); + WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 2 * blockSize, 3 * blockSize - 1)); WeightVector wvPer=new WeightVector(WeightPer,1); WeightVector wvOrg=new WeightVector(WeightOrg,1); WeightVector wvWF=new WeightVector(WeightWF,1); @@ -339,15 +309,15 @@ public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) // double max = Double.NEGATIVE_INFINITY; //double score; - ml.wolfe.examples.parisa.iJLIS2.Labels temp=new Labels(); + Labels temp=new Labels(); ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); - Double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv); - Double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv); - Double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv); - Double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv); - Double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv); + float coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); + float coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); + float coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); + float coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); + float coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); try{ GRBEnv env = new GRBEnv("mip1.log"); GRBModel model = new GRBModel(env); @@ -422,28 +392,28 @@ public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) } @Override public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { //using GurobiHook - int blockSize=RunnerPL.lexm().totalNumofFeature(); - double[] globalWeight=wv.getWeightArray(); - double[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); - double[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); - double[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); - WeightVector wvPer=new WeightVector(WeightPer,1); - WeightVector wvOrg=new WeightVector(WeightOrg,1); - WeightVector wvWF=new WeightVector(WeightWF,1); - ml.wolfe.examples.parisa.iJLIS2.JointER JE=new JointER(((ERqInstancePL) input).pair); - ConllRelation head = ml.wolfe.examples.parisa.iJLIS2.JointER.findHead((ConllRelation) ((ERqInstancePL) input).pair); - ml.wolfe.examples.parisa.iJLIS2.JointER inference = (JointER) InferenceManager.get("ml.wolfe.examples.parisa.iJLIS2.JointER", head); + int blockSize=RunnerPL.lexm().getNumOfFeature(); + WeightVector globalWeight= new WeightVector(wv.getWeightArray()); + WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); + WeightVector WeightOrg= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); + WeightVector WeightWF= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); + WeightVector wvPer= new WeightVector(WeightPer,1); + WeightVector wvOrg= new WeightVector(WeightOrg,1); + WeightVector wvWF= new WeightVector(WeightWF,1); + JointER JE= new JointER(((ERqInstancePL) input).pair); + ConllRelation head = JointER.findHead((ConllRelation) ((ERqInstancePL) input).pair); + JointER inference = (JointER) InferenceManager.get("ml.wolfe.examples.parisa.iJLIS2.JointER", head); if (inference == null) { - inference = new ml.wolfe.examples.parisa.iJLIS2.JointER(head); + inference = new JointER(head); InferenceManager.put(inference); } String result = null; - ml.wolfe.examples.parisa.iJLIS2.work_forClassifier __work_forClassifier = new ml.wolfe.examples.parisa.iJLIS2.work_forClassifier(); + work_forClassifier __work_forClassifier = new work_forClassifier(); try { - result = inference.valueOf(__work_forClassifier, ((ERqInstancePL) input).pair); + result = inference.valueOf((__work_forClassifier), ((ERqInstancePL) input).pair); } catch (Exception e) { @@ -461,16 +431,16 @@ public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exce // double max = Double.NEGATIVE_INFINITY; //double score; - ml.wolfe.examples.parisa.iJLIS2.Labels temp=new Labels(); + Labels temp=new Labels(); ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); /////// - double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv); - double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv); - double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv); - double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv); - double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv); + double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); + double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); + double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); + double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); + double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); //try { GurobiHook myGurobi=new GurobiHook(); @@ -579,6 +549,9 @@ public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exce // } return maxC; } + + + /*public FirstOrderConstraint makeConstraint(Object __example) { if (!(__example instanceof ConllRelation)) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java deleted file mode 100755 index 933d88fb..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/Conll04_InstanceReader.java +++ /dev/null @@ -1,205 +0,0 @@ -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.Vector; - - -//import jointentityrelationextraction. -//import edu.illinois.cs.cogcomp.datastruct; -import edu.illinois.cs.cogcomp.core.io.LineIO; -//import ConllRawSentence; -//import ConllReader.ConllRelation; -//import per.Conll04Reader; -//import ConllReader.ConllRawToken; -import edu.illinois.cs.cogcomp.lbjava.parse.Parser; -//import .illinois.cs.cogcomp.tutorial.Document; - -public class Conll04_InstanceReader implements Parser { - public Vector instances; - public Vector sentences; - public Vector relations; - - public String[] entityLabels,relLabels; - private int currentInstanceId; - - - public Conll04_InstanceReader(String filename){ - instances=new Vector(); - relations=new Vector(); - sentences=new Vector(); - entityLabels=new String[0]; - relLabels=new String[0]; -// } - - - //public void readData(String filename) throws Exception { - //BufferedReader br=new BufferedReader(new FileReader(filename)); - List lines = null; - try { - lines = LineIO.read(filename); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - String line; - String[] tokens; - - - ConllRawToken c=new ConllRawToken(); - - ConllRelation r; - int currSentId=0; - boolean sentEnd=false; - ConllRawSentence sent=new ConllRawSentence(currSentId); - - ArrayList entityal = new ArrayList(); - ArrayList relal = new ArrayList(); - - boolean relationSeen=false; - int sentindex = 0; - while(sentindex < lines.size()){ - line = lines.get(sentindex); - sentindex ++; - - //System.out.println(sentindex + " " + line); - if(line.isEmpty()){ - sentEnd=true; - -/* if(!sentEnd){ - currSentId++; - sentEnd=true; - - sentences.add(sent); - - sent=new ConllRawSentence(currSentId); - }*/ - continue; - } - - tokens=line.split("\t|\n"); - int s=tokens.length; - if(s==3){ - relationSeen=true; - r=new ConllRelation(); -// r.sentId1=currSentId-1; -// r.sentId2=currSentId-1; - r.wordId1=Integer.parseInt(tokens[0]); - r.wordId2=Integer.parseInt(tokens[1]); - r.relType=tokens[2]; - relations.add(r); - sent.addRelations(r); -// sentences.elementAt(sentences.size()-1).addRelations(r); - if(!relal.contains(tokens[2])){ - relal.add(tokens[2]); - } - } - else{ - //System.out.println("tokens[1]="+tokens[1]+"done"); - if(sentEnd){ - //if(!relationSeen) - { - sentences.add(sent); -/* if(currSentId < 700) - System.out.println("sid:" + currSentId); - else System.out.println("sid:" + (currSentId + 51)); - for(int ind = 0;ind < sent.sentTokens.size();ind ++) - System.out.print(sent.sentTokens.get(ind).phrase + " "); - System.out.println(); - */ - currSentId++; - } - sent=new ConllRawSentence(currSentId); - } - - c=new ConllRawToken(); - -/* if(currSentId < 700) - assert (currSentId == Integer.parseInt(tokens[0])); - else - { - assert(currSentId == Integer.parseInt(tokens[0]) - 51); - if(currSentId != Integer.parseInt(tokens[0]) - 51) - System.out.println("fuck you here"); - }*/ - - c.entType=tokens[1]; - c.sentId=currSentId; - c.wordId=Integer.parseInt(tokens[2]); - c.setPOS(tokens[4]); - c.setPhrase(tokens[5]); - - sent.addTokens(c); - if(!tokens[1].trim().equals("O")){ - instances.add(c); - sent.setCurrentTokenAsEntity(); - if(!entityal.contains(tokens[1])){ - entityal.add(tokens[1]); - } - } - - sentEnd=false; - relationSeen=false; - } - } - - entityLabels=entityal.toArray(entityLabels); - relLabels=relal.toArray(relLabels); - - } - - - public void printData(){ - System.out.println("printing total "+sentences.size()+" sentences"); - for(int i=0;i instances; - public Vector sentences; - public Vector relations; - - public String[] entityLabels,relLabels; - private int currentInstanceId; - - - public Conll04_RelationReader(String filename){ - instances=new Vector(); - relations=new Vector(); - sentences=new Vector(); - entityLabels=new String[0]; - relLabels=new String[0]; -// } - - - //public void readData(String filename) throws Exception { - //BufferedReader br=new BufferedReader(new FileReader(filename)); - List lines = null; - try { - lines = LineIO.read(filename); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - String line; - String[] tokens; - - - ConllRawToken c=new ConllRawToken(); - - ConllRelation r; - int currSentId=0; - boolean sentEnd=false; - ConllRawSentence sent=new ConllRawSentence(currSentId); - - ArrayList entityal = new ArrayList(); - ArrayList relal = new ArrayList(); - - boolean relationSeen=false; - int sentindex = 0; - while(sentindex < lines.size()){ - line = lines.get(sentindex); - sentindex ++; - - //System.out.println(sentindex + " " + line); - if(line.isEmpty()){ - sentEnd=true; - -/* if(!sentEnd){ - currSentId++; - sentEnd=true; - - sentences.add(sent); - - sent=new ConllRawSentence(currSentId); - }*/ - continue; - } - - tokens=line.split("\t|\n"); - int s=tokens.length; - if(s==3){ - relationSeen=true; - r=new ConllRelation(); - r.sentId=currSentId; - //r.s=new ConllRawSentence(currSentId); - //r.sentId1=currSentId-1; - //r.sentId2=currSentId-1; - r.wordId1=Integer.parseInt(tokens[0]); - r.wordId2=Integer.parseInt(tokens[1]); - r.relType=tokens[2]; - relations.add(r); - // System.out.println("WORD1:"+r.s.sentTokens.elementAt(r.wordId1).phrase); - sent.addRelations(r); -// sentences.elementAt(sentences.size()-1).addRelations(r); - if(!relal.contains(tokens[2])){ - relal.add(tokens[2]); - } - } - else{ - //System.out.println("tokens[1]="+tokens[1]+"done"); - if(sentEnd){ - //if(!relationSeen) - { - sentences.add(sent); -/* if(currSentId < 700) - System.out.println("sid:" + currSentId); - else System.out.println("sid:" + (currSentId + 51)); - for(int ind = 0;ind < sent.sentTokens.size();ind ++) - System.out.print(sent.sentTokens.get(ind).phrase + " "); - System.out.println(); - */ - currSentId++; - } - sent=new ConllRawSentence(currSentId); - } - - c=new ConllRawToken(); - -/* if(currSentId < 700) - assert (currSentId == Integer.parseInt(tokens[0])); - else - { - assert(currSentId == Integer.parseInt(tokens[0]) - 51); - if(currSentId != Integer.parseInt(tokens[0]) - 51) - System.out.println("fuck you here"); - }*/ - - c.entType=tokens[1]; - c.sentId=currSentId; - c.wordId=Integer.parseInt(tokens[2]); - c.setPOS(tokens[4]); - c.setPhrase(tokens[5]); - - sent.addTokens(c); - if(!tokens[1].trim().equals("O")){ - instances.add(c); - sent.setCurrentTokenAsEntity(); - if(!entityal.contains(tokens[1])){ - entityal.add(tokens[1]); - } - } - - sentEnd=false; - relationSeen=false; - } - } - - entityLabels=entityal.toArray(entityLabels); - relLabels=relal.toArray(relLabels); - - for (int counter=0; counter sentTokens; - public Vector relations; - public int sentId; - public Vector entityIndices; - - public ConllRawSentence(int sentId){ - sentTokens = new Vector(); - relations= new Vector(); - entityIndices=new Vector(); - this.sentId=sentId; - } - - public void addTokens(ConllRawToken c){ - sentTokens.add(c); - } - - public void addRelations(ConllRelation r){ - relations.add(r); - } - - public void setCurrentTokenAsEntity(){ - entityIndices.add(sentTokens.size()-1); - } - - public Vector getEntitiesInSentence(){ - Vector entities=new Vector(); - for(int i=0;isentTokens.size()-1) break; - window[index]=sentTokens.elementAt(i+loc); -// String a=sentTokens.elementAt(i+loc).getPhrase(isLowerCase); -// window[index]="Window"+i+":"+a; - index++; - // window[index]="Window:"+a; - // index++; - } - return window; - } - - public void printEntities(){ - for(int i=0;i`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTz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}7w^{P+bT06t0e2U%nKDpxKQ_tAXDch$FT!HiwxR>f%`1QRXfUDbY?*-PV ztAmu^12_82&;0cG#v;*qQ-Na%=LK`OdGFA^Sr>f%vhu0oqL|CSE~#XvO|E-aGJC&p z|K;;pUxD*?ccyYZ>!@X$a)VEG^~uut*V-pXeScZKd~(>O>(P~ZySGfTTnZeEubz17 zXXr!ETQ{ck1XgW*otO0cVzI?p_u^L~R>w{Ew&|^W4csH#U%K~hqTbJE_ukmTkhdZ3cdzW_sTWr&2OjEbX)%TYUzr?pc zM8eg6{hs!@Zl_xdA3eNMC2A1lJKv}sbff}sXLoNMRq zY~6M5t=BK{)v5CqJ$>?D!(jFCx+4*nO{}|4@h-kMYra~$cJ;xXTlz9K%WnLBVvDgk zFfu=V*>+!bZEI6IuoeR@Gq@5NdC+Gy_X6O=`*)N7?`{6)2Y9n{?0v9HGRTF2VaZ8$ oh5&CyCJ_e2K_tj>po2(I0rXgs0B=?{kOU(TngZ!|pkWLQ0O#kO6#xJL diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java deleted file mode 100755 index 3e918413..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.java +++ /dev/null @@ -1,1220 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09DCA44C040148F55A9C9CD3894CF9D3DAE146DD50120A44F4E54A776A73913399E1ABB36411FDDD0EEB287D28AF8FAAC705724640D0BBD6445D07C04276B5E4136B83FB0F0490C650737E01905214467D0E1822C4A12570BB461CEB6F48639092C1587484433CF10AEBE7B784A689C15B48E71E6155FC325530B8F77C1BA6836C0993757F86859B357A47C29B851CAB601E9297589385F0FC91549EEE3840B32FF442E82B907AFE398D223D2E2B3E61AE2F26306D70734225D528BA27DB18F10325BDFF3AF561ADD7A90A3382C70D1E534E26909BB5E80D7C9C2F4607957D049CFF203A95FC0166100000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - - - -public class LocClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = LocClassifier.class.getResource("LocClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate LocClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = LocClassifier.class.getResource("LocClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate LocClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (LocClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.test.ex"); } - public static boolean isTraining; - public static LocClassifier instance; - - public static LocClassifier getInstance() - { - loadInstance(); - return instance; - } - - private LocClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "LocClassifier"; - setEncoding(null); - setLabeler(new locLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public LocClassifier() - { - super("LocClassifier"); - isClone = true; - } - - public LocClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public LocClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(LocClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(LocClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(LocClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "LocClassifier"; - setLabeler(new locLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: LocClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - LocClassifier classifier = new LocClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "LocClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof LocClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/LocClassifier.test.ex deleted file mode 100755 index 8f3e067c766ae6d5460ecdbfc25a336cf3831047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17618 zcmYhDdmz*O`~UCimRiMKk;>`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTzvwL#06ajMn`Ze=1*5>D}%srWh1Xg(lKMYrOfaU;_iMe|A{=kze-kEbhMHXb5>Z zDrPk5(PA5?k%iBUe6%Kc<7v)Q0pSq8UvOh>7mC`auT3jw?6*5;Ku*TOe!|?gDRt9d zKH5{({`mN<#>ZK_PxzMK?u$-=O?6(Irz8M{wU>X@OG5eZLL%Jt)V(pZFZpN-$DG`1`5&;3wLClD@U3FPR3MpSV)u^%UV zLSVxhJtl-ma2=O};Px!?c#PL?6A`COAo_YydjsyS;cLOke!F8Bo$YOX(?yKm`z^cw zzBBR4(z66v-xwH}Ge;MLOmd{aqMGXsl;UtEcV$gFLDths{9+feXvAoS)p7K+xckbW zyEtTM|GTg#gDZO0O-A|S3WrxGTTxJ4o4fKUO>nixp+k{kcr|R%wh7wkZ|nB-#guO)hs}ZC3tRA(Ykg^9d!e6*^LKzAtH1;C9S524u2uD^E zeZs^t)S8Phj`080$C{CawBt>k84Ab44~mHaN_B)@?sX@J#dWjaDpF+R%Z9+#jCixw z4UfNNdoHX}_(~Z*f}2$x{QJS3O;3ahX3|l)R^St@L`+7B@=RS1fPKCKDri2 z;0z5J{KV$=3+|nu_uOV_hTxT(JP`&k_`%o`cfaJ5M}bOA`D|t?fuvoL-YaU-TUDiU z(bHb-wnfZKq*Bw8)Ou~TP59s%RW3mjCmC0E~Rj&;0H5LX48O6V1?JO}*IV8PwS#Z=utMLL85$dk=EO=?N}H zOBLHYR^kxGN_dffUiAfJgXrMl@g7swJqcKeIt!cwE=?cXmi z9`5Ux6r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23Ce8Ux53gU@uXouybei^TuqP1|&4fwYJ@RA!h+Uw0sfrYY*%9We84-{K( z^QX+D+p5vy3%WiEr+Zay8gRqFDV5q~Kb?H8I8ah|78%?9TR9+*we2E&^6HRO=u|*M z7;$PD$;dj!NK3bv$-JYY1ObwYjN!Tbs7s`^M|)OjXHMK%dXv?s@?)Y`EeQi}oVb$( zoND(W4v6MkeIsme4Ozm{=bKFctLlC82DRrPIU|JsH{#D|8 zdG+sqGv}7w^{P+bT06t0e2U%nKDpxKQ_tAXDch$FT!HiwxR>f%`1QRXfUDbY?*-PV ztAmu^12_82&;0cG#v;*qQ-Na%=LK`OdGFA^Sr>f%vhu0oqL|CSE~#XvO|E-aGJC&p z|K;;pUxD*?ccyYZ>!@X$a)VEG^~uut*V-pXeScZKd~(>O>(P~ZySGfTTnZeEubz17 zXXr!ETQ{ck1XgW*otO0cVzI?p_u^L~R>w{Ew&|^W4csH#U%K~hqTbJE_ukmTkhdZ3cdzW_sTWr&2OjEbX)%TYUzr?pc zM8eg6{hs!@Zl_xdA3eNMC2A1lJKv}sbff}sXLoNMRq zY~6M5t=BK{)v5CqJ$>?D!(jFCx+4*nO{}|4@h-kMYra~$cJ;xXTlz9K%WnLBVvDgk zFfu=V*>+!bZEI6IuoeR@Gq@5NdC+Gy_X6O=`*)N7?`{6)2Y9n{?0v9HGRTF2VaZ8$ oh5&CyCJ_e2K_tj>po2(I0rXgs0B=?{kOU(TngZ!|pkWLQ0O#kO6#xJL diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.ex deleted file mode 100755 index 108e5ef0ed31dac675ed95d4361fd5e0421c530b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17129 zcmYg%dpOhm|9^GoPAYCil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B#>hcb?Tp5k ze6YI`S2HS>3Xu2wTHRDhw9SQu-4Kb^A-hn!+Xp27-%^^pv@)F-7?zx5X9)0SWD;RO hoKJx)2Rfeu6+lm`2=HcQ14%Ffp(&7_2Q-X<0RSK0;`jgn diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java deleted file mode 100755 index 57cb81ea..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.java +++ /dev/null @@ -1,1220 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09BCE43C04C054F75CACA8E2862C3ABA2C20596524AA4545851B14EEC8B9C099AD32BD1AC34CFB311DF506B75AB747EED89C282931C64B54E4F58E9487191DC2DE319E9D24837ED2E1F95A7260F90CDC9346245601D67D8B3AC03852E6169CE9CF37548E38291CE55E00C4748F30437DFAF0C6E8C186B48174E65577270AAB71D8F6878A7D2937A225AEB747CA3C9A33D02A5AA90CCA1059183A1C139770F4505D8EEED941B5A8F84A18A8BA0F7F94C6499D2E838E61A99E5CC1CBB41A7623B138BA9EC6E0F30E46EBAF74FB2A4BCF075C0E055C46DFB4A25D81A4B3E116B91CBC0E079D4304C1F71093AD0A51F6100000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - - - -public class OrganizationClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate OrganizationClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate OrganizationClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (OrganizationClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.test.ex"); } - public static boolean isTraining; - public static OrganizationClassifier instance; - - public static OrganizationClassifier getInstance() - { - loadInstance(); - return instance; - } - - private OrganizationClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "OrganizationClassifier"; - setEncoding(null); - setLabeler(new orgLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public OrganizationClassifier() - { - super("OrganizationClassifier"); - isClone = true; - } - - public OrganizationClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public OrganizationClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(OrganizationClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(OrganizationClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(OrganizationClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "OrganizationClassifier"; - setLabeler(new orgLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: OrganizationClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - OrganizationClassifier classifier = new OrganizationClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "OrganizationClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof OrganizationClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationClassifier.test.ex deleted file mode 100755 index 108e5ef0ed31dac675ed95d4361fd5e0421c530b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17129 zcmYg%dpOhm|9^GoPAYCilCnE)<&em33Ck*>@4feWKA(@%)9&_f`{njXN=okeUxOQD9eeqoOx){sRUpD6R zAo$1#n|20fiuOH$L#JVl!TkK-n(-RJ?k;ol*w@1L#dTr+Me4dz z+EVOm`)G~b;fZ@1NakhGUcs%F z#3A>;Es>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src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java deleted file mode 100755 index 448e033a..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/OrganizationWorkFor.java +++ /dev/null @@ -1,93 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class OrganizationWorkFor extends ParameterizedConstraint -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - private static final OrganizationClassifier __OrganizationClassifier = new OrganizationClassifier(); - - public OrganizationWorkFor() { super("OrganizationWorkFor"); } - - public String getInputType() { return "ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = ("" + (__OrganizationClassifier.discreteValue(t.e2))).equals("" + (true)); - else LBJ2$constraint$result$0 = true; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "OrganizationWorkFor".hashCode(); } - public boolean equals(Object o) { return o instanceof OrganizationWorkFor; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__OrganizationClassifier, t.e2), "" + (true)); - LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.ex deleted file mode 100755 index d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wbq`~EzB|NQ*r;g5Ok{k~q;^*mir4Ty(?+q=m5ixcS6mNmvN|TQ?APW&Ep4$&rXPO8B8PjEIZ>* zF#bBekk#TH^6C}x2%`!T7s6d|p^2aVwg2~7>bL8oBmJK?b4rp_qT*lqTMwltTtM>5 zI?%Tm58h^Imu}{Cm`w-p-=-P~MI#~Yad&r(lZ&IgpSSQV6r5R&dvacmY39S{c>Z0; z`Z$yW^?6voX5=)3Jhf@Hcp>TI>`9qwdm%%^9%rm86l=Y9KIw`YmA};RymAmo)s~wY zf6I40)*8d|X0dGkqT-aMOCqu}9FpZSdeV^{YgSu{xo|ZR@bRV79Si__xbGWbOvu$AF}tY3N0JfAgO zJ|#V=^)07+`i$UW00OCF_9~$9SkA;U%wws9i>v>gICuNIL>Ygb@1N_7XU|b+A5WmP zzw^~x5x7ZJT*)GT3rS-1ZOWxjp<`ymb#DFO z<6=l0H`wgJq1V48C2GFj8qDC?)T4cn9A5r*is1F89esJu7|N&;XY(w4i}Ck+Bx7qe z5pP=_|7thsa-ui0*D~yI+VH;r?iMIK!2Ls+aciCC^s}F!seitL9A3fJgp0KIP?;5& zZ~Zhc?@fs(^_?}D3mb1e0*&9(WOf70%`GE?xere_xRbE z2Ic7H>8~< zTiRgec~oYRq3szhceiE<|D{b{#J$jL6;`mhnNhuN^&$wrj(9dJ1BwQl4}P?uySNbW zjrI}Zd0vrW$c!Wv5ka-6BxUAN?ZG+`v?Sb3Ne(}evq!~y=+2`p(ULgc@=7keGB?$1 zlD$+RU#UBIOr@ERn6Iz1EovlNf~G5&A}`~y3^{c z^R!p}dh_O3_3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A~*RB*1a?<|=wGmQI}bEL`f@v`Ml3J=hdj zsbpHKu2MLGUt8 zU#`HB?Y^+UAXxG-c5`Jt=`clQzlk&v+#V6B>r|3dPiA%H2Go(k+4dj|f~ zX^vqPi3;ZN6$e&HFrBZ*4qS$7ET?;v{)I;vt;XO1^p%|JmGirvuTP;9?w>>lXnb&t5DX&zG5?$4!;`Nzi8@~c;HIJYJpdKPXM>ipW5ni%yl<#Yy8(= z0l+OJTvPXDe3#mF^-n<6nU@Fc7H_?DEc6|45NW2f>-k_{Ox}x}TD5rg`7qYUpZ*xQ zZO^$Mv*h{RO21zo+HYIAgO|=11un$&`aAhe^o_OWrZ2j>cDwOYW#BmiS@C~mYHmHT zo7=11sb1OUdo8#0^UZULbuT{MS*v#FBfnX*WI&rf1~Msa&z(X*$k1ExA0n0 z>b&PX=PlQ`2J!WKtiCk=ec0!StINF~-fXq>%>NS~;LXlauicdO$eDp*$w_vG0B=Sn i5eCG;Ajoo{gF#RM^q7zUZ&o&t1S1fd0%>s<5Dx%*;z&IJ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java deleted file mode 100755 index 01529f7e..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.java +++ /dev/null @@ -1,1220 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09DCE43C04C048F55CAC98E1862CF4F45830A2DA48459041831714667DD469C6CBB2BD12024CBB3BA6F518BE86664FDC8F0AE48C80E984431F622AA68340293BD42E81B5C9F52D04C06B08B93788482C09F86DD3EB35489430770B56B06FDB324B94841E0296406A91E8D1DC5FBD30BA12B3A690D79AEAAEE3D845F094CF70E85FE35C8127AC5FD3A16DEE4995AB429BA50CAA109431B7589385F0FC91549EEE3940B32F50AD156394CF3726B203D269537B0DC2F26D06D7073039A611EA69BA53CF2819ADEEF19F2B0D6FBC40D9145E38E0FA127554C4D59324F172BC391C563D001BFF30A3599ED9C6100000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - - - -public class PersonClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = PersonClassifier.class.getResource("PersonClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate PersonClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = PersonClassifier.class.getResource("PersonClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate PersonClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (PersonClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.test.ex"); } - public static boolean isTraining; - public static PersonClassifier instance; - - public static PersonClassifier getInstance() - { - loadInstance(); - return instance; - } - - private PersonClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "PersonClassifier"; - setEncoding(null); - setLabeler(new personLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public PersonClassifier() - { - super("PersonClassifier"); - isClone = true; - } - - public PersonClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public PersonClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(PersonClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(PersonClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(PersonClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "PersonClassifier"; - setLabeler(new personLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: PersonClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - PersonClassifier classifier = new PersonClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "PersonClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof PersonClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonClassifier.test.ex deleted file mode 100755 index d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wbq`~EzB|NQ*r;g5Ok{k~q;^*mir4Ty(?+q=m5ixcS6mNmvN|TQ?APW&Ep4$&rXPO8B8PjEIZ>* zF#bBekk#TH^6C}x2%`!T7s6d|p^2aVwg2~7>bL8oBmJK?b4rp_qT*lqTMwltTtM>5 zI?%Tm58h^Imu}{Cm`w-p-=-P~MI#~Yad&r(lZ&IgpSSQV6r5R&dvacmY39S{c>Z0; z`Z$yW^?6voX5=)3Jhf@Hcp>TI>`9qwdm%%^9%rm86l=Y9KIw`YmA};RymAmo)s~wY zf6I40)*8d|X0dGkqT-aMOCqu}9FpZSdeV^{YgSu{xo|ZR@bRV79Si__xbGWbOvu$AF}tY3N0JfAgO zJ|#V=^)07+`i$UW00OCF_9~$9SkA;U%wws9i>v>gICuNIL>Ygb@1N_7XU|b+A5WmP zzw^~x5x7ZJT*)GT3rS-1ZOWxjp<`ymb#DFO z<6=l0H`wgJq1V48C2GFj8qDC?)T4cn9A5r*is1F89esJu7|N&;XY(w4i}Ck+Bx7qe z5pP=_|7thsa-ui0*D~yI+VH;r?iMIK!2Ls+aciCC^s}F!seitL9A3fJgp0KIP?;5& zZ~Zhc?@fs(^_?}D3mb1e0*&9(WOf70%`GE?xere_xRbE z2Ic7H>8~< zTiRgec~oYRq3szhceiE<|D{b{#J$jL6;`mhnNhuN^&$wrj(9dJ1BwQl4}P?uySNbW zjrI}Zd0vrW$c!Wv5ka-6BxUAN?ZG+`v?Sb3Ne(}evq!~y=+2`p(ULgc@=7keGB?$1 zlD$+RU#UBIOr@ERn6Iz1EovlN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v@;M;p%{62poH7;$C)dl`;*i!#zVgA~*RB*1a?<|=wGmQI}bEL`f@v`Ml3J=hdj zsbpHKu2MLGUt8 zU#`HB?Y^+UAXxG-c5`Jt=`clQzlk&v+#V6B>r|3dPiA%H2Go(k+4dj|f~ zX^vqPi3;ZN6$e&HFrBZ*4qS$7ET?;v{)I;vt;XO1^p%|JmGirvuTP;9?w>>lXnb&t5DX&zG5?$4!;`Nzi8@~c;HIJYJpdKPXM>ipW5ni%yl<#Yy8(= z0l+OJTvPXDe3#mF^-n<6nU@Fc7H_?DEc6|45NW2f>-k_{Ox}x}TD5rg`7qYUpZ*xQ zZO^$Mv*h{RO21zo+HYIAgO|=11un$&`aAhe^o_OWrZ2j>cDwOYW#BmiS@C~mYHmHT zo7=11sb1OUdo8#0^UZULbuT{MS*v#FBfnX*WI&rf1~Msa&z(X*$k1ExA0n0 z>b&PX=PlQ`2J!WKtiCk=ec0!StINF~-fXq>%>NS~;LXlauicdO$eDp*$w_vG0B=Sn i5eCG;Ajoo{gF#RM^q7zUZ&o&t1S1fd0%>s<5Dx%*;z&IJ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java deleted file mode 100755 index 9bac6434..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/PersonWorkFor.java +++ /dev/null @@ -1,93 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class PersonWorkFor extends ParameterizedConstraint -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - private static final PersonClassifier __PersonClassifier = new PersonClassifier(); - - public PersonWorkFor() { super("PersonWorkFor"); } - - public String getInputType() { return "ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = ("" + (__PersonClassifier.discreteValue(t.e1))).equals("" + (true)); - else LBJ2$constraint$result$0 = true; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "PersonWorkFor".hashCode(); } - public boolean equals(Object o) { return o instanceof PersonWorkFor; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__PersonClassifier, t.e1), "" + (true)); - LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java deleted file mode 100755 index bb885a11..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelArgsClassifier.java +++ /dev/null @@ -1,90 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// discrete RelArgsClassifier(ConllRelation r) <- JointER(work_forClassifier) - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class RelArgsClassifier extends Classifier -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - - public RelArgsClassifier() - { - containingPackage = ""; - name = "RelArgsClassifier"; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "*", "*" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation head = JointER.findHead((ConllRelation) __example); - JointER inference = (JointER) InferenceManager.get("JointER", head); - - if (inference == null) - { - inference = new JointER(head); - InferenceManager.put(inference); - } - - String result = null; - - try { result = inference.valueOf(__work_forClassifier, __example); } - catch (Exception e) - { - System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); - e.printStackTrace(); - System.exit(1); - } - - return result; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "RelArgsClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof RelArgsClassifier; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java deleted file mode 100755 index 1cefef75..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/RelationFeatures.java +++ /dev/null @@ -1,66 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class RelationFeatures extends Classifier -{ - public RelationFeatures() - { - containingPackage = ""; - name = "RelationFeatures"; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete%"; } - - public FeatureVector classify(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - FeatureVector __result; - __result = new FeatureVector(); - String __id; - String __value; - - __id = "" + (("WORD1:" + t.s.sentTokens.elementAt(t.wordId1).phrase)); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - __id = "" + (("WORD2:" + t.s.sentTokens.elementAt(t.wordId2).phrase)); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - return __result; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "RelationFeatures".hashCode(); } - public boolean equals(Object o) { return o instanceof RelationFeatures; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java deleted file mode 100755 index 427e9b46..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/locLabel.java +++ /dev/null @@ -1,91 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000D4C814A02C034144FA234659086F20577D590D594F2013E825CFCF8629254A4EEEDA222EA606ED3ED56CC121B0713D7C066703AFEDA0981A7F76A8DE2AA8C9CFC34CB3515C1E0B7C281FA0B5A1A691E5F063C7E4E52F1F6A131B3F996F3137E6317B6F4941FD7A5450523FF18EF84D512E3B0EA6D8000000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class locLabel extends Classifier -{ - public locLabel() - { - containingPackage = ""; - name = "locLabel"; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Loc", "nLoc" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'locLabel' defined on line 40 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Loc")) - { - return "Loc"; - } - else - { - return "nLoc"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "locLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof locLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java deleted file mode 100755 index da2f14f2..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/orgLabel.java +++ /dev/null @@ -1,91 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class orgLabel extends Classifier -{ - public orgLabel() - { - containingPackage = ""; - name = "orgLabel"; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Org", "nOrg" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'orgLabel' defined on line 64 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Org")) - { - return "Org"; - } - else - { - return "nOrg"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "orgLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof orgLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java deleted file mode 100755 index 2d599e25..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/personLabel.java +++ /dev/null @@ -1,91 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class personLabel extends Classifier -{ - public personLabel() - { - containingPackage = ""; - name = "personLabel"; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Per", "nPer" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'personLabel' defined on line 17 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Peop")) - { - return "Per"; - } - else - { - return "nPer"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "personLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof personLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java deleted file mode 100755 index 0dba1dad..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/workLabel.java +++ /dev/null @@ -1,91 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - -public class workLabel extends Classifier -{ - public workLabel() - { - containingPackage = ""; - name = "workLabel"; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Works", "nWorks" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'workLabel' defined on line 88 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRelation t = (ConllRelation) __example; - - if (t.relType.equalsIgnoreCase("Work_For")) - { - return "Works"; - } - else - { - return "nWorks"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "workLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof workLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.ex deleted file mode 100755 index 56277adf24ea6a01e937e2ecbdabe4c4d36648e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0r5VC%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r{v@(Kj{ceRqHJKOaN%_!pnOl(Xkg&6UIrIsVG%5sdk^r`TcEO&mS5^3Ror zuJ?BPyxF+1a%1mx1B)eg*LR)#_3&TsESGQm;m)()*9E0qKeE*5>hi>$g+VKJueYjo z1Wsminx!wbTr6*O{fvh=dZ6@$m?$n%zuXZc9_J^0>F7uahNK7%s!xYO9r;x^g79Rx zC~u*|=pStn4VDfy&!n#|yCw6QUEu@@E6D-CG<-ZDq^Ca$#%RAi^E9iC;5{ZV(nbwl ze!5*D8dNkH#u%=Je?RlIdQmjS z9UMpG_>=@9CcxguahpNx5{3U-PROfA_gA16J;i8o$8q0HDWV&6<+(sw8~Jsw^xC6V zeK_DuVndrW>rqmsHe4UBqrex>jE(e?Lxr5vX~upY9jVfFE;LX0*qQ=5Dy@nJ4- zy^Z{~m%Kd6&=wG+W@+CTz_t{4MT6HtA$Ipz7$sDlNdC}E#zgVA$@ylGc$HdQHfQ93 zFq47gT=L2&!WQ{nZFwfK1|i$3t&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>Ed6T?b!$!e*fC*1Ou6}d%x9O<55~$Zo|%EM9q|E%$OCicfT^^~&xRuv zCdT!}dvx!75@i6}+tImrmmWtY$2D}&Sd!#9aKuRYvR_aU!=zvCU}dj97aNQ2rV8Mk zqMrEE75&mlP2JcY;R8YHFzm*adY($Up-g-U>E4EE9|eC0MqBK-%Su;jz7TYpj)m6a zb9_5a;4n*gtolsmz zZ#F4^s^Ujf@#oUi@0&~c9juzwGhcUv!6RBCo7b=g0$1BVxBw(`#7S$13WLPs)><6# zCt+b~AQvAX{d0%Eur9R5d|0x$fYE`LEA3*zkOJB3FUKdPUDDNIxxqvh$vwAByBt5&o~}37f~MTVO$UT^GxvA+31!)m zZ0mTa+s~GqmiM7#Js2c?gN6yx8vA&KDHP_BSM$}4rjaR65|F+|ndZ0U*{{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java deleted file mode 100755 index e4fc5a2c..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.java +++ /dev/null @@ -1,1220 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09BCE43C04C054F75CACA8E2842C3ABA2D50A24755904167C6A239172912391F8C6780212EFD915BAEF10BDBA3EBA37DECB6B24640B0BC87CE85671055D77E94EA67C13486820A97E806B2878B6804821F40F10F3820CCAE36F07186F4863B092472C3144A50E4D15FDF1F244348E275715D0C315532B8BF4C9AA30780E317AAE90D0BA6FC7356BC29A851CAB601E93A3585CBD00F690549E1FB840B727FA42D25231E8F3767BCA3D06ED3B58ABCB9D08D0EBD1329A6E0EEAC5F60E71C84D6FFF8E7948E9FBD40B5382C97D1FDD7A2278CD7E748EBCC696638BDAB60A8EEF01CF3394BE6100000 - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import java.util.List; - - - - -public class work_forClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = work_forClassifier.class.getResource("work_forClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate work_forClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = work_forClassifier.class.getResource("work_forClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate work_forClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (work_forClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.test.ex"); } - public static boolean isTraining; - public static work_forClassifier instance; - - public static work_forClassifier getInstance() - { - loadInstance(); - return instance; - } - - private work_forClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "work_forClassifier"; - setEncoding(null); - setLabeler(new workLabel()); - setExtractor(new RelationFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public work_forClassifier() - { - super("work_forClassifier"); - isClone = true; - } - - public work_forClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public work_forClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(work_forClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(work_forClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(work_forClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "work_forClassifier"; - setLabeler(new workLabel()); - setExtractor(new RelationFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRelation || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRelation || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: work_forClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - work_forClassifier classifier = new work_forClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "work_forClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof work_forClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/java/work_forClassifier.test.ex deleted file mode 100755 index 56277adf24ea6a01e937e2ecbdabe4c4d36648e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0r5VC%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r{v@(Kj{ceRqHJKOaN%_!pnOl(Xkg&6UIrIsVG%5sdk^r`TcEO&mS5^3Ror zuJ?BPyxF+1a%1mx1B)eg*LR)#_3&TsESGQm;m)()*9E0qKeE*5>hi>$g+VKJueYjo z1Wsminx!wbTr6*O{fvh=dZ6@$m?$n%zuXZc9_J^0>F7uahNK7%s!xYO9r;x^g79Rx zC~u*|=pStn4VDfy&!n#|yCw6QUEu@@E6D-CG<-ZDq^Ca$#%RAi^E9iC;5{ZV(nbwl ze!5*D8dNkH#u%=Je?RlIdQmjS z9UMpG_>=@9CcxguahpNx5{3U-PROfA_gA16J;i8o$8q0HDWV&6<+(sw8~Jsw^xC6V zeK_DuVndrW>rqmsHe4UBqrex>jE(e?Lxr5vX~upY9jVfFE;LX0*qQ=5Dy@nJ4- zy^Z{~m%Kd6&=wG+W@+CTz_t{4MT6HtA$Ipz7$sDlNdC}E#zgVA$@ylGc$HdQHfQ93 zFq47gT=L2&!WQ{nZFwfK1|i$3t&O#V6u655+cZ2_0TtevyQ_!%*s$6ObQ+xhEtzZ@ zRpTP>Q-JXffZnK|1(f${es3~hIU4E=)_9La8o-y%B(}EkmPFCfbA$8WB?E4wFhdWv zXejv}qw7;I&5hCQf$Rk#%o66@_>j74y@NS{t+M_sQ?b9q> zvdTuS$_7yno_CR&Pw)isypr%K^6@GDRyq0zsd~uThNK`NIpq;x2`L8W116O<44fC@ z>Vmh1FqvA%86mRYL$ExPCq3tY>}k+FZKGX%l#!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xBw(`#7S$13WLPs)><6# zCt+b~AQvAX{d0%Eur9R5d|0x$fYE`LEA3*zkOJB3FUKdPUDDNIxxqvh$vwAByBt5&o~}37f~MTVO$UT^GxvA+31!)m zZ0mTa+s~GqmiM7#Js2c?gN6yx8vA&KDHP_BSM$}4rjaR65|F+|ndZ0U*{{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java index 6adc2e77..7ca1a304 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java @@ -7,10 +7,10 @@ //import LBJ.LBJ2.Classifier; -import LBJ2.classify.Classifier; -import LBJ2.classify.DiscretePrimitiveStringFeature; -import LBJ2.classify.Feature; -import LBJ2.classify.FeatureVector; + +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; +import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; import ml.wolfe.examples.parisa.ConllRawToken; @@ -30,7 +30,7 @@ public orgLabel() public String[] allowableValues() { return __allowableValues; } - public FeatureVector classify(Object __example) + public FeatureVector classify(Object __example) { return new FeatureVector(featureValue(__example)); } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java index 0c85cc8d..3f694095 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java @@ -2,13 +2,12 @@ // F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -//import LBJ.Classifier; -import LBJ2.classify.Classifier; -import LBJ2.classify.DiscretePrimitiveStringFeature; -import LBJ2.classify.Feature; -import LBJ2.classify.FeatureVector; -import ml.wolfe.examples.parisa.ConllRelation; +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; +import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; +import edu.illinois.cs.cogcomp.lbjava.classify.Feature; +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; public class workLabel extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java index a53cf58c..f42cab20 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java @@ -1,24 +1,14 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -//import LBJ.SparseAveragedPerceptron; -//import util.ClassUtils; -//import util.ExceptionlessInputStream; -//import util.ExceptionlessOutputStream; - -//import LBJ.SparseAveragedPerceptron; - -//import LBJ.LBJ2.SparseAveragedPerceptron; - -import LBJ2.classify.*; -import LBJ2.learn.*; -import LBJ2.parse.ArrayFileParser; -import LBJ2.parse.Parser; -import LBJ2.util.ClassUtils; -import LBJ2.util.ExceptionlessInputStream; -import LBJ2.util.ExceptionlessOutputStream; -import ml.wolfe.examples.parisa.ConllRelation; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser; +import edu.illinois.cs.cogcomp.lbjava.parse.Parser; +import edu.illinois.cs.cogcomp.lbjava.util.ClassUtils; +import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream; +import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; public class work_forClassifier extends SparseAveragedPerceptron From 76304eb7b07c1cf5863b5ff20f3c6fbced1e5a9a Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 17 Nov 2015 00:30:05 -0600 Subject: [PATCH 004/118] modified the ILP version of ER --- .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 77 ++ .../SL_SVM/iJLIS2/mYjava/EntityFeatures.java | 65 + .../iJLIS2/mYjava/JointER$subjectto.java | 96 ++ .../SL_SVM/iJLIS2/mYjava/JointER.java | 43 + .../SL_SVM/iJLIS2/mYjava/LocClassifier.ex | Bin 0 -> 17618 bytes .../SL_SVM/iJLIS2/mYjava/LocClassifier.java | 1220 +++++++++++++++++ .../iJLIS2/mYjava/LocClassifier.test.ex | Bin 0 -> 17618 bytes .../iJLIS2/mYjava/OrganizationClassifier.ex | Bin 0 -> 17129 bytes .../iJLIS2/mYjava/OrganizationClassifier.java | 1220 +++++++++++++++++ .../mYjava/OrganizationClassifier.test.ex | Bin 0 -> 17129 bytes .../iJLIS2/mYjava/OrganizationWorkFor.java | 93 ++ .../SL_SVM/iJLIS2/mYjava/PersonClassifier.ex | Bin 0 -> 17506 bytes .../iJLIS2/mYjava/PersonClassifier.java | 1220 +++++++++++++++++ .../iJLIS2/mYjava/PersonClassifier.test.ex | Bin 0 -> 17506 bytes .../SL_SVM/iJLIS2/mYjava/PersonWorkFor.java | 93 ++ .../iJLIS2/mYjava/RelArgsClassifier.java | 90 ++ .../iJLIS2/mYjava/RelationFeatures.java | 66 + .../SL_SVM/iJLIS2/mYjava/locLabel.java | 91 ++ .../SL_SVM/iJLIS2/mYjava/orgLabel.java | 91 ++ .../SL_SVM/iJLIS2/mYjava/personLabel.java | 91 ++ .../SL_SVM/iJLIS2/mYjava/workLabel.java | 91 ++ .../iJLIS2/mYjava/work_forClassifier.ex | Bin 0 -> 9506 bytes .../iJLIS2/mYjava/work_forClassifier.java | 1220 +++++++++++++++++ .../iJLIS2/mYjava/work_forClassifier.test.ex | Bin 0 -> 9506 bytes 24 files changed, 5867 insertions(+) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.test.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.ex create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java create mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.test.ex diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java new file mode 100644 index 00000000..feb01ebd --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -0,0 +1,77 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.ERiStructure; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.ERqInstance; +import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + +/** + * Created by Parisa on 11/16/15. + */ +public class ERFeatureGenerator extends AbstractFeatureGenerator { + private static final long serialVersionUID = 1L; + public ERFeatureGenerator(){ + + } + public IFeatureVector getFeatureVector (IInstance x, IStructure y){ + ERqInstancePL mx= (ERqInstancePL) x; + ERiStructurePL my=(ERiStructurePL) y; + if (my.Rlables.E1Label().toLowerCase().contains("peop")) + my.fvPeop=mx.E1fv; + if (my.Rlables.E2Label().toLowerCase().contains("peop")) + { + (my.fvPeop).addFeature(mx.E2fv);} + + if (my.Rlables.E1Label().toLowerCase().contains("org")) + my.fvOrg=mx.E1fv; + if (my.Rlables.E2Label().toLowerCase().contains("org")) + my.fvOrg.addFeature(mx.E2fv); + + + my.fvOrg.shift(RunnerPL.lexm().getNumOfFeature()); + my.fv.addFeature(my.fvPeop); + my.fv.addFeature(my.fvOrg); + + if(my.Rlables.RelLabel().toLowerCase().contains("work")) + my.fvWorkFor=mx.Rfv; + my.fvWorkFor.shift((RunnerPL.lexm().getNumOfFeature()*2)); + + my.fv.addFeature(my.fvWorkFor); + + // return my.fv; + + // FeatureVectorBuffer fvb= new FeatureVectorBuffer(my.fv); + //TODO tune fvb indexes + return my.fv.toFeatureVector(); + } + } + + +// List feats = new ArrayList(); + + + /* if (Rlables.E1Label().contains("loc")) + fvLoc=qi.E1fv; + if (Rlables.E2Label().contains("loc")) + fvLoc=FeatureVector.plus(fvLoc,qi.E2fv); + + if (Rlables.E1Label().contains("other")) + fvOther=qi.E2fv; + if (Rlables.E2Label().contains("other")) + fvOther=FeatureVector.plus(fvOther,qi.E2fv); + if (Rlables.E1Label().equalsIgnoreCase("O")) + fvO=qi.E1fv; + if (Rlables.E2Label().equalsIgnoreCase("O")) + fvO=FeatureVector.plus(fvO,qi.E2fv); + + + if (Rlables.RelLabel().contains("Live-in")) + fvLivesIn=qi.Rfv; + if (Rlables.RelLabel().contains("work-for")) + fvWorkFor=qi.Rfv;*/ +//return + + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java new file mode 100755 index 00000000..1d219587 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java @@ -0,0 +1,65 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B49CC2E4E2A4D294555507DCB29CC29A47B4D4C292D2A4D26D07ECFCBC9C90A4C2F09CFCE4DC35821D450B1D558A6582E4DCB2E455821DB00FF0650B258292A2D45B658A5000617B321944000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; + +import java.util.List; + + +public class EntityFeatures extends Classifier +{ + public EntityFeatures() + { + containingPackage = ""; + name = "EntityFeatures"; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete%"; } + + public FeatureVector classify(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'EntityFeatures(ConllRawToken)' defined on line 9 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRawToken t = (ConllRawToken) __example; + + FeatureVector __result; + __result = new FeatureVector(); + String __id; + String __value; + + __id = "" + (t.POS); + __value = "true"; + __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); + return __result; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'EntityFeatures(ConllRawToken)' defined on line 9 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "EntityFeatures".hashCode(); } + public boolean equals(Object o) { return o instanceof EntityFeatures; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java new file mode 100755 index 00000000..47b742b0 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java @@ -0,0 +1,96 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FAC7029EA14A25C5A94959A9C52529FA1EC9F979393149A939852999F97A052A9A05DA0E0109A545C9F971E9F549DE69F54A10413DF815070FF2A4F4CCBCCA20BA348495B24D200172979CDF5000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.PersonWorkFor; + +import java.util.List; + + +public class JointER$subjectto extends ParameterizedConstraint +{ + private static final PersonWorkFor __PersonWorkFor = new PersonWorkFor(); + private static final OrganizationWorkFor __OrganizationWorkFor = new OrganizationWorkFor(); + + public JointER$subjectto() { super("JointER$subjectto"); } + + public String getInputType() { return "ConllRelation"; } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 29 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + { + boolean LBJ2$constraint$result$0; + { + boolean LBJ2$constraint$result$1; + LBJ2$constraint$result$1 = __PersonWorkFor.discreteValue(t).equals("true"); + if (LBJ2$constraint$result$1) + LBJ2$constraint$result$0 = __OrganizationWorkFor.discreteValue(t).equals("true"); + else LBJ2$constraint$result$0 = false; + } + if (!LBJ2$constraint$result$0) return "false"; + } + + return "true"; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'JointER$subjectto(ConllRelation)' defined on line 29 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "JointER$subjectto".hashCode(); } + public boolean equals(Object o) { return o instanceof JointER$subjectto; } + + public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 29 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FirstOrderConstraint __result = new FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = __PersonWorkFor.makeConstraint(t); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = __OrganizationWorkFor.makeConstraint(t); + LBJ2$constraint$result$0 = new FirstOrderConjunction(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java new file mode 100755 index 00000000..0b877e61 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java @@ -0,0 +1,43 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000D6DC13E0280401641EBACF5EEE91C2981588581C31C2034898BCC4239120A48BBBA426747F2F53F85A72329690592B8F9B6C049A341A2937D49393BA0C1BE18819F46FDC316388AD8923FB9AB6E501A91F0DED7C4B4880CCCE3CE65EDEE5EF771E70799C4B1EBAAE334C88DE309EC8F214C8000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.JointER$subjectto; + +import java.util.List; +import java.util.*; + + +public class JointER extends ILPInference +{ + public static ConllRelation findHead(ConllRelation t) + { + return t; + } + + + public JointER() { } + public JointER(ConllRelation head) + { + super(head, new GurobiHook()); + constraint = new JointER$subjectto().makeConstraint(head); + } + + public String getHeadType() { return "ConllRelation"; } + public String[] getHeadFinderTypes() + { + return new String[]{ "ConllRelation" }; + } + + public Normalizer getNormalizer(Learner c) + { + return new Softmax(); + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..8f3e067c766ae6d5460ecdbfc25a336cf3831047 GIT binary patch literal 17618 zcmYhDdmz*O`~UCimRiMKk;>`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTzvwL#06ajMn`Ze=1*5>D}%srWh1Xg(lKMYrOfaU;_iMe|A{=kze-kEbhMHXb5>Z zDrPk5(PA5?k%iBUe6%Kc<7v)Q0pSq8UvOh>7mC`auT3jw?6*5;Ku*TOe!|?gDRt9d zKH5{({`mN<#>ZK_PxzMK?u$-=O?6(Irz8M{wU>X@OG5eZLL%Jt)V(pZFZpN-$DG`1`5&;3wLClD@U3FPR3MpSV)u^%UV zLSVxhJtl-ma2=O};Px!?c#PL?6A`COAo_YydjsyS;cLOke!F8Bo$YO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zr?pc zM8eg6{hs!@Zl_xdA3eNMC2A1lJKv}sbff}sXLoNMRq zY~6M5t=BK{)v5CqJ$>?D!(jFCx+4*nO{}|4@h-kMYra~$cJ;xXTlz9K%WnLBVvDgk zFfu=V*>+!bZEI6IuoeR@Gq@5NdC+Gy_X6O=`*)N7?`{6)2Y9n{?0v9HGRTF2VaZ8$ oh5&CyCJ_e2K_tj>po2(I0rXgs0B=?{kOU(TngZ!|pkWLQ0O#kO6#xJL literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java new file mode 100755 index 00000000..3e918413 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09DCA44C040148F55A9C9CD3894CF9D3DAE146DD50120A44F4E54A776A73913399E1ABB36411FDDD0EEB287D28AF8FAAC705724640D0BBD6445D07C04276B5E4136B83FB0F0490C650737E01905214467D0E1822C4A12570BB461CEB6F48639092C1587484433CF10AEBE7B784A689C15B48E71E6155FC325530B8F77C1BA6836C0993757F86859B357A47C29B851CAB601E9297589385F0FC91549EEE3840B32FF442E82B907AFE398D223D2E2B3E61AE2F26306D70734225D528BA27DB18F10325BDFF3AF561ADD7A90A3382C70D1E534E26909BB5E80D7C9C2F4607957D049CFF203A95FC0166100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class LocClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = LocClassifier.class.getResource("LocClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate LocClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = LocClassifier.class.getResource("LocClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate LocClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (LocClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.test.ex"); } + public static boolean isTraining; + public static LocClassifier instance; + + public static LocClassifier getInstance() + { + loadInstance(); + return instance; + } + + private LocClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "LocClassifier"; + setEncoding(null); + setLabeler(new locLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public LocClassifier() + { + super("LocClassifier"); + isClone = true; + } + + public LocClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public LocClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(LocClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(LocClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(LocClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "LocClassifier"; + setLabeler(new locLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: LocClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + LocClassifier classifier = new LocClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "LocClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof LocClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..8f3e067c766ae6d5460ecdbfc25a336cf3831047 GIT binary patch literal 17618 zcmYhDdmz*O`~UCimRiMKk;>`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTzvwL#06ajMn`Ze=1*5>D}%srW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_tAXDch$FT!HiwxR>f%`1QRXfUDbY?*-PV ztAmu^12_82&;0cG#v;*qQ-Na%=LK`OdGFA^Sr>f%vhu0oqL|CSE~#XvO|E-aGJC&p z|K;;pUxD*?ccyYZ>!@X$a)VEG^~uut*V-pXeScZKd~(>O>(P~ZySGfTTnZeEubz17 zXXr!ETQ{ck1XgW*otO0cVzI?p_u^L~R>w{Ew&|^W4csH#U%K~hqTbJE_ukmTkhdZ3cdzW_sTWr&2OjEbX)%TYUzr?pc zM8eg6{hs!@Zl_xdA3eNMC2A1lJKv}sbff}sXLoNMRq zY~6M5t=BK{)v5CqJ$>?D!(jFCx+4*nO{}|4@h-kMYra~$cJ;xXTlz9K%WnLBVvDgk zFfu=V*>+!bZEI6IuoeR@Gq@5NdC+Gy_X6O=`*)N7?`{6)2Y9n{?0v9HGRTF2VaZ8$ oh5&CyCJ_e2K_tj>po2(I0rXgs0B=?{kOU(TngZ!|pkWLQ0O#kO6#xJL literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..108e5ef0ed31dac675ed95d4361fd5e0421c530b GIT binary patch literal 17129 zcmYg%dpOhm|9^GoPAYCilCnE)<&em33Ck*>@4feWKA(@%)9&_f`{njXN=okeUxOQD9eeqoOx){sRUpD6R zAo$1#n|20fiuOH$L#JVl!TkK-n(-RJ?k;ol*w@1L#dTr+Me4dz z+EVOm`)G~b;fZ@1NakhGUcs%F z#3A>;Es>i#`_cABpGGQklg`ka=^Z;OQ5unC_%*S%L=M@#ye@<*^xEDC?n-=x;aIlv zZkB{VEZ>{XO{R-(=-MQ1MgEDa0H1F>jzZFZJq%h-_ikij7Sn1j$CPDaUj&;q5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$dwbyQS5L}+QR|puoC;bvEz9)l5NlO&k6N7XL{SaP(;kYlpX{D)a+&j3m!N$9|fby#b z4`oT6idM#;Orb@*DvtL>y09jKzNE1YWX!f zEzYF8g=PUkOgwQB(K^9Mt<1`ae6P+^GNtbHK@`y3lt%jvoJB9S65kyMG-G|Fr~jlO z!>Q4b^>t(ygXsZsgFogr+1CxQ|2|d(9!p{T6XLDqrX?_dvQFiR0c}B@SwM(>3M_a2 z7g{i0K7Ao_hheo_Rsf_dPRG*MhODJq1=CvGxL=+p=K3{KKt!9)xDM0t(vqdl(3sSG zIFaE1*i&r2rtUB^&;WX-3@0)@*!;77yghvOmh-%^;SLnMoS4Ff-}WG7 zc?OU$K0@s&U5{kB!uGud4epzMpnkgXO?$01g&4FJJZj8t6>! zS>p@v3!ic*?+SI%^hfru9^_LFV3F^VQ@Ilh={&@cHZ#5jF%Nel7z8lxHj_-7Bc^t#7JZ*1V>}cgfW4Cn>g0fcv-4Ea zw%Y~&K!?nfi7C+^ieXHaF#(SxT&{YxQaRy9B{c@VdU?5;+%?j=r~~(`KE|+Tb<@Xw z$S&;^hex{)h3Y!icHR%ZwhT(1TvfJ5B5)mB`n25+~+@& zyW9&m(`H&GCJl*U9<#rtdmlg+Zo`{06Nkrq5N@omcXcd8QE8?z1$cS?#sZPu_DcOa z)at{{EA|zTX?c!ewu>Qhz5U^~JvdlV4kAmVnAH&98!L0BwA);{g6>e}jGxm6y!%r}iiN_`mW=g&L$3_L)RS0P|%B#>hcb?Tp5k ze6YI`S2HS>3Xu2wTHRDhw9SQu-4Kb^A-hn!+Xp27-%^^pv@)F-7?zx5X9)0SWD;RO hoKJx)2Rfeu6+lm`2=HcQ14%Ffp(&7_2Q-X<0RSK0;`jgn literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java new file mode 100755 index 00000000..57cb81ea --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09BCE43C04C054F75CACA8E2862C3ABA2C20596524AA4545851B14EEC8B9C099AD32BD1AC34CFB311DF506B75AB747EED89C282931C64B54E4F58E9487191DC2DE319E9D24837ED2E1F95A7260F90CDC9346245601D67D8B3AC03852E6169CE9CF37548E38291CE55E00C4748F30437DFAF0C6E8C186B48174E65577270AAB71D8F6878A7D2937A225AEB747CA3C9A33D02A5AA90CCA1059183A1C139770F4505D8EEED941B5A8F84A18A8BA0F7F94C6499D2E838E61A99E5CC1CBB41A7623B138BA9EC6E0F30E46EBAF74FB2A4BCF075C0E055C46DFB4A25D81A4B3E116B91CBC0E079D4304C1F71093AD0A51F6100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class OrganizationClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate OrganizationClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate OrganizationClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (OrganizationClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.test.ex"); } + public static boolean isTraining; + public static OrganizationClassifier instance; + + public static OrganizationClassifier getInstance() + { + loadInstance(); + return instance; + } + + private OrganizationClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "OrganizationClassifier"; + setEncoding(null); + setLabeler(new orgLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public OrganizationClassifier() + { + super("OrganizationClassifier"); + isClone = true; + } + + public OrganizationClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public OrganizationClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(OrganizationClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(OrganizationClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(OrganizationClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "OrganizationClassifier"; + setLabeler(new orgLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: OrganizationClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + OrganizationClassifier classifier = new OrganizationClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "OrganizationClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof OrganizationClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..108e5ef0ed31dac675ed95d4361fd5e0421c530b GIT binary patch literal 17129 zcmYg%dpOhm|9^GoPAYCilCnE)<&em33Ck*>@4feWKA(@%)9&_f`{njXN=okeUxOQD9eeqoOx){sRUpD6R zAo$1#n|20fiuOH$L#JVl!TkK-n(-RJ?k;ol*w@1L#dTr+Me4dz z+EVOm`)G~b;fZ@1NakhGUcs%F z#3A>;Es>i#`_cABpGGQklg`ka=^Z;OQ5unC_%*S%L=M@#ye@<*^xEDC?n-=x;aIlv zZkB{VEZ>{XO{R-(=-MQ1MgEDa0H1F>jzZFZJq%h-_ikij7Sn1j$CPDaUj&;q5Ffpe zv^9V}t`C>98i8o(<``uUDoLe-cdCB0(BCZ$zmvn|P)t`#s^*jfM1eT@6Db^vL%NRX zuLcj&^8^PJ<^-$8aHO*8m-wnZCEw@m6Uy8}T9ly7?u|1C3yhKA?waog8oFN%+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tbHK@`y3lt%jvoJB9S65kyMG-G|Fr~jlO z!>Q4b^>t(ygXsZsgFogr+1CxQ|2|d(9!p{T6XLDqrX?_dvQFiR0c}B@SwM(>3M_a2 z7g{i0K7Ao_hheo_Rsf_dPRG*MhODJq1=CvGxL=+p=K3{KKt!9)xDM0t(vqdl(3sSG zIFaE1*i&r2rtUB^&;WX-3@0)@*!;77yghvOmh-%^;SLnMoS4Ff-}WG7 zc?OU$K0@s&U5{kB!uGud4epzMpnkgXO?$01g&4FJJZj8t6>! zS>p@v3!ic*?+SI%^hfru9^_LFV3F^VQ@Ilh={&@cHZ#5jF%Nel7z8lxHj_-7Bc^t#7JZ*1V>}cgfW4Cn>g0fcv-4Ea zw%Y~&K!?nfi7C+^ieXHaF#(SxT&{YxQaRy9B{c@VdU?5;+%?j=r~~(`KE|+Tb<@Xw z$S&;^hex{)h3Y!icHR%ZwhT(1TvfJ5B5)mB`n25+~+@& zyW9&m(`H&GCJl*U9<#rtdmlg+Zo`{06Nkrq5N@omcXcd8QE8?z1$cS?#sZPu_DcOa z)at{{EA|zTX?c!ewu>Qhz5U^~JvdlV4kAmVnAH&98!L0BwA);{g6>e}jGxm6y!%r}iiN_`mW=g&L$3_L)RS0P|%B#>hcb?Tp5k ze6YI`S2HS>3Xu2wTHRDhw9SQu-4Kb^A-hn!+Xp27-%^^pv@)F-7?zx5X9)0SWD;RO hoKJx)2Rfeu6+lm`2=HcQ14%Ffp(&7_2Q-X<0RSK0;`jgn literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java new file mode 100755 index 00000000..448e033a --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java @@ -0,0 +1,93 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class OrganizationWorkFor extends ParameterizedConstraint +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + private static final OrganizationClassifier __OrganizationClassifier = new OrganizationClassifier(); + + public OrganizationWorkFor() { super("OrganizationWorkFor"); } + + public String getInputType() { return "ConllRelation"; } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + { + boolean LBJ2$constraint$result$0; + { + boolean LBJ2$constraint$result$1; + LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); + if (LBJ2$constraint$result$1) + LBJ2$constraint$result$0 = ("" + (__OrganizationClassifier.discreteValue(t.e2))).equals("" + (true)); + else LBJ2$constraint$result$0 = true; + } + if (!LBJ2$constraint$result$0) return "false"; + } + + return "true"; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "OrganizationWorkFor".hashCode(); } + public boolean equals(Object o) { return o instanceof OrganizationWorkFor; } + + public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FirstOrderConstraint __result = new FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__OrganizationClassifier, t.e2), "" + (true)); + LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1 GIT binary patch literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wbq`~EzB|NQ*r;g5Ok{k~q;^*mir4Ty(?+q=m5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#mF^-n<6nU@Fc7H_?DEc6|45NW2f>-k_{Ox}x}TD5rg`7qYUpZ*xQ zZO^$Mv*h{RO21zo+HYIAgO|=11un$&`aAhe^o_OWrZ2j>cDwOYW#BmiS@C~mYHmHT zo7=11sb1OUdo8#0^UZULbuT{MS*v#FBfnX*WI&rf1~Msa&z(X*$k1ExA0n0 z>b&PX=PlQ`2J!WKtiCk=ec0!StINF~-fXq>%>NS~;LXlauicdO$eDp*$w_vG0B=Sn i5eCG;Ajoo{gF#RM^q7zUZ&o&t1S1fd0%>s<5Dx%*;z&IJ literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java new file mode 100755 index 00000000..01529f7e --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09DCE43C04C048F55CAC98E1862CF4F45830A2DA48459041831714667DD469C6CBB2BD12024CBB3BA6F518BE86664FDC8F0AE48C80E984431F622AA68340293BD42E81B5C9F52D04C06B08B93788482C09F86DD3EB35489430770B56B06FDB324B94841E0296406A91E8D1DC5FBD30BA12B3A690D79AEAAEE3D845F094CF70E85FE35C8127AC5FD3A16DEE4995AB429BA50CAA109431B7589385F0FC91549EEE3940B32F50AD156394CF3726B203D269537B0DC2F26D06D7073039A611EA69BA53CF2819ADEEF19F2B0D6FBC40D9145E38E0FA127554C4D59324F172BC391C563D001BFF30A3599ED9C6100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class PersonClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = PersonClassifier.class.getResource("PersonClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate PersonClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = PersonClassifier.class.getResource("PersonClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate PersonClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (PersonClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.test.ex"); } + public static boolean isTraining; + public static PersonClassifier instance; + + public static PersonClassifier getInstance() + { + loadInstance(); + return instance; + } + + private PersonClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "PersonClassifier"; + setEncoding(null); + setLabeler(new personLabel()); + setExtractor(new EntityFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public PersonClassifier() + { + super("PersonClassifier"); + isClone = true; + } + + public PersonClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public PersonClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(PersonClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(PersonClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(PersonClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "PersonClassifier"; + setLabeler(new personLabel()); + setExtractor(new EntityFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRawToken || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRawToken || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: PersonClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + PersonClassifier classifier = new PersonClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "PersonClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof PersonClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1 GIT binary patch literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wb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JpdKPXM>ipW5ni%yl<#Yy8(= z0l+OJTvPXDe3#mF^-n<6nU@Fc7H_?DEc6|45NW2f>-k_{Ox}x}TD5rg`7qYUpZ*xQ zZO^$Mv*h{RO21zo+HYIAgO|=11un$&`aAhe^o_OWrZ2j>cDwOYW#BmiS@C~mYHmHT zo7=11sb1OUdo8#0^UZULbuT{MS*v#FBfnX*WI&rf1~Msa&z(X*$k1ExA0n0 z>b&PX=PlQ`2J!WKtiCk=ec0!StINF~-fXq>%>NS~;LXlauicdO$eDp*$w_vG0B=Sn i5eCG;Ajoo{gF#RM^q7zUZ&o&t1S1fd0%>s<5Dx%*;z&IJ literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java new file mode 100755 index 00000000..9bac6434 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java @@ -0,0 +1,93 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class PersonWorkFor extends ParameterizedConstraint +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + private static final PersonClassifier __PersonClassifier = new PersonClassifier(); + + public PersonWorkFor() { super("PersonWorkFor"); } + + public String getInputType() { return "ConllRelation"; } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + { + boolean LBJ2$constraint$result$0; + { + boolean LBJ2$constraint$result$1; + LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); + if (LBJ2$constraint$result$1) + LBJ2$constraint$result$0 = ("" + (__PersonClassifier.discreteValue(t.e1))).equals("" + (true)); + else LBJ2$constraint$result$0 = true; + } + if (!LBJ2$constraint$result$0) return "false"; + } + + return "true"; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "PersonWorkFor".hashCode(); } + public boolean equals(Object o) { return o instanceof PersonWorkFor; } + + public FirstOrderConstraint makeConstraint(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + FirstOrderConstraint __result = new FirstOrderConstant(true); + + { + FirstOrderConstraint LBJ2$constraint$result$0 = null; + { + FirstOrderConstraint LBJ2$constraint$result$1 = null; + LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); + FirstOrderConstraint LBJ2$constraint$result$2 = null; + LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__PersonClassifier, t.e1), "" + (true)); + LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); + } + __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); + } + + return __result; + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java new file mode 100755 index 00000000..bb885a11 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java @@ -0,0 +1,90 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// discrete RelArgsClassifier(ConllRelation r) <- JointER(work_forClassifier) + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class RelArgsClassifier extends Classifier +{ + private static final work_forClassifier __work_forClassifier = new work_forClassifier(); + + public RelArgsClassifier() + { + containingPackage = ""; + name = "RelArgsClassifier"; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "*", "*" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation head = JointER.findHead((ConllRelation) __example); + JointER inference = (JointER) InferenceManager.get("JointER", head); + + if (inference == null) + { + inference = new JointER(head); + InferenceManager.put(inference); + } + + String result = null; + + try { result = inference.valueOf(__work_forClassifier, __example); } + catch (Exception e) + { + System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); + e.printStackTrace(); + System.exit(1); + } + + return result; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "RelArgsClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof RelArgsClassifier; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java new file mode 100755 index 00000000..1cefef75 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java @@ -0,0 +1,66 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class RelationFeatures extends Classifier +{ + public RelationFeatures() + { + containingPackage = ""; + name = "RelationFeatures"; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete%"; } + + public FeatureVector classify(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + ConllRelation t = (ConllRelation) __example; + + FeatureVector __result; + __result = new FeatureVector(); + String __id; + String __value; + + __id = "" + (("WORD1:" + t.s.sentTokens.elementAt(t.wordId1).phrase)); + __value = "true"; + __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); + __id = "" + (("WORD2:" + t.s.sentTokens.elementAt(t.wordId2).phrase)); + __value = "true"; + __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); + return __result; + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "RelationFeatures".hashCode(); } + public boolean equals(Object o) { return o instanceof RelationFeatures; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java new file mode 100755 index 00000000..427e9b46 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000D4C814A02C034144FA234659086F20577D590D594F2013E825CFCF8629254A4EEEDA222EA606ED3ED56CC121B0713D7C066703AFEDA0981A7F76A8DE2AA8C9CFC34CB3515C1E0B7C281FA0B5A1A691E5F063C7E4E52F1F6A131B3F996F3137E6317B6F4941FD7A5450523FF18EF84D512E3B0EA6D8000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class locLabel extends Classifier +{ + public locLabel() + { + containingPackage = ""; + name = "locLabel"; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Loc", "nLoc" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'locLabel' defined on line 40 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Loc")) + { + return "Loc"; + } + else + { + return "nLoc"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "locLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof locLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java new file mode 100755 index 00000000..da2f14f2 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class orgLabel extends Classifier +{ + public orgLabel() + { + containingPackage = ""; + name = "orgLabel"; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Org", "nOrg" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'orgLabel' defined on line 64 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Org")) + { + return "Org"; + } + else + { + return "nOrg"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "orgLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof orgLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java new file mode 100755 index 00000000..2d599e25 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class personLabel extends Classifier +{ + public personLabel() + { + containingPackage = ""; + name = "personLabel"; + } + + public String getInputType() { return "ConllRawToken"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Per", "nPer" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRawToken)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'personLabel' defined on line 17 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRawToken t = (ConllRawToken) __example; + + if (t.entType.equalsIgnoreCase("Peop")) + { + return "Per"; + } + else + { + return "nPer"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRawToken[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "personLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof personLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java new file mode 100755 index 00000000..0dba1dad --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java @@ -0,0 +1,91 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + +public class workLabel extends Classifier +{ + public workLabel() + { + containingPackage = ""; + name = "workLabel"; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete"; } + + private static String[] __allowableValues = new String[]{ "Works", "nWorks" }; + public static String[] getAllowableValues() { return __allowableValues; } + public String[] allowableValues() { return __allowableValues; } + + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public Feature featureValue(Object __example) + { + String result = discreteValue(__example); + return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); + } + + public String discreteValue(Object __example) + { + if (!(__example instanceof ConllRelation)) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + String __cachedValue = _discreteValue(__example); + + if (valueIndexOf(__cachedValue) == -1) + { + System.err.println("Classifier 'workLabel' defined on line 88 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); + System.exit(1); + } + + return __cachedValue; + } + + private String _discreteValue(Object __example) + { + ConllRelation t = (ConllRelation) __example; + + if (t.relType.equalsIgnoreCase("Work_For")) + { + return "Works"; + } + else + { + return "nWorks"; + } + } + + public FeatureVector[] classify(Object[] examples) + { + if (!(examples instanceof ConllRelation[])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + return super.classify(examples); + } + + public int hashCode() { return "workLabel".hashCode(); } + public boolean equals(Object o) { return o instanceof workLabel; } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.ex new file mode 100755 index 0000000000000000000000000000000000000000..56277adf24ea6a01e937e2ecbdabe4c4d36648e1 GIT binary patch literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0r5VC%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r{v@(Kj{ceRqHJKOaN%_!pnOl(Xkg&6UIrIsVG%5sdk^r`TcEO&mS5^3Ror zuJ?BPyxF+1a%1mx1B)eg*LR)#_3&TsESGQm;m)()*9E0qKeE*5>hi>$g+VKJueYjo z1Wsminx!wbTr6*O{fvh=dZ6@$m?$n%zuXZc9_J^0>F7uahNK7%s!xYO9r;x^g79Rx zC~u*|=pStn4VDfy&!n#|yCw6QUEu@@E6D-CG<-ZDq^Ca$#%RAi^E9iC;5{ZV(nbwl ze!5*D8dNkH#u%=Je?RlIdQmjS z9UMpG_>=@9CcxguahpNx5{3U-PROfA_gA16J;i8o$8q0HDWV&6<+(sw8~Jsw^xC6V zeK_DuVndrW>rqmsHe4UBqrex>jE(e?Lxr5vX~upY9jVfFE;LX0*qQ=5Dy@nJ4- zy^Z{~m%Kd6&=wG+W@+CTz_t{4MT6HtA$Ipz7$sDlNdC}E#zgVA$@ylGc$HdQHfQ93 zFq47gT=L2&!WQ{nZFwfK1|i$3t&O#V6u655+cZ2_0TtevyQ_!%*s$6ObQ+xhEtzZ@ zRpTP>Q-JXffZnK|1(f${es3~hIU4E=)_9La8o-y%B(}EkmPFCfbA$8WB?E4wFhdWv zXejv}qw7;I&5hCQf$Rk#%o66@_>j74y@NS{t+M_sQ?b9q> zvdTuS$_7yno_CR&Pw)isypr%K^6@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z7TYpj)m6a zb9_5a;4n*gtolsmz zZ#F4^s^Ujf@#oUi@0&~c9juzwGhcUv!6RBCo7b=g0$1BVxBw(`#7S$13WLPs)><6# zCt+b~AQvAX{d0%Eur9R5d|0x$fYE`LEA3*zkOJB3FUKdPUDDNIxxqvh$vwAByBt5&o~}37f~MTVO$UT^GxvA+31!)m zZ0mTa+s~GqmiM7#Js2c?gN6yx8vA&KDHP_BSM$}4rjaR65|F+|ndZ0U*{{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G literal 0 HcmV?d00001 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java new file mode 100755 index 00000000..e4fc5a2c --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java @@ -0,0 +1,1220 @@ +// Modifying this comment will cause the next execution of LBJava to overwrite this file. +// F1B88000000000000000DA09BCE43C04C054F75CACA8E2842C3ABA2D50A24755904167C6A239172912391F8C6780212EFD915BAEF10BDBA3EBA37DECB6B24640B0BC87CE85671055D77E94EA67C13486820A97E806B2878B6804821F40F10F3820CCAE36F07186F4863B092472C3144A50E4D15FDF1F244348E275715D0C315532B8BF4C9AA30780E317AAE90D0BA6FC7356BC29A851CAB601E93A3585CBD00F690549E1FB840B727FA42D25231E8F3767BCA3D06ED3B58ABCB9D08D0EBD1329A6E0EEAC5F60E71C84D6FFF8E7948E9FBD40B5382C97D1FDD7A2278CD7E748EBCC696638BDAB60A8EEF01CF3394BE6100000 + +import edu.illinois.cs.cogcomp.core.io.LineIO; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.*; +import java.util.List; + + + + +public class work_forClassifier extends SparseAveragedPerceptron +{ + private static java.net.URL _lcFilePath; + private static java.net.URL _lexFilePath; + + static + { + _lcFilePath = work_forClassifier.class.getResource("work_forClassifier.lc"); + + if (_lcFilePath == null) + { + System.err.println("ERROR: Can't locate work_forClassifier.lc in the class path."); + System.exit(1); + } + + _lexFilePath = work_forClassifier.class.getResource("work_forClassifier.lex"); + + if (_lexFilePath == null) + { + System.err.println("ERROR: Can't locate work_forClassifier.lex in the class path."); + System.exit(1); + } + } + + private static void loadInstance() + { + if (instance == null) + { + instance = (work_forClassifier) Learner.readLearner(_lcFilePath); + instance.readLexiconOnDemand(_lexFilePath); + } + } + + public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.ex"); } + public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.test.ex"); } + public static boolean isTraining; + public static work_forClassifier instance; + + public static work_forClassifier getInstance() + { + loadInstance(); + return instance; + } + + private work_forClassifier(boolean b) + { + super(new Parameters()); + containingPackage = ""; + name = "work_forClassifier"; + setEncoding(null); + setLabeler(new workLabel()); + setExtractor(new RelationFeatures()); + isClone = false; + } + + public static TestingMetric getTestingMetric() { return null; } + + + private boolean isClone; + + public void unclone() { isClone = false; } + + public work_forClassifier() + { + super("work_forClassifier"); + isClone = true; + } + + public work_forClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } + + public work_forClassifier(Parameters p, String modelPath, String lexiconPath) { + super(p); + try { + lcFilePath = new java.net.URL("file:" + modelPath); + lexFilePath = new java.net.URL("file:" + lexiconPath); + } + catch (Exception e) { + System.err.println("ERROR: Can't create model or lexicon URL: " + e); + e.printStackTrace(); + System.exit(1); + } + + if (new java.io.File(modelPath).exists()) { + readModel(lcFilePath); + readLexiconOnDemand(lexFilePath); + } + else if (IOUtilities.existsInClasspath(work_forClassifier.class, modelPath)) { + readModel(IOUtilities.loadFromClasspath(work_forClassifier.class, modelPath)); + readLexiconOnDemand(IOUtilities.loadFromClasspath(work_forClassifier.class, lexiconPath)); + } + else { + containingPackage = ""; + name = "work_forClassifier"; + setLabeler(new workLabel()); + setExtractor(new RelationFeatures()); + } + + isClone = false; + } + + public String getInputType() { return "ConllRelation"; } + public String getOutputType() { return "discrete"; } + + public void learn(Object example) + { + if (isClone) + { + if (!(example instanceof ConllRelation || example instanceof Object[])) + { + String type = example == null ? "null" : example.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(example); + return; + } + + if (example instanceof Object[]) + { + Object[] a = (Object[]) example; + if (a[0] instanceof int[]) + { + super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); + return; + } + } + + super.learn(example); + } + + public void learn(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + instance.learn(examples); + return; + } + + super.learn(examples); + } + + public Feature featureValue(Object __example) + { + if (isClone) + { + if (!(__example instanceof ConllRelation || __example instanceof Object[])) + { + String type = __example == null ? "null" : __example.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.featureValue(__example); + } + + if (__example instanceof Object[]) + { + Object[] a = (Object[]) __example; + if (a[0] instanceof int[]) + return super.featureValue((int[]) a[0], (double[]) a[1]); + } + + Feature __result; + __result = super.featureValue(__example); + return __result; + } + + public FeatureVector classify(Object __example) + { + return new FeatureVector(featureValue(__example)); + } + + public String discreteValue(Object __example) + { + return featureValue(__example).getStringValue(); + } + + public FeatureVector[] classify(Object[] examples) + { + if (isClone) + { + if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) + { + String type = examples == null ? "null" : examples.getClass().getName(); + System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); + new Exception().printStackTrace(); + System.exit(1); + } + + loadInstance(); + return instance.classify(examples); + } + + FeatureVector[] result = super.classify(examples); + return result; + } + + public static void main(String[] args) + { + String testParserName = null; + String testFile = null; + Parser testParser = getTestParser(); + + try + { + if (!args[0].equals("null")) + testParserName = args[0]; + if (args.length > 1) testFile = args[1]; + + if (testParserName == null && testParser == null) + { + System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); + System.err.println("generated this classifier, so a parser and input file must be specified.\n"); + throw new Exception(); + } + } + catch (Exception e) + { + System.err.println("usage: work_forClassifier \\"); + System.err.println(" [ [ ...]]\n"); + System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); + System.err.println(" to use the default as specified by the \"testFrom\" clause."); + System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); + System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); + System.err.println(" specified by the \"testFrom\" clause has a single string argument"); + System.err.println(" constructor) to use an alternate file."); + System.err.println(" * A is a label (or prediction) that should not count towards"); + System.err.println(" overall precision and recall assessments."); + System.exit(1); + } + + if (testParserName == null && testFile != null && !testFile.equals("null")) + testParserName = testParser.getClass().getName(); + if (testParserName != null) + testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); + work_forClassifier classifier = new work_forClassifier(); + TestDiscrete tester = new TestDiscrete(); + for (int i = 2; i < args.length; ++i) + tester.addNull(args[i]); + TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); + } + + public int hashCode() { return "work_forClassifier".hashCode(); } + public boolean equals(Object o) { return o instanceof work_forClassifier; } + + public void write(java.io.PrintStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) + { + if (isClone) + { + loadInstance(); + instance.write(a0); + return; + } + + super.write(a0); + } + + public void initialize(int a0, int a1) + { + if (isClone) + { + loadInstance(); + instance.initialize(a0, a1); + return; + } + + super.initialize(a0, a1); + } + + public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.read(a0); + return; + } + + super.read(a0); + } + + public void learn(int[] a0, double[] a1, int[] a2, double[] a3) + { + if (isClone) + { + loadInstance(); + instance.learn(a0, a1, a2, a3); + return; + } + + super.learn(a0, a1, a2, a3); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() + { + if (isClone) + { + loadInstance(); + return instance.getParameters(); + } + + return super.getParameters(); + } + + public double score(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.score(a0, a1); + } + + return super.score(a0, a1); + } + + public void promote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.promote(a0, a1, a2); + return; + } + + super.promote(a0, a1, a2); + } + + public void demote(int[] a0, double[] a1, double a2) + { + if (isClone) + { + loadInstance(); + instance.demote(a0, a1, a2); + return; + } + + super.demote(a0, a1, a2); + } + + public void forget() + { + if (isClone) + { + loadInstance(); + instance.forget(); + return; + } + + super.forget(); + } + + public void setLearningRate(double a0) + { + if (isClone) + { + loadInstance(); + instance.setLearningRate(a0); + return; + } + + super.setLearningRate(a0); + } + + public double getLearningRate() + { + if (isClone) + { + loadInstance(); + return instance.getLearningRate(); + } + + return super.getLearningRate(); + } + + public void setThreshold(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThreshold(a0); + return; + } + + super.setThreshold(a0); + } + + public java.lang.String discreteValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0, a1); + } + + return super.discreteValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0, a1); + } + + return super.featureValue(a0, a1); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0, a1); + } + + return super.classify(a0, a1); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public double score(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.score(a0); + } + + return super.score(a0); + } + + public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setLabeler(a0); + return; + } + + super.setLabeler(a0); + } + + public double getInitialWeight() + { + if (isClone) + { + loadInstance(); + return instance.getInitialWeight(); + } + + return super.getInitialWeight(); + } + + public void setInitialWeight(double a0) + { + if (isClone) + { + loadInstance(); + instance.setInitialWeight(a0); + return; + } + + super.setInitialWeight(a0); + } + + public double getThreshold() + { + if (isClone) + { + loadInstance(); + return instance.getThreshold(); + } + + return super.getThreshold(); + } + + public double getPositiveThickness() + { + if (isClone) + { + loadInstance(); + return instance.getPositiveThickness(); + } + + return super.getPositiveThickness(); + } + + public void setPositiveThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setPositiveThickness(a0); + return; + } + + super.setPositiveThickness(a0); + } + + public double getNegativeThickness() + { + if (isClone) + { + loadInstance(); + return instance.getNegativeThickness(); + } + + return super.getNegativeThickness(); + } + + public void setNegativeThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setNegativeThickness(a0); + return; + } + + super.setNegativeThickness(a0); + } + + public void setThickness(double a0) + { + if (isClone) + { + loadInstance(); + instance.setThickness(a0); + return; + } + + super.setThickness(a0); + } + + public boolean shouldPromote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldPromote(a0, a1, a2, a3); + } + + return super.shouldPromote(a0, a1, a2, a3); + } + + public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) + { + if (isClone) + { + loadInstance(); + return instance.computeLearningRate(a0, a1, a2, a3); + } + + return super.computeLearningRate(a0, a1, a2, a3); + } + + public boolean shouldDemote(boolean a0, double a1, double a2, double a3) + { + if (isClone) + { + loadInstance(); + return instance.shouldDemote(a0, a1, a2, a3); + } + + return super.shouldDemote(a0, a1, a2, a3); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0, a1); + } + + return super.scores(a0, a1); + } + + public void write(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.write(a0, a1); + return; + } + + super.write(a0, a1); + } + + public void save() + { + if (isClone) + { + loadInstance(); + instance.save(); + return; + } + + super.save(); + } + + public void read(java.lang.String a0, java.lang.String a1) + { + if (isClone) + { + loadInstance(); + instance.read(a0, a1); + return; + } + + super.read(a0, a1); + } + + public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0); + } + + return super.realValue(a0); + } + + public double realValue(int[] a0, double[] a1) + { + if (isClone) + { + loadInstance(); + return instance.realValue(a0, a1); + } + + return super.realValue(a0, a1); + } + + public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.discreteValue(a0); + } + + return super.discreteValue(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.featureValue(a0); + } + + return super.featureValue(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + instance.learn(a0); + return; + } + + super.learn(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) + { + if (isClone) + { + loadInstance(); + return instance.classify(a0); + } + + return super.classify(a0); + } + + public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) + { + if (isClone) + { + loadInstance(); + instance.setParameters(a0); + return; + } + + super.setParameters(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() + { + if (isClone) + { + loadInstance(); + return instance.emptyClone(); + } + + return super.emptyClone(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) + { + if (isClone) + { + loadInstance(); + return instance.scores(a0); + } + + return super.scores(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0); + } + + return super.getExampleArray(a0); + } + + public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) + { + if (isClone) + { + loadInstance(); + return instance.getExampleArray(a0, a1); + } + + return super.getExampleArray(a0, a1); + } + + public void readLexiconOnDemand(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public void readLexiconOnDemand(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexiconOnDemand(a0); + return; + } + + super.readLexiconOnDemand(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() + { + if (isClone) + { + loadInstance(); + return instance.demandLexicon(); + } + + return super.demandLexicon(); + } + + public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) + { + if (isClone) + { + loadInstance(); + instance.setExtractor(a0); + return; + } + + super.setExtractor(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() + { + if (isClone) + { + loadInstance(); + return instance.getLabeler(); + } + + return super.getLabeler(); + } + + public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() + { + if (isClone) + { + loadInstance(); + return instance.getExtractor(); + } + + return super.getExtractor(); + } + + public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLexicon(a0); + return; + } + + super.setLexicon(a0); + } + + public void setEncoding(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setEncoding(a0); + return; + } + + super.setEncoding(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLexicon(); + } + + return super.getLexicon(); + } + + public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) + { + if (isClone) + { + loadInstance(); + instance.setLabelLexicon(a0); + return; + } + + super.setLabelLexicon(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() + { + if (isClone) + { + loadInstance(); + return instance.getLabelLexicon(); + } + + return super.getLabelLexicon(); + } + + public void setModelLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public void setModelLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setModelLocation(a0); + return; + } + + super.setModelLocation(a0); + } + + public java.net.URL getModelLocation() + { + if (isClone) + { + loadInstance(); + return instance.getModelLocation(); + } + + return super.getModelLocation(); + } + + public void setLexiconLocation(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public void setLexiconLocation(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.setLexiconLocation(a0); + return; + } + + super.setLexiconLocation(a0); + } + + public java.net.URL getLexiconLocation() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconLocation(); + } + + return super.getLexiconLocation(); + } + + public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) + { + if (isClone) + { + loadInstance(); + instance.countFeatures(a0); + return; + } + + super.countFeatures(a0); + } + + public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() + { + if (isClone) + { + loadInstance(); + return instance.getLexiconDiscardCounts(); + } + + return super.getLexiconDiscardCounts(); + } + + public void readLexicon(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void readLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readLexicon(a0); + return; + } + + super.readLexicon(a0); + } + + public void doneLearning() + { + if (isClone) + { + loadInstance(); + instance.doneLearning(); + return; + } + + super.doneLearning(); + } + + public void doneWithRound() + { + if (isClone) + { + loadInstance(); + instance.doneWithRound(); + return; + } + + super.doneWithRound(); + } + + public int getPrunedLexiconSize() + { + if (isClone) + { + loadInstance(); + return instance.getPrunedLexiconSize(); + } + + return super.getPrunedLexiconSize(); + } + + public void saveModel() + { + if (isClone) + { + loadInstance(); + instance.saveModel(); + return; + } + + super.saveModel(); + } + + public void saveLexicon() + { + if (isClone) + { + loadInstance(); + instance.saveLexicon(); + return; + } + + super.saveLexicon(); + } + + public void writeModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeModel(a0); + return; + } + + super.writeModel(a0); + } + + public void writeLexicon(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.writeLexicon(a0); + return; + } + + super.writeLexicon(a0); + } + + public void readModel(java.lang.String a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readModel(java.net.URL a0) + { + if (isClone) + { + loadInstance(); + instance.readModel(a0); + return; + } + + super.readModel(a0); + } + + public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) + { + if (isClone) + { + loadInstance(); + instance.readLabelLexicon(a0); + return; + } + + super.readLabelLexicon(a0); + } + + public static class Parameters extends SparseAveragedPerceptron.Parameters + { + public Parameters() + { + learningRate = 0.1; + thickness = 3.5; + } + } +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.test.ex new file mode 100755 index 0000000000000000000000000000000000000000..56277adf24ea6a01e937e2ecbdabe4c4d36648e1 GIT binary patch literal 9506 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{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G literal 0 HcmV?d00001 From 61aea921bb69e86187df544c801068e0f0008055 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 17 Nov 2015 10:30:21 -0600 Subject: [PATCH 005/118] modified the ILP version of ER --- .../SL_SVM/iJLIS2/JointER$subjectto.java | 2 +- .../SL_SVM/iJLIS2/OrganizationClassifier.java | 16 +++++----- .../SL_SVM/iJLIS2/OrganizationWorkFor.java | 4 +-- .../SL_SVM/iJLIS2/PersonClassifier.java | 32 +++++++------------ .../SL_SVM/iJLIS2/PersonWorkFor.java | 7 ++-- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 2 -- .../SL_SVM/iJLIS2/mYjava/EntityFeatures.java | 2 +- .../iJLIS2/mYjava/JointER$subjectto.java | 3 +- .../SL_SVM/iJLIS2/mYjava/LocClassifier.java | 4 ++- .../iJLIS2/mYjava/OrganizationClassifier.java | 5 ++- .../iJLIS2/mYjava/OrganizationWorkFor.java | 6 +++- .../iJLIS2/mYjava/PersonClassifier.java | 5 ++- .../SL_SVM/iJLIS2/mYjava/PersonWorkFor.java | 6 +++- .../iJLIS2/mYjava/RelArgsClassifier.java | 6 +++- .../iJLIS2/mYjava/RelationFeatures.java | 4 ++- .../SL_SVM/iJLIS2/mYjava/locLabel.java | 4 ++- .../SL_SVM/iJLIS2/mYjava/orgLabel.java | 9 +++--- .../SL_SVM/iJLIS2/mYjava/personLabel.java | 4 ++- .../SL_SVM/iJLIS2/mYjava/workLabel.java | 9 +++--- .../iJLIS2/mYjava/work_forClassifier.java | 7 ++-- .../SL_SVM/iJLIS2/orgLabel.java | 7 ++-- .../SL_SVM/iJLIS2/personLabel.java | 11 ++++--- .../datamodel/GraphQueriesTest.scala | 6 ++-- 23 files changed, 87 insertions(+), 74 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java index f2e7cc27..9f0781b1 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java @@ -61,7 +61,7 @@ public FeatureVector[] classify(Object[] examples) public int hashCode() { return "JointER$subjectto".hashCode(); } public boolean equals(Object o) { return o instanceof JointER$subjectto; } - public Constraint makeConstraint(Object __example) + public FirstOrderConstraint makeConstraint(Object __example) { if (!(__example instanceof ConllRelation)) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java index 648c8337..f5d70372 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java @@ -7,15 +7,15 @@ //import util.ExceptionlessOutputStream; //import LBJ.learn.SparseAveragedPerceptron; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser; +import edu.illinois.cs.cogcomp.lbjava.parse.Parser; +import edu.illinois.cs.cogcomp.lbjava.util.ClassUtils; +import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream; +import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import LBJ2.classify.*; -import LBJ2.learn.*; -import LBJ2.parse.ArrayFileParser; -import LBJ2.parse.Parser; -import LBJ2.util.ClassUtils; -import LBJ2.util.ExceptionlessInputStream; -import LBJ2.util.ExceptionlessOutputStream; -import ml.wolfe.examples.parisa.ConllRawToken; //import learn.*; public class OrganizationClassifier extends SparseAveragedPerceptron { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java index 007e1b10..3ef04dbb 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java @@ -5,11 +5,9 @@ import edu.illinois.cs.cogcomp.lbjava.infer.*; - - +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.OrganizationClassifier; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; -import ml.wolfe.examples.parisa.ConllRelation; public class OrganizationWorkFor extends ParameterizedConstraint { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java index d6718bcc..0ffadfe7 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java @@ -4,26 +4,18 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -/*import Classifier; -import SparseAveragedPerceptron; -import util.ClassUtils; -import util.ExceptionlessInputStream; -import util.ExceptionlessOutputStream;*/ - -//import LBJ.SparseAveragedPerceptron; -// -//import LBJ.LBJ2.SparseAveragedPerceptron; - -import LBJ2.classify.*; -import LBJ2.learn.*; -import LBJ2.parse.ArrayFileParser; -import LBJ2.parse.Parser; -import LBJ2.util.ClassUtils; -import LBJ2.util.ExceptionlessInputStream; -import LBJ2.util.ExceptionlessOutputStream; -import ml.wolfe.examples.parisa.ConllRawToken; +import edu.illinois.cs.cogcomp.lbjava.classify.*; +import edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron; +import edu.illinois.cs.cogcomp.lbjava.learn.*; +import edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser; +import edu.illinois.cs.cogcomp.lbjava.parse.Parser; +import edu.illinois.cs.cogcomp.lbjava.util.ClassUtils; +import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream; +import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; + public class PersonClassifier extends SparseAveragedPerceptron { private static java.net.URL _lcFilePath; @@ -57,7 +49,7 @@ private static void loadInstance() } } - public static Parser getParser() { return new ArrayFileParser("PersonClassifier.ex"); } + public static Parser getParser() { return new ArrayFileParser("PersonClassifier.ex"); } public static Parser getTestParser() { return new ArrayFileParser("PersonClassifier.test.ex"); } public static boolean isTraining; public static PersonClassifier instance; @@ -638,7 +630,7 @@ public boolean shouldDemote(boolean a0, double a1, double a2, double a3) return super.shouldDemote(a0, a1, a2, a3); } - public ScoreSet scores(int[] a0, double[] a1) + public ScoreSet scores(int[] a0, double[] a1) { if (isClone) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java index 798cbfa7..5cb74743 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java @@ -2,10 +2,9 @@ // F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import LBJ2.classify.FeatureVector; -import LBJ2.infer.*; -import ml.wolfe.examples.parisa.ConllRelation; - +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.lbjava.infer.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; public class PersonWorkFor extends ParameterizedConstraint { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java index 388796e4..5b6de760 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java @@ -2,9 +2,7 @@ import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; import edu.illinois.cs.cogcomp.lbjava.infer.InferenceManager; -import edu.illinois.cs.cogcomp.lbjava.learn.Learner; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.ERiStructure; import edu.illinois.cs.cogcomp.sl.core.AbstractInferenceSolver; import edu.illinois.cs.cogcomp.sl.core.IInstance; import edu.illinois.cs.cogcomp.sl.core.IStructure; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java index 1d219587..553c0f36 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B49CC2E4E2A4D294555507DCB29CC29A47B4D4C292D2A4D26D07ECFCBC9C90A4C2F09CFCE4DC35821D450B1D558A6582E4DCB2E455821DB00FF0650B258292A2D45B658A5000617B321944000000 import edu.illinois.cs.cogcomp.core.io.LineIO; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java index 47b742b0..e8bc2487 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B4ECFCB2E292A4CCCCB2150FAC7029EA14A25C5A94959A9C52529FA1EC9F979393149A939852999F97A052A9A05DA0E0109A545C9F971E9F549DE69F54A10413DF815070FF2A4F4CCBCCA20BA348495B24D200172979CDF5000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -9,6 +9,7 @@ import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.PersonWorkFor; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.OrganizationWorkFor; import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java index 3e918413..dfa4e987 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09DCA44C040148F55A9C9CD3894CF9D3DAE146DD50120A44F4E54A776A73913399E1ABB36411FDDD0EEB287D28AF8FAAC705724640D0BBD6445D07C04276B5E4136B83FB0F0490C650737E01905214467D0E1822C4A12570BB461CEB6F48639092C1587484433CF10AEBE7B784A689C15B48E71E6155FC325530B8F77C1BA6836C0993757F86859B357A47C29B851CAB601E9297589385F0FC91549EEE3840B32FF442E82B907AFE398D223D2E2B3E61AE2F26306D70734225D528BA27DB18F10325BDFF3AF561ADD7A90A3382C70D1E534E26909BB5E80D7C9C2F4607957D049CFF203A95FC0166100000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java index 57cb81ea..3b124b4a 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09BCE43C04C054F75CACA8E2862C3ABA2C20596524AA4545851B14EEC8B9C099AD32BD1AC34CFB311DF506B75AB747EED89C282931C64B54E4F58E9487191DC2DE319E9D24837ED2E1F95A7260F90CDC9346245601D67D8B3AC03852E6169CE9CF37548E38291CE55E00C4748F30437DFAF0C6E8C186B48174E65577270AAB71D8F6878A7D2937A225AEB747CA3C9A33D02A5AA90CCA1059183A1C139770F4505D8EEED941B5A8F84A18A8BA0F7F94C6499D2E838E61A99E5CC1CBB41A7623B138BA9EC6E0F30E46EBAF74FB2A4BCF075C0E055C46DFB4A25D81A4B3E116B91CBC0E079D4304C1F71093AD0A51F6100000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,9 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.orgLabel; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java index 448e033a..c222f6a6 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,10 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.OrganizationClassifier; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java index 01529f7e..ae39f184 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09DCE43C04C048F55CAC98E1862CF4F45830A2DA48459041831714667DD469C6CBB2BD12024CBB3BA6F518BE86664FDC8F0AE48C80E984431F622AA68340293BD42E81B5C9F52D04C06B08B93788482C09F86DD3EB35489430770B56B06FDB324B94841E0296406A91E8D1DC5FBD30BA12B3A690D79AEAAEE3D845F094CF70E85FE35C8127AC5FD3A16DEE4995AB429BA50CAA109431B7589385F0FC91549EEE3940B32F50AD156394CF3726B203D269537B0DC2F26D06D7073039A611EA69BA53CF2819ADEEF19F2B0D6FBC40D9145E38E0FA127554C4D59324F172BC391C563D001BFF30A3599ED9C6100000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,9 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.personLabel; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java index 9bac6434..4b22e54b 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,10 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.PersonClassifier; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java index bb885a11..bb2dce76 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // discrete RelArgsClassifier(ConllRelation r) <- JointER(work_forClassifier) import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,10 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.JointER; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java index 1cefef75..7bdd7b93 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java index 427e9b46..eebe12f5 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000D4C814A02C034144FA234659086F20577D590D594F2013E825CFCF8629254A4EEEDA222EA606ED3ED56CC121B0713D7C066703AFEDA0981A7F76A8DE2AA8C9CFC34CB3515C1E0B7C281FA0B5A1A691E5F063C7E4E52F1F6A131B3F996F3137E6317B6F4941FD7A5450523FF18EF84D512E3B0EA6D8000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java index da2f14f2..5e207bea 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; + import java.util.List; @@ -39,15 +41,12 @@ public Feature featureValue(Object __example) public String discreteValue(Object __example) { - if (!(__example instanceof ConllRawToken)) - { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); - } - String __cachedValue = _discreteValue(__example); + String __cachedValue = _discreteValue(__example); if (valueIndexOf(__cachedValue) == -1) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java index 2d599e25..4f7fab3a 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; + import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java index 0dba1dad..63c2a3a0 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; + import java.util.List; @@ -39,15 +41,12 @@ public Feature featureValue(Object __example) public String discreteValue(Object __example) { - if (!(__example instanceof ConllRelation)) - { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); - } - String __cachedValue = _discreteValue(__example); + String __cachedValue = _discreteValue(__example); if (valueIndexOf(__cachedValue) == -1) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java index e4fc5a2c..23b8daf9 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java @@ -1,4 +1,4 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09BCE43C04C054F75CACA8E2842C3ABA2D50A24755904167C6A239172912391F8C6780212EFD915BAEF10BDBA3EBA37DECB6B24640B0BC87CE85671055D77E94EA67C13486820A97E806B2878B6804821F40F10F3820CCAE36F07186F4863B092472C3144A50E4D15FDF1F244348E275715D0C315532B8BF4C9AA30780E317AAE90D0BA6FC7356BC29A851CAB601E93A3585CBD00F690549E1FB840B727FA42D25231E8F3767BCA3D06ED3B58ABCB9D08D0EBD1329A6E0EEAC5F60E71C84D6FFF8E7948E9FBD40B5382C97D1FDD7A2278CD7E748EBCC696638BDAB60A8EEF01CF3394BE6100000 import edu.illinois.cs.cogcomp.core.io.LineIO; @@ -7,6 +7,9 @@ import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.workLabel; + import java.util.List; @@ -169,7 +172,7 @@ public Feature featureValue(Object __example) { if (isClone) { - if (!(__example instanceof ConllRelation || __example instanceof Object[])) + if (!(__example instanceof Object[])) { String type = __example == null ? "null" : __example.getClass().getName(); System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java index 7ca1a304..06953d8c 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java @@ -4,14 +4,11 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -//import LBJ.LBJ2.Classifier; - - import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; +import edu.illinois.cs.cogcomp.lbjava.classify.Feature; import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import ml.wolfe.examples.parisa.ConllRawToken; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; public class orgLabel extends Classifier diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java index bf4c9977..e2b3ea56 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java @@ -10,11 +10,12 @@ //import LBJ2.classify.Feature; //import LBJ2.classify.FeatureVector; -import LBJ2.classify.Classifier; -import LBJ2.classify.DiscretePrimitiveStringFeature; -import LBJ2.classify.Feature; -import LBJ2.classify.FeatureVector; -import ml.wolfe.examples.parisa.ConllRawToken; + +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; +import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; +import edu.illinois.cs.cogcomp.lbjava.classify.Feature; +import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; public class personLabel extends Classifier { diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/GraphQueriesTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/GraphQueriesTest.scala index f86a19f9..ea0bdddb 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/GraphQueriesTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/datamodel/GraphQueriesTest.scala @@ -113,8 +113,8 @@ class GraphQueriesTest extends FlatSpec with Matchers { query3.counts("a") should be(3) query3.counts("e") should be(1) - "finding the nodes in a window in the neighbohood" should "find the neighbors in a window" in {
 - 
 firstNames.getWithWindow(firstNames.getAllInstances.head, -2, 2).toSet should be(Set(None, Some("Dave"), Some("John"), Some("Mark")))
 - lastNames.getWithWindow(lastNames.getAllInstances.head, -2, 2).toSet should be(Set(None, Some("Dave"), Some("John"), Some("Mark")))

} + // "finding the nodes in a window in the neighbohood" should "find the neighbors in a window" in {
 + // 
 firstNames.getWithWindow(firstNames.getAllInstances.head, -2, 2).toSet should be(Set(None, Some("Dave"), Some("John"), Some("Mark")))
 + // lastNames.getWithWindow(lastNames.getAllInstances.head, -2, 2).toSet should be(Set(None, Some("Dave"), Some("John"), Some("Mark")))

} } } From 066f87ca973dc82ca6a1e709e6b4f7f9358daf18 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 17 Nov 2015 13:26:34 -0600 Subject: [PATCH 006/118] simple SL example running --- .../SL_SVM/iJLIS/DataGenerator.java | 83 ------------- .../SL_SVM/iJLIS/ERqInstance.java | 7 +- .../SL_SVM/iJLIS/QueryInstance.java | 42 ------- .../SL_SVM/iJLIS/Runner.scala | 110 ++++++------------ .../SL_SVM/iJLIS/SUtils.java | 79 +++---------- .../SL_SVM/iJLIS/iERinference.scala | 16 +-- .../SL_SVM/iJLIS2/ERqInstancePL.java | 17 +-- .../SL_SVM/iJLIS2/RunnerPL.scala | 34 +++--- 8 files changed, 87 insertions(+), 301 deletions(-) delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java deleted file mode 100755 index d73583c8..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/DataGenerator.java +++ /dev/null @@ -1,83 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; - -import edu.illinois.cs.cogcomp.core.io.LineIO; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - - -public class DataGenerator { - - public DataGenerator() throws IOException{ - - // Process: generate three names - // three labels: each 0 - // if name1 contains more than one vowel: - // label it as 1 - // if name2 starts with a vowel, and name1 is labeled as 1: - // name2 gets a 1 - // if name2 is 1 and name3 has a vowel in the last place and if name1 is 0: - // name3 gets a 0 - - ArrayList names = LineIO.read("names"); - List triples = new ArrayList(); - List outlines = new ArrayList(); - for(String name : names){ - triples.add(name.toLowerCase().trim()); - - if(triples.size() == 3){ - System.out.println(triples); - - String n1 = triples.get(0); - String n2 = triples.get(1); - String n3 = triples.get(2); - - int lab1, lab2, lab3; - - if(SUtils.numVowels(n1) > 2){ - lab1 = 1; - }else{ - lab1 = 0; - } - - if(SUtils.isVowel(n2.charAt(0)) && lab1 == 1){ - lab2 = 1; - }else{ - lab2 = 0; - } - - if(SUtils.isVowel(n2.charAt(n2.length()-1)) && lab1 == 0){ - lab3 = 1; - }else{ - lab3 = 0; - } - - System.out.println("" + lab1 + lab2 + lab3 + ""); - - String out = String.format("%s %s %s %d%d%d", n1,n2,n3,lab1,lab2,lab3); - outlines.add(out); - - triples.clear(); - } - } - - - double part = 0.75; - int partInd = (int) (outlines.size() * part); - - LineIO.write("namedata-train", outlines.subList(0, partInd)); - LineIO.write("namedata-test", outlines.subList(partInd, outlines.size())); - - - - } - - - - public static void main(String[] args) throws IOException{ - DataGenerator dg = new DataGenerator(); - - } - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java index b5bd72f9..003979c0 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java @@ -14,15 +14,16 @@ public class ERqInstance implements IInstance { ConllRawToken q; List nodeNames; // order matters! IFeatureVector fv; - + List feats; public ERqInstance(ConllRawToken tok) { q=tok; - List feats = new ArrayList(); + feats = new ArrayList(); feats.add("Ph:"+tok.phrase); feats.add("POS:"+tok.POS); this.nodeNames = feats; // do something with node names to make features - this.fv = SUtils.makeFeatures(feats); + this.fv = SUtils.makeFeatures(feats).toFeatureVector(); + } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java deleted file mode 100755 index 720f1483..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/QueryInstance.java +++ /dev/null @@ -1,42 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; - -import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; - -import java.util.ArrayList; -import java.util.List; - -/** - * This is the X instance for the prediction problem - * - * @author mayhew2 - * - */ -public class QueryInstance implements IInstance { - - List nodeNames; // order matters! - - IFeatureVector fv; - - public QueryInstance(List nodeNames) { - this.nodeNames = nodeNames; - - List feats = new ArrayList(); - - // do something with node names to make features - - int i = 0; - for(String n : nodeNames){ - feats.add("num" + i + "vow:" + SUtils.numVowels(n)); - int j = 0; - for(char c : n.toCharArray()){ - feats.add("isvowpos:" + i + j + ":" + SUtils.isVowel(c)); - j++; - } - i++; - } - - this.fv = SUtils.makeFeatures(feats); - } - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala index 3814cc13..4401cb10 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala @@ -4,29 +4,18 @@ import java.util import java.util.{ArrayList, List} import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew -import edu.illinois.cs.cogcomp.sl.applications.cs_multiclass._ import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} - object Runner { -var lexm: Lexiconer = new Lexiconer() - /*def readX(cr:Conll04_InstanceReader):List[IInstance]={ - var i: Int = 0 - val sclist: List[IInstance]=new ArrayList[IInstance] - while (i < 100){//cr.instances.size){ - val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) - sclist.add(newqi) - i=i+1 - } - sclist - }*/ + var lexm: Lexiconer = new Lexiconer() + def readXY(cr:Conll04_ReaderNew, outlist: => List[IStructure], sclist: => List[IInstance], l:Int,u:Int){ var i: Int = l while (i < u){//cr.instances.size){ - val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) + val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) sclist.add(newqi) val a: Nodevalues=new Nodevalues() a.a=(cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) @@ -35,26 +24,15 @@ var lexm: Lexiconer = new Lexiconer() i=i+1 } } - /*def readY(cr:Conll04_InstanceReader):List[IStructure]={ - var i: Int = 0 - val outlist: List[IStructure]=new util.ArrayList[IStructure] - while (i < 100){//cr.instances.size){ - val a: Nodevalues=new Nodevalues() - a.a=(cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) - val cs: ERiStructure = new ERiStructure(cr.instances.elementAt(i), a.a) - outlist.add(cs) - i=i+1 - } - outlist - } -*/ - def trainSSVM(modelname: String): String = { - var cr = new Conll04_ReaderNew("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp","Pair") + def trainSSVM(modelname: String): Unit = { + var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp","Pair") var sclist: List[IInstance]= new ArrayList[IInstance]//=readX(cr) var outlist: List[IStructure] = new ArrayList[IStructure]//readY(cr) readXY(cr,outlist,sclist,1,100) + cr=null + lexm.setAllowNewFeatures(false) val sp: SLProblem = new SLProblem sp.instanceList = sclist @@ -63,21 +41,17 @@ var lexm: Lexiconer = new Lexiconer() para.TOTAL_NUMBER_FEATURE = lexm.getNumOfFeature para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false - val si: iERinference = new iERinference val model: SLModel = new SLModel - model.infSolver= si - // model.featureGenerator= ERFeatureGenerator + model.featureGenerator= new ERFeatureGenerator model.lm = lexm - model.saveModel(modelname); + model.config = new util.HashMap(); model.para=para - // LabeledMultiClassData sp = MultiClassIOManager.readTrainingData(trainingDataPath); model.infSolver = new iERinference; - model.featureGenerator = new MultiClassFeatureGenerator(); val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); model.wv = learner.train(sp); - return modelname + model.saveModel(modelname); } def testSequenceSSVM(model_name: String) { @@ -85,18 +59,12 @@ var lexm: Lexiconer = new Lexiconer() Runner.lexm = model.lm val learned_wv: WeightVector = model.wv val inference_proc: iERinference = model.infSolver.asInstanceOf[iERinference] - var cr = new Conll04_ReaderNew("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp","Pair") + var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp","Pair") var sclist: List[IInstance]= new ArrayList[IInstance]//=readX(cr) var outlist: List[IStructure] = new ArrayList[IStructure]//readY(cr) readXY(cr,outlist,sclist,101,200) cr=null - // var sclist: List[IInstance]=readX(cr) - //var outlist: List[IStructure] = readY(cr) - // val sclist: List[IInstance] = new ArrayList[IInstance] - //val outlist: List[IStructure] = new ArrayList[IStructure] - // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-test" - //readData(sclist, outlist, fname) val sp: SLProblem = new SLProblem sp.instanceList = sclist sp.goldStructureList = outlist @@ -109,35 +77,31 @@ var lexm: Lexiconer = new Lexiconer() var fn: Double = 0 var total: Double = 0.0 - var i: Int = 0 - while (i < sp.instanceList.size) { - val gold: ERiStructure = sp.goldStructureList.get(i).asInstanceOf[ERiStructure] - val prediction:ERiStructure = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructure] - System.out.println(prediction) - //{ - //var j: Int = 0 - // while (j < gold.nodeValues.size) { - // { - val pred: Boolean = prediction.nodeValues - val goldval: Boolean = gold.nodeValues - if (goldval == pred) { - if (pred == true) { - tp += 1.0 - } - else { - tn += 1.0 - } - } - else { - if (pred ==false) { - fp += 1.0 - } - else { - fn += 1.0 - } - } - total += 1.0 - i=i+1 + var i: Int = 0 + while (i < sp.instanceList.size) { + val gold: ERiStructure = sp.goldStructureList.get(i).asInstanceOf[ERiStructure] + val prediction:ERiStructure = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructure] + System.out.println(prediction) + val pred: Boolean = prediction.nodeValues + val goldval: Boolean = gold.nodeValues + if (goldval == pred) { + if (pred == true) { + tp += 1.0 + } + else { + tn += 1.0 + } + } + else { + if (pred ==false) { + fp += 1.0 + } + else { + fn += 1.0 + } + } + total += 1.0 + i=i+1 } val precision: Double = tp / (tp + fp) @@ -145,7 +109,7 @@ var lexm: Lexiconer = new Lexiconer() val F1: Double = 2 * precision * recall / (precision + recall) println("=========================") println(" P R F ") - // println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")) + // println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")) println(precision, recall, F1)//String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)) println("=========================") println("Acc = " + (tp + tn) / total) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java index d06fcbf1..afc91b56 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java @@ -1,6 +1,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.RunnerPL; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; +import edu.illinois.cs.cogcomp.sl.util.Lexiconer; import org.apache.commons.lang3.ArrayUtils; import java.util.ArrayList; @@ -8,55 +9,32 @@ public class SUtils { - - // Totally made up labels - public enum NodeLabel { - VALIANT, COWARDLY - }; - - public static List binaryToNodeLabel(String binary){ - ArrayList ret = new ArrayList(); - - for(char c : binary.toCharArray()){ - int val = Integer.parseInt(c+""); - if (val == 0){ - ret.add(NodeLabel.VALIANT); - }else{ - ret.add(NodeLabel.COWARDLY); - } - } - - return ret; - - } - - - /** + /** * A static method for smartly adding features to the LexManager, and creating a FeatureVector * at the same time. * * @param feats * @return */ - public static IFeatureVector makeFeatures(List feats) { + public static FeatureVectorBuffer makeFeatures(List feats) { ArrayList idxList = new ArrayList(); ArrayList valList = new ArrayList(); for (String feat : feats) { - if (!RunnerPL.lexm().containFeature(feat)) { - System.out.println("Flag of preview"+ RunnerPL.lexm().getNumOfFeature()); - System.out.print("before Flag of feature set"+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); - if(RunnerPL.lexm().isAllowNewFeatures()) + if (!Runner.lexm().containFeature(feat)) { + System.out.println("Flag of preview: "+ Runner.lexm().getNumOfFeature()); + System.out.print("before Flag of feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); + if(Runner.lexm().isAllowNewFeatures()) //Todo see the error of the following line // RunnerPL.lexm().previewFeature(feat); - System.out.print("After preview flag"+RunnerPL.lexm().getNumOfFeature()); - System.out.print("Flag of after feature set"+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); - + System.out.print("After preview flag: "+Runner.lexm().getNumOfFeature()); + System.out.print("Flag of after feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); + Runner.lexm().addFeature(feat); } - if (RunnerPL.lexm().containFeature(feat)) { + if (Runner.lexm().containFeature(feat)) { - int fid = RunnerPL.lexm().getFeatureId(feat); + int fid = Runner.lexm().getFeatureId(feat); idxList.add(fid); valList.add(1.); } @@ -65,34 +43,7 @@ public static IFeatureVector makeFeatures(List feats) { int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); //Todo check waht is going on in the next two lines - return makeFeatures(feats); - //return new IFeatureVector(idx, val); + return new FeatureVectorBuffer(idx, val); } - - public static int numVowels(String s){ - int ret = 0; - - for(char c : s.toCharArray()){ - if(isVowel(c)){ - ret +=1; - } - } - return ret; - } - - public static boolean isVowel(char c){ - return isVowel(c+""); - } - - public static boolean isVowel(String s){ - List vowels = new ArrayList(); - vowels.add("a"); - vowels.add("e"); - vowels.add("i"); - vowels.add("o"); - vowels.add("u"); - - return vowels.contains(s); - } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala index ba0031e8..31768a48 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala @@ -9,11 +9,7 @@ import edu.illinois.cs.cogcomp.sl.util.WeightVector /** * Created by parisakordjamshidi on 20/09/14. */ -//class iERinference { - //object iERinference { - // private final val serialVersionUID: Long = 1L - //} class iERinference extends AbstractInferenceSolver { /** * This is for training @@ -84,14 +80,7 @@ return maxC //return a } - /** - * Given this QueryInstance, what are the options for responses? - * This simple method just enumerates all possibilities. (in this - * contrived example there are 8 total) - * - // * @param qi - // * @return - */ + def getOptions(qi: ERqInstance): List[ERiStructure] = { val options: List[ERiStructure] = new ArrayList[ERiStructure] //for (i <- NodeLabel.values) { @@ -109,6 +98,9 @@ return maxC return options } + override def clone():iERinference ={ + return new iERinference(); + } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java index 9f4f6a56..cdbf704a 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java @@ -22,12 +22,14 @@ public class ERqInstancePL implements IInstance { FeatureVectorBuffer E1fv; FeatureVectorBuffer E2fv; FeatureVectorBuffer Rfv; - + List E1feats; + List E2feats; + List Rfeats; public ERqInstancePL(ConllRelation pair) { this.pair=pair; - List E1feats = new ArrayList(); - List E2feats=new ArrayList(); - List Rfeats=new ArrayList(); + E1feats = new ArrayList(); + E2feats=new ArrayList(); + Rfeats=new ArrayList(); E1feats.add("Ph:"+pair.s.sentTokens.elementAt(pair.wordId1).phrase); E1feats.add("POS:"+pair.s.sentTokens.elementAt(pair.wordId1).POS); E2feats.add("Ph:"+pair.s.sentTokens.elementAt(pair.wordId2).phrase); @@ -38,10 +40,9 @@ public ERqInstancePL(ConllRelation pair) { //System.out.println(RunnerPL.lexm().totalNumofFeature()); // do something with node names to make features - this.E1fv = (FeatureVectorBuffer) SUtils.makeFeatures(E1feats); - - this.E2fv = (FeatureVectorBuffer) SUtils.makeFeatures(E2feats); - this.Rfv= (FeatureVectorBuffer) SUtils.makeFeatures(Rfeats); + // this.E1fv = SUtils.makeFeatures(E1feats); + // this.E2fv = (FeatureVectorBuffer) SUtils.makeFeatures(E2feats); + // this.Rfv= (FeatureVectorBuffer) SUtils.makeFeatures(Rfeats); } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index b4464da1..419d820f 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -12,7 +12,9 @@ object RunnerPL { /** * This modifies the two lists given two it. They are initialized. */ -var lexm: Lexiconer = new Lexiconer() + var lexm:Lexiconer=null + + def readXY(cr:Conll04_ReaderNew, outlist: =>List[IStructure], sclist: => List[IInstance], l:Int,u:Int){ var i= l while (i < u){//cr.instances.size){ @@ -30,40 +32,40 @@ def readXY(cr:Conll04_ReaderNew, outlist: =>List[IStructure], sclist: => List[II } - def trainSSVM(modelname: String, cr:Conll04_ReaderNew): String = { + def trainSSVM(modelname: String, cr:Conll04_ReaderNew): Unit = { - var sclist: List[IInstance]= new util.ArrayList[IInstance]//=readX(cr) - var outlist: List[IStructure] = new util.ArrayList[IStructure]//readY(cr) + var sclist: List[IInstance]= new util.ArrayList[IInstance] //=readX(cr) + var outlist: List[IStructure] = new util.ArrayList[IStructure] //readY(cr) readXY(cr,outlist,sclist,0,10) - //cr=null - // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-train" - lexm.setAllowNewFeatures(false) + + val model: SLModel = new SLModel + model.lm= new Lexiconer() + model.lm.setAllowNewFeatures(false) + lexm=model.lm + val sp: SLProblem = new SLProblem sp.instanceList = sclist sp.goldStructureList = outlist + val para: SLParameters = new SLParameters - para.TOTAL_NUMBER_FEATURE = 3*lexm.getNumOfFeature + para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false - val si: iERjavaInferencePL = new iERjavaInferencePL - val model: SLModel = new SLModel model.infSolver= new iERjavaInferencePL - model.lm = lexm - model.saveModel(modelname); + model.config = new util.HashMap(); model.para=para model.featureGenerator= new ERFeatureGenerator val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); // val learned_wv: WeightVector = learner.trainStructuredSVM(si, sp, para) model.wv = learner.train(sp) - return modelname - } + model.saveModel(modelname); + } def testSequenceSSVM(model_name: String,cr:Conll04_ReaderNew) { // val iom: JLISModelIOManager = new JLISModelIOManager val model: SLModel = SLModel.loadModel(model_name) - RunnerPL.lexm = model.lm val learned_wv: WeightVector = model.wv val inference_proc: iERjavaInferencePL = model.infSolver.asInstanceOf[iERjavaInferencePL] // var cr = new Conll04_RelationReader("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp") @@ -143,7 +145,7 @@ def readXY(cr:Conll04_ReaderNew, outlist: =>List[IStructure], sclist: => List[II } def main(args: Array[String]) { - var cr = new Conll04_ReaderNew("/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/conll04.corp","Pair") + var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp","Pair") val modelname: String = "mytest1.ssvm.model" trainSSVM(modelname,cr) System.out.println("\n=== NOW TESTING ===") From f824e37bb0743dcddd47e9b36fd77a9e743c9172 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 17 Nov 2015 14:44:23 -0600 Subject: [PATCH 007/118] simple SL example running --- .../SL_SVM/iJLIS/SUtils.java | 21 ++++++++++--------- .../SL_SVM/iJLIS2/ERiStructurePL.java | 2 +- .../SL_SVM/iJLIS2/ERqInstancePL.java | 6 +++--- .../SL_SVM/iJLIS2/RunnerPL.scala | 2 +- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 13 +++--------- 5 files changed, 19 insertions(+), 25 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java index afc91b56..aa76aa9d 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java @@ -1,5 +1,6 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.RunnerPL; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; import edu.illinois.cs.cogcomp.sl.util.Lexiconer; import org.apache.commons.lang3.ArrayUtils; @@ -22,19 +23,19 @@ public static FeatureVectorBuffer makeFeatures(List feats) { for (String feat : feats) { - if (!Runner.lexm().containFeature(feat)) { - System.out.println("Flag of preview: "+ Runner.lexm().getNumOfFeature()); - System.out.print("before Flag of feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); - if(Runner.lexm().isAllowNewFeatures()) + if (!RunnerPL.lexm().containFeature(feat)) { + System.out.println("Flag of preview: "+ RunnerPL.lexm().getNumOfFeature()); + System.out.print("before Flag of feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); + if(RunnerPL.lexm().isAllowNewFeatures()) //Todo see the error of the following line - // RunnerPL.lexm().previewFeature(feat); - System.out.print("After preview flag: "+Runner.lexm().getNumOfFeature()); - System.out.print("Flag of after feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); - Runner.lexm().addFeature(feat); + // RunnerPLPL.lexm().previewFeature(feat); + System.out.print("After preview flag: "+RunnerPL.lexm().getNumOfFeature()); + System.out.print("Flag of after feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); + RunnerPL.lexm().addFeature(feat); } - if (Runner.lexm().containFeature(feat)) { + if (RunnerPL.lexm().containFeature(feat)) { - int fid = Runner.lexm().getFeatureId(feat); + int fid = RunnerPL.lexm().getFeatureId(feat); idxList.add(fid); valList.add(1.); } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java index 85532514..30f85d93 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java @@ -19,7 +19,7 @@ public class ERiStructurePL implements IStructure { public FeatureVectorBuffer fvO=new FeatureVectorBuffer(new int[0] , new double[0]); public FeatureVectorBuffer fvWorkFor=new FeatureVectorBuffer(new int[0] , new double[0]); public FeatureVectorBuffer fvLivesIn=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fv; + public FeatureVectorBuffer fv=new FeatureVectorBuffer(); public ERiStructurePL(ERqInstancePL qi, Labels Rlables) { // List feats = new ArrayList(); diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java index cdbf704a..b68f140e 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java @@ -40,9 +40,9 @@ public ERqInstancePL(ConllRelation pair) { //System.out.println(RunnerPL.lexm().totalNumofFeature()); // do something with node names to make features - // this.E1fv = SUtils.makeFeatures(E1feats); - // this.E2fv = (FeatureVectorBuffer) SUtils.makeFeatures(E2feats); - // this.Rfv= (FeatureVectorBuffer) SUtils.makeFeatures(Rfeats); + this.E1fv = SUtils.makeFeatures(E1feats); + this.E2fv = SUtils.makeFeatures(E2feats); + this.Rfv= SUtils.makeFeatures(Rfeats); } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index 419d820f..25d8e51d 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -12,7 +12,7 @@ object RunnerPL { /** * This modifies the two lists given two it. They are initialized. */ - var lexm:Lexiconer=null + var lexm:Lexiconer = new Lexiconer() def readXY(cr:Conll04_ReaderNew, outlist: =>List[IStructure], sclist: => List[IInstance], l:Int,u:Int){ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java index 5b6de760..07eac7cd 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java @@ -578,14 +578,7 @@ public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exce return __result; } */ - /** - * Given this QueryInstance, what are the options for responses? - * This simple method just enumerates all possibilities. (in this - * contrived example there are 8 total) - * - * @param qi - * @return - */ - - + public iERjavaInferencePL clone() { + return new iERjavaInferencePL(); + } } From c354a912e76d383e8e11c60fedcb58860d615610 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 18 Nov 2015 20:28:21 -0600 Subject: [PATCH 008/118] modified IO manager and feature generator --- .../SL_SVM/iJLIS/Runner.scala | 1 - .../SL_SVM/iJLIS/SUtils.java | 6 +- .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 95 ++++++++++--------- .../SL_SVM/iJLIS2/ERiStructurePL.java | 48 +++++----- .../SL_SVM/iJLIS2/RunnerPL.scala | 76 ++++----------- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 10 +- 6 files changed, 99 insertions(+), 137 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala index 4401cb10..52387e84 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala @@ -121,5 +121,4 @@ object Runner { System.out.println("\n=== NOW TESTING ===") testSequenceSSVM(modelname) } - } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java index aa76aa9d..e8fe4784 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java @@ -25,12 +25,12 @@ public static FeatureVectorBuffer makeFeatures(List feats) { if (!RunnerPL.lexm().containFeature(feat)) { System.out.println("Flag of preview: "+ RunnerPL.lexm().getNumOfFeature()); - System.out.print("before Flag of feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); + System.out.println("before Flag of feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); if(RunnerPL.lexm().isAllowNewFeatures()) //Todo see the error of the following line // RunnerPLPL.lexm().previewFeature(feat); - System.out.print("After preview flag: "+RunnerPL.lexm().getNumOfFeature()); - System.out.print("Flag of after feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); + System.out.println("After preview flag: "+RunnerPL.lexm().getNumOfFeature()); + System.out.println("Flag of after feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); RunnerPL.lexm().addFeature(feat); } if (RunnerPL.lexm().containFeature(feat)) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index feb01ebd..e2f32e26 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -1,77 +1,80 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.ERiStructure; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.ERqInstance; import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; import edu.illinois.cs.cogcomp.sl.core.IInstance; import edu.illinois.cs.cogcomp.sl.core.IStructure; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; +import edu.illinois.cs.cogcomp.sl.util.Lexiconer; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.ArrayList; +import java.util.List; -/** - * Created by Parisa on 11/16/15. - */ public class ERFeatureGenerator extends AbstractFeatureGenerator { private static final long serialVersionUID = 1L; + private Lexiconer lm; public ERFeatureGenerator(){ } + public ERFeatureGenerator(Lexiconer lm) { + this.lm = lm; + } + public Lexiconer getlexicon(){ + return this.lm; + } public IFeatureVector getFeatureVector (IInstance x, IStructure y){ - ERqInstancePL mx= (ERqInstancePL) x; - ERiStructurePL my=(ERiStructurePL) y; + + FeatureVectorBuffer fv = new FeatureVectorBuffer(); + ERqInstancePL mx = (ERqInstancePL) x; + ERiStructurePL my = (ERiStructurePL) y; + + + if (my.Rlables.E1Label().toLowerCase().contains("peop")) my.fvPeop=mx.E1fv; - if (my.Rlables.E2Label().toLowerCase().contains("peop")) - { - (my.fvPeop).addFeature(mx.E2fv);} - if (my.Rlables.E1Label().toLowerCase().contains("org")) - my.fvOrg=mx.E1fv; if (my.Rlables.E2Label().toLowerCase().contains("org")) - my.fvOrg.addFeature(mx.E2fv); - - - my.fvOrg.shift(RunnerPL.lexm().getNumOfFeature()); - my.fv.addFeature(my.fvPeop); - my.fv.addFeature(my.fvOrg); + my.fvOrg=mx.E2fv; + fv.addFeature(my.fvPeop); + fv.addFeature(my.fvOrg); if(my.Rlables.RelLabel().toLowerCase().contains("work")) my.fvWorkFor=mx.Rfv; - my.fvWorkFor.shift((RunnerPL.lexm().getNumOfFeature()*2)); - - my.fv.addFeature(my.fvWorkFor); + fv.addFeature(my.fvWorkFor); - // return my.fv; - - // FeatureVectorBuffer fvb= new FeatureVectorBuffer(my.fv); - //TODO tune fvb indexes - return my.fv.toFeatureVector(); + //TODO tune fvb indexes + return fv.toFeatureVector(); } - } + public FeatureVectorBuffer makeFeatures(List feats) { + ArrayList idxList = new ArrayList(); + ArrayList valList = new ArrayList(); -// List feats = new ArrayList(); + for (String feat : feats) { - /* if (Rlables.E1Label().contains("loc")) - fvLoc=qi.E1fv; - if (Rlables.E2Label().contains("loc")) - fvLoc=FeatureVector.plus(fvLoc,qi.E2fv); - - if (Rlables.E1Label().contains("other")) - fvOther=qi.E2fv; - if (Rlables.E2Label().contains("other")) - fvOther=FeatureVector.plus(fvOther,qi.E2fv); - if (Rlables.E1Label().equalsIgnoreCase("O")) - fvO=qi.E1fv; - if (Rlables.E2Label().equalsIgnoreCase("O")) - fvO=FeatureVector.plus(fvO,qi.E2fv); + if (!this.lm.containFeature(feat)) { + System.out.println("Flag of preview: "+ this.lm.getNumOfFeature()); + System.out.println("before Flag of feature set: "+ this.lm.isAllowNewFeatures()+"\n"); + if(this.lm.isAllowNewFeatures()) + System.out.println("After preview flag: "+this.lm.getNumOfFeature()); + System.out.println("Flag of after feature set: "+ this.lm.isAllowNewFeatures()+"\n"); + this.lm.addFeature(feat); + } + if (this.lm.containFeature(feat)) { + int fid = this.lm.getFeatureId(feat); + idxList.add(fid); + valList.add(1.); + } + } - if (Rlables.RelLabel().contains("Live-in")) - fvLivesIn=qi.Rfv; - if (Rlables.RelLabel().contains("work-for")) - fvWorkFor=qi.Rfv;*/ -//return + int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); + double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); + //Todo check waht is going on in the next two lines + return new FeatureVectorBuffer(idx, val); + } +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java index 30f85d93..9bf7f927 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java @@ -1,37 +1,33 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; -import edu.illinois.cs.cogcomp.sl.core.IStructure; - /** * Created by parisakordjamshidi on 19/09/14. */ -public class ERiStructurePL implements IStructure { - public Labels Rlables; - public ERqInstancePL qi; - public FeatureVectorBuffer fvPeop=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvOrg=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvLoc=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvOther=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvO=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvWorkFor=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvLivesIn=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fv=new FeatureVectorBuffer(); +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; + +public class ERiStructurePL implements IStructure { - public ERiStructurePL(ERqInstancePL qi, Labels Rlables) { - // List feats = new ArrayList(); + public Labels Rlables; + // public ERqInstancePL qi; + public FeatureVectorBuffer fvPeop =new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvOrg=new FeatureVectorBuffer(new int[0] , new double[0]); +// public FeatureVectorBuffer fvLoc=new FeatureVectorBuffer(new int[0] , new double[0]); +// public FeatureVectorBuffer fvOther=new FeatureVectorBuffer(new int[0] , new double[0]); +// public FeatureVectorBuffer fvO=new FeatureVectorBuffer(new int[0] , new double[0]); + public FeatureVectorBuffer fvWorkFor=new FeatureVectorBuffer(new int[0] , new double[0]); +// public FeatureVectorBuffer fvLivesIn=new FeatureVectorBuffer(new int[0] , new double[0]); +// + public ERiStructurePL(Labels Rlables) { this.Rlables = Rlables; - this.qi=qi; - //this.fv = FeatureVector.plus(this.qi.fv, this.fv); - } - @Override - public String toString() { - return "[ERiStructure: " + this.Rlables + "]"; - } - + // this.Rlables.set(Rlables.E1Label(),Rlables.E2Label(),Rlables.RelLabel()); + //this.qi=qi; + } + @Override + public String toString() { + return "[ERiStructure: " + this.Rlables + "]"; } +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index 25d8e51d..b5b24fcd 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 import java.util -import java.util.List + import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory @@ -9,80 +9,44 @@ import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} object RunnerPL { - /** - * This modifies the two lists given two it. They are initialized. - */ - var lexm:Lexiconer = new Lexiconer() - - -def readXY(cr:Conll04_ReaderNew, outlist: =>List[IStructure], sclist: => List[IInstance], l:Int,u:Int){ - var i= l - while (i < u){//cr.instances.size){ - val newqi: ERqInstancePL = new ERqInstancePL(cr.relations.elementAt(i)) - sclist.add(newqi) - var a: Labels=new Labels() - val pair=cr.relations.elementAt(i); - a.E1Label=pair.s.sentTokens.elementAt(pair.wordId1).entType.toLowerCase(); - a.E2Label=pair.s.sentTokens.elementAt(pair.wordId2).entType.toLowerCase(); - a.RelLabel=pair.relType.toLowerCase(); - val cs: ERiStructurePL = new ERiStructurePL(newqi, a) - outlist.add(cs) - i=i+1 - } - } + var lexm:Lexiconer = new Lexiconer() - def trainSSVM(modelname: String, cr:Conll04_ReaderNew): Unit = { - var sclist: List[IInstance]= new util.ArrayList[IInstance] //=readX(cr) - var outlist: List[IStructure] = new util.ArrayList[IStructure] //readY(cr) - readXY(cr,outlist,sclist,0,10) - val model: SLModel = new SLModel - model.lm= new Lexiconer() - model.lm.setAllowNewFeatures(false) - lexm=model.lm + def trainSSVM(modelname: String, cr:Conll04_ReaderNew): Unit = { - val sp: SLProblem = new SLProblem - sp.instanceList = sclist - sp.goldStructureList = outlist + val model = new SLModel + val sp = ERIOManager.readXY(cr,0,10) + model.infSolver = new iERjavaInferencePL + val para = new SLParameters - val para: SLParameters = new SLParameters - para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false - model.infSolver= new iERjavaInferencePL - model.config = new util.HashMap(); - model.para=para - model.featureGenerator= new ERFeatureGenerator + model.para = para + model.featureGenerator = new ERFeatureGenerator + model.lm = new Lexiconer() + model.lm.setAllowNewFeatures(true) + lexm=model.lm + para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); // val learned_wv: WeightVector = learner.trainStructuredSVM(si, sp, para) + println("num?:"+RunnerPL.lexm.getNumOfFeature) + println("num?:"+model.lm.getNumOfFeature) + model.wv = learner.train(sp) model.saveModel(modelname); } def testSequenceSSVM(model_name: String,cr:Conll04_ReaderNew) { - // val iom: JLISModelIOManager = new JLISModelIOManager val model: SLModel = SLModel.loadModel(model_name) val learned_wv: WeightVector = model.wv val inference_proc: iERjavaInferencePL = model.infSolver.asInstanceOf[iERjavaInferencePL] - // var cr = new Conll04_RelationReader("/Users/parisakordjamshidi/wolfe-0.1.0/LBJ/data/conll04.corp") - var sclist: List[IInstance]= new util.ArrayList[IInstance]//=readX(cr) - var outlist: List[IStructure] = new util.ArrayList[IStructure]//readY(cr) - readXY(cr,outlist,sclist,11,20) - // cr=null - - // var sclist: List[IInstance]=readX(cr) - //var outlist: List[IStructure] = readY(cr) - // val sclist: List[IInstance] = new ArrayList[IInstance] - //val outlist: List[IStructure] = new ArrayList[IStructure] - // val fname: String = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-test" - //readData(sclist, outlist, fname) - val sp: SLProblem = new SLProblem - sp.instanceList = sclist - sp.goldStructureList= outlist + // cr=null + + val sp = ERIOManager.readXY(cr,11,20) printTestACC(sp, inference_proc, learned_wv) } private def printTestACC(sp: SLProblem, s_finder: AbstractInferenceSolver, ssvm_wv: WeightVector) { @@ -149,7 +113,7 @@ def readXY(cr:Conll04_ReaderNew, outlist: =>List[IStructure], sclist: => List[II val modelname: String = "mytest1.ssvm.model" trainSSVM(modelname,cr) System.out.println("\n=== NOW TESTING ===") - testSequenceSSVM(modelname,cr) + //testSequenceSSVM(modelname,cr) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java index 07eac7cd..97baab8b 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java @@ -174,11 +174,11 @@ public IStructure getLossAugmentedBestStructure(WeightVector wv, IInstance input ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); - double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); - double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); - double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); - double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); - double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); + double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); + double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); + double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); + double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); + double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv.toFeatureVector()); //try { GurobiHook myGurobi=new GurobiHook(); From bb91303a5227b7684615f209647d82af2de5eaee Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 18 Nov 2015 20:29:01 -0600 Subject: [PATCH 009/118] modified IO manager and feature generator --- .../SL_SVM/iJLIS2/ERIOManager.scala | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala new file mode 100644 index 00000000..fbc91033 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala @@ -0,0 +1,24 @@ + package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 + + import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew + import edu.illinois.cs.cogcomp.sl.core.SLProblem + + object ERIOManager { + + def readXY(cr: Conll04_ReaderNew, l: Int, u: Int): SLProblem = { + var sp: SLProblem = new SLProblem() + var i = l + while (i < u) { + val newqi: ERqInstancePL = new ERqInstancePL(cr.relations.elementAt(i)) + var a: Labels = new Labels() + val pair = cr.relations.elementAt(i) + a.E1Label = pair.s.sentTokens.elementAt(pair.wordId1).entType.toLowerCase + a.E2Label = pair.s.sentTokens.elementAt(pair.wordId2).entType.toLowerCase + a.RelLabel = pair.relType.toLowerCase + val cs: ERiStructurePL = new ERiStructurePL(newqi, a) + i = i + 1 + sp.addExample(newqi,cs) + } + sp + } + } From 18531faff0cf24b4a675a3508b8667a92e4c1aeb Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 18 Nov 2015 20:38:00 -0600 Subject: [PATCH 010/118] modified IO manager and feature generator --- .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 132 +++++++++--------- .../SL_SVM/iJLIS2/ERIOManager.scala | 2 +- .../SL_SVM/iJLIS2/ERqInstancePL.java | 8 +- 3 files changed, 70 insertions(+), 72 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index e2f32e26..0bf40acd 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -1,80 +1,84 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; -import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; -import edu.illinois.cs.cogcomp.sl.util.Lexiconer; -import org.apache.commons.lang3.ArrayUtils; + import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.SUtils; + import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; + import edu.illinois.cs.cogcomp.sl.core.IInstance; + import edu.illinois.cs.cogcomp.sl.core.IStructure; + import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; + import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; + import edu.illinois.cs.cogcomp.sl.util.Lexiconer; + import org.apache.commons.lang3.ArrayUtils; -import java.util.ArrayList; -import java.util.List; + import java.util.ArrayList; + import java.util.List; -public class ERFeatureGenerator extends AbstractFeatureGenerator { - private static final long serialVersionUID = 1L; - private Lexiconer lm; - public ERFeatureGenerator(){ + public class ERFeatureGenerator extends AbstractFeatureGenerator { + private static final long serialVersionUID = 1L; + private Lexiconer lm; + public ERFeatureGenerator(){ + } + public ERFeatureGenerator(Lexiconer lm) { + this.lm = lm; } - public ERFeatureGenerator(Lexiconer lm) { - this.lm = lm; - } - public Lexiconer getlexicon(){ - return this.lm; - } - public IFeatureVector getFeatureVector (IInstance x, IStructure y){ - - FeatureVectorBuffer fv = new FeatureVectorBuffer(); - ERqInstancePL mx = (ERqInstancePL) x; - ERiStructurePL my = (ERiStructurePL) y; - - - - if (my.Rlables.E1Label().toLowerCase().contains("peop")) - my.fvPeop=mx.E1fv; - - if (my.Rlables.E2Label().toLowerCase().contains("org")) - my.fvOrg=mx.E2fv; - fv.addFeature(my.fvPeop); - fv.addFeature(my.fvOrg); - - if(my.Rlables.RelLabel().toLowerCase().contains("work")) - my.fvWorkFor=mx.Rfv; - fv.addFeature(my.fvWorkFor); + public Lexiconer getlexicon(){ + return this.lm; + } + public IFeatureVector getFeatureVector (IInstance x, IStructure y){ + + FeatureVectorBuffer fv = new FeatureVectorBuffer(); + ERqInstancePL mx = (ERqInstancePL) x; + ERiStructurePL my = (ERiStructurePL) y; + + // do something with node names to make features + mx.E1fv = makeFeatures(mx.E1feats); + mx.E2fv = makeFeatures(mx.E2feats); + mx.Rfv= makeFeatures(mx.Rfeats); + + if (my.Rlables.E1Label().toLowerCase().contains("peop")) + my.fvPeop=mx.E1fv; + + if (my.Rlables.E2Label().toLowerCase().contains("org")) + my.fvOrg=mx.E2fv; + fv.addFeature(my.fvPeop); + fv.addFeature(my.fvOrg); + + if(my.Rlables.RelLabel().toLowerCase().contains("work")) + my.fvWorkFor=mx.Rfv; + fv.addFeature(my.fvWorkFor); + + //TODO tune fvb indexes + return fv.toFeatureVector(); + } - //TODO tune fvb indexes - return fv.toFeatureVector(); - } + public FeatureVectorBuffer makeFeatures(List feats) { + ArrayList idxList = new ArrayList(); + ArrayList valList = new ArrayList(); - public FeatureVectorBuffer makeFeatures(List feats) { - ArrayList idxList = new ArrayList(); - ArrayList valList = new ArrayList(); + for (String feat : feats) { - for (String feat : feats) { + if (!this.lm.containFeature(feat)) { + System.out.println("Flag of preview: "+ this.lm.getNumOfFeature()); + System.out.println("before Flag of feature set: "+ this.lm.isAllowNewFeatures()+"\n"); + if(this.lm.isAllowNewFeatures()) + System.out.println("After preview flag: "+this.lm.getNumOfFeature()); + System.out.println("Flag of after feature set: "+ this.lm.isAllowNewFeatures()+"\n"); + this.lm.addFeature(feat); + } + if (this.lm.containFeature(feat)) { - if (!this.lm.containFeature(feat)) { - System.out.println("Flag of preview: "+ this.lm.getNumOfFeature()); - System.out.println("before Flag of feature set: "+ this.lm.isAllowNewFeatures()+"\n"); - if(this.lm.isAllowNewFeatures()) - System.out.println("After preview flag: "+this.lm.getNumOfFeature()); - System.out.println("Flag of after feature set: "+ this.lm.isAllowNewFeatures()+"\n"); - this.lm.addFeature(feat); + int fid = this.lm.getFeatureId(feat); + idxList.add(fid); + valList.add(1.); + } } - if (this.lm.containFeature(feat)) { - int fid = this.lm.getFeatureId(feat); - idxList.add(fid); - valList.add(1.); - } + int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); + double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); + //Todo check waht is going on in the next two lines + return new FeatureVectorBuffer(idx, val); } - int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); - double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); - //Todo check waht is going on in the next two lines - return new FeatureVectorBuffer(idx, val); } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala index fbc91033..82a8a1a7 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala @@ -15,7 +15,7 @@ a.E1Label = pair.s.sentTokens.elementAt(pair.wordId1).entType.toLowerCase a.E2Label = pair.s.sentTokens.elementAt(pair.wordId2).entType.toLowerCase a.RelLabel = pair.relType.toLowerCase - val cs: ERiStructurePL = new ERiStructurePL(newqi, a) + val cs: ERiStructurePL = new ERiStructurePL( a) i = i + 1 sp.addExample(newqi,cs) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java index b68f140e..7cb5b24a 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java @@ -37,13 +37,7 @@ public ERqInstancePL(ConllRelation pair) { if (pair.wordId1 Date: Wed, 18 Nov 2015 21:23:55 -0600 Subject: [PATCH 011/118] modified IO manager and feature generator --- .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 3 --- .../SL_SVM/iJLIS2/RunnerPL.scala | 12 +++--------- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 10 +++++----- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index 0bf40acd..c231315b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -1,6 +1,5 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.SUtils; import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; import edu.illinois.cs.cogcomp.sl.core.IInstance; import edu.illinois.cs.cogcomp.sl.core.IStructure; @@ -15,9 +14,7 @@ public class ERFeatureGenerator extends AbstractFeatureGenerator { private static final long serialVersionUID = 1L; private Lexiconer lm; - public ERFeatureGenerator(){ - } public ERFeatureGenerator(Lexiconer lm) { this.lm = lm; } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index b5b24fcd..c2cf4211 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -10,10 +10,7 @@ import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} object RunnerPL { - var lexm:Lexiconer = new Lexiconer() - - - + var lexm=new Lexiconer() def trainSSVM(modelname: String, cr:Conll04_ReaderNew): Unit = { val model = new SLModel @@ -26,14 +23,11 @@ object RunnerPL { model.config = new util.HashMap(); model.para = para - model.featureGenerator = new ERFeatureGenerator - model.lm = new Lexiconer() + model.featureGenerator = new ERFeatureGenerator(lexm) model.lm.setAllowNewFeatures(true) - lexm=model.lm para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - // val learned_wv: WeightVector = learner.trainStructuredSVM(si, sp, para) - println("num?:"+RunnerPL.lexm.getNumOfFeature) + println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) println("num?:"+model.lm.getNumOfFeature) model.wv = learner.train(sp) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java index 97baab8b..5cda8704 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java @@ -43,7 +43,7 @@ public Pair getLossSensitiveBestStructure(WeightVector wv, I Double coefLosWF= Double.valueOf((1-2*(goldL))); Labels temp=new Labels(); - ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); + ERiStructurePL maxC = new ERiStructurePL(temp); Double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosper1; Double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosper2; Double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosorg1; @@ -121,7 +121,7 @@ public Pair getLossSensitiveBestStructure(WeightVector wv, I e.getMessage()); } // Return structure with highest score+loss, and loss of this structure - return new Pair(maxC, ((double) getLoss(((IInstance) maxC.qi), maxC, goldStruct))); + return new Pair(maxC, ((double) getLoss( input, maxC, goldStruct))); } @Override @@ -171,7 +171,7 @@ public IStructure getLossAugmentedBestStructure(WeightVector wv, IInstance input // double max = Double.NEGATIVE_INFINITY; //double score; Labels temp=new Labels(); - ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); + ERiStructurePL maxC = new ERiStructurePL(temp); double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); @@ -308,7 +308,7 @@ public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) // double max = Double.NEGATIVE_INFINITY; //double score; Labels temp=new Labels(); - ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); + ERiStructurePL maxC = new ERiStructurePL(temp); float coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); @@ -430,7 +430,7 @@ public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exce // double max = Double.NEGATIVE_INFINITY; //double score; Labels temp=new Labels(); - ERiStructurePL maxC = new ERiStructurePL((ERqInstancePL)input,temp); + ERiStructurePL maxC = new ERiStructurePL(temp); /////// From dff68b5678d861f173c26992d65c638a2840b9b1 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 19 Nov 2015 11:21:39 -0600 Subject: [PATCH 012/118] modified IO manager and feature generator --- .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 10 ++++++---- .../EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index c231315b..6c958665 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -51,7 +51,7 @@ public IFeatureVector getFeatureVector (IInstance x, IStructure y){ public FeatureVectorBuffer makeFeatures(List feats) { ArrayList idxList = new ArrayList(); ArrayList valList = new ArrayList(); - + FeatureVectorBuffer temp= new FeatureVectorBuffer(); for (String feat : feats) { @@ -68,13 +68,15 @@ public FeatureVectorBuffer makeFeatures(List feats) { int fid = this.lm.getFeatureId(feat); idxList.add(fid); valList.add(1.); + temp.addFeature(fid,1.); } } - int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); - double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); + // int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); + // double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); //Todo check waht is going on in the next two lines - return new FeatureVectorBuffer(idx, val); + // return new FeatureVectorBuffer(idx, val); + return temp; } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index c2cf4211..fc27ea4c 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -24,6 +24,7 @@ object RunnerPL { model.config = new util.HashMap(); model.para = para model.featureGenerator = new ERFeatureGenerator(lexm) + model.lm=lexm model.lm.setAllowNewFeatures(true) para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); From bf0a450e965a7bb4c4c94393b045acc6ed8cd966 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 19 Nov 2015 12:15:17 -0600 Subject: [PATCH 013/118] Removed Lbjava generated files --- .../SL_SVM/iJLIS2/ContainsStation.java | 24 - .../SL_SVM/iJLIS2/EntityFeatures.java | 63 - .../SL_SVM/iJLIS2/Labelsj.java | 12 - .../SL_SVM/iJLIS2/LocClassifier.ex | Bin 17618 -> 0 bytes .../SL_SVM/iJLIS2/LocClassifier.lc | Bin 2620 -> 0 bytes .../SL_SVM/iJLIS2/LocClassifier.test.ex | Bin 17618 -> 0 bytes .../SL_SVM/iJLIS2/OrganizationClassifier.ex | Bin 17129 -> 0 bytes .../SL_SVM/iJLIS2/OrganizationClassifier.java | 1221 ----------------- .../SL_SVM/iJLIS2/OrganizationClassifier.lc | Bin 3303 -> 0 bytes .../iJLIS2/OrganizationClassifier.test.ex | Bin 17129 -> 0 bytes .../SL_SVM/iJLIS2/OrganizationWorkFor.java | 92 -- .../SL_SVM/iJLIS2/PersonClassifier.ex | Bin 17506 -> 0 bytes .../SL_SVM/iJLIS2/PersonClassifier.java | 1220 ---------------- .../SL_SVM/iJLIS2/PersonClassifier.lc | Bin 2080 -> 0 bytes .../SL_SVM/iJLIS2/PersonClassifier.test.ex | Bin 17506 -> 0 bytes .../SL_SVM/iJLIS2/PersonWorkFor.java | 89 -- .../SL_SVM/iJLIS2/RelationFeatures.java | 63 - .../SL_SVM/iJLIS2/RunnerPL.scala | 2 +- .../iJLIS2/mYjava/JointER$subjectto.java | 7 - .../iJLIS2/mYjava/OrganizationClassifier.java | 6 - .../iJLIS2/mYjava/OrganizationWorkFor.java | 6 - .../iJLIS2/mYjava/PersonClassifier.java | 6 - .../iJLIS2/mYjava/work_forClassifier.java | 6 - .../SL_SVM/iJLIS2/orgLabel.java | 92 -- .../SL_SVM/iJLIS2/personLabel.java | 98 -- .../SL_SVM/iJLIS2/workLabel.java | 90 -- .../SL_SVM/iJLIS2/work_forClassifier.ex | Bin 9506 -> 0 bytes .../SL_SVM/iJLIS2/work_forClassifier.java | 1215 ---------------- .../SL_SVM/iJLIS2/work_forClassifier.lc | Bin 11279 -> 0 bytes .../SL_SVM/iJLIS2/work_forClassifier.test.ex | Bin 9506 -> 0 bytes .../SL_SVM/iJLIS2/work_forClassifier1.java | 37 - 31 files changed, 1 insertion(+), 4348 deletions(-) delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ContainsStation.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labelsj.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.lc delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.lc delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.lc delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.lc delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier1.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ContainsStation.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ContainsStation.java deleted file mode 100755 index 17e38060..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ContainsStation.java +++ /dev/null @@ -1,24 +0,0 @@ -/* -package ml.wolfe.examples.parisa.iJLIS2; - -import LBJ2.classify.ScoreSet; - -public class ContainsStation extends DumbLearner -{ - public ContainsStation() { super("ContainsStation"); } - - public String getInputType() { return "Neighborhood"; } - public String[] allowableValues() { - return new String[]{ "false", "true" }; - } - - public ScoreSet scores(Object example) - { - ScoreSet result = new ScoreSet(); - result.put("false", 0); - result.put("true", -1); - return result; - } -} - -*/ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java deleted file mode 100755 index 9b1020fc..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/EntityFeatures.java +++ /dev/null @@ -1,63 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294555507DCB29CC29A47B4D4C292D2A4D26D07ECFCBC9C90A4C2F09CFCE4DC35821D450B1D558A6582E4DCB2E455821DB00FF0650B258292A2D45B658A5000617B321944000000 - - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - - -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; -import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - -public class EntityFeatures extends Classifier -{ - public EntityFeatures() - { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "EntityFeatures"; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRawToken"; } - public String getOutputType() { return "discrete%"; } - - public FeatureVector classify(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'EntityFeatures(ConllRawToken)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRawToken t = (ConllRawToken) __example; - - FeatureVector __result; - __result = new FeatureVector(); - String __id; - String __value; - - __id = "" + (t.POS); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - return __result; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'EntityFeatures(ConllRawToken)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "EntityFeatures".hashCode(); } - public boolean equals(Object o) { return o instanceof EntityFeatures; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labelsj.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labelsj.java deleted file mode 100755 index f72145d9..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labelsj.java +++ /dev/null @@ -1,12 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -/** - * Created by parisakordjamshidi on 25/09/14. - */ -public class Labelsj { - String E1Label;//: java.lang.String=""; - String E2Label; - String RelLabel; - // val labels: util.ArrayList[String]=new util.ArrayList[String] - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.ex deleted file mode 100755 index a4e6b25cda129b816cb610cea687224d1005a78b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17618 zcmYhDdmxkj|NrmmmRiMKk;>`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(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<-p_%qc7euSw`LKc8mt>| zK!52;rFpVV(wEb|*C=Jh{)6zFank5FXn(_*XFH&ur7S#8=o>gjUoZESN4J39^u4a3 z?2&Bmya4rNcx(sMrNR9&A;)myhy;Pwlf|A+^ABz944S7x{IWF}`t5N3lWYwit{>ue z;hp_PW8gm4y)_%~o0c@v-yc|8wtT4iLIcNMqyCg^$6pP)Z*DsX^<&xy4H_q`ETaC# z=FvxKUZ7s<8M$sVmj?BX%XK>N`<47AY8UFC@eG{PMg0!y(D21skfYy7-MB@rP+XWQDi);sNLTiKQA2Wx_v)x&L zZFk@tkBx^e4J8Lh%y-T*GT#JqLzeh3{fe_)MAerMu76#+-orlpWS zQ6uKV`)eQbww!l2D*$)W%DH4cTe4>+!g|cPX#&gz(iPAbSN{RgSAY!~5%RddG#TQf zt4tH1zgcBG1M8b*{Xa7W_7NQU`!}iGlKp#+K%X)m`B=8|ogBawS(y%TxU^vw%sGZ5 zTLb$8x|}V~C3^E3&}VFfUtBn<333h_DvH2?`-&_cN{gycz{Gl&cE9dL7F4)(WEAeSP0{+%-%9Q={ z0{!K5LbA`6>)hDg2k*qd{aau@5cd9csCgfCUN}8e9;1I(=H9J;^L)22PQ2TDjdll% zkiOsIA$dGkvKLm9dp(lf8%^&^4=rmXZtF%{-;?L??`mEo`q%vjP)i30E`-80ya@mR zni>EAP)h*<6aW+e2mlBG)m7?5E`-80ya@mRni>EA2LJ#7000000000000000002xv eN=9jHWl&261^@s60096205t#r0PzU`0002q`ar+{ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/LocClassifier.test.ex deleted file mode 100755 index a4e6b25cda129b816cb610cea687224d1005a78b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17618 zcmYhDdmxkj|NrmmmRiMK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izationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java deleted file mode 100755 index f5d70372..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.java +++ /dev/null @@ -1,1221 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000D9F8BCE43C04C054F75CACA8E2843C3ABA2D50AAA59A212515065C609991735B29A7646B348788F77644FF08DEDB2D9B7E646B0A4E40B7DE058FB0D939CA70433E3039E5CA39C034B83D37AE940C76077790301AA042DEE10FD86081D85A38D883BF7E690D745238386A3180D40F7086E6F57726E8218A52C858B55D3F88E83F07EABE0943753385430A964986031BF11E923AA1DDFB3926741F19430567D42FD76782BBD2617F51435F5D21CF8C1A7123B21CD4DB852CF08399F6FF7A295963F1EA81C1AA8C6DFB07EAA489AB27FC6F3A7E1D1EAB960842EF20ED1E217F54100000 -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -//import util.ClassUtils; -//import util.ExceptionlessInputStream; -//import util.ExceptionlessOutputStream; - -//import LBJ.learn.SparseAveragedPerceptron; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser; -import edu.illinois.cs.cogcomp.lbjava.parse.Parser; -import edu.illinois.cs.cogcomp.lbjava.util.ClassUtils; -import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream; -import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - -//import learn.*; -public class OrganizationClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate OrganizationClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.ex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate OrganizationClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (OrganizationClassifier) readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new ArrayFileParser("OrganizationClassifier.ex"); } - public static Parser getTestParser() { return new ArrayFileParser("OrganizationClassifier.test.ex"); } - public static boolean isTraining; - public static OrganizationClassifier instance; - - public static OrganizationClassifier getInstance() - { - loadInstance(); - return instance; - } - - private OrganizationClassifier(boolean b) - { - super(new Parameters()); - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "OrganizationClassifier"; - setEncoding(null); - setLabeler(new orgLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public OrganizationClassifier() - { - super("ml.wolfe.examples.parisa.iJLIS2.OrganizationClassifier"); - isClone = true; - } - - public OrganizationClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - public OrganizationClassifier(Parameters p, String modelPath, String lexiconPath) - { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "OrganizationClassifier"; - setLabeler(new orgLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 74 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: ml.wolfe.examples.parisa.iJLIS2.OrganizationClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = ClassUtils.getParser(testParserName, new Class[]{String.class}, new String[]{testFile}); - OrganizationClassifier classifier = new OrganizationClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "OrganizationClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof OrganizationClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public void setParameters(LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public void learn(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public FeatureVector[] classify(FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public FeatureVector classify(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public Feature featureValue(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public java.lang.String discreteValue(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public double realValue(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public void setParameters(Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public ScoreSet scores(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public void setExtractor(Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLabelLexicon(ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.lc b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.lc deleted file mode 100755 index efda01563773c78ba4bec164ceff89f6d887ea97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3303 zcmVfoJO9KQH00;mG0N7RPL;wH)000000000000#g708BzkMrmwiy;ym4l+_iV zgy@7t$ezh$lG(RpGRe#&0V9&{fmonnQI@LMNC-n12$N(IqOmLi7mk9mSW09O^a!GY zP-C$wg?YHJSSW&kr&Zz+2-Jllivoh_d-r?y(|nkNfAn;Yo_p^5-n+~1{_cG*X!-^x z&G3e*t3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qnx&J&( zU&sCLAL%d&zavY3NG_?FoJ9d*lG{ z+xN%1GR`BHu@SyIKPv~j1)HnO_*`~=l?3?uUOLYFFQuNstz0MWrgq3*_rwvv$L;w< z?my3Yz%6IflTbHrW(&;goY!I?AFn?K{ChSG0o`%eRnV<#+aUh@osYu%%iWgC?{#Y5 z)K8vge|=D%@7uP>cET}$hxgF|Ano0@LEIUm^iXf(e+I$4_TK&luN%!P;q!Pc$veFr z`l?`M9pGBTkGx;@R*RT26pq8wL(2TBdvYt}Z<&7>^2}Uw1pZF=@xhI3-+pr2xMcpmq=~y`LS5``cvsM@ zwn;EY(%+p4_ik!vBFwMU&*Zt5_S-YCo-t;mO9u!s zP3v=K3;+PW8UO%LO928D02BZS00;osRq8}BP3v=K3;+PW8UO$X000000000000000 l0000008BzkMrmwiP)h{{000000RRC2H2?qroD2W}007_#p{M`= diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationClassifier.test.ex deleted file mode 100755 index 54d84a4d0fc72a4b72896c272caf5fdc26e70458..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17129 zcmYg%dpy(q`+s%kPCB?1Ny_fHl|v%CB`m9ilJgvLRt^&)$2nx~l+=hjCWdXHIn3$9 z95O~KWM<2mG-BB@XT!`ke((GH*N=zCV}H!{-g~d>x}K-Y_ReqnW%oz|zoU-an|uDh zp98>S%NrJE4}$#`v9UwDqjsab+9v~@fk75`bUbbq)|VHeZ&*A$PL{EkLZ47muebU% zQU@E^gHn8fiqgJ&(|sba3MD7knb1-8Bc$ADDZuf&OjR$`i@tb1Yh8@x=q(%Zc@TU= zxOE!?Ge!Fz&!N+>MqqwkQ1y7VV0V|fd3>~>ZE+pi(r&6F1pc5ZAH_)TI+2==l$I3x z`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7FYbw_Nw$#_ZeQb$O1N*G%)IIqF7;ne^Ki=3CM{C*vDHs_qt zMfk- zOdKl^7vx>0FQJAkSf*90RVV;?jBdih8I6qEiMS}1OYJg~`#08j!g3tgz;tSQuSO_N zC)=nC=GZm%tRlKDbE&*#xGk#pAuiVVRe-^$N3(hFmxyS01qfj8q<}g&AmHpgleFn_ z#y`|1Go_=8^#-FElch|+BMFnOTCGruzga{wm&u^%!^ zJ4InpZi68@4%K-{oCA3REpWt+^D_mgYp5D9xWXDk8Ww@f=K90^Q=#!oaS*rpFXT?Q zg3Z*K=7~uIVyOGiz`YxJJBxhOK#Bsw22=hu)gvfW;(TZdYH zymi&C95OA(G01W@K(4nv+O`7+Dab-(XcW^r;tDD0>SAFdf-;xu5N?Xq9EM9Mp+V)}2R4{*jEeE%B zTp69I`+g_`xGw+Y8qJCI4?5-v%gbe~B5$Yf@?hRq+1&BQmi)9ca{irT>4Q^`x=xd; z;(rH(mSTKHUdqUkuDMkE=w`0CV|*Uhb40OSVU4xW{a)FUf2wwz#XXVL^Sw81>acKF z3-`bKG-AFM5SuehmYXfj4|eDo+rs)pV1*SEagK{Ml4f&0Z&qKCfGHBuq_=qVKRsRA zf8@T9?H|`Rp|D%lcC$%ry1(vz+7~QA^6MC=aO7%GMJq(8xscj4De!UrQdlo+ObmR_k4%TJL z1ltRXgvgp_J(ZnXeJi)iVwU+PF-WP8gMIvYr|$lTNb)KK42=L11UwX=cLM4~e+&O8 zmZA+9uzD_o) zuf|r7h^74HJVvV;D~L8Zu+W<#(K=)oYJ2B^r0>)Jw=S(rCkBQkC)pVSycwB97!c=E fAj^Tyr$7bJ(<%bIS=m4mj6i4#q~`$*V_*OPvDf5G diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java deleted file mode 100755 index 3ef04dbb..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/OrganizationWorkFor.java +++ /dev/null @@ -1,92 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.lbjava.infer.*; - - -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.OrganizationClassifier; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; - -public class OrganizationWorkFor extends ParameterizedConstraint -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - private static final OrganizationClassifier __OrganizationClassifier = new OrganizationClassifier(); - - public OrganizationWorkFor() { super("ml.wolfe.examples.parisa.iJLIS2.OrganizationWorkFor"); } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 118 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = ("" + (__OrganizationClassifier.discreteValue(t.e2))).equals("" + (true)); - else LBJ2$constraint$result$0 = true; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationWorkFor(ConllRelation)' defined on line 118 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "OrganizationWorkFor".hashCode(); } - public boolean equals(Object o) { return o instanceof OrganizationWorkFor; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 118 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__OrganizationClassifier, t.e2), "" + (true)); - LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.ex deleted file mode 100755 index 2df1c53159ef342f4cb32b7b0a7b811808d69021..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17506 zcmYg%XFQwx`~T_Co~m-%Qj~Jq+Ky4Gijb;n!lI z$$f~yv*#{r838*jBd`(1=>4U~HEQ{i$%+!t@j)o$dj98gv_ECJAm?%X;{}gA#$-MI zXuqJ}-YEFbjq(?@*6q>Jv(3&{FY5-cVQS>o-wrSEh0-TM4Hq`3Y-TDmgU&eAq0grW zW0B3OsErIQRm^(Nq(^y!D{1lg5W|jlLM=>`bExanuF3-~6Ng97PKt3E%pmzJyW&qW z{yMRk-Rd3k>J{=BqY4ri!d-BoiJ$p-@b{n8uh+*$2U53kOOsTh;$Qh&4`(D?K=R5u z(6<>6-ezi-ZRK{F%>?k@rWy%FBOx7eclV5wOQO7=xAH6&o?VN3a$b&U=ELWB{$0q% z1e62ydDyUS53Yazs&Hwau7(>mYW)X z%XcHz8pHBtv26aL;*@4eBXTkwlI1dcGmxF@R@;era5X={$o>*5d-)~f(w)opLJ`Qb zuDi`yJAAb*MH-WxnX=ePGRonnnD2t2a8g@!6-EY&)8gVX_(>kLmEnM_UwO|ypEF!J zEj^|6HMeKxtl&}r0;yy6Dxm3)+{qP~$8sqb*T6e*?v8hfGX6T>J~fogoukk`oen^lw z-nJtC)n3x&L~mxFW!TY-;eG$TZBTfC`-gJlwtCH(XFovG|9k;Cyn?L@7i;gMvMMoO z2WVd2TM|zix@xl)H{W^$8o#HHxSi$CIX3d7xiy-_4;@O-GC>m@&^wEOu;zGbT z*++=ydqsvJGm}(A1l6LFl$pnMhZ{uDvTzS2Is9bqJ{9kwyMVStOX7Gds<`mV+*GqE z_Hw0smG00rd6i)WDU}(?j#b>sT-v)8jgvi8HD^~2lrEJoWt^Qq53>yENw2rg z*Ix7M%b#a8ypNwB&7f3k3^D&cmz&;#tA#GU-wu);gZf*$-!9Vry%UwU_>yDRY6&l? zKbXX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DDj6x&}z&4E=) zrgiEnMU(h-W*}f#d0*QSyA$B|VCtFFnsZ&?`#jO|RR>@&#QhexV4Bi6rzr)cppANv z76)2mU4g(jJvQj>f}^&ALsf%*YL8Tkh(WyS874oM7h^1T1L4>LAdj55lgX9&G|2Jg zDjfNq!uWOZun6BUOxueKL)MZX%8GFJEHe-Znd<@8s>%4zBp(_An4%eJz@D*Z;6GjF z7*?^UU_M_-V6_C(`FiZ&Ww^#lhDX_7c!bef3?4vV$$4J6zZ&@Z6}q(IP~ThAwotq* zTh(M@b$FY(I{8*OY&ObD`?&?7_|S2;Sr6Fib?=uC@H_Br0ExpY*4fCuO(-je{&GsA zt-)dmmA2EV$Ve3vl}afbxljO+uK%1xGW&f-6)Qh{dnq100xQ`y-+o@}V{bUBWyB`b z;AxB>))VV7|4?bcE&sQ?fBr?jyMO;V1)RUSTl9FP)e$Yrn6u|k6`oC)V{H^ZZ|aRc z<r+&+J5tH&|d-N3E!Uw;Jv zw~%m6-IwuQYS-020aa&S9<*D$_0qA>cfdiUna-}~gMl%5FLG+t;@RiJSRa4-W8k(u z=YGtR=XWdpetBrWZRHMLI$spH5Yy}L_S>t64;z3j{TV>K!?qNY{{ zSiZJ=ZCdyL|99rBUw10+-8Wu$&)WTsru)gw#m{GdnJ+3){=P=u<+Zx_t@U2_*WZ?A zzgzO&>-Ljhfua94Td#XpYYc3q0>`%1u8Pl{bogEA1>n-uyv0{iN;hkUR<}2;{KCKc z`HZ#GD!b-StrbZJ2BpNRnoi{xajX9AjXrO3YWvG~tIt=w3p;!}wl1vSw({P>Ye}i| zp7WfyT;m$V*YC0V(){;fpChg=_kMV@)zUNnPkewkJ4d~CQ`RGA28Jak*%<=78JR>F h5C?-G%YhCCK?TrbLIS*5*+3GEKxhi2#lh!^000P5Ns#~m diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java deleted file mode 100755 index 0ffadfe7..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.java +++ /dev/null @@ -1,1220 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000D9F8DCA430140148F55A9D39938B91F727A8E142420280ACAE9CB84B33D9DC0B36FC0DDD3EA22EBBB342F60E5BAA8AAFA2445F24640F442A997390553EE329C9D6237A430ECF2972260B50CDC93422416827C8E30EB3528AA19748D2B54BFED11A551258DB4EF006A91E8D1EEAFDEE95D09D3D0481A5577DF230A1E2DF9CEED7692DD2065E04275E0A0374B30C371415ABBF421C19243E3F45C423FFC903ADEE08D0CF61C5F71B60B344F3139A631EAAF5DA1E71C84D67FF349224BDF2314F60D588A3DB6C2D5313F8DEE9E365B25D0E2D9302E0F7B7F9F4DF24100000 - - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron; - - -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser; -import edu.illinois.cs.cogcomp.lbjava.parse.Parser; -import edu.illinois.cs.cogcomp.lbjava.util.ClassUtils; -import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream; -import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - -public class PersonClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = PersonClassifier.class.getResource("PersonClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate PersonClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = PersonClassifier.class.getResource("PersonClassifier.ex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate PersonClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (PersonClassifier) readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new ArrayFileParser("PersonClassifier.ex"); } - public static Parser getTestParser() { return new ArrayFileParser("PersonClassifier.test.ex"); } - public static boolean isTraining; - public static PersonClassifier instance; - - public static PersonClassifier getInstance() - { - loadInstance(); - return instance; - } - - private PersonClassifier(boolean b) - { - super(new Parameters()); - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "PersonClassifier"; - setEncoding(null); - setLabeler(new personLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public PersonClassifier() - { - super("ml.wolfe.examples.parisa.iJLIS2.PersonClassifier"); - isClone = true; - } - - public PersonClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - public PersonClassifier(Parameters p, String modelPath, String lexiconPath) - { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "PersonClassifier"; - setLabeler(new personLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 27 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: ml.wolfe.examples.parisa.iJLIS2.PersonClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = ClassUtils.getParser(testParserName, new Class[]{String.class}, new String[]{testFile}); - PersonClassifier classifier = new PersonClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "PersonClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof PersonClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return (Parameters) super.getParameters(); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters( SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public void setParameters( LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler( Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public void learn( FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn( FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public FeatureVector[] classify( FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public FeatureVector classify( FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public Feature featureValue( FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public java.lang.String discreteValue( FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public double realValue( FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public void setParameters( Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public ScoreSet scores( FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public void setExtractor( Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon( Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon( Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures( Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLabelLexicon(ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.lc b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.lc deleted file mode 100755 index 50cb93aa01219d80407038b0110ac9fd0ec741c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2080 zcmV+*2;cWmO9KQH00;mG0NGXQL;wH)000000000000#g708BzkMrmwi?N|$J6jcHNbnCxBShJPVz7b` zHJE6Wh;#-Cp$LlN-ykLs5F;SaDpC`ZZr<;l^X|RxGb9V{&+cD8w%bK@YmKVRf-%I@;aL$xUF+yF=1$@ zL^U|6!ar3G2v>GGdQ>o?L}r)C{>Y55Tq}4ht}idl56J#-Fuy{crBsH3oKz6(u^5nJ zZ>6qhcK(e@ZDm-F$m7GxbS0w9lqW{QO0e1h>%sz4+iT?{{NKUX%#9GkBG`agNC@h! zHsSYTzu;;*xVyciKcCEoW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-OAZXFErhce%eN$A(!Yxknfnoy29ymgcG{Z@Y!o(H}O z@9Oo%3z64XbSJk3toL9WwtHvk`zJGyt^3t?GtP58com*^`^2R<&gRGSMa$a12=hJT zl?9lm?)z5hetb#KXLo3Uw%QEUR^!@kwp7!r-W?#J<^&d~hx4Cp|TuoQ- zw301@A@Ae%7uA(=*v(Xz_S~YM_b&fyxbB3*;`zMywUV#40k2l__0n_ko8#SwhQo&F zE>8y>@9LMiarG4E?=CFi4!Eafsde4f_TRH+f9AG?_V*kWt<*6R&e`+k_1#|y=a98s zZJRR>f6M)k7OgaQSy%G3+qjpp7H$%>5wDKn_(yt*C$(&YdwJIdkoKP}nzW&n`}t(t z{?ak?@mwk$)7G7MYo!xC7cxJzg8H`)R#n}q6+8=XHwU{o0_Xc4)^G0;yr*+*+XT4h zoqJcq?^0Unl7~@u&adUX{f*xMP)i30*!yaSpa%c|tQr6SP)h*<6aW+e2mlBG*;VR9 z*!yaSpa%c|tQr6S2LJ#7000000000000000002xvN=9jHWl&261^@s60096205t#r K0M!Qo0000%3Mfnf diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonClassifier.test.ex deleted file mode 100755 index 2df1c53159ef342f4cb32b7b0a7b811808d69021..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17506 zcmYg%XFQwx`~T_Co~m-%Qj~Jq+Ky4Gijb;n!lI z$$f~yv*#{r838*jBd`(1=>4U~HEQ{i$%+!t@j)o$dj98gv_ECJAm?%X;{}gA#$-MI zXuqJ}-YEFbjq(?@*6q>Jv(3&{FY5-cVQS>o-wrSEh0-TM4Hq`3Y-TDmgU&eAq0grW zW0B3OsErIQRm^(Nq(^y!D{1lg5W|jlLM=>`bExanuF3-~6Ng97PKt3E%pmzJy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-)dmmA2EV$Ve3vl}afbxljO+uK%1xGW&f-6)Qh{dnq100xQ`y-+o@}V{bUBWyB`b z;AxB>))VV7|4?bcE&sQ?fBr?jyMO;V1)RUSTl9FP)e$Yrn6u|k6`oC)V{H^ZZ|aRc z<r+&+J5tH&|d-N3E!Uw;Jv zw~%m6-IwuQYS-020aa&S9<*D$_0qA>cfdiUna-}~gMl%5FLG+t;@RiJSRa4-W8k(u z=YGtR=XWdpetBrWZRHMLI$spH5Yy}L_S>t64;z3j{TV>K!?qNY{{ zSiZJ=ZCdyL|99rBUw10+-8Wu$&)WTsru)gw#m{GdnJ+3){=P=u<+Zx_t@U2_*WZ?A zzgzO&>-Ljhfua94Td#XpYYc3q0>`%1u8Pl{bogEA1>n-uyv0{iN;hkUR<}2;{KCKc z`HZ#GD!b-StrbZJ2BpNRnoi{xajX9AjXrO3YWvG~tIt=w3p;!}wl1vSw({P>Ye}i| zp7WfyT;m$V*YC0V(){;fpChg=_kMV@)zUNnPkewkJ4d~CQ`RGA28Jak*%<=78JR>F h5C?-G%YhCCK?TrbLIS*5*+3GEKxhi2#lh!^000P5Ns#~m diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java deleted file mode 100755 index 5cb74743..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/PersonWorkFor.java +++ /dev/null @@ -1,89 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - -public class PersonWorkFor extends ParameterizedConstraint -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - private static final PersonClassifier __PersonClassifier = new PersonClassifier(); - - public PersonWorkFor() { super("ml.wolfe.examples.parisa.iJLIS2.PersonWorkFor"); } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = ("" + (__PersonClassifier.discreteValue(t.e1))).equals("" + (true)); - else LBJ2$constraint$result$0 = true; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "PersonWorkFor".hashCode(); } - public boolean equals(Object o) { return o instanceof PersonWorkFor; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__PersonClassifier, t.e1), "" + (true)); - LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java deleted file mode 100755 index a5620079..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RelationFeatures.java +++ /dev/null @@ -1,63 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; -import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - -public class RelationFeatures extends Classifier -{ - public RelationFeatures() - { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "RelationFeatures"; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } - public String getOutputType() { return "discrete%"; } - - public FeatureVector classify(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 15 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FeatureVector __result; - __result = new FeatureVector(); - String __id; - String __value; - - __id = "" + (("WORD1:" + t.s.sentTokens.elementAt(t.wordId1).phrase)); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - __id = "" + (("WORD2:" + t.s.sentTokens.elementAt(t.wordId2).phrase)); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - return __result; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 15 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "RelationFeatures".hashCode(); } - public boolean equals(Object o) { return o instanceof RelationFeatures; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index fc27ea4c..7cc74779 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -108,7 +108,7 @@ object RunnerPL { val modelname: String = "mytest1.ssvm.model" trainSSVM(modelname,cr) System.out.println("\n=== NOW TESTING ===") - //testSequenceSSVM(modelname,cr) + testSequenceSSVM(modelname,cr) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java index e8bc2487..f636ce4e 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java @@ -1,17 +1,10 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B4ECFCB2E292A4CCCCB2150FAC7029EA14A25C5A94959A9C52529FA1EC9F979393149A939852999F97A052A9A05DA0E0109A545C9F971E9F549DE69F54A10413DF815070FF2A4F4CCBCCA20BA348495B24D200172979CDF5000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.PersonWorkFor; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.OrganizationWorkFor; - -import java.util.List; public class JointER$subjectto extends ParameterizedConstraint diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java index 3b124b4a..5773cc0f 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java @@ -1,19 +1,13 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09BCE43C04C054F75CACA8E2862C3ABA2C20596524AA4545851B14EEC8B9C099AD32BD1AC34CFB311DF506B75AB747EED89C282931C64B54E4F58E9487191DC2DE319E9D24837ED2E1F95A7260F90CDC9346245601D67D8B3AC03852E6169CE9CF37548E38291CE55E00C4748F30437DFAF0C6E8C186B48174E65577270AAB71D8F6878A7D2937A225AEB747CA3C9A33D02A5AA90CCA1059183A1C139770F4505D8EEED941B5A8F84A18A8BA0F7F94C6499D2E838E61A99E5CC1CBB41A7623B138BA9EC6E0F30E46EBAF74FB2A4BCF075C0E055C46DFB4A25D81A4B3E116B91CBC0E079D4304C1F71093AD0A51F6100000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.orgLabel; -import java.util.List; - - - public class OrganizationClassifier extends SparseAveragedPerceptron { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java index c222f6a6..26b20968 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java @@ -1,18 +1,12 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.OrganizationClassifier; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; -import java.util.List; - public class OrganizationWorkFor extends ParameterizedConstraint { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java index ae39f184..1387fa40 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java @@ -1,19 +1,13 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09DCE43C04C048F55CAC98E1862CF4F45830A2DA48459041831714667DD469C6CBB2BD12024CBB3BA6F518BE86664FDC8F0AE48C80E984431F622AA68340293BD42E81B5C9F52D04C06B08B93788482C09F86DD3EB35489430770B56B06FDB324B94841E0296406A91E8D1DC5FBD30BA12B3A690D79AEAAEE3D845F094CF70E85FE35C8127AC5FD3A16DEE4995AB429BA50CAA109431B7589385F0FC91549EEE3940B32F50AD156394CF3726B203D269537B0DC2F26D06D7073039A611EA69BA53CF2819ADEEF19F2B0D6FBC40D9145E38E0FA127554C4D59324F172BC391C563D001BFF30A3599ED9C6100000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.personLabel; -import java.util.List; - - - public class PersonClassifier extends SparseAveragedPerceptron { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java index 23b8daf9..e1e5a16e 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java @@ -1,19 +1,13 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09BCE43C04C054F75CACA8E2842C3ABA2D50A24755904167C6A239172912391F8C6780212EFD915BAEF10BDBA3EBA37DECB6B24640B0BC87CE85671055D77E94EA67C13486820A97E806B2878B6804821F40F10F3820CCAE36F07186F4863B092472C3144A50E4D15FDF1F244348E275715D0C315532B8BF4C9AA30780E317AAE90D0BA6FC7356BC29A851CAB601E93A3585CBD00F690549E1FB840B727FA42D25231E8F3767BCA3D06ED3B58ABCB9D08D0EBD1329A6E0EEAC5F60E71C84D6FFF8E7948E9FBD40B5382C97D1FDD7A2278CD7E748EBCC696638BDAB60A8EEF01CF3394BE6100000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.workLabel; -import java.util.List; - - - public class work_forClassifier extends SparseAveragedPerceptron { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java deleted file mode 100755 index 06953d8c..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/orgLabel.java +++ /dev/null @@ -1,92 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 - - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; -import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; -import edu.illinois.cs.cogcomp.lbjava.classify.Feature; -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - - -public class orgLabel extends Classifier -{ - public orgLabel() - { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "orgLabel"; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.iJLIS2.ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Org", "nOrg" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 66 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'orgLabel' defined on line 66 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Org")) - { - return "Org"; - } - else - { - return "nOrg"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 66 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "orgLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof orgLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java deleted file mode 100755 index e2b3ea56..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/personLabel.java +++ /dev/null @@ -1,98 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 - - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - - -//import LBJ2.classify.Classifier; -//import LBJ2.classify.DiscretePrimitiveStringFeature; -//import LBJ2.classify.Feature; -//import LBJ2.classify.FeatureVector; - - -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; -import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; -import edu.illinois.cs.cogcomp.lbjava.classify.Feature; -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - -public class personLabel extends Classifier -{ - public personLabel() - { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "personLabel"; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Per", "nPer" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 21 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'personLabel' defined on line 21 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Peop")) - { - return "Per"; - } - else - { - return "nPer"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 21 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "personLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof personLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java deleted file mode 100755 index 3f694095..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/workLabel.java +++ /dev/null @@ -1,90 +0,0 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - - -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; -import edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature; -import edu.illinois.cs.cogcomp.lbjava.classify.Feature; -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - -public class workLabel extends Classifier -{ - public workLabel() - { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "workLabel"; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Works", "nWorks" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 91 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'workLabel' defined on line 91 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRelation t = (ConllRelation) __example; - - if (t.relType.equalsIgnoreCase("Work_For")) - { - return "Works"; - } - else - { - return "nWorks"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 91 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "workLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof workLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.ex deleted file mode 100755 index a9a59b507cc240665647f3831400debe88a80992..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0sTIO%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r@Dsef#U|u5bS5V~8IA;_WY^2lDHwqUl~1uG2iwSJIuO?qi0tBx$@BU z-fo{a8#h*N?7ePavBd8Bu9LqW{_CCP@{K>-dG`Cdpp@%JmKt4Mp189xXvOaJR<(}6 z$!t!u^re=I<*lxt@f1f7l)exX#YO6uJ7UD+{G=}(9Vx+(6v09D=`g4xzv@O1o(vb| zEp!&sKLum zw<$z}iYCJt!?p15XP%a?032N6R!-0}AML=%JeI^*uZ0gZeEjt);NcQy4JBTAf2cR2 zK9_k^J40b%8lpCVs$FA;yT#81s~8*L;ch56=b3nL0`a>F5E?#?^*V_Y@eaJ@qj0FF zAgcYtNUwk@l+rT+Bo}(1_;_K88LXYBu-MlorJi!_c^TG4KFqxQqa3?MzQay^s#~># z%(;v_~MzdkzR7BkaK)WwQ~&CLv}T+K0Z~5(dK1plg}hR%muEu zk>B=`mq!`e0)o^m?HdEwmIAM6@H!~O?j8%HgsKzCA9~4{D89R#Zw851sl{b;Mh*xw z8A#40uZ$vWk?+-(XA)}=vaQeCbSLYa4G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/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java deleted file mode 100755 index f42cab20..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.java +++ /dev/null @@ -1,1215 +0,0 @@ - - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser; -import edu.illinois.cs.cogcomp.lbjava.parse.Parser; -import edu.illinois.cs.cogcomp.lbjava.util.ClassUtils; -import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream; -import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - - -public class work_forClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = work_forClassifier.class.getResource("work_forClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate work_forClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = work_forClassifier.class.getResource("work_forClassifier.ex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate work_forClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (work_forClassifier) readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new ArrayFileParser("work_forClassifier.lc"); } - public static Parser getTestParser() { return new ArrayFileParser("work_forClassifier.test.ex"); } - public static boolean isTraining; - public static work_forClassifier instance; - - public static work_forClassifier getInstance() - { - loadInstance(); - return instance; - } - - private work_forClassifier(boolean b) - { - super(new Parameters()); - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "work_forClassifier"; - setEncoding(null); - setLabeler(new workLabel()); - setExtractor(new RelationFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public work_forClassifier() - { - super("ml.wolfe.examples.parisa.iJLIS2.work_forClassifier"); - isClone = true; - } - - public work_forClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - public work_forClassifier(Parameters p, String modelPath, String lexiconPath) - { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else { - containingPackage = "ml.wolfe.examples.parisa.iJLIS2"; - name = "work_forClassifier"; - setLabeler(new workLabel()); - setExtractor(new RelationFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRelation || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRelation || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 99 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: ml.wolfe.examples.parisa.iJLIS2.work_forClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = ClassUtils.getParser(testParserName, new Class[]{String.class}, new String[]{testFile}); - work_forClassifier classifier = new work_forClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "work_forClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof work_forClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public void setParameters(LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public void learn(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public FeatureVector[] classify(FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public FeatureVector classify(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public Feature featureValue(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public java.lang.String discreteValue(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public double realValue(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public void setParameters(Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public ScoreSet scores(FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public void setExtractor(Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLabelLexicon(ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.lc b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.lc deleted file mode 100755 index 6ab4bbf57626fc5024e8f066b4d31bf76dcf955a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11279 zcmY*mF-L=Xf-K}32WFVf^i38+XX0s<<%*CZ+;NR=icB?2Oy2uKe^ zdI#xJ1EB;65R(u>`t_T+Gxxi@KhBxinKNf+=j^l3oX6bs_zA!f-oHL=xovRde;Lo; z{r$WD8NKjy-L*dzXgSr?CVBou${Xt&1(y}N^J95qzx?n#p(lxQeodKYN zy-#7*mr8jdyee`Q26oTSpZzkM`Qf$nzi$32OZU}}XB|(8{W(bIu!+*l@TKmCr3jDK zI&`@M5}%{PVglQ^VCK%Uki;Ekw4`Kyz9eNM=7z}aaw>v?ANtH)cq17PwFV)a`i6c< zDvdxjX#LCdGrch*_CMsLHKd>CySze~B`LH6cV*#%r3Hgqrl7=Nlbi`p2R;7jJuT(9-dMM0|)Tvi%D-)=pIA3K<1bDLZRtVKM zf1YDBaeWCP#hXdNquasUN1;DfK`sv4b8fn&YZYp zH*KL_Cpnu>)9CpcbHU8%$6flFAqoIBQ4T~Ei~6RaZ_F}^?m1#df58D*T56||?A%7% zma8qMZ5sN9^iGB02`%0K$sY2kZvgssTJui}??f-O8P>V5r!Ew3;@u*ktMr#BmUD&O z)?j4SzQQqIVP~Ui^Ml*eZ`4u7GHLV}>xV-Eyg+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$1)%a>#F%jxM28-TX z0zik?C$YI$19V(KfENO4LE+6ceON-AaWsQ>TgyM`+!FyyYI_W28PP5^k6s6NL?9aF zu3Jw^I+iUJvPypqayPa6eG~H>7yE#h)Rv4HWu2IvM#s>PznD)+u>3y+`$!)NN&nFV zZ>TZvXoJ4?Q~KE&br%wk_}`DoBpLP#PvNDbrvLn92w@0W_{{J7pwUl=GwZ57`?40q zA1m8%ab@rDh)MtMip%2FG8ZWg`HyMq{M~d21_=kVIb3#6kS_D7!c8O-Vs6UAo2csV zmaK5(2w&onBj%<@j{%PSKNau)j{T2{_y4#5tLZg2J^9c71djf7)xT@k-@}d^`9ILo B%8dX3 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/work_forClassifier.test.ex deleted file mode 100755 index 683d677bbf2ddf7436f50bc5935917449bea3dbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0sTIO%gU%u?}?hs-3)u(Sj`u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r@Ds<^MXn>zn`i7^26&`0S;eJ%4JhByQO8S4OX3%(o-O4zq6J=$Vy&t~_+T zugB-j#*LL5`>q>UEU~-3>*TM8|9WS+eB%#yp8dWqDCPQ*rAAkmC+;i^TCsb*Rjng% zGMm#ZeW`83a#z>Sc#5M3OJ9hI;v)6S9Wml@UecG&&XizCir}F7bQsi;U-cjeSB8u7 z7CMan(H_xY=}_}b`s%V>)X?Rp z+Z3W9MU!ES;ad3jGf&G`01hs3D<|lgk9J^W9!p}Z*TM%HKK^utrRg4WVzXuA=c_tp3K>V%(gock}eNN&;yaRXnC>-i3 zi0b$-(kGw_rSwby$%P&$K3<^{94m z9Fg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;GCk~ z_|p{w(n(F-*dE~nK`I}1Ym;t2m2^Xy_!82+4bwgf{tk?`*m0MYuGD-X=ro-Rt;gqh zcAP*yOzw3;J#ZifiJpZmXZrqvQyaM_=a3+cTczOjCS_2S)L}UB(`6Jv@t@{b#8)*- za6f>@VjPL|2Pk%P=3IJ*Hz|gCRQn7gco?0NLh0H@+dfSGl)vC;o4A1aaUs3g zr2MIh7g5EVOH;pZF6DKyYF5vD-4OIV=Ct9wwiv>dpWUs#*pOkh>SBL2m*-B|iE!^6b5Pg=& z<{5^OuYPes*Ea5%^W(7c0H)16HBEQGu%))`ao4ShFGk5?s7H~`%+#?>Bh#Kb7{KWi zoFryPSnE#JI)|LCr6slG)9kG$KAI%=-ZJfW{8W3o-dqcswjFLdAgr6Yzr#-`%a&wY z$3s1Sw&b+D4<+ltAn6-4Opw;t$16;sFps>NuWmGrOnH)k^f$^hzb(&xO%|=PpH5=>I Date: Tue, 1 Dec 2015 10:20:32 -0600 Subject: [PATCH 014/118] Modified classifier imports --- .../saulexamples/nlp/DataModelTests/GraphQueries.scala | 1 - .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 10 ++++++---- .../SL_SVM/iJLIS2/JointER$subjectto.java | 2 ++ .../EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala | 3 ++- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 1 + .../SL_SVM/iJLIS2/mYjava/JointER$subjectto.java | 2 -- .../SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java | 1 - .../SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java | 4 ---- .../SL_SVM/iJLIS2/mYjava/PersonClassifier.java | 2 -- .../SL_SVM/iJLIS2/mYjava/PersonWorkFor.java | 4 ---- .../SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java | 2 -- .../SL_SVM/iJLIS2/mYjava/locLabel.java | 8 +------- .../SL_SVM/iJLIS2/mYjava/work_forClassifier.java | 2 +- .../cs/cogcomp/saulexamples/nlp/commonSensors.scala | 1 - 14 files changed, 13 insertions(+), 30 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/DataModelTests/GraphQueries.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/DataModelTests/GraphQueries.scala index 573805f9..99689b3d 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/DataModelTests/GraphQueries.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/DataModelTests/GraphQueries.scala @@ -1,7 +1,6 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.DataModelTests import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.saul.datamodel.node.NodeSet object graphQueries extends App { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index 6c958665..85910f9c 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -1,12 +1,12 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + import edu.illinois.cs.cogcomp.saul.classifier.Learnable; import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; import edu.illinois.cs.cogcomp.sl.core.IInstance; import edu.illinois.cs.cogcomp.sl.core.IStructure; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; import edu.illinois.cs.cogcomp.sl.util.Lexiconer; - import org.apache.commons.lang3.ArrayUtils; import java.util.ArrayList; import java.util.List; @@ -14,14 +14,16 @@ public class ERFeatureGenerator extends AbstractFeatureGenerator { private static final long serialVersionUID = 1L; private Lexiconer lm; + // public List c; - public ERFeatureGenerator(Lexiconer lm) { + + public ERFeatureGenerator(Lexiconer lm) { this.lm = lm; } public Lexiconer getlexicon(){ return this.lm; } - public IFeatureVector getFeatureVector (IInstance x, IStructure y){ + public IFeatureVector getFeatureVector (IInstance x, IStructure y){ FeatureVectorBuffer fv = new FeatureVectorBuffer(); ERqInstancePL mx = (ERqInstancePL) x; @@ -52,7 +54,7 @@ public FeatureVectorBuffer makeFeatures(List feats) { ArrayList idxList = new ArrayList(); ArrayList valList = new ArrayList(); FeatureVectorBuffer temp= new FeatureVectorBuffer(); - + //c.get(0).featureExtractor(); for (String feat : feats) { if (!this.lm.containFeature(feat)) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java index 9f0781b1..456d0d6d 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; import edu.illinois.cs.cogcomp.lbjava.infer.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.OrganizationWorkFor; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.PersonWorkFor; public class JointER$subjectto extends ParameterizedConstraint diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index 7cc74779..c66cdc16 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -17,7 +17,6 @@ object RunnerPL { val sp = ERIOManager.readXY(cr,0,10) model.infSolver = new iERjavaInferencePL val para = new SLParameters - para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false @@ -28,6 +27,7 @@ object RunnerPL { model.lm.setAllowNewFeatures(true) para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); + println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) println("num?:"+model.lm.getNumOfFeature) @@ -105,6 +105,7 @@ object RunnerPL { def main(args: Array[String]) { var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp","Pair") + val modelname: String = "mytest1.ssvm.model" trainSSVM(modelname,cr) System.out.println("\n=== NOW TESTING ===") diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java index 5cda8704..eaab4400 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java @@ -3,6 +3,7 @@ import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; import edu.illinois.cs.cogcomp.lbjava.infer.InferenceManager; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.work_forClassifier; import edu.illinois.cs.cogcomp.sl.core.AbstractInferenceSolver; import edu.illinois.cs.cogcomp.sl.core.IInstance; import edu.illinois.cs.cogcomp.sl.core.IStructure; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java index f636ce4e..66519718 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java @@ -4,8 +4,6 @@ import edu.illinois.cs.cogcomp.lbjava.classify.*; import edu.illinois.cs.cogcomp.lbjava.infer.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.PersonWorkFor; - public class JointER$subjectto extends ParameterizedConstraint { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java index 5773cc0f..ca3de424 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java @@ -6,7 +6,6 @@ import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.orgLabel; public class OrganizationClassifier extends SparseAveragedPerceptron diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java index 26b20968..7aab0f71 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java @@ -4,10 +4,6 @@ import edu.illinois.cs.cogcomp.lbjava.classify.*; import edu.illinois.cs.cogcomp.lbjava.infer.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.OrganizationClassifier; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; - - public class OrganizationWorkFor extends ParameterizedConstraint { private static final work_forClassifier __work_forClassifier = new work_forClassifier(); diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java index 1387fa40..d796fc48 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java @@ -6,8 +6,6 @@ import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.personLabel; - public class PersonClassifier extends SparseAveragedPerceptron { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java index 4b22e54b..0f97e10a 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java @@ -8,10 +8,6 @@ import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.PersonClassifier; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; - -import java.util.List; public class PersonWorkFor extends ParameterizedConstraint diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java index bb2dce76..a06818a6 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java @@ -9,8 +9,6 @@ import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.JointER; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.work_forClassifier; - import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java index eebe12f5..e814c5b9 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java @@ -1,16 +1,10 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000D4C814A02C034144FA234659086F20577D590D594F2013E825CFCF8629254A4EEEDA222EA606ED3ED56CC121B0713D7C066703AFEDA0981A7F76A8DE2AA8C9CFC34CB3515C1E0B7C281FA0B5A1A691E5F063C7E4E52F1F6A131B3F996F3137E6317B6F4941FD7A5450523FF18EF84D512E3B0EA6D8000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; + import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import java.util.List; - public class locLabel extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java index e1e5a16e..c71f0dce 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java @@ -6,7 +6,7 @@ import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.workLabel; + public class work_forClassifier extends SparseAveragedPerceptron diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/commonSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/commonSensors.scala index 98e6920f..3294b6b2 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/commonSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/commonSensors.scala @@ -3,7 +3,6 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp import edu.illinois.cs.cogcomp.annotation.AnnotatorService import edu.illinois.cs.cogcomp.core.datastructures.ViewNames import edu.illinois.cs.cogcomp.core.datastructures.textannotation.{ Constituent, Sentence, TextAnnotation } -import edu.illinois.cs.cogcomp.core.utilities.ResourceManager import edu.illinois.cs.cogcomp.curator.CuratorFactory import edu.illinois.cs.cogcomp.nlp.pipeline.IllinoisPipelineFactory import edu.illinois.cs.cogcomp.saulexamples.data.Document From 0f0db251707ddb879fca739d305ba7d82e39b509 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 3 Dec 2015 13:37:42 -0600 Subject: [PATCH 015/118] working ER given the feature errors --- build.sbt | 2 +- .../IndenpendentTraining.scala | 27 ++++------ .../entityRelationBasicDataModel.scala | 28 +++++----- .../entityRelationClassifiers.scala | 21 ++------ .../entityRelationConstraints.scala | 54 ++++++++++--------- .../SL_SVM/iJLIS2/RunnerPL.scala | 1 + 6 files changed, 58 insertions(+), 75 deletions(-) diff --git a/build.sbt b/build.sbt index ed11d9ea..b3c5c5b7 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,7 @@ lazy val commonSettings = Seq( "com.gurobi" % "gurobi" % "6.0", "org.apache.commons" % "commons-math3" % "3.0", "org.scalatest" % "scalatest_2.11" % "2.2.4", - "edu.illinois.cs.cogcomp" % "illinois-sl" % "1.3.1" + "edu.illinois.cs.cogcomp" % "illinois-sl" % "1.3.1" withSources() ) ) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala index 1005f26f..7bdbfafa 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala @@ -23,24 +23,19 @@ object indenpendentTraining extends App { populate_ER_graph val it = 2 println("Indepent Training with iteration " + it) - personClassifier.learn(it) - personClassifier.test(tokens.getAllInstances) - orgClassifier.learn(it) - orgClassifier.test(tokens.getAllInstances) - - LocClassifier.learn(it) - LocClassifier.test(tokens.getAllInstances) - workForClassifier.learn(it) - workForClassifier.test(pairs.getAllInstances) + PersonClassifier.learn(it) + PersonClassifier.test(tokens.getAllInstances) + OrgClassifier.learn(it) + OrgClassifier.test(tokens.getAllInstances) + + LocationClassifier.learn(it) + LocationClassifier.test(tokens.getAllInstances) + WorkForClassifier.learn(it) + WorkForClassifier.test(pairs.getAllInstances) LivesInClassifier.learn(it) LivesInClassifier.test(pairs.getAllInstances) - locationClassifier.learn(it) - locationClassifier.test(tokens.getAllInstances) - // workForClassifier.learn(it) - // workForClassifier.test() - // LivesInClassifier.learn(it) - // LivesInClassifier.test() - + LocationClassifier.learn(it) + LocationClassifier.test(tokens.getAllInstances) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala index 1e230c36..2b797860 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala @@ -70,20 +70,20 @@ object entityRelationBasicDataModel extends DataModel { } } - val relPos = property[ConllRelation]("reltokenSurface") { - rela: ConllRelation => - val e1 = rela.e1 - val e2 = rela.e2 - - this.getNodeWithType[ConllRawToken].getWithWindow(e1, -2, 2, _.sentId).zipWithIndex.map { - case (Some(t), idx) => s"left-$idx-pos-${t.POS} " - case (None, idx) => s"left-$idx-pos-EMPTY " - } ++ - this.getNodeWithType[ConllRawToken].getWithWindow(e2, -2, 2, _.sentId).zipWithIndex.map { - case (Some(t), idx) => s"right-$idx-pos-${t.POS} " - case (None, idx) => s"right-$idx-pos-EMPTY} " - } - } +// val relPos = property[ConllRelation]("reltokenSurface") { +// rela: ConllRelation => +// val e1 = rela.e1 +// val e2 = rela.e2 +// +// this.getNodeWithType[ConllRawToken].getWithWindow(e1, -2, 2, _.sentId).zipWithIndex.map { +// case (Some(t), idx) => s"left-$idx-pos-${t.POS} " +// case (None, idx) => s"left-$idx-pos-EMPTY " +// } ++ +// this.getNodeWithType[ConllRawToken].getWithWindow(e2, -2, 2, _.sentId).zipWithIndex.map { +// case (Some(t), idx) => s"right-$idx-pos-${t.POS} " +// case (None, idx) => s"right-$idx-pos-EMPTY} " +// } +// } /** Labeler Properties */ val entityType = property[ConllRawToken]("entityType") { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala index 8c4611a8..2da1b082 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala @@ -12,7 +12,7 @@ object entityRelationClassifiers { val parameters = new SparseAveragedPerceptron.Parameters() //parameters.modelDir = "model" - object orgClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { + object OrgClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { def label: Property[ConllRawToken] = entityType is "Org" override def feature = using(word) } @@ -21,29 +21,14 @@ object entityRelationClassifiers { def label: Property[ConllRawToken] = entityType is "Peop" } - object LocClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { + object LocationClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel, parameters) { def label: Property[ConllRawToken] = entityType is "Loc" } - object workForClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel, parameters) { + object WorkForClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel, parameters) { override def label: Property[ConllRelation] = relationType is "Work_For" } object LivesInClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel, parameters) { override def label: Property[ConllRelation] = relationType is "Work_For"} - - object personClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel) { - def label: Property[ConllRawToken] = entityType is "Peop" - } - - object locationClassifier extends Learnable[ConllRawToken](entityRelationBasicDataModel) { - def label: Property[ConllRawToken] = entityType is "Loc" - } - - object worksForClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel) { - override def label: Property[ConllRelation] = relationType is "Work_For" - } - object livesInClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel) { - override def label: Property[ConllRelation] = relationType is "Live_In" - } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala index 477bad11..42f63d03 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala @@ -1,39 +1,41 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRelation, ConllRawToken } -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationClassifiers._ import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.entityRelationConstraints._ +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationClassifiers._ object entityRelationConstraints { - object orgConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, orgClassifier) { - def subjectTo = Per_Org - override val pathToHead = Some('containE2) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 - } - - object PerConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, personClassifier) { - - def subjectTo = Per_Org - // override val pathToHead = Some(entityRelationBasicDataModel.RelationToPer) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 - } - - object LocConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, locationClassifier) { - - def subjectTo = Per_Org - override val pathToHead = Some('containE2) - //TODO add test unit for this filter - // override def filter(t: ConllRawToken,h:ConllRelation): Boolean = t.wordId==h.wordId2 + val Per_Org = ConstrainedClassifier.constraintOf[ConllRelation] { + x: ConllRelation => + { + (((WorkForClassifier on x) isTrue) ==> + (((OrgClassifier on x.e2) isTrue) &&& + ((PersonClassifier on x.e1) isTrue))) &&& ( + ((LivesInClassifier on x) isTrue) ==> ( + ((PersonClassifier on x.e1) isTrue) + &&& ((LocationClassifier on x.e2) isTrue) + ) + ) &&& ((WorkForClassifier on x isTrue) ==> (LivesInClassifier on x isNotTrue)) &&& ((LivesInClassifier on x isTrue) ==> (WorkForClassifier on x isNotTrue)) + } } - object P_O_relationClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](entityRelationBasicDataModel, worksForClassifier) { - def subjectTo = Per_Org + val LiveInConstrint = ConstrainedClassifier.constraintOf[ConllRelation] { + x: ConllRelation => + { + ((LivesInClassifier on x) isTrue) ==> ( + ((PersonClassifier on x.e1) isTrue) + &&& ((LocationClassifier on x.e2) isTrue) + ) + } } - object LiveIn_P_O_relationClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](entityRelationBasicDataModel, livesInClassifier) { - def subjectTo = Per_Org + val PersonWorkFor = ConstrainedClassifier.constraintOf[ConllRelation] { + x: ConllRelation => + { + ((WorkForClassifier on x) isTrue) ==> + ((PersonClassifier on x.e1) isTrue) + } } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index c66cdc16..210a5264 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -26,6 +26,7 @@ object RunnerPL { model.lm=lexm model.lm.setAllowNewFeatures(true) para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature + para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) From 3add3855eb4bbc8ba0236a58dbadd5d2233b1842 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 3 Dec 2015 13:40:29 -0600 Subject: [PATCH 016/118] working ER given the feature errors --- .gitignore | 1 + .../cogcomp/saul/classifier/Learnable.scala | 2 +- .../entityRelationConstraintClassifiers.scala | 40 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala diff --git a/.gitignore b/.gitignore index b4afb327..b574a3a7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/config .DS_Store /data .idea diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala index 635cf04d..e965d00a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala @@ -38,7 +38,7 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: // TODO: do caching instead of deleting caching when finished develop // TODO: define default paramters - val modelDir = "models" + val modelDir = "models/" IOUtils.mkdir(modelDir) IOUtils.rm(modelDir + getClassNameForClassifier + ".lc") IOUtils.rm(modelDir + getClassNameForClassifier + ".lex") diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala new file mode 100644 index 00000000..30e643cb --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala @@ -0,0 +1,40 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel + +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRelation, ConllRawToken} +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationConstraints._ +import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ +/** + * Created by Parisa on 12/3/15. + */ +object entityRelationConstraintClassifiers { + object OrgConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, OrgClassifier) { + def subjectTo = Per_Org + override val pathToHead = Some('containE2) + override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 + } + + object PerConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, PersonClassifier) { + + def subjectTo = Per_Org + // override val pathToHead = Some(entityRelationBasicDataModel.RelationToPer) + override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 + } + + object LocConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, LocationClassifier) { + + def subjectTo = Per_Org + override val pathToHead = Some('containE2) + //TODO add test unit for this filter + // override def filter(t: ConllRawToken,h:ConllRelation): Boolean = t.wordId==h.wordId2 + } + + object P_O_relationClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](entityRelationBasicDataModel, WorkForClassifier) { + def subjectTo = Per_Org + } + + object LiveIn_P_O_relationClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](entityRelationBasicDataModel, LivesInClassifier) { + def subjectTo = Per_Org + } +} From 9ba8584cb3eabc03536de32e0237ec4a043eea78 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 4 Dec 2015 09:18:59 -0600 Subject: [PATCH 017/118] some sLtemplate --- .../cogcomp/saul/classifier/JoinSLtrain.scala | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala new file mode 100644 index 00000000..6644c507 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala @@ -0,0 +1,48 @@ +package edu.illinois.cs.cogcomp.saul.classifier + +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} +import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory + +import scala.reflect.ClassTag + +/** + * Created by Parisa on 12/3/15. + */ +object JoinSLtrain { + def apply[HEAD <: AnyRef]( + dm: DataModel, + cls: List[ConstrainedClassifier[_, HEAD]] + )( + implicit + headTag: ClassTag[HEAD] + ) = { + + trainSSVM[HEAD](dm, cls) + } + + def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]]): Unit = { + + val model = new SLModel +// val sp = ERIOManager.readXY(cr,0,10) +// model.infSolver = new iERjavaInferencePL + val para = new SLParameters + para.C_FOR_STRUCTURE = 1 + para.CHECK_INFERENCE_OPT = false + +// model.config = new util.HashMap(); + model.para = para +// model.featureGenerator = new ERFeatureGenerator(lexm) +// model.lm=lexm + model.lm.setAllowNewFeatures(true) + para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature + para.loadConfigFile("./config/DCD.config") + val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); + +// println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) + println("num?:"+model.lm.getNumOfFeature) + +// model.wv = learner.train(sp) +// model.saveModel(modelname); + } +} From f9513704975b0edca814f46872f17a57a8733c33 Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 7 Dec 2015 10:24:42 -0600 Subject: [PATCH 018/118] SL_Instances --- .../cogcomp/saul/classifier/JoinSLtrain.scala | 66 +++++++++++++++++++ .../cogcomp/saul/classifier/JointTrain.scala | 2 +- .../saul/classifier/SL_IOManager.scala | 16 +++++ .../saul/classifier/Saul_SL_Instance.java | 31 +++++++++ 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala index 6644c507..10ea92a0 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala @@ -1,5 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier +import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory @@ -24,6 +25,9 @@ object JoinSLtrain { def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]]): Unit = { val model = new SLModel + val allHeads = dm.getNodeWithType[HEAD].getTrainingInstances + val sp= SL_IOManager.makeSLProblem(dm,cls) + // val sp = ERIOManager.readXY(cr,0,10) // model.infSolver = new iERjavaInferencePL val para = new SLParameters @@ -44,5 +48,67 @@ object JoinSLtrain { // model.wv = learner.train(sp) // model.saveModel(modelname); + + + + + allHeads foreach { + h => + { + cls.foreach { + case c: ConstrainedClassifier[_, HEAD] => { + + type C = c.LEFT + + + val typedC = c.asInstanceOf[ConstrainedClassifier[_, HEAD]] + + val oracle = typedC.onClassifier.getLabeler + + typedC.getCandidates(h) foreach { + x => + { + + def trainOnce() = { + + val result = typedC.classifier.discreteValue(x) + val trueLabel = oracle.discreteValue(x) + + if (result.equals("true") && trueLabel.equals("false")) { + val a = typedC.onClassifier.getExampleArray(x) + val a0 = a(0).asInstanceOf[Array[Int]] + val a1 = a(1).asInstanceOf[Array[Double]] + + typedC.onClassifier.asInstanceOf[LinearThresholdUnit].promote(a0, a1, 0.1) + } else { + + if (result.equals("false") && trueLabel.equals("true")) { + val a = typedC.onClassifier.getExampleArray(x) + val a0 = a(0).asInstanceOf[Array[Int]] + val a1 = a(1).asInstanceOf[Array[Double]] + typedC.onClassifier.asInstanceOf[LinearThresholdUnit].demote(a0, a1, 0.1) + } else { + } + } + + } + + trainOnce() + } + } + } + } + } + } + train(dm, cls, it - 1) + + + + + + + + + } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrain.scala index f67afc3c..6dba2ab5 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrain.scala @@ -78,7 +78,7 @@ object JointTrain { cls.foreach { case c: ConstrainedClassifier[_, HEAD] => { - type C = c.LEFT + //type C = c.LEFT // println("-=-=-=-=-") // println(c.tType) // println(c.headType) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala new file mode 100644 index 00000000..e894fe55 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala @@ -0,0 +1,16 @@ +package edu.illinois.cs.cogcomp.saul.classifier + +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.sl.core.SLProblem +/** + * Created by Parisa on 12/4/15. + */ +object SL_IOManager { + def makeSLProblem [HEAD<: AnyRef](dm : DataModel, list: List[ConstrainedClassifier[_, HEAD]]): SLProblem ={ + var sp : SLProblem = new SLProblem() + val allHeads= dm.getNodeWithType[HEAD].getAllInstances + allHeads.foreach( x => new Saul_SL_Instance(list.asInstanceOf,x)) + // val input: Saul_SL_Instance = new Saul_SL_Instance(list,) + sp + } +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java new file mode 100644 index 00000000..3bb04bca --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java @@ -0,0 +1,31 @@ +package edu.illinois.cs.cogcomp.saul.classifier; + +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; +import edu.illinois.cs.cogcomp.sl.core.IInstance; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Parisa on 12/4/15. + */ +public class Saul_SL_Instance implements IInstance { + + + public Saul_SL_Instance(ArrayList> l, T x ){ + { + for (ConstrainedClassifier c : l) + { + Classifier oracle = c.onClassifier().getLabeler(); + ArrayList cands= (ArrayList) c.getCandidates(x); + for (T ci: cands){ + c.classifier().discreteValue(ci) ; //prediction result + oracle.discreteValue(ci) ; // true lable + c.onClassifier().getExampleArray(ci) ; // return a Feature values and indexs +// val a0 = a(0).asInstanceOf[Array[Int]] +// val a1 = a(1).asInstanceOf[Array[Double]] + } + } + + } + } +} From 43437906782dc862cd69d7b76970f4412f9ea191 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 10:54:26 -0600 Subject: [PATCH 019/118] SL-IOmanager for Saul --- .../saul/classifier/SL_IOManager.scala | 16 ++++++++------ .../saul/classifier/Saul_SL_Instance.java | 16 +++++++++----- .../classifier/Saul_SL_Label_Structure.java | 22 +++++++++++++++++++ 3 files changed, 41 insertions(+), 13 deletions(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Label_Structure.java diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala index e894fe55..02ffd7d2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala @@ -6,11 +6,13 @@ import edu.illinois.cs.cogcomp.sl.core.SLProblem * Created by Parisa on 12/4/15. */ object SL_IOManager { - def makeSLProblem [HEAD<: AnyRef](dm : DataModel, list: List[ConstrainedClassifier[_, HEAD]]): SLProblem ={ - var sp : SLProblem = new SLProblem() - val allHeads= dm.getNodeWithType[HEAD].getAllInstances - allHeads.foreach( x => new Saul_SL_Instance(list.asInstanceOf,x)) - // val input: Saul_SL_Instance = new Saul_SL_Instance(list,) - sp - } + def makeSLProblem [HEAD<: AnyRef](dm : DataModel, list: List[ConstrainedClassifier[_, HEAD]]): SLProblem ={ + var sp : SLProblem = new SLProblem() + val allHeads= dm.getNodeWithType[HEAD].getAllInstances + allHeads.foreach( x => { val ins= new Saul_SL_Instance(list.asInstanceOf, x) + val outs= new Saul_SL_Label_Structure(list.asInstanceOf, x) + sp.addExample(ins,outs) + }) + sp + } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java index 3bb04bca..44074285 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java @@ -2,25 +2,29 @@ import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; import edu.illinois.cs.cogcomp.sl.core.IInstance; +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; + import java.util.ArrayList; import java.util.List; /** * Created by Parisa on 12/4/15. */ -public class Saul_SL_Instance implements IInstance { - +public class Saul_SL_Instance<_> implements IInstance { - public Saul_SL_Instance(ArrayList> l, T x ){ + List inputFeatures; + public Saul_SL_Instance(ArrayList> l, _ x ){ { for (ConstrainedClassifier c : l) { Classifier oracle = c.onClassifier().getLabeler(); - ArrayList cands= (ArrayList) c.getCandidates(x); - for (T ci: cands){ + ArrayList<_> cands= (ArrayList<_>) c.getCandidates(x); + for (_ ci: cands){ c.classifier().discreteValue(ci) ; //prediction result oracle.discreteValue(ci) ; // true lable - c.onClassifier().getExampleArray(ci) ; // return a Feature values and indexs + ; // return a Feature values and indexs + inputFeatures.add(c.onClassifier().getExampleArray(ci)); + // val a0 = a(0).asInstanceOf[Array[Int]] // val a1 = a(1).asInstanceOf[Array[Double]] } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Label_Structure.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Label_Structure.java new file mode 100644 index 00000000..cc856228 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Label_Structure.java @@ -0,0 +1,22 @@ +package edu.illinois.cs.cogcomp.saul.classifier; + +import edu.illinois.cs.cogcomp.sl.core.IStructure; +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Parisa on 12/8/15. + */ +public class Saul_SL_Label_Structure <_> implements IStructure { + + ArrayList labels; + + public Saul_SL_Label_Structure(ArrayList> l, _ x ){ + + for (ConstrainedClassifier c : l){ + labels.add(c.onClassifier().discreteValue(x)); + } + } +} From 146ed3ef596ecd61bae3a313b987b586581e5029 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 12:02:04 -0600 Subject: [PATCH 020/118] a template for inference and loss to be debugged. --- .../cogcomp/saul/classifier/JoinSLtrain.scala | 2 - .../saul/classifier/Saul_SL_Inference.scala | 42 +++++++++++++++++++ .../saul/classifier/Saul_SL_Instance.java | 10 +++-- 3 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala index 10ea92a0..41eee328 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala @@ -27,8 +27,6 @@ object JoinSLtrain { val model = new SLModel val allHeads = dm.getNodeWithType[HEAD].getTrainingInstances val sp= SL_IOManager.makeSLProblem(dm,cls) - -// val sp = ERIOManager.readXY(cr,0,10) // model.infSolver = new iERjavaInferencePL val para = new SLParameters para.C_FOR_STRUCTURE = 1 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala new file mode 100644 index 00000000..4262c062 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala @@ -0,0 +1,42 @@ +package edu.illinois.cs.cogcomp.saul.classifier + +import edu.illinois.cs.cogcomp.sl.core.{IStructure, IInstance, AbstractInferenceSolver} +import edu.illinois.cs.cogcomp.sl.util.WeightVector + +/** + * Created by Parisa on 12/8/15. + */ +class Saul_SL_Inference extends AbstractInferenceSolver{ + + override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { + val myIns=ins.asInstanceOf[Saul_SL_Instance] + var myStruct: Saul_SL_Label_Structure = ??? + for (i <- 0 until myIns.factorClassifiers.size() ){ + + myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) + } + myStruct + } + + override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { + var l: Float = 0 + val myGold = gold.asInstanceOf[Saul_SL_Label_Structure] + val myPred = pred.asInstanceOf[Saul_SL_Label_Structure] + for (i <- 0 until myGold.labels.size()){ + l = l + myGold.labels.get(i).equals(myPred.labels.get(i)).asInstanceOf[Float] + } + l + } + + override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { + + val myIns=ins.asInstanceOf[Saul_SL_Instance] + var myStruct: Saul_SL_Label_Structure = ??? + for (i <- 0 until myIns.factorClassifiers.size() ){ + + myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) + } + myStruct + } + +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java index 44074285..454e4b59 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java @@ -2,7 +2,6 @@ import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; import java.util.ArrayList; import java.util.List; @@ -13,6 +12,8 @@ public class Saul_SL_Instance<_> implements IInstance { List inputFeatures; + List factorClassifiers; + public Saul_SL_Instance(ArrayList> l, _ x ){ { for (ConstrainedClassifier c : l) @@ -24,7 +25,10 @@ public Saul_SL_Instance(ArrayList> l, _ x ){ oracle.discreteValue(ci) ; // true lable ; // return a Feature values and indexs inputFeatures.add(c.onClassifier().getExampleArray(ci)); - + factorClassifiers.add(c); + } + ; + // val a0 = a(0).asInstanceOf[Array[Int]] // val a1 = a(1).asInstanceOf[Array[Double]] } @@ -32,4 +36,4 @@ public Saul_SL_Instance(ArrayList> l, _ x ){ } } -} + From b3fac2cb9d61ec628c75db5773c46991724846e0 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 12:03:03 -0600 Subject: [PATCH 021/118] a template for inference and loss to be debugged. --- .../cogcomp/saul/classifier/JoinSLtrain.scala | 93 ++++++------ .../saul/classifier/SL_IOManager.scala | 18 +-- .../saul/classifier/Saul_SL_Inference.scala | 33 +++-- .../cs/cogcomp/saul/datamodel/edge/Link.scala | 12 +- .../entityRelationBasicDataModel.scala | 28 ++-- .../entityRelationClassifiers.scala | 3 +- .../entityRelationConstraintClassifiers.scala | 7 +- .../entityRelationConstraints.scala | 36 ++--- .../SL_SVM/iJLIS/Runner.scala | 57 ++++---- .../SL_SVM/iJLIS/iERinference.scala | 135 +++++++++--------- .../SL_SVM/iJLIS2/ERIOManager.scala | 38 ++--- .../SL_SVM/iJLIS2/Labels.scala | 53 ++++--- .../SL_SVM/iJLIS2/RunnerPL.scala | 108 +++++++------- .../datamodel/GraphQueriesTest.scala | 6 +- 14 files changed, 301 insertions(+), 326 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala index 41eee328..0da97ae7 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala @@ -2,22 +2,21 @@ package edu.illinois.cs.cogcomp.saul.classifier import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} +import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import scala.reflect.ClassTag -/** - * Created by Parisa on 12/3/15. - */ +/** Created by Parisa on 12/3/15. + */ object JoinSLtrain { def apply[HEAD <: AnyRef]( - dm: DataModel, - cls: List[ConstrainedClassifier[_, HEAD]] - )( - implicit - headTag: ClassTag[HEAD] - ) = { + dm: DataModel, + cls: List[ConstrainedClassifier[_, HEAD]] + )( + implicit + headTag: ClassTag[HEAD] + ) = { trainSSVM[HEAD](dm, cls) } @@ -26,87 +25,75 @@ object JoinSLtrain { val model = new SLModel val allHeads = dm.getNodeWithType[HEAD].getTrainingInstances - val sp= SL_IOManager.makeSLProblem(dm,cls) -// model.infSolver = new iERjavaInferencePL + val sp = SL_IOManager.makeSLProblem(dm, cls) + // model.infSolver = new iERjavaInferencePL val para = new SLParameters para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false -// model.config = new util.HashMap(); + // model.config = new util.HashMap(); model.para = para -// model.featureGenerator = new ERFeatureGenerator(lexm) -// model.lm=lexm + // model.featureGenerator = new ERFeatureGenerator(lexm) + // model.lm=lexm model.lm.setAllowNewFeatures(true) - para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature + para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); -// println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) - println("num?:"+model.lm.getNumOfFeature) + // println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) + println("num?:" + model.lm.getNumOfFeature) -// model.wv = learner.train(sp) -// model.saveModel(modelname); + // model.wv = learner.train(sp) + // model.saveModel(modelname); - - - - allHeads foreach { - h => + allHeads foreach { + h => { cls.foreach { case c: ConstrainedClassifier[_, HEAD] => { type C = c.LEFT - val typedC = c.asInstanceOf[ConstrainedClassifier[_, HEAD]] val oracle = typedC.onClassifier.getLabeler typedC.getCandidates(h) foreach { x => - { - - def trainOnce() = { + { - val result = typedC.classifier.discreteValue(x) - val trueLabel = oracle.discreteValue(x) + def trainOnce() = { - if (result.equals("true") && trueLabel.equals("false")) { - val a = typedC.onClassifier.getExampleArray(x) - val a0 = a(0).asInstanceOf[Array[Int]] - val a1 = a(1).asInstanceOf[Array[Double]] + val result = typedC.classifier.discreteValue(x) + val trueLabel = oracle.discreteValue(x) - typedC.onClassifier.asInstanceOf[LinearThresholdUnit].promote(a0, a1, 0.1) - } else { - - if (result.equals("false") && trueLabel.equals("true")) { + if (result.equals("true") && trueLabel.equals("false")) { val a = typedC.onClassifier.getExampleArray(x) val a0 = a(0).asInstanceOf[Array[Int]] val a1 = a(1).asInstanceOf[Array[Double]] - typedC.onClassifier.asInstanceOf[LinearThresholdUnit].demote(a0, a1, 0.1) + + typedC.onClassifier.asInstanceOf[LinearThresholdUnit].promote(a0, a1, 0.1) + } else { + + if (result.equals("false") && trueLabel.equals("true")) { + val a = typedC.onClassifier.getExampleArray(x) + val a0 = a(0).asInstanceOf[Array[Int]] + val a1 = a(1).asInstanceOf[Array[Double]] + typedC.onClassifier.asInstanceOf[LinearThresholdUnit].demote(a0, a1, 0.1) } else { + } } - } - } + } - trainOnce() + trainOnce() } } } } } - } - train(dm, cls, it - 1) - - - - - - - - + } + train(dm, cls, it - 1) } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala index 02ffd7d2..60356947 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala @@ -2,16 +2,16 @@ package edu.illinois.cs.cogcomp.saul.classifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.SLProblem -/** - * Created by Parisa on 12/4/15. - */ +/** Created by Parisa on 12/4/15. + */ object SL_IOManager { - def makeSLProblem [HEAD<: AnyRef](dm : DataModel, list: List[ConstrainedClassifier[_, HEAD]]): SLProblem ={ - var sp : SLProblem = new SLProblem() - val allHeads= dm.getNodeWithType[HEAD].getAllInstances - allHeads.foreach( x => { val ins= new Saul_SL_Instance(list.asInstanceOf, x) - val outs= new Saul_SL_Label_Structure(list.asInstanceOf, x) - sp.addExample(ins,outs) + def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]]): SLProblem = { + var sp: SLProblem = new SLProblem() + val allHeads = dm.getNodeWithType[HEAD].getAllInstances + allHeads.foreach(x => { + val ins = new Saul_SL_Instance(list.asInstanceOf, x) + val outs = new Saul_SL_Label_Structure(list.asInstanceOf, x) + sp.addExample(ins, outs) }) sp } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala index 4262c062..a256890d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala @@ -1,42 +1,41 @@ package edu.illinois.cs.cogcomp.saul.classifier -import edu.illinois.cs.cogcomp.sl.core.{IStructure, IInstance, AbstractInferenceSolver} +import edu.illinois.cs.cogcomp.sl.core.{ IStructure, IInstance, AbstractInferenceSolver } import edu.illinois.cs.cogcomp.sl.util.WeightVector -/** - * Created by Parisa on 12/8/15. - */ -class Saul_SL_Inference extends AbstractInferenceSolver{ +/** Created by Parisa on 12/8/15. + */ +class Saul_SL_Inference extends AbstractInferenceSolver { override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { - val myIns=ins.asInstanceOf[Saul_SL_Instance] + val myIns = ins.asInstanceOf[Saul_SL_Instance] var myStruct: Saul_SL_Label_Structure = ??? - for (i <- 0 until myIns.factorClassifiers.size() ){ + for (i <- 0 until myIns.factorClassifiers.size()) { - myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) + myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) } - myStruct + myStruct } override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { var l: Float = 0 val myGold = gold.asInstanceOf[Saul_SL_Label_Structure] val myPred = pred.asInstanceOf[Saul_SL_Label_Structure] - for (i <- 0 until myGold.labels.size()){ - l = l + myGold.labels.get(i).equals(myPred.labels.get(i)).asInstanceOf[Float] + for (i <- 0 until myGold.labels.size()) { + l = l + myGold.labels.get(i).equals(myPred.labels.get(i)).asInstanceOf[Float] } l } override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { - val myIns=ins.asInstanceOf[Saul_SL_Instance] - var myStruct: Saul_SL_Label_Structure = ??? - for (i <- 0 until myIns.factorClassifiers.size() ){ + val myIns = ins.asInstanceOf[Saul_SL_Instance] + var myStruct: Saul_SL_Label_Structure = ??? + for (i <- 0 until myIns.factorClassifiers.size()) { - myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) - } - myStruct + myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) + } + myStruct } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala index 4628b95b..553325b7 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala @@ -92,8 +92,8 @@ trait Edge[T <: AnyRef, U <: AnyRef] { } case class AsymmetricEdge[T <: AnyRef, U <: AnyRef](val forward: Link[T, U], val backward: Link[U, T], - ms: Seq[(T, U) => Boolean] = Seq.empty[(T, U) => Boolean]) - extends Edge[T,U] { + ms: Seq[(T, U) => Boolean] = Seq.empty[(T, U) => Boolean]) + extends Edge[T, U] { val matchers = { val m = ArrayBuffer.empty[(T, U) => Boolean] m ++= ms @@ -103,9 +103,11 @@ case class AsymmetricEdge[T <: AnyRef, U <: AnyRef](val forward: Link[T, U], val override def unary_- : Edge[U, T] = AsymmetricEdge(backward, forward, matchers.map(f => (u: U, t: T) => f(t, u))) } -case class SymmetricEdge[T <: AnyRef](link: Link[T, T], - ms: Seq[(T, T) => Boolean] = Seq.empty[(T, T) => Boolean]) - extends Edge[T,T] { +case class SymmetricEdge[T <: AnyRef]( + link: Link[T, T], + ms: Seq[(T, T) => Boolean] = Seq.empty[(T, T) => Boolean] +) + extends Edge[T, T] { def forward = link def backward = link val matchers = { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala index 2b797860..77894031 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationBasicDataModel.scala @@ -70,20 +70,20 @@ object entityRelationBasicDataModel extends DataModel { } } -// val relPos = property[ConllRelation]("reltokenSurface") { -// rela: ConllRelation => -// val e1 = rela.e1 -// val e2 = rela.e2 -// -// this.getNodeWithType[ConllRawToken].getWithWindow(e1, -2, 2, _.sentId).zipWithIndex.map { -// case (Some(t), idx) => s"left-$idx-pos-${t.POS} " -// case (None, idx) => s"left-$idx-pos-EMPTY " -// } ++ -// this.getNodeWithType[ConllRawToken].getWithWindow(e2, -2, 2, _.sentId).zipWithIndex.map { -// case (Some(t), idx) => s"right-$idx-pos-${t.POS} " -// case (None, idx) => s"right-$idx-pos-EMPTY} " -// } -// } + // val relPos = property[ConllRelation]("reltokenSurface") { + // rela: ConllRelation => + // val e1 = rela.e1 + // val e2 = rela.e2 + // + // this.getNodeWithType[ConllRawToken].getWithWindow(e1, -2, 2, _.sentId).zipWithIndex.map { + // case (Some(t), idx) => s"left-$idx-pos-${t.POS} " + // case (None, idx) => s"left-$idx-pos-EMPTY " + // } ++ + // this.getNodeWithType[ConllRawToken].getWithWindow(e2, -2, 2, _.sentId).zipWithIndex.map { + // case (Some(t), idx) => s"right-$idx-pos-${t.POS} " + // case (None, idx) => s"right-$idx-pos-EMPTY} " + // } + // } /** Labeler Properties */ val entityType = property[ConllRawToken]("entityType") { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala index 2da1b082..7970fec1 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationClassifiers.scala @@ -29,6 +29,7 @@ object entityRelationClassifiers { override def label: Property[ConllRelation] = relationType is "Work_For" } object LivesInClassifier extends Learnable[ConllRelation](entityRelationBasicDataModel, parameters) { - override def label: Property[ConllRelation] = relationType is "Work_For"} + override def label: Property[ConllRelation] = relationType is "Work_For" + } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala index 30e643cb..e4a45915 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala @@ -1,13 +1,12 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRelation, ConllRawToken} +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRelation, ConllRawToken } import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationConstraints._ import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ -/** - * Created by Parisa on 12/3/15. - */ +/** Created by Parisa on 12/3/15. + */ object entityRelationConstraintClassifiers { object OrgConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, OrgClassifier) { def subjectTo = Per_Org diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala index 42f63d03..eb151e55 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraints.scala @@ -9,33 +9,33 @@ object entityRelationConstraints { val Per_Org = ConstrainedClassifier.constraintOf[ConllRelation] { x: ConllRelation => - { - (((WorkForClassifier on x) isTrue) ==> - (((OrgClassifier on x.e2) isTrue) &&& - ((PersonClassifier on x.e1) isTrue))) &&& ( - ((LivesInClassifier on x) isTrue) ==> ( - ((PersonClassifier on x.e1) isTrue) - &&& ((LocationClassifier on x.e2) isTrue) - ) - ) &&& ((WorkForClassifier on x isTrue) ==> (LivesInClassifier on x isNotTrue)) &&& ((LivesInClassifier on x isTrue) ==> (WorkForClassifier on x isNotTrue)) - } + { + (((WorkForClassifier on x) isTrue) ==> + (((OrgClassifier on x.e2) isTrue) &&& + ((PersonClassifier on x.e1) isTrue))) &&& ( + ((LivesInClassifier on x) isTrue) ==> ( + ((PersonClassifier on x.e1) isTrue) + &&& ((LocationClassifier on x.e2) isTrue) + ) + ) &&& ((WorkForClassifier on x isTrue) ==> (LivesInClassifier on x isNotTrue)) &&& ((LivesInClassifier on x isTrue) ==> (WorkForClassifier on x isNotTrue)) + } } val LiveInConstrint = ConstrainedClassifier.constraintOf[ConllRelation] { x: ConllRelation => - { - ((LivesInClassifier on x) isTrue) ==> ( - ((PersonClassifier on x.e1) isTrue) + { + ((LivesInClassifier on x) isTrue) ==> ( + ((PersonClassifier on x.e1) isTrue) &&& ((LocationClassifier on x.e2) isTrue) ) - } + } } val PersonWorkFor = ConstrainedClassifier.constraintOf[ConllRelation] { x: ConllRelation => - { - ((WorkForClassifier on x) isTrue) ==> - ((PersonClassifier on x.e1) isTrue) - } + { + ((WorkForClassifier on x) isTrue) ==> + ((PersonClassifier on x.e1) isTrue) + } } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala index 52387e84..e267687c 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala @@ -1,37 +1,37 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS import java.util -import java.util.{ArrayList, List} +import java.util.{ ArrayList, List } import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory -import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} +import edu.illinois.cs.cogcomp.sl.util.{ Lexiconer, WeightVector } object Runner { var lexm: Lexiconer = new Lexiconer() - def readXY(cr:Conll04_ReaderNew, outlist: => List[IStructure], sclist: => List[IInstance], l:Int,u:Int){ + def readXY(cr: Conll04_ReaderNew, outlist: => List[IStructure], sclist: => List[IInstance], l: Int, u: Int) { var i: Int = l - while (i < u){//cr.instances.size){ - val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) + while (i < u) { //cr.instances.size){ + val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) sclist.add(newqi) - val a: Nodevalues=new Nodevalues() - a.a=(cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) + val a: Nodevalues = new Nodevalues() + a.a = (cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) val cs: ERiStructure = new ERiStructure(newqi, a.a) outlist.add(cs) - i=i+1 + i = i + 1 } } def trainSSVM(modelname: String): Unit = { - var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp","Pair") - var sclist: List[IInstance]= new ArrayList[IInstance]//=readX(cr) - var outlist: List[IStructure] = new ArrayList[IStructure]//readY(cr) - readXY(cr,outlist,sclist,1,100) + var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") + var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) + var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) + readXY(cr, outlist, sclist, 1, 100) - cr=null + cr = null lexm.setAllowNewFeatures(false) val sp: SLProblem = new SLProblem @@ -42,11 +42,11 @@ object Runner { para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false val model: SLModel = new SLModel - model.featureGenerator= new ERFeatureGenerator + model.featureGenerator = new ERFeatureGenerator model.lm = lexm model.config = new util.HashMap(); - model.para=para + model.para = para model.infSolver = new iERinference; val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); @@ -59,11 +59,11 @@ object Runner { Runner.lexm = model.lm val learned_wv: WeightVector = model.wv val inference_proc: iERinference = model.infSolver.asInstanceOf[iERinference] - var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp","Pair") - var sclist: List[IInstance]= new ArrayList[IInstance]//=readX(cr) - var outlist: List[IStructure] = new ArrayList[IStructure]//readY(cr) - readXY(cr,outlist,sclist,101,200) - cr=null + var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") + var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) + var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) + readXY(cr, outlist, sclist, 101, 200) + cr = null val sp: SLProblem = new SLProblem sp.instanceList = sclist @@ -80,28 +80,25 @@ object Runner { var i: Int = 0 while (i < sp.instanceList.size) { val gold: ERiStructure = sp.goldStructureList.get(i).asInstanceOf[ERiStructure] - val prediction:ERiStructure = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructure] + val prediction: ERiStructure = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructure] System.out.println(prediction) val pred: Boolean = prediction.nodeValues val goldval: Boolean = gold.nodeValues if (goldval == pred) { if (pred == true) { tp += 1.0 - } - else { + } else { tn += 1.0 } - } - else { - if (pred ==false) { + } else { + if (pred == false) { fp += 1.0 - } - else { + } else { fn += 1.0 } } total += 1.0 - i=i+1 + i = i + 1 } val precision: Double = tp / (tp + fp) @@ -110,7 +107,7 @@ object Runner { println("=========================") println(" P R F ") // println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")) - println(precision, recall, F1)//String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)) + println(precision, recall, F1) //String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)) println("=========================") println("Acc = " + (tp + tn) / total) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala index 31768a48..efa40558 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala @@ -1,35 +1,32 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS -import java.util.{ArrayList, List} +import java.util.{ ArrayList, List } -import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} +import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } import edu.illinois.cs.cogcomp.sl.util.WeightVector -/** - * Created by parisakordjamshidi on 20/09/14. - */ +/** Created by parisakordjamshidi on 20/09/14. + */ class iERinference extends AbstractInferenceSolver { - /** - * This is for training - */ + /** This is for training + */ - override def getLoss(iInstance: IInstance, gold: IStructure, pred: IStructure): Float ={ - val igold: ERiStructure = gold.asInstanceOf[ERiStructure]; - val ipred: ERiStructure = pred.asInstanceOf[ERiStructure]; + override def getLoss(iInstance: IInstance, gold: IStructure, pred: IStructure): Float = { + val igold: ERiStructure = gold.asInstanceOf[ERiStructure]; + val ipred: ERiStructure = pred.asInstanceOf[ERiStructure]; var loss: Float = 0 - if (ipred.nodeValues==igold.nodeValues) - loss=0 - else - loss=1 + if (ipred.nodeValues == igold.nodeValues) + loss = 0 + else + loss = 1 - loss - } + loss + } - /** - * This is for prediction. - */ + /** This is for prediction. + */ def getBestStructure(wv: WeightVector, input: IInstance): IStructure = { val qi: ERqInstance = input.asInstanceOf[ERqInstance] val options: List[ERiStructure] = getOptions(qi) @@ -37,9 +34,9 @@ class iERinference extends AbstractInferenceSolver { var score: Double = .0 var maxC: ERiStructure = null import scala.collection.JavaConversions._ - for ( c <- options) { - val a= new ERFeatureGenerator(); - val f= a.getFeatureVector(c.qi,c) + for (c <- options) { + val a = new ERFeatureGenerator(); + val f = a.getFeatureVector(c.qi, c) score = wv.dotProduct(f) if (score > max) { max = score @@ -49,60 +46,58 @@ class iERinference extends AbstractInferenceSolver { return maxC } - override def getLossAugmentedBestStructure(wv: WeightVector, input: IInstance, gold: IStructure): IStructure ={ + override def getLossAugmentedBestStructure(wv: WeightVector, input: IInstance, gold: IStructure): IStructure = { - val goldStruct: ERiStructure = gold.asInstanceOf[ERiStructure] - val qi: ERqInstance = input.asInstanceOf[ERqInstance] - val options: List[ERiStructure] = getOptions(qi) - var max: Double = Double.NegativeInfinity - var score: Double = .0 - var maxC: ERiStructure = null - var loss: Double = .0 - System.out.println - System.out.println(gold) - import scala.collection.JavaConversions._ - for (c <- options) { - val a= new ERFeatureGenerator(); - val f= a.getFeatureVector(c.qi,c) - score = wv.dotProduct(f) - loss = getLoss(null,c, goldStruct) - score += loss - System.out.println(c) - System.out.println(f) - System.out.println(score) - if (score > max) { - max = score - maxC = c - } + val goldStruct: ERiStructure = gold.asInstanceOf[ERiStructure] + val qi: ERqInstance = input.asInstanceOf[ERqInstance] + val options: List[ERiStructure] = getOptions(qi) + var max: Double = Double.NegativeInfinity + var score: Double = .0 + var maxC: ERiStructure = null + var loss: Double = .0 + System.out.println + System.out.println(gold) + import scala.collection.JavaConversions._ + for (c <- options) { + val a = new ERFeatureGenerator(); + val f = a.getFeatureVector(c.qi, c) + score = wv.dotProduct(f) + loss = getLoss(null, c, goldStruct) + score += loss + System.out.println(c) + System.out.println(f) + System.out.println(score) + if (score > max) { + max = score + maxC = c } -return maxC - // val a= new edu.illinois.cs.cogcomp.core.datastructures.Pair[IStructure, java.lang.Double](maxC.asInstanceOf[IStructure], new lang.Double(getLoss(maxC, goldStruct))) - - //return a } + return maxC + // val a= new edu.illinois.cs.cogcomp.core.datastructures.Pair[IStructure, java.lang.Double](maxC.asInstanceOf[IStructure], new lang.Double(getLoss(maxC, goldStruct))) - def getOptions(qi: ERqInstance): List[ERiStructure] = { - val options: List[ERiStructure] = new ArrayList[ERiStructure] - //for (i <- NodeLabel.values) { - // for (j <- NodeLabel.values) { - // for (k <- NodeLabel.values) { - // val labelOptions: List[Nodevalues]= new ArrayList[Nodevalues]() - // val a:Nodevalues=new Nodevalues() - // a.a=true - //labelOptions.add(a) - //a.a=false - //labelOptions.add(a) - //labelOptions.add(k) - options.add(new ERiStructure(qi, true)) - options.add(new ERiStructure(qi, false)) + //return a + } - return options - } - override def clone():iERinference ={ + def getOptions(qi: ERqInstance): List[ERiStructure] = { + val options: List[ERiStructure] = new ArrayList[ERiStructure] + //for (i <- NodeLabel.values) { + // for (j <- NodeLabel.values) { + // for (k <- NodeLabel.values) { + // val labelOptions: List[Nodevalues]= new ArrayList[Nodevalues]() + // val a:Nodevalues=new Nodevalues() + // a.a=true + //labelOptions.add(a) + //a.a=false + //labelOptions.add(a) + //labelOptions.add(k) + options.add(new ERiStructure(qi, true)) + options.add(new ERiStructure(qi, false)) + + return options + } + override def clone(): iERinference = { return new iERinference(); } - - } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala index 82a8a1a7..537744bf 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala @@ -1,24 +1,24 @@ - package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 - import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew - import edu.illinois.cs.cogcomp.sl.core.SLProblem +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew +import edu.illinois.cs.cogcomp.sl.core.SLProblem - object ERIOManager { +object ERIOManager { - def readXY(cr: Conll04_ReaderNew, l: Int, u: Int): SLProblem = { - var sp: SLProblem = new SLProblem() - var i = l - while (i < u) { - val newqi: ERqInstancePL = new ERqInstancePL(cr.relations.elementAt(i)) - var a: Labels = new Labels() - val pair = cr.relations.elementAt(i) - a.E1Label = pair.s.sentTokens.elementAt(pair.wordId1).entType.toLowerCase - a.E2Label = pair.s.sentTokens.elementAt(pair.wordId2).entType.toLowerCase - a.RelLabel = pair.relType.toLowerCase - val cs: ERiStructurePL = new ERiStructurePL( a) - i = i + 1 - sp.addExample(newqi,cs) - } - sp + def readXY(cr: Conll04_ReaderNew, l: Int, u: Int): SLProblem = { + var sp: SLProblem = new SLProblem() + var i = l + while (i < u) { + val newqi: ERqInstancePL = new ERqInstancePL(cr.relations.elementAt(i)) + var a: Labels = new Labels() + val pair = cr.relations.elementAt(i) + a.E1Label = pair.s.sentTokens.elementAt(pair.wordId1).entType.toLowerCase + a.E2Label = pair.s.sentTokens.elementAt(pair.wordId2).entType.toLowerCase + a.RelLabel = pair.relType.toLowerCase + val cs: ERiStructurePL = new ERiStructurePL(a) + i = i + 1 + sp.addExample(newqi, cs) } + sp } +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala index 5f87ef64..51a3f079 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala @@ -1,37 +1,36 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 -/** - * Created by parisakordjamshidi on 23/09/14. - */ +/** Created by parisakordjamshidi on 23/09/14. + */ class Labels { - var E1Label:String=""; - var E2Label:String=""; - var RelLabel:String=""; - // val labels: util.ArrayList[String]=new util.ArrayList[String] -def set(x:String,y:String,z:String) { - E1Label=x; - E2Label=y; - RelLabel=z; - } - def LinirizLabels():collection.mutable.MutableList[collection.mutable.MutableList[Boolean]]= - { - var a: collection.mutable.MutableList[Boolean]= scala.collection.mutable.MutableList(E1Label.toLowerCase.contains("peop")) - a+=E2Label.contains("peop") - var b: collection.mutable.MutableList[collection.mutable.MutableList[Boolean]]=collection.mutable.MutableList(a) + var E1Label: String = ""; + var E2Label: String = ""; + var RelLabel: String = ""; + // val labels: util.ArrayList[String]=new util.ArrayList[String] + def set(x: String, y: String, z: String) { + E1Label = x; + E2Label = y; + RelLabel = z; + } + def LinirizLabels(): collection.mutable.MutableList[collection.mutable.MutableList[Boolean]] = + { + var a: collection.mutable.MutableList[Boolean] = scala.collection.mutable.MutableList(E1Label.toLowerCase.contains("peop")) + a += E2Label.contains("peop") + var b: collection.mutable.MutableList[collection.mutable.MutableList[Boolean]] = collection.mutable.MutableList(a) - a=collection.mutable.MutableList(E1Label.toLowerCase.contains("org")) - a+=E2Label.toLowerCase.contains("org") + a = collection.mutable.MutableList(E1Label.toLowerCase.contains("org")) + a += E2Label.toLowerCase.contains("org") - b+=a + b += a - a=collection.mutable.MutableList(RelLabel.toLowerCase.contains("work")) - a+=E2Label.toLowerCase.contains("work") + a = collection.mutable.MutableList(RelLabel.toLowerCase.contains("work")) + a += E2Label.toLowerCase.contains("work") - b+=a + b += a - //a+=RelLabel.contains("work_for") - //E1Label="e" -b - } + //a+=RelLabel.contains("work_for") + //E1Label="e" + b + } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index 210a5264..32bba5f9 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -5,16 +5,15 @@ import java.util import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory -import edu.illinois.cs.cogcomp.sl.util.{Lexiconer, WeightVector} - +import edu.illinois.cs.cogcomp.sl.util.{ Lexiconer, WeightVector } object RunnerPL { - var lexm=new Lexiconer() - def trainSSVM(modelname: String, cr:Conll04_ReaderNew): Unit = { + var lexm = new Lexiconer() + def trainSSVM(modelname: String, cr: Conll04_ReaderNew): Unit = { val model = new SLModel - val sp = ERIOManager.readXY(cr,0,10) + val sp = ERIOManager.readXY(cr, 0, 10) model.infSolver = new iERjavaInferencePL val para = new SLParameters para.C_FOR_STRUCTURE = 1 @@ -23,26 +22,26 @@ object RunnerPL { model.config = new util.HashMap(); model.para = para model.featureGenerator = new ERFeatureGenerator(lexm) - model.lm=lexm + model.lm = lexm model.lm.setAllowNewFeatures(true) - para.TOTAL_NUMBER_FEATURE = 3*model.lm.getNumOfFeature + para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) - println("num?:"+model.lm.getNumOfFeature) + println("num?:" + (model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) + println("num?:" + model.lm.getNumOfFeature) model.wv = learner.train(sp) model.saveModel(modelname); - } + } - def testSequenceSSVM(model_name: String,cr:Conll04_ReaderNew) { + def testSequenceSSVM(model_name: String, cr: Conll04_ReaderNew) { val model: SLModel = SLModel.loadModel(model_name) val learned_wv: WeightVector = model.wv val inference_proc: iERjavaInferencePL = model.infSolver.asInstanceOf[iERjavaInferencePL] - // cr=null + // cr=null - val sp = ERIOManager.readXY(cr,11,20) + val sp = ERIOManager.readXY(cr, 11, 20) printTestACC(sp, inference_proc, learned_wv) } private def printTestACC(sp: SLProblem, s_finder: AbstractInferenceSolver, ssvm_wv: WeightVector) { @@ -52,45 +51,42 @@ object RunnerPL { var fn: Double = 0 var total: Double = 0.0 - var i: Int = 0 - while (i < sp.instanceList.size) { - val gold: ERiStructurePL = sp.goldStructureList.get(i).asInstanceOf[ERiStructurePL] - val prediction:ERiStructurePL = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructurePL] - System.out.println(prediction) - //{ - var j: Int = 0 - - // while (j < gold.nodeValues.size) { - // { - val tempGold= gold.Rlables.LinirizLabels() - val tempPred=prediction.Rlables.LinirizLabels() - while (j Date: Tue, 8 Dec 2015 12:10:59 -0600 Subject: [PATCH 022/118] a template for inference and loss to be debugged. --- .../cogcomp/saul/classifier/{ => SL_model}/JoinSLtrain.scala | 5 +++-- .../saul/classifier/{ => SL_model}/SL_IOManager.scala | 4 +++- .../saul/classifier/{ => SL_model}/Saul_SL_Inference.scala | 5 +++-- .../saul/classifier/{ => SL_model}/Saul_SL_Instance.java | 3 ++- .../classifier/{ => SL_model}/Saul_SL_Label_Structure.java | 3 ++- 5 files changed, 13 insertions(+), 7 deletions(-) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/{ => SL_model}/JoinSLtrain.scala (94%) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/{ => SL_model}/SL_IOManager.scala (82%) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/{ => SL_model}/Saul_SL_Inference.scala (90%) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/{ => SL_model}/Saul_SL_Instance.java (90%) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/{ => SL_model}/Saul_SL_Label_Structure.java (79%) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala similarity index 94% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 0da97ae7..2a04a896 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -1,8 +1,9 @@ -package edu.illinois.cs.cogcomp.saul.classifier +package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } +import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import scala.reflect.ClassTag diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala similarity index 82% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index 60356947..8a4bb097 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -1,7 +1,9 @@ -package edu.illinois.cs.cogcomp.saul.classifier +package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.SLProblem + /** Created by Parisa on 12/4/15. */ object SL_IOManager { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala similarity index 90% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index a256890d..291716ee 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,6 +1,6 @@ -package edu.illinois.cs.cogcomp.saul.classifier +package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.sl.core.{ IStructure, IInstance, AbstractInferenceSolver } +import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector /** Created by Parisa on 12/8/15. @@ -34,6 +34,7 @@ class Saul_SL_Inference extends AbstractInferenceSolver { for (i <- 0 until myIns.factorClassifiers.size()) { myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) + } myStruct } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java similarity index 90% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java index 454e4b59..87b4995c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java @@ -1,6 +1,7 @@ -package edu.illinois.cs.cogcomp.saul.classifier; +package edu.illinois.cs.cogcomp.saul.classifier.SL_model; import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier; import edu.illinois.cs.cogcomp.sl.core.IInstance; import java.util.ArrayList; diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Label_Structure.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java similarity index 79% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Label_Structure.java rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java index cc856228..6e8935f7 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Saul_SL_Label_Structure.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java @@ -1,5 +1,6 @@ -package edu.illinois.cs.cogcomp.saul.classifier; +package edu.illinois.cs.cogcomp.saul.classifier.SL_model; +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier; import edu.illinois.cs.cogcomp.sl.core.IStructure; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; From 6eb8281f8de75037d3f6d296c31ba79a6d8d41b4 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 13:36:24 -0600 Subject: [PATCH 023/118] a template for feture generator to be debugged. --- .../SL_model/SL_FeatureGenerator.scala | 29 +++++++++++++++++++ .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala new file mode 100644 index 00000000..205e8423 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -0,0 +1,29 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model + +import edu.illinois.cs.cogcomp.sl.core.{IStructure, IInstance, AbstractFeatureGenerator} +import edu.illinois.cs.cogcomp.sl.util.{FeatureVectorBuffer, IFeatureVector} + +/** + * Created by Parisa on 12/8/15. + */ +class SL_FeatureGenerator extends AbstractFeatureGenerator{ + override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { + val myX = x.asInstanceOf[Saul_SL_Instance] + val myY = x.asInstanceOf[Saul_SL_Label_Structure] + var fv = new FeatureVectorBuffer() + + for (i <- 0 until myX.factorClassifiers.size()){ + val a= myX.factorClassifiers.get(i).onClassifier.getExampleArray() + val a0 = a(0).asInstanceOf[Array[Int]] + var a1 = a(1).asInstanceOf[Array[Double]] + val lab = myY.labels.get(i) + if (!lab.equals("true")) + { + a1= Array.fill[Double](a1.length)(0) + } + val fv= new FeatureVectorBuffer(a0,a1) + fv.addFeature(a0,a1) + } + fv.toFeatureVector() + } +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index 85910f9c..0f288071 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -42,7 +42,7 @@ public IFeatureVector getFeatureVector (IInstance x, IStructure y){ fv.addFeature(my.fvPeop); fv.addFeature(my.fvOrg); - if(my.Rlables.RelLabel().toLowerCase().contains("work")) + if (my.Rlables.RelLabel().toLowerCase().contains("work")) my.fvWorkFor=mx.Rfv; fv.addFeature(my.fvWorkFor); From 292ffac160e870134d5971ab5a83b60c44e0c3cc Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 13:37:01 -0600 Subject: [PATCH 024/118] a template for feture generator to be debugged. --- .../classifier/SL_model/JoinSLtrain.scala | 2 +- .../SL_model/SL_FeatureGenerator.scala | 26 +++++++++---------- .../SL_model/Saul_SL_Inference.scala | 2 +- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 2a04a896..75388a17 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -3,7 +3,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} +import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import scala.reflect.ClassTag diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 205e8423..4a5a28fa 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -1,29 +1,27 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.sl.core.{IStructure, IInstance, AbstractFeatureGenerator} -import edu.illinois.cs.cogcomp.sl.util.{FeatureVectorBuffer, IFeatureVector} +import edu.illinois.cs.cogcomp.sl.core.{ IStructure, IInstance, AbstractFeatureGenerator } +import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } -/** - * Created by Parisa on 12/8/15. - */ -class SL_FeatureGenerator extends AbstractFeatureGenerator{ +/** Created by Parisa on 12/8/15. + */ +class SL_FeatureGenerator extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { val myX = x.asInstanceOf[Saul_SL_Instance] val myY = x.asInstanceOf[Saul_SL_Label_Structure] var fv = new FeatureVectorBuffer() - for (i <- 0 until myX.factorClassifiers.size()){ - val a= myX.factorClassifiers.get(i).onClassifier.getExampleArray() + for (i <- 0 until myX.factorClassifiers.size()) { + val a = myX.factorClassifiers.get(i).onClassifier.getExampleArray() val a0 = a(0).asInstanceOf[Array[Int]] var a1 = a(1).asInstanceOf[Array[Double]] val lab = myY.labels.get(i) - if (!lab.equals("true")) - { - a1= Array.fill[Double](a1.length)(0) + if (!lab.equals("true")) { + a1 = Array.fill[Double](a1.length)(0) } - val fv= new FeatureVectorBuffer(a0,a1) - fv.addFeature(a0,a1) - } + val fv = new FeatureVectorBuffer(a0, a1) + fv.addFeature(a0, a1) + } fv.toFeatureVector() } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 291716ee..f9a71124 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} +import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } import edu.illinois.cs.cogcomp.sl.util.WeightVector /** Created by Parisa on 12/8/15. From 1e3cbb6335a6bacdb5b2ab56c4c52345934c611c Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 14:24:39 -0600 Subject: [PATCH 025/118] a template for test_App --- .../classifier/SL_model/JoinSLtrain.scala | 62 ++----------------- ...aining.scala => IndependentTraining.scala} | 2 +- .../RewriteBasicModel/mySL_Saul_TestApp.scala | 12 ++++ 3 files changed, 19 insertions(+), 57 deletions(-) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/{IndenpendentTraining.scala => IndependentTraining.scala} (97%) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 75388a17..963d0304 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -1,9 +1,8 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } +import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import scala.reflect.ClassTag @@ -27,74 +26,25 @@ object JoinSLtrain { val model = new SLModel val allHeads = dm.getNodeWithType[HEAD].getTrainingInstances val sp = SL_IOManager.makeSLProblem(dm, cls) - // model.infSolver = new iERjavaInferencePL + model.infSolver = new Saul_SL_Inference val para = new SLParameters para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false // model.config = new util.HashMap(); model.para = para - // model.featureGenerator = new ERFeatureGenerator(lexm) + model.featureGenerator = new SL_FeatureGenerator // model.lm=lexm model.lm.setAllowNewFeatures(true) - para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature + // para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); // println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) println("num?:" + model.lm.getNumOfFeature) - // model.wv = learner.train(sp) - // model.saveModel(modelname); - - allHeads foreach { - h => - { - cls.foreach { - case c: ConstrainedClassifier[_, HEAD] => { - - type C = c.LEFT - - val typedC = c.asInstanceOf[ConstrainedClassifier[_, HEAD]] - - val oracle = typedC.onClassifier.getLabeler - - typedC.getCandidates(h) foreach { - x => - { - - def trainOnce() = { - - val result = typedC.classifier.discreteValue(x) - val trueLabel = oracle.discreteValue(x) - - if (result.equals("true") && trueLabel.equals("false")) { - val a = typedC.onClassifier.getExampleArray(x) - val a0 = a(0).asInstanceOf[Array[Int]] - val a1 = a(1).asInstanceOf[Array[Double]] - - typedC.onClassifier.asInstanceOf[LinearThresholdUnit].promote(a0, a1, 0.1) - } else { - - if (result.equals("false") && trueLabel.equals("true")) { - val a = typedC.onClassifier.getExampleArray(x) - val a0 = a(0).asInstanceOf[Array[Int]] - val a1 = a(1).asInstanceOf[Array[Double]] - typedC.onClassifier.asInstanceOf[LinearThresholdUnit].demote(a0, a1, 0.1) - } else { - } - } - - } - - trainOnce() - } - } - } - } - } - } - train(dm, cls, it - 1) + model.wv = learner.train(sp) + model.saveModel("modelname.SAUL"); } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndependentTraining.scala similarity index 97% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndependentTraining.scala index 7bdbfafa..44fbb374 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndenpendentTraining.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/IndependentTraining.scala @@ -6,7 +6,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBas import scala.collection.JavaConversions._ -object indenpendentTraining extends App { +object IndependentTraining extends App { def populate_ER_graph = { val reader = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Token") diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala new file mode 100644 index 00000000..f8a7750a --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala @@ -0,0 +1,12 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.IndependentTraining._ +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationConstraintClassifiers.PerConstraintClassifier + +/** + * Created by Parisa on 12/8/15. + */ +object mySL_Saul_TestApp { + populate_ER_graph + JoinSLtrain(entityRelationBasicDataModel,List(PerConstraintClassifier)) +} From 6f677671fbf539737e4e08c8784825fd56db5240 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 16:00:14 -0600 Subject: [PATCH 026/118] fixed typing and runtime Errors --- .../saul/classifier/SL_model/JoinSLtrain.scala | 2 +- .../classifier/SL_model/SL_FeatureGenerator.scala | 7 ++++--- .../saul/classifier/SL_model/SL_IOManager.scala | 4 +++- .../classifier/SL_model/Saul_SL_Inference.scala | 14 +++++++------- .../saul/classifier/SL_model/Saul_SL_Instance.java | 6 +++--- .../SL_model/Saul_SL_Label_Structure.java | 4 ++-- .../RewriteBasicModel/mySL_Saul_TestApp.scala | 4 +++- .../trainingparadigm/IndenpendentTraining.scala | 2 +- .../trainingparadigm/JoinTraining.scala | 2 +- .../trainingparadigm/PipelineTraining.scala | 2 +- 10 files changed, 26 insertions(+), 21 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 963d0304..370bc319 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -21,7 +21,7 @@ object JoinSLtrain { trainSSVM[HEAD](dm, cls) } - def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]]): Unit = { + def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t:ClassTag[HEAD]): Unit = { val model = new SLModel val allHeads = dm.getNodeWithType[HEAD].getTrainingInstances diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 4a5a28fa..99f51cdb 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -5,10 +5,11 @@ import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } /** Created by Parisa on 12/8/15. */ -class SL_FeatureGenerator extends AbstractFeatureGenerator { +class SL_FeatureGenerator[_,HEAD] extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { - val myX = x.asInstanceOf[Saul_SL_Instance] - val myY = x.asInstanceOf[Saul_SL_Label_Structure] + + val myX = x.asInstanceOf[Saul_SL_Instance[HEAD,_]] + val myY = x.asInstanceOf[Saul_SL_Label_Structure[HEAD,_]] var fv = new FeatureVectorBuffer() for (i <- 0 until myX.factorClassifiers.size()) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index 8a4bb097..9427420a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -4,10 +4,12 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.SLProblem +import scala.reflect.ClassTag + /** Created by Parisa on 12/4/15. */ object SL_IOManager { - def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]]): SLProblem = { + def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): SLProblem = { var sp: SLProblem = new SLProblem() val allHeads = dm.getNodeWithType[HEAD].getAllInstances allHeads.foreach(x => { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index f9a71124..6a719f01 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -5,11 +5,11 @@ import edu.illinois.cs.cogcomp.sl.util.WeightVector /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference extends AbstractInferenceSolver { +class Saul_SL_Inference[_,HEAD] extends AbstractInferenceSolver { override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_Instance] - var myStruct: Saul_SL_Label_Structure = ??? + val myIns = ins.asInstanceOf[Saul_SL_Instance[_,HEAD]] + var myStruct: Saul_SL_Label_Structure [_,HEAD]= ??? for (i <- 0 until myIns.factorClassifiers.size()) { myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) @@ -19,8 +19,8 @@ class Saul_SL_Inference extends AbstractInferenceSolver { override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { var l: Float = 0 - val myGold = gold.asInstanceOf[Saul_SL_Label_Structure] - val myPred = pred.asInstanceOf[Saul_SL_Label_Structure] + val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[_,HEAD]] + val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[_,HEAD]] for (i <- 0 until myGold.labels.size()) { l = l + myGold.labels.get(i).equals(myPred.labels.get(i)).asInstanceOf[Float] } @@ -29,8 +29,8 @@ class Saul_SL_Inference extends AbstractInferenceSolver { override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_Instance] - var myStruct: Saul_SL_Label_Structure = ??? + val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD,_]] + var myStruct: Saul_SL_Label_Structure[HEAD,_] = ??? for (i <- 0 until myIns.factorClassifiers.size()) { myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java index 87b4995c..d08dfa2f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java @@ -10,12 +10,12 @@ /** * Created by Parisa on 12/4/15. */ -public class Saul_SL_Instance<_> implements IInstance { +public class Saul_SL_Instance<_, HEAD> implements IInstance { List inputFeatures; List factorClassifiers; - public Saul_SL_Instance(ArrayList> l, _ x ){ + public Saul_SL_Instance(ArrayList> l, _ x ){ { for (ConstrainedClassifier c : l) { @@ -29,7 +29,7 @@ public Saul_SL_Instance(ArrayList> l, _ x ){ factorClassifiers.add(c); } ; - + // val a0 = a(0).asInstanceOf[Array[Int]] // val a1 = a(1).asInstanceOf[Array[Double]] } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java index 6e8935f7..0421e91e 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java @@ -10,11 +10,11 @@ /** * Created by Parisa on 12/8/15. */ -public class Saul_SL_Label_Structure <_> implements IStructure { +public class Saul_SL_Label_Structure <_,HEAD> implements IStructure { ArrayList labels; - public Saul_SL_Label_Structure(ArrayList> l, _ x ){ + public Saul_SL_Label_Structure(ArrayList> l, _ x ){ for (ConstrainedClassifier c : l){ labels.add(c.onClassifier().discreteValue(x)); diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala index f8a7750a..8688e694 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala @@ -7,6 +7,8 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBas * Created by Parisa on 12/8/15. */ object mySL_Saul_TestApp { + def main() { populate_ER_graph - JoinSLtrain(entityRelationBasicDataModel,List(PerConstraintClassifier)) + JoinSLtrain(entityRelationBasicDataModel,List(PerConstraintClassifier)) + } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/IndenpendentTraining.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/IndenpendentTraining.scala index d76323e5..c056ca0b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/IndenpendentTraining.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/IndenpendentTraining.scala @@ -5,7 +5,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.entityRela /** Created by haowu on 5/6/15. */ -object indenpendentTraining { +object IndenpendentTraining { val it = 5 diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/JoinTraining.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/JoinTraining.scala index 59875293..b5077772 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/JoinTraining.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/JoinTraining.scala @@ -8,7 +8,7 @@ import edu.illinois.cs.cogcomp.saul.classifier.JointTrain /** Created by Parisa on 5/6/15. */ -object joinTraining { +object JoinTraining { def trainJoint(preTrainIteration: Int, jointTrainIteration: Int): Unit = { println("Joint Training with Pretraint " + preTrainIteration) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/PipelineTraining.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/PipelineTraining.scala index 656f5e5e..5cab1bc0 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/PipelineTraining.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/trainingparadigm/PipelineTraining.scala @@ -5,7 +5,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.entityRela /** Created by haowu on 5/6/15. */ -object pipelineTraining { +object PipelineTraining { val it = 20 From c3b05bc1a90bfcf3921d10561062b1584d61c70f Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 8 Dec 2015 18:34:38 -0600 Subject: [PATCH 027/118] a template for test_App --- .../RewriteBasicModel/mySL_Saul_TestApp.scala | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala index 8688e694..f9e9ce15 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala @@ -6,9 +6,8 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBas /** * Created by Parisa on 12/8/15. */ -object mySL_Saul_TestApp { - def main() { +object mySL_Saul_TestApp extends App { populate_ER_graph JoinSLtrain(entityRelationBasicDataModel,List(PerConstraintClassifier)) - } + } From 15551ab6733ad25517ff3eafceae51308f56f8c0 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 10 Dec 2015 18:59:01 -0600 Subject: [PATCH 028/118] Added scala versions of IStructure and IInstance --- .../SL_model/SL_FeatureGenerator.scala | 4 +-- .../classifier/SL_model/SL_IOManager.scala | 4 +-- .../SL_model/Saul_SL_Inference.scala | 12 +++---- .../SL_model/Saul_SL_Instance.scala | 34 +++++++++++++++++++ .../SL_model/Saul_SL_Label_Structure.scala | 21 ++++++++++++ ...java => Saul_SL_Label_java_Structure.java} | 4 +-- ...stance.java => Saul_SL_java_Instance.java} | 8 ++--- 7 files changed, 71 insertions(+), 16 deletions(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/{Saul_SL_Label_Structure.java => Saul_SL_Label_java_Structure.java} (74%) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/{Saul_SL_Instance.java => Saul_SL_java_Instance.java} (80%) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 99f51cdb..933d31a2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -8,8 +8,8 @@ import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } class SL_FeatureGenerator[_,HEAD] extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { - val myX = x.asInstanceOf[Saul_SL_Instance[HEAD,_]] - val myY = x.asInstanceOf[Saul_SL_Label_Structure[HEAD,_]] + val myX = x.asInstanceOf[Saul_SL_java_Instance[HEAD,_]] + val myY = x.asInstanceOf[Saul_SL_Label_java_Structure[HEAD,_]] var fv = new FeatureVectorBuffer() for (i <- 0 until myX.factorClassifiers.size()) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index 9427420a..709e3bfc 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -13,8 +13,8 @@ object SL_IOManager { var sp: SLProblem = new SLProblem() val allHeads = dm.getNodeWithType[HEAD].getAllInstances allHeads.foreach(x => { - val ins = new Saul_SL_Instance(list.asInstanceOf, x) - val outs = new Saul_SL_Label_Structure(list.asInstanceOf, x) + val ins = new Saul_SL_java_Instance(list.asInstanceOf[ConstrainedClassifier[_,HEAD]], x) + val outs = new Saul_SL_Label_java_Structure(list.asInstanceOf, x) sp.addExample(ins, outs) }) sp diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 6a719f01..1ca6e7d0 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -8,8 +8,8 @@ import edu.illinois.cs.cogcomp.sl.util.WeightVector class Saul_SL_Inference[_,HEAD] extends AbstractInferenceSolver { override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_Instance[_,HEAD]] - var myStruct: Saul_SL_Label_Structure [_,HEAD]= ??? + val myIns = ins.asInstanceOf[Saul_SL_java_Instance[_,HEAD]] + var myStruct: Saul_SL_Label_java_Structure [_,HEAD]= ??? for (i <- 0 until myIns.factorClassifiers.size()) { myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) @@ -19,8 +19,8 @@ class Saul_SL_Inference[_,HEAD] extends AbstractInferenceSolver { override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { var l: Float = 0 - val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[_,HEAD]] - val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[_,HEAD]] + val myGold = gold.asInstanceOf[Saul_SL_Label_java_Structure[_,HEAD]] + val myPred = pred.asInstanceOf[Saul_SL_Label_java_Structure[_,HEAD]] for (i <- 0 until myGold.labels.size()) { l = l + myGold.labels.get(i).equals(myPred.labels.get(i)).asInstanceOf[Float] } @@ -29,8 +29,8 @@ class Saul_SL_Inference[_,HEAD] extends AbstractInferenceSolver { override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD,_]] - var myStruct: Saul_SL_Label_Structure[HEAD,_] = ??? + val myIns = ins.asInstanceOf[Saul_SL_java_Instance[HEAD,_]] + var myStruct: Saul_SL_Label_java_Structure[HEAD,_] = ??? for (i <- 0 until myIns.factorClassifiers.size()) { myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala new file mode 100644 index 00000000..ed3764ec --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -0,0 +1,34 @@ + package edu.illinois.cs.cogcomp.saul.classifier.SL_model + + import edu.illinois.cs.cogcomp.lbjava.classify.Classifier + import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier + import edu.illinois.cs.cogcomp.sl.core.IInstance + import scala.collection.JavaConversions._ + /** + * Created by Parisa on 12/10/15. + */ + class Saul_SL_Instance[_, HEAD] extends IInstance{ + + var inputFeatures : List[Object[_]]= null + var factorClassifiers : List[ConstrainedClassifier[_, HEAD]] = null + + def apply(l : List[ConstrainedClassifier[_, HEAD]], x : HEAD){ + for (c: ConstrainedClassifier[_, HEAD] <- l) + { + val oracle: Classifier = c.onClassifier.getLabeler() + val cands: Seq[_] = c.getCandidates(x) + for ( ci<- cands){ + c.classifier.discreteValue(ci) //prediction result + oracle.discreteValue(ci) // true lable + // return a Feature values and indexs + inputFeatures.add(c.onClassifier.getExampleArray(ci)) + factorClassifiers.add(c) + } + // val a0 = a(0).asInstanceOf[Array[Int]] + // val a1 = a(1).asInstanceOf[Array[Double]] + } + } + } + + + diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala new file mode 100644 index 00000000..8cb0fb81 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -0,0 +1,21 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model + +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.sl.core.IStructure + +import scala.collection.JavaConversions._ +/** + * Created by Parisa on 12/10/15. + */ +class Saul_SL_Label_Structure [_,HEAD] extends IStructure{ + + var labels : List[String] = null + + def Saul_SL_Label_java_Structure(l: List[ConstrainedClassifier[_, HEAD]] , obj: HEAD){ + + l.foreach( (c:ConstrainedClassifier[_,HEAD]) => { + labels.add(c.onClassifier.discreteValue()) + }) + } +} + diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java similarity index 74% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java index 0421e91e..fa664b6a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java @@ -10,11 +10,11 @@ /** * Created by Parisa on 12/8/15. */ -public class Saul_SL_Label_Structure <_,HEAD> implements IStructure { +public class Saul_SL_Label_java_Structure<_,HEAD> implements IStructure { ArrayList labels; - public Saul_SL_Label_Structure(ArrayList> l, _ x ){ + public Saul_SL_Label_java_Structure(ArrayList> l, _ x){ for (ConstrainedClassifier c : l){ labels.add(c.onClassifier().discreteValue(x)); diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java similarity index 80% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java index d08dfa2f..1652d9c5 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java @@ -10,18 +10,18 @@ /** * Created by Parisa on 12/4/15. */ -public class Saul_SL_Instance<_, HEAD> implements IInstance { +public class Saul_SL_java_Instance<_, HEAD> implements IInstance { List inputFeatures; List factorClassifiers; - public Saul_SL_Instance(ArrayList> l, _ x ){ + public Saul_SL_java_Instance(ArrayList> l, _ x){ { for (ConstrainedClassifier c : l) { Classifier oracle = c.onClassifier().getLabeler(); - ArrayList<_> cands= (ArrayList<_>) c.getCandidates(x); - for (_ ci: cands){ + ArrayList cands= (ArrayList) c.getCandidates(x); + for (HEAD ci: cands){ c.classifier().discreteValue(ci) ; //prediction result oracle.discreteValue(ci) ; // true lable ; // return a Feature values and indexs From ec8da517b111ac6432a88bdb9e3063561c1192d6 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 10 Dec 2015 19:04:31 -0600 Subject: [PATCH 029/118] Added scala versions of IStructure and IInstance --- .../classifier/SL_model/JoinSLtrain.scala | 6 +-- .../SL_model/SL_FeatureGenerator.scala | 6 +-- .../classifier/SL_model/SL_IOManager.scala | 2 +- .../SL_model/Saul_SL_Inference.scala | 14 ++--- .../SL_model/Saul_SL_Instance.scala | 52 +++++++++---------- .../SL_model/Saul_SL_Label_Structure.scala | 15 +++--- .../RewriteBasicModel/mySL_Saul_TestApp.scala | 7 ++- 7 files changed, 48 insertions(+), 54 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 370bc319..7544199f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -2,7 +2,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} +import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import scala.reflect.ClassTag @@ -21,7 +21,7 @@ object JoinSLtrain { trainSSVM[HEAD](dm, cls) } - def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t:ClassTag[HEAD]): Unit = { + def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { val model = new SLModel val allHeads = dm.getNodeWithType[HEAD].getTrainingInstances @@ -36,7 +36,7 @@ object JoinSLtrain { model.featureGenerator = new SL_FeatureGenerator // model.lm=lexm model.lm.setAllowNewFeatures(true) - // para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature + // para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 933d31a2..129df327 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -5,11 +5,11 @@ import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } /** Created by Parisa on 12/8/15. */ -class SL_FeatureGenerator[_,HEAD] extends AbstractFeatureGenerator { +class SL_FeatureGenerator[_, HEAD] extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { - val myX = x.asInstanceOf[Saul_SL_java_Instance[HEAD,_]] - val myY = x.asInstanceOf[Saul_SL_Label_java_Structure[HEAD,_]] + val myX = x.asInstanceOf[Saul_SL_java_Instance[HEAD, _]] + val myY = x.asInstanceOf[Saul_SL_Label_java_Structure[HEAD, _]] var fv = new FeatureVectorBuffer() for (i <- 0 until myX.factorClassifiers.size()) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index 709e3bfc..4041b312 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -13,7 +13,7 @@ object SL_IOManager { var sp: SLProblem = new SLProblem() val allHeads = dm.getNodeWithType[HEAD].getAllInstances allHeads.foreach(x => { - val ins = new Saul_SL_java_Instance(list.asInstanceOf[ConstrainedClassifier[_,HEAD]], x) + val ins = new Saul_SL_java_Instance(list.asInstanceOf, x) val outs = new Saul_SL_Label_java_Structure(list.asInstanceOf, x) sp.addExample(ins, outs) }) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 1ca6e7d0..1fa80c48 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -5,11 +5,11 @@ import edu.illinois.cs.cogcomp.sl.util.WeightVector /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[_,HEAD] extends AbstractInferenceSolver { +class Saul_SL_Inference[_, HEAD] extends AbstractInferenceSolver { override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_java_Instance[_,HEAD]] - var myStruct: Saul_SL_Label_java_Structure [_,HEAD]= ??? + val myIns = ins.asInstanceOf[Saul_SL_java_Instance[_, HEAD]] + var myStruct: Saul_SL_Label_java_Structure[_, HEAD] = ??? for (i <- 0 until myIns.factorClassifiers.size()) { myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) @@ -19,8 +19,8 @@ class Saul_SL_Inference[_,HEAD] extends AbstractInferenceSolver { override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { var l: Float = 0 - val myGold = gold.asInstanceOf[Saul_SL_Label_java_Structure[_,HEAD]] - val myPred = pred.asInstanceOf[Saul_SL_Label_java_Structure[_,HEAD]] + val myGold = gold.asInstanceOf[Saul_SL_Label_java_Structure[_, HEAD]] + val myPred = pred.asInstanceOf[Saul_SL_Label_java_Structure[_, HEAD]] for (i <- 0 until myGold.labels.size()) { l = l + myGold.labels.get(i).equals(myPred.labels.get(i)).asInstanceOf[Float] } @@ -29,8 +29,8 @@ class Saul_SL_Inference[_,HEAD] extends AbstractInferenceSolver { override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_java_Instance[HEAD,_]] - var myStruct: Saul_SL_Label_java_Structure[HEAD,_] = ??? + val myIns = ins.asInstanceOf[Saul_SL_java_Instance[HEAD, _]] + var myStruct: Saul_SL_Label_java_Structure[HEAD, _] = ??? for (i <- 0 until myIns.factorClassifiers.size()) { myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index ed3764ec..36a637d2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -1,34 +1,30 @@ - package edu.illinois.cs.cogcomp.saul.classifier.SL_model +package edu.illinois.cs.cogcomp.saul.classifier.SL_model - import edu.illinois.cs.cogcomp.lbjava.classify.Classifier - import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier - import edu.illinois.cs.cogcomp.sl.core.IInstance - import scala.collection.JavaConversions._ - /** - * Created by Parisa on 12/10/15. - */ - class Saul_SL_Instance[_, HEAD] extends IInstance{ +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.sl.core.IInstance +import scala.collection.JavaConversions._ +/** Created by Parisa on 12/10/15. + */ +class Saul_SL_Instance[_, HEAD] extends IInstance { - var inputFeatures : List[Object[_]]= null - var factorClassifiers : List[ConstrainedClassifier[_, HEAD]] = null + var inputFeatures: List[Object[_]] = null + var factorClassifiers: List[ConstrainedClassifier[_, HEAD]] = null - def apply(l : List[ConstrainedClassifier[_, HEAD]], x : HEAD){ - for (c: ConstrainedClassifier[_, HEAD] <- l) - { - val oracle: Classifier = c.onClassifier.getLabeler() - val cands: Seq[_] = c.getCandidates(x) - for ( ci<- cands){ - c.classifier.discreteValue(ci) //prediction result - oracle.discreteValue(ci) // true lable - // return a Feature values and indexs - inputFeatures.add(c.onClassifier.getExampleArray(ci)) - factorClassifiers.add(c) - } - // val a0 = a(0).asInstanceOf[Array[Int]] - // val a1 = a(1).asInstanceOf[Array[Double]] - } + def apply(l: List[ConstrainedClassifier[_, HEAD]], x: HEAD) { + for (c: ConstrainedClassifier[_, HEAD] <- l) { + val oracle: Classifier = c.onClassifier.getLabeler() + val cands: Seq[_] = c.getCandidates(x) + for (ci <- cands) { + c.classifier.discreteValue(ci) //prediction result + oracle.discreteValue(ci) // true lable + // return a Feature values and indexs + inputFeatures.add(c.onClassifier.getExampleArray(ci)) + factorClassifiers.add(c) } + // val a0 = a(0).asInstanceOf[Array[Int]] + // val a1 = a(1).asInstanceOf[Array[Double]] + } } - - +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala index 8cb0fb81..ba6023f9 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -4,18 +4,17 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IStructure import scala.collection.JavaConversions._ -/** - * Created by Parisa on 12/10/15. - */ -class Saul_SL_Label_Structure [_,HEAD] extends IStructure{ +/** Created by Parisa on 12/10/15. + */ +class Saul_SL_Label_Structure[_, HEAD] extends IStructure { - var labels : List[String] = null + var labels: List[String] = null - def Saul_SL_Label_java_Structure(l: List[ConstrainedClassifier[_, HEAD]] , obj: HEAD){ + def Saul_SL_Label_java_Structure(l: List[ConstrainedClassifier[_, HEAD]], obj: HEAD) { - l.foreach( (c:ConstrainedClassifier[_,HEAD]) => { + l.foreach((c: ConstrainedClassifier[_, HEAD]) => { labels.add(c.onClassifier.discreteValue()) }) - } + } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala index f9e9ce15..19a06b18 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala @@ -3,11 +3,10 @@ import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.IndependentTraining._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationConstraintClassifiers.PerConstraintClassifier -/** - * Created by Parisa on 12/8/15. - */ +/** Created by Parisa on 12/8/15. + */ object mySL_Saul_TestApp extends App { populate_ER_graph - JoinSLtrain(entityRelationBasicDataModel,List(PerConstraintClassifier)) + JoinSLtrain(entityRelationBasicDataModel, List(PerConstraintClassifier)) } From 5446e050720f30c6bfded77516972da34d917653 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 22 Mar 2016 19:17:42 -0500 Subject: [PATCH 030/118] -trying SL input/output --- .../SL_model/Saul_SL_Instance.scala | 2 +- .../SL_SVM/iJLIS3/Runner.scala | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index e75231de..2a21664e 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -11,7 +11,7 @@ class Saul_SL_Instance[T<:AnyRef, HEAD<:AnyRef] extends IInstance { val inputFeatures = List() var factorClassifiers = List() - def apply(l: List[ConstrainedClassifier[T, HEAD]], x: HEAD) { + def apply(l: List[ConstrainedClassifier[T, HEAD]], x: HEAD)={ for (c: ConstrainedClassifier[T, HEAD] <- l) { val oracle: Classifier = c.onClassifier.getLabeler() val cands: Seq[_] = c.getCandidates(x) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala index 9c6065e5..b53c8be2 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala @@ -1,8 +1,40 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS3 +import java.util.{ArrayList, List} + +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.Saul_SL_java_Instance +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.{ERiStructure, Nodevalues, ERqInstance} +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.entityRelationClassifiers.PerConstraintClassifier +import edu.illinois.cs.cogcomp.sl.core.{IInstance, IStructure} + /** * Created by Parisa on 3/22/16. */ object Runner { + + def readXY(cr: Conll04_ReaderNew, outlist: List[IStructure], sclist: List[IInstance], l: Int, u: Int) { + var i: Int = l + while (i < u) { //cr.instances.size){ + val newqi: Saul_SL_java_Instance = new Saul_SL_java_Instance(List(PerConstraintClassifier),cr.instances.elementAt(i)) + sclist.add(newqi) + val a: Nodevalues = new Nodevalues() + a.a = (cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) + val cs: ERiStructure = new ERiStructure(newqi, a.a) + outlist.add(cs) + i = i + 1 + } + } + + def trainSSVM(modelname: String): Unit = { + var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") + var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) + var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) + readXY(cr, outlist, sclist, 1, 100) + + cr = null + } + } From 1899e6012d8b689007c27d1db528067d7f8bf460 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 22 Mar 2016 22:26:24 -0500 Subject: [PATCH 031/118] -trying SL input/output --- .../SL_model/Saul_SL_Instance.scala | 12 ++++++---- .../SL_model/Saul_SL_java_Instance.java | 4 ++-- .../SL_SVM/iJLIS3/Runner.scala | 24 ++++++++----------- 3 files changed, 19 insertions(+), 21 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index 2a21664e..6d903c36 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -4,15 +4,17 @@ import edu.illinois.cs.cogcomp.lbjava.classify.Classifier import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IInstance import scala.collection.JavaConversions._ +import scala.reflect.ClassTag + /** Created by Parisa on 12/10/15. */ -class Saul_SL_Instance[T<:AnyRef, HEAD<:AnyRef] extends IInstance { +class Saul_SL_Instance[_, HEAD<:AnyRef] extends IInstance { - val inputFeatures = List() - var factorClassifiers = List() + val inputFeatures = List() // List + var factorClassifiers = List() //List - def apply(l: List[ConstrainedClassifier[T, HEAD]], x: HEAD)={ - for (c: ConstrainedClassifier[T, HEAD] <- l) { + def apply(l: List[ConstrainedClassifier[_, HEAD]], x: HEAD)(implicit headTag: ClassTag[_])={ + for (c: ConstrainedClassifier[_, HEAD] <- l) { val oracle: Classifier = c.onClassifier.getLabeler() val cands: Seq[_] = c.getCandidates(x) for (ci <- cands) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java index 1652d9c5..5e836747 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java @@ -20,8 +20,8 @@ public Saul_SL_java_Instance(ArrayList> l, _ x){ for (ConstrainedClassifier c : l) { Classifier oracle = c.onClassifier().getLabeler(); - ArrayList cands= (ArrayList) c.getCandidates(x); - for (HEAD ci: cands){ + ArrayList<_> cands= (ArrayList<_>) c.getCandidates(x); + for (_ ci: cands){ c.classifier().discreteValue(ci) ; //prediction result oracle.discreteValue(ci) ; // true lable ; // return a Feature values and indexs diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala index b53c8be2..20312166 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala @@ -2,11 +2,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJ import java.util.{ArrayList, List} -import edu.illinois.cs.cogcomp.saul.classifier.SL_model.Saul_SL_java_Instance -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS.{ERiStructure, Nodevalues, ERqInstance} -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.entityRelationClassifiers.PerConstraintClassifier import edu.illinois.cs.cogcomp.sl.core.{IInstance, IStructure} /** @@ -16,16 +12,16 @@ object Runner { def readXY(cr: Conll04_ReaderNew, outlist: List[IStructure], sclist: List[IInstance], l: Int, u: Int) { - var i: Int = l - while (i < u) { //cr.instances.size){ - val newqi: Saul_SL_java_Instance = new Saul_SL_java_Instance(List(PerConstraintClassifier),cr.instances.elementAt(i)) - sclist.add(newqi) - val a: Nodevalues = new Nodevalues() - a.a = (cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) - val cs: ERiStructure = new ERiStructure(newqi, a.a) - outlist.add(cs) - i = i + 1 - } +// var i: Int = l +// while (i < u) { //cr.instances.size){ +// val newqi: Saul_SL_java_Instance = new Saul_SL_java_Instance(List(PerConstraintClassifier),cr.instances.elementAt(i)) +// sclist.add(newqi) +// val a: Nodevalues = new Nodevalues() +// a.a = (cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) +// val cs: ERiStructure = new ERiStructure(newqi, a.a) +// outlist.add(cs) +// i = i + 1 +// } } def trainSSVM(modelname: String): Unit = { From e8d8a2d9d4df08d5c3b913e6737ed2466fc1bb32 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 23 Mar 2016 11:24:26 -0500 Subject: [PATCH 032/118] -merged with ER --- .../classifier/JoinTrainSparseNetwork.scala | 9 ++-- .../SL_model/Saul_SL_Instance.scala | 9 ++-- .../SL_model/Saul_SL_Label_Structure.scala | 2 +- ...EntityRelationConstrainedClassifiers.scala | 1 - .../EntityRelationConstraints.Scala | 6 +-- .../entityRelationConstraintClassifiers.scala | 41 ------------------- .../SL_SVM/iJLIS3/Runner.scala | 36 ---------------- .../iJLIS3}/mySL_Saul_TestApp.scala | 12 +++--- .../nlp/POSTagger/POSClassifiers.scala | 2 +- 9 files changed, 21 insertions(+), 97 deletions(-) delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/{RewriteBasicModel => SL_SVM/iJLIS3}/mySL_Saul_TestApp.scala (56%) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala index ee5ccff7..d06369c9 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala @@ -37,12 +37,11 @@ object JoinTrainSparseNetwork { }*/ - def apply[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]]) - (implicit headTag: ClassTag[HEAD]) = - { + def apply[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit headTag: ClassTag[HEAD]) = + { - train[HEAD](dm, cls, 1) - } + train[HEAD](dm, cls, 1) + } def apply[HEAD <: AnyRef]( dm: DataModel, diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index 6d903c36..29658eea 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -3,18 +3,19 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.classify.Classifier import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IInstance + import scala.collection.JavaConversions._ -import scala.reflect.ClassTag /** Created by Parisa on 12/10/15. */ -class Saul_SL_Instance[_, HEAD<:AnyRef] extends IInstance { +class Saul_SL_Instance[T <: AnyRef, HEAD <: AnyRef] extends IInstance { val inputFeatures = List() // List var factorClassifiers = List() //List - def apply(l: List[ConstrainedClassifier[_, HEAD]], x: HEAD)(implicit headTag: ClassTag[_])={ - for (c: ConstrainedClassifier[_, HEAD] <- l) { + def apply(l: List[ConstrainedClassifier[T, HEAD]], x: HEAD) //(implicit headTag: ClassTag[_]) + = { + for (c: ConstrainedClassifier[T, HEAD] <- l) { val oracle: Classifier = c.onClassifier.getLabeler() val cands: Seq[_] = c.getCandidates(x) for (ci <- cands) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala index baa5d4a8..ffd85398 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -6,7 +6,7 @@ import edu.illinois.cs.cogcomp.sl.core.IStructure import scala.collection.JavaConversions._ /** Created by Parisa on 12/10/15. */ -class Saul_SL_Label_Structure[T<:AnyRef, HEAD<:AnyRef] extends IStructure { +class Saul_SL_Label_Structure[T <: AnyRef, HEAD <: AnyRef] extends IStructure { var labels: List[String] = null diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala index 2163f573..2e653140 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala @@ -5,7 +5,6 @@ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ C import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstraints._ - object EntityRelationConstrainedClassifiers { object orgConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](EntityRelationDataModel, orgClassifier) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala index 0dfffde0..2e483af9 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala @@ -3,8 +3,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation -import EntityRelationClassifiers._ -import EntityRelationClassifiers.orgClassifier +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers._ + object EntityRelationConstraints { @@ -18,7 +18,7 @@ object EntityRelationConstraints { val liveInConstraint = ConstrainedClassifier.constraint[ConllRelation] { x: ConllRelation => { - ((livesInClassifier on x) isTrue) ==> ( + (( livesInClassifier on x) isTrue) ==> ( ((personClassifier on x.e1) isTrue) and ((locationClassifier on x.e2) isTrue) ) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala deleted file mode 100644 index 198c7876..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/entityRelationConstraintClassifiers.scala +++ /dev/null @@ -1,41 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel - -import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRelation, ConllRawToken } -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.entityRelationConstraints._ -import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.entityRelationClassifiers.{workForClassifier, LivesInClassifier} - -/** Created by Parisa on 12/3/15. - */ -object entityRelationConstraintClassifiers { - object OrgConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, orgClassifier) { - def subjectTo = Per_Org - // override val pathToHead = Some('containE2) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 - } - - object PerConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, personClassifier) { - - def subjectTo = Per_Org - // override val pathToHead = Some(entityRelationBasicDataModel.RelationToPer) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 - } - - object LocConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](entityRelationBasicDataModel, locationClassifier) { - - def subjectTo = Per_Org - //override val pathToHead = Some('containE2) - //TODO add test unit for this filter - // override def filter(t: ConllRawToken,h:ConllRelation): Boolean = t.wordId==h.wordId2 - } - - object P_O_relationClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](entityRelationBasicDataModel, workForClassifier) { - def subjectTo = Per_Org - } - - object LiveIn_P_O_relationClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](entityRelationBasicDataModel, LivesInClassifier) { - def subjectTo = Per_Org - } -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala deleted file mode 100644 index 20312166..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/Runner.scala +++ /dev/null @@ -1,36 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS3 - -import java.util.{ArrayList, List} - -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew -import edu.illinois.cs.cogcomp.sl.core.{IInstance, IStructure} - -/** - * Created by Parisa on 3/22/16. - */ -object Runner { - - - def readXY(cr: Conll04_ReaderNew, outlist: List[IStructure], sclist: List[IInstance], l: Int, u: Int) { -// var i: Int = l -// while (i < u) { //cr.instances.size){ -// val newqi: Saul_SL_java_Instance = new Saul_SL_java_Instance(List(PerConstraintClassifier),cr.instances.elementAt(i)) -// sclist.add(newqi) -// val a: Nodevalues = new Nodevalues() -// a.a = (cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) -// val cs: ERiStructure = new ERiStructure(newqi, a.a) -// outlist.add(cs) -// i = i + 1 -// } - } - - def trainSSVM(modelname: String): Unit = { - var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") - var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) - var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) - readXY(cr, outlist, sclist, 1, 100) - - cr = null - } - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala similarity index 56% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 973b1026..444cc77d 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/RewriteBasicModel/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -1,12 +1,14 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS3 + import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstrainedClassifiers.perConstraintClassifier +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationDataModel + //import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.IndependentTraining._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.entityRelationConstraintClassifiers.PerConstraintClassifier /** Created by Parisa on 12/8/15. */ object mySL_Saul_TestApp extends App { - //populate_ER_graph - JoinSLtrain(entityRelationBasicDataModel, List(PerConstraintClassifier)) - + EntityRelationDataModel.populateWithConll() + JoinSLtrain(EntityRelationDataModel, List(perConstraintClassifier)) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala index 3166031b..e6b773f5 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.POSTagger import edu.illinois.cs.cogcomp.core.datastructures.textannotation.Constituent -import edu.illinois.cs.cogcomp.lbjava.learn.{SparseAveragedPerceptron, SparseNetworkLearner} +import edu.illinois.cs.cogcomp.lbjava.learn.{ SparseAveragedPerceptron, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.Learnable import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.nlp.POSTagger.POSDataModel._ From 8d44eb174af67650a832b22f41e44fa59190b2bc Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 23 Mar 2016 15:12:00 -0500 Subject: [PATCH 033/118] -SL I/O --- .../cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala | 1 - .../cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala | 4 +++- .../saul/classifier/SL_model/Saul_SL_java_Instance.java | 4 ++-- .../EntityRelationConstrainedClassifiers.scala | 1 + .../nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java | 1 - .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 1 - .../SL_SVM/iJLIS2/mYjava/EntityFeatures.java | 7 ------- .../SL_SVM/iJLIS2/mYjava/JointER.java | 7 ------- .../SL_SVM/iJLIS2/mYjava/LocClassifier.java | 6 ------ .../SL_SVM/iJLIS2/mYjava/PersonWorkFor.java | 4 ---- .../SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java | 5 ----- .../SL_SVM/iJLIS2/mYjava/RelationFeatures.java | 7 ------- .../SL_SVM/iJLIS2/mYjava/orgLabel.java | 7 ------- .../SL_SVM/iJLIS2/mYjava/personLabel.java | 7 ------- .../SL_SVM/iJLIS2/mYjava/workLabel.java | 7 ------- 15 files changed, 6 insertions(+), 63 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 103ec803..710679cc 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -24,7 +24,6 @@ object JoinSLtrain { def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { val model = new SLModel - val allHeads = dm.getNodeWithType[HEAD].getTrainingInstances val sp = SL_IOManager.makeSLProblem(dm, cls) model.infSolver = new Saul_SL_Inference val para = new SLParameters diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index 4041b312..a2d0eea3 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -4,6 +4,7 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.SLProblem +import scala.collection.JavaConverters._ import scala.reflect.ClassTag /** Created by Parisa on 12/4/15. @@ -13,7 +14,8 @@ object SL_IOManager { var sp: SLProblem = new SLProblem() val allHeads = dm.getNodeWithType[HEAD].getAllInstances allHeads.foreach(x => { - val ins = new Saul_SL_java_Instance(list.asInstanceOf, x) + val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava + val ins = new Saul_SL_java_Instance(l, x) val outs = new Saul_SL_Label_java_Structure(list.asInstanceOf, x) sp.addExample(ins, outs) }) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java index 5e836747..b280272f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java @@ -15,12 +15,12 @@ public class Saul_SL_java_Instance<_, HEAD> implements IInstance { List inputFeatures; List factorClassifiers; - public Saul_SL_java_Instance(ArrayList> l, _ x){ + public Saul_SL_java_Instance(List> l, _ x){ { for (ConstrainedClassifier c : l) { Classifier oracle = c.onClassifier().getLabeler(); - ArrayList<_> cands= (ArrayList<_>) c.getCandidates(x); + List<_> cands= (List<_>) c.getCandidates(x); for (_ ci: cands){ c.classifier().discreteValue(ci) ; //prediction result oracle.discreteValue(ci) ; // true lable diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala index 2e653140..d470d88b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala @@ -4,6 +4,7 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawToken, ConllRelation } import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers.{locationClassifier, personClassifier, orgClassifier} import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstraints._ object EntityRelationConstrainedClassifiers { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java index e8fe4784..bdb6c1a5 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java @@ -2,7 +2,6 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.RunnerPL; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import edu.illinois.cs.cogcomp.sl.util.Lexiconer; import org.apache.commons.lang3.ArrayUtils; import java.util.ArrayList; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index 0f288071..543ef0ea 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -1,6 +1,5 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - import edu.illinois.cs.cogcomp.saul.classifier.Learnable; import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; import edu.illinois.cs.cogcomp.sl.core.IInstance; import edu.illinois.cs.cogcomp.sl.core.IStructure; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java index 553c0f36..beb77b3e 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java @@ -1,16 +1,9 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B49CC2E4E2A4D294555507DCB29CC29A47B4D4C292D2A4D26D07ECFCBC9C90A4C2F09CFCE4DC35821D450B1D558A6582E4DCB2E455821DB00FF0650B258292A2D45B658A5000617B321944000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import java.util.List; - public class EntityFeatures extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java index 0b877e61..6d125cfc 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java @@ -1,18 +1,11 @@ // Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000D6DC13E0280401641EBACF5EEE91C2981588581C31C2034898BCC4239120A48BBBA426747F2F53F85A72329690592B8F9B6C049A341A2937D49393BA0C1BE18819F46FDC316388AD8923FB9AB6E501A91F0DED7C4B4880CCCE3CE65EDEE5EF771E70799C4B1EBAAE334C88DE309EC8F214C8000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.lbjava.classify.*; import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.JointER$subjectto; -import java.util.List; -import java.util.*; - public class JointER extends ILPInference { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java index dfa4e987..fc361990 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java @@ -1,18 +1,12 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000DA09DCA44C040148F55A9C9CD3894CF9D3DAE146DD50120A44F4E54A776A73913399E1ABB36411FDDD0EEB287D28AF8FAAC705724640D0BBD6445D07C04276B5E4136B83FB0F0490C650737E01905214467D0E1822C4A12570BB461CEB6F48639092C1587484433CF10AEBE7B784A689C15B48E71E6155FC325530B8F77C1BA6836C0993757F86859B357A47C29B851CAB601E9297589385F0FC91549EEE3840B32FF442E82B907AFE398D223D2E2B3E61AE2F26306D70734225D528BA27DB18F10325BDFF3AF561ADD7A90A3382C70D1E534E26909BB5E80D7C9C2F4607957D049CFF203A95FC0166100000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; import edu.illinois.cs.cogcomp.lbjava.learn.*; import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import java.util.List; - - - public class LocClassifier extends SparseAveragedPerceptron { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java index 0f97e10a..833e7e1d 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java @@ -1,12 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java index a06818a6..6474b82a 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java @@ -1,15 +1,10 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // discrete RelArgsClassifier(ConllRelation r) <- JointER(work_forClassifier) -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.JointER; -import java.util.List; public class RelArgsClassifier extends Classifier diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java index 7bdd7b93..45417550 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java @@ -1,16 +1,9 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import java.util.List; - public class RelationFeatures extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java index 5e207bea..91d43852 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java @@ -1,16 +1,9 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import java.util.List; - public class orgLabel extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java index 4f7fab3a..b8565130 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java @@ -1,16 +1,9 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import java.util.List; - public class personLabel extends Classifier { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java index 63c2a3a0..627ca5a7 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java @@ -1,16 +1,9 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. // F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 -import edu.illinois.cs.cogcomp.core.io.LineIO; import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import java.util.List; - public class workLabel extends Classifier { From dfed404cda9bb0900c760f2560de4b9d889ee5ce Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 23 Mar 2016 22:38:41 -0500 Subject: [PATCH 034/118] -playing with types --- .../saul/classifier/SL_model/SL_IOManager.scala | 6 +++--- .../classifier/SL_model/Saul_SL_Instance.scala | 14 +++++++------- .../classifier/SL_model/Saul_SL_java_Instance.java | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index a2d0eea3..a4bc476d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -4,7 +4,6 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.SLProblem -import scala.collection.JavaConverters._ import scala.reflect.ClassTag /** Created by Parisa on 12/4/15. @@ -14,8 +13,9 @@ object SL_IOManager { var sp: SLProblem = new SLProblem() val allHeads = dm.getNodeWithType[HEAD].getAllInstances allHeads.foreach(x => { - val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava - val ins = new Saul_SL_java_Instance(l, x) + // val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava + val ins = new Saul_SL_Instance(list,x) + //ins.apply(list,x) val outs = new Saul_SL_Label_java_Structure(list.asInstanceOf, x) sp.addExample(ins, outs) }) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index 29658eea..e98a43c4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -5,17 +5,18 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IInstance import scala.collection.JavaConversions._ +import scala.reflect.ClassTag /** Created by Parisa on 12/10/15. */ -class Saul_SL_Instance[T <: AnyRef, HEAD <: AnyRef] extends IInstance { +case class Saul_SL_Instance[T <: List[ConstrainedClassifier[_,HEAD]],HEAD<:AnyRef](l:T,x:HEAD) extends IInstance { val inputFeatures = List() // List - var factorClassifiers = List() //List + var factorClassifiers: List[ConstrainedClassifier[_,HEAD]] = List() //List - def apply(l: List[ConstrainedClassifier[T, HEAD]], x: HEAD) //(implicit headTag: ClassTag[_]) + def apply(implicit headTag: ClassTag[HEAD]) = { - for (c: ConstrainedClassifier[T, HEAD] <- l) { + for (c: ConstrainedClassifier[_,HEAD] <- l) { val oracle: Classifier = c.onClassifier.getLabeler() val cands: Seq[_] = c.getCandidates(x) for (ci <- cands) { @@ -24,10 +25,9 @@ class Saul_SL_Instance[T <: AnyRef, HEAD <: AnyRef] extends IInstance { // return a Feature values and indexs inputFeatures.add(c.onClassifier.getExampleArray(ci)) factorClassifiers.add(c) - } + }// yield inputFeatures // val a0 = a(0).asInstanceOf[Array[Int]] // val a1 = a(1).asInstanceOf[Array[Double]] - } } -} +}} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java index b280272f..f7ced091 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java @@ -15,7 +15,7 @@ public class Saul_SL_java_Instance<_, HEAD> implements IInstance { List inputFeatures; List factorClassifiers; - public Saul_SL_java_Instance(List> l, _ x){ + public Saul_SL_java_Instance(List> l, HEAD x){ { for (ConstrainedClassifier c : l) { From c436cb5382e54a1e9bc0f751e7c7412ae06773a9 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 25 Mar 2016 14:44:20 -0500 Subject: [PATCH 035/118] -initial version of SL integration -it has not been tested and has issues --- .../classifier/SL_model/JoinSLtrain.scala | 9 ++-- .../SL_model/SL_FeatureGenerator.scala | 40 +++++++++------ .../classifier/SL_model/SL_IOManager.scala | 11 ++-- .../saul/classifier/SL_model/SUtils.java | 48 ++++++++++++++++++ .../SL_model/Saul_SL_Inference.scala | 39 ++++++++------- .../SL_model/Saul_SL_Instance.scala | 50 +++++++++++-------- .../SL_model/Saul_SL_Label_Structure.scala | 25 +++++++--- .../Saul_SL_Label_java_Structure.java | 2 +- ...EntityRelationConstrainedClassifiers.scala | 2 +- .../IndependentModels.scala | 1 + .../SL_SVM/iJLIS/Runner.scala | 4 +- 11 files changed, 158 insertions(+), 73 deletions(-) create mode 100755 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 710679cc..d9484f90 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -22,25 +22,24 @@ object JoinSLtrain { } def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { - + //var lexm: Lexiconer = new Lexiconer() val model = new SLModel val sp = SL_IOManager.makeSLProblem(dm, cls) model.infSolver = new Saul_SL_Inference val para = new SLParameters para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false - // model.config = new util.HashMap(); model.para = para model.featureGenerator = new SL_FeatureGenerator - // model.lm=lexm - model.lm.setAllowNewFeatures(true) + // model.lm=lexm + // model.lm.setAllowNewFeatures(false) // para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); // println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) - println("num?:" + model.lm.getNumOfFeature) + //println("num?:" + model.lm.getNumOfFeature) model.wv = learner.train(sp) model.saveModel("modelname.SAUL"); diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 129df327..4ecb310a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -5,24 +5,36 @@ import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } /** Created by Parisa on 12/8/15. */ -class SL_FeatureGenerator[_, HEAD] extends AbstractFeatureGenerator { +class SL_FeatureGenerator[HEAD <: AnyRef] extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { - val myX = x.asInstanceOf[Saul_SL_java_Instance[HEAD, _]] - val myY = x.asInstanceOf[Saul_SL_Label_java_Structure[HEAD, _]] - var fv = new FeatureVectorBuffer() - - for (i <- 0 until myX.factorClassifiers.size()) { - val a = myX.factorClassifiers.get(i).onClassifier.getExampleArray() - val a0 = a(0).asInstanceOf[Array[Int]] - var a1 = a(1).asInstanceOf[Array[Double]] - val lab = myY.labels.get(i) - if (!lab.equals("true")) { - a1 = Array.fill[Double](a1.length)(0) + val myX = x.asInstanceOf[Saul_SL_Instance[HEAD]] + val myY = y.asInstanceOf[Saul_SL_Label_Structure[HEAD]] + val fv = new FeatureVectorBuffer() + var labelCount=0 + for (i <- 0 until myX.factorClassifiers.size) { + val c = myX.factorClassifiers(i) + val candis: Seq[_] = c.getCandidates(myX.head) + val fvLocal = new FeatureVectorBuffer() + var previousSize=0 + previousSize=0 + for (ci <- candis) { + previousSize= fvLocal.toFeatureVector().getMaxIdx + val a = c.onClassifier.getExampleArray(ci) + val a0 = a(0).asInstanceOf[Array[Int]] + var a1 = a(1).asInstanceOf[Array[Double]] + val lab = myY.labels(labelCount) + labelCount=labelCount+1 + if (!lab.equals("true")) { + a1 = Array.fill[Double](a1.length)(0) + } + //val fv = new FeatureVectorBuffer(a0, a1) + fvLocal.addFeature(a0, a1) } - val fv = new FeatureVectorBuffer(a0, a1) - fv.addFeature(a0, a1) + fv.addFeature(fvLocal, previousSize) } + fv.toFeatureVector() } + } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index a4bc476d..c771c966 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -3,20 +3,23 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.SLProblem +import edu.illinois.cs.cogcomp.sl.util.Lexiconer import scala.reflect.ClassTag /** Created by Parisa on 12/4/15. */ object SL_IOManager { + val lexm: Lexiconer = new Lexiconer() def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): SLProblem = { var sp: SLProblem = new SLProblem() val allHeads = dm.getNodeWithType[HEAD].getAllInstances allHeads.foreach(x => { - // val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava - val ins = new Saul_SL_Instance(list,x) - //ins.apply(list,x) - val outs = new Saul_SL_Label_java_Structure(list.asInstanceOf, x) + // val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava + val ins = new Saul_SL_Instance(list, x) + ins.apply + val outs = new Saul_SL_Label_Structure(list, x) + outs.apply sp.addExample(ins, outs) }) sp diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java new file mode 100755 index 00000000..19419a17 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java @@ -0,0 +1,48 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model; + +import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; +import org.apache.commons.lang3.ArrayUtils; + +import java.util.ArrayList; +import java.util.List; + + +public class SUtils { + /** + * A static method for smartly adding features to the LexManager, and creating a FeatureVector + * at the same time. + * + * @param feats + * @return + */ + public static FeatureVectorBuffer makeFeatures(List feats) { + ArrayList idxList = new ArrayList(); + ArrayList valList = new ArrayList(); + + for (String feat : feats) { + + if (!SL_IOManager.lexm().containFeature(feat)) { + System.out.println("Flag of preview: "+ SL_IOManager.lexm().getNumOfFeature()); + System.out.println("before Flag of feature set: "+ SL_IOManager.lexm().isAllowNewFeatures()+"\n"); + if(SL_IOManager.lexm().isAllowNewFeatures()) + //Todo see the error of the following line + // RunnerPLPL.lexm().previewFeature(feat); + System.out.println("After preview flag: "+SL_IOManager.lexm().getNumOfFeature()); + System.out.println("Flag of after feature set: "+ SL_IOManager.lexm().isAllowNewFeatures()+"\n"); + SL_IOManager.lexm().addFeature(feat); + } + if (SL_IOManager.lexm().containFeature(feat)) { + + int fid = SL_IOManager.lexm().getFeatureId(feat); + idxList.add(fid); + valList.add(1.); + } + } + + int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); + double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); + //Todo check waht is going on in the next two lines + return new FeatureVectorBuffer(idx, val); + } + +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 1fa80c48..d062af6b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -5,38 +5,41 @@ import edu.illinois.cs.cogcomp.sl.util.WeightVector /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[_, HEAD] extends AbstractInferenceSolver { +class Saul_SL_Inference[HEAD <: AnyRef] extends AbstractInferenceSolver { override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_java_Instance[_, HEAD]] - var myStruct: Saul_SL_Label_java_Structure[_, HEAD] = ??? - for (i <- 0 until myIns.factorClassifiers.size()) { - - myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) + val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] + var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList,myIns.head) + for (i <- 0 until myIns.factorClassifiers.size) { + val c = myIns.factorClassifiers(i) + val candis: Seq[_] = c.getCandidates(myIns.head) + candis.foreach(x => + myStruct.labels += myIns.factorClassifiers(i).classifier.discreteValue(x)) } myStruct } - override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { + override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { //TODO check var l: Float = 0 - val myGold = gold.asInstanceOf[Saul_SL_Label_java_Structure[_, HEAD]] - val myPred = pred.asInstanceOf[Saul_SL_Label_java_Structure[_, HEAD]] - for (i <- 0 until myGold.labels.size()) { - l = l + myGold.labels.get(i).equals(myPred.labels.get(i)).asInstanceOf[Float] + val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[HEAD]] + val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[HEAD]] + for (i <- 0 until myGold.labels.size) { + l = l + myGold.labels(i).equals(myPred.labels(i)).asInstanceOf[Float] } l } override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_java_Instance[HEAD, _]] - var myStruct: Saul_SL_Label_java_Structure[HEAD, _] = ??? - for (i <- 0 until myIns.factorClassifiers.size()) { - - myStruct.labels.add(myIns.factorClassifiers.get(i).onClassifier.discreteValue(myIns.inputFeatures.get(i))) - + val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] + var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList,myIns.head) + for (i <- 0 until myIns.factorClassifiers.size) { + val c = myIns.factorClassifiers(i) + val candis: Seq[_] = c.getCandidates(myIns.head) + candis.foreach(x => + myStruct.labels += myIns.factorClassifiers(i).classifier.discreteValue(x)) } myStruct } - + //Todo add loss to the objective before calling inference } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index e98a43c4..09f10a75 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -1,33 +1,43 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IInstance +import edu.illinois.cs.cogcomp.sl.util.IFeatureVector -import scala.collection.JavaConversions._ -import scala.reflect.ClassTag +import scala.collection.mutable.ListBuffer /** Created by Parisa on 12/10/15. + * Here we only make the lbjava lexicons for each onClassifier + * (i.e. the base classifier of each constraint classifier) based on the features of IInstances */ -case class Saul_SL_Instance[T <: List[ConstrainedClassifier[_,HEAD]],HEAD<:AnyRef](l:T,x:HEAD) extends IInstance { +case class Saul_SL_Instance[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEAD]], x: HEAD) extends IInstance { - val inputFeatures = List() // List - var factorClassifiers: List[ConstrainedClassifier[_,HEAD]] = List() //List + // val inputFeatures:ListBuffer[Array[Object]]= ListBuffer() // List + var factorClassifiers: ListBuffer[ConstrainedClassifier[_, HEAD]] = ListBuffer() + //List + var fv: IFeatureVector = null; + val head: HEAD = x + def apply = { + l.foreach { + (c: ConstrainedClassifier[_, HEAD]) => + //val oracle: Classifier = c.onClassifier.getLabeler() + val cands: Seq[_] = c.getCandidates(x) + for (ci <- cands) { + // c.classifier.discreteValue(ci) //prediction result + // oracle.discreteValue(ci) // true lable + // return a Feature values and indexs + val t = c.onClassifier.getExampleArray(ci, true) + // val l: java.util.List[String]= c.onClassifier.getCurrentLexicon.getMap.keys.map(x=> x.toString).toList + // inputFeatures.add(t) - def apply(implicit headTag: ClassTag[HEAD]) - = { - for (c: ConstrainedClassifier[_,HEAD] <- l) { - val oracle: Classifier = c.onClassifier.getLabeler() - val cands: Seq[_] = c.getCandidates(x) - for (ci <- cands) { - c.classifier.discreteValue(ci) //prediction result - oracle.discreteValue(ci) // true lable - // return a Feature values and indexs - inputFeatures.add(c.onClassifier.getExampleArray(ci)) - factorClassifiers.add(c) - }// yield inputFeatures - // val a0 = a(0).asInstanceOf[Array[Int]] + // print("") + // fv = SUtils.makeFeatures(l).toFeatureVector(); + + } // yield inputFeatures + // val a0 = a(0).asInstanceOf[Array[Int]] + factorClassifiers += (c) //TODO probably we need to remove this, it seems to be redundant // val a1 = a(1).asInstanceOf[Array[Double]] + } } -}} +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala index ffd85398..a6ba26bd 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -1,20 +1,29 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IStructure import scala.collection.JavaConversions._ +import scala.collection.mutable.ListBuffer + /** Created by Parisa on 12/10/15. */ -class Saul_SL_Label_Structure[T <: AnyRef, HEAD <: AnyRef] extends IStructure { +class Saul_SL_Label_Structure[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEAD]], x: HEAD) extends IStructure { - var labels: List[String] = null + var labels: ListBuffer[String] = ListBuffer() - def Saul_SL_Label_java_Structure(l: List[ConstrainedClassifier[T, HEAD]], obj: HEAD) { + def apply { - l.foreach((c: ConstrainedClassifier[T, HEAD]) => { - labels.add(c.onClassifier.discreteValue()) - }) + l.foreach { (c: ConstrainedClassifier[_, HEAD]) => + { + val oracle: Classifier = c.onClassifier.getLabeler() + val candis: Seq[_] = c.getCandidates(x) + candis.foreach { + ci => + labels.add(oracle.discreteValue(ci)) + } + } + } } -} - +} \ No newline at end of file diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java index fa664b6a..cd8f2e41 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java @@ -14,7 +14,7 @@ public class Saul_SL_Label_java_Structure<_,HEAD> implements IStructure { ArrayList labels; - public Saul_SL_Label_java_Structure(ArrayList> l, _ x){ + public Saul_SL_Label_java_Structure(ArrayList> l, HEAD x){ for (ConstrainedClassifier c : l){ labels.add(c.onClassifier().discreteValue(x)); diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala index d470d88b..e7f7ab75 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala @@ -4,7 +4,7 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawToken, ConllRelation } import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers.{locationClassifier, personClassifier, orgClassifier} +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers.{ locationClassifier, personClassifier, orgClassifier } import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstraints._ object EntityRelationConstrainedClassifiers { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/IndependentModels.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/IndependentModels.scala index 15c91a5f..1692b76f 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/IndependentModels.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/IndependentModels.scala @@ -5,6 +5,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRela object IndependentModels extends App { EntityRelationDataModel.populateWithConll() + personClassifier.learn(iter) val iter = 5 println("Person Classifier Evaluation") println("=================================") diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala index e267687c..30e7c10c 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala @@ -33,12 +33,12 @@ object Runner { cr = null - lexm.setAllowNewFeatures(false) + lexm.setAllowNewFeatures(true) val sp: SLProblem = new SLProblem sp.instanceList = sclist sp.goldStructureList = outlist val para: SLParameters = new SLParameters - para.TOTAL_NUMBER_FEATURE = lexm.getNumOfFeature + // para.TOTAL_NUMBER_FEATURE = lexm.getNumOfFeature para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false val model: SLModel = new SLModel From 2c9ce2131bb6b2385f915b15d97306bed55db7c2 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 25 Mar 2016 14:45:36 -0500 Subject: [PATCH 036/118] format --- .../saul/classifier/SL_model/SL_FeatureGenerator.scala | 10 +++++----- .../saul/classifier/SL_model/Saul_SL_Inference.scala | 4 ++-- .../EntityRelationConstraints.Scala | 3 +-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 4ecb310a..eb517d4f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -11,20 +11,20 @@ class SL_FeatureGenerator[HEAD <: AnyRef] extends AbstractFeatureGenerator { val myX = x.asInstanceOf[Saul_SL_Instance[HEAD]] val myY = y.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val fv = new FeatureVectorBuffer() - var labelCount=0 + var labelCount = 0 for (i <- 0 until myX.factorClassifiers.size) { val c = myX.factorClassifiers(i) val candis: Seq[_] = c.getCandidates(myX.head) val fvLocal = new FeatureVectorBuffer() - var previousSize=0 - previousSize=0 + var previousSize = 0 + previousSize = 0 for (ci <- candis) { - previousSize= fvLocal.toFeatureVector().getMaxIdx + previousSize = fvLocal.toFeatureVector().getMaxIdx val a = c.onClassifier.getExampleArray(ci) val a0 = a(0).asInstanceOf[Array[Int]] var a1 = a(1).asInstanceOf[Array[Double]] val lab = myY.labels(labelCount) - labelCount=labelCount+1 + labelCount = labelCount + 1 if (!lab.equals("true")) { a1 = Array.fill[Double](a1.length)(0) } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index d062af6b..87e31db3 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -9,7 +9,7 @@ class Saul_SL_Inference[HEAD <: AnyRef] extends AbstractInferenceSolver { override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList,myIns.head) + var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList, myIns.head) for (i <- 0 until myIns.factorClassifiers.size) { val c = myIns.factorClassifiers(i) val candis: Seq[_] = c.getCandidates(myIns.head) @@ -32,7 +32,7 @@ class Saul_SL_Inference[HEAD <: AnyRef] extends AbstractInferenceSolver { override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList,myIns.head) + var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList, myIns.head) for (i <- 0 until myIns.factorClassifiers.size) { val c = myIns.factorClassifiers(i) val candis: Seq[_] = c.getCandidates(myIns.head) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala index 2e483af9..ed60283f 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstraints.Scala @@ -5,7 +5,6 @@ import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers._ - object EntityRelationConstraints { val relationArgumentConstraints = ConstrainedClassifier.constraint[ConllRelation] { @@ -18,7 +17,7 @@ object EntityRelationConstraints { val liveInConstraint = ConstrainedClassifier.constraint[ConllRelation] { x: ConllRelation => { - (( livesInClassifier on x) isTrue) ==> ( + ((livesInClassifier on x) isTrue) ==> ( ((personClassifier on x.e1) isTrue) and ((locationClassifier on x.e2) isTrue) ) From 2556b816747f5e8efd542977623ed8f5db61734b Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 25 Mar 2016 15:08:08 -0500 Subject: [PATCH 037/118] -removed java/lbjava files --- .../SL_SVM/iJLIS2/mYjava/EntityFeatures.java | 58 - .../iJLIS2/mYjava/JointER$subjectto.java | 88 -- .../SL_SVM/iJLIS2/mYjava/JointER.java | 36 - .../SL_SVM/iJLIS2/mYjava/LocClassifier.ex | Bin 17618 -> 0 bytes .../SL_SVM/iJLIS2/mYjava/LocClassifier.java | 1216 ---------------- .../iJLIS2/mYjava/LocClassifier.test.ex | Bin 17618 -> 0 bytes .../iJLIS2/mYjava/OrganizationClassifier.ex | Bin 17129 -> 0 bytes .../iJLIS2/mYjava/OrganizationClassifier.java | 1216 ---------------- .../mYjava/OrganizationClassifier.test.ex | Bin 17129 -> 0 bytes .../iJLIS2/mYjava/OrganizationWorkFor.java | 87 -- .../SL_SVM/iJLIS2/mYjava/PersonClassifier.ex | Bin 17506 -> 0 bytes .../iJLIS2/mYjava/PersonClassifier.java | 1215 ---------------- .../iJLIS2/mYjava/PersonClassifier.test.ex | Bin 17506 -> 0 bytes .../SL_SVM/iJLIS2/mYjava/PersonWorkFor.java | 89 -- .../iJLIS2/mYjava/RelArgsClassifier.java | 87 -- .../iJLIS2/mYjava/RelationFeatures.java | 61 - .../SL_SVM/iJLIS2/mYjava/locLabel.java | 87 -- .../SL_SVM/iJLIS2/mYjava/orgLabel.java | 83 -- .../SL_SVM/iJLIS2/mYjava/personLabel.java | 86 -- .../SL_SVM/iJLIS2/mYjava/workLabel.java | 83 -- .../iJLIS2/mYjava/work_forClassifier.ex | Bin 9506 -> 0 bytes .../iJLIS2/mYjava/work_forClassifier.java | 1217 ----------------- .../iJLIS2/mYjava/work_forClassifier.test.ex | Bin 9506 -> 0 bytes .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 3 +- 24 files changed, 1 insertion(+), 5711 deletions(-) delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.test.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.ex delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.test.ex diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java deleted file mode 100755 index beb77b3e..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/EntityFeatures.java +++ /dev/null @@ -1,58 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294555507DCB29CC29A47B4D4C292D2A4D26D07ECFCBC9C90A4C2F09CFCE4DC35821D450B1D558A6582E4DCB2E455821DB00FF0650B258292A2D45B658A5000617B321944000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - - -public class EntityFeatures extends Classifier -{ - public EntityFeatures() - { - containingPackage = ""; - name = "EntityFeatures"; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete%"; } - - public FeatureVector classify(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'EntityFeatures(ConllRawToken)' defined on line 9 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRawToken t = (ConllRawToken) __example; - - FeatureVector __result; - __result = new FeatureVector(); - String __id; - String __value; - - __id = "" + (t.POS); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - return __result; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'EntityFeatures(ConllRawToken)' defined on line 9 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "EntityFeatures".hashCode(); } - public boolean equals(Object o) { return o instanceof EntityFeatures; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java deleted file mode 100755 index 66519718..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER$subjectto.java +++ /dev/null @@ -1,88 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FAC7029EA14A25C5A94959A9C52529FA1EC9F979393149A939852999F97A052A9A05DA0E0109A545C9F971E9F549DE69F54A10413DF815070FF2A4F4CCBCCA20BA348495B24D200172979CDF5000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - -public class JointER$subjectto extends ParameterizedConstraint -{ - private static final PersonWorkFor __PersonWorkFor = new PersonWorkFor(); - private static final OrganizationWorkFor __OrganizationWorkFor = new OrganizationWorkFor(); - - public JointER$subjectto() { super("JointER$subjectto"); } - - public String getInputType() { return "ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 29 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = __PersonWorkFor.discreteValue(t).equals("true"); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = __OrganizationWorkFor.discreteValue(t).equals("true"); - else LBJ2$constraint$result$0 = false; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'JointER$subjectto(ConllRelation)' defined on line 29 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "JointER$subjectto".hashCode(); } - public boolean equals(Object o) { return o instanceof JointER$subjectto; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 29 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = __PersonWorkFor.makeConstraint(t); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = __OrganizationWorkFor.makeConstraint(t); - LBJ2$constraint$result$0 = new FirstOrderConjunction(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java deleted file mode 100755 index 6d125cfc..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/JointER.java +++ /dev/null @@ -1,36 +0,0 @@ -// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000D6DC13E0280401641EBACF5EEE91C2981588581C31C2034898BCC4239120A48BBBA426747F2F53F85A72329690592B8F9B6C049A341A2937D49393BA0C1BE18819F46FDC316388AD8923FB9AB6E501A91F0DED7C4B4880CCCE3CE65EDEE5EF771E70799C4B1EBAAE334C88DE309EC8F214C8000000 - -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.JointER$subjectto; - - -public class JointER extends ILPInference -{ - public static ConllRelation findHead(ConllRelation t) - { - return t; - } - - - public JointER() { } - public JointER(ConllRelation head) - { - super(head, new GurobiHook()); - constraint = new JointER$subjectto().makeConstraint(head); - } - - public String getHeadType() { return "ConllRelation"; } - public String[] getHeadFinderTypes() - { - return new String[]{ "ConllRelation" }; - } - - public Normalizer getNormalizer(Learner c) - { - return new Softmax(); - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.ex deleted file mode 100755 index 8f3e067c766ae6d5460ecdbfc25a336cf3831047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17618 zcmYhDdmz*O`~UCimRiMKk;>`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTzvwL#06ajMn`Ze=1*5>D}%srWh1Xg(lKMYrOfaU;_iMe|A{=kze-kEbhMHXb5>Z zDrPk5(PA5?k%iBUe6%Kc<7v)Q0pSq8UvOh>7mC`auT3jw?6*5;Ku*TOe!|?gDRt9d zKH5{({`mN<#>ZK_PxzMK?u$-=O?6(Irz8M{wU>X@OG5eZLL%Jt)V(pZFZpN-$DG`1`5&;3wLClD@U3FPR3MpSV)u^%UV zLSVxhJtl-ma2=O};Px!?c#PL?6A`COAo_YydjsyS;cLOke!F8Bo$YOX(?yKm`z^cw zzBBR4(z66v-xwH}Ge;MLOmd{aqMGXsl;UtEcV$gFLDths{9+feXvAoS)p7K+xckbW zyEtTM|GTg#gDZO0O-A|S3WrxGTTxJ4o4fKUO>nixp+k{kcr|R%wh7wkZ|nB-#guO)hs}ZC3tRA(Ykg^9d!e6*^LKzAtH1;C9S524u2uD^E zeZs^t)S8Phj`080$C{CawBt>k84Ab44~mHaN_B)@?sX@J#dWjaDpF+R%Z9+#jCixw z4UfNNdoHX}_(~Z*f}2$x{QJS3O;3ahX3|l)R^St@L`+7B@=RS1fPKCKDri2 z;0z5J{KV$=3+|nu_uOV_hTxT(JP`&k_`%o`cfaJ5M}bOA`D|t?fuvoL-YaU-TUDiU z(bHb-wnfZKq*Bw8)Ou~TP59s%RW3mjCmC0E~Rj&;0H5LX48O6V1?JO}*IV8PwS#Z=utMLL85$dk=EO=?N}H zOBLHYR^kxGN_dffUiAfJgXrMl@g7swJqcKeIt!cwE=?cXm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uT z5v_{%gD23Ce8Ux53gU@uXouybei^TuqP1|&4fwYJ@RA!h+Uw0sfrYY*%9We84-{K( z^QX+D+p5vy3%WiEr+Zay8gRqFDV5q~Kb?H8I8ah|78%?9TR9+*we2E&^6HRO=u|*M z7;$PD$;dj!NK3bv$-JYY1ObwYjN!Tbs7s`^M|)OjXHMK%dXv?s@?)Y`EeQi}oVb$( zoND(W4v6MkeIsme4Ozm{=bKFctLlC82DRrPIU|JsH{#D|8 zdG+sqGv}7w^{P+bT06t0e2U%nKDpxKQ_tAXDch$FT!HiwxR>f%`1QRXfUDbY?*-PV ztAmu^12_82&;0cG#v;*qQ-Na%=LK`OdGFA^Sr>f%vhu0oqL|CSE~#XvO|E-aGJC&p z|K;;pUxD*?ccyYZ>!@X$a)VEG^~uut*V-pXeScZKd~(>O>(P~ZySGfTTnZeEubz17 zXXr!ETQ{ck1XgW*otO0cVzI?p_u^L~R>w{Ew&|^W4csH#U%K~hqTbJE_ukmTkhdZ3cdzW_sTWr&2OjEbX)%TYUzr?pc zM8eg6{hs!@Zl_xdA3eNMC2A1lJKv}sbff}sXLoNMRq zY~6M5t=BK{)v5CqJ$>?D!(jFCx+4*nO{}|4@h-kMYra~$cJ;xXTlz9K%WnLBVvDgk zFfu=V*>+!bZEI6IuoeR@Gq@5NdC+Gy_X6O=`*)N7?`{6)2Y9n{?0v9HGRTF2VaZ8$ oh5&CyCJ_e2K_tj>po2(I0rXgs0B=?{kOU(TngZ!|pkWLQ0O#kO6#xJL diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java deleted file mode 100755 index fc361990..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.java +++ /dev/null @@ -1,1216 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09DCA44C040148F55A9C9CD3894CF9D3DAE146DD50120A44F4E54A776A73913399E1ABB36411FDDD0EEB287D28AF8FAAC705724640D0BBD6445D07C04276B5E4136B83FB0F0490C650737E01905214467D0E1822C4A12570BB461CEB6F48639092C1587484433CF10AEBE7B784A689C15B48E71E6155FC325530B8F77C1BA6836C0993757F86859B357A47C29B851CAB601E9297589385F0FC91549EEE3840B32FF442E82B907AFE398D223D2E2B3E61AE2F26306D70734225D528BA27DB18F10325BDFF3AF561ADD7A90A3382C70D1E534E26909BB5E80D7C9C2F4607957D049CFF203A95FC0166100000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - - -public class LocClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = LocClassifier.class.getResource("LocClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate LocClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = LocClassifier.class.getResource("LocClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate LocClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (LocClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/LocClassifier.test.ex"); } - public static boolean isTraining; - public static LocClassifier instance; - - public static LocClassifier getInstance() - { - loadInstance(); - return instance; - } - - private LocClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "LocClassifier"; - setEncoding(null); - setLabeler(new locLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public LocClassifier() - { - super("LocClassifier"); - isClone = true; - } - - public LocClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public LocClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(LocClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(LocClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(LocClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "LocClassifier"; - setLabeler(new locLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'LocClassifier(ConllRawToken)' defined on line 48 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: LocClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - LocClassifier classifier = new LocClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "LocClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof LocClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/LocClassifier.test.ex deleted file mode 100755 index 8f3e067c766ae6d5460ecdbfc25a336cf3831047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17618 zcmYhDdmz*O`~UCimRiMKk;>`5?{fY)L=?t~TXGt6T9%=ZQzgeaPAR!VlueG?95=_g zG3Qeh?u{(wER*A!(=ekk{NDHXub+ST2k+VIbzRTv`Fvb#EROvu_REPACw?J6HZ}R> z|N9UIzP2fk=SB1XEDp2z{#>#l zaTzvwL#06ajMn`Ze=1*5>D}%srWh1Xg(lKMYrOfaU;_iMe|A{=kze-kEbhMHXb5>Z zDrPk5(PA5?k%iBUe6%Kc<7v)Q0pSq8UvOh>7mC`auT3jw?6*5;Ku*TOe!|?gDRt9d zKH5{({`mN<#>ZK_PxzMK?u$-=O?6(Irz8M{wU>X@OG5eZLL%Jt)V(pZFZpN-$DG`1`5&;3wLClD@U3FPR3MpSV)u^%UV zLSVxhJtl-ma2=O};Px!?c#PL?6A`COAo_YydjsyS;cLOke!F8Bo$YOX(?yKm`z^cw zzBBR4(z66v-xwH}Ge;MLOmd{aqMGXsl;UtEcV$gFLDths{9+feXvAoS)p7K+xckbW zyEtTM|GTg#gDZO0O-A|S3WrxGTTxJ4o4fKUO>nixp+k{kcr|R%wh7wkZ|nB-#guO)hs}ZC3tRA(Ykg^9d!e6*^LKzAtH1;C9S524u2uD^E zeZs^t)S8Phj`080$C{CawBt>k84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(I0rXgs0B=?{kOU(TngZ!|pkWLQ0O#kO6#xJL diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.ex deleted file mode 100755 index 108e5ef0ed31dac675ed95d4361fd5e0421c530b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17129 zcmYg%dpOhm|9^GoPAYCilCnE)<&em33Ck*>@4feWKA(@%)9&_f`{njXN=okeUxOQD9eeqoOx){sRUpD6R zAo$1#n|20fiuOH$L#JVl!TkK-n(-RJ?k;ol*w@1L#dTr+Me4dz z+EVOm`)G~b;fZ@1NakhGUcs%F z#3A>;Es>i#`_cABpGGQklg`ka=^Z;OQ5unC_%*S%L=M@#ye@<*^xEDC?n-=x;aIlv zZkB{VEZ>{XO{R-(=-MQ1MgEDa0H1F>jzZFZJq%h-_ikij7Sn1j$CPDaUj&;q5Ffpe zv^9V}t`C>98i8o(<``uUDoLe-cdCB0(BCZ$zmvn|P)t`#s^*jfM1eT@6Db^vL%NRX zuLcj&^8^PJ<^-$8aHO*8m-wnZCEw@m6Uy8}T9ly7?u|1C3yhKA?waog8oFN%+|y(p z1hiJv!P<|clxaSLPB_P8ACWTel^3+^qaFDp{X=GbX(pJOHv=+3UQ5{Czt?IQD%OQ40cQ4!gIsTk}Hr#&!G?@-Zz2=49e)Tf*pUqrw z`>G%76!Nd9a2*BIU zmnCKVZRIHg{oRJVos&!m`t9D^b7z&9ce}%$?S$jBu)65os`qwr z%;9(Hr`wCQ?P5#UCgI!NEChW_LvcRFt5mcSI*)YB%M1&M#B2W$2>v+Sh(PC`Hw#ne zD>yT z%yL`xc<7jislSM9P%c?hBZdqu7&<;uBG~$juDdOg8)%yjGuJHx64C{^kC4m~@e{tUF&6}-4kerpa+H=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z8lxHj_-7Bc^t#7JZ*1V>}cgfW4Cn>g0fcv-4Ea zw%Y~&K!?nfi7C+^ieXHaF#(SxT&{YxQaRy9B{c@VdU?5;+%?j=r~~(`KE|+Tb<@Xw z$S&;^hex{)h3Y!icHR%ZwhT(1TvfJ5B5)mB`n25+~+@& zyW9&m(`H&GCJl*U9<#rtdmlg+Zo`{06Nkrq5N@omcXcd8QE8?z1$cS?#sZPu_DcOa z)at{{EA|zTX?c!ewu>Qhz5U^~JvdlV4kAmVnAH&98!L0BwA);{g6>e}jGxm6y!%r}iiN_`mW=g&L$3_L)RS0P|%B#>hcb?Tp5k ze6YI`S2HS>3Xu2wTHRDhw9SQu-4Kb^A-hn!+Xp27-%^^pv@)F-7?zx5X9)0SWD;RO hoKJx)2Rfeu6+lm`2=HcQ14%Ffp(&7_2Q-X<0RSK0;`jgn diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java deleted file mode 100755 index ca3de424..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.java +++ /dev/null @@ -1,1216 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09BCE43C04C054F75CACA8E2862C3ABA2C20596524AA4545851B14EEC8B9C099AD32BD1AC34CFB311DF506B75AB747EED89C282931C64B54E4F58E9487191DC2DE319E9D24837ED2E1F95A7260F90CDC9346245601D67D8B3AC03852E6169CE9CF37548E38291CE55E00C4748F30437DFAF0C6E8C186B48174E65577270AAB71D8F6878A7D2937A225AEB747CA3C9A33D02A5AA90CCA1059183A1C139770F4505D8EEED941B5A8F84A18A8BA0F7F94C6499D2E838E61A99E5CC1CBB41A7623B138BA9EC6E0F30E46EBAF74FB2A4BCF075C0E055C46DFB4A25D81A4B3E116B91CBC0E079D4304C1F71093AD0A51F6100000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - - -public class OrganizationClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate OrganizationClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = OrganizationClassifier.class.getResource("OrganizationClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate OrganizationClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (OrganizationClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/OrganizationClassifier.test.ex"); } - public static boolean isTraining; - public static OrganizationClassifier instance; - - public static OrganizationClassifier getInstance() - { - loadInstance(); - return instance; - } - - private OrganizationClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "OrganizationClassifier"; - setEncoding(null); - setLabeler(new orgLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public OrganizationClassifier() - { - super("OrganizationClassifier"); - isClone = true; - } - - public OrganizationClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public OrganizationClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(OrganizationClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(OrganizationClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(OrganizationClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "OrganizationClassifier"; - setLabeler(new orgLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationClassifier(ConllRawToken)' defined on line 72 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: OrganizationClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - OrganizationClassifier classifier = new OrganizationClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "OrganizationClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof OrganizationClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationClassifier.test.ex deleted file mode 100755 index 108e5ef0ed31dac675ed95d4361fd5e0421c530b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17129 zcmYg%dpOhm|9^GoPAYCilCnE)<&em33Ck*>@4feWKA(@%)9&_f`{njXN=okeUxOQD9eeqoOx){sRUpD6R zAo$1#n|20fiuOH$L#JVl!TkK-n(-RJ?k;ol*w@1L#dTr+Me4dz z+EVOm`)G~b;fZ@1NakhGUcs%F z#3A>;Es>i#`_cABpGGQklg`ka=^Z;OQ5unC_%*S%L=M@#ye@<*^xEDC?n-=x;aIlv zZkB{VEZ>{XO{R-(=-MQ1MgEDa0H1F>jzZFZJq%h-_ikij7Sn1j$CPDaUj&;q5Ffpe zv^9V}t`C>98i8o(<``uUDoLe-cdCB0(BCZ$zmvn|P)t`#s^*jfM1eT@6Db^vL%NRX zuLcj&^8^PJ<^-$8aHO*8m-wnZCEw@m6Uy8}T9ly7?u|1C3yhKA?waog8oFN%+|y(p z1hiJv!P<|clxaSLPB_P8ACWTel^3+^qaFDp{X=GbX(pJOHv=+3UQ5{Czt?IQD%OQ40cQ4!gIsTk}Hr#&!G?@-Zz2=49e)Tf*pUqrw z`>G%76!Nd9a2*BIU zmnCKVZRIHg{oRJVos&!m`t9D^b7z&9ce}%$?S$jBu)65os`qwr z%;9(Hr`wCQ?P5#UCgI!NEChW_LvcRFt5mcSI*)YB%M1&M#B2W$2>v+Sh(PC`Hw#ne zD>yT z%yL`xc<7jislSM9P%c?hBZdqu7&<;uBG~$juDdOg8)%yjGuJHx64C{^kC4m~@e{tUF&6}-4kerpa+H=&IqI=Gc ziw_L&Q};Xc63Hrg>6xde=YTUvA$^6)Dw{#Icvf@A{k7%9rUTUP_vxe4F0mKR;V@xl z{m<+leM`&`Z!xF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+%?j=r~~(`KE|+Tb<@Xw z$S&;^hex{)h3Y!icHR%ZwhT(1TvfJ5B5)mB`n25+~+@& zyW9&m(`H&GCJl*U9<#rtdmlg+Zo`{06Nkrq5N@omcXcd8QE8?z1$cS?#sZPu_DcOa z)at{{EA|zTX?c!ewu>Qhz5U^~JvdlV4kAmVnAH&98!L0BwA);{g6>e}jGxm6y!%r}iiN_`mW=g&L$3_L)RS0P|%B#>hcb?Tp5k ze6YI`S2HS>3Xu2wTHRDhw9SQu-4Kb^A-hn!+Xp27-%^^pv@)F-7?zx5X9)0SWD;RO hoKJx)2Rfeu6+lm`2=HcQ14%Ffp(&7_2Q-X<0RSK0;`jgn diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java deleted file mode 100755 index 7aab0f71..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/OrganizationWorkFor.java +++ /dev/null @@ -1,87 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FF2A4F4CCBCCAA4C29CCCFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC10B0A24986A245B249305A2E3D2FB8C93721B8B8333D2335B843082E6565A052545A9AA06B67826E02B22DB45328BA3B658A500087F6B885A7000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -public class OrganizationWorkFor extends ParameterizedConstraint -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - private static final OrganizationClassifier __OrganizationClassifier = new OrganizationClassifier(); - - public OrganizationWorkFor() { super("OrganizationWorkFor"); } - - public String getInputType() { return "ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = ("" + (__OrganizationClassifier.discreteValue(t.e2))).equals("" + (true)); - else LBJ2$constraint$result$0 = true; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "OrganizationWorkFor".hashCode(); } - public boolean equals(Object o) { return o instanceof OrganizationWorkFor; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'OrganizationWorkFor(ConllRelation)' defined on line 20 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__OrganizationClassifier, t.e2), "" + (true)); - LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.ex deleted file mode 100755 index d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wbq`~EzB|NQ*r;g5Ok{k~q;^*mir4Ty(?+q=m5ixcS6mNmvN|TQ?APW&Ep4$&rXPO8B8PjEIZ>* zF#bBekk#TH^6C}x2%`!T7s6d|p^2aVwg2~7>bL8oBmJK?b4rp_qT*lqTMwltTtM>5 zI?%Tm58h^Imu}{Cm`w-p-=-P~MI#~Yad&r(lZ&IgpSSQV6r5R&dvacmY39S{c>Z0; z`Z$yW^?6voX5=)3Jhf@Hcp>TI>`9qwdm%%^9%rm86l=Y9KIw`YmA};RymAmo)s~wY zf6I40)*8d|X0dGkqT-aMOCqu}9FpZSdeV^{YgSu{xo|ZR@bRV79Si__xbGWbOvu$AF}tY3N0JfAgO zJ|#V=^)07+`i$UW00OCF_9~$9SkA;U%wws9i>v>gICuNIL>Ygb@1N_7XU|b+A5WmP zzw^~x5x7ZJT*)GT3rS-1ZOWxjp<`ymb#DFO z<6=l0H`wgJq1V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PT0@_aICGD>2pE% zXjFVL+6og=_~+eb&NDPAG4O#ZIBWdCtoC5g6o3ZPi1Z!n<-#?3{$Sv&4^}K~h|=&1 z=y@|K+3<6TASWoWSp3UDTM-!2}sf7u>d9I&)7y{Sux6Xv%SGFD-YN}<5SLyv+_e0!fCRFv9J>H)T`&bBkTpt>`SHfO(L>wC zlU6gZ$AX=8oAqP5$Q5p?YO?1+NkU+bU2KIr4bdfp4>F?J!3P6nKp2Ld_4<5FDRA{cD>iveIt>1qGh`k zq-DU`GqN2>J;6^MNc}?pySSJs8-dIdSHlhlhKChRbQy^x1>bB+)izyvhsP++4!<7a zi5v@;M;p%{62poH7;$C)dl`;*i!#zVgA~*RB*1a?<|=wGmQI}bEL`f@v`Ml3J=hdj zsbpHKu2MLGUt8 zU#`HB?Y^+UAXxG-c5`Jt=`clQzlk&v+#V6B>r|3dPiA%H2Go(k+4dj|f~ zX^vqPi3;ZN6$e&HFrBZ*4qS$7ET?;v{)I;vt;XO1^p%|JmGirvuTP;9?w>>lXnb&t5DX&zG5?$4!;`Nzi8@~c;HIJYJpdKPXM>ipW5ni%yl<#Yy8(= z0l+OJTvPXDe3#mF^-n<6nU@Fc7H_?DEc6|45NW2f>-k_{Ox}x}TD5rg`7qYUpZ*xQ zZO^$Mv*h{RO21zo+HYIAgO|=11un$&`aAhe^o_OWrZ2j>cDwOYW#BmiS@C~mYHmHT zo7=11sb1OUdo8#0^UZULbuT{MS*v#FBfnX*WI&rf1~Msa&z(X*$k1ExA0n0 z>b&PX=PlQ`2J!WKtiCk=ec0!StINF~-fXq>%>NS~;LXlauicdO$eDp*$w_vG0B=Sn i5eCG;Ajoo{gF#RM^q7zUZ&o&t1S1fd0%>s<5Dx%*;z&IJ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java deleted file mode 100755 index d796fc48..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.java +++ /dev/null @@ -1,1215 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09DCE43C04C048F55CAC98E1862CF4F45830A2DA48459041831714667DD469C6CBB2BD12024CBB3BA6F518BE86664FDC8F0AE48C80E984431F622AA68340293BD42E81B5C9F52D04C06B08B93788482C09F86DD3EB35489430770B56B06FDB324B94841E0296406A91E8D1DC5FBD30BA12B3A690D79AEAAEE3D845F094CF70E85FE35C8127AC5FD3A16DEE4995AB429BA50CAA109431B7589385F0FC91549EEE3940B32F50AD156394CF3726B203D269537B0DC2F26D06D7073039A611EA69BA53CF2819ADEEF19F2B0D6FBC40D9145E38E0FA127554C4D59324F172BC391C563D001BFF30A3599ED9C6100000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - -public class PersonClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = PersonClassifier.class.getResource("PersonClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate PersonClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = PersonClassifier.class.getResource("PersonClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate PersonClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (PersonClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/PersonClassifier.test.ex"); } - public static boolean isTraining; - public static PersonClassifier instance; - - public static PersonClassifier getInstance() - { - loadInstance(); - return instance; - } - - private PersonClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "PersonClassifier"; - setEncoding(null); - setLabeler(new personLabel()); - setExtractor(new EntityFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public PersonClassifier() - { - super("PersonClassifier"); - isClone = true; - } - - public PersonClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public PersonClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(PersonClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(PersonClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(PersonClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "PersonClassifier"; - setLabeler(new personLabel()); - setExtractor(new EntityFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRawToken || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof ConllRawToken || __example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRawToken[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonClassifier(ConllRawToken)' defined on line 24 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: PersonClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - PersonClassifier classifier = new PersonClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "PersonClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof PersonClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonClassifier.test.ex deleted file mode 100755 index d73b0e6e724c3909d32f7d9af4a9f3449eaebfb1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17506 zcmYg%dpy(q`+p}LB<_k3aaYc6he*O$awBuvFw0p7CW@Gu;}oGAQEVa1`821Ta+nc? z%wgqx8aXcK!!Wbq`~EzB|NQ*r;g5Ok{k~q;^*mir4Ty(?+q=m5ixcS6mNmvN|TQ?APW&Ep4$&rXPO8B8PjEIZ>* zF#bBekk#TH^6C}x2%`!T7s6d|p^2aVwg2~7>bL8oBmJK?b4rp_qT*lqTMwltTtM>5 zI?%Tm58h^Imu}{Cm`w-p-=-P~MI#~Yad&r(lZ&IgpSSQV6r5R&dvacmY39S{c>Z0; z`Z$yW^?6voX5=)3Jhf@Hcp>TI>`9qwdm%%^9%rm86l=Y9KIw`YmA};RymAmo)s~wY zf6I40)*8d|X0dGkqT-aMOCqu}9FpZSdeV^{YgSu{xo|ZR@bRV79Si__xbGWbOvu$AF}tY3N0JfAgO zJ|#V=^)07+`i$UW00OCF_9~$9SkA;U%wws9i>v>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_SVM/iJLIS2/mYjava/PersonWorkFor.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java deleted file mode 100755 index 833e7e1d..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/PersonWorkFor.java +++ /dev/null @@ -1,89 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2158084D2A2ECFCB0FCF2AC67BCF22D07ECFCBC9C90A4DC94C29CCCFC35821D458A658270A45C7A5E71937E426171766A566A6196005CDACA41A4A8A43551C6DE0A6202B4BE5AA12C5585B24D20001EE1FFCBE6000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - - -public class PersonWorkFor extends ParameterizedConstraint -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - private static final PersonClassifier __PersonClassifier = new PersonClassifier(); - - public PersonWorkFor() { super("PersonWorkFor"); } - - public String getInputType() { return "ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = ("" + (__work_forClassifier.discreteValue(t))).equals("" + (true)); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = ("" + (__PersonClassifier.discreteValue(t.e1))).equals("" + (true)); - else LBJ2$constraint$result$0 = true; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "PersonWorkFor".hashCode(); } - public boolean equals(Object o) { return o instanceof PersonWorkFor; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 15 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__PersonClassifier, t.e1), "" + (true)); - LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java deleted file mode 100755 index 6474b82a..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelArgsClassifier.java +++ /dev/null @@ -1,87 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// discrete RelArgsClassifier(ConllRelation r) <- JointER(work_forClassifier) - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.JointER; - - -public class RelArgsClassifier extends Classifier -{ - private static final work_forClassifier __work_forClassifier = new work_forClassifier(); - - public RelArgsClassifier() - { - containingPackage = ""; - name = "RelArgsClassifier"; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "*", "*" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation head = JointER.findHead((ConllRelation) __example); - JointER inference = (JointER) InferenceManager.get("JointER", head); - - if (inference == null) - { - inference = new JointER(head); - InferenceManager.put(inference); - } - - String result = null; - - try { result = inference.valueOf(__work_forClassifier, __example); } - catch (Exception e) - { - System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); - e.printStackTrace(); - System.exit(1); - } - - return result; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'RelArgsClassifier(ConllRelation)' defined on line 35 of ER_Joint.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "RelArgsClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof RelArgsClassifier; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java deleted file mode 100755 index 45417550..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/RelationFeatures.java +++ /dev/null @@ -1,61 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294555580A4DC94C29CCCFC37B4D4C292D2A4D26D07ECFCBC9C1898A24986A28D8EA245B2417A6E517AA2868258BF709B81A5929286B2498E51BE1054B4242F3B1827A79A939A9B04E936986498E597E715A876A81A6AE51464152617AA6A285924941596AA53A892644C99264896A4D200F49FA670EB000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - - -public class RelationFeatures extends Classifier -{ - public RelationFeatures() - { - containingPackage = ""; - name = "RelationFeatures"; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete%"; } - - public FeatureVector classify(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - FeatureVector __result; - __result = new FeatureVector(); - String __id; - String __value; - - __id = "" + (("WORD1:" + t.s.sentTokens.elementAt(t.wordId1).phrase)); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - __id = "" + (("WORD2:" + t.s.sentTokens.elementAt(t.wordId2).phrase)); - __value = "true"; - __result.addFeature(new DiscretePrimitiveStringFeature(this.containingPackage, this.name, __id, __value, valueIndexOf(__value), (short) 0)); - return __result; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'RelationFeatures(ConllRelation)' defined on line 12 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "RelationFeatures".hashCode(); } - public boolean equals(Object o) { return o instanceof RelationFeatures; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java deleted file mode 100755 index e814c5b9..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/locLabel.java +++ /dev/null @@ -1,87 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000D4C814A02C034144FA234659086F20577D590D594F2013E825CFCF8629254A4EEEDA222EA606ED3ED56CC121B0713D7C066703AFEDA0981A7F76A8DE2AA8C9CFC34CB3515C1E0B7C281FA0B5A1A691E5F063C7E4E52F1F6A131B3F996F3137E6317B6F4941FD7A5450523FF18EF84D512E3B0EA6D8000000 - - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - - -public class locLabel extends Classifier -{ - public locLabel() - { - containingPackage = ""; - name = "locLabel"; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Loc", "nLoc" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'locLabel' defined on line 40 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Loc")) - { - return "Loc"; - } - else - { - return "nLoc"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'locLabel(ConllRawToken)' defined on line 40 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "locLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof locLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java deleted file mode 100755 index 91d43852..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/orgLabel.java +++ /dev/null @@ -1,83 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000B49CC2E4E2A4D294DA652FF2A4752D1505AC301D5BA09F549EE398949A93A1EC9F97939314985E129F9D9A97A052A9A063ABA05DA09996A0A152A79A97521259509AA79A585A98935CE99E979F549AEC985C9AA1063C435318A0186679615E920454CA51A6512537A83519522F0E235B00A5116788D8000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - - -public class orgLabel extends Classifier -{ - public orgLabel() - { - containingPackage = ""; - name = "orgLabel"; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Org", "nOrg" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'orgLabel' defined on line 64 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Org")) - { - return "Org"; - } - else - { - return "nOrg"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'orgLabel(ConllRawToken)' defined on line 64 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "orgLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof orgLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java deleted file mode 100755 index b8565130..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/personLabel.java +++ /dev/null @@ -1,86 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000D4D814A02C030154FA234659086F20677D590E244A71886FB25C1662E42544A4EEE64712EAEF2ED7EDB96EC71341CAEE8037B1272F9DA4906955E01FC06F38A03F92E374DB348A40AE7B4B2DC752F5A38491F590D1E1B44ECBFB98A168891EB9F439B01AD3B9F71312FFD448D1552076CF309F19AF60EBF78FC019000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; - - -public class personLabel extends Classifier -{ - public personLabel() - { - containingPackage = ""; - name = "personLabel"; - } - - public String getInputType() { return "ConllRawToken"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Per", "nPer" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRawToken)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'personLabel' defined on line 17 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRawToken t = (ConllRawToken) __example; - - if (t.entType.equalsIgnoreCase("Peop")) - { - return "Per"; - } - else - { - return "nPer"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRawToken[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'personLabel(ConllRawToken)' defined on line 17 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "personLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof personLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java deleted file mode 100755 index 627ca5a7..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/workLabel.java +++ /dev/null @@ -1,83 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000D4D81BA020130144F756945908EDF0867702806522C592157490E2BBAB9C12274EFDD0A6175DC0CB16ED525E3B1A062738ADD3BB50939F5BA4FA69BB8720BFE55897F0E8529A05904BE52D449EA4EB4760E3CBF18E0FC1327EDED44D0D7CC0FFD7C3E64DC580D6DDC23A909FFB82CA8A218336E8466CAE70B03EE714B9000000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - - -public class workLabel extends Classifier -{ - public workLabel() - { - containingPackage = ""; - name = "workLabel"; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete"; } - - private static String[] __allowableValues = new String[]{ "Works", "nWorks" }; - public static String[] getAllowableValues() { return __allowableValues; } - public String[] allowableValues() { return __allowableValues; } - - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public Feature featureValue(Object __example) - { - String result = discreteValue(__example); - return new DiscretePrimitiveStringFeature(containingPackage, name, "", result, valueIndexOf(result), (short) allowableValues().length); - } - - public String discreteValue(Object __example) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - - String __cachedValue = _discreteValue(__example); - - if (valueIndexOf(__cachedValue) == -1) - { - System.err.println("Classifier 'workLabel' defined on line 88 of LALModel.lbj produced '" + __cachedValue + "' as a feature value, which is not allowable."); - System.exit(1); - } - - return __cachedValue; - } - - private String _discreteValue(Object __example) - { - ConllRelation t = (ConllRelation) __example; - - if (t.relType.equalsIgnoreCase("Work_For")) - { - return "Works"; - } - else - { - return "nWorks"; - } - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'workLabel(ConllRelation)' defined on line 88 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "workLabel".hashCode(); } - public boolean equals(Object o) { return o instanceof workLabel; } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.ex deleted file mode 100755 index 56277adf24ea6a01e937e2ecbdabe4c4d36648e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0r5VC%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r{v@(Kj{ceRqHJKOaN%_!pnOl(Xkg&6UIrIsVG%5sdk^r`TcEO&mS5^3Ror zuJ?BPyxF+1a%1mx1B)eg*LR)#_3&TsESGQm;m)()*9E0qKeE*5>hi>$g+VKJueYjo z1Wsminx!wbTr6*O{fvh=dZ6@$m?$n%zuXZc9_J^0>F7uahNK7%s!xYO9r;x^g79Rx zC~u*|=pStn4VDfy&!n#|yCw6QUEu@@E6D-CG<-ZDq^Ca$#%RAi^E9iC;5{ZV(nbwl ze!5*D8dNkH#u%=Je?RlIdQmjS z9UMpG_>=@9CcxguahpNx5{3U-PROfA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Y6nQA+}`-%Oh)OS|km6xwSgpJhs3FK#1IjeSfGX%N< zyf`4IcN3pFwE25S4@uxocE;n3k!ZuxDkJ_ye;GYn^e* zo!9-ze|;K*H22BNP`ZU!$b$Nc3!0WQo zJx#lWvVLirF4c3$=2M!^X~)pgPqPWDQFDHJ@&xyDhOgI+3*pJW%Wqsjp90<9Ypdt7 zL3lQvEC>+>Ed6T?b!$!e*fC*1Ou6}d%x9O<55~$Zo|%EM9q|E%$OCicfT^^~&xRuv zCdT!}dvx!75@i6}+tImrmmWtY$2D}&Sd!#9aKuRYvR_aU!=zvCU}dj97aNQ2rV8Mk zqMrEE75&mlP2JcY;R8YHFzm*adY($Up-g-U>E4EE9|eC0MqBK-%Su;jz7TYpj)m6a zb9_5a;4n*gtolsmz zZ#F4^s^Ujf@#oUi@0&~c9juzwGhcUv!6RBCo7b=g0$1BVxBw(`#7S$13WLPs)><6# zCt+b~AQvAX{d0%Eur9R5d|0x$fYE`LEA3*zkOJB3FUKdPUDDNIxxqvh$vwAByBt5&o~}37f~MTVO$UT^GxvA+31!)m zZ0mTa+s~GqmiM7#Js2c?gN6yx8vA&KDHP_BSM$}4rjaR65|F+|ndZ0U*{{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java deleted file mode 100755 index c71f0dce..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.java +++ /dev/null @@ -1,1217 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava;// Modifying this comment will cause the next execution of LBJava to overwrite this file. -// F1B88000000000000000DA09BCE43C04C054F75CACA8E2842C3ABA2D50A24755904167C6A239172912391F8C6780212EFD915BAEF10BDBA3EBA37DECB6B24640B0BC87CE85671055D77E94EA67C13486820A97E806B2878B6804821F40F10F3820CCAE36F07186F4863B092472C3144A50E4D15FDF1F244348E275715D0C315532B8BF4C9AA30780E317AAE90D0BA6FC7356BC29A851CAB601E93A3585CBD00F690549E1FB840B727FA42D25231E8F3767BCA3D06ED3B58ABCB9D08D0EBD1329A6E0EEAC5F60E71C84D6FFF8E7948E9FBD40B5382C97D1FDD7A2278CD7E748EBCC696638BDAB60A8EEF01CF3394BE6100000 - -import edu.illinois.cs.cogcomp.lbjava.classify.*; -import edu.illinois.cs.cogcomp.lbjava.io.IOUtilities; -import edu.illinois.cs.cogcomp.lbjava.learn.*; -import edu.illinois.cs.cogcomp.lbjava.parse.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - - - -public class work_forClassifier extends SparseAveragedPerceptron -{ - private static java.net.URL _lcFilePath; - private static java.net.URL _lexFilePath; - - static - { - _lcFilePath = work_forClassifier.class.getResource("work_forClassifier.lc"); - - if (_lcFilePath == null) - { - System.err.println("ERROR: Can't locate work_forClassifier.lc in the class path."); - System.exit(1); - } - - _lexFilePath = work_forClassifier.class.getResource("work_forClassifier.lex"); - - if (_lexFilePath == null) - { - System.err.println("ERROR: Can't locate work_forClassifier.lex in the class path."); - System.exit(1); - } - } - - private static void loadInstance() - { - if (instance == null) - { - instance = (work_forClassifier) Learner.readLearner(_lcFilePath); - instance.readLexiconOnDemand(_lexFilePath); - } - } - - public static Parser getParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.ex"); } - public static Parser getTestParser() { return new edu.illinois.cs.cogcomp.lbjava.parse.ArrayFileParser("/home/kordjam/Downloads/mylbjtest/src/main/java/work_forClassifier.test.ex"); } - public static boolean isTraining; - public static work_forClassifier instance; - - public static work_forClassifier getInstance() - { - loadInstance(); - return instance; - } - - private work_forClassifier(boolean b) - { - super(new Parameters()); - containingPackage = ""; - name = "work_forClassifier"; - setEncoding(null); - setLabeler(new workLabel()); - setExtractor(new RelationFeatures()); - isClone = false; - } - - public static TestingMetric getTestingMetric() { return null; } - - - private boolean isClone; - - public void unclone() { isClone = false; } - - public work_forClassifier() - { - super("work_forClassifier"); - isClone = true; - } - - public work_forClassifier(String modelPath, String lexiconPath) { this(new Parameters(), modelPath, lexiconPath); } - - public work_forClassifier(Parameters p, String modelPath, String lexiconPath) { - super(p); - try { - lcFilePath = new java.net.URL("file:" + modelPath); - lexFilePath = new java.net.URL("file:" + lexiconPath); - } - catch (Exception e) { - System.err.println("ERROR: Can't create model or lexicon URL: " + e); - e.printStackTrace(); - System.exit(1); - } - - if (new java.io.File(modelPath).exists()) { - readModel(lcFilePath); - readLexiconOnDemand(lexFilePath); - } - else if (IOUtilities.existsInClasspath(work_forClassifier.class, modelPath)) { - readModel(IOUtilities.loadFromClasspath(work_forClassifier.class, modelPath)); - readLexiconOnDemand(IOUtilities.loadFromClasspath(work_forClassifier.class, lexiconPath)); - } - else { - containingPackage = ""; - name = "work_forClassifier"; - setLabeler(new workLabel()); - setExtractor(new RelationFeatures()); - } - - isClone = false; - } - - public String getInputType() { return "ConllRelation"; } - public String getOutputType() { return "discrete"; } - - public void learn(Object example) - { - if (isClone) - { - if (!(example instanceof ConllRelation || example instanceof Object[])) - { - String type = example == null ? "null" : example.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(example); - return; - } - - if (example instanceof Object[]) - { - Object[] a = (Object[]) example; - if (a[0] instanceof int[]) - { - super.learn((int[]) a[0], (double[]) a[1], (int[]) a[2], (double[]) a[3]); - return; - } - } - - super.learn(example); - } - - public void learn(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - instance.learn(examples); - return; - } - - super.learn(examples); - } - - public Feature featureValue(Object __example) - { - if (isClone) - { - if (!(__example instanceof Object[])) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.featureValue(__example); - } - - if (__example instanceof Object[]) - { - Object[] a = (Object[]) __example; - if (a[0] instanceof int[]) - return super.featureValue((int[]) a[0], (double[]) a[1]); - } - - Feature __result; - __result = super.featureValue(__example); - return __result; - } - - public FeatureVector classify(Object __example) - { - return new FeatureVector(featureValue(__example)); - } - - public String discreteValue(Object __example) - { - return featureValue(__example).getStringValue(); - } - - public FeatureVector[] classify(Object[] examples) - { - if (isClone) - { - if (!(examples instanceof ConllRelation[] || examples instanceof Object[][])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'work_forClassifier(ConllRelation)' defined on line 95 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - loadInstance(); - return instance.classify(examples); - } - - FeatureVector[] result = super.classify(examples); - return result; - } - - public static void main(String[] args) - { - String testParserName = null; - String testFile = null; - Parser testParser = getTestParser(); - - try - { - if (!args[0].equals("null")) - testParserName = args[0]; - if (args.length > 1) testFile = args[1]; - - if (testParserName == null && testParser == null) - { - System.err.println("The \"testFrom\" clause was not used in the learning classifier expression that"); - System.err.println("generated this classifier, so a parser and input file must be specified.\n"); - throw new Exception(); - } - } - catch (Exception e) - { - System.err.println("usage: work_forClassifier \\"); - System.err.println(" [ [ ...]]\n"); - System.err.println(" * must be the fully qualified class name of a Parser, or \"null\""); - System.err.println(" to use the default as specified by the \"testFrom\" clause."); - System.err.println(" * is the relative or absolute path of a file, or \"null\" to"); - System.err.println(" use the parser arguments specified by the \"testFrom\" clause. can also be non-\"null\" when is \"null\" (when the parser"); - System.err.println(" specified by the \"testFrom\" clause has a single string argument"); - System.err.println(" constructor) to use an alternate file."); - System.err.println(" * A is a label (or prediction) that should not count towards"); - System.err.println(" overall precision and recall assessments."); - System.exit(1); - } - - if (testParserName == null && testFile != null && !testFile.equals("null")) - testParserName = testParser.getClass().getName(); - if (testParserName != null) - testParser = edu.illinois.cs.cogcomp.lbjava.util.ClassUtils.getParser(testParserName, new Class[]{ String.class }, new String[]{ testFile }); - work_forClassifier classifier = new work_forClassifier(); - TestDiscrete tester = new TestDiscrete(); - for (int i = 2; i < args.length; ++i) - tester.addNull(args[i]); - TestDiscrete.testDiscrete(tester, classifier, classifier.getLabeler(), testParser, true, 0); - } - - public int hashCode() { return "work_forClassifier".hashCode(); } - public boolean equals(Object o) { return o instanceof work_forClassifier; } - - public void write(java.io.PrintStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void write(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream a0) - { - if (isClone) - { - loadInstance(); - instance.write(a0); - return; - } - - super.write(a0); - } - - public void initialize(int a0, int a1) - { - if (isClone) - { - loadInstance(); - instance.initialize(a0, a1); - return; - } - - super.initialize(a0, a1); - } - - public void read(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.read(a0); - return; - } - - super.read(a0); - } - - public void learn(int[] a0, double[] a1, int[] a2, double[] a3) - { - if (isClone) - { - loadInstance(); - instance.learn(a0, a1, a2, a3); - return; - } - - super.learn(a0, a1, a2, a3); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters getParameters() - { - if (isClone) - { - loadInstance(); - return instance.getParameters(); - } - - return super.getParameters(); - } - - public double score(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.score(a0, a1); - } - - return super.score(a0, a1); - } - - public void promote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.promote(a0, a1, a2); - return; - } - - super.promote(a0, a1, a2); - } - - public void demote(int[] a0, double[] a1, double a2) - { - if (isClone) - { - loadInstance(); - instance.demote(a0, a1, a2); - return; - } - - super.demote(a0, a1, a2); - } - - public void forget() - { - if (isClone) - { - loadInstance(); - instance.forget(); - return; - } - - super.forget(); - } - - public void setLearningRate(double a0) - { - if (isClone) - { - loadInstance(); - instance.setLearningRate(a0); - return; - } - - super.setLearningRate(a0); - } - - public double getLearningRate() - { - if (isClone) - { - loadInstance(); - return instance.getLearningRate(); - } - - return super.getLearningRate(); - } - - public void setThreshold(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThreshold(a0); - return; - } - - super.setThreshold(a0); - } - - public java.lang.String discreteValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0, a1); - } - - return super.discreteValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0, a1); - } - - return super.featureValue(a0, a1); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0, a1); - } - - return super.classify(a0, a1); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public double score(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.score(a0); - } - - return super.score(a0); - } - - public void setLabeler(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setLabeler(a0); - return; - } - - super.setLabeler(a0); - } - - public double getInitialWeight() - { - if (isClone) - { - loadInstance(); - return instance.getInitialWeight(); - } - - return super.getInitialWeight(); - } - - public void setInitialWeight(double a0) - { - if (isClone) - { - loadInstance(); - instance.setInitialWeight(a0); - return; - } - - super.setInitialWeight(a0); - } - - public double getThreshold() - { - if (isClone) - { - loadInstance(); - return instance.getThreshold(); - } - - return super.getThreshold(); - } - - public double getPositiveThickness() - { - if (isClone) - { - loadInstance(); - return instance.getPositiveThickness(); - } - - return super.getPositiveThickness(); - } - - public void setPositiveThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setPositiveThickness(a0); - return; - } - - super.setPositiveThickness(a0); - } - - public double getNegativeThickness() - { - if (isClone) - { - loadInstance(); - return instance.getNegativeThickness(); - } - - return super.getNegativeThickness(); - } - - public void setNegativeThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setNegativeThickness(a0); - return; - } - - super.setNegativeThickness(a0); - } - - public void setThickness(double a0) - { - if (isClone) - { - loadInstance(); - instance.setThickness(a0); - return; - } - - super.setThickness(a0); - } - - public boolean shouldPromote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldPromote(a0, a1, a2, a3); - } - - return super.shouldPromote(a0, a1, a2, a3); - } - - public double computeLearningRate(int[] a0, double[] a1, double a2, boolean a3) - { - if (isClone) - { - loadInstance(); - return instance.computeLearningRate(a0, a1, a2, a3); - } - - return super.computeLearningRate(a0, a1, a2, a3); - } - - public boolean shouldDemote(boolean a0, double a1, double a2, double a3) - { - if (isClone) - { - loadInstance(); - return instance.shouldDemote(a0, a1, a2, a3); - } - - return super.shouldDemote(a0, a1, a2, a3); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0, a1); - } - - return super.scores(a0, a1); - } - - public void write(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.write(a0, a1); - return; - } - - super.write(a0, a1); - } - - public void save() - { - if (isClone) - { - loadInstance(); - instance.save(); - return; - } - - super.save(); - } - - public void read(java.lang.String a0, java.lang.String a1) - { - if (isClone) - { - loadInstance(); - instance.read(a0, a1); - return; - } - - super.read(a0, a1); - } - - public double realValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0); - } - - return super.realValue(a0); - } - - public double realValue(int[] a0, double[] a1) - { - if (isClone) - { - loadInstance(); - return instance.realValue(a0, a1); - } - - return super.realValue(a0, a1); - } - - public java.lang.String discreteValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.discreteValue(a0); - } - - return super.discreteValue(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Feature featureValue(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.featureValue(a0); - } - - return super.featureValue(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public void learn(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - instance.learn(a0); - return; - } - - super.learn(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector[] classify(java.lang.Object[][] a0) - { - if (isClone) - { - loadInstance(); - return instance.classify(a0); - } - - return super.classify(a0); - } - - public void setParameters(edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters a0) - { - if (isClone) - { - loadInstance(); - instance.setParameters(a0); - return; - } - - super.setParameters(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Learner emptyClone() - { - if (isClone) - { - loadInstance(); - return instance.emptyClone(); - } - - return super.emptyClone(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet scores(edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector a0) - { - if (isClone) - { - loadInstance(); - return instance.scores(a0); - } - - return super.scores(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0); - } - - return super.getExampleArray(a0); - } - - public java.lang.Object[] getExampleArray(java.lang.Object a0, boolean a1) - { - if (isClone) - { - loadInstance(); - return instance.getExampleArray(a0, a1); - } - - return super.getExampleArray(a0, a1); - } - - public void readLexiconOnDemand(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public void readLexiconOnDemand(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexiconOnDemand(a0); - return; - } - - super.readLexiconOnDemand(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon demandLexicon() - { - if (isClone) - { - loadInstance(); - return instance.demandLexicon(); - } - - return super.demandLexicon(); - } - - public void setExtractor(edu.illinois.cs.cogcomp.lbjava.classify.Classifier a0) - { - if (isClone) - { - loadInstance(); - instance.setExtractor(a0); - return; - } - - super.setExtractor(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getLabeler() - { - if (isClone) - { - loadInstance(); - return instance.getLabeler(); - } - - return super.getLabeler(); - } - - public edu.illinois.cs.cogcomp.lbjava.classify.Classifier getExtractor() - { - if (isClone) - { - loadInstance(); - return instance.getExtractor(); - } - - return super.getExtractor(); - } - - public void setLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLexicon(a0); - return; - } - - super.setLexicon(a0); - } - - public void setEncoding(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setEncoding(a0); - return; - } - - super.setEncoding(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLexicon(); - } - - return super.getLexicon(); - } - - public void setLabelLexicon(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon a0) - { - if (isClone) - { - loadInstance(); - instance.setLabelLexicon(a0); - return; - } - - super.setLabelLexicon(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLabelLexicon() - { - if (isClone) - { - loadInstance(); - return instance.getLabelLexicon(); - } - - return super.getLabelLexicon(); - } - - public void setModelLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public void setModelLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setModelLocation(a0); - return; - } - - super.setModelLocation(a0); - } - - public java.net.URL getModelLocation() - { - if (isClone) - { - loadInstance(); - return instance.getModelLocation(); - } - - return super.getModelLocation(); - } - - public void setLexiconLocation(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public void setLexiconLocation(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.setLexiconLocation(a0); - return; - } - - super.setLexiconLocation(a0); - } - - public java.net.URL getLexiconLocation() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconLocation(); - } - - return super.getLexiconLocation(); - } - - public void countFeatures(edu.illinois.cs.cogcomp.lbjava.learn.Lexicon.CountPolicy a0) - { - if (isClone) - { - loadInstance(); - instance.countFeatures(a0); - return; - } - - super.countFeatures(a0); - } - - public edu.illinois.cs.cogcomp.lbjava.learn.Lexicon getLexiconDiscardCounts() - { - if (isClone) - { - loadInstance(); - return instance.getLexiconDiscardCounts(); - } - - return super.getLexiconDiscardCounts(); - } - - public void readLexicon(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void readLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readLexicon(a0); - return; - } - - super.readLexicon(a0); - } - - public void doneLearning() - { - if (isClone) - { - loadInstance(); - instance.doneLearning(); - return; - } - - super.doneLearning(); - } - - public void doneWithRound() - { - if (isClone) - { - loadInstance(); - instance.doneWithRound(); - return; - } - - super.doneWithRound(); - } - - public int getPrunedLexiconSize() - { - if (isClone) - { - loadInstance(); - return instance.getPrunedLexiconSize(); - } - - return super.getPrunedLexiconSize(); - } - - public void saveModel() - { - if (isClone) - { - loadInstance(); - instance.saveModel(); - return; - } - - super.saveModel(); - } - - public void saveLexicon() - { - if (isClone) - { - loadInstance(); - instance.saveLexicon(); - return; - } - - super.saveLexicon(); - } - - public void writeModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeModel(a0); - return; - } - - super.writeModel(a0); - } - - public void writeLexicon(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.writeLexicon(a0); - return; - } - - super.writeLexicon(a0); - } - - public void readModel(java.lang.String a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readModel(java.net.URL a0) - { - if (isClone) - { - loadInstance(); - instance.readModel(a0); - return; - } - - super.readModel(a0); - } - - public void readLabelLexicon(edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessInputStream a0) - { - if (isClone) - { - loadInstance(); - instance.readLabelLexicon(a0); - return; - } - - super.readLabelLexicon(a0); - } - - public static class Parameters extends SparseAveragedPerceptron.Parameters - { - public Parameters() - { - learningRate = 0.1; - thickness = 3.5; - } - } -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.test.ex b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/mYjava/work_forClassifier.test.ex deleted file mode 100755 index 56277adf24ea6a01e937e2ecbdabe4c4d36648e1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9506 zcmY*<3s@3q8}??p9w^B?r$J?{wdSI0r5VC%gU%u?`>hs-3)w6p{~u}Q`NA%nooKkoHk*Z=)+T{8nS?>o;t&;8!-{XFmZ z?^~*G@r{v@(Kj{ceRqHJKOaN%_!pnOl(Xkg&6UIrIsVG%5sdk^r`TcEO&mS5^3Ror zuJ?BPyxF+1a%1mx1B)eg*LR)#_3&TsESGQm;m)()*9E0qKeE*5>hi>$g+VKJueYjo z1Wsminx!wbTr6*O{fvh=dZ6@$m?$n%zuXZc9_J^0>F7uahNK7%s!xYO9r;x^g79Rx zC~u*|=pStn4VDfy&!n#|yCw6QUEu@@E6D-CG<-ZDq^Ca$#%RAi^E9iC;5{ZV(nbwl ze!5*D8dNkH#u%=Je?RlIdQmjS z9UMpG_>=@9CcxguahpNx5{3U-PROfA_gA16J;i8o$8q0HDWV&6<+(sw8~Jsw^xC6V zeK_DuVndrW>rqmsHe4UBqrex>jE(e?Lxr5vX~upY9jVfFE;LX0*qQ=5Dy@nJ4- zy^Z{~m%Kd6&=wG+W@+CTz_t{4MT6HtA$Ipz7$sDlNdC}E#zgVA$@ylGc$HdQHfQ93 zFq47gT=L2&!WQ{nZFwfK1|i$3t&O#V6u655+cZ2_0T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C*1Ou6}d%x9O<55~$Zo|%EM9q|E%$OCicfT^^~&xRuv zCdT!}dvx!75@i6}+tImrmmWtY$2D}&Sd!#9aKuRYvR_aU!=zvCU}dj97aNQ2rV8Mk zqMrEE75&mlP2JcY;R8YHFzm*adY($Up-g-U>E4EE9|eC0MqBK-%Su;jz7TYpj)m6a zb9_5a;4n*gtolsmz zZ#F4^s^Ujf@#oUi@0&~c9juzwGhcUv!6RBCo7b=g0$1BVxBw(`#7S$13WLPs)><6# zCt+b~AQvAX{d0%Eur9R5d|0x$fYE`LEA3*zkOJB3FUKdPUDDNIxxqvh$vwAByBt5&o~}37f~MTVO$UT^GxvA+31!)m zZ0mTa+s~GqmiM7#Js2c?gN6yx8vA&KDHP_BSM$}4rjaR65|F+|ndZ0U*{{i>Rrb?K z?5!RpwSrUZt(!|~0d%(t-FdUOntr^8%6Fc*7WuLzoD}`vr@!iW2*!V(q0!}@iGn}Z zqi-!;S@Mnlz9o7V-~7K9oBsFQ;)_lH|L6a{=H$Q6;M>I$OVICDbU(7#**E_OcW7-G diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 444cc77d..4364feae 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -4,11 +4,10 @@ import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstrainedClassifiers.perConstraintClassifier import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationDataModel -//import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.RewriteBasicModel.IndependentTraining._ - /** Created by Parisa on 12/8/15. */ object mySL_Saul_TestApp extends App { EntityRelationDataModel.populateWithConll() + JoinSLtrain(EntityRelationDataModel, List(perConstraintClassifier)) } From 537ccfb04c2f9f92b0353250f868c862d300cdd2 Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 28 Mar 2016 10:17:36 -0500 Subject: [PATCH 038/118] commented out the programs that use the lbjava generated classes as debendency. --- .../EntityRelationDataModel.scala | 2 +- .../SL_SVM/iJLIS/SUtils.java | 22 +- .../SL_SVM/iJLIS2/JointER$subjectto.java | 188 +-- .../SL_SVM/iJLIS2/JointER.java | 84 +- .../SL_SVM/iJLIS2/RunnerPL.scala | 224 ++-- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 1170 ++++++++--------- .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 4 +- 7 files changed, 847 insertions(+), 847 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala index 69adb35b..4291c9c0 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala @@ -112,7 +112,7 @@ object EntityRelationDataModel extends DataModel { } def populateWithConll() = { - val reader = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Token") + val reader = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04_small.corp", "Token") sentences.populate(reader.sentences) pairs.populate(reader.relations) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java index bdb6c1a5..86551b99 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.RunnerPL; +//import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.Runner; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; import org.apache.commons.lang3.ArrayUtils; @@ -22,19 +22,19 @@ public static FeatureVectorBuffer makeFeatures(List feats) { for (String feat : feats) { - if (!RunnerPL.lexm().containFeature(feat)) { - System.out.println("Flag of preview: "+ RunnerPL.lexm().getNumOfFeature()); - System.out.println("before Flag of feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); - if(RunnerPL.lexm().isAllowNewFeatures()) + if (!Runner.lexm().containFeature(feat)) { + System.out.println("Flag of preview: "+ Runner.lexm().getNumOfFeature()); + System.out.println("before Flag of feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); + if(Runner.lexm().isAllowNewFeatures()) //Todo see the error of the following line - // RunnerPLPL.lexm().previewFeature(feat); - System.out.println("After preview flag: "+RunnerPL.lexm().getNumOfFeature()); - System.out.println("Flag of after feature set: "+ RunnerPL.lexm().isAllowNewFeatures()+"\n"); - RunnerPL.lexm().addFeature(feat); + // RunnerPL.lexm().previewFeature(feat); + System.out.println("After preview flag: "+Runner.lexm().getNumOfFeature()); + System.out.println("Flag of after feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); + Runner.lexm().addFeature(feat); } - if (RunnerPL.lexm().containFeature(feat)) { + if (Runner.lexm().containFeature(feat)) { - int fid = RunnerPL.lexm().getFeatureId(feat); + int fid = Runner.lexm().getFeatureId(feat); idxList.add(fid); valList.add(1.); } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java index 456d0d6d..a3406dff 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java @@ -1,94 +1,94 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FAC7029EA14A25C5A94959A9C52529FA1EC9F979393149A939852999F97A052A9A05DA0E0109A545C9F971E9F549DE69F54A10413DF815070FF2A4F4CCBCCA20BA348495B24D200172979CDF5000000 - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - - -import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; -import edu.illinois.cs.cogcomp.lbjava.infer.*; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.OrganizationWorkFor; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.PersonWorkFor; - - -public class JointER$subjectto extends ParameterizedConstraint -{ - private static final PersonWorkFor __PersonWorkFor = new PersonWorkFor(); - private static final OrganizationWorkFor __OrganizationWorkFor = new OrganizationWorkFor(); - - public JointER$subjectto() { super("ml.wolfe.examples.parisa.iJLIS2.JointER$subjectto"); } - - public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } - - public String discreteValue(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 127 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - - { - boolean LBJ2$constraint$result$0; - { - boolean LBJ2$constraint$result$1; - LBJ2$constraint$result$1 = __PersonWorkFor.discreteValue(t).equals("true"); - if (LBJ2$constraint$result$1) - LBJ2$constraint$result$0 = __OrganizationWorkFor.discreteValue(t).equals("true"); - else LBJ2$constraint$result$0 = false; - } - if (!LBJ2$constraint$result$0) return "false"; - } - - return "true"; - } - - public FeatureVector[] classify(Object[] examples) - { - if (!(examples instanceof ConllRelation[])) - { - String type = examples == null ? "null" : examples.getClass().getName(); - System.err.println("Classifier 'JointER$subjectto(ConllRelation)' defined on line 127 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - return super.classify(examples); - } - - public int hashCode() { return "JointER$subjectto".hashCode(); } - public boolean equals(Object o) { return o instanceof JointER$subjectto; } - - public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 127 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - FirstOrderConstraint __result = new FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = __PersonWorkFor.makeConstraint(t); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = __OrganizationWorkFor.makeConstraint(t); - LBJ2$constraint$result$0 = new FirstOrderConjunction(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -} - +//// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +//// F1B88000000000000000B4ECFCB2E292A4CCCCB2150FAC7029EA14A25C5A94959A9C52529FA1EC9F979393149A939852999F97A052A9A05DA0E0109A545C9F971E9F549DE69F54A10413DF815070FF2A4F4CCBCCA20BA348495B24D200172979CDF5000000 +// +//package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; +// +// +//import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector; +//import edu.illinois.cs.cogcomp.lbjava.infer.*; +//import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +////import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.OrganizationWorkFor; +////import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.PersonWorkFor; +// +// +//public class JointER$subjectto extends ParameterizedConstraint +//{ +// private static final PersonWorkFor __PersonWorkFor = new PersonWorkFor(); +// private static final OrganizationWorkFor __OrganizationWorkFor = new OrganizationWorkFor(); +// +// public JointER$subjectto() { super("ml.wolfe.examples.parisa.iJLIS2.JointER$subjectto"); } +// +// public String getInputType() { return "ml.wolfe.examples.parisa.ConllRelation"; } +// +// public String discreteValue(Object __example) +// { +// if (!(__example instanceof ConllRelation)) +// { +// String type = __example == null ? "null" : __example.getClass().getName(); +// System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 127 of LALModel.lbj received '" + type + "' as input."); +// new Exception().printStackTrace(); +// System.exit(1); +// } +// +// ConllRelation t = (ConllRelation) __example; +// +// { +// boolean LBJ2$constraint$result$0; +// { +// boolean LBJ2$constraint$result$1; +// LBJ2$constraint$result$1 = __PersonWorkFor.discreteValue(t).equals("true"); +// if (LBJ2$constraint$result$1) +// LBJ2$constraint$result$0 = __OrganizationWorkFor.discreteValue(t).equals("true"); +// else LBJ2$constraint$result$0 = false; +// } +// if (!LBJ2$constraint$result$0) return "false"; +// } +// +// return "true"; +// } +// +// public FeatureVector[] classify(Object[] examples) +// { +// if (!(examples instanceof ConllRelation[])) +// { +// String type = examples == null ? "null" : examples.getClass().getName(); +// System.err.println("Classifier 'JointER$subjectto(ConllRelation)' defined on line 127 of LALModel.lbj received '" + type + "' as input."); +// new Exception().printStackTrace(); +// System.exit(1); +// } +// +// return super.classify(examples); +// } +// +// public int hashCode() { return "JointER$subjectto".hashCode(); } +// public boolean equals(Object o) { return o instanceof JointER$subjectto; } +// +// public FirstOrderConstraint makeConstraint(Object __example) +// { +// if (!(__example instanceof ConllRelation)) +// { +// String type = __example == null ? "null" : __example.getClass().getName(); +// System.err.println("Constraint 'JointER$subjectto(ConllRelation)' defined on line 127 of LALModel.lbj received '" + type + "' as input."); +// new Exception().printStackTrace(); +// System.exit(1); +// } +// +// ConllRelation t = (ConllRelation) __example; +// FirstOrderConstraint __result = new FirstOrderConstant(true); +// +// { +// FirstOrderConstraint LBJ2$constraint$result$0 = null; +// { +// FirstOrderConstraint LBJ2$constraint$result$1 = null; +// LBJ2$constraint$result$1 = __PersonWorkFor.makeConstraint(t); +// FirstOrderConstraint LBJ2$constraint$result$2 = null; +// LBJ2$constraint$result$2 = __OrganizationWorkFor.makeConstraint(t); +// LBJ2$constraint$result$0 = new FirstOrderConjunction(LBJ2$constraint$result$1, LBJ2$constraint$result$2); +// } +// __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); +// } +// +// return __result; +// } +//} +// diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java index 10cba718..67543346 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java @@ -1,42 +1,42 @@ -// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. -// F1B88000000000000000D6DC13E0280401641EBACF5EEE91C2981588581C31C2034898BCC4239120A48BBBA426747F2F53F85A72329690592B8F9B6C049A341A2937D49393BA0C1BE18819F46FDC316388AD8923FB9AB6E501A91F0DED7C4B4880CCCE3CE65EDEE5EF771E70799C4B1EBAAE334C88DE309EC8F214C8000000 -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -//import LBJ.infer.GurobiHook; -//import LBJ.infer.ILPInference; - - -import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; -import edu.illinois.cs.cogcomp.lbjava.infer.ILPInference; -import edu.illinois.cs.cogcomp.lbjava.learn.Learner; -import edu.illinois.cs.cogcomp.lbjava.learn.Normalizer; -import edu.illinois.cs.cogcomp.lbjava.learn.Softmax; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; - -public class JointER extends ILPInference -{ - public static ConllRelation findHead(ConllRelation t) - { - return t; - } - - - public JointER() { } - public JointER(ConllRelation head) - { - super(head, new GurobiHook()); - constraint = new JointER$subjectto().makeConstraint(head); - } - - public String getHeadType() { return "ml.wolfe.examples.parisa.ConllRelation"; } - public String[] getHeadFinderTypes() - { - return new String[]{ "ml.wolfe.examples.parisa.ConllRelation" }; - } - - public Normalizer getNormalizer(Learner c) - { - return new Softmax(); - } -} - +//// Modifying this comment will cause the next execution of LBJ2 to overwrite this file. +//// F1B88000000000000000D6DC13E0280401641EBACF5EEE91C2981588581C31C2034898BCC4239120A48BBBA426747F2F53F85A72329690592B8F9B6C049A341A2937D49393BA0C1BE18819F46FDC316388AD8923FB9AB6E501A91F0DED7C4B4880CCCE3CE65EDEE5EF771E70799C4B1EBAAE334C88DE309EC8F214C8000000 +//package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; +// +////import LBJ.infer.GurobiHook; +////import LBJ.infer.ILPInference; +// +// +//import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; +//import edu.illinois.cs.cogcomp.lbjava.infer.ILPInference; +//import edu.illinois.cs.cogcomp.lbjava.learn.Learner; +//import edu.illinois.cs.cogcomp.lbjava.learn.Normalizer; +//import edu.illinois.cs.cogcomp.lbjava.learn.Softmax; +//import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +// +//public class JointER extends ILPInference +//{ +// public static ConllRelation findHead(ConllRelation t) +// { +// return t; +// } +// +// +// public JointER() { } +// public JointER(ConllRelation head) +// { +// super(head, new GurobiHook()); +// constraint = new JointER$subjectto().makeConstraint(head); +// } +// +// public String getHeadType() { return "ml.wolfe.examples.parisa.ConllRelation"; } +// public String[] getHeadFinderTypes() +// { +// return new String[]{ "ml.wolfe.examples.parisa.ConllRelation" }; +// } +// +// public Normalizer getNormalizer(Learner c) +// { +// return new Softmax(); +// } +//} +// diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala index 32bba5f9..a4786021 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala @@ -1,112 +1,112 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 - -import java.util - -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew -import edu.illinois.cs.cogcomp.sl.core._ -import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory -import edu.illinois.cs.cogcomp.sl.util.{ Lexiconer, WeightVector } - -object RunnerPL { - - var lexm = new Lexiconer() - def trainSSVM(modelname: String, cr: Conll04_ReaderNew): Unit = { - - val model = new SLModel - val sp = ERIOManager.readXY(cr, 0, 10) - model.infSolver = new iERjavaInferencePL - val para = new SLParameters - para.C_FOR_STRUCTURE = 1 - para.CHECK_INFERENCE_OPT = false - - model.config = new util.HashMap(); - model.para = para - model.featureGenerator = new ERFeatureGenerator(lexm) - model.lm = lexm - model.lm.setAllowNewFeatures(true) - para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature - para.loadConfigFile("./config/DCD.config") - val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - - println("num?:" + (model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) - println("num?:" + model.lm.getNumOfFeature) - - model.wv = learner.train(sp) - model.saveModel(modelname); - } - - def testSequenceSSVM(model_name: String, cr: Conll04_ReaderNew) { - val model: SLModel = SLModel.loadModel(model_name) - val learned_wv: WeightVector = model.wv - val inference_proc: iERjavaInferencePL = model.infSolver.asInstanceOf[iERjavaInferencePL] - // cr=null - - val sp = ERIOManager.readXY(cr, 11, 20) - printTestACC(sp, inference_proc, learned_wv) - } - private def printTestACC(sp: SLProblem, s_finder: AbstractInferenceSolver, ssvm_wv: WeightVector) { - var tp: Double = 0 - var fp: Double = 0 - var tn: Double = 0 - var fn: Double = 0 - var total: Double = 0.0 - - var i: Int = 0 - while (i < sp.instanceList.size) { - val gold: ERiStructurePL = sp.goldStructureList.get(i).asInstanceOf[ERiStructurePL] - val prediction: ERiStructurePL = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructurePL] - System.out.println(prediction) - //{ - var j: Int = 0 - - // while (j < gold.nodeValues.size) { - // { - val tempGold = gold.Rlables.LinirizLabels() - val tempPred = prediction.Rlables.LinirizLabels() - while (j < tempGold.size) { - var k: Int = 0 - while (k < tempGold(j).size) { - val pred: Boolean = tempPred(j)(k) //prediction.nodeValues - val goldval: Boolean = tempGold(j)(k) //d.nodeValues - if (goldval == pred) { - if (pred == true) { - tp += 1.0 - } else { - tn += 1.0 - } - } else { - if (pred == false) { - fp += 1.0 - } else { - fn += 1.0 - } - } - total += 1.0 - k = k + 1 - } - j = j + 1 - } - i = i + 1 - - } - val precision: Double = tp / (tp + fp) - val recall: Double = tp / (tp + fn) - val F1: Double = 2 * precision * recall / (precision + recall) - println("=========================") - println(" P R F ") - // println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")) - println(precision, recall, F1) //String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)) - println("=========================") - println("Acc = " + (tp + tn) / total) - } - - def main(args: Array[String]) { - var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") - - val modelname: String = "mytest1.ssvm.model" - trainSSVM(modelname, cr) - System.out.println("\n=== NOW TESTING ===") - testSequenceSSVM(modelname, cr) - } - -} +//package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 +// +//import java.util +// +//import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew +//import edu.illinois.cs.cogcomp.sl.core._ +//import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory +//import edu.illinois.cs.cogcomp.sl.util.{ Lexiconer, WeightVector } +// +//object RunnerPL { +// +// var lexm = new Lexiconer() +// def trainSSVM(modelname: String, cr: Conll04_ReaderNew): Unit = { +// +// val model = new SLModel +// val sp = ERIOManager.readXY(cr, 0, 10) +// model.infSolver = new iERjavaInferencePL +// val para = new SLParameters +// para.C_FOR_STRUCTURE = 1 +// para.CHECK_INFERENCE_OPT = false +// +// model.config = new util.HashMap(); +// model.para = para +// model.featureGenerator = new ERFeatureGenerator(lexm) +// model.lm = lexm +// model.lm.setAllowNewFeatures(true) +// para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature +// para.loadConfigFile("./config/DCD.config") +// val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); +// +// println("num?:" + (model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) +// println("num?:" + model.lm.getNumOfFeature) +// +// model.wv = learner.train(sp) +// model.saveModel(modelname); +// } +// +// def testSequenceSSVM(model_name: String, cr: Conll04_ReaderNew) { +// val model: SLModel = SLModel.loadModel(model_name) +// val learned_wv: WeightVector = model.wv +// val inference_proc: iERjavaInferencePL = model.infSolver.asInstanceOf[iERjavaInferencePL] +// // cr=null +// +// val sp = ERIOManager.readXY(cr, 11, 20) +// printTestACC(sp, inference_proc, learned_wv) +// } +// private def printTestACC(sp: SLProblem, s_finder: AbstractInferenceSolver, ssvm_wv: WeightVector) { +// var tp: Double = 0 +// var fp: Double = 0 +// var tn: Double = 0 +// var fn: Double = 0 +// var total: Double = 0.0 +// +// var i: Int = 0 +// while (i < sp.instanceList.size) { +// val gold: ERiStructurePL = sp.goldStructureList.get(i).asInstanceOf[ERiStructurePL] +// val prediction: ERiStructurePL = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructurePL] +// System.out.println(prediction) +// //{ +// var j: Int = 0 +// +// // while (j < gold.nodeValues.size) { +// // { +// val tempGold = gold.Rlables.LinirizLabels() +// val tempPred = prediction.Rlables.LinirizLabels() +// while (j < tempGold.size) { +// var k: Int = 0 +// while (k < tempGold(j).size) { +// val pred: Boolean = tempPred(j)(k) //prediction.nodeValues +// val goldval: Boolean = tempGold(j)(k) //d.nodeValues +// if (goldval == pred) { +// if (pred == true) { +// tp += 1.0 +// } else { +// tn += 1.0 +// } +// } else { +// if (pred == false) { +// fp += 1.0 +// } else { +// fn += 1.0 +// } +// } +// total += 1.0 +// k = k + 1 +// } +// j = j + 1 +// } +// i = i + 1 +// +// } +// val precision: Double = tp / (tp + fp) +// val recall: Double = tp / (tp + fn) +// val F1: Double = 2 * precision * recall / (precision + recall) +// println("=========================") +// println(" P R F ") +// // println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")) +// println(precision, recall, F1) //String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)) +// println("=========================") +// println("Acc = " + (tp + tn) / total) +// } +// +// def main(args: Array[String]) { +// var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") +// +// val modelname: String = "mytest1.ssvm.model" +// trainSSVM(modelname, cr) +// System.out.println("\n=== NOW TESTING ===") +// testSequenceSSVM(modelname, cr) +// } +// +//} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java index eaab4400..fd380ea3 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java @@ -1,585 +1,585 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; - -import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; -import edu.illinois.cs.cogcomp.lbjava.infer.InferenceManager; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.work_forClassifier; -import edu.illinois.cs.cogcomp.sl.core.AbstractInferenceSolver; -import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; -import edu.illinois.cs.cogcomp.sl.util.WeightVector; -import gurobi.*; -import javafx.util.Pair; - -import java.util.Arrays; - -public class iERjavaInferencePL extends AbstractInferenceSolver { - - private static final long serialVersionUID = 1L; - - - public Pair getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { - - int blockSize= RunnerPL.lexm().getNumOfFeature(); - float[] globalWeight=wv.getWeightArray(); - float[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); - float[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); - float[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); - - WeightVector wvPer=new WeightVector(new WeightVector(WeightPer),1); - WeightVector wvOrg=new WeightVector(new WeightVector(WeightOrg),1); - WeightVector wvWF=new WeightVector(new WeightVector(WeightWF),1); - ERiStructurePL goldStruct = (ERiStructurePL) gold; - - Integer goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("peop")) ? 1 : 0; - Double coefLosper1= Double.valueOf((1-2*(goldL))); - goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("peop")) ? 1 : 0; - Double coefLosper2= Double.valueOf((1-2*(goldL))); - goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("org")) ? 1 : 0; - Double coefLosorg1= Double.valueOf((1-2*(goldL))); - goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("org")) ? 1 : 0; - Double coefLosorg2= Double.valueOf((1-2*(goldL))); - goldL= (((ERiStructurePL) gold).Rlables.RelLabel().toLowerCase().contains("work")) ? 1 : 0; - Double coefLosWF= Double.valueOf((1-2*(goldL))); - Labels temp=new Labels(); - - ERiStructurePL maxC = new ERiStructurePL(temp); - Double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosper1; - Double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosper2; - Double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosorg1; - Double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosorg2; - Double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv)+coefLosWF; - - try{ - GRBEnv env = new GRBEnv("mip1.log"); - GRBModel model = new GRBModel(env); - //create variables - GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); - GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); - GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); - GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); - GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); - // integrate the new variables - model.update(); - //Set objective maximize fn(x).per - GRBLinExpr expr= new GRBLinExpr(); - expr.addTerm(coefper1,per1); - expr.addTerm(coefper2,per2); - expr.addTerm(coeforg1,org1); - expr.addTerm(coeforg2,org2); - expr.addTerm(coefWF,WF); - model.setObjective(expr,GRB.MAXIMIZE); - //add constraints - expr=new GRBLinExpr(); - expr.addTerm(1,per1); - expr.addTerm(1,org1); - model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); - - expr=new GRBLinExpr(); - expr.addTerm(1,per2); - expr.addTerm(1,org2); - model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); - - - expr=new GRBLinExpr(); - expr.addTerm(-1,per1); - expr.addTerm(1,WF); - model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); - - expr=new GRBLinExpr(); - expr.addTerm(-1,org2); - expr.addTerm(1,WF); - model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); - - model.optimize(); - double x=per1.get(GRB.DoubleAttr.X); - //addBooleanVariabl(2.0); - - java.lang.String x1=(x>0.5)? "peop":"npeop"; - x=per2.get(GRB.DoubleAttr.X); - java.lang.String x2=(x>0.5)? "peop":"npeop"; - - if (x1.equals("npeop")){ - x=org1.get(GRB.DoubleAttr.X); - x1=(x>0.5)? "org":"norg";} - if (x2.equals("npeop")){ - x=org2.get(GRB.DoubleAttr.X); - x2=(x>0.5)? "org":"norg";} - - x=WF.get(GRB.DoubleAttr.X); - java.lang.String x3=(x>0.5)? "work_for":"nwf"; - - // x=org2.get(GRB.DoubleAttr.X); - maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; - model.dispose(); - env.dispose(); - - } - catch (GRBException e) - { - System.out.println("Error code: " + e.getErrorCode() + ". " + - e.getMessage()); - } - // Return structure with highest score+loss, and loss of this structure - return new Pair(maxC, ((double) getLoss( input, maxC, goldStruct))); - } - - @Override - public float getLoss(IInstance iInstance, IStructure iStructure, IStructure iStructure1) { - - float E1loss = 0; - float E2loss=0; - float Rloss=0; - ERiStructurePL hyp= ((ERiStructurePL) iStructure); - ERiStructurePL gold=((ERiStructurePL) iStructure1); - if (hyp.Rlables.E1Label().equals(gold.Rlables.E1Label())) - E1loss=0; - else - E1loss=1; - - if (hyp.Rlables.E2Label().equals(gold.Rlables.E2Label())) - E2loss=0; - else - E2loss=1; - - - if (hyp.Rlables.RelLabel().equals(gold.Rlables.RelLabel())) - Rloss=0; - else - Rloss=1; - return ((E1loss+E2loss+Rloss)/3); - } - /** - * This is for prediction. - */ - - - @Override - public IStructure getLossAugmentedBestStructure(WeightVector wv, IInstance input, IStructure iStructure) throws Exception { - - int blockSize=RunnerPL.lexm().getNumOfFeature(); - WeightVector globalWeight=new WeightVector(wv.getWeightArray()); - WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); - WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); - WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); - WeightVector wvPer=new WeightVector(WeightPer,1); - WeightVector wvOrg=new WeightVector(WeightOrg,1); - WeightVector wvWF=new WeightVector(WeightWF,1); - // ERqInstancePL qi = (ERqInstancePL) input; - // List options = getOptions(qi); - - // double max = Double.NEGATIVE_INFINITY; - //double score; - Labels temp=new Labels(); - ERiStructurePL maxC = new ERiStructurePL(temp); - - - double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); - double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); - double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); - double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); - double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv.toFeatureVector()); - //try - { - GurobiHook myGurobi=new GurobiHook(); - double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; - int[] vars=new int[coeff.length]; - for (int i = 0; i < coeff.length; i++) { - //System.out.println("adding: i : +" + coeff[i]); - vars[i]= myGurobi.addBooleanVariable(coeff[i]); - - } - - - // GRBEnv env = new GRBEnv("mip1.log"); - // GRBModel model = new GRBModel(env); model. - //create variables - // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); - // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); - // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); - // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); - // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); - - // integrate the new variables - // model.update(); - //Set objective maximize fn(x).per - // GRBLinExpr expr= new GRBLinExpr(); - - // expr.addTerm(coefper1,per1); - // expr.addTerm(coefper2,per2); - // expr.addTerm(coeforg1,org1); - //expr.addTerm(coeforg2,org1); - //expr.addTerm(coefWF,WF); - // model.setObjective(expr,GRB.MAXIMIZE); - // per(i)=> ~org(i) - // work-for(i,j)=>per(i)and org(j) - - //add constraints - double coeffc1[]={1,0,1,0,0}; - myGurobi.addLessThanConstraint(vars,coeffc1,1); - double coeffc2[]={0,1,0,1,0}; - myGurobi.addLessThanConstraint(vars,coeffc2,1); - double coeffc3[]={-1,0,0,0,1}; - myGurobi.addLessThanConstraint(vars,coeffc3,0); - double coeffc4[]={0,0,0,-1,1}; - myGurobi.addLessThanConstraint(vars,coeffc4,0); - - // expr=new GRBLinExpr(); - // expr.addTerm(1,per1); - // expr.addTerm(1,org1); - // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); - - //expr=new GRBLinExpr(); - //expr.addTerm(1,per2); - //expr.addTerm(1,org2); - //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); - - // expr=new GRBLinExpr(); - // expr.addTerm(-1,per1); - // expr.addTerm(1,WF); - // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); - - // expr=new GRBLinExpr(); - // expr.addTerm(-1,org2); - // expr.addTerm(1,WF); - // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); - - - // model.optimize(); - - myGurobi.setMaximize(true); - boolean solved = false; - try { - solved = myGurobi.solve(); - } catch (Exception e) { - e.printStackTrace(); - } - if (!solved) { - System.out.println("ILP solver failed"); - // System.exit(0); - } - - // read the solution - - // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); - java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; - // x=per2.get(GRB.DoubleAttr.X); - java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; - - if (x1.equals("npeop")){ - // x=org1.get(GRB.DoubleAttr.X); - x1=myGurobi.getBooleanValue(2)? "org":"norg";} - if (x2.equals("npeop")){ - // x=org2.get(GRB.DoubleAttr.X); - x2=myGurobi.getBooleanValue(3)? "org":"norg";} - // x=WF.get(GRB.DoubleAttr.X); - java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; - - // x=org2.get(GRB.DoubleAttr.X); - maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; - // model.dispose(); - // env.dispose(); - } - // catch (GRBException e) - // { - // System.out.println("Error code: " + e.getErrorCode() + ". " + - // e.getMessage()); - // } - return maxC; - } - - - - - - - public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) throws Exception { - int blockSize=RunnerPL.lexm().getNumOfFeature(); - WeightVector globalWeight=new WeightVector(wv.getWeightArray()); - WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); - WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); - WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 2 * blockSize, 3 * blockSize - 1)); - WeightVector wvPer=new WeightVector(WeightPer,1); - WeightVector wvOrg=new WeightVector(WeightOrg,1); - WeightVector wvWF=new WeightVector(WeightWF,1); - // ERqInstancePL qi = (ERqInstancePL) input; - // List options = getOptions(qi); - - // double max = Double.NEGATIVE_INFINITY; - //double score; - Labels temp=new Labels(); - ERiStructurePL maxC = new ERiStructurePL(temp); - - - float coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); - float coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); - float coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); - float coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); - float coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); - try{ - GRBEnv env = new GRBEnv("mip1.log"); - GRBModel model = new GRBModel(env); - //create variables - GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); - GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); - GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); - GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); - GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); - - // integrate the new variables - model.update(); - //Set objective maximize fn(x).per - GRBLinExpr expr= new GRBLinExpr(); - expr.addTerm(coefper1,per1); - expr.addTerm(coefper2,per2); - expr.addTerm(coeforg1,org1); - expr.addTerm(coeforg2,org1); - expr.addTerm(coefWF,WF); - model.setObjective(expr,GRB.MAXIMIZE); - // per(i)=> ~org(i) - // work-for(i,j)=>per(i)and org(j) - //add constraints - expr=new GRBLinExpr(); - expr.addTerm(1,per1); - expr.addTerm(1,org1); - model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); - - expr=new GRBLinExpr(); - expr.addTerm(1,per2); - expr.addTerm(1,org2); - model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); - - expr=new GRBLinExpr(); - expr.addTerm(-1,per1); - expr.addTerm(1,WF); - model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); - - expr=new GRBLinExpr(); - expr.addTerm(-1,org2); - expr.addTerm(1,WF); - model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); - - - model.optimize(); - // read the solution - double x=per1.get(GRB.DoubleAttr.X); - java.lang.String x1=(x>0.5)? "peop":"npeop"; - x=per2.get(GRB.DoubleAttr.X); - java.lang.String x2=(x>0.5)? "peop":"npeop"; - - if (x1.equals("npeop")){ - x=org1.get(GRB.DoubleAttr.X); - x1=(x>0.5)? "org":"norg";} - if (x2.equals("npeop")){ - x=org2.get(GRB.DoubleAttr.X); - x2=(x>0.5)? "org":"norg";} - x=WF.get(GRB.DoubleAttr.X); - java.lang.String x3=(x>0.5)? "work_for":"nwf"; - - // x=org2.get(GRB.DoubleAttr.X); - maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; - model.dispose(); - env.dispose(); - } - catch (GRBException e) - { - System.out.println("Error code: " + e.getErrorCode() + ". " + - e.getMessage()); - } - return maxC; - } - @Override - public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { //using GurobiHook - int blockSize=RunnerPL.lexm().getNumOfFeature(); - WeightVector globalWeight= new WeightVector(wv.getWeightArray()); - WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); - WeightVector WeightOrg= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); - WeightVector WeightWF= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); - WeightVector wvPer= new WeightVector(WeightPer,1); - WeightVector wvOrg= new WeightVector(WeightOrg,1); - WeightVector wvWF= new WeightVector(WeightWF,1); - JointER JE= new JointER(((ERqInstancePL) input).pair); - ConllRelation head = JointER.findHead((ConllRelation) ((ERqInstancePL) input).pair); - JointER inference = (JointER) InferenceManager.get("ml.wolfe.examples.parisa.iJLIS2.JointER", head); - - if (inference == null) - { - inference = new JointER(head); - InferenceManager.put(inference); - } - - String result = null; - work_forClassifier __work_forClassifier = new work_forClassifier(); - try { - result = inference.valueOf((__work_forClassifier), ((ERqInstancePL) input).pair); - } - catch (Exception e) - { - System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); - e.printStackTrace(); - System.exit(1); - } - - //return result; - //JointER$subjectto JEc=new JointER$subjectto(); - //JEc.makeConstraint(((ERqInstancePL) input).pair); - //((ERqInstancePL) input).pair - // ERqInstancePL qi = (ERqInstancePL) input; - // List options = getOptions(qi); - - // double max = Double.NEGATIVE_INFINITY; - //double score; - Labels temp=new Labels(); - ERiStructurePL maxC = new ERiStructurePL(temp); -/////// - - - double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); - double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); - double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); - double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); - double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); - //try - { - GurobiHook myGurobi=new GurobiHook(); - double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; - int[] vars=new int[coeff.length]; - for (int i = 0; i < coeff.length; i++) { - //System.out.println("adding: i : +" + coeff[i]); - vars[i]= myGurobi.addBooleanVariable(coeff[i]); - - } - - - // GRBEnv env = new GRBEnv("mip1.log"); - // GRBModel model = new GRBModel(env); model. - //create variables - // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); - // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); - // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); - // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); - // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); - - // integrate the new variables - // model.update(); - //Set objective maximize fn(x).per - // GRBLinExpr expr= new GRBLinExpr(); - - // expr.addTerm(coefper1,per1); - // expr.addTerm(coefper2,per2); - // expr.addTerm(coeforg1,org1); - //expr.addTerm(coeforg2,org1); - //expr.addTerm(coefWF,WF); - // model.setObjective(expr,GRB.MAXIMIZE); - // per(i)=> ~org(i) - // work-for(i,j)=>per(i)and org(j) - - //add constraints - double coeffc1[]={1,0,1,0,0}; - myGurobi.addLessThanConstraint(vars,coeffc1,1); - double coeffc2[]={0,1,0,1,0}; - myGurobi.addLessThanConstraint(vars,coeffc2,1); - double coeffc3[]={-1,0,0,0,1}; - myGurobi.addLessThanConstraint(vars,coeffc3,0); - double coeffc4[]={0,0,0,-1,1}; - myGurobi.addLessThanConstraint(vars,coeffc4,0); - - // expr=new GRBLinExpr(); - // expr.addTerm(1,per1); - // expr.addTerm(1,org1); - // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); - - //expr=new GRBLinExpr(); - //expr.addTerm(1,per2); - //expr.addTerm(1,org2); - //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); - - // expr=new GRBLinExpr(); - // expr.addTerm(-1,per1); - // expr.addTerm(1,WF); - // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); - - // expr=new GRBLinExpr(); - // expr.addTerm(-1,org2); - // expr.addTerm(1,WF); - // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); - - - // model.optimize(); - - myGurobi.setMaximize(true); - boolean solved = false; - try { - solved = myGurobi.solve(); - } catch (Exception e) { - e.printStackTrace(); - } - if (!solved) { - System.out.println("ILP solver failed"); - // System.exit(0); - } - - // read the solution - - // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); - java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; - // x=per2.get(GRB.DoubleAttr.X); - java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; - - if (x1.equals("npeop")){ - // x=org1.get(GRB.DoubleAttr.X); - x1=myGurobi.getBooleanValue(2)? "org":"norg";} - if (x2.equals("npeop")){ - // x=org2.get(GRB.DoubleAttr.X); - x2=myGurobi.getBooleanValue(3)? "org":"norg";} - // x=WF.get(GRB.DoubleAttr.X); - java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; - - // x=org2.get(GRB.DoubleAttr.X); - maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; - // model.dispose(); - // env.dispose(); - } - // catch (GRBException e) - // { - // System.out.println("Error code: " + e.getErrorCode() + ". " + - // e.getMessage()); - // } - return maxC; - } - - - - /*public FirstOrderConstraint makeConstraint(Object __example) - { - if (!(__example instanceof ConllRelation)) - { - String type = __example == null ? "null" : __example.getClass().getName(); - System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); - new Exception().printStackTrace(); - System.exit(1); - } - - ConllRelation t = (ConllRelation) __example; - infer.FirstOrderConstraint __result = new infer.FirstOrderConstant(true); - - { - FirstOrderConstraint LBJ2$constraint$result$0 = null; - { - FirstOrderConstraint LBJ2$constraint$result$1 = null; - LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); - FirstOrderConstraint LBJ2$constraint$result$2 = null; - LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(PersonClassifier, t.e1), "" + (true)); - LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); - } - __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); - } - - return __result; - } -*/ - public iERjavaInferencePL clone() { - return new iERjavaInferencePL(); - } -} +//package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; +// +//import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook; +//import edu.illinois.cs.cogcomp.lbjava.infer.InferenceManager; +//import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; +////import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.mYjava.work_forClassifier; +//import edu.illinois.cs.cogcomp.sl.core.AbstractInferenceSolver; +//import edu.illinois.cs.cogcomp.sl.core.IInstance; +//import edu.illinois.cs.cogcomp.sl.core.IStructure; +//import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; +//import edu.illinois.cs.cogcomp.sl.util.WeightVector; +//import gurobi.*; +//import javafx.util.Pair; +// +//import java.util.Arrays; +// +//public class iERjavaInferencePL extends AbstractInferenceSolver { +// +// private static final long serialVersionUID = 1L; +// +// +// public Pair getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { +// +// int blockSize= RunnerPL.lexm().getNumOfFeature(); +// float[] globalWeight=wv.getWeightArray(); +// float[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); +// float[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); +// float[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); +// +// WeightVector wvPer=new WeightVector(new WeightVector(WeightPer),1); +// WeightVector wvOrg=new WeightVector(new WeightVector(WeightOrg),1); +// WeightVector wvWF=new WeightVector(new WeightVector(WeightWF),1); +// ERiStructurePL goldStruct = (ERiStructurePL) gold; +// +// Integer goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("peop")) ? 1 : 0; +// Double coefLosper1= Double.valueOf((1-2*(goldL))); +// goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("peop")) ? 1 : 0; +// Double coefLosper2= Double.valueOf((1-2*(goldL))); +// goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("org")) ? 1 : 0; +// Double coefLosorg1= Double.valueOf((1-2*(goldL))); +// goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("org")) ? 1 : 0; +// Double coefLosorg2= Double.valueOf((1-2*(goldL))); +// goldL= (((ERiStructurePL) gold).Rlables.RelLabel().toLowerCase().contains("work")) ? 1 : 0; +// Double coefLosWF= Double.valueOf((1-2*(goldL))); +// Labels temp=new Labels(); +// +// ERiStructurePL maxC = new ERiStructurePL(temp); +// Double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosper1; +// Double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosper2; +// Double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosorg1; +// Double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosorg2; +// Double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv)+coefLosWF; +// +// try{ +// GRBEnv env = new GRBEnv("mip1.log"); +// GRBModel model = new GRBModel(env); +// //create variables +// GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); +// GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); +// GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); +// GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); +// GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); +// // integrate the new variables +// model.update(); +// //Set objective maximize fn(x).per +// GRBLinExpr expr= new GRBLinExpr(); +// expr.addTerm(coefper1,per1); +// expr.addTerm(coefper2,per2); +// expr.addTerm(coeforg1,org1); +// expr.addTerm(coeforg2,org2); +// expr.addTerm(coefWF,WF); +// model.setObjective(expr,GRB.MAXIMIZE); +// //add constraints +// expr=new GRBLinExpr(); +// expr.addTerm(1,per1); +// expr.addTerm(1,org1); +// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); +// +// expr=new GRBLinExpr(); +// expr.addTerm(1,per2); +// expr.addTerm(1,org2); +// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); +// +// +// expr=new GRBLinExpr(); +// expr.addTerm(-1,per1); +// expr.addTerm(1,WF); +// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); +// +// expr=new GRBLinExpr(); +// expr.addTerm(-1,org2); +// expr.addTerm(1,WF); +// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); +// +// model.optimize(); +// double x=per1.get(GRB.DoubleAttr.X); +// //addBooleanVariabl(2.0); +// +// java.lang.String x1=(x>0.5)? "peop":"npeop"; +// x=per2.get(GRB.DoubleAttr.X); +// java.lang.String x2=(x>0.5)? "peop":"npeop"; +// +// if (x1.equals("npeop")){ +// x=org1.get(GRB.DoubleAttr.X); +// x1=(x>0.5)? "org":"norg";} +// if (x2.equals("npeop")){ +// x=org2.get(GRB.DoubleAttr.X); +// x2=(x>0.5)? "org":"norg";} +// +// x=WF.get(GRB.DoubleAttr.X); +// java.lang.String x3=(x>0.5)? "work_for":"nwf"; +// +// // x=org2.get(GRB.DoubleAttr.X); +// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; +// model.dispose(); +// env.dispose(); +// +// } +// catch (GRBException e) +// { +// System.out.println("Error code: " + e.getErrorCode() + ". " + +// e.getMessage()); +// } +// // Return structure with highest score+loss, and loss of this structure +// return new Pair(maxC, ((double) getLoss( input, maxC, goldStruct))); +// } +// +// @Override +// public float getLoss(IInstance iInstance, IStructure iStructure, IStructure iStructure1) { +// +// float E1loss = 0; +// float E2loss=0; +// float Rloss=0; +// ERiStructurePL hyp= ((ERiStructurePL) iStructure); +// ERiStructurePL gold=((ERiStructurePL) iStructure1); +// if (hyp.Rlables.E1Label().equals(gold.Rlables.E1Label())) +// E1loss=0; +// else +// E1loss=1; +// +// if (hyp.Rlables.E2Label().equals(gold.Rlables.E2Label())) +// E2loss=0; +// else +// E2loss=1; +// +// +// if (hyp.Rlables.RelLabel().equals(gold.Rlables.RelLabel())) +// Rloss=0; +// else +// Rloss=1; +// return ((E1loss+E2loss+Rloss)/3); +// } +// /** +// * This is for prediction. +// */ +// +// +// @Override +// public IStructure getLossAugmentedBestStructure(WeightVector wv, IInstance input, IStructure iStructure) throws Exception { +// +// int blockSize=RunnerPL.lexm().getNumOfFeature(); +// WeightVector globalWeight=new WeightVector(wv.getWeightArray()); +// WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); +// WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); +// WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); +// WeightVector wvPer=new WeightVector(WeightPer,1); +// WeightVector wvOrg=new WeightVector(WeightOrg,1); +// WeightVector wvWF=new WeightVector(WeightWF,1); +// // ERqInstancePL qi = (ERqInstancePL) input; +// // List options = getOptions(qi); +// +// // double max = Double.NEGATIVE_INFINITY; +// //double score; +// Labels temp=new Labels(); +// ERiStructurePL maxC = new ERiStructurePL(temp); +// +// +// double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); +// double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); +// double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); +// double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); +// double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv.toFeatureVector()); +// //try +// { +// GurobiHook myGurobi=new GurobiHook(); +// double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; +// int[] vars=new int[coeff.length]; +// for (int i = 0; i < coeff.length; i++) { +// //System.out.println("adding: i : +" + coeff[i]); +// vars[i]= myGurobi.addBooleanVariable(coeff[i]); +// +// } +// +// +// // GRBEnv env = new GRBEnv("mip1.log"); +// // GRBModel model = new GRBModel(env); model. +// //create variables +// // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); +// // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); +// // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); +// // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); +// // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); +// +// // integrate the new variables +// // model.update(); +// //Set objective maximize fn(x).per +// // GRBLinExpr expr= new GRBLinExpr(); +// +// // expr.addTerm(coefper1,per1); +// // expr.addTerm(coefper2,per2); +// // expr.addTerm(coeforg1,org1); +// //expr.addTerm(coeforg2,org1); +// //expr.addTerm(coefWF,WF); +// // model.setObjective(expr,GRB.MAXIMIZE); +// // per(i)=> ~org(i) +// // work-for(i,j)=>per(i)and org(j) +// +// //add constraints +// double coeffc1[]={1,0,1,0,0}; +// myGurobi.addLessThanConstraint(vars,coeffc1,1); +// double coeffc2[]={0,1,0,1,0}; +// myGurobi.addLessThanConstraint(vars,coeffc2,1); +// double coeffc3[]={-1,0,0,0,1}; +// myGurobi.addLessThanConstraint(vars,coeffc3,0); +// double coeffc4[]={0,0,0,-1,1}; +// myGurobi.addLessThanConstraint(vars,coeffc4,0); +// +// // expr=new GRBLinExpr(); +// // expr.addTerm(1,per1); +// // expr.addTerm(1,org1); +// // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); +// +// //expr=new GRBLinExpr(); +// //expr.addTerm(1,per2); +// //expr.addTerm(1,org2); +// //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); +// +// // expr=new GRBLinExpr(); +// // expr.addTerm(-1,per1); +// // expr.addTerm(1,WF); +// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); +// +// // expr=new GRBLinExpr(); +// // expr.addTerm(-1,org2); +// // expr.addTerm(1,WF); +// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); +// +// +// // model.optimize(); +// +// myGurobi.setMaximize(true); +// boolean solved = false; +// try { +// solved = myGurobi.solve(); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// if (!solved) { +// System.out.println("ILP solver failed"); +// // System.exit(0); +// } +// +// // read the solution +// +// // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); +// java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; +// // x=per2.get(GRB.DoubleAttr.X); +// java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; +// +// if (x1.equals("npeop")){ +// // x=org1.get(GRB.DoubleAttr.X); +// x1=myGurobi.getBooleanValue(2)? "org":"norg";} +// if (x2.equals("npeop")){ +// // x=org2.get(GRB.DoubleAttr.X); +// x2=myGurobi.getBooleanValue(3)? "org":"norg";} +// // x=WF.get(GRB.DoubleAttr.X); +// java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; +// +// // x=org2.get(GRB.DoubleAttr.X); +// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; +// // model.dispose(); +// // env.dispose(); +// } +// // catch (GRBException e) +// // { +// // System.out.println("Error code: " + e.getErrorCode() + ". " + +// // e.getMessage()); +// // } +// return maxC; +// } +// +// +// +// +// +// +// public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) throws Exception { +// int blockSize=RunnerPL.lexm().getNumOfFeature(); +// WeightVector globalWeight=new WeightVector(wv.getWeightArray()); +// WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); +// WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); +// WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 2 * blockSize, 3 * blockSize - 1)); +// WeightVector wvPer=new WeightVector(WeightPer,1); +// WeightVector wvOrg=new WeightVector(WeightOrg,1); +// WeightVector wvWF=new WeightVector(WeightWF,1); +// // ERqInstancePL qi = (ERqInstancePL) input; +// // List options = getOptions(qi); +// +// // double max = Double.NEGATIVE_INFINITY; +// //double score; +// Labels temp=new Labels(); +// ERiStructurePL maxC = new ERiStructurePL(temp); +// +// +// float coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); +// float coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); +// float coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); +// float coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); +// float coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); +// try{ +// GRBEnv env = new GRBEnv("mip1.log"); +// GRBModel model = new GRBModel(env); +// //create variables +// GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); +// GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); +// GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); +// GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); +// GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); +// +// // integrate the new variables +// model.update(); +// //Set objective maximize fn(x).per +// GRBLinExpr expr= new GRBLinExpr(); +// expr.addTerm(coefper1,per1); +// expr.addTerm(coefper2,per2); +// expr.addTerm(coeforg1,org1); +// expr.addTerm(coeforg2,org1); +// expr.addTerm(coefWF,WF); +// model.setObjective(expr,GRB.MAXIMIZE); +// // per(i)=> ~org(i) +// // work-for(i,j)=>per(i)and org(j) +// //add constraints +// expr=new GRBLinExpr(); +// expr.addTerm(1,per1); +// expr.addTerm(1,org1); +// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); +// +// expr=new GRBLinExpr(); +// expr.addTerm(1,per2); +// expr.addTerm(1,org2); +// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); +// +// expr=new GRBLinExpr(); +// expr.addTerm(-1,per1); +// expr.addTerm(1,WF); +// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); +// +// expr=new GRBLinExpr(); +// expr.addTerm(-1,org2); +// expr.addTerm(1,WF); +// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); +// +// +// model.optimize(); +// // read the solution +// double x=per1.get(GRB.DoubleAttr.X); +// java.lang.String x1=(x>0.5)? "peop":"npeop"; +// x=per2.get(GRB.DoubleAttr.X); +// java.lang.String x2=(x>0.5)? "peop":"npeop"; +// +// if (x1.equals("npeop")){ +// x=org1.get(GRB.DoubleAttr.X); +// x1=(x>0.5)? "org":"norg";} +// if (x2.equals("npeop")){ +// x=org2.get(GRB.DoubleAttr.X); +// x2=(x>0.5)? "org":"norg";} +// x=WF.get(GRB.DoubleAttr.X); +// java.lang.String x3=(x>0.5)? "work_for":"nwf"; +// +// // x=org2.get(GRB.DoubleAttr.X); +// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; +// model.dispose(); +// env.dispose(); +// } +// catch (GRBException e) +// { +// System.out.println("Error code: " + e.getErrorCode() + ". " + +// e.getMessage()); +// } +// return maxC; +// } +// @Override +// public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { //using GurobiHook +// int blockSize=RunnerPL.lexm().getNumOfFeature(); +// WeightVector globalWeight= new WeightVector(wv.getWeightArray()); +// WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); +// WeightVector WeightOrg= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); +// WeightVector WeightWF= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); +// WeightVector wvPer= new WeightVector(WeightPer,1); +// WeightVector wvOrg= new WeightVector(WeightOrg,1); +// WeightVector wvWF= new WeightVector(WeightWF,1); +// JointER JE= new JointER(((ERqInstancePL) input).pair); +// ConllRelation head = JointER.findHead((ConllRelation) ((ERqInstancePL) input).pair); +// JointER inference = (JointER) InferenceManager.get("ml.wolfe.examples.parisa.iJLIS2.JointER", head); +// +// if (inference == null) +// { +// inference = new JointER(head); +// InferenceManager.put(inference); +// } +// +//// String result = null; +//// work_forClassifier __work_forClassifier = new work_forClassifier(); +//// try { +//// result = inference.valueOf((__work_forClassifier), ((ERqInstancePL) input).pair); +//// } +//// catch (Exception e) +//// { +//// System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); +//// e.printStackTrace(); +//// System.exit(1); +//// } +// +// //return result; +// //JointER$subjectto JEc=new JointER$subjectto(); +// //JEc.makeConstraint(((ERqInstancePL) input).pair); +// //((ERqInstancePL) input).pair +// // ERqInstancePL qi = (ERqInstancePL) input; +// // List options = getOptions(qi); +// +// // double max = Double.NEGATIVE_INFINITY; +// //double score; +// Labels temp=new Labels(); +// ERiStructurePL maxC = new ERiStructurePL(temp); +///////// +// +// +// double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); +// double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); +// double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); +// double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); +// double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); +// //try +// { +// GurobiHook myGurobi=new GurobiHook(); +// double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; +// int[] vars=new int[coeff.length]; +// for (int i = 0; i < coeff.length; i++) { +// //System.out.println("adding: i : +" + coeff[i]); +// vars[i]= myGurobi.addBooleanVariable(coeff[i]); +// +// } +// +// +// // GRBEnv env = new GRBEnv("mip1.log"); +// // GRBModel model = new GRBModel(env); model. +// //create variables +// // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); +// // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); +// // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); +// // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); +// // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); +// +// // integrate the new variables +// // model.update(); +// //Set objective maximize fn(x).per +// // GRBLinExpr expr= new GRBLinExpr(); +// +// // expr.addTerm(coefper1,per1); +// // expr.addTerm(coefper2,per2); +// // expr.addTerm(coeforg1,org1); +// //expr.addTerm(coeforg2,org1); +// //expr.addTerm(coefWF,WF); +// // model.setObjective(expr,GRB.MAXIMIZE); +// // per(i)=> ~org(i) +// // work-for(i,j)=>per(i)and org(j) +// +// //add constraints +// double coeffc1[]={1,0,1,0,0}; +// myGurobi.addLessThanConstraint(vars,coeffc1,1); +// double coeffc2[]={0,1,0,1,0}; +// myGurobi.addLessThanConstraint(vars,coeffc2,1); +// double coeffc3[]={-1,0,0,0,1}; +// myGurobi.addLessThanConstraint(vars,coeffc3,0); +// double coeffc4[]={0,0,0,-1,1}; +// myGurobi.addLessThanConstraint(vars,coeffc4,0); +// +// // expr=new GRBLinExpr(); +// // expr.addTerm(1,per1); +// // expr.addTerm(1,org1); +// // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); +// +// //expr=new GRBLinExpr(); +// //expr.addTerm(1,per2); +// //expr.addTerm(1,org2); +// //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); +// +// // expr=new GRBLinExpr(); +// // expr.addTerm(-1,per1); +// // expr.addTerm(1,WF); +// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); +// +// // expr=new GRBLinExpr(); +// // expr.addTerm(-1,org2); +// // expr.addTerm(1,WF); +// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); +// +// +// // model.optimize(); +// +// myGurobi.setMaximize(true); +// boolean solved = false; +// try { +// solved = myGurobi.solve(); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// if (!solved) { +// System.out.println("ILP solver failed"); +// // System.exit(0); +// } +// +// // read the solution +// +// // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); +// java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; +// // x=per2.get(GRB.DoubleAttr.X); +// java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; +// +// if (x1.equals("npeop")){ +// // x=org1.get(GRB.DoubleAttr.X); +// x1=myGurobi.getBooleanValue(2)? "org":"norg";} +// if (x2.equals("npeop")){ +// // x=org2.get(GRB.DoubleAttr.X); +// x2=myGurobi.getBooleanValue(3)? "org":"norg";} +// // x=WF.get(GRB.DoubleAttr.X); +// java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; +// +// // x=org2.get(GRB.DoubleAttr.X); +// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; +// // model.dispose(); +// // env.dispose(); +// } +// // catch (GRBException e) +// // { +// // System.out.println("Error code: " + e.getErrorCode() + ". " + +// // e.getMessage()); +// // } +// return maxC; +// } +// +// +// +// /*public FirstOrderConstraint makeConstraint(Object __example) +// { +// if (!(__example instanceof ConllRelation)) +// { +// String type = __example == null ? "null" : __example.getClass().getName(); +// System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); +// new Exception().printStackTrace(); +// System.exit(1); +// } +// +// ConllRelation t = (ConllRelation) __example; +// infer.FirstOrderConstraint __result = new infer.FirstOrderConstant(true); +// +// { +// FirstOrderConstraint LBJ2$constraint$result$0 = null; +// { +// FirstOrderConstraint LBJ2$constraint$result$1 = null; +// LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); +// FirstOrderConstraint LBJ2$constraint$result$2 = null; +// LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(PersonClassifier, t.e1), "" + (true)); +// LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); +// } +// __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); +// } +// +// return __result; +// } +//*/ +// public iERjavaInferencePL clone() { +// return new iERjavaInferencePL(); +// } +//} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 4364feae..cf28c046 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -3,11 +3,11 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJ import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstrainedClassifiers.perConstraintClassifier import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationDataModel - +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers.personClassifier /** Created by Parisa on 12/8/15. */ object mySL_Saul_TestApp extends App { EntityRelationDataModel.populateWithConll() - + personClassifier.learn(1) JoinSLtrain(EntityRelationDataModel, List(perConstraintClassifier)) } From 75ac53eb84369be14564dd7ee42b04f980e93fad Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 30 Mar 2016 07:05:27 -0500 Subject: [PATCH 039/118] -added a comment --- .../cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 87e31db3..991ba8d2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -32,6 +32,7 @@ class Saul_SL_Inference[HEAD <: AnyRef] extends AbstractInferenceSolver { override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] + // update the classifiers with the current wight modle var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList, myIns.head) for (i <- 0 until myIns.factorClassifiers.size) { val c = myIns.factorClassifiers(i) From 71ca9bda11461b2c42de78f5e6506f40bcdfa2ad Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 30 Mar 2016 11:41:00 -0500 Subject: [PATCH 040/118] fixed joinTrainig intialization --- .../saul/classifier/ConstrainedClassifier.scala | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 9b489a4e..c1931ef8 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -92,17 +92,30 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo } def buildWithConstraint(infer: InferenceCondition[T, HEAD], cls: Learner)(t: T): String = { + + val lex = cls.getLabelLexicon + var flag = false + for (i <- 0 until lex.size()) { + if (lex.lookupKey(i).valueEquals(cls.getLabeler().discreteValue(t))) + flag = true + } + findHead(t) match { case Some(head) => val name = String.valueOf(infer.subjectTo.hashCode()) var inference = InferenceManager.get(name, head) + if (inference == null) { inference = infer(head) if (log) println("Inference is NULL " + name) InferenceManager.put(name, inference) } - inference.valueOf(cls, t) + if (!flag) { + print("The models have not been trained for this label!") + "" + } else + inference.valueOf(cls, t) case None => val name = String.valueOf(infer.subjectTo.hashCode()) From 2b07413c22351be721eb9493b970ea9f757b1b1d Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 31 Mar 2016 10:12:15 -0500 Subject: [PATCH 041/118] minor --- build.sbt | 2 +- .../EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 3405901b..fbe68d54 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,7 @@ lazy val commonSettings = Seq( ), javaOptions ++= List("-Xmx6g"), libraryDependencies ++= Seq( - "edu.illinois.cs.cogcomp" % "LBJava" % "1.2.8", + "edu.illinois.cs.cogcomp" % "LBJava" % "1.2.8" withSources, "edu.illinois.cs.cogcomp" % "illinois-core-utilities" % cogcompNLPVersion withSources, "com.gurobi" % "gurobi" % "6.0", "org.apache.commons" % "commons-math3" % "3.0", diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index cf28c046..2e3da2b3 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -3,11 +3,9 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJ import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstrainedClassifiers.perConstraintClassifier import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationDataModel -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers.personClassifier /** Created by Parisa on 12/8/15. */ object mySL_Saul_TestApp extends App { EntityRelationDataModel.populateWithConll() - personClassifier.learn(1) JoinSLtrain(EntityRelationDataModel, List(perConstraintClassifier)) } From 1a84d671d7044365dabd71bb01cd9d46288c1f4e Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 1 Apr 2016 15:00:59 -0500 Subject: [PATCH 042/118] -initialization of join classifiers -added factors as a parameter to inference -fixed the loss augmented inference -fixed hamming loss -added the factors to the SLModel -initial general SLSaul Evaluation - added a flag for making train and test problem intances -added a util for converting double arrays -fixed exchanging weights between Saul and LBjava constrained classifiers --- .../classifier/JoinTrainSparseNetwork.scala | 21 ------- .../classifier/SL_model/InitializeSL.scala | 59 +++++++++++++++++++ .../classifier/SL_model/JoinSLtrain.scala | 10 ++-- .../SL_model/SL_FeatureGenerator.scala | 4 +- .../classifier/SL_model/SL_IOManager.scala | 16 ++++- .../saul/classifier/SL_model/SUtils.java | 1 + .../classifier/SL_model/SaulSLModel.scala | 11 ++++ .../saul/classifier/SL_model/SaulSLTest.scala | 31 ++++++++++ .../SL_model/Saul_SL_Inference.scala | 47 ++++++++++----- .../SL_model/Saul_SL_Instance.scala | 6 +- .../saul/classifier/SL_model/Utils.scala | 13 ++++ .../saul/classifier/SaparseNetWorkLBP.scala | 1 + .../EntityRelationClassifiers.Scala | 23 ++++---- ...EntityRelationConstrainedClassifiers.scala | 6 +- .../EntityRelationDataModel.scala | 2 +- .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 5 +- 16 files changed, 191 insertions(+), 65 deletions(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala index d06369c9..e502e3fd 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala @@ -92,31 +92,10 @@ object JoinTrainSparseNetwork { typedC.getCandidates(h) foreach { x => { - // println(x) - // typedC.onClassifier.learn(x) - def trainOnce() = { val result = typedC.classifier.discreteValue(x) - // val result = typedC.classifier.discreteValue(x) - // - // println(s"${typedC.onClassifier.scores(x).getScore("true")}") - // println(s"${typedC.onClassifier.scores(x).getScore("false")}") - val trueLabel = oracle.discreteValue(x) - - // val classifierToTrain = typedC.classifier - - // if(result.equals(trueLabel)){ - // print(Console.GREEN) - // }else{ - // print(Console.RED) - // } - // print(result + " ??? " + trueLabel) - // println(Console.RESET) - - // - // if (result.equals("true") && !typedC.classifier.getLabeler.discreteValue(x).equals("true")) val ilearner = typedC.onClassifier.asInstanceOf[Learner].asInstanceOf[SparseNetworkLBP] val lLexicon = typedC.onClassifier.getLabelLexicon var LTU_actual: Int = 0 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala new file mode 100644 index 00000000..02210900 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala @@ -0,0 +1,59 @@ + package edu.illinois.cs.cogcomp.saul.classifier.SL_model + + import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit + import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP + import edu.illinois.cs.cogcomp.sl.core.SLProblem + import edu.illinois.cs.cogcomp.sl.util.WeightVector + + import scala.collection.JavaConversions._ + /** + * Created by Parisa on 4/1/16. + */ + object InitializeSL{ + + + def apply[HEAD<:AnyRef](sp:SLProblem , model:SaulSLModel[HEAD]): WeightVector = { + var myWeight: Array[Float]= Array() + model.Factors.foreach{ + cf => + sp.instanceList.toList.zipWithIndex.foreach { + case (myIns,ind) => { + val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] + //for (i <- 0 until ins.ConstraintFactors.size) { + val candis: Seq[_] = cf.getCandidates(ins.head) + val ilearner = cf.onClassifier.asInstanceOf[SparseNetworkLBP] + val lLexicon = cf.onClassifier.getLabelLexicon + candis.foreach { + x => + val a = cf.onClassifier.getExampleArray(x) + val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures + val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues + val exampleLabels = a(2).asInstanceOf[Array[Int]] + val labelValues = a(3).asInstanceOf[Array[Double]] + val label = exampleLabels(0) + var N = ilearner.net.size(); + if (label >= N || ilearner.net.get(label) == null) { + ilearner.iConjuctiveLables = ilearner.iConjuctiveLables | ilearner.getLabelLexicon.lookupKey(label).isConjunctive(); + var ltu: LinearThresholdUnit = ilearner.getbaseLTU + ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); + ilearner.net.set(label, ltu); + N = label + 1; + } + } // for each candidate + } // for each constraintFactor + }//end case + }//for each example +model.Factors.foreach( + +x => + for (i <- 0 until x.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) + { + val w1= x.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector + for (j<- 0 until w1.size()) + myWeight +:= w1.getWeight(j).asInstanceOf[Float] + }) + val wv= new WeightVector(myWeight) + wv + }//end of apply + + }// end of object diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index d9484f90..2c74c4f2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -23,9 +23,9 @@ object JoinSLtrain { def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { //var lexm: Lexiconer = new Lexiconer() - val model = new SLModel + val model = new SaulSLModel(cls) val sp = SL_IOManager.makeSLProblem(dm, cls) - model.infSolver = new Saul_SL_Inference + model.infSolver = new Saul_SL_Inference(model.Factors) val para = new SLParameters para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false @@ -40,9 +40,11 @@ object JoinSLtrain { // println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) //println("num?:" + model.lm.getNumOfFeature) - + InitializeSL(sp,model) model.wv = learner.train(sp) - model.saveModel("modelname.SAUL"); + +// model.saveModel("modelname.SAUL"); + } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index eb517d4f..2811987b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -12,8 +12,8 @@ class SL_FeatureGenerator[HEAD <: AnyRef] extends AbstractFeatureGenerator { val myY = y.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val fv = new FeatureVectorBuffer() var labelCount = 0 - for (i <- 0 until myX.factorClassifiers.size) { - val c = myX.factorClassifiers(i) + for (i <- 0 until myX.ConstraintFactors.size) { + val c = myX.ConstraintFactors(i) val candis: Seq[_] = c.getCandidates(myX.head) val fvLocal = new FeatureVectorBuffer() var previousSize = 0 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index c771c966..b4d3db05 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -11,10 +11,20 @@ import scala.reflect.ClassTag */ object SL_IOManager { val lexm: Lexiconer = new Lexiconer() - def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): SLProblem = { + def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]],testing:Boolean=false)(implicit t: ClassTag[HEAD]): SLProblem = { var sp: SLProblem = new SLProblem() - val allHeads = dm.getNodeWithType[HEAD].getAllInstances - allHeads.foreach(x => { + var allHeads : Iterable[HEAD]= Iterable[HEAD]() + if (testing) + { + allHeads = dm.getNodeWithType[HEAD].getTestingInstances + } + else + { + allHeads = dm.getNodeWithType[HEAD].getAllInstances + } + + allHeads.foreach(x => + { // val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava val ins = new Saul_SL_Instance(list, x) ins.apply diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java index 19419a17..2b7b8b12 100755 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java @@ -45,4 +45,5 @@ public static FeatureVectorBuffer makeFeatures(List feats) { return new FeatureVectorBuffer(idx, val); } + } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala new file mode 100644 index 00000000..612e1098 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala @@ -0,0 +1,11 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model + +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.sl.core.SLModel + +/** + * Created by Parisa on 4/1/16. + */ +class SaulSLModel[HEAD<: AnyRef](cls: List[ConstrainedClassifier[_,HEAD]]) extends SLModel { + var Factors: List[ConstrainedClassifier[_,HEAD]]= cls +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala new file mode 100644 index 00000000..61195304 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala @@ -0,0 +1,31 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model + +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.sl.core.IStructure +import scala.collection.JavaConversions._ +/** + * Created by Parisa on 4/1/16. + */ + +object SaulSLTest { + + def evaluate(goldIstructure: List[IStructure], predictedIstructure: List[IStructure], model: SaulSLModel) = { + model.Factors.foreach { + x=> { + } + } + } + def apply[HEAD](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], model: SaulSLModel, inference: Saul_SL_Inference): Unit = { + val sp = SL_IOManager.makeSLProblem(dm, cls, true) + var a: List[IStructure] = List[IStructure]() + sp.instanceList.toList.foreach { + ins => + a = model.infSolver.getBestStructure(model.wv, ins) :: a + } + evaluate(a,sp.goldStructureList.toList, model) + } + + + +} \ No newline at end of file diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 991ba8d2..8434b9ac 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,20 +1,23 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } +import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseWeightVector} +import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector - /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[HEAD <: AnyRef] extends AbstractInferenceSolver { +class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]]) extends AbstractInferenceSolver { + val a=factors override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { + val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList, myIns.head) - for (i <- 0 until myIns.factorClassifiers.size) { - val c = myIns.factorClassifiers(i) + var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.ConstraintFactors.toList, myIns.head) + for (i <- 0 until myIns.ConstraintFactors.size) { + val c = myIns.ConstraintFactors(i) val candis: Seq[_] = c.getCandidates(myIns.head) candis.foreach(x => - myStruct.labels += myIns.factorClassifiers(i).classifier.discreteValue(x)) + myStruct.labels += myIns.ConstraintFactors(i).classifier.discreteValue(x)) } myStruct } @@ -24,7 +27,9 @@ class Saul_SL_Inference[HEAD <: AnyRef] extends AbstractInferenceSolver { val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[HEAD]] for (i <- 0 until myGold.labels.size) { - l = l + myGold.labels(i).equals(myPred.labels(i)).asInstanceOf[Float] + + if (myGold.labels(i)!=(myPred.labels(i))) + l = l+1 } l } @@ -32,14 +37,26 @@ class Saul_SL_Inference[HEAD <: AnyRef] extends AbstractInferenceSolver { override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - // update the classifiers with the current wight modle - var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.factorClassifiers.toList, myIns.head) - for (i <- 0 until myIns.factorClassifiers.size) { - val c = myIns.factorClassifiers(i) - val candis: Seq[_] = c.getCandidates(myIns.head) - candis.foreach(x => - myStruct.labels += myIns.factorClassifiers(i).classifier.discreteValue(x)) + val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.ConstraintFactors.toList, myIns.head) + + a.foreach { + cf=> + + for (i <- 0 until cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) + { + val w1= cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector + val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(i,w1.size()) + cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Utils.converFarrayToD(myFactorJoinlyTrainedWeight)) + + } + } + a.foreach { + cf=> + cf.getCandidates(myIns.head).foreach { + x => + myStruct.labels += cf.classifier.discreteValue(x) } + } myStruct } //Todo add loss to the objective before calling inference diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index 09f10a75..df7abdfc 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -13,7 +13,8 @@ import scala.collection.mutable.ListBuffer case class Saul_SL_Instance[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEAD]], x: HEAD) extends IInstance { // val inputFeatures:ListBuffer[Array[Object]]= ListBuffer() // List - var factorClassifiers: ListBuffer[ConstrainedClassifier[_, HEAD]] = ListBuffer() + var ConstraintFactors: ListBuffer[ConstrainedClassifier[_, HEAD]] =ListBuffer() + //List var fv: IFeatureVector = null; val head: HEAD = x @@ -35,7 +36,8 @@ case class Saul_SL_Instance[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEA } // yield inputFeatures // val a0 = a(0).asInstanceOf[Array[Int]] - factorClassifiers += (c) //TODO probably we need to remove this, it seems to be redundant + ConstraintFactors += (c) //TODO probably we need to remove this, it seems to be redundant + // val a1 = a(1).asInstanceOf[Array[Double]] } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala new file mode 100644 index 00000000..f6f0859e --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala @@ -0,0 +1,13 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model + +/** + * Created by Parisa on 4/1/16. + */ +object Utils { + def converFarrayToD(a: Array[Float]):Array[Double]={ + var d:Array[Double]=Array[Double]() + a.foreach(x=> + d :+ Float.float2double(x)) + d + } +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SaparseNetWorkLBP.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SaparseNetWorkLBP.scala index 56a35474..46213ce7 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SaparseNetWorkLBP.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SaparseNetWorkLBP.scala @@ -5,6 +5,7 @@ import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetwork /** Created by Parisa on 5/24/15. */ class SparseNetworkLBP extends SparseNetworkLearner { + var net = network var iConjuctiveLables = conjunctiveLabels def getLTU(i: Int): LinearThresholdUnit = { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationClassifiers.Scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationClassifiers.Scala index 72a6a95c..638f3552 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationClassifiers.Scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationClassifiers.Scala @@ -1,17 +1,16 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation -import edu.illinois.cs.cogcomp.lbjava.learn.SparseNetworkLearner -import edu.illinois.cs.cogcomp.saul.classifier.Learnable +import edu.illinois.cs.cogcomp.saul.classifier.{Learnable, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saul.datamodel.property.Property -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawSentence, ConllRawToken, ConllRelation } +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRawSentence, ConllRawToken, ConllRelation} import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationDataModel._ object EntityRelationClassifiers { object orgClassifier extends Learnable[ConllRawToken](EntityRelationDataModel) { def label: Property[ConllRawToken] = entityType is "Org" - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP override def feature = using(windowWithIn[ConllRawSentence](-2, 2, List(pos)), word, phrase, containsSubPhraseMent, containsSubPhraseIng, containsInPersonList, wordLen, containsInCityList) } @@ -20,25 +19,25 @@ object EntityRelationClassifiers { def label: Property[ConllRawToken] = entityType is "Peop" override def feature = using(windowWithIn[ConllRawSentence](-2, 2, List(pos)), word, phrase, containsSubPhraseMent, containsSubPhraseIng, containsInPersonList, wordLen, containsInCityList) - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP } object locationClassifier extends Learnable[ConllRawToken](EntityRelationDataModel) { def label: Property[ConllRawToken] = entityType is "Loc" override def feature = using(windowWithIn[ConllRawSentence](-2, 2, List(pos)), word, phrase, containsSubPhraseMent, containsSubPhraseIng, containsInPersonList, wordLen, containsInCityList) - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP } object worksForClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { def label: Property[ConllRelation] = relationType is "Work_For" override def feature = using(relFeature, relPos) - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP } object workForClassifierPipe extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "Work_For" - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP override def feature = using( relFeature, relPos, ePipe ) @@ -46,22 +45,22 @@ object EntityRelationClassifiers { object livesInClassifierPipe extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "Live_In" override def feature = using(relFeature, relPos, ePipe) - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP } object livesInClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { def label: Property[ConllRelation] = relationType is "Live_In" override def feature = using(relFeature, relPos) - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP } object org_baseClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "OrgBased_In" - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP } object locatedInClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "Located_In" - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseNetworkLBP } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala index e7f7ab75..3b7cc6c8 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala @@ -11,14 +11,14 @@ object EntityRelationConstrainedClassifiers { object orgConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](EntityRelationDataModel, orgClassifier) { def subjectTo = relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo2ndArg) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 + //override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 } object perConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](EntityRelationDataModel, personClassifier) { def subjectTo = relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo1stArg) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 + // override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 } object locConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](EntityRelationDataModel, locationClassifier) { @@ -26,7 +26,7 @@ object EntityRelationConstrainedClassifiers { def subjectTo = relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo2ndArg) //TODO add test unit for this filter - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 + // override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 } object work_P_O_relationClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](EntityRelationDataModel, worksForClassifier) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala index 4291c9c0..e3ab1f49 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationDataModel.scala @@ -23,7 +23,7 @@ object EntityRelationDataModel extends DataModel { sentenceToToken.addSensor(sentenceToTokens_GeneratingS _) sentencesToPairs.addSensor(sentenceToRelation_GeneratingS _) - pairTo1stArg.addSensor(relationToSecondArg_MatchingS _) + pairTo1stArg.addSensor(relationToFirstArg_MatchingS _) pairTo2ndArg.addSensor(relationToSecondArg_MatchingS _) /** Properties */ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 2e3da2b3..e9d6e041 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -1,11 +1,12 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS3 import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstrainedClassifiers.perConstraintClassifier +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationDataModel + /** Created by Parisa on 12/8/15. */ object mySL_Saul_TestApp extends App { EntityRelationDataModel.populateWithConll() - JoinSLtrain(EntityRelationDataModel, List(perConstraintClassifier)) + JoinSLtrain(EntityRelationDataModel, List(perConstraintClassifier,orgConstraintClassifier, locConstraintClassifier,liveIn_P_O_relationClassifier,work_P_O_relationClassifier)) } From 9ab6560c249c05767a41a4e10dcf35b311635cb3 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sat, 2 Apr 2016 07:21:03 -0500 Subject: [PATCH 043/118] added an trial lossaugmented classifier --- .../classifier/SL_model/JoinSLtrain.scala | 2 +- .../saul/classifier/SL_model/SaulSLTest.scala | 6 ++-- .../SL_model/Saul_SL_Inference.scala | 21 ++++++++++-- .../SL_model/lossAugmentedClassifier.scala | 32 +++++++++++++++++++ ...EntityRelationConstrainedClassifiers.scala | 1 + 5 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 2c74c4f2..0c7ac2c4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -25,7 +25,7 @@ object JoinSLtrain { //var lexm: Lexiconer = new Lexiconer() val model = new SaulSLModel(cls) val sp = SL_IOManager.makeSLProblem(dm, cls) - model.infSolver = new Saul_SL_Inference(model.Factors) + model.infSolver = new Saul_SL_Inference(model.Factors, dm) val para = new SLParameters para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala index 61195304..d36a8608 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala @@ -4,19 +4,21 @@ import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.IStructure import scala.collection.JavaConversions._ +import scala.reflect.ClassTag + /** * Created by Parisa on 4/1/16. */ object SaulSLTest { - def evaluate(goldIstructure: List[IStructure], predictedIstructure: List[IStructure], model: SaulSLModel) = { + def evaluate[HEAD<:AnyRef](goldIstructure: List[IStructure], predictedIstructure: List[IStructure], model: SaulSLModel[HEAD]) = { model.Factors.foreach { x=> { } } } - def apply[HEAD](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], model: SaulSLModel, inference: Saul_SL_Inference): Unit = { + def apply[HEAD<:AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], model: SaulSLModel[HEAD], inference: Saul_SL_Inference[HEAD])(implicit t: ClassTag[HEAD]): Unit = { val sp = SL_IOManager.makeSLProblem(dm, cls, true) var a: List[IStructure] = List[IStructure]() sp.instanceList.toList.foreach { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 8434b9ac..3fd13f36 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,14 +1,19 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseWeightVector} import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector + +import scala.reflect.ClassTag + /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]]) extends AbstractInferenceSolver { +class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { val a=factors - + val dataM=dm override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] @@ -50,6 +55,18 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE } } + + // val newFactors=List[ConstrainedClassifier[_,HEAD]] + a.foreach{ + x=> + + x.buildWithConstraint(x.subjectTo.createInferenceCondition[x.LEFT](dm,new GurobiHook()),new lossAugmentedClassifier[x.LEFT](x.onClassifier)) + // x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) + + //x.buildWithConstraint(x.subjectTo.createInferenceCondition(dm,)) + // val a = new ConstrainedClassifier[_,HEAD](dm,new lossAugmentedClassifier[_](x.onClassifier)){ def subjectTo = null} //EntityRelationConstraints.relationArgumentConstraints} {} + } + a.foreach { cf=> cf.getCandidates(myIns.head).foreach { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala new file mode 100644 index 00000000..d9e80462 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala @@ -0,0 +1,32 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import java.io.PrintStream + +import edu.illinois.cs.cogcomp.lbjava.classify.{FeatureVector, ScoreSet} +import edu.illinois.cs.cogcomp.lbjava.learn.Learner + +/** + * Created by Parisa on 4/1/16. + */ +class lossAugmentedClassifier[T](c:Learner) extends Learner("lossAugmentedClassifier") { + override def getInputType: String = { "dummy"} + + override def allowableValues: Array[String] = c.allowableValues()//{ Array[String]("false", "true") } + + override def equals(o: Any): Boolean = { getClass == o.getClass } + + /** The reason for true to be -1 is because the internal optimization by default finds the maximizer, while in this + * problem we are looking for a minimizer + */ + override def scores(example: AnyRef): ScoreSet = { + val result: ScoreSet = c.scores(example)//new ScoreSet + result + } + + override def write(printStream: PrintStream): Unit = ??? + + override def scores(ints: Array[Int], doubles: Array[Double]): ScoreSet = ??? + + override def classify(ints: Array[Int], doubles: Array[Double]): FeatureVector = ??? + + override def learn(ints: Array[Int], doubles: Array[Double], ints1: Array[Int], doubles1: Array[Double]): Unit = ??? + } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala index 3b7cc6c8..5fec0f80 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/EntityRelationConstrainedClassifiers.scala @@ -6,6 +6,7 @@ import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationClassifiers.{ locationClassifier, personClassifier, orgClassifier } import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstraints._ + object EntityRelationConstrainedClassifiers { object orgConstraintClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](EntityRelationDataModel, orgClassifier) { From 0eeee9946b82df7bd2617bc271d06f9a852588fb Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 4 Apr 2016 12:44:05 -0500 Subject: [PATCH 044/118] -Augmented the scores with loss. --- .../SL_model/Saul_SL_Inference.scala | 14 +++++++++----- .../SL_model/lossAugmentedClassifier.scala | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 3fd13f36..0f2fb268 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,6 +1,5 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseWeightVector} import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -57,15 +56,20 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE } // val newFactors=List[ConstrainedClassifier[_,HEAD]] - a.foreach{ - x=> + a.foreach { + cf => + val tempclassifier = new lossAugmentedClassifier[cf.LEFT](cf.onClassifier) + cf.getCandidates(myIns.head).foreach { + example=> - x.buildWithConstraint(x.subjectTo.createInferenceCondition[x.LEFT](dm,new GurobiHook()),new lossAugmentedClassifier[x.LEFT](x.onClassifier)) + tempclassifier.scores(example.asInstanceOf[AnyRef]) + //cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) // x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) - //x.buildWithConstraint(x.subjectTo.createInferenceCondition(dm,)) + //x.buildWithConstraint(x.subjectTo.createInferenceCondition(dm,)) // val a = new ConstrainedClassifier[_,HEAD](dm,new lossAugmentedClassifier[_](x.onClassifier)){ def subjectTo = null} //EntityRelationConstraints.relationArgumentConstraints} {} } + } a.foreach { cf=> diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala index d9e80462..45cc884c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala @@ -3,11 +3,12 @@ import java.io.PrintStream import edu.illinois.cs.cogcomp.lbjava.classify.{FeatureVector, ScoreSet} import edu.illinois.cs.cogcomp.lbjava.learn.Learner +import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP /** * Created by Parisa on 4/1/16. */ -class lossAugmentedClassifier[T](c:Learner) extends Learner("lossAugmentedClassifier") { +class lossAugmentedClassifier[T](c:Learner, cand_num: Int=1) extends Learner("lossAugmentedClassifier") { override def getInputType: String = { "dummy"} override def allowableValues: Array[String] = c.allowableValues()//{ Array[String]("false", "true") } @@ -18,8 +19,19 @@ class lossAugmentedClassifier[T](c:Learner) extends Learner("lossAugmentedClassi * problem we are looking for a minimizer */ override def scores(example: AnyRef): ScoreSet = { - val result: ScoreSet = c.scores(example)//new ScoreSet - result + if (cand_num==0) + print("There is no relevant component of this type in the head to be classified.") + val cf= c.asInstanceOf[SparseNetworkLBP] + val gold = cf.getLabeler.discreteValue(example) + val lLexicon = cf.getLabelLexicon + val resultS: ScoreSet = c.scores(example)//new ScoreSet + for (i <- 0 until lLexicon.size()) { + if (lLexicon.lookupKey(i).valueEquals(gold)) + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) + else + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1/(cand_num)) ) + } + resultS } override def write(printStream: PrintStream): Unit = ??? From ab79d5e32ed64f7d18c2e9a6444141373eb37107 Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 4 Apr 2016 13:23:59 -0500 Subject: [PATCH 045/118] -minor --- .../cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 0f2fb268..34f22284 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -63,7 +63,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE example=> tempclassifier.scores(example.asInstanceOf[AnyRef]) - //cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) + // cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[cf.LEFT](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) // x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) //x.buildWithConstraint(x.subjectTo.createInferenceCondition(dm,)) From 3288d9197e45912037c1172e22d9b3165b69b306 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 5 Apr 2016 11:24:44 -0500 Subject: [PATCH 046/118] -some fixes on feature generator --- .../classifier/SL_model/JoinSLtrain.scala | 2 +- .../SL_model/SL_FeatureGenerator.scala | 21 +++++++++++-------- .../SL_model/Saul_SL_Inference.scala | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 0c7ac2c4..5d730c4b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -31,7 +31,7 @@ object JoinSLtrain { para.CHECK_INFERENCE_OPT = false // model.config = new util.HashMap(); model.para = para - model.featureGenerator = new SL_FeatureGenerator + model.featureGenerator = new SL_FeatureGenerator(model.Factors) // model.lm=lexm // model.lm.setAllowNewFeatures(false) // para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 2811987b..f755b135 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -1,26 +1,28 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.{ IStructure, IInstance, AbstractFeatureGenerator } import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } /** Created by Parisa on 12/8/15. */ -class SL_FeatureGenerator[HEAD <: AnyRef] extends AbstractFeatureGenerator { +class SL_FeatureGenerator[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]]) extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { val myX = x.asInstanceOf[Saul_SL_Instance[HEAD]] val myY = y.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val fv = new FeatureVectorBuffer() var labelCount = 0 - for (i <- 0 until myX.ConstraintFactors.size) { - val c = myX.ConstraintFactors(i) - val candis: Seq[_] = c.getCandidates(myX.head) + var previousSize = 0 + var previousSize2 = 0 + factors.foreach{ + cf => + val candis: Seq[_] = cf.getCandidates(myX.head) val fvLocal = new FeatureVectorBuffer() - var previousSize = 0 - previousSize = 0 - for (ci <- candis) { - previousSize = fvLocal.toFeatureVector().getMaxIdx - val a = c.onClassifier.getExampleArray(ci) + previousSize=previousSize+previousSize2 + candis.foreach { + ci=> + val a = cf.onClassifier.getExampleArray((ci),true) val a0 = a(0).asInstanceOf[Array[Int]] var a1 = a(1).asInstanceOf[Array[Double]] val lab = myY.labels(labelCount) @@ -30,6 +32,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef] extends AbstractFeatureGenerator { } //val fv = new FeatureVectorBuffer(a0, a1) fvLocal.addFeature(a0, a1) + previousSize2 = fvLocal.toFeatureVector().getMaxIdx } fv.addFeature(fvLocal, previousSize) } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 34f22284..df4c362c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -63,7 +63,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE example=> tempclassifier.scores(example.asInstanceOf[AnyRef]) - // cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[cf.LEFT](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) + // cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[AnyRef](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) // x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) //x.buildWithConstraint(x.subjectTo.createInferenceCondition(dm,)) From 724e59eceb596c92af0b915294fe9ff4aee62af2 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sat, 9 Apr 2016 21:44:42 -0500 Subject: [PATCH 047/118] -finished feature generator --- .../classifier/SL_model/InitializeSL.scala | 112 ++++++++++-------- .../classifier/SL_model/JoinSLtrain.scala | 9 +- .../SL_model/SL_FeatureGenerator.scala | 65 +++++----- .../classifier/SL_model/SaulSLModel.scala | 8 +- .../SL_model/Saul_SL_Inference.scala | 38 ++++-- .../SL_model/Saul_SL_Instance.scala | 26 ++-- .../SL_model/lossAugmentedClassifier.scala | 2 +- 7 files changed, 151 insertions(+), 109 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala index 02210900..b1682d3e 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala @@ -1,59 +1,67 @@ - package edu.illinois.cs.cogcomp.saul.classifier.SL_model +package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit +import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP +import edu.illinois.cs.cogcomp.sl.core.SLProblem +import edu.illinois.cs.cogcomp.sl.util.WeightVector - import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit - import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP - import edu.illinois.cs.cogcomp.sl.core.SLProblem - import edu.illinois.cs.cogcomp.sl.util.WeightVector +import scala.collection.JavaConversions._ +import scala.collection.mutable.ListBuffer - import scala.collection.JavaConversions._ - /** - * Created by Parisa on 4/1/16. - */ - object InitializeSL{ +/** + * Created by Parisa on 4/1/16. + */ +object InitializeSL{ - def apply[HEAD<:AnyRef](sp:SLProblem , model:SaulSLModel[HEAD]): WeightVector = { - var myWeight: Array[Float]= Array() - model.Factors.foreach{ - cf => + def apply[HEAD<:AnyRef](sp:SLProblem , model:SaulSLModel[HEAD]): SaulSLModel[HEAD] = { + + model.Factors.foreach{ + cf => sp.instanceList.toList.zipWithIndex.foreach { - case (myIns,ind) => { - val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] - //for (i <- 0 until ins.ConstraintFactors.size) { - val candis: Seq[_] = cf.getCandidates(ins.head) - val ilearner = cf.onClassifier.asInstanceOf[SparseNetworkLBP] - val lLexicon = cf.onClassifier.getLabelLexicon - candis.foreach { - x => - val a = cf.onClassifier.getExampleArray(x) - val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures - val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues - val exampleLabels = a(2).asInstanceOf[Array[Int]] - val labelValues = a(3).asInstanceOf[Array[Double]] - val label = exampleLabels(0) - var N = ilearner.net.size(); - if (label >= N || ilearner.net.get(label) == null) { - ilearner.iConjuctiveLables = ilearner.iConjuctiveLables | ilearner.getLabelLexicon.lookupKey(label).isConjunctive(); - var ltu: LinearThresholdUnit = ilearner.getbaseLTU - ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); - ilearner.net.set(label, ltu); - N = label + 1; - } - } // for each candidate - } // for each constraintFactor - }//end case - }//for each example -model.Factors.foreach( + case (myIns,ind) => { + val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] + //for (i <- 0 until ins.ConstraintFactors.size) { + val candis: Seq[_] = cf.getCandidates(ins.head) + val ilearner = cf.onClassifier.asInstanceOf[SparseNetworkLBP] + val lLexicon = cf.onClassifier.getLabelLexicon + candis.foreach { + x => + val a = cf.onClassifier.getExampleArray(x) + val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures + val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues + val exampleLabels = a(2).asInstanceOf[Array[Int]] + val labelValues = a(3).asInstanceOf[Array[Double]] + val label = exampleLabels(0) + var N = ilearner.net.size(); + if (label >= N || ilearner.net.get(label) == null) { + ilearner.iConjuctiveLables = ilearner.iConjuctiveLables | ilearner.getLabelLexicon.lookupKey(label).isConjunctive(); + var ltu: LinearThresholdUnit = ilearner.getbaseLTU + ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); + ilearner.net.set(label, ltu); + N = label + 1; + } + } // for each candidate + } // for each constraintFactor + }//end case + }//for each example + var wvLength=0 + var lt: ListBuffer[Array[Float]] = ListBuffer() + model.Factors.foreach( + x => { -x => - for (i <- 0 until x.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) - { - val w1= x.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector - for (j<- 0 until w1.size()) - myWeight +:= w1.getWeight(j).asInstanceOf[Float] - }) - val wv= new WeightVector(myWeight) - wv - }//end of apply + val sparseNet= x.onClassifier.asInstanceOf[SparseNetworkLBP] + val temp= (sparseNet.getLexicon.size()) - }// end of object + for (i <- 0 until sparseNet.net.size()) { + val t= Array.fill[Float](temp)(0) + lt= lt:+ t + wvLength = wvLength + temp + } + println(sparseNet.getLexicon.size(), "*",sparseNet.getLabelLexicon.size()) + }) + val myWeight = Array.fill[Float](wvLength)(0) + val wv= new WeightVector(myWeight) + val m= new SaulSLModel[HEAD](model.Factors,lt) + m + }//end f apply +}// end of object diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 5d730c4b..5e610919 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -12,7 +12,7 @@ import scala.reflect._ object JoinSLtrain { def apply[HEAD <: AnyRef]( dm: DataModel, - cls: List[ConstrainedClassifier[_, HEAD]] + cls: List[ConstrainedClassifier[_<:AnyRef, HEAD]] )( implicit headTag: ClassTag[HEAD] @@ -21,17 +21,17 @@ object JoinSLtrain { trainSSVM[HEAD](dm, cls) } - def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { + def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_<:AnyRef, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { //var lexm: Lexiconer = new Lexiconer() - val model = new SaulSLModel(cls) val sp = SL_IOManager.makeSLProblem(dm, cls) + val model = InitializeSL(sp, new SaulSLModel(cls)) model.infSolver = new Saul_SL_Inference(model.Factors, dm) val para = new SLParameters para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false // model.config = new util.HashMap(); model.para = para - model.featureGenerator = new SL_FeatureGenerator(model.Factors) + model.featureGenerator = new SL_FeatureGenerator(model) // model.lm=lexm // model.lm.setAllowNewFeatures(false) // para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature @@ -40,7 +40,6 @@ object JoinSLtrain { // println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) //println("num?:" + model.lm.getNumOfFeature) - InitializeSL(sp,model) model.wv = learner.train(sp) // model.saveModel("modelname.SAUL"); diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index f755b135..f554ca7d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -1,43 +1,54 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.sl.core.{ IStructure, IInstance, AbstractFeatureGenerator } -import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } +import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP +import edu.illinois.cs.cogcomp.sl.core.{AbstractFeatureGenerator, IInstance, IStructure} +import edu.illinois.cs.cogcomp.sl.util.{FeatureVectorBuffer, IFeatureVector} /** Created by Parisa on 12/8/15. */ -class SL_FeatureGenerator[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]]) extends AbstractFeatureGenerator { +class SL_FeatureGenerator[HEAD <: AnyRef](model:SaulSLModel[HEAD]) extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { val myX = x.asInstanceOf[Saul_SL_Instance[HEAD]] val myY = y.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val fv = new FeatureVectorBuffer() - var labelCount = 0 - var previousSize = 0 - var previousSize2 = 0 - factors.foreach{ - cf => - val candis: Seq[_] = cf.getCandidates(myX.head) - val fvLocal = new FeatureVectorBuffer() - previousSize=previousSize+previousSize2 - candis.foreach { - ci=> - val a = cf.onClassifier.getExampleArray((ci),true) - val a0 = a(0).asInstanceOf[Array[Int]] - var a1 = a(1).asInstanceOf[Array[Double]] - val lab = myY.labels(labelCount) - labelCount = labelCount + 1 - if (!lab.equals("true")) { - a1 = Array.fill[Double](a1.length)(0) + var ltuNum = 0 + var factorOffset = 0 + model.Factors.zipWithIndex.foreach{ + + case (cf,indF) => + val candis: Seq[_] = cf.getCandidates(myX.head) + val sparseNet= cf.onClassifier.asInstanceOf[SparseNetworkLBP] + val fvLocal = new FeatureVectorBuffer() + var localOffset = 0 + candis.zipWithIndex.foreach { + case (ci,indC) => + val a = sparseNet.getExampleArray(ci,false) + var a0 = a(0).asInstanceOf[Array[Int]] + var a1 = a(1).asInstanceOf[Array[Double]] + val lab = myY.labels(indC) + for (netI<-0 until sparseNet.net.size()){ + if (netI!=0) + localOffset= localOffset+ model.LtuTemplates(ltuNum+netI-1).length + else localOffset =0 + if (!sparseNet.getLabelLexicon.lookupKey(netI).valueEquals(lab)) + { + a1 = Array() + a0 = Array() + } + fvLocal.addFeature(new FeatureVectorBuffer(a0,a1),localOffset) + } + } + ltuNum=ltuNum+sparseNet.net.size() + + if (indF>0) + factorOffset = factorOffset + model.Factors(indF-1).onClassifier.getLexicon.size() * model.Factors(indF-1).onClassifier.getLabelLexicon.size() + + fv.addFeature(fvLocal, factorOffset) } - //val fv = new FeatureVectorBuffer(a0, a1) - fvLocal.addFeature(a0, a1) - previousSize2 = fvLocal.toFeatureVector().getMaxIdx - } - fv.addFeature(fvLocal, previousSize) - } fv.toFeatureVector() + } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala index 612e1098..641514ec 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala @@ -3,9 +3,13 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.SLModel +import scala.collection.mutable.ListBuffer + /** * Created by Parisa on 4/1/16. */ -class SaulSLModel[HEAD<: AnyRef](cls: List[ConstrainedClassifier[_,HEAD]]) extends SLModel { - var Factors: List[ConstrainedClassifier[_,HEAD]]= cls +class SaulSLModel[HEAD<: AnyRef](cls: List[ConstrainedClassifier[_<:AnyRef,HEAD]], listBuffer: ListBuffer[Array[Float]]=ListBuffer()) extends SLModel { + var Factors: List[ConstrainedClassifier[_<:AnyRef,HEAD]]= cls + var LtuTemplates: ListBuffer[Array[Float]]= listBuffer + } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index df4c362c..51fc764b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,5 +1,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import edu.illinois.cs.cogcomp.lbjava.classify.Classifier +import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseWeightVector} import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -10,7 +12,7 @@ import scala.reflect.ClassTag /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { +class Saul_SL_Inference[_<:AnyRef,HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:AnyRef,HEAD]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { val a=factors val dataM=dm override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { @@ -27,15 +29,32 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE } override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { //TODO check - var l: Float = 0 + var TotalLoss: Float = 0 val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[HEAD]] - for (i <- 0 until myGold.labels.size) { + var count = 0 + a.foreach { + x=> + var localLoss=0 + val oracle: Classifier = x.onClassifier.getLabeler() + val candidates= x.getCandidates(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) + candidates.foreach{ + ci => + if (myGold.labels(count)!=(myPred.labels(count))) + localLoss = localLoss+1 + count=count+1 + } + TotalLoss=TotalLoss+localLoss/candidates.size - if (myGold.labels(i)!=(myPred.labels(i))) - l = l+1 +// for (i <- 0 until myGold.labels.size) { +// if (myGold.labels(i)!=(myPred.labels(i))) +// TotalLoss = TotalLoss+1 +// } +// } - l + TotalLoss=TotalLoss/factors.size + + TotalLoss } override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { @@ -54,15 +73,16 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE } } - - // val newFactors=List[ConstrainedClassifier[_,HEAD]] + val FactorsNum=a.size +/// val newFactors=List[ConstrainedClassifier[_,HEAD]] a.foreach { cf => - val tempclassifier = new lossAugmentedClassifier[cf.LEFT](cf.onClassifier) + val tempclassifier = new lossAugmentedClassifier[cf.LEFT](cf.onClassifier, cf.getCandidates(myIns.head).size*FactorsNum) cf.getCandidates(myIns.head).foreach { example=> tempclassifier.scores(example.asInstanceOf[AnyRef]) + myStruct.labels += cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[cf.LEFT](dm, new GurobiHook()), new lossAugmentedClassifier[cf.LEFT](cf.onClassifier))(example.asInstanceOf[cf.LEFT]) // cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[AnyRef](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) // x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index df7abdfc..4557af99 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -22,19 +22,19 @@ case class Saul_SL_Instance[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEA l.foreach { (c: ConstrainedClassifier[_, HEAD]) => //val oracle: Classifier = c.onClassifier.getLabeler() - val cands: Seq[_] = c.getCandidates(x) - for (ci <- cands) { - // c.classifier.discreteValue(ci) //prediction result - // oracle.discreteValue(ci) // true lable - // return a Feature values and indexs - val t = c.onClassifier.getExampleArray(ci, true) - // val l: java.util.List[String]= c.onClassifier.getCurrentLexicon.getMap.keys.map(x=> x.toString).toList - // inputFeatures.add(t) - - // print("") - // fv = SUtils.makeFeatures(l).toFeatureVector(); - - } // yield inputFeatures +// val cands: Seq[_] = c.getCandidates(x) +// for (ci <- cands) { +// // c.classifier.discreteValue(ci) //prediction result +// // oracle.discreteValue(ci) // true lable +// // return a Feature values and indexs +// val t = c.onClassifier.getExampleArray(ci, true) +// // val l: java.util.List[String]= c.onClassifier.getCurrentLexicon.getMap.keys.map(x=> x.toString).toList +// // inputFeatures.add(t) +// +// // print("") +// // fv = SUtils.makeFeatures(l).toFeatureVector(); +// +// } // yield inputFeatures // val a0 = a(0).asInstanceOf[Array[Int]] ConstraintFactors += (c) //TODO probably we need to remove this, it seems to be redundant diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala index 45cc884c..39fcd8d4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala @@ -8,7 +8,7 @@ import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP /** * Created by Parisa on 4/1/16. */ -class lossAugmentedClassifier[T](c:Learner, cand_num: Int=1) extends Learner("lossAugmentedClassifier") { +class lossAugmentedClassifier[T<:AnyRef](c:Learner, cand_num: Int=1) extends Learner("lossAugmentedClassifier") { override def getInputType: String = { "dummy"} override def allowableValues: Array[String] = c.allowableValues()//{ Array[String]("false", "true") } From 900394d0eba1d8f8361141f3a37a6031ddc6f724 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 14 Apr 2016 20:59:02 -0500 Subject: [PATCH 048/118] -some minor trial and error --- .../classifier/SL_model/JoinSLtrain.scala | 14 +----- .../saul/classifier/SL_model/SaulSLTest.scala | 2 - .../SL_model/Saul_SL_Inference.scala | 40 +++++++++++------- .../SL_model/Saul_SL_Instance.scala | 26 +----------- .../SL_model/lossAugmentedClassifier.scala | 4 +- .../SL_SVM/iJLIS/.GraphStructure.java.swp | Bin 12288 -> 0 bytes .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 12 ------ .../EntityRelationClassifiers.scala | 22 +++++----- .../EntityRelationDataModel.scala | 7 +-- .../EntityRelationSensors.scala | 6 +-- .../SL_SVM/iJLIS/ERFeatureGenerator.java | 2 +- .../SL_SVM/iJLIS/ERiStructure.java | 2 +- .../SL_SVM/iJLIS/ERqInstance.java | 2 +- .../SL_SVM/iJLIS/Nodevalues.java | 2 +- .../SL_SVM/iJLIS/Runner.java | 0 .../SL_SVM/iJLIS/Runner.scala | 11 +++-- .../SL_SVM/iJLIS/SUtils.java | 2 +- .../SL_SVM/iJLIS/iERinference.scala | 2 +- .../SL_SVM/iJLIS/iERjavaInference.java | 0 .../SL_SVM/iJLIS/mytest.ssvm.model | Bin .../SL_SVM/iJLIS/namedata-test | 0 .../SL_SVM/iJLIS/namedata-train | 0 .../SL_SVM/iJLIS/names | 0 .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 2 +- .../SL_SVM/iJLIS2/ERIOManager.scala | 6 +-- .../SL_SVM/iJLIS2/ERiStructurePL.java | 2 +- .../SL_SVM/iJLIS2/ERqInstancePL.java | 2 +- .../SL_SVM/iJLIS2/JointER$subjectto.java | 0 .../SL_SVM/iJLIS2/JointER.java | 0 .../SL_SVM/iJLIS2/Labels.scala | 2 +- .../SL_SVM/iJLIS2/RunnerPL.scala | 0 .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 0 .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 12 ++++++ 33 files changed, 76 insertions(+), 106 deletions(-) delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/.GraphStructure.java.swp delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/ERFeatureGenerator.java (90%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/ERiStructure.java (94%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/ERqInstance.java (90%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/Nodevalues.java (55%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/Runner.java (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/Runner.scala (90%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/SUtils.java (95%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/iERinference.scala (97%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/iERjavaInference.java (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/mytest.ssvm.model (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/namedata-test (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/namedata-train (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS/names (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/ERFeatureGenerator.java (97%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/ERIOManager.scala (79%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/ERiStructurePL.java (93%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/ERqInstancePL.java (93%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/JointER$subjectto.java (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/JointER.java (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/Labels.scala (92%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/RunnerPL.scala (100%) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/{EntityMentionRelation => EntityRelation}/SL_SVM/iJLIS2/iERjavaInferencePL.java (100%) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 5e610919..a25eddad 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -22,28 +22,16 @@ object JoinSLtrain { } def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_<:AnyRef, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { - //var lexm: Lexiconer = new Lexiconer() val sp = SL_IOManager.makeSLProblem(dm, cls) val model = InitializeSL(sp, new SaulSLModel(cls)) - model.infSolver = new Saul_SL_Inference(model.Factors, dm) + model.infSolver = new Saul_SL_Inference[HEAD](model.Factors, dm) val para = new SLParameters para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false - // model.config = new util.HashMap(); model.para = para model.featureGenerator = new SL_FeatureGenerator(model) - // model.lm=lexm - // model.lm.setAllowNewFeatures(false) - // para.TOTAL_NUMBER_FEATURE = 3 * model.lm.getNumOfFeature para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - - // println("num?:"+(model.featureGenerator).asInstanceOf[ERFeatureGenerator].getlexicon().getNumOfFeature) - //println("num?:" + model.lm.getNumOfFeature) model.wv = learner.train(sp) - -// model.saveModel("modelname.SAUL"); - - } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala index d36a8608..4e6bde3f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala @@ -28,6 +28,4 @@ object SaulSLTest { evaluate(a,sp.goldStructureList.toList, model) } - - } \ No newline at end of file diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 51fc764b..6e76506b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -12,8 +12,9 @@ import scala.reflect.ClassTag /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[_<:AnyRef,HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:AnyRef,HEAD]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { +class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:AnyRef,HEAD]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { val a=factors + a.head.tType val dataM=dm override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { @@ -45,13 +46,7 @@ class Saul_SL_Inference[_<:AnyRef,HEAD <: AnyRef](factors: List[ConstrainedClass count=count+1 } TotalLoss=TotalLoss+localLoss/candidates.size - -// for (i <- 0 until myGold.labels.size) { -// if (myGold.labels(i)!=(myPred.labels(i))) -// TotalLoss = TotalLoss+1 -// } -// - } + } TotalLoss=TotalLoss/factors.size TotalLoss @@ -77,18 +72,31 @@ class Saul_SL_Inference[_<:AnyRef,HEAD <: AnyRef](factors: List[ConstrainedClass /// val newFactors=List[ConstrainedClassifier[_,HEAD]] a.foreach { cf => - val tempclassifier = new lossAugmentedClassifier[cf.LEFT](cf.onClassifier, cf.getCandidates(myIns.head).size*FactorsNum) - cf.getCandidates(myIns.head).foreach { - example=> + val tempclassifier = new lossAugmentedClassifier(cf.onClassifier, cf.getCandidates(myIns.head).size*FactorsNum) + cf.getCandidates(myIns.head.asInstanceOf[HEAD]).foreach { + (example )=> + + // val tic=example.asInstanceOf[cf.LEFT] + val g1= tempclassifier.scores(example) - tempclassifier.scores(example.asInstanceOf[AnyRef]) - myStruct.labels += cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[cf.LEFT](dm, new GurobiHook()), new lossAugmentedClassifier[cf.LEFT](cf.onClassifier))(example.asInstanceOf[cf.LEFT]) - // cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[AnyRef](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) - // x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) + // type t= cf.LEFT + // type h = HEAD + val temp1= t.runtimeClass + // val b= example.asInstanceOf[cf.LEFT] + val g2= cf.onClassifier.scores(example) + + // cf.subjectTo.createInferenceCondition[cf.LEFT](dm, new GurobiHook()) + // cf(example)//.onClassifier. + //cf.buildWithConstraint(cf.subjectTo.createInferenceCondition(dm, new GurobiHook())) + // x: T => buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance()).convertToType[T], onClassifier)(x) + myStruct.labels += + cf.buildWithConstraint(cf.subjectTo.createInferenceCondition(dm, new GurobiHook()), tempclassifier)(example.asInstanceOf[cf.LEFT]) + // cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[AnyRef](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) +// x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) //x.buildWithConstraint(x.subjectTo.createInferenceCondition(dm,)) // val a = new ConstrainedClassifier[_,HEAD](dm,new lossAugmentedClassifier[_](x.onClassifier)){ def subjectTo = null} //EntityRelationConstraints.relationArgumentConstraints} {} - } + } } a.foreach { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index 4557af99..5c1dc60f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -3,7 +3,6 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IInstance import edu.illinois.cs.cogcomp.sl.util.IFeatureVector - import scala.collection.mutable.ListBuffer /** Created by Parisa on 12/10/15. @@ -11,35 +10,14 @@ import scala.collection.mutable.ListBuffer * (i.e. the base classifier of each constraint classifier) based on the features of IInstances */ case class Saul_SL_Instance[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEAD]], x: HEAD) extends IInstance { - - // val inputFeatures:ListBuffer[Array[Object]]= ListBuffer() // List var ConstraintFactors: ListBuffer[ConstrainedClassifier[_, HEAD]] =ListBuffer() - - //List var fv: IFeatureVector = null; val head: HEAD = x def apply = { l.foreach { (c: ConstrainedClassifier[_, HEAD]) => - //val oracle: Classifier = c.onClassifier.getLabeler() -// val cands: Seq[_] = c.getCandidates(x) -// for (ci <- cands) { -// // c.classifier.discreteValue(ci) //prediction result -// // oracle.discreteValue(ci) // true lable -// // return a Feature values and indexs -// val t = c.onClassifier.getExampleArray(ci, true) -// // val l: java.util.List[String]= c.onClassifier.getCurrentLexicon.getMap.keys.map(x=> x.toString).toList -// // inputFeatures.add(t) -// -// // print("") -// // fv = SUtils.makeFeatures(l).toFeatureVector(); -// -// } // yield inputFeatures - // val a0 = a(0).asInstanceOf[Array[Int]] - ConstraintFactors += (c) //TODO probably we need to remove this, it seems to be redundant - - // val a1 = a(1).asInstanceOf[Array[Double]] - } + ConstraintFactors += (c) + } } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala index 39fcd8d4..6422861d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala @@ -5,10 +5,12 @@ import edu.illinois.cs.cogcomp.lbjava.classify.{FeatureVector, ScoreSet} import edu.illinois.cs.cogcomp.lbjava.learn.Learner import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP +import scala.reflect.ClassTag + /** * Created by Parisa on 4/1/16. */ -class lossAugmentedClassifier[T<:AnyRef](c:Learner, cand_num: Int=1) extends Learner("lossAugmentedClassifier") { +class lossAugmentedClassifier[T<:AnyRef](c:Learner, cand_num: Int=1)(implicit t:ClassTag[T] ) extends Learner("lossAugmentedClassifier") { override def getInputType: String = { "dummy"} override def allowableValues: Array[String] = c.allowableValues()//{ Array[String]("false", "true") } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/.GraphStructure.java.swp b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/.GraphStructure.java.swp deleted file mode 100644 index 0e11b8284cd7cb30c389d6ef2af98461757d6e5c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2%WfP+6oxD88c0A~1R@G5hE0#1R8Im?Bs;c@A|-M#LCB6#2w9Z7YdkgXo2$BK zVwsQ!V1W<|7I^?9kaz;vA%TT*thRXx(kXQ#Kl z{sF%v-evf_$k@-{u5NvN`R=t>#*FP{CK}4bwfyf#Mk8elDMBlB9P2dGR;Z{vGUoGU z!eE@meRZxU&Wm1iuI|btkChFq34=uHG_awJWst;mhhW+vmquF|=<6Hno53|B^TB3e z%CIPn5<@wXN21aVGC&4u11H%#7tZ(G`P-eh_{%TdBr#-w43GgbKnBPF86X2>fDAlE z28#RyyN~C6rg`Rz&GEz|$L5j_WPl8i0Wv@a$N(8217v^9JYzqB2jB`=0vEwK&;>qV;30DT75oBz1Yd#s;4^Rta;Bf}-G3MQ4o@W#)OH+r~CL)+qV-F=l;xu7XkV_u~^+v>OK_ucq? zJza`cg®Txf5$)%;HMKPr_uSWi)aorVe%o#l0)dNFTcf(^N&;?cGcdAN(;-^A*`<7Mpk?w0Nk-A%VL17pU8uO z8ef>)-oiV_@mCBKzs2?Bxv@~yt=y zX1igQUPY3h16+e%Ur}tniO9Y u;_B=xKb`uR(K_ubqpiQrnf(h^neZO~ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala deleted file mode 100644 index e9d6e041..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ /dev/null @@ -1,12 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS3 - -import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationConstrainedClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.EntityRelationDataModel - -/** Created by Parisa on 12/8/15. - */ -object mySL_Saul_TestApp extends App { - EntityRelationDataModel.populateWithConll() - JoinSLtrain(EntityRelationDataModel, List(perConstraintClassifier,orgConstraintClassifier, locConstraintClassifier,liveIn_P_O_relationClassifier,work_P_O_relationClassifier)) -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala index 6c48ec6a..4f24c448 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala @@ -1,10 +1,10 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.lbjava.learn.{ SparsePerceptron, StochasticGradientDescent, SupportVectorMachine, SparseNetworkLearner } -import edu.illinois.cs.cogcomp.saul.classifier.Learnable +import edu.illinois.cs.cogcomp.lbjava.learn.SparsePerceptron +import edu.illinois.cs.cogcomp.saul.classifier.{Learnable, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saul.datamodel.property.Property -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawSentence, ConllRawToken, ConllRelation } +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRawSentence, ConllRawToken, ConllRelation} import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ object EntityRelationClassifiers { @@ -12,7 +12,7 @@ object EntityRelationClassifiers { /** independent entity classifiers */ object OrganizationClassifier extends Learnable[ConllRawToken](EntityRelationDataModel) { def label: Property[ConllRawToken] = entityType is "Org" - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP override def feature = using(word, windowWithin[ConllRawSentence](-2, 2, List(pos)), phrase, containsSubPhraseMent, containsSubPhraseIng, wordLen) // The gazetteer properties are temporarily removed: containsInPersonList, containsInCityList @@ -22,7 +22,7 @@ object EntityRelationClassifiers { def label: Property[ConllRawToken] = entityType is "Peop" override def feature = using(word, windowWithin[ConllRawSentence](-2, 2, List(pos)), phrase, containsSubPhraseMent, containsSubPhraseIng, wordLen) - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP // The gazetteer properties are temporarily removed: containsInPersonList, containsInCityList } @@ -30,7 +30,7 @@ object EntityRelationClassifiers { def label: Property[ConllRawToken] = entityType is "Loc" override def feature = using(word, windowWithin[ConllRawSentence](-2, 2, List(pos)), phrase, containsSubPhraseMent, containsSubPhraseIng, wordLen) - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP // The gazetteer properties are temporarily removed: containsInPersonList, containsInCityList } @@ -38,18 +38,18 @@ object EntityRelationClassifiers { object WorksForClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { def label: Property[ConllRelation] = relationType is "Work_For" override def feature = using(relFeature, relPos) - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP } object LivesInClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { def label: Property[ConllRelation] = relationType is "Live_In" override def feature = using(relFeature, relPos) - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP } object OrgBasedInClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "OrgBased_In" - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP } object LocatedInClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { @@ -61,13 +61,13 @@ object EntityRelationClassifiers { object WorksForClassifierPipeline extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "Work_For" override def feature = using(relFeature, relPos, entityPrediction) - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP } object LivesInClassifierPipeline extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "Live_In" override def feature = using(relFeature, relPos, entityPrediction) - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP } def saveEntityModels() = { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala index 9d9d9354..4d178a38 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala @@ -1,13 +1,10 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawSentence, ConllRawToken, ConllRelation } -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_Reader +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRawSentence, ConllRawToken, ConllRelation} import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationSensors._ -import scala.collection.JavaConversions._ - object EntityRelationDataModel extends DataModel { /** Nodes & Edges */ @@ -114,7 +111,7 @@ object EntityRelationDataModel extends DataModel { def populateWithConll() = { sentences.populate(EntityRelationSensors.sentencesTrain) - sentences.populate(EntityRelationSensors.sentencesTest, train = false) + //sentences.populate(EntityRelationSensors.sentencesTest, train = false) } def populateWithConllSmallSet() = { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index 340f1b65..fc26ced6 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -6,8 +6,8 @@ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{ Conll import scala.collection.JavaConverters._ object EntityRelationSensors { - val path = "../data/" - val resourcePath = "../saul-examples/src/main/resources/EntityMentionRelation/" + val path = "./data/" + val resourcePath = "./saul-examples/src/main/resources/EntityMentionRelation/" def readConllData(dir: String): (List[ConllRawSentence], List[ConllRelation], List[ConllRawToken]) = { val reader = new Conll04_Reader(dir, "Token") @@ -17,7 +17,7 @@ object EntityRelationSensors { } lazy val (sentencesAll, relationsAll, entitiesAll) = readConllData(path + "EntityMentionRelation/conll04.corp") - lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_train.corp") + lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_small.corp") lazy val (sentencesTest, relationsTest, entitiesTest) = readConllData(path + "EntityMentionRelation/conll04_test.corp") lazy val (sentencesSmallSet, testRelationsSmallSet, entitiesSmallSet) = readConllData(resourcePath + "conll04-smallDocument.txt") diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERFeatureGenerator.java similarity index 90% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERFeatureGenerator.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERFeatureGenerator.java index 661152c7..0f979e72 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERFeatureGenerator.java @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; import edu.illinois.cs.cogcomp.sl.core.IInstance; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERiStructure.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERiStructure.java similarity index 94% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERiStructure.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERiStructure.java index 8cb6a76f..7f2b25d6 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERiStructure.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERiStructure.java @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; import edu.illinois.cs.cogcomp.sl.core.IStructure; import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERqInstance.java similarity index 90% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERqInstance.java index 003979c0..fc04034f 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/ERqInstance.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERqInstance.java @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; import edu.illinois.cs.cogcomp.sl.core.IInstance; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Nodevalues.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Nodevalues.java similarity index 55% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Nodevalues.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Nodevalues.java index 651d3be7..8fa4fa81 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Nodevalues.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Nodevalues.java @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; /** * Created by parisakordjamshidi on 21/09/14. diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.java similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.scala similarity index 90% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.scala index 30e7c10c..15ca80cf 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/Runner.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.scala @@ -1,9 +1,8 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS import java.util import java.util.{ ArrayList, List } - -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_Reader import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import edu.illinois.cs.cogcomp.sl.util.{ Lexiconer, WeightVector } @@ -12,7 +11,7 @@ object Runner { var lexm: Lexiconer = new Lexiconer() - def readXY(cr: Conll04_ReaderNew, outlist: => List[IStructure], sclist: => List[IInstance], l: Int, u: Int) { + def readXY(cr: Conll04_Reader, outlist: => List[IStructure], sclist: => List[IInstance], l: Int, u: Int) { var i: Int = l while (i < u) { //cr.instances.size){ val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) @@ -26,7 +25,7 @@ object Runner { } def trainSSVM(modelname: String): Unit = { - var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") + var cr = new Conll04_Reader("./data/EntityMentionRelation/conll04.corp", "Pair") var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) readXY(cr, outlist, sclist, 1, 100) @@ -59,7 +58,7 @@ object Runner { Runner.lexm = model.lm val learned_wv: WeightVector = model.wv val inference_proc: iERinference = model.infSolver.asInstanceOf[iERinference] - var cr = new Conll04_ReaderNew("./data/EntityMentionRelation/conll04.corp", "Pair") + var cr = new Conll04_Reader("./data/EntityMentionRelation/conll04.corp", "Pair") var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) readXY(cr, outlist, sclist, 101, 200) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/SUtils.java similarity index 95% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/SUtils.java index 86551b99..4827f386 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/SUtils.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/SUtils.java @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS; +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; //import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.Runner; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERinference.scala similarity index 97% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERinference.scala index efa40558..9a1c3fc7 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERinference.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERinference.scala @@ -1,5 +1,5 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS import java.util.{ ArrayList, List } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERjavaInference.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERjavaInference.java similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/iERjavaInference.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERjavaInference.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/mytest.ssvm.model b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/mytest.ssvm.model similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/mytest.ssvm.model rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/mytest.ssvm.model diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/namedata-test b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/namedata-test similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/namedata-test rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/namedata-test diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/namedata-train b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/namedata-train similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/namedata-train rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/namedata-train diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/names b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/names similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS/names rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/names diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java similarity index 97% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java index 543ef0ea..df28067d 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java @@ -1,4 +1,4 @@ - package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; + package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2; import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; import edu.illinois.cs.cogcomp.sl.core.IInstance; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala similarity index 79% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala index 537744bf..8cedf488 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERIOManager.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala @@ -1,11 +1,11 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2 -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_ReaderNew +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{Conll04_Reader} import edu.illinois.cs.cogcomp.sl.core.SLProblem object ERIOManager { - def readXY(cr: Conll04_ReaderNew, l: Int, u: Int): SLProblem = { + def readXY(cr: Conll04_Reader, l: Int, u: Int): SLProblem = { var sp: SLProblem = new SLProblem() var i = l while (i < u) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERiStructurePL.java similarity index 93% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERiStructurePL.java index 4832a67f..6a6deecb 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERiStructurePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERiStructurePL.java @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2; /** * Created by parisakordjamshidi on 19/09/14. diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERqInstancePL.java similarity index 93% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERqInstancePL.java index 9ef947a7..08f93b0f 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/ERqInstancePL.java +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERqInstancePL.java @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2; +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2; import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; import edu.illinois.cs.cogcomp.sl.core.IInstance; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/JointER$subjectto.java similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER$subjectto.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/JointER$subjectto.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/JointER.java similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/JointER.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/JointER.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/Labels.scala similarity index 92% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/Labels.scala index 51a3f079..104f7048 100755 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/Labels.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/Labels.scala @@ -1,4 +1,4 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2 /** Created by parisakordjamshidi on 23/09/14. */ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/RunnerPL.scala similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/RunnerPL.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/RunnerPL.scala diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java similarity index 100% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityMentionRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala new file mode 100644 index 00000000..09034724 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -0,0 +1,12 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS3 + +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel + +/** Created by Parisa on 12/8/15. + */ +object mySL_Saul_TestApp extends App { + EntityRelationDataModel.populateWithConll() + JoinSLtrain(EntityRelationDataModel, List(PerConstrainedClassifier,OrgConstrainedClassifier, LocConstrainedClassifier,LivesIn_PerOrg_relationConstrainedClassifier,WorksFor_PerOrg_ConstrainedClassifier)) +} From a217d8e2e372fd29f950f9c7b741d955e02fd833 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 14 Apr 2016 21:01:13 -0500 Subject: [PATCH 049/118] added the test --- .../EntityRelation/SL_SVM/iJLIS3/test.scala | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala new file mode 100644 index 00000000..77efe319 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala @@ -0,0 +1,42 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS3 + +import scala.reflect.ClassTag + +object Main { + case class typeHolder [HEAD](a: List[TwoTypeClass[_,HEAD]], x: HEAD){ + val head: HEAD = x + } + +abstract class TwoTypeClass[T , HEAD ](val value: String)(implicit val xTag: ClassTag[T], + implicit val yTag: ClassTag[HEAD]) { + type L = T + type R = HEAD + + def gen(head: HEAD): Seq[T]={ + val s:Seq[T] = null + s + } + } + + + def creator[HEAD](a : TwoTypeClass[_,HEAD ])( x: typeHolder) : Unit = { + + def subCreator(x:typeHolder)={ + x.head + } + } + def main(args: Array[String]){ + val x: String= null + def funtionOfType[HEAD](a : List[TwoTypeClass[_,HEAD]])(x:typeHolder) : Unit = { + a.foreach({ + cf => + val t=cf.gen(x.head.asInstanceOf[HEAD]) + t.foreach { + x=> creator(cf)_ + + } + + }) + } + } +} From 54aaac98ba8f86b3c3d986e0b2599214ba8d6647 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 14 Apr 2016 22:25:01 -0500 Subject: [PATCH 050/118] -update the scorer classifier inside ConstraintClassifier -check the zero candidate number case for loss --- .../classifier/ConstrainedClassifier.scala | 13 +++ .../SL_model/Saul_SL_Inference.scala | 43 +++------- .../SL_model/lossAugmentedClassifier.scala | 4 +- .../EntityRelation/SL_SVM/iJLIS3/test.scala | 83 +++++++++---------- 4 files changed, 65 insertions(+), 78 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 2425392b..f24915f9 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -4,6 +4,7 @@ import edu.illinois.cs.cogcomp.lbjava.classify.TestDiscrete import edu.illinois.cs.cogcomp.lbjava.infer._ import edu.illinois.cs.cogcomp.lbjava.learn.Learner import edu.illinois.cs.cogcomp.lbjava.parse.Parser +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.lossAugmentedClassifier import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -11,6 +12,7 @@ import edu.illinois.cs.cogcomp.saul.datamodel.edge.Edge import edu.illinois.cs.cogcomp.saul.lbjrelated.LBJClassifierEquivalent import edu.illinois.cs.cogcomp.saul.parser.LBJIteratorParserScala +import scala.collection.mutable.ListBuffer import scala.reflect.ClassTag abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataModel, val onClassifier: Learner)( @@ -139,6 +141,17 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo cls.discreteValue(t) } } + def refineScorer(h:HEAD,normalizer: Int): ListBuffer[String] ={ + + val tempclassifier = new lossAugmentedClassifier(onClassifier, normalizer) //cf.getCandidates(myIns.head).size*FactorsNum) + var v= ListBuffer[String]() + getCandidates(h).foreach { + (example) => + val g1 = tempclassifier.scores(example) + v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance()).convertToType[T], tempclassifier)(example) + } + v + } def buildWithConstraint(inferenceCondition: InferenceCondition[T, HEAD])(t: T): String = { buildWithConstraint(inferenceCondition, onClassifier)(t) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 6e76506b..910e674b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,7 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.classify.Classifier -import edu.illinois.cs.cogcomp.lbjava.infer.GurobiHook import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseWeightVector} import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -45,7 +44,8 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:A localLoss = localLoss+1 count=count+1 } - TotalLoss=TotalLoss+localLoss/candidates.size + if (candidates.size!=0) + TotalLoss=TotalLoss+localLoss/candidates.size } TotalLoss=TotalLoss/factors.size @@ -72,40 +72,17 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:A /// val newFactors=List[ConstrainedClassifier[_,HEAD]] a.foreach { cf => - val tempclassifier = new lossAugmentedClassifier(cf.onClassifier, cf.getCandidates(myIns.head).size*FactorsNum) - cf.getCandidates(myIns.head.asInstanceOf[HEAD]).foreach { - (example )=> - // val tic=example.asInstanceOf[cf.LEFT] - val g1= tempclassifier.scores(example) - - // type t= cf.LEFT - // type h = HEAD - val temp1= t.runtimeClass - - // val b= example.asInstanceOf[cf.LEFT] - val g2= cf.onClassifier.scores(example) - - // cf.subjectTo.createInferenceCondition[cf.LEFT](dm, new GurobiHook()) - // cf(example)//.onClassifier. - //cf.buildWithConstraint(cf.subjectTo.createInferenceCondition(dm, new GurobiHook())) - // x: T => buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance()).convertToType[T], onClassifier)(x) - myStruct.labels += - cf.buildWithConstraint(cf.subjectTo.createInferenceCondition(dm, new GurobiHook()), tempclassifier)(example.asInstanceOf[cf.LEFT]) - // cf.buildWithConstraint(cf.subjectTo.createInferenceCondition[AnyRef](dm,new GurobiHook()),new lossAugmentedClassifier[cf.LEFT](cf.onClassifier)) -// x.buildWithConstraint(x.subjectTo.createInferenceCondition[_](dm, x.getSolverInstance()).convertToType[_], new lossAugmentedClassifier[_](x.onClassifier)) - //x.buildWithConstraint(x.subjectTo.createInferenceCondition(dm,)) - // val a = new ConstrainedClassifier[_,HEAD](dm,new lossAugmentedClassifier[_](x.onClassifier)){ def subjectTo = null} //EntityRelationConstraints.relationArgumentConstraints} {} - } + myStruct.labels ++= cf.refineScorer(myIns.head.asInstanceOf[HEAD],cf.getCandidates(myIns.head).size*FactorsNum) } - a.foreach { - cf=> - cf.getCandidates(myIns.head).foreach { - x => - myStruct.labels += cf.classifier.discreteValue(x) - } - } +// a.foreach { +// cf=> +// cf.getCandidates(myIns.head).foreach { +// x => +// myStruct.labels += cf.classifier.discreteValue(x) +// } +// } myStruct } //Todo add loss to the objective before calling inference diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala index 6422861d..39fcd8d4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala @@ -5,12 +5,10 @@ import edu.illinois.cs.cogcomp.lbjava.classify.{FeatureVector, ScoreSet} import edu.illinois.cs.cogcomp.lbjava.learn.Learner import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP -import scala.reflect.ClassTag - /** * Created by Parisa on 4/1/16. */ -class lossAugmentedClassifier[T<:AnyRef](c:Learner, cand_num: Int=1)(implicit t:ClassTag[T] ) extends Learner("lossAugmentedClassifier") { +class lossAugmentedClassifier[T<:AnyRef](c:Learner, cand_num: Int=1) extends Learner("lossAugmentedClassifier") { override def getInputType: String = { "dummy"} override def allowableValues: Array[String] = c.allowableValues()//{ Array[String]("false", "true") } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala index 77efe319..3968ff22 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala @@ -1,42 +1,41 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS3 - -import scala.reflect.ClassTag - -object Main { - case class typeHolder [HEAD](a: List[TwoTypeClass[_,HEAD]], x: HEAD){ - val head: HEAD = x - } - -abstract class TwoTypeClass[T , HEAD ](val value: String)(implicit val xTag: ClassTag[T], - implicit val yTag: ClassTag[HEAD]) { - type L = T - type R = HEAD - - def gen(head: HEAD): Seq[T]={ - val s:Seq[T] = null - s - } - } - - - def creator[HEAD](a : TwoTypeClass[_,HEAD ])( x: typeHolder) : Unit = { - - def subCreator(x:typeHolder)={ - x.head - } - } - def main(args: Array[String]){ - val x: String= null - def funtionOfType[HEAD](a : List[TwoTypeClass[_,HEAD]])(x:typeHolder) : Unit = { - a.foreach({ - cf => - val t=cf.gen(x.head.asInstanceOf[HEAD]) - t.foreach { - x=> creator(cf)_ - - } - - }) - } - } -} +//package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS3 +// +//import scala.reflect.ClassTag +// +//object Main { +// case class typeHolder [HEAD](a: List[TwoTypeClass[_,HEAD]], x: HEAD){ +// val head: HEAD = x +// } +// +//abstract class TwoTypeClass[T , HEAD ](val value: String)(implicit val xTag: ClassTag[T], +// implicit val yTag: ClassTag[HEAD]) { +// type L = T +// type R = HEAD +// +// def gen(head: HEAD): Seq[T]={ +// val s:Seq[T] = null +// s +// } +// } +// +// +// def creator[HEAD](a : TwoTypeClass[_,HEAD ])( x: typeHolder) : Unit = { +// +// def subCreator(x:typeHolder)={ +// x.head +// } +// } +// def main(args: Array[String]){ +// val x: String= null +// def funtionOfType[HEAD](a : List[TwoTypeClass[_,HEAD]])(x:typeHolder) : Unit = { +// a.foreach({ +// cf => +// val t=cf.gen(x.head.asInstanceOf[HEAD]) +// t.foreach { +// x=> creator(cf)_ +// +// } +// }) +// } +// } +//} From 230a82c591f03ff8d7c00ce18f68a8149286e9b0 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 15 Apr 2016 14:39:01 -0500 Subject: [PATCH 051/118] -Some trial error --- .../classifier/ConstrainedClassifier.scala | 10 +++++-- .../cogcomp/saul/classifier/Learnable.scala | 28 +++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index f24915f9..0b520355 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -93,14 +93,17 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo } } - def buildWithConstraint(infer: InferenceCondition[T, HEAD], cls: Learner)(t: T): String = { + def buildWithConstraint(infer: InferenceCondition[T, HEAD], cls: Learner, lexFlag: Boolean=true)(t: T): String = { val lex = cls.getLabelLexicon var flag = false + if (lexFlag) for (i <- 0 until lex.size()) { if (lex.lookupKey(i).valueEquals(cls.getLabeler().discreteValue(t))) flag = true } + else + flag=true findHead(t) match { case Some(head) => @@ -141,14 +144,17 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo cls.discreteValue(t) } } + + def refineScorer(h:HEAD,normalizer: Int): ListBuffer[String] ={ + onClassifier val tempclassifier = new lossAugmentedClassifier(onClassifier, normalizer) //cf.getCandidates(myIns.head).size*FactorsNum) var v= ListBuffer[String]() getCandidates(h).foreach { (example) => val g1 = tempclassifier.scores(example) - v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance()).convertToType[T], tempclassifier)(example) + v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance()).convertToType[T], tempclassifier,false)(example) } v } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala index a99903a3..213aca0e 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala @@ -5,14 +5,14 @@ import java.net.URL import java.time import edu.illinois.cs.cogcomp.core.io.IOUtils -import edu.illinois.cs.cogcomp.lbjava.classify.{ FeatureVector, TestDiscrete } +import edu.illinois.cs.cogcomp.lbjava.classify.{FeatureVector, TestDiscrete} import edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters import edu.illinois.cs.cogcomp.lbjava.learn._ import edu.illinois.cs.cogcomp.lbjava.parse.Parser import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream import edu.illinois.cs.cogcomp.saul.TestContinuous import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.saul.datamodel.property.{ CombinedDiscreteProperty, Property, PropertyWithWindow, RelationalFeature } +import edu.illinois.cs.cogcomp.saul.datamodel.property.{CombinedDiscreteProperty, Property, PropertyWithWindow, RelationalFeature} import edu.illinois.cs.cogcomp.saul.lbjrelated.LBJLearnerEquivalent import edu.illinois.cs.cogcomp.saul.parser.LBJIteratorParserScala @@ -22,6 +22,8 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: /** Whether to use caching */ val useCache = false + var scorerFlag= false + val loggging = false var isTraining = false @@ -54,6 +56,10 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: IOUtils.mkdir(modelDir) classifier.setModelLocation(lcFilePath()) classifier.setLexiconLocation(lexFilePath()) + def setSorer(): Unit = + { + scorerFlag = true + } // create .lex file if it does not exist if (!IOUtils.exists(lexFilePath().getPath)) { @@ -80,6 +86,24 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: } } +// override def scores(example: AnyRef): ScoreSet = { +// val cand_num=1 +//// if (cand_num==0) +//// print("There is no relevant component of this type in the head to be classified.") +// val cf= classifier.asInstanceOf[SparseNetworkLBP] +// val gold = cf.getLabeler.discreteValue(example) +// val lLexicon = cf.getLabelLexicon +// val resultS: ScoreSet = classifier.scores(example)//new ScoreSet +// for (i <- 0 until lLexicon.size()) { +// if (lLexicon.lookupKey(i).valueEquals(gold)) +// resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) +// else +// resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1/(cand_num)) ) +// } +// resultS +// } + + def setLabeler(): Unit = { if (label != null) { val oracle = Property.entitiesToLBJFeature(label) From eb3acdeea433e894837f065107457d33b12780a9 Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 18 Apr 2016 23:27:25 -0500 Subject: [PATCH 052/118] -LossAugmented Normalizer added --- .../classifier/ConstrainedClassifier.scala | 9 +++-- .../cogcomp/saul/classifier/Learnable.scala | 20 ++--------- .../{InitializeSL.scala => Initialize.scala} | 2 +- .../classifier/SL_model/JoinSLtrain.scala | 2 +- .../SL_model/LossAugmentedNormalizer.scala | 33 +++++++++++++++++++ .../classifier/infer/InferenceCondition.scala | 8 +++-- .../saul/classifier/infer/JointTemplate.scala | 8 ++--- .../saul/constraint/LfsConstraint.scala | 5 +-- .../property/CombinedDiscreteProperty.scala | 22 +++++++++++-- 9 files changed, 74 insertions(+), 35 deletions(-) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/{InitializeSL.scala => Initialize.scala} (99%) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 0b520355..d8560158 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -4,7 +4,7 @@ import edu.illinois.cs.cogcomp.lbjava.classify.TestDiscrete import edu.illinois.cs.cogcomp.lbjava.infer._ import edu.illinois.cs.cogcomp.lbjava.learn.Learner import edu.illinois.cs.cogcomp.lbjava.parse.Parser -import edu.illinois.cs.cogcomp.saul.classifier.SL_model.lossAugmentedClassifier +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.LossAugmentedNormalizer import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -147,14 +147,13 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo def refineScorer(h:HEAD,normalizer: Int): ListBuffer[String] ={ - onClassifier - - val tempclassifier = new lossAugmentedClassifier(onClassifier, normalizer) //cf.getCandidates(myIns.head).size*FactorsNum) + val tempclassifier = onClassifier + //val tempclassifier = new lossAugmentedClassifier(onClassifier, normalizer) //cf.getCandidates(myIns.head).size*FactorsNum) var v= ListBuffer[String]() getCandidates(h).foreach { (example) => val g1 = tempclassifier.scores(example) - v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance()).convertToType[T], tempclassifier,false)(example) + v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance(),new LossAugmentedNormalizer(normalizer,onClassifier,example)).convertToType[T], tempclassifier,false)(example) } v } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala index 213aca0e..83c10dda 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala @@ -36,6 +36,7 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: def feature: List[Property[T]] = datamodel.getPropertiesForType[T] + /** filter out the label from the features */ def combinedProperties = if (label != null) new CombinedDiscreteProperty[T](this.feature.filterNot(_.name == label.name)) else new CombinedDiscreteProperty[T](this.feature) @@ -86,24 +87,7 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: } } -// override def scores(example: AnyRef): ScoreSet = { -// val cand_num=1 -//// if (cand_num==0) -//// print("There is no relevant component of this type in the head to be classified.") -// val cf= classifier.asInstanceOf[SparseNetworkLBP] -// val gold = cf.getLabeler.discreteValue(example) -// val lLexicon = cf.getLabelLexicon -// val resultS: ScoreSet = classifier.scores(example)//new ScoreSet -// for (i <- 0 until lLexicon.size()) { -// if (lLexicon.lookupKey(i).valueEquals(gold)) -// resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) -// else -// resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1/(cand_num)) ) -// } -// resultS -// } - - + def setLabeler(): Unit = { if (label != null) { val oracle = Property.entitiesToLBJFeature(label) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala similarity index 99% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index b1682d3e..edd4c0af 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/InitializeSL.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -10,7 +10,7 @@ import scala.collection.mutable.ListBuffer /** * Created by Parisa on 4/1/16. */ -object InitializeSL{ +object Initialize{ def apply[HEAD<:AnyRef](sp:SLProblem , model:SaulSLModel[HEAD]): SaulSLModel[HEAD] = { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index a25eddad..92cfe12d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -23,7 +23,7 @@ object JoinSLtrain { def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_<:AnyRef, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { val sp = SL_IOManager.makeSLProblem(dm, cls) - val model = InitializeSL(sp, new SaulSLModel(cls)) + val model = Initialize(sp, new SaulSLModel(cls)) model.infSolver = new Saul_SL_Inference[HEAD](model.Factors, dm) val para = new SLParameters para.C_FOR_STRUCTURE = 1 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala new file mode 100644 index 00000000..2fb75e15 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala @@ -0,0 +1,33 @@ +package edu.illinois.cs.cogcomp.saul.classifier.SL_model + +import edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet +import edu.illinois.cs.cogcomp.lbjava.learn.{Learner, Normalizer} +import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP + +/** + * Created by Parisa on 4/18/16. + */ +class LossAugmentedNormalizer(cand_num:Int, c:Learner, example: AnyRef) extends Normalizer{ + /** + * Simply returns the argument. + * + * @param scores The set of scores to normalize. + * @return The normalized set of scores. + **/ + def normalize(scores: ScoreSet): ScoreSet = { + if (cand_num==0) + print("There is no relevant component of this type in the head to be classified.") + val cf= c.asInstanceOf[SparseNetworkLBP] + val gold = cf.getLabeler.discreteValue(example) + val lLexicon = cf.getLabelLexicon + + val resultS: ScoreSet = scores//c.scores(example)//new ScoreSet + for (i <- 0 until lLexicon.size()) { + if (lLexicon.lookupKey(i).valueEquals(gold)) + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) + else + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1/(cand_num)) ) + } + resultS + } +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 49d2b3c9..85119453 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -1,12 +1,13 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint } +import edu.illinois.cs.cogcomp.lbjava.learn.{IdentityNormalizer, Normalizer, Learner} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import scala.reflect.ClassTag -abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataModel, solver: ILPSolver)( +abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataModel, solver: ILPSolver, normalize: Normalizer= new IdentityNormalizer)( implicit val inputTag: ClassTag[INPUT], val headTag: ClassTag[HEAD] @@ -14,12 +15,15 @@ abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataM def subjectTo: LfsConstraint[HEAD] def transfer(t: HEAD): JointTemplate[HEAD] = { - new JointTemplate[HEAD](t, solver) { + new JointTemplate[HEAD](t, solver,normalize) { // TODO: Define this function override def getSubjectToInstance: ParameterizedConstraint = { subjectTo.transfer } // TODO: override other functions that needed here + override def getNormalizer(c:Learner): Normalizer ={ + normalize + } } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala index 129c3219..3b11a370 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala @@ -3,7 +3,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint, ILPInference } import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Normalizer, Learner } -abstract class JointTemplate[T](head: T, solver: ILPSolver) extends ILPInference(head, solver) { +abstract class JointTemplate[T](head: T, solver: ILPSolver, norm: Normalizer= new IdentityNormalizer) extends ILPInference(head, solver) { constraint = this.getSubjectToInstance.makeConstraint(head) override def getHeadType: String = { @@ -14,9 +14,9 @@ abstract class JointTemplate[T](head: T, solver: ILPSolver) extends ILPInference Array[String](null, null) } - override def getNormalizer(c: Learner): Normalizer = { - new IdentityNormalizer - } + override def getNormalizer(c: Learner): Normalizer //= { + // new IdentityNormalizer + //} def getSubjectToInstance: ParameterizedConstraint } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala index 8a6c4c0d..24f3d3c6 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala @@ -1,6 +1,7 @@ package edu.illinois.cs.cogcomp.saul.constraint import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint, FirstOrderConstraint } +import edu.illinois.cs.cogcomp.lbjava.learn.{IdentityNormalizer, Normalizer} import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -34,8 +35,8 @@ abstract class LfsConstraint[T <: AnyRef](implicit val tag: ClassTag[T]) { val lc = this - def createInferenceCondition[C <: AnyRef](dm: DataModel, solver: ILPSolver)(implicit cTag: ClassTag[C]): InferenceCondition[C, T] = { - new InferenceCondition[C, T](dm, solver) { + def createInferenceCondition[C <: AnyRef](dm: DataModel, solver: ILPSolver, normalize: Normalizer= new IdentityNormalizer)(implicit cTag: ClassTag[C]): InferenceCondition[C, T] = { + new InferenceCondition[C, T](dm, solver, normalize) { override def subjectTo: LfsConstraint[T] = lc } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala index 8ac46072..6be11fb3 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala @@ -2,8 +2,7 @@ package edu.illinois.cs.cogcomp.saul.datamodel.property import java.util -import edu.illinois.cs.cogcomp.lbjava.classify.{ DiscretePrimitiveStringFeature, FeatureVector, Classifier } -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.lbjava.classify.{Classifier, FeatureVector} import edu.illinois.cs.cogcomp.saul.datamodel.property.features.ClassifierContainsInLBP import scala.reflect.ClassTag @@ -37,6 +36,25 @@ case class CombinedDiscreteProperty[T <: AnyRef]( super.classify(examples) } + // override def scores(example: AnyRef): ScoreSet = { + // val cand_num=1 + //// if (cand_num==0) + //// print("There is no relevant component of this type in the head to be classified.") + // val cf= classifier.asInstanceOf[SparseNetworkLBP] + // val gold = cf.getLabeler.discreteValue(example) + // val lLexicon = cf.getLabelLexicon + // val resultS: ScoreSet = classifier.scores(example)//new ScoreSet + // for (i <- 0 until lLexicon.size()) { + // if (lLexicon.lookupKey(i).valueEquals(gold)) + // resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) + // else + // resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1/(cand_num)) ) + // } + // resultS + // } + + + override def getCompositeChildren: util.LinkedList[_] = { val result: util.LinkedList[Classifier] = new util.LinkedList[Classifier]() atts.foreach(x => result.add(x.classifier)) From b840e9a73e9e194febcd76f8fd19c0105ec7dd59 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 20 Apr 2016 15:26:01 -0500 Subject: [PATCH 053/118] -LossAugmented classifier via rewriting the scorer in lbjava - fixed a bug in ER word ids --- build.sbt | 6 ++-- .../classifier/ConstrainedClassifier.scala | 8 ++--- .../cogcomp/saul/classifier/Learnable.scala | 16 +++++----- .../classifier/SL_model/JoinSLtrain.scala | 23 +++++++++++++++ .../SL_model/LossAugmentedNormalizer.scala | 2 +- .../SL_model/Saul_SL_Inference.scala | 29 ++++++++++--------- ...EntityRelationConstrainedClassifiers.scala | 4 +-- 7 files changed, 56 insertions(+), 32 deletions(-) diff --git a/build.sbt b/build.sbt index fbe68d54..19ce3918 100644 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,5 @@ + + val cogcompNLPVersion = "3.0.18" val cogcompPipelineVersion = "0.1.15" @@ -10,12 +12,12 @@ lazy val commonSettings = Seq( version := "0.1", scalaVersion := "2.11.7", resolvers ++= Seq( - Resolver.mavenLocal, + "Local Maven Repository" at "file://"+"/Users/Parisa/"+"/.m2/repository", "CogcompSoftware" at "http://cogcomp.cs.illinois.edu/m2repo/" ), javaOptions ++= List("-Xmx6g"), libraryDependencies ++= Seq( - "edu.illinois.cs.cogcomp" % "LBJava" % "1.2.8" withSources, + "edu.illinois.cs.cogcomp" % "LBJava" % "2.1.18-SNAPSHOT" withSources(), "edu.illinois.cs.cogcomp" % "illinois-core-utilities" % cogcompNLPVersion withSources, "com.gurobi" % "gurobi" % "6.0", "org.apache.commons" % "commons-math3" % "3.0", diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index d8560158..8ce35414 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -146,14 +146,12 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo } - def refineScorer(h:HEAD,normalizer: Int): ListBuffer[String] ={ - val tempclassifier = onClassifier - //val tempclassifier = new lossAugmentedClassifier(onClassifier, normalizer) //cf.getCandidates(myIns.head).size*FactorsNum) + def lossAugmentedInfer(h:HEAD,offset: Int): ListBuffer[String] ={ var v= ListBuffer[String]() getCandidates(h).foreach { (example) => - val g1 = tempclassifier.scores(example) - v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance(),new LossAugmentedNormalizer(normalizer,onClassifier,example)).convertToType[T], tempclassifier,false)(example) + // val g1 = onClassifier.scores(example) + v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance(),new LossAugmentedNormalizer(offset,onClassifier,example)).convertToType[T], onClassifier)(example) } v } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala index 83c10dda..8055153c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala @@ -5,14 +5,14 @@ import java.net.URL import java.time import edu.illinois.cs.cogcomp.core.io.IOUtils -import edu.illinois.cs.cogcomp.lbjava.classify.{FeatureVector, TestDiscrete} +import edu.illinois.cs.cogcomp.lbjava.classify.{ FeatureVector, TestDiscrete } import edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters import edu.illinois.cs.cogcomp.lbjava.learn._ import edu.illinois.cs.cogcomp.lbjava.parse.Parser import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream import edu.illinois.cs.cogcomp.saul.TestContinuous import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.saul.datamodel.property.{CombinedDiscreteProperty, Property, PropertyWithWindow, RelationalFeature} +import edu.illinois.cs.cogcomp.saul.datamodel.property.{ CombinedDiscreteProperty, Property, PropertyWithWindow, RelationalFeature } import edu.illinois.cs.cogcomp.saul.lbjrelated.LBJLearnerEquivalent import edu.illinois.cs.cogcomp.saul.parser.LBJIteratorParserScala @@ -22,7 +22,7 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: /** Whether to use caching */ val useCache = false - var scorerFlag= false +// var scorerFlag= false val loggging = false @@ -36,7 +36,6 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: def feature: List[Property[T]] = datamodel.getPropertiesForType[T] - /** filter out the label from the features */ def combinedProperties = if (label != null) new CombinedDiscreteProperty[T](this.feature.filterNot(_.name == label.name)) else new CombinedDiscreteProperty[T](this.feature) @@ -57,10 +56,10 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: IOUtils.mkdir(modelDir) classifier.setModelLocation(lcFilePath()) classifier.setLexiconLocation(lexFilePath()) - def setSorer(): Unit = - { - scorerFlag = true - } +// def setSorer(): Unit = +// { +// scorerFlag = true +// } // create .lex file if it does not exist if (!IOUtils.exists(lexFilePath().getPath)) { @@ -87,7 +86,6 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: } } - def setLabeler(): Unit = { if (label != null) { val oracle = Property.entitiesToLBJFeature(label) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 92cfe12d..44cc8819 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -26,6 +26,8 @@ object JoinSLtrain { val model = Initialize(sp, new SaulSLModel(cls)) model.infSolver = new Saul_SL_Inference[HEAD](model.Factors, dm) val para = new SLParameters + para.STOP_CONDITION = 0.0001f + para.INNER_STOP_CONDITION= 0.0001f para.C_FOR_STRUCTURE = 1 para.CHECK_INFERENCE_OPT = false model.para = para @@ -33,5 +35,26 @@ object JoinSLtrain { para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); model.wv = learner.train(sp) + model.saveModel("SL_ER_Model.txt") + } + def TestSSVM [HEAD <: AnyRef](dm: DataModel,cls: List[ConstrainedClassifier[_<:AnyRef,HEAD]], modelPath:String ): Unit = { + val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] + val sp: SLProblem = SL_IOManager.makeSLProblem(dm, cls,testing=true) + + // val sp.instanceList.toList.map(x=> myModel.infSolver.getBestStructure(myModel.wv,x.asInstanceOf[Saul_SL_Instance].head.asInstanceOf[Saul_SL_Instance])) +// def apply { +// +// l.foreach { (c: ConstrainedClassifier[_, HEAD]) => +// { +// val oracle: Classifier = c.onClassifier.getLabeler() +// val candis: Seq[_] = c.getCandidates(x) +// candis.foreach { +// ci => +// labels.add(oracle.discreteValue(ci)) +// } +// } +// } +// } + } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala index 2fb75e15..4c33a76b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala @@ -21,7 +21,7 @@ class LossAugmentedNormalizer(cand_num:Int, c:Learner, example: AnyRef) extends val gold = cf.getLabeler.discreteValue(example) val lLexicon = cf.getLabelLexicon - val resultS: ScoreSet = scores//c.scores(example)//new ScoreSet + val resultS: ScoreSet = cf.scores(example)//new ScoreSet for (i <- 0 until lLexicon.size()) { if (lLexicon.lookupKey(i).valueEquals(gold)) resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 910e674b..d82726ed 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -56,6 +56,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:A val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.ConstraintFactors.toList, myIns.head) + val FactorsNum=a.size a.foreach { cf=> @@ -65,25 +66,27 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:A val w1= cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(i,w1.size()) cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Utils.converFarrayToD(myFactorJoinlyTrainedWeight)) - } - } - val FactorsNum=a.size -/// val newFactors=List[ConstrainedClassifier[_,HEAD]] - a.foreach { - cf => - - myStruct.labels ++= cf.refineScorer(myIns.head.asInstanceOf[HEAD],cf.getCandidates(myIns.head).size*FactorsNum) + cf.onClassifier.setLossFlag() + cf.onClassifier.setCandidates(cf.getCandidates(myIns.head).size* FactorsNum) } +/// val newFactors=List[ConstrainedClassifier[_,HEAD]] // a.foreach { -// cf=> -// cf.getCandidates(myIns.head).foreach { -// x => -// myStruct.labels += cf.classifier.discreteValue(x) -// } +// cf => +// +// myStruct.labels ++= cf.lossAugmentedInfer(myIns.head.asInstanceOf[HEAD],cf.getCandidates(myIns.head).size*FactorsNum) // } + + a.foreach { + cf=> + cf.getCandidates(myIns.head).foreach { + x => + myStruct.labels += cf.classifier.discreteValue(x) + } + } myStruct } + a.map (x=> x.onClassifier.unsetLossFlag()) //Todo add loss to the objective before calling inference } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala index 91c1e18a..82eaf6c1 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala @@ -13,14 +13,14 @@ object EntityRelationConstrainedClassifiers { object OrgConstrainedClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](EntityRelationDataModel, OrganizationClassifier) { def subjectTo = relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo2ndArg) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 + override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 override val solver = erSolver } object PerConstrainedClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](EntityRelationDataModel, PersonClassifier) { def subjectTo = relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo1stArg) - override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 + override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 override val solver = erSolver } From 37a5caa9cbb35cc7aa346b890359214ed95ba31d Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 25 Apr 2016 15:24:08 -0500 Subject: [PATCH 054/118] - refined the input output structures -refined the model --- build.sbt | 2 +- .../saul/classifier/SL_model/Initialize.scala | 10 ++++++- .../classifier/SL_model/JoinSLtrain.scala | 13 +++++---- .../SL_model/SL_FeatureGenerator.scala | 4 +-- .../classifier/SL_model/SL_IOManager.scala | 6 ++-- .../classifier/SL_model/SaulSLModel.scala | 22 ++++++++++++--- .../saul/classifier/SL_model/SaulSLTest.scala | 1 + .../SL_model/Saul_SL_Inference.scala | 28 +++++++++---------- .../SL_model/Saul_SL_Instance.scala | 19 ++----------- .../SL_model/Saul_SL_Label_Structure.scala | 6 ++-- .../EntityRelationDataModel.scala | 5 ++-- .../EntityRelationSensors.scala | 3 +- .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 11 +++++++- 13 files changed, 74 insertions(+), 56 deletions(-) diff --git a/build.sbt b/build.sbt index c32ef15c..ae36aaa2 100644 --- a/build.sbt +++ b/build.sbt @@ -46,7 +46,7 @@ lazy val saulExamples = (project in file("saul-examples")). "edu.illinois.cs.cogcomp" % "illinois-edison" % cogcompNLPVersion, "edu.illinois.cs.cogcomp" % "illinois-nlp-readers" % "0.0.2-SNAPSHOT", "edu.illinois.cs.cogcomp" % "saul-pos-tagger-models" % "1.0", - "edu.illinois.cs.cogcomp" % "saul-er-models" % "1.3" + "edu.illinois.cs.cogcomp" % "saul-er-models" % "1.3", "edu.illinois.cs.cogcomp" % "illinois-nlp-readers" % "0.0.2-SNAPSHOT", "edu.illinois.cs.cogcomp" % "saul-pos-tagger-models" % "1.0" ) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index edd4c0af..5c8db5bd 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -9,6 +9,8 @@ import scala.collection.mutable.ListBuffer /** * Created by Parisa on 4/1/16. + * Here we only make the lbjava lexicons for each onClassifier + * (i.e. the base classifier of each constraint classifier) based on the features of IInstances */ object Initialize{ @@ -38,12 +40,16 @@ object Initialize{ var ltu: LinearThresholdUnit = ilearner.getbaseLTU ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); ilearner.net.set(label, ltu); + print( "weight vector size:"+ilearner.net.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) + println("lexicon size:"+ilearner.getLexicon.size()) + N = label + 1; } } // for each candidate } // for each constraintFactor }//end case }//for each example + var wvLength=0 var lt: ListBuffer[Array[Float]] = ListBuffer() model.Factors.foreach( @@ -59,9 +65,11 @@ object Initialize{ } println(sparseNet.getLexicon.size(), "*",sparseNet.getLabelLexicon.size()) }) + val myWeight = Array.fill[Float](wvLength)(0) val wv= new WeightVector(myWeight) - val m= new SaulSLModel[HEAD](model.Factors,lt) + val m= new SaulSLModel[HEAD](model.Factors.toList,lt) + m.wv=wv m }//end f apply }// end of object diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 44cc8819..24f9c792 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -10,9 +10,9 @@ import scala.reflect._ /** Created by Parisa on 12/3/15. */ object JoinSLtrain { - def apply[HEAD <: AnyRef]( + def apply[HEAD<:AnyRef]( dm: DataModel, - cls: List[ConstrainedClassifier[_<:AnyRef, HEAD]] + cls: List[ConstrainedClassifier[_, HEAD]] )( implicit headTag: ClassTag[HEAD] @@ -21,10 +21,10 @@ object JoinSLtrain { trainSSVM[HEAD](dm, cls) } - def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_<:AnyRef, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { + def trainSSVM[HEAD<:AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { val sp = SL_IOManager.makeSLProblem(dm, cls) val model = Initialize(sp, new SaulSLModel(cls)) - model.infSolver = new Saul_SL_Inference[HEAD](model.Factors, dm) + model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model,dm) val para = new SLParameters para.STOP_CONDITION = 0.0001f para.INNER_STOP_CONDITION= 0.0001f @@ -34,12 +34,13 @@ object JoinSLtrain { model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); + model.wv = learner.train(sp) model.saveModel("SL_ER_Model.txt") } - def TestSSVM [HEAD <: AnyRef](dm: DataModel,cls: List[ConstrainedClassifier[_<:AnyRef,HEAD]], modelPath:String ): Unit = { + def TestSSVM [HEAD<:AnyRef](dm: DataModel,cls: List[ConstrainedClassifier[_,HEAD]], modelPath:String )(implicit t: ClassTag[HEAD]): Unit = { val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] - val sp: SLProblem = SL_IOManager.makeSLProblem(dm, cls,testing=true) + val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](dm, cls,testing=true) // val sp.instanceList.toList.map(x=> myModel.infSolver.getBestStructure(myModel.wv,x.asInstanceOf[Saul_SL_Instance].head.asInstanceOf[Saul_SL_Instance])) // def apply { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index f554ca7d..260b36f4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -5,8 +5,8 @@ import edu.illinois.cs.cogcomp.sl.core.{AbstractFeatureGenerator, IInstance, ISt import edu.illinois.cs.cogcomp.sl.util.{FeatureVectorBuffer, IFeatureVector} /** Created by Parisa on 12/8/15. - */ -class SL_FeatureGenerator[HEAD <: AnyRef](model:SaulSLModel[HEAD]) extends AbstractFeatureGenerator { + */ +class SL_FeatureGenerator[HEAD<:AnyRef](model:SaulSLModel[HEAD]) extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { val myX = x.asInstanceOf[Saul_SL_Instance[HEAD]] diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index b4d3db05..baa67719 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -20,16 +20,14 @@ object SL_IOManager { } else { - allHeads = dm.getNodeWithType[HEAD].getAllInstances + allHeads = dm.getNodeWithType[HEAD].getTrainingInstances } allHeads.foreach(x => { // val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava - val ins = new Saul_SL_Instance(list, x) - ins.apply + val ins = new Saul_SL_Instance(x) val outs = new Saul_SL_Label_Structure(list, x) - outs.apply sp.addExample(ins, outs) }) sp diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala index 641514ec..650e1df2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala @@ -1,15 +1,29 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model +import java.io.{BufferedOutputStream, FileOutputStream, ObjectOutputStream} + import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.sl.core.SLModel +import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} import scala.collection.mutable.ListBuffer /** * Created by Parisa on 4/1/16. */ -class SaulSLModel[HEAD<: AnyRef](cls: List[ConstrainedClassifier[_<:AnyRef,HEAD]], listBuffer: ListBuffer[Array[Float]]=ListBuffer()) extends SLModel { - var Factors: List[ConstrainedClassifier[_<:AnyRef,HEAD]]= cls - var LtuTemplates: ListBuffer[Array[Float]]= listBuffer +class SaulSLModel[HEAD<: AnyRef](cls: List[ConstrainedClassifier[_,HEAD]], listBuffer: ListBuffer[Array[Float]]=ListBuffer()) extends SLModel with Serializable{ + var LtuTemplates: ListBuffer[Array[Float]]= listBuffer + var Factors: ListBuffer[ConstrainedClassifier[_, HEAD]] =ListBuffer() + cls.foreach { + (c: ConstrainedClassifier[_, HEAD]) => + Factors += (c) + } + + override def saveModel(fileName :String): Unit = { + numFeatuerBit = SLParameters.HASHING_MASK + val oos: ObjectOutputStream = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(fileName))) + oos.writeObject(this.wv) + oos.close + // logger.info("Done!") + } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala index 4e6bde3f..b8829d42 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala @@ -3,6 +3,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.IStructure + import scala.collection.JavaConversions._ import scala.reflect.ClassTag diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index d82726ed..0ff0e266 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -7,23 +7,23 @@ import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector +import scala.collection.mutable.ListBuffer import scala.reflect.ClassTag /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:AnyRef,HEAD]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { +class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]], ltuTemplates: ListBuffer[Array[Float]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { val a=factors - a.head.tType val dataM=dm override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.ConstraintFactors.toList, myIns.head) - for (i <- 0 until myIns.ConstraintFactors.size) { - val c = myIns.ConstraintFactors(i) + var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) + for (i <- 0 until factors.size) { + val c = factors(i) val candis: Seq[_] = c.getCandidates(myIns.head) candis.foreach(x => - myStruct.labels += myIns.ConstraintFactors(i).classifier.discreteValue(x)) + myStruct.labels += factors(i).classifier.discreteValue(x)) } myStruct } @@ -55,20 +55,21 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:A override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](myIns.ConstraintFactors.toList, myIns.head) + val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) val FactorsNum=a.size - + var ltu_count = 0 a.foreach { cf=> - for (i <- 0 until cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) { - val w1= cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector - val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(i,w1.size()) + val w1= ltuTemplates(ltu_count)//cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector + print("w1 size\t", w1.size) + val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(i,w1.size) cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Utils.converFarrayToD(myFactorJoinlyTrainedWeight)) } cf.onClassifier.setLossFlag() cf.onClassifier.setCandidates(cf.getCandidates(myIns.head).size* FactorsNum) + println() } /// val newFactors=List[ConstrainedClassifier[_,HEAD]] @@ -85,8 +86,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_<:A myStruct.labels += cf.classifier.discreteValue(x) } } + a.map (x=> x.onClassifier.unsetLossFlag()) myStruct } - a.map (x=> x.onClassifier.unsetLossFlag()) - //Todo add loss to the objective before calling inference -} + } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index 5c1dc60f..e81f37c5 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -1,23 +1,10 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.IInstance -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector -import scala.collection.mutable.ListBuffer /** Created by Parisa on 12/10/15. - * Here we only make the lbjava lexicons for each onClassifier - * (i.e. the base classifier of each constraint classifier) based on the features of IInstances */ -case class Saul_SL_Instance[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEAD]], x: HEAD) extends IInstance { - var ConstraintFactors: ListBuffer[ConstrainedClassifier[_, HEAD]] =ListBuffer() - var fv: IFeatureVector = null; - val head: HEAD = x - def apply = { - l.foreach { - (c: ConstrainedClassifier[_, HEAD]) => - ConstraintFactors += (c) - } - } -} +case class Saul_SL_Instance[HEAD <: AnyRef](x: HEAD) extends IInstance { + val head: HEAD = x + } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala index a6ba26bd..5822219e 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -13,16 +13,14 @@ class Saul_SL_Label_Structure[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, H var labels: ListBuffer[String] = ListBuffer() - def apply { - - l.foreach { (c: ConstrainedClassifier[_, HEAD]) => + l.foreach { (c: ConstrainedClassifier[_, HEAD]) => { val oracle: Classifier = c.onClassifier.getLabeler() val candis: Seq[_] = c.getCandidates(x) candis.foreach { ci => labels.add(oracle.discreteValue(ci)) - } + } } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala index 4d178a38..473ab01b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala @@ -111,10 +111,11 @@ object EntityRelationDataModel extends DataModel { def populateWithConll() = { sentences.populate(EntityRelationSensors.sentencesTrain) - //sentences.populate(EntityRelationSensors.sentencesTest, train = false) + sentences.populate(EntityRelationSensors.sentencesTest, train = false) } def populateWithConllSmallSet() = { - sentences.populate(EntityRelationSensors.sentencesSmallSet, train = false) + sentences.populate(EntityRelationSensors.sentencesSmallSet) + sentences.populate(EntityRelationSensors.sentencesSmallSet2, train = false) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index c9401afe..f4182206 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -22,9 +22,10 @@ object EntityRelationSensors { } lazy val (sentencesAll, relationsAll, entitiesAll) = readConllData(path + "EntityMentionRelation/conll04.corp") - lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_small.corp") + lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_train.corp") lazy val (sentencesTest, relationsTest, entitiesTest) = readConllData(path + "EntityMentionRelation/conll04_test.corp") lazy val (sentencesSmallSet, testRelationsSmallSet, entitiesSmallSet) = readConllData(resourcePath + "conll04-smallDocument.txt") + lazy val (sentencesSmallSet2, trainRelationsSmallSet, trainEntitiesSmallSet) = readConllData(path + "EntityMentionRelation/conll04_small.corp") def sentenceToRelation_GeneratingSensor(s: ConllRawSentence): List[ConllRelation] = { s.relations.asScala.toList diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 09034724..28bb1d7b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -7,6 +7,15 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDat /** Created by Parisa on 12/8/15. */ object mySL_Saul_TestApp extends App { - EntityRelationDataModel.populateWithConll() + + EntityRelationDataModel.populateWithConllSmallSet() JoinSLtrain(EntityRelationDataModel, List(PerConstrainedClassifier,OrgConstrainedClassifier, LocConstrainedClassifier,LivesIn_PerOrg_relationConstrainedClassifier,WorksFor_PerOrg_ConstrainedClassifier)) + + /* Test SL_ER */ + + PerConstrainedClassifier.test() + OrgConstrainedClassifier.test() + LocConstrainedClassifier.test() + LivesIn_PerOrg_relationConstrainedClassifier.test() + WorksFor_PerOrg_ConstrainedClassifier.test() } From 5516bbf9bf7fd744eb27ada8cf07e1bd8b7abb22 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 26 Apr 2016 14:26:41 -0500 Subject: [PATCH 055/118] minor changes to tset --- .../saul/classifier/SL_model/JoinSLtrain.scala | 2 +- .../EntityRelation/EntityRelationClassifiers.scala | 14 +++++++------- .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 24f9c792..a477be0f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -24,7 +24,7 @@ object JoinSLtrain { def trainSSVM[HEAD<:AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { val sp = SL_IOManager.makeSLProblem(dm, cls) val model = Initialize(sp, new SaulSLModel(cls)) - model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model,dm) + model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LtuTemplates,dm) val para = new SLParameters para.STOP_CONDITION = 0.0001f para.INNER_STOP_CONDITION= 0.0001f diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala index 85161584..3004d469 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala @@ -1,9 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.lbjava.learn.{ SparsePerceptron, StochasticGradientDescent, SupportVectorMachine, SparseNetworkLearner } -import edu.illinois.cs.cogcomp.saul.classifier.Learnable +import edu.illinois.cs.cogcomp.saul.classifier.{Learnable, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.property.Property -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawSentence, ConllRawToken, ConllRelation } +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRawSentence, ConllRawToken, ConllRelation} import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ object EntityRelationClassifiers { @@ -28,7 +27,7 @@ object EntityRelationClassifiers { def label: Property[ConllRawToken] = entityType is "Loc" override def feature = using(word, windowWithin[ConllRawSentence](-2, 2, List(pos)), phrase, containsSubPhraseMent, containsSubPhraseIng, wordLen) - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP // The gazetteer properties are temporarily removed: containsInPersonList, containsInCityList } @@ -47,12 +46,12 @@ object EntityRelationClassifiers { object OrgBasedInClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "OrgBased_In" - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP } object LocatedInClassifier extends Learnable[ConllRelation](EntityRelationDataModel) { override def label: Property[ConllRelation] = relationType is "Located_In" - override lazy val classifier = new SparsePerceptron() + override lazy val classifier = new SparseNetworkLBP } /** relation pipeline classifiers */ @@ -66,4 +65,5 @@ object EntityRelationClassifiers { override def label: Property[ConllRelation] = relationType is "Live_In" override def feature = using(relFeature, relPos, entityPrediction) override lazy val classifier = new SparseNetworkLBP - } \ No newline at end of file + } +} \ No newline at end of file diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 28bb1d7b..8982b9b8 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -13,9 +13,9 @@ object mySL_Saul_TestApp extends App { /* Test SL_ER */ - PerConstrainedClassifier.test() - OrgConstrainedClassifier.test() - LocConstrainedClassifier.test() - LivesIn_PerOrg_relationConstrainedClassifier.test() - WorksFor_PerOrg_ConstrainedClassifier.test() + PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) + OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) + LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) + LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTestingInstances,outputGranularity = 10) + WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTestingInstances,outputGranularity = 10) } From de9f2db65c14df16a92eeb113ed276e8b9ae147f Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 28 Apr 2016 11:57:33 -0500 Subject: [PATCH 056/118] - some test to compare with independent models - change verbosity of inference information --- .../classifier/SL_model/JoinSLtrain.scala | 13 ++++---- .../SL_model/Saul_SL_Inference.scala | 30 +++++++++---------- .../classifier/infer/InferenceCondition.scala | 1 + .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 7 ++++- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index a477be0f..39a3be89 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -24,18 +24,17 @@ object JoinSLtrain { def trainSSVM[HEAD<:AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { val sp = SL_IOManager.makeSLProblem(dm, cls) val model = Initialize(sp, new SaulSLModel(cls)) - model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LtuTemplates,dm) + model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LtuTemplates, dm) val para = new SLParameters - para.STOP_CONDITION = 0.0001f - para.INNER_STOP_CONDITION= 0.0001f - para.C_FOR_STRUCTURE = 1 - para.CHECK_INFERENCE_OPT = false +// para.STOP_CONDITION = 0.0001f +// para.INNER_STOP_CONDITION= 0.0001f +// para.C_FOR_STRUCTURE = 1 +// para.CHECK_INFERENCE_OPT = false model.para = para model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - - model.wv = learner.train(sp) + model.wv = learner.train(sp,model.wv) model.saveModel("SL_ER_Model.txt") } def TestSSVM [HEAD<:AnyRef](dm: DataModel,cls: List[ConstrainedClassifier[_,HEAD]], modelPath:String )(implicit t: ClassTag[HEAD]): Unit = { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 0ff0e266..6ebe4bb6 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,6 +1,5 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseWeightVector} import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -33,10 +32,11 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[HEAD]] var count = 0 + println(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) a.foreach { x=> var localLoss=0 - val oracle: Classifier = x.onClassifier.getLabeler() + // val oracle: Classifier = x.onClassifier.getLabeler() val candidates= x.getCandidates(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) candidates.foreach{ ci => @@ -48,7 +48,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE TotalLoss=TotalLoss+localLoss/candidates.size } TotalLoss=TotalLoss/factors.size - + println("Loss="+TotalLoss) TotalLoss } @@ -58,35 +58,35 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) val FactorsNum=a.size var ltu_count = 0 - a.foreach { + var offset = 0 + a.foreach { cf=> for (i <- 0 until cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) { val w1= ltuTemplates(ltu_count)//cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector print("w1 size\t", w1.size) - val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(i,w1.size) + val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(offset,offset+w1.size) cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Utils.converFarrayToD(myFactorJoinlyTrainedWeight)) + offset = offset + ltuTemplates(ltu_count).length + ltu_count= ltu_count + 1 } cf.onClassifier.setLossFlag() cf.onClassifier.setCandidates(cf.getCandidates(myIns.head).size* FactorsNum) - println() } -/// val newFactors=List[ConstrainedClassifier[_,HEAD]] -// a.foreach { -// cf => -// -// myStruct.labels ++= cf.lossAugmentedInfer(myIns.head.asInstanceOf[HEAD],cf.getCandidates(myIns.head).size*FactorsNum) -// } - + var labelCount=0 a.foreach { cf=> cf.getCandidates(myIns.head).foreach { x => - myStruct.labels += cf.classifier.discreteValue(x) + print(cf.classifier.name.substring(80)+"\t") + print("gt:"+cf.onClassifier.getLabeler.discreteValue(x)) + myStruct.labels(labelCount)= cf.classifier.discreteValue(x) + println("\tmvc:"+myStruct.labels(labelCount)) + labelCount= labelCount+1 } } a.map (x=> x.onClassifier.unsetLossFlag()) myStruct } - } + } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 85119453..08d714d4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -20,6 +20,7 @@ abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataM override def getSubjectToInstance: ParameterizedConstraint = { subjectTo.transfer } + verbosity = 2 // TODO: override other functions that needed here override def getNormalizer(c:Learner): Normalizer ={ normalize diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 8982b9b8..190801b8 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -1,6 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS3 +import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel @@ -12,7 +14,10 @@ object mySL_Saul_TestApp extends App { JoinSLtrain(EntityRelationDataModel, List(PerConstrainedClassifier,OrgConstrainedClassifier, LocConstrainedClassifier,LivesIn_PerOrg_relationConstrainedClassifier,WorksFor_PerOrg_ConstrainedClassifier)) /* Test SL_ER */ - + println("Independent Classifiers:") + ClassifierUtils.TrainClassifiers(10,PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + ClassifierUtils.TestClassifiers(PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + println("SL Classifiers:") PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) From 27d6209b5c2741811de7fca0569459e652151908 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 20 May 2016 09:07:24 -0500 Subject: [PATCH 057/118] -Fixed the conversion to float -removed test population to avoid wrong edges between train and test -fixed a bug in feature generator indexing --- .../classifier/SL_model/SL_FeatureGenerator.scala | 5 ++++- .../saul/classifier/SL_model/Saul_SL_Inference.scala | 4 ++++ .../cs/cogcomp/saul/classifier/SL_model/Utils.scala | 11 ++++++----- .../nlp/EntityRelation/EntityRelationDataModel.scala | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 260b36f4..8457ff9c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -26,6 +26,7 @@ class SL_FeatureGenerator[HEAD<:AnyRef](model:SaulSLModel[HEAD]) extends Abstrac val a = sparseNet.getExampleArray(ci,false) var a0 = a(0).asInstanceOf[Array[Int]] var a1 = a(1).asInstanceOf[Array[Double]] + val fvTemp = new FeatureVectorBuffer(a0,a1) val lab = myY.labels(indC) for (netI<-0 until sparseNet.net.size()){ if (netI!=0) @@ -35,8 +36,10 @@ class SL_FeatureGenerator[HEAD<:AnyRef](model:SaulSLModel[HEAD]) extends Abstrac { a1 = Array() a0 = Array() + fvLocal.addFeature(new FeatureVectorBuffer(a0,a1),localOffset) } - fvLocal.addFeature(new FeatureVectorBuffer(a0,a1),localOffset) + else + fvLocal.addFeature(fvTemp,localOffset) } } ltuNum=ltuNum+sparseNet.net.size() diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 6ebe4bb6..c47b70b6 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -66,7 +66,11 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE val w1= ltuTemplates(ltu_count)//cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector print("w1 size\t", w1.size) val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(offset,offset+w1.size) + val p= cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Utils.converFarrayToD(myFactorJoinlyTrainedWeight)) + + cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Array[Double](0.1,0.2)) + offset = offset + ltuTemplates(ltu_count).length ltu_count= ltu_count + 1 } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala index f6f0859e..066ef0ef 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala @@ -1,13 +1,14 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model - +import Array._ /** * Created by Parisa on 4/1/16. */ object Utils { def converFarrayToD(a: Array[Float]):Array[Double]={ - var d:Array[Double]=Array[Double]() - a.foreach(x=> - d :+ Float.float2double(x)) - d + var d:Array[Double]=ofDim[Double](a.length) + for (i<-0 until a.length){ + d.update(i,Float.float2double(a(i))) + } + d } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala index 76022aff..02bd34ea 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala @@ -16,7 +16,7 @@ object EntityRelationDataModel extends DataModel { val sentencesToPairs = edge(sentences, pairs) val pairTo1stArg = edge(pairs, tokens) val pairTo2ndArg = edge(pairs, tokens) - val tokenToPair = edge(tokens, pairs) + // val tokenToPair = edge(tokens, pairs) sentenceToToken.addSensor(sentenceToTokens_GeneratingSensor _) sentencesToPairs.addSensor(sentenceToRelation_GeneratingSensor _) @@ -116,6 +116,6 @@ object EntityRelationDataModel extends DataModel { def populateWithConllSmallSet() = { sentences.populate(EntityRelationSensors.sentencesSmallSet) - sentences.populate(EntityRelationSensors.sentencesSmallSet2, train = false) + //sentences.populate(EntityRelationSensors.sentencesSmallSet2, train = false) } } From a40957f16b01b0d2d132aeb5f4bc4071baa40b5d Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 31 May 2016 12:32:01 -0500 Subject: [PATCH 058/118] -Fixed the weight update -Test on training instances --- .../SL_model/SL_FeatureGenerator.scala | 2 ++ .../SL_model/Saul_SL_Inference.scala | 19 +++++++++++++------ .../classifier/infer/InferenceCondition.scala | 2 +- .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 10 +++++----- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 8457ff9c..2a05cb53 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -40,6 +40,8 @@ class SL_FeatureGenerator[HEAD<:AnyRef](model:SaulSLModel[HEAD]) extends Abstrac } else fvLocal.addFeature(fvTemp,localOffset) + val p=fvLocal.toFeatureVector + } } ltuNum=ltuNum+sparseNet.net.size() diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index c47b70b6..d0bba7e4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,11 +1,12 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseWeightVector} +import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector +import scala.Array._ import scala.collection.mutable.ListBuffer import scala.reflect.ClassTag @@ -53,7 +54,6 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE } override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) val FactorsNum=a.size @@ -64,12 +64,19 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE for (i <- 0 until cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) { val w1= ltuTemplates(ltu_count)//cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector - print("w1 size\t", w1.size) + print("w",ltu_count," size:\t", w1.size) val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(offset,offset+w1.size) - val p= cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters - cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Utils.converFarrayToD(myFactorJoinlyTrainedWeight)) - cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector= new SparseWeightVector(Array[Double](0.1,0.2)) + val exampleFeatureIndexes = ofDim[Int](myFactorJoinlyTrainedWeight.length) + for (featureIndex <- 0 until myFactorJoinlyTrainedWeight.length) { + exampleFeatureIndexes(featureIndex) = featureIndex; + } + + + val p= cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] + p.weightVector.clear() + p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes,Utils.converFarrayToD(myFactorJoinlyTrainedWeight),0.0) + cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) offset = offset + ltuTemplates(ltu_count).length ltu_count= ltu_count + 1 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 08d714d4..543f0159 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -20,7 +20,7 @@ abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataM override def getSubjectToInstance: ParameterizedConstraint = { subjectTo.transfer } - verbosity = 2 + verbosity = 1 // TODO: override other functions that needed here override def getNormalizer(c:Learner): Normalizer ={ normalize diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 190801b8..7ef37e65 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -18,9 +18,9 @@ object mySL_Saul_TestApp extends App { ClassifierUtils.TrainClassifiers(10,PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) ClassifierUtils.TestClassifiers(PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) println("SL Classifiers:") - PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) - OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) - LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTestingInstances,outputGranularity = 10) - LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTestingInstances,outputGranularity = 10) - WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTestingInstances,outputGranularity = 10) + PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances,outputGranularity = 10) + OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances,outputGranularity = 10) + LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances,outputGranularity = 10) + LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances,outputGranularity = 10) + WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances,outputGranularity = 10) } From d20df419ef061a0d646b2967f754c940ebe02d0f Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 31 May 2016 12:34:48 -0500 Subject: [PATCH 059/118] -Format --- .../classifier/ConstrainedClassifier.scala | 21 ++--- .../cogcomp/saul/classifier/Learnable.scala | 10 +- .../saul/classifier/SL_model/Initialize.scala | 55 ++++++----- .../classifier/SL_model/JoinSLtrain.scala | 46 ++++----- .../SL_model/LossAugmentedNormalizer.scala | 46 +++++---- .../SL_model/SL_FeatureGenerator.scala | 50 +++++----- .../classifier/SL_model/SL_IOManager.scala | 23 ++--- .../classifier/SL_model/SaulSLModel.scala | 27 +++--- .../saul/classifier/SL_model/SaulSLTest.scala | 16 ++-- .../SL_model/Saul_SL_Inference.scala | 94 +++++++++---------- .../SL_model/Saul_SL_Instance.scala | 4 +- .../SL_model/Saul_SL_Label_Structure.scala | 12 +-- .../saul/classifier/SL_model/Utils.scala | 19 ++-- .../SL_model/lossAugmentedClassifier.scala | 65 +++++++------ .../classifier/infer/InferenceCondition.scala | 8 +- .../saul/classifier/infer/JointTemplate.scala | 4 +- .../saul/constraint/LfsConstraint.scala | 4 +- .../property/CombinedDiscreteProperty.scala | 4 +- .../EntityRelationClassifiers.scala | 4 +- .../EntityRelationDataModel.scala | 4 +- .../SL_SVM/iJLIS2/ERIOManager.scala | 2 +- .../SL_SVM/iJLIS3/mySL_Saul_TestApp.scala | 18 ++-- 22 files changed, 260 insertions(+), 276 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 53cb32ab..ab89150a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -111,17 +111,17 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo } } - def buildWithConstraint(infer: InferenceCondition[T, HEAD], cls: Learner, lexFlag: Boolean=true)(t: T): String = { + def buildWithConstraint(infer: InferenceCondition[T, HEAD], cls: Learner, lexFlag: Boolean = true)(t: T): String = { val lex = cls.getLabelLexicon var flag = false if (lexFlag) - for (i <- 0 until lex.size()) { - if (lex.lookupKey(i).valueEquals(cls.getLabeler().discreteValue(t))) - flag = true - } + for (i <- 0 until lex.size()) { + if (lex.lookupKey(i).valueEquals(cls.getLabeler().discreteValue(t))) + flag = true + } else - flag=true + flag = true findHead(t) match { case Some(head) => @@ -163,13 +163,12 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val dm: DataMo } } - - def lossAugmentedInfer(h:HEAD,offset: Int): ListBuffer[String] ={ - var v= ListBuffer[String]() + def lossAugmentedInfer(h: HEAD, offset: Int): ListBuffer[String] = { + var v = ListBuffer[String]() getCandidates(h).foreach { (example) => - // val g1 = onClassifier.scores(example) - v+= buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance(),new LossAugmentedNormalizer(offset,onClassifier,example)).convertToType[T], onClassifier)(example) + // val g1 = onClassifier.scores(example) + v += buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance(), new LossAugmentedNormalizer(offset, onClassifier, example)).convertToType[T], onClassifier)(example) } v } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala index e1d73b48..fd03ebaf 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala @@ -22,7 +22,7 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: /** Whether to use caching */ val useCache = false -// var scorerFlag= false + // var scorerFlag= false val loggging = false @@ -58,10 +58,10 @@ abstract class Learnable[T <: AnyRef](val datamodel: DataModel, val parameters: IOUtils.mkdir(modelDir) classifier.setModelLocation(lcFilePath()) classifier.setLexiconLocation(lexFilePath()) -// def setSorer(): Unit = -// { -// scorerFlag = true -// } + // def setSorer(): Unit = + // { + // scorerFlag = true + // } // create .lex file if it does not exist if (!IOUtils.exists(lexFilePath().getPath)) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 5c8db5bd..2c4bb561 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -7,20 +7,18 @@ import edu.illinois.cs.cogcomp.sl.util.WeightVector import scala.collection.JavaConversions._ import scala.collection.mutable.ListBuffer -/** - * Created by Parisa on 4/1/16. - * Here we only make the lbjava lexicons for each onClassifier - * (i.e. the base classifier of each constraint classifier) based on the features of IInstances - */ -object Initialize{ +/** Created by Parisa on 4/1/16. + * Here we only make the lbjava lexicons for each onClassifier + * (i.e. the base classifier of each constraint classifier) based on the features of IInstances + */ +object Initialize { + def apply[HEAD <: AnyRef](sp: SLProblem, model: SaulSLModel[HEAD]): SaulSLModel[HEAD] = { - def apply[HEAD<:AnyRef](sp:SLProblem , model:SaulSLModel[HEAD]): SaulSLModel[HEAD] = { - - model.Factors.foreach{ + model.Factors.foreach { cf => sp.instanceList.toList.zipWithIndex.foreach { - case (myIns,ind) => { + case (myIns, ind) => { val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] //for (i <- 0 until ins.ConstraintFactors.size) { val candis: Seq[_] = cf.getCandidates(ins.head) @@ -30,8 +28,8 @@ object Initialize{ x => val a = cf.onClassifier.getExampleArray(x) val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures - val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues - val exampleLabels = a(2).asInstanceOf[Array[Int]] + val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues + val exampleLabels = a(2).asInstanceOf[Array[Int]] val labelValues = a(3).asInstanceOf[Array[Double]] val label = exampleLabels(0) var N = ilearner.net.size(); @@ -40,36 +38,37 @@ object Initialize{ var ltu: LinearThresholdUnit = ilearner.getbaseLTU ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); ilearner.net.set(label, ltu); - print( "weight vector size:"+ilearner.net.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) - println("lexicon size:"+ilearner.getLexicon.size()) + print("weight vector size:" + ilearner.net.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) + println("lexicon size:" + ilearner.getLexicon.size()) N = label + 1; } } // for each candidate } // for each constraintFactor - }//end case - }//for each example + } //end case + } //for each example - var wvLength=0 + var wvLength = 0 var lt: ListBuffer[Array[Float]] = ListBuffer() model.Factors.foreach( x => { - val sparseNet= x.onClassifier.asInstanceOf[SparseNetworkLBP] - val temp= (sparseNet.getLexicon.size()) + val sparseNet = x.onClassifier.asInstanceOf[SparseNetworkLBP] + val temp = (sparseNet.getLexicon.size()) for (i <- 0 until sparseNet.net.size()) { - val t= Array.fill[Float](temp)(0) - lt= lt:+ t + val t = Array.fill[Float](temp)(0) + lt = lt :+ t wvLength = wvLength + temp } - println(sparseNet.getLexicon.size(), "*",sparseNet.getLabelLexicon.size()) - }) + println(sparseNet.getLexicon.size(), "*", sparseNet.getLabelLexicon.size()) + } + ) val myWeight = Array.fill[Float](wvLength)(0) - val wv= new WeightVector(myWeight) - val m= new SaulSLModel[HEAD](model.Factors.toList,lt) - m.wv=wv + val wv = new WeightVector(myWeight) + val m = new SaulSLModel[HEAD](model.Factors.toList, lt) + m.wv = wv m - }//end f apply -}// end of object + } //end f apply +} // end of object diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 39a3be89..0b18df86 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -10,7 +10,7 @@ import scala.reflect._ /** Created by Parisa on 12/3/15. */ object JoinSLtrain { - def apply[HEAD<:AnyRef]( + def apply[HEAD <: AnyRef]( dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]] )( @@ -21,40 +21,40 @@ object JoinSLtrain { trainSSVM[HEAD](dm, cls) } - def trainSSVM[HEAD<:AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { + def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { val sp = SL_IOManager.makeSLProblem(dm, cls) val model = Initialize(sp, new SaulSLModel(cls)) model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LtuTemplates, dm) val para = new SLParameters -// para.STOP_CONDITION = 0.0001f -// para.INNER_STOP_CONDITION= 0.0001f -// para.C_FOR_STRUCTURE = 1 -// para.CHECK_INFERENCE_OPT = false + // para.STOP_CONDITION = 0.0001f + // para.INNER_STOP_CONDITION= 0.0001f + // para.C_FOR_STRUCTURE = 1 + // para.CHECK_INFERENCE_OPT = false model.para = para model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - model.wv = learner.train(sp,model.wv) + model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") } - def TestSSVM [HEAD<:AnyRef](dm: DataModel,cls: List[ConstrainedClassifier[_,HEAD]], modelPath:String )(implicit t: ClassTag[HEAD]): Unit = { + def TestSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] - val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](dm, cls,testing=true) + val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](dm, cls, testing = true) - // val sp.instanceList.toList.map(x=> myModel.infSolver.getBestStructure(myModel.wv,x.asInstanceOf[Saul_SL_Instance].head.asInstanceOf[Saul_SL_Instance])) -// def apply { -// -// l.foreach { (c: ConstrainedClassifier[_, HEAD]) => -// { -// val oracle: Classifier = c.onClassifier.getLabeler() -// val candis: Seq[_] = c.getCandidates(x) -// candis.foreach { -// ci => -// labels.add(oracle.discreteValue(ci)) -// } -// } -// } -// } + // val sp.instanceList.toList.map(x=> myModel.infSolver.getBestStructure(myModel.wv,x.asInstanceOf[Saul_SL_Instance].head.asInstanceOf[Saul_SL_Instance])) + // def apply { + // + // l.foreach { (c: ConstrainedClassifier[_, HEAD]) => + // { + // val oracle: Classifier = c.onClassifier.getLabeler() + // val candis: Seq[_] = c.getCandidates(x) + // candis.foreach { + // ci => + // labels.add(oracle.discreteValue(ci)) + // } + // } + // } + // } } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala index 4c33a76b..677cf470 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala @@ -1,33 +1,31 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet -import edu.illinois.cs.cogcomp.lbjava.learn.{Learner, Normalizer} +import edu.illinois.cs.cogcomp.lbjava.learn.{ Learner, Normalizer } import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP -/** - * Created by Parisa on 4/18/16. - */ -class LossAugmentedNormalizer(cand_num:Int, c:Learner, example: AnyRef) extends Normalizer{ - /** - * Simply returns the argument. - * - * @param scores The set of scores to normalize. - * @return The normalized set of scores. - **/ +/** Created by Parisa on 4/18/16. + */ +class LossAugmentedNormalizer(cand_num: Int, c: Learner, example: AnyRef) extends Normalizer { + /** Simply returns the argument. + * + * @param scores The set of scores to normalize. + * @return The normalized set of scores. + */ def normalize(scores: ScoreSet): ScoreSet = { - if (cand_num==0) - print("There is no relevant component of this type in the head to be classified.") - val cf= c.asInstanceOf[SparseNetworkLBP] - val gold = cf.getLabeler.discreteValue(example) - val lLexicon = cf.getLabelLexicon + if (cand_num == 0) + print("There is no relevant component of this type in the head to be classified.") + val cf = c.asInstanceOf[SparseNetworkLBP] + val gold = cf.getLabeler.discreteValue(example) + val lLexicon = cf.getLabelLexicon - val resultS: ScoreSet = cf.scores(example)//new ScoreSet - for (i <- 0 until lLexicon.size()) { - if (lLexicon.lookupKey(i).valueEquals(gold)) - resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) - else - resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1/(cand_num)) ) - } - resultS + val resultS: ScoreSet = cf.scores(example) //new ScoreSet + for (i <- 0 until lLexicon.size()) { + if (lLexicon.lookupKey(i).valueEquals(gold)) + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1 / (cand_num))) + else + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1 / (cand_num))) + } + resultS } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 2a05cb53..4de42ffc 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -1,12 +1,12 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP -import edu.illinois.cs.cogcomp.sl.core.{AbstractFeatureGenerator, IInstance, IStructure} -import edu.illinois.cs.cogcomp.sl.util.{FeatureVectorBuffer, IFeatureVector} +import edu.illinois.cs.cogcomp.sl.core.{ AbstractFeatureGenerator, IInstance, IStructure } +import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } /** Created by Parisa on 12/8/15. - */ -class SL_FeatureGenerator[HEAD<:AnyRef](model:SaulSLModel[HEAD]) extends AbstractFeatureGenerator { + */ +class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends AbstractFeatureGenerator { override def getFeatureVector(x: IInstance, y: IStructure): IFeatureVector = { val myX = x.asInstanceOf[Saul_SL_Instance[HEAD]] @@ -14,43 +14,41 @@ class SL_FeatureGenerator[HEAD<:AnyRef](model:SaulSLModel[HEAD]) extends Abstrac val fv = new FeatureVectorBuffer() var ltuNum = 0 var factorOffset = 0 - model.Factors.zipWithIndex.foreach{ + model.Factors.zipWithIndex.foreach { - case (cf,indF) => + case (cf, indF) => val candis: Seq[_] = cf.getCandidates(myX.head) - val sparseNet= cf.onClassifier.asInstanceOf[SparseNetworkLBP] + val sparseNet = cf.onClassifier.asInstanceOf[SparseNetworkLBP] val fvLocal = new FeatureVectorBuffer() var localOffset = 0 candis.zipWithIndex.foreach { - case (ci,indC) => - val a = sparseNet.getExampleArray(ci,false) + case (ci, indC) => + val a = sparseNet.getExampleArray(ci, false) var a0 = a(0).asInstanceOf[Array[Int]] var a1 = a(1).asInstanceOf[Array[Double]] - val fvTemp = new FeatureVectorBuffer(a0,a1) + val fvTemp = new FeatureVectorBuffer(a0, a1) val lab = myY.labels(indC) - for (netI<-0 until sparseNet.net.size()){ - if (netI!=0) - localOffset= localOffset+ model.LtuTemplates(ltuNum+netI-1).length - else localOffset =0 - if (!sparseNet.getLabelLexicon.lookupKey(netI).valueEquals(lab)) - { + for (netI <- 0 until sparseNet.net.size()) { + if (netI != 0) + localOffset = localOffset + model.LtuTemplates(ltuNum + netI - 1).length + else localOffset = 0 + if (!sparseNet.getLabelLexicon.lookupKey(netI).valueEquals(lab)) { a1 = Array() a0 = Array() - fvLocal.addFeature(new FeatureVectorBuffer(a0,a1),localOffset) - } - else - fvLocal.addFeature(fvTemp,localOffset) - val p=fvLocal.toFeatureVector + fvLocal.addFeature(new FeatureVectorBuffer(a0, a1), localOffset) + } else + fvLocal.addFeature(fvTemp, localOffset) + val p = fvLocal.toFeatureVector } - } - ltuNum=ltuNum+sparseNet.net.size() + } + ltuNum = ltuNum + sparseNet.net.size() - if (indF>0) - factorOffset = factorOffset + model.Factors(indF-1).onClassifier.getLexicon.size() * model.Factors(indF-1).onClassifier.getLabelLexicon.size() + if (indF > 0) + factorOffset = factorOffset + model.Factors(indF - 1).onClassifier.getLexicon.size() * model.Factors(indF - 1).onClassifier.getLabelLexicon.size() fv.addFeature(fvLocal, factorOffset) - } + } fv.toFeatureVector() diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index baa67719..60affcb1 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -11,25 +11,22 @@ import scala.reflect.ClassTag */ object SL_IOManager { val lexm: Lexiconer = new Lexiconer() - def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]],testing:Boolean=false)(implicit t: ClassTag[HEAD]): SLProblem = { + def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]], testing: Boolean = false)(implicit t: ClassTag[HEAD]): SLProblem = { var sp: SLProblem = new SLProblem() - var allHeads : Iterable[HEAD]= Iterable[HEAD]() - if (testing) - { + var allHeads: Iterable[HEAD] = Iterable[HEAD]() + if (testing) { allHeads = dm.getNodeWithType[HEAD].getTestingInstances - } - else - { + } else { allHeads = dm.getNodeWithType[HEAD].getTrainingInstances } allHeads.foreach(x => - { - // val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava - val ins = new Saul_SL_Instance(x) - val outs = new Saul_SL_Label_Structure(list, x) - sp.addExample(ins, outs) - }) + { + // val l: java.util.List[ConstrainedClassifier[_,HEAD]] =list.asJava + val ins = new Saul_SL_Instance(x) + val outs = new Saul_SL_Label_Structure(list, x) + sp.addExample(ins, outs) + }) sp } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala index 650e1df2..acb1295b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala @@ -1,29 +1,28 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import java.io.{BufferedOutputStream, FileOutputStream, ObjectOutputStream} +import java.io.{ BufferedOutputStream, FileOutputStream, ObjectOutputStream } import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} +import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } import scala.collection.mutable.ListBuffer -/** - * Created by Parisa on 4/1/16. - */ -class SaulSLModel[HEAD<: AnyRef](cls: List[ConstrainedClassifier[_,HEAD]], listBuffer: ListBuffer[Array[Float]]=ListBuffer()) extends SLModel with Serializable{ - var LtuTemplates: ListBuffer[Array[Float]]= listBuffer - var Factors: ListBuffer[ConstrainedClassifier[_, HEAD]] =ListBuffer() - cls.foreach { - (c: ConstrainedClassifier[_, HEAD]) => - Factors += (c) - } +/** Created by Parisa on 4/1/16. + */ +class SaulSLModel[HEAD <: AnyRef](cls: List[ConstrainedClassifier[_, HEAD]], listBuffer: ListBuffer[Array[Float]] = ListBuffer()) extends SLModel with Serializable { + var LtuTemplates: ListBuffer[Array[Float]] = listBuffer + var Factors: ListBuffer[ConstrainedClassifier[_, HEAD]] = ListBuffer() + cls.foreach { + (c: ConstrainedClassifier[_, HEAD]) => + Factors += (c) + } - override def saveModel(fileName :String): Unit = { + override def saveModel(fileName: String): Unit = { numFeatuerBit = SLParameters.HASHING_MASK val oos: ObjectOutputStream = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(fileName))) oos.writeObject(this.wv) oos.close - // logger.info("Done!") + // logger.info("Done!") } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala index b8829d42..7f8a30e4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala @@ -7,26 +7,26 @@ import edu.illinois.cs.cogcomp.sl.core.IStructure import scala.collection.JavaConversions._ import scala.reflect.ClassTag -/** - * Created by Parisa on 4/1/16. - */ +/** Created by Parisa on 4/1/16. + */ object SaulSLTest { - def evaluate[HEAD<:AnyRef](goldIstructure: List[IStructure], predictedIstructure: List[IStructure], model: SaulSLModel[HEAD]) = { + def evaluate[HEAD <: AnyRef](goldIstructure: List[IStructure], predictedIstructure: List[IStructure], model: SaulSLModel[HEAD]) = { model.Factors.foreach { - x=> { - } + x => + { + } } } - def apply[HEAD<:AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], model: SaulSLModel[HEAD], inference: Saul_SL_Inference[HEAD])(implicit t: ClassTag[HEAD]): Unit = { + def apply[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], model: SaulSLModel[HEAD], inference: Saul_SL_Inference[HEAD])(implicit t: ClassTag[HEAD]): Unit = { val sp = SL_IOManager.makeSLProblem(dm, cls, true) var a: List[IStructure] = List[IStructure]() sp.instanceList.toList.foreach { ins => a = model.infSolver.getBestStructure(model.wv, ins) :: a } - evaluate(a,sp.goldStructureList.toList, model) + evaluate(a, sp.goldStructureList.toList, model) } } \ No newline at end of file diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index d0bba7e4..36d319a2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,9 +1,9 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit -import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, SparseNetworkLBP } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} +import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } import edu.illinois.cs.cogcomp.sl.util.WeightVector import scala.Array._ @@ -12,9 +12,9 @@ import scala.reflect.ClassTag /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HEAD]], ltuTemplates: ListBuffer[Array[Float]], dm:DataModel) (implicit t:ClassTag[HEAD]) extends AbstractInferenceSolver { - val a=factors - val dataM=dm +class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, HEAD]], ltuTemplates: ListBuffer[Array[Float]], dm: DataModel)(implicit t: ClassTag[HEAD]) extends AbstractInferenceSolver { + val a = factors + val dataM = dm override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] @@ -35,69 +35,67 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_,HE var count = 0 println(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) a.foreach { - x=> - var localLoss=0 - // val oracle: Classifier = x.onClassifier.getLabeler() - val candidates= x.getCandidates(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) - candidates.foreach{ + x => + var localLoss = 0 + // val oracle: Classifier = x.onClassifier.getLabeler() + val candidates = x.getCandidates(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) + candidates.foreach { ci => - if (myGold.labels(count)!=(myPred.labels(count))) - localLoss = localLoss+1 - count=count+1 - } - if (candidates.size!=0) - TotalLoss=TotalLoss+localLoss/candidates.size - } - TotalLoss=TotalLoss/factors.size - println("Loss="+TotalLoss) + if (myGold.labels(count) != (myPred.labels(count))) + localLoss = localLoss + 1 + count = count + 1 + } + if (candidates.size != 0) + TotalLoss = TotalLoss + localLoss / candidates.size + } + TotalLoss = TotalLoss / factors.size + println("Loss=" + TotalLoss) TotalLoss } override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) - val FactorsNum=a.size + val FactorsNum = a.size var ltu_count = 0 var offset = 0 a.foreach { - cf=> - for (i <- 0 until cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) - { - val w1= ltuTemplates(ltu_count)//cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector - print("w",ltu_count," size:\t", w1.size) - val myFactorJoinlyTrainedWeight= weight.getWeightArray.slice(offset,offset+w1.size) + cf => + for (i <- 0 until cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) { + val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector + print("w", ltu_count, " size:\t", w1.size) + val myFactorJoinlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) val exampleFeatureIndexes = ofDim[Int](myFactorJoinlyTrainedWeight.length) for (featureIndex <- 0 until myFactorJoinlyTrainedWeight.length) { exampleFeatureIndexes(featureIndex) = featureIndex; } - - val p= cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] - p.weightVector.clear() - p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes,Utils.converFarrayToD(myFactorJoinlyTrainedWeight),0.0) - cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) + val p = cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] + p.weightVector.clear() + p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJoinlyTrainedWeight), 0.0) + cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) offset = offset + ltuTemplates(ltu_count).length - ltu_count= ltu_count + 1 + ltu_count = ltu_count + 1 } - cf.onClassifier.setLossFlag() - cf.onClassifier.setCandidates(cf.getCandidates(myIns.head).size* FactorsNum) - } + cf.onClassifier.setLossFlag() + cf.onClassifier.setCandidates(cf.getCandidates(myIns.head).size * FactorsNum) + } - var labelCount=0 - a.foreach { - cf=> - cf.getCandidates(myIns.head).foreach { - x => - print(cf.classifier.name.substring(80)+"\t") - print("gt:"+cf.onClassifier.getLabeler.discreteValue(x)) - myStruct.labels(labelCount)= cf.classifier.discreteValue(x) - println("\tmvc:"+myStruct.labels(labelCount)) - labelCount= labelCount+1 + var labelCount = 0 + a.foreach { + cf => + cf.getCandidates(myIns.head).foreach { + x => + print(cf.classifier.name.substring(80) + "\t") + print("gt:" + cf.onClassifier.getLabeler.discreteValue(x)) + myStruct.labels(labelCount) = cf.classifier.discreteValue(x) + println("\tmvc:" + myStruct.labels(labelCount)) + labelCount = labelCount + 1 + } } - } - a.map (x=> x.onClassifier.unsetLossFlag()) + a.map(x => x.onClassifier.unsetLossFlag()) myStruct } - } +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala index e81f37c5..56c15839 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Instance.scala @@ -5,6 +5,6 @@ import edu.illinois.cs.cogcomp.sl.core.IInstance /** Created by Parisa on 12/10/15. */ case class Saul_SL_Instance[HEAD <: AnyRef](x: HEAD) extends IInstance { - val head: HEAD = x - } + val head: HEAD = x +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala index 5822219e..c31391a6 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -14,12 +14,12 @@ class Saul_SL_Label_Structure[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, H var labels: ListBuffer[String] = ListBuffer() l.foreach { (c: ConstrainedClassifier[_, HEAD]) => - { - val oracle: Classifier = c.onClassifier.getLabeler() - val candis: Seq[_] = c.getCandidates(x) - candis.foreach { - ci => - labels.add(oracle.discreteValue(ci)) + { + val oracle: Classifier = c.onClassifier.getLabeler() + val candis: Seq[_] = c.getCandidates(x) + candis.foreach { + ci => + labels.add(oracle.discreteValue(ci)) } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala index 066ef0ef..a2fa720d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Utils.scala @@ -1,14 +1,13 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import Array._ -/** - * Created by Parisa on 4/1/16. - */ +/** Created by Parisa on 4/1/16. + */ object Utils { - def converFarrayToD(a: Array[Float]):Array[Double]={ - var d:Array[Double]=ofDim[Double](a.length) - for (i<-0 until a.length){ - d.update(i,Float.float2double(a(i))) - } - d - } + def converFarrayToD(a: Array[Float]): Array[Double] = { + var d: Array[Double] = ofDim[Double](a.length) + for (i <- 0 until a.length) { + d.update(i, Float.float2double(a(i))) + } + d + } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala index 39fcd8d4..b572c8a3 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala @@ -1,44 +1,43 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import java.io.PrintStream -import edu.illinois.cs.cogcomp.lbjava.classify.{FeatureVector, ScoreSet} +import edu.illinois.cs.cogcomp.lbjava.classify.{ FeatureVector, ScoreSet } import edu.illinois.cs.cogcomp.lbjava.learn.Learner import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP -/** - * Created by Parisa on 4/1/16. - */ -class lossAugmentedClassifier[T<:AnyRef](c:Learner, cand_num: Int=1) extends Learner("lossAugmentedClassifier") { - override def getInputType: String = { "dummy"} - - override def allowableValues: Array[String] = c.allowableValues()//{ Array[String]("false", "true") } - - override def equals(o: Any): Boolean = { getClass == o.getClass } - - /** The reason for true to be -1 is because the internal optimization by default finds the maximizer, while in this - * problem we are looking for a minimizer - */ - override def scores(example: AnyRef): ScoreSet = { - if (cand_num==0) - print("There is no relevant component of this type in the head to be classified.") - val cf= c.asInstanceOf[SparseNetworkLBP] - val gold = cf.getLabeler.discreteValue(example) - val lLexicon = cf.getLabelLexicon - val resultS: ScoreSet = c.scores(example)//new ScoreSet - for (i <- 0 until lLexicon.size()) { - if (lLexicon.lookupKey(i).valueEquals(gold)) - resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1/(cand_num)) ) - else - resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1/(cand_num)) ) - } - resultS +/** Created by Parisa on 4/1/16. + */ +class lossAugmentedClassifier[T <: AnyRef](c: Learner, cand_num: Int = 1) extends Learner("lossAugmentedClassifier") { + override def getInputType: String = { "dummy" } + + override def allowableValues: Array[String] = c.allowableValues() //{ Array[String]("false", "true") } + + override def equals(o: Any): Boolean = { getClass == o.getClass } + + /** The reason for true to be -1 is because the internal optimization by default finds the maximizer, while in this + * problem we are looking for a minimizer + */ + override def scores(example: AnyRef): ScoreSet = { + if (cand_num == 0) + print("There is no relevant component of this type in the head to be classified.") + val cf = c.asInstanceOf[SparseNetworkLBP] + val gold = cf.getLabeler.discreteValue(example) + val lLexicon = cf.getLabelLexicon + val resultS: ScoreSet = c.scores(example) //new ScoreSet + for (i <- 0 until lLexicon.size()) { + if (lLexicon.lookupKey(i).valueEquals(gold)) + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score - (1 / (cand_num))) + else + resultS.put(lLexicon.lookupKey(i).getStringValue, resultS.getScore(lLexicon.lookupKey(i).getStringValue).score + (1 / (cand_num))) } + resultS + } - override def write(printStream: PrintStream): Unit = ??? + override def write(printStream: PrintStream): Unit = ??? - override def scores(ints: Array[Int], doubles: Array[Double]): ScoreSet = ??? + override def scores(ints: Array[Int], doubles: Array[Double]): ScoreSet = ??? - override def classify(ints: Array[Int], doubles: Array[Double]): FeatureVector = ??? + override def classify(ints: Array[Int], doubles: Array[Double]): FeatureVector = ??? - override def learn(ints: Array[Int], doubles: Array[Double], ints1: Array[Int], doubles1: Array[Double]): Unit = ??? - } + override def learn(ints: Array[Int], doubles: Array[Double], ints1: Array[Int], doubles1: Array[Double]): Unit = ??? +} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 543f0159..b4ccd190 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -1,13 +1,13 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint } -import edu.illinois.cs.cogcomp.lbjava.learn.{IdentityNormalizer, Normalizer, Learner} +import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Normalizer, Learner } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import scala.reflect.ClassTag -abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataModel, solver: ILPSolver, normalize: Normalizer= new IdentityNormalizer)( +abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataModel, solver: ILPSolver, normalize: Normalizer = new IdentityNormalizer)( implicit val inputTag: ClassTag[INPUT], val headTag: ClassTag[HEAD] @@ -15,14 +15,14 @@ abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](val dm: DataM def subjectTo: LfsConstraint[HEAD] def transfer(t: HEAD): JointTemplate[HEAD] = { - new JointTemplate[HEAD](t, solver,normalize) { + new JointTemplate[HEAD](t, solver, normalize) { // TODO: Define this function override def getSubjectToInstance: ParameterizedConstraint = { subjectTo.transfer } verbosity = 1 // TODO: override other functions that needed here - override def getNormalizer(c:Learner): Normalizer ={ + override def getNormalizer(c: Learner): Normalizer = { normalize } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala index 3b11a370..d6780a03 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala @@ -3,7 +3,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint, ILPInference } import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Normalizer, Learner } -abstract class JointTemplate[T](head: T, solver: ILPSolver, norm: Normalizer= new IdentityNormalizer) extends ILPInference(head, solver) { +abstract class JointTemplate[T](head: T, solver: ILPSolver, norm: Normalizer = new IdentityNormalizer) extends ILPInference(head, solver) { constraint = this.getSubjectToInstance.makeConstraint(head) override def getHeadType: String = { @@ -15,7 +15,7 @@ abstract class JointTemplate[T](head: T, solver: ILPSolver, norm: Normalizer= ne } override def getNormalizer(c: Learner): Normalizer //= { - // new IdentityNormalizer + // new IdentityNormalizer //} def getSubjectToInstance: ParameterizedConstraint diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala index 24f3d3c6..37e24bab 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saul.constraint import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint, FirstOrderConstraint } -import edu.illinois.cs.cogcomp.lbjava.learn.{IdentityNormalizer, Normalizer} +import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Normalizer } import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.datamodel.DataModel @@ -35,7 +35,7 @@ abstract class LfsConstraint[T <: AnyRef](implicit val tag: ClassTag[T]) { val lc = this - def createInferenceCondition[C <: AnyRef](dm: DataModel, solver: ILPSolver, normalize: Normalizer= new IdentityNormalizer)(implicit cTag: ClassTag[C]): InferenceCondition[C, T] = { + def createInferenceCondition[C <: AnyRef](dm: DataModel, solver: ILPSolver, normalize: Normalizer = new IdentityNormalizer)(implicit cTag: ClassTag[C]): InferenceCondition[C, T] = { new InferenceCondition[C, T](dm, solver, normalize) { override def subjectTo: LfsConstraint[T] = lc } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala index 6be11fb3..f34baf4c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/property/CombinedDiscreteProperty.scala @@ -2,7 +2,7 @@ package edu.illinois.cs.cogcomp.saul.datamodel.property import java.util -import edu.illinois.cs.cogcomp.lbjava.classify.{Classifier, FeatureVector} +import edu.illinois.cs.cogcomp.lbjava.classify.{ Classifier, FeatureVector } import edu.illinois.cs.cogcomp.saul.datamodel.property.features.ClassifierContainsInLBP import scala.reflect.ClassTag @@ -53,8 +53,6 @@ case class CombinedDiscreteProperty[T <: AnyRef]( // resultS // } - - override def getCompositeChildren: util.LinkedList[_] = { val result: util.LinkedList[Classifier] = new util.LinkedList[Classifier]() atts.foreach(x => result.add(x.classifier)) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala index 3004d469..79d43efe 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala @@ -1,8 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.saul.classifier.{Learnable, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.classifier.{ Learnable, SparseNetworkLBP } import edu.illinois.cs.cogcomp.saul.datamodel.property.Property -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRawSentence, ConllRawToken, ConllRelation} +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawSentence, ConllRawToken, ConllRelation } import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ object EntityRelationClassifiers { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala index 02bd34ea..325de2d1 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRawSentence, ConllRawToken, ConllRelation} +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawSentence, ConllRawToken, ConllRelation } import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationSensors._ @@ -16,7 +16,7 @@ object EntityRelationDataModel extends DataModel { val sentencesToPairs = edge(sentences, pairs) val pairTo1stArg = edge(pairs, tokens) val pairTo2ndArg = edge(pairs, tokens) - // val tokenToPair = edge(tokens, pairs) + // val tokenToPair = edge(tokens, pairs) sentenceToToken.addSensor(sentenceToTokens_GeneratingSensor _) sentencesToPairs.addSensor(sentenceToRelation_GeneratingSensor _) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala index 8cedf488..b06dc707 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2 -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{Conll04_Reader} +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{ Conll04_Reader } import edu.illinois.cs.cogcomp.sl.core.SLProblem object ERIOManager { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala index 7ef37e65..8cb22923 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala @@ -11,16 +11,16 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDat object mySL_Saul_TestApp extends App { EntityRelationDataModel.populateWithConllSmallSet() - JoinSLtrain(EntityRelationDataModel, List(PerConstrainedClassifier,OrgConstrainedClassifier, LocConstrainedClassifier,LivesIn_PerOrg_relationConstrainedClassifier,WorksFor_PerOrg_ConstrainedClassifier)) + JoinSLtrain(EntityRelationDataModel, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) /* Test SL_ER */ - println("Independent Classifiers:") - ClassifierUtils.TrainClassifiers(10,PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + println("Independent Classifiers:") + ClassifierUtils.TrainClassifiers(10, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) ClassifierUtils.TestClassifiers(PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) - println("SL Classifiers:") - PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances,outputGranularity = 10) - OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances,outputGranularity = 10) - LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances,outputGranularity = 10) - LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances,outputGranularity = 10) - WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances,outputGranularity = 10) + println("SL Classifiers:") + PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) + OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) + LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) + LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) + WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) } From 00594cd822fd92bcf187c61ee2081323bef4ec48 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 8 Jun 2016 23:16:00 -0500 Subject: [PATCH 060/118] -updated with upstream master --- .../cogcomp/saul/classifier/ConstrainedClassifier.scala | 9 ++++----- .../saul/classifier/SL_model/SL_FeatureGenerator.scala | 2 +- .../saul/classifier/SL_model/Saul_SL_Inference.scala | 6 +++--- .../classifier/SL_model/Saul_SL_Label_Structure.scala | 2 +- .../SL_model/Saul_SL_Label_java_Structure.java | 2 +- .../saul/classifier/infer/InferenceCondition.scala | 6 +++--- .../cs/cogcomp/saul/constraint/LfsConstraint.scala | 2 +- .../nlp/EntityRelation/EntityRelationClassifiers.scala | 2 +- 8 files changed, 15 insertions(+), 16 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 5e78627b..1546be0f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -1,15 +1,14 @@ package edu.illinois.cs.cogcomp.saul.classifier -import edu.illinois.cs.cogcomp.lbjava.classify.{ Classifier, FeatureVector, TestDiscrete } +import edu.illinois.cs.cogcomp.lbjava.classify.{Classifier, FeatureVector, TestDiscrete} import edu.illinois.cs.cogcomp.lbjava.infer._ import edu.illinois.cs.cogcomp.lbjava.learn.Learner -import edu.illinois.cs.cogcomp.lbjava.parse.Parser -import edu.illinois.cs.cogcomp.saul.classifier.SL_model.LossAugmentedNormalizer import edu.illinois.cs.cogcomp.saul.TestWithStorage +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.LossAugmentedNormalizer import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import edu.illinois.cs.cogcomp.saul.datamodel.edge.Edge -import edu.illinois.cs.cogcomp.saul.lbjrelated.{ LBJLearnerEquivalent, LBJClassifierEquivalent } +import edu.illinois.cs.cogcomp.saul.lbjrelated.{LBJClassifierEquivalent, LBJLearnerEquivalent} import edu.illinois.cs.cogcomp.saul.parser.LBJIteratorParserScala import scala.collection.mutable.ListBuffer @@ -121,7 +120,7 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi getCandidates(h).foreach { (example) => // val g1 = onClassifier.scores(example) - v += buildWithConstraint(subjectTo.createInferenceCondition[T](this.dm, getSolverInstance(), new LossAugmentedNormalizer(offset, onClassifier, example)).convertToType[T], onClassifier)(example) + v += buildWithConstraint(subjectTo.createInferenceCondition[T](getSolverInstance(), new LossAugmentedNormalizer(offset, onClassifier.classifier, example)).convertToType[T], onClassifier.classifier)(example) } v } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 4de42ffc..9eaafdd2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -45,7 +45,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst ltuNum = ltuNum + sparseNet.net.size() if (indF > 0) - factorOffset = factorOffset + model.Factors(indF - 1).onClassifier.getLexicon.size() * model.Factors(indF - 1).onClassifier.getLabelLexicon.size() + factorOffset = factorOffset + model.Factors(indF - 1).onClassifier.classifier.getLexicon.size() * model.Factors(indF - 1).onClassifier.getLabelLexicon.size() fv.addFeature(fvLocal, factorOffset) } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 36d319a2..df92817a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -79,8 +79,8 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H offset = offset + ltuTemplates(ltu_count).length ltu_count = ltu_count + 1 } - cf.onClassifier.setLossFlag() - cf.onClassifier.setCandidates(cf.getCandidates(myIns.head).size * FactorsNum) + cf.onClassifier.classifier.setLossFlag() + cf.onClassifier.classifier.setCandidates(cf.getCandidates(myIns.head).size * FactorsNum) } var labelCount = 0 @@ -95,7 +95,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H labelCount = labelCount + 1 } } - a.map(x => x.onClassifier.unsetLossFlag()) + a.map(x => x.onClassifier.classifier.unsetLossFlag()) myStruct } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala index c31391a6..6e5d6a87 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -15,7 +15,7 @@ class Saul_SL_Label_Structure[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, H l.foreach { (c: ConstrainedClassifier[_, HEAD]) => { - val oracle: Classifier = c.onClassifier.getLabeler() + val oracle: Classifier = c.onClassifier.classifier.getLabeler() val candis: Seq[_] = c.getCandidates(x) candis.foreach { ci => diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java index cd8f2e41..6246e543 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java @@ -17,7 +17,7 @@ public class Saul_SL_Label_java_Structure<_,HEAD> implements IStructure { public Saul_SL_Label_java_Structure(ArrayList> l, HEAD x){ for (ConstrainedClassifier c : l){ - labels.add(c.onClassifier().discreteValue(x)); + labels.add(c.onClassifier().classifier().discreteValue(x)); } } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 8dfc1710..6f9bca15 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -1,12 +1,12 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer -import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint } -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.lbjava.infer.{ILPSolver, ParameterizedConstraint} +import edu.illinois.cs.cogcomp.lbjava.learn.{IdentityNormalizer, Learner, Normalizer} import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import scala.reflect.ClassTag -abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](solver: ILPSolver)( +abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](solver: ILPSolver, normalize: Normalizer = new IdentityNormalizer)( implicit val inputTag: ClassTag[INPUT], val headTag: ClassTag[HEAD] diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala index 1846a8bd..1bfb6d68 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala @@ -34,7 +34,7 @@ abstract class LfsConstraint[T <: AnyRef](implicit val tag: ClassTag[T]) { val lc = this - def createInferenceCondition[C <: AnyRef](solver: ILPSolver, normalize: Normalizer = new IdentityNormalizer)(implicit cTag: ClassTag[C]): InferenceCondition[C, T] = { + def createInferenceCondition[C <: AnyRef](solver: ILPSolver, normalizer: Normalizer = new IdentityNormalizer)(implicit cTag: ClassTag[C]): InferenceCondition[C, T] = { new InferenceCondition[C, T](solver,normalizer) { override def subjectTo: LfsConstraint[T] = lc } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala index 4e6aab2e..904d717e 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala @@ -10,7 +10,7 @@ object EntityRelationClassifiers { object OrganizationClassifier extends Learnable(tokens) { def label: Property[ConllRawToken] = entityType is "Org" override lazy val classifier = new SparseNetworkLBP - override def feature = using(word, windowWithin[ConllRawSentence](-2, 2, List(pos)), phrase, + override def feature = using(word, windowWithin[ConllRawSentence](EntityRelationDataModel, -2, 2, List(pos)), phrase, containsSubPhraseMent, containsSubPhraseIng, wordLen) // The gazetteer properties are temporarily removed: containsInPersonList, containsInCityList } From f1eb1a0e6a1d7058e254c9efdf91ceb182a159b9 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 9 Jun 2016 10:43:51 -0500 Subject: [PATCH 061/118] -deleted all temporary test files -minor edits --- .../saul/classifier/SL_model/Initialize.scala | 8 +- ...stApp.scala => EntityRelationApp_SL.scala} | 5 +- .../SL_SVM/iJLIS/ERFeatureGenerator.java | 24 - .../SL_SVM/iJLIS/ERiStructure.java | 53 - .../SL_SVM/iJLIS/ERqInstance.java | 29 - .../SL_SVM/iJLIS/Nodevalues.java | 8 - .../EntityRelation/SL_SVM/iJLIS/Runner.java | 179 --- .../EntityRelation/SL_SVM/iJLIS/Runner.scala | 120 -- .../EntityRelation/SL_SVM/iJLIS/SUtils.java | 49 - .../SL_SVM/iJLIS/iERinference.scala | 103 -- .../SL_SVM/iJLIS/iERjavaInference.java | 223 ---- .../SL_SVM/iJLIS/mytest.ssvm.model | Bin 15524 -> 0 bytes .../EntityRelation/SL_SVM/iJLIS/namedata-test | 92 -- .../SL_SVM/iJLIS/namedata-train | 274 ---- .../nlp/EntityRelation/SL_SVM/iJLIS/names | 1099 ----------------- .../SL_SVM/iJLIS2/ERFeatureGenerator.java | 84 -- .../SL_SVM/iJLIS2/ERIOManager.scala | 24 - .../SL_SVM/iJLIS2/ERiStructurePL.java | 33 - .../SL_SVM/iJLIS2/ERqInstancePL.java | 35 - .../SL_SVM/iJLIS2/JointER$subjectto.java | 94 -- .../EntityRelation/SL_SVM/iJLIS2/JointER.java | 42 - .../EntityRelation/SL_SVM/iJLIS2/Labels.scala | 36 - .../SL_SVM/iJLIS2/RunnerPL.scala | 112 -- .../SL_SVM/iJLIS2/iERjavaInferencePL.java | 585 --------- .../EntityRelation/SL_SVM/iJLIS3/test.scala | 41 - 25 files changed, 6 insertions(+), 3346 deletions(-) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/{SL_SVM/iJLIS3/mySL_Saul_TestApp.scala => EntityRelationApp_SL.scala} (88%) delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERFeatureGenerator.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERiStructure.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERqInstance.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Nodevalues.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.scala delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/SUtils.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERinference.scala delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERjavaInference.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/mytest.ssvm.model delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/namedata-test delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/namedata-train delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/names delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERFeatureGenerator.java delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERiStructurePL.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERqInstancePL.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/JointER$subjectto.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/JointER.java delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/Labels.scala delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/RunnerPL.scala delete mode 100755 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/iERjavaInferencePL.java delete mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 2c4bb561..8c992158 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -22,11 +22,11 @@ object Initialize { val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] //for (i <- 0 until ins.ConstraintFactors.size) { val candis: Seq[_] = cf.getCandidates(ins.head) - val ilearner = cf.onClassifier.asInstanceOf[SparseNetworkLBP] - val lLexicon = cf.onClassifier.getLabelLexicon + val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val lLexicon = cf.onClassifier.classifier.getLabelLexicon candis.foreach { x => - val a = cf.onClassifier.getExampleArray(x) + val a = cf.onClassifier.classifier.getExampleArray(x) val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues val exampleLabels = a(2).asInstanceOf[Array[Int]] @@ -53,7 +53,7 @@ object Initialize { model.Factors.foreach( x => { - val sparseNet = x.onClassifier.asInstanceOf[SparseNetworkLBP] + val sparseNet = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] val temp = (sparseNet.getLexicon.size()) for (i <- 0 until sparseNet.net.size()) { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala similarity index 88% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 8cb22923..e8b1fff2 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/mySL_Saul_TestApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -1,14 +1,13 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS3 +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel /** Created by Parisa on 12/8/15. */ -object mySL_Saul_TestApp extends App { +object EntityRelationApp_SL extends App { EntityRelationDataModel.populateWithConllSmallSet() JoinSLtrain(EntityRelationDataModel, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERFeatureGenerator.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERFeatureGenerator.java deleted file mode 100644 index 0f979e72..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERFeatureGenerator.java +++ /dev/null @@ -1,24 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; - -import edu.illinois.cs.cogcomp.sl.core.AbstractFeatureGenerator; -import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; - -/** - * Created by Parisa on 10/27/15. - */ -public class ERFeatureGenerator extends AbstractFeatureGenerator { - private static final long serialVersionUID = 1L; - public ERFeatureGenerator(){ - - } - public IFeatureVector getFeatureVector (IInstance x, IStructure y){ - ERqInstance mx= (ERqInstance) x; - ERiStructure my=(ERiStructure) y; - FeatureVectorBuffer fvb= new FeatureVectorBuffer(mx.fv); - //TODO tune fvb indexes - return fvb.toFeatureVector(); - } -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERiStructure.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERiStructure.java deleted file mode 100755 index 7f2b25d6..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERiStructure.java +++ /dev/null @@ -1,53 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; - -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; -import java.util.ArrayList; -import java.util.List; - - -/** - * Created by parisakordjamshidi on 19/09/14. - */ -public class ERiStructure implements IStructure { - - public Boolean nodeValues; - public ERqInstance qi; - private IFeatureVector fv; - - public ERiStructure(ERqInstance qi,Boolean nodeValues) { - List feats = new ArrayList(); - this.nodeValues = nodeValues; - // List feats2=new ArrayList(); - //feats.add(tok.entType); - // do something with node names to make features - // if (nodeValues==true) - { - this.qi=qi; - this.fv =this.qi.fv; //only if the lable is one the features are considered otherwise all of them turned to zero - // nodeValues=(true); - } - // else { - // this.fv=SUtils.makeFeatures(feats); - - // nodeValues=(false); - // } - - //this.fv = FeatureVector.plus(this.qi.fv, this.fv); - } - -// @Override -// public IFeatureVector getFeatureVector() { -// List feats = new ArrayList(); -// if (nodeValues==true) -// return this.fv; -// else -// return SUtils.makeFeatures(feats); -// } - - public String toString() { return "" + this.nodeValues; } - - } - - - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERqInstance.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERqInstance.java deleted file mode 100755 index fc04034f..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/ERqInstance.java +++ /dev/null @@ -1,29 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; - -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRawToken; -import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.util.IFeatureVector; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by parisakordjamshidi on 19/09/14. - */ -public class ERqInstance implements IInstance { - ConllRawToken q; - List nodeNames; // order matters! - IFeatureVector fv; - List feats; - public ERqInstance(ConllRawToken tok) { - q=tok; - feats = new ArrayList(); - feats.add("Ph:"+tok.phrase); - feats.add("POS:"+tok.POS); - this.nodeNames = feats; - // do something with node names to make features - this.fv = SUtils.makeFeatures(feats).toFeatureVector(); - - } - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Nodevalues.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Nodevalues.java deleted file mode 100755 index 8fa4fa81..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Nodevalues.java +++ /dev/null @@ -1,8 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; - -/** - * Created by parisakordjamshidi on 21/09/14. - */ -public class Nodevalues { - public Boolean a; -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.java deleted file mode 100755 index 0e1ce7ad..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.java +++ /dev/null @@ -1,179 +0,0 @@ -/* -package ml.wolfe.examples.parisa.iJLIS; - -import edu.illinois.cs.cogcomp.core.io.LineIO; -import edu.illinois.cs.cogcomp.indsup.inference.AbstractLossSensitiveStructureFinder; -import edu.illinois.cs.cogcomp.indsup.inference.IInstance; -import edu.illinois.cs.cogcomp.indsup.inference.IStructure; -import edu.illinois.cs.cogcomp.indsup.learning.*; -import edu.illinois.cs.cogcomp.indsup.learning.L2Loss.L2LossJLISLearner; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; - -public class Runner { - - */ -/* - * Notice that lexm is static. - *//* - - static LexManager lexm = new LexManager(); - - */ -/** - * This modifies the two lists given two it. They are initialized. - * - * @param sclist - * @param outlist - * @param fname - * @throws java.io.FileNotFoundException - *//* - - public static void readData(List sclist, List outlist, String fname) throws FileNotFoundException { - - ArrayList lines = LineIO.read(fname); - - for(String line : lines){ - List s = Arrays.asList(line.split("\\s+")); - - QueryInstance newqi = new QueryInstance(s.subList(0, 3)); - sclist.add(newqi); - GraphStructure cs = new GraphStructure(newqi, SUtils.binaryToNodeLabel(s.get(3))); - outlist.add(cs); - } - } - - public static String trainSSVM(String modelname) throws Exception { - - // First we read the data. - // X instance list - List sclist = new ArrayList(); - // Y instance (structure) - List outlist = new ArrayList(); - - String fname = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-train"; - readData(sclist, outlist, fname); - lexm.setAllowNewFeatures(false); - - // Define the problem, and give it data - StructuredProblem sp = new StructuredProblem(); - sp.input_list = sclist; - sp.output_list = outlist; - - // Create parameters - JLISParameters para = new JLISParameters(); - para.total_number_features = lexm.totalNumofFeature(); - para.c_struct = 1; - para.check_inference_opt = false; - - SimpleInference si = new SimpleInference(); - - // Actually do the learning - L2LossJLISLearner learner = new L2LossJLISLearner(); - WeightVector learned_wv = learner.trainStructuredSVM(si, sp, para); - - // Package all the parameters together - SimpleModel model = new SimpleModel(); - model.wv = learned_wv; - model.s_finder = new SimpleInference(); - model.lm = lexm; - - // This is just a way to serialize the model - JLISModelIOManager iom = new JLISModelIOManager(); - iom.saveModel(model, modelname); - - return modelname; - - } - - public static void testSequenceSSVM(String model_name) throws Exception { - // Load the model - JLISModelIOManager iom = new JLISModelIOManager(); - SimpleModel model = (SimpleModel) iom.loadModel(model_name); - Runner.lexm = model.lm; - WeightVector learned_wv = model.wv; - SimpleInference inference_proc = (SimpleInference) model.s_finder; - - // X instance list - List sclist = new ArrayList(); - // Y instance (structure) - List outlist = new ArrayList(); - - // Load the data - String fname = "/Users/parisakordjamshidi/wolfe-0.1.0/wolfe-examples/src/main/scala/ml/wolfe/examples/parisa/iJLIS/namedata-trainnamedata-test"; - readData(sclist, outlist, fname); - - // Create a problem with testing data - StructuredProblem sp = new StructuredProblem(); - sp.input_list = sclist; - sp.output_list = outlist; - - printTestACC(sp, inference_proc, learned_wv); - } - - private static void printTestACC(StructuredProblem sp, AbstractLossSensitiveStructureFinder s_finder, WeightVector ssvm_wv) throws IOException, - Exception { - - double tp = 0; - double fp = 0; - double tn = 0; - double fn = 0; - double total = 0.0; - - for (int i = 0; i < sp.input_list.size(); i++) { - - GraphStructure gold = (GraphStructure) sp.output_list.get(i); - GraphStructure prediction = (GraphStructure) s_finder.getBestStructure(ssvm_wv, sp.input_list.get(i)); - System.out.println(prediction); - - for (int j = 0; j < gold.nodeValues.size(); j++) { - SUtils.NodeLabel pred = prediction.nodeValues.get(j); - SUtils.NodeLabel goldval = gold.nodeValues.get(j); - - // got it right. - if (goldval == pred) { - if (pred == SUtils.NodeLabel.VALIANT) { - tp += 1.0; - } else { - tn += 1.0; - } - } else { // so I got the answer wrong - if (pred == SUtils.NodeLabel.VALIANT) { - fp += 1.0; - } else { - fn += 1.0; - } - } - - total += 1.0; - } - } - - double precision = tp / (tp + fp); - double recall = tp / (tp + fn); - double F1 = 2 * precision * recall / (precision + recall); - System.out.println("========================="); - System.out.println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")); -// System.out.println(String.format("COWARDLY: %4.3f %4.3f %4.3f", precision, recall, F1)); - System.out.println(String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)); - System.out.println("========================="); - System.out.println("Acc = " + (tp + tn) / total); - } - - public static void main(String[] args) throws Exception { - String modelname = "mytest.ssvm.model"; - trainSSVM(modelname); - - System.out.println("\n=== NOW TESTING ==="); - testSequenceSSVM(modelname); - - } - -} -*/ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.scala deleted file mode 100755 index 15ca80cf..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/Runner.scala +++ /dev/null @@ -1,120 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS - -import java.util -import java.util.{ ArrayList, List } -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.Conll04_Reader -import edu.illinois.cs.cogcomp.sl.core._ -import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory -import edu.illinois.cs.cogcomp.sl.util.{ Lexiconer, WeightVector } - -object Runner { - - var lexm: Lexiconer = new Lexiconer() - - def readXY(cr: Conll04_Reader, outlist: => List[IStructure], sclist: => List[IInstance], l: Int, u: Int) { - var i: Int = l - while (i < u) { //cr.instances.size){ - val newqi: ERqInstance = new ERqInstance(cr.instances.elementAt(i)) - sclist.add(newqi) - val a: Nodevalues = new Nodevalues() - a.a = (cr.instances.elementAt(i).entType.toLowerCase.contains("peop")) - val cs: ERiStructure = new ERiStructure(newqi, a.a) - outlist.add(cs) - i = i + 1 - } - } - - def trainSSVM(modelname: String): Unit = { - var cr = new Conll04_Reader("./data/EntityMentionRelation/conll04.corp", "Pair") - var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) - var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) - readXY(cr, outlist, sclist, 1, 100) - - cr = null - - lexm.setAllowNewFeatures(true) - val sp: SLProblem = new SLProblem - sp.instanceList = sclist - sp.goldStructureList = outlist - val para: SLParameters = new SLParameters - // para.TOTAL_NUMBER_FEATURE = lexm.getNumOfFeature - para.C_FOR_STRUCTURE = 1 - para.CHECK_INFERENCE_OPT = false - val model: SLModel = new SLModel - model.featureGenerator = new ERFeatureGenerator - model.lm = lexm - - model.config = new util.HashMap(); - model.para = para - - model.infSolver = new iERinference; - val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - model.wv = learner.train(sp); - model.saveModel(modelname); - } - - def testSequenceSSVM(model_name: String) { - val model: SLModel = SLModel.loadModel(model_name) - Runner.lexm = model.lm - val learned_wv: WeightVector = model.wv - val inference_proc: iERinference = model.infSolver.asInstanceOf[iERinference] - var cr = new Conll04_Reader("./data/EntityMentionRelation/conll04.corp", "Pair") - var sclist: List[IInstance] = new ArrayList[IInstance] //=readX(cr) - var outlist: List[IStructure] = new ArrayList[IStructure] //readY(cr) - readXY(cr, outlist, sclist, 101, 200) - cr = null - - val sp: SLProblem = new SLProblem - sp.instanceList = sclist - sp.goldStructureList = outlist - printTestACC(sp, inference_proc, learned_wv) - } - private def printTestACC(sp: SLProblem, s_finder: AbstractInferenceSolver, ssvm_wv: WeightVector) { - var tp: Double = 0 - var fp: Double = 0 - var tn: Double = 0 - var fn: Double = 0 - var total: Double = 0.0 - - var i: Int = 0 - while (i < sp.instanceList.size) { - val gold: ERiStructure = sp.goldStructureList.get(i).asInstanceOf[ERiStructure] - val prediction: ERiStructure = s_finder.getBestStructure(ssvm_wv, sp.instanceList.get(i)).asInstanceOf[ERiStructure] - System.out.println(prediction) - val pred: Boolean = prediction.nodeValues - val goldval: Boolean = gold.nodeValues - if (goldval == pred) { - if (pred == true) { - tp += 1.0 - } else { - tn += 1.0 - } - } else { - if (pred == false) { - fp += 1.0 - } else { - fn += 1.0 - } - } - total += 1.0 - i = i + 1 - - } - val precision: Double = tp / (tp + fp) - val recall: Double = tp / (tp + fn) - val F1: Double = 2 * precision * recall / (precision + recall) - println("=========================") - println(" P R F ") - // println(String.format(" %-5s %-5s %-5s", "P", "R", "F1")) - println(precision, recall, F1) //String.format("VALIANT : %4.3f %4.3f %4.3f", precision, recall, F1)) - println("=========================") - println("Acc = " + (tp + tn) / total) - } - - def main(args: Array[String]) { - val modelname: String = "mytest.ssvm.model" - trainSSVM(modelname) - System.out.println("\n=== NOW TESTING ===") - testSequenceSSVM(modelname) - } -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/SUtils.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/SUtils.java deleted file mode 100755 index 4827f386..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/SUtils.java +++ /dev/null @@ -1,49 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS; - -//import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityMentionRelation.SL_SVM.iJLIS2.Runner; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import org.apache.commons.lang3.ArrayUtils; - -import java.util.ArrayList; -import java.util.List; - - -public class SUtils { - /** - * A static method for smartly adding features to the LexManager, and creating a FeatureVector - * at the same time. - * - * @param feats - * @return - */ - public static FeatureVectorBuffer makeFeatures(List feats) { - ArrayList idxList = new ArrayList(); - ArrayList valList = new ArrayList(); - - for (String feat : feats) { - - if (!Runner.lexm().containFeature(feat)) { - System.out.println("Flag of preview: "+ Runner.lexm().getNumOfFeature()); - System.out.println("before Flag of feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); - if(Runner.lexm().isAllowNewFeatures()) - //Todo see the error of the following line - // RunnerPL.lexm().previewFeature(feat); - System.out.println("After preview flag: "+Runner.lexm().getNumOfFeature()); - System.out.println("Flag of after feature set: "+ Runner.lexm().isAllowNewFeatures()+"\n"); - Runner.lexm().addFeature(feat); - } - if (Runner.lexm().containFeature(feat)) { - - int fid = Runner.lexm().getFeatureId(feat); - idxList.add(fid); - valList.add(1.); - } - } - - int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); - double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); - //Todo check waht is going on in the next two lines - return new FeatureVectorBuffer(idx, val); - } - -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERinference.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERinference.scala deleted file mode 100755 index 9a1c3fc7..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERinference.scala +++ /dev/null @@ -1,103 +0,0 @@ - -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS - -import java.util.{ ArrayList, List } - -import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } -import edu.illinois.cs.cogcomp.sl.util.WeightVector - -/** Created by parisakordjamshidi on 20/09/14. - */ - -class iERinference extends AbstractInferenceSolver { - /** This is for training - */ - - override def getLoss(iInstance: IInstance, gold: IStructure, pred: IStructure): Float = { - val igold: ERiStructure = gold.asInstanceOf[ERiStructure]; - val ipred: ERiStructure = pred.asInstanceOf[ERiStructure]; - var loss: Float = 0 - if (ipred.nodeValues == igold.nodeValues) - loss = 0 - else - loss = 1 - - loss - } - - /** This is for prediction. - */ - def getBestStructure(wv: WeightVector, input: IInstance): IStructure = { - val qi: ERqInstance = input.asInstanceOf[ERqInstance] - val options: List[ERiStructure] = getOptions(qi) - var max: Double = Double.NegativeInfinity - var score: Double = .0 - var maxC: ERiStructure = null - import scala.collection.JavaConversions._ - for (c <- options) { - val a = new ERFeatureGenerator(); - val f = a.getFeatureVector(c.qi, c) - score = wv.dotProduct(f) - if (score > max) { - max = score - maxC = c - } - } - return maxC - } - - override def getLossAugmentedBestStructure(wv: WeightVector, input: IInstance, gold: IStructure): IStructure = { - - val goldStruct: ERiStructure = gold.asInstanceOf[ERiStructure] - val qi: ERqInstance = input.asInstanceOf[ERqInstance] - val options: List[ERiStructure] = getOptions(qi) - var max: Double = Double.NegativeInfinity - var score: Double = .0 - var maxC: ERiStructure = null - var loss: Double = .0 - System.out.println - System.out.println(gold) - import scala.collection.JavaConversions._ - for (c <- options) { - val a = new ERFeatureGenerator(); - val f = a.getFeatureVector(c.qi, c) - score = wv.dotProduct(f) - loss = getLoss(null, c, goldStruct) - score += loss - System.out.println(c) - System.out.println(f) - System.out.println(score) - if (score > max) { - max = score - maxC = c - } - } - return maxC - // val a= new edu.illinois.cs.cogcomp.core.datastructures.Pair[IStructure, java.lang.Double](maxC.asInstanceOf[IStructure], new lang.Double(getLoss(maxC, goldStruct))) - - //return a - } - - def getOptions(qi: ERqInstance): List[ERiStructure] = { - val options: List[ERiStructure] = new ArrayList[ERiStructure] - //for (i <- NodeLabel.values) { - // for (j <- NodeLabel.values) { - // for (k <- NodeLabel.values) { - // val labelOptions: List[Nodevalues]= new ArrayList[Nodevalues]() - // val a:Nodevalues=new Nodevalues() - // a.a=true - //labelOptions.add(a) - //a.a=false - //labelOptions.add(a) - //labelOptions.add(k) - options.add(new ERiStructure(qi, true)) - options.add(new ERiStructure(qi, false)) - - return options - } - override def clone(): iERinference = { - return new iERinference(); - } - -} - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERjavaInference.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERjavaInference.java deleted file mode 100755 index 01b63a4c..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/iERjavaInference.java +++ /dev/null @@ -1,223 +0,0 @@ -/* -package ml.wolfe.examples.parisa.iJLIS; - -*/ -/** - * Created by parisakordjamshidi on 22/09/14. - *//* - - -import edu.illinois.cs.cogcomp.core.datastructures.Pair; -import edu.illinois.cs.cogcomp.indsup.inference.AbstractLossSensitiveStructureFinder; -import edu.illinois.cs.cogcomp.indsup.inference.IInstance; -import edu.illinois.cs.cogcomp.indsup.inference.IStructure; -import edu.illinois.cs.cogcomp.indsup.learning.WeightVector; -import gurobi.*; - -import java.util.ArrayList; -import java.util.List; -//import edu.illinois.cs.cogcomp.jlistutorial.SUtils.NodeLabel; - -public class iERjavaInference extends AbstractLossSensitiveStructureFinder { - - private static final long serialVersionUID = 1L; - - */ -/** - * This is for training - *//* - - @Override - - public Pair getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { -//// - ERiStructure goldStruct = (ERiStructure) gold; - ERqInstance qi = (ERqInstance) input; - Integer goldL = (((ERiStructure) gold).nodeValues) ? 1 : 0; - Double coefLos= Double.valueOf((1-2*(goldL))); -// double loss; - ERiStructure maxC = new ERiStructure((ERqInstance)input,true); - Double coef=wv.dotProduct(((ERqInstance) input).fv)+coefLos; - try{ - GRBEnv env = new GRBEnv("mip1.log"); - GRBModel model = new GRBModel(env); - //create variables - GRBVar per=model.addVar(0,1,0.0,GRB.BINARY,"per"); - // integrate the new variables - model.update(); - //Set objective maximize fn(x).per - GRBLinExpr expr= new GRBLinExpr(); - expr.addTerm(coef,per); - model.setObjective(expr,GRB.MAXIMIZE); - //add constraints - model.optimize(); - double x=per.get(GRB.DoubleAttr.X); - maxC.nodeValues=(x>0.5); - model.dispose(); - env.dispose(); - } - catch (GRBException e) - { - System.out.println("Error code: " + e.getErrorCode() + ". " + - e.getMessage()); - } - // Return structure with highest score+loss, and loss of this structure - return new Pair(maxC, getHammingLoss(maxC, goldStruct)); - } - - public Pair getLossSensitiveBestStructureback(WeightVector wv, IInstance input, IStructure gold) throws Exception { - - ERiStructure goldStruct = (ERiStructure) gold; - ERqInstance qi = (ERqInstance) input; - - List options = getOptions(qi); - - double max = Double.NEGATIVE_INFINITY; - double score; - ERiStructure maxC = null; - double loss; - - System.out.println(); - System.out.println(gold); - - // Now get the structure with the max: score+loss - for (ERiStructure c : options) { - score = wv.dotProduct(c.getFeatureVector()); - loss = getHammingLoss(c, goldStruct); - score += loss; - - System.out.println(c); - System.out.println(c.getFeatureVector()); - System.out.println(score); - - if (score > max) { - max = score; - maxC = c; - } - } - - // Return structure with highest score+loss, and loss of this structure - return new Pair(maxC, getHammingLoss(maxC, goldStruct)); - } - - public double getHammingLoss(ERiStructure hyp, ERiStructure gold){ - double loss = 0; - if (hyp.nodeValues==gold.nodeValues) - loss=0; - else - loss=1; - return loss; - } - - */ -/** - * This is for prediction. - *//* - - //@Override - public IStructure getBestStructureback(WeightVector wv, IInstance input) throws Exception { - ERqInstance qi = (ERqInstance) input; - - List options = getOptions(qi); - - double max = Double.NEGATIVE_INFINITY; - double score; - ERiStructure maxC = null; - - // Now get the structure with the max: score+loss - for (ERiStructure c : options) { - score = wv.dotProduct(c.getFeatureVector()); - - if (score > max) { - max = score; - maxC = c; - } - } - - // Return structure with highest score+loss, and loss of this structure - return maxC; - } - - @Override - public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { - - ERqInstance qi = (ERqInstance) input; - List options = getOptions(qi); - - double max = Double.NEGATIVE_INFINITY; - //double score; - ERiStructure maxC = new ERiStructure((ERqInstance)input,true); - - // Now get the structure with the max: score+loss - // for (ERiStructure c : options) { - // score = wv.dotProduct(c.getFeatureVector()); - Double coef=wv.dotProduct(((ERqInstance) input).fv); - // if (score > max) { - // max = score; - // maxC = c; - //} - //} - /*/ -/*//* - // Return structure with highest score+loss, and loss of this structure - // return maxC; - try{ - GRBEnv env = new GRBEnv("mip1.log"); - GRBModel model = new GRBModel(env); - //create variables - GRBVar per=model.addVar(0,1,0.0,GRB.BINARY,"per"); - // integrate the new variables - model.update(); - //Set objective maximize fn(x).per - GRBLinExpr expr= new GRBLinExpr(); - expr.addTerm(coef,per); - model.setObjective(expr,GRB.MAXIMIZE); - - //add constraints - model.optimize(); - double x=per.get(GRB.DoubleAttr.X); - maxC.nodeValues=(x>0.5); - model.dispose(); - env.dispose(); - } - catch (GRBException e) - { - System.out.println("Error code: " + e.getErrorCode() + ". " + - e.getMessage()); - } - return maxC; - } - */ -/** - * Given this QueryInstance, what are the options for responses? - * This simple method just enumerates all possibilities. (in this - * contrived example there are 8 total) - * - * @param qi - * @return - *//* - - public List getOptions(ERqInstance qi) { - - List options = new ArrayList(); - - - // val options: List[ERiStructure] = new ArrayList[ERiStructure] - //for (i <- NodeLabel.values) { - // for (j <- NodeLabel.values) { - // for (k <- NodeLabel.values) { - // val labelOptions: List[Nodevalues]= new ArrayList[Nodevalues]() - // val a:Nodevalues=new Nodevalues() - // a.a=true - //labelOptions.add(a) - //a.a=false - //labelOptions.add(a) - //labelOptions.add(k) - options.add(new ERiStructure(qi, true)); - options.add(new ERiStructure(qi, false)); - - return options; - } - -} -*/ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/mytest.ssvm.model b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS/mytest.ssvm.model deleted file mode 100755 index fe8ba626ea651048a0d86ddd08fe160e9e2f3125..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15524 zcmeHOd3Y36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4%xZ-0@vI$6OwGB$T>h++#10{MDhS_;K#`X03m^%;T9YZip29N$|M*ux;4}KYlBp2iA;E98q{vU* z|Jt`&25s(eb5y$upo^MTy40Gs1uAyl6tb z<$3*^$WN_b79RY+`JsQ{{h;Tz=4XuUvmUI!?7~iC`>_GT-)Y=mU$QDTzGqGyefPO4 zhYtHvj2B8C4&L|o3HqM8xur9{d`5r&(wUcyuZ|h}^?plN?p&rHuTg1vzx*@$;f4q5 zR&Nl~_buO1_T!aIebn9t(cZ&{=!dTKIFf$Zub?%E3F?L*<U6&2|^#`mWilcAadP zG;W5dH~r907vfE0-HmCV1lpc`bdj;F+wk0TwR;+3y)Np+5Oty_sS|xkrxOKF*56>P zi{#a>SG|`m^eFbew{v{QmHH_Cc<;5FUfBJyF8q~px~%g$~y~g(v6lLi)XrzUcpH{xqcL z9iACpINFf3`=@bmev_2FJ)7w}&J15Ss^wX!-;nVT`V3KL?)8$E{cMQ3m)G4tjjb6Y z-+cPyB}2r=ko_(EG(;WiA`gc2Thy~#-*2T2SG?To^?3VVrrlhgZ-_oNME~m2ZqYx6 zoNJ=Lq#k{A<#t^sjTnOTj(O)xCSHAA((a#z*iYZtvd78qu1wKIpStDrEvtQ@edjXt zai_baw68VRkah3gZ~3ULbwg)X8e)!0J^E{74ow-<^q?W;Dqi21eZKI9uTqhg^>DmK z{e{hktvBS{7jxSXb6d*GpN5#1hL}@^m>-7dXG8RhA?nu c; - - - public ERFeatureGenerator(Lexiconer lm) { - this.lm = lm; - } - public Lexiconer getlexicon(){ - return this.lm; - } - public IFeatureVector getFeatureVector (IInstance x, IStructure y){ - - FeatureVectorBuffer fv = new FeatureVectorBuffer(); - ERqInstancePL mx = (ERqInstancePL) x; - ERiStructurePL my = (ERiStructurePL) y; - - // do something with node names to make features - mx.E1fv = makeFeatures(mx.E1feats); - mx.E2fv = makeFeatures(mx.E2feats); - mx.Rfv= makeFeatures(mx.Rfeats); - - if (my.Rlables.E1Label().toLowerCase().contains("peop")) - my.fvPeop=mx.E1fv; - - if (my.Rlables.E2Label().toLowerCase().contains("org")) - my.fvOrg=mx.E2fv; - fv.addFeature(my.fvPeop); - fv.addFeature(my.fvOrg); - - if (my.Rlables.RelLabel().toLowerCase().contains("work")) - my.fvWorkFor=mx.Rfv; - fv.addFeature(my.fvWorkFor); - - //TODO tune fvb indexes - return fv.toFeatureVector(); - } - - public FeatureVectorBuffer makeFeatures(List feats) { - ArrayList idxList = new ArrayList(); - ArrayList valList = new ArrayList(); - FeatureVectorBuffer temp= new FeatureVectorBuffer(); - //c.get(0).featureExtractor(); - for (String feat : feats) { - - if (!this.lm.containFeature(feat)) { - System.out.println("Flag of preview: "+ this.lm.getNumOfFeature()); - System.out.println("before Flag of feature set: "+ this.lm.isAllowNewFeatures()+"\n"); - if(this.lm.isAllowNewFeatures()) - System.out.println("After preview flag: "+this.lm.getNumOfFeature()); - System.out.println("Flag of after feature set: "+ this.lm.isAllowNewFeatures()+"\n"); - this.lm.addFeature(feat); - } - if (this.lm.containFeature(feat)) { - - int fid = this.lm.getFeatureId(feat); - idxList.add(fid); - valList.add(1.); - temp.addFeature(fid,1.); - } - } - - // int[] idx = ArrayUtils.toPrimitive(idxList.toArray(new Integer[0])); - // double[] val = ArrayUtils.toPrimitive(valList.toArray(new Double[0])); - //Todo check waht is going on in the next two lines - // return new FeatureVectorBuffer(idx, val); - return temp; - } - - } - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala deleted file mode 100644 index b06dc707..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERIOManager.scala +++ /dev/null @@ -1,24 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2 - -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{ Conll04_Reader } -import edu.illinois.cs.cogcomp.sl.core.SLProblem - -object ERIOManager { - - def readXY(cr: Conll04_Reader, l: Int, u: Int): SLProblem = { - var sp: SLProblem = new SLProblem() - var i = l - while (i < u) { - val newqi: ERqInstancePL = new ERqInstancePL(cr.relations.elementAt(i)) - var a: Labels = new Labels() - val pair = cr.relations.elementAt(i) - a.E1Label = pair.s.sentTokens.elementAt(pair.wordId1).entType.toLowerCase - a.E2Label = pair.s.sentTokens.elementAt(pair.wordId2).entType.toLowerCase - a.RelLabel = pair.relType.toLowerCase - val cs: ERiStructurePL = new ERiStructurePL(a) - i = i + 1 - sp.addExample(newqi, cs) - } - sp - } -} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERiStructurePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERiStructurePL.java deleted file mode 100755 index 6a6deecb..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERiStructurePL.java +++ /dev/null @@ -1,33 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2; - -/** - * Created by parisakordjamshidi on 19/09/14. - */ - -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; - -public class ERiStructurePL implements IStructure { - - public Labels Rlables; - // public ERqInstancePL qi; - public FeatureVectorBuffer fvPeop =new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvOrg=new FeatureVectorBuffer(new int[0] , new double[0]); -// public FeatureVectorBuffer fvLoc=new FeatureVectorBuffer(new int[0] , new double[0]); -// public FeatureVectorBuffer fvOther=new FeatureVectorBuffer(new int[0] , new double[0]); -// public FeatureVectorBuffer fvO=new FeatureVectorBuffer(new int[0] , new double[0]); - public FeatureVectorBuffer fvWorkFor=new FeatureVectorBuffer(new int[0] , new double[0]); -// public FeatureVectorBuffer fvLivesIn=new FeatureVectorBuffer(new int[0] , new double[0]); -// - public ERiStructurePL(Labels Rlables) { - this.Rlables = Rlables; - // this.Rlables.set(Rlables.E1Label(),Rlables.E2Label(),Rlables.RelLabel()); - //this.qi=qi; - } - @Override - public String toString() { - return "[ERiStructure: " + this.Rlables + "]"; - } -} - - diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERqInstancePL.java b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERqInstancePL.java deleted file mode 100755 index 08f93b0f..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS2/ERqInstancePL.java +++ /dev/null @@ -1,35 +0,0 @@ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS2; -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation; -import edu.illinois.cs.cogcomp.sl.core.IInstance; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by parisakordjamshidi on 19/09/14. - */ -public class ERqInstancePL implements IInstance { - //ConllRawToken q; - ConllRelation pair; - // List nodeNames; // order matters! - - FeatureVectorBuffer E1fv; - FeatureVectorBuffer E2fv; - FeatureVectorBuffer Rfv; - List E1feats; - List E2feats; - List Rfeats; - public ERqInstancePL(ConllRelation pair) { - this.pair=pair; - E1feats = new ArrayList(); - E2feats=new ArrayList(); - Rfeats=new ArrayList(); - E1feats.add("Ph:"+pair.s.sentTokens.elementAt(pair.wordId1).phrase); - E1feats.add("POS:"+pair.s.sentTokens.elementAt(pair.wordId1).POS); - E2feats.add("Ph:"+pair.s.sentTokens.elementAt(pair.wordId2).phrase); - E2feats.add("POS:"+pair.s.sentTokens.elementAt(pair.wordId2).POS); - if (pair.wordId1 getLossSensitiveBestStructure(WeightVector wv, IInstance input, IStructure gold) throws Exception { -// -// int blockSize= RunnerPL.lexm().getNumOfFeature(); -// float[] globalWeight=wv.getWeightArray(); -// float[] WeightPer= Arrays.copyOfRange(globalWeight, 0,blockSize-1); -// float[] WeightOrg=Arrays.copyOfRange(globalWeight,blockSize,2*blockSize-1); -// float[] WeightWF=Arrays.copyOfRange(globalWeight,2*blockSize,3*blockSize-1); -// -// WeightVector wvPer=new WeightVector(new WeightVector(WeightPer),1); -// WeightVector wvOrg=new WeightVector(new WeightVector(WeightOrg),1); -// WeightVector wvWF=new WeightVector(new WeightVector(WeightWF),1); -// ERiStructurePL goldStruct = (ERiStructurePL) gold; -// -// Integer goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("peop")) ? 1 : 0; -// Double coefLosper1= Double.valueOf((1-2*(goldL))); -// goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("peop")) ? 1 : 0; -// Double coefLosper2= Double.valueOf((1-2*(goldL))); -// goldL = (((ERiStructurePL) gold).Rlables.E1Label().toLowerCase().contains("org")) ? 1 : 0; -// Double coefLosorg1= Double.valueOf((1-2*(goldL))); -// goldL = (((ERiStructurePL) gold).Rlables.E2Label().toLowerCase().contains("org")) ? 1 : 0; -// Double coefLosorg2= Double.valueOf((1-2*(goldL))); -// goldL= (((ERiStructurePL) gold).Rlables.RelLabel().toLowerCase().contains("work")) ? 1 : 0; -// Double coefLosWF= Double.valueOf((1-2*(goldL))); -// Labels temp=new Labels(); -// -// ERiStructurePL maxC = new ERiStructurePL(temp); -// Double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosper1; -// Double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosper2; -// Double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv)+coefLosorg1; -// Double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv)+coefLosorg2; -// Double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv)+coefLosWF; -// -// try{ -// GRBEnv env = new GRBEnv("mip1.log"); -// GRBModel model = new GRBModel(env); -// //create variables -// GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); -// GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); -// GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); -// GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); -// GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); -// // integrate the new variables -// model.update(); -// //Set objective maximize fn(x).per -// GRBLinExpr expr= new GRBLinExpr(); -// expr.addTerm(coefper1,per1); -// expr.addTerm(coefper2,per2); -// expr.addTerm(coeforg1,org1); -// expr.addTerm(coeforg2,org2); -// expr.addTerm(coefWF,WF); -// model.setObjective(expr,GRB.MAXIMIZE); -// //add constraints -// expr=new GRBLinExpr(); -// expr.addTerm(1,per1); -// expr.addTerm(1,org1); -// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); -// -// expr=new GRBLinExpr(); -// expr.addTerm(1,per2); -// expr.addTerm(1,org2); -// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); -// -// -// expr=new GRBLinExpr(); -// expr.addTerm(-1,per1); -// expr.addTerm(1,WF); -// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); -// -// expr=new GRBLinExpr(); -// expr.addTerm(-1,org2); -// expr.addTerm(1,WF); -// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); -// -// model.optimize(); -// double x=per1.get(GRB.DoubleAttr.X); -// //addBooleanVariabl(2.0); -// -// java.lang.String x1=(x>0.5)? "peop":"npeop"; -// x=per2.get(GRB.DoubleAttr.X); -// java.lang.String x2=(x>0.5)? "peop":"npeop"; -// -// if (x1.equals("npeop")){ -// x=org1.get(GRB.DoubleAttr.X); -// x1=(x>0.5)? "org":"norg";} -// if (x2.equals("npeop")){ -// x=org2.get(GRB.DoubleAttr.X); -// x2=(x>0.5)? "org":"norg";} -// -// x=WF.get(GRB.DoubleAttr.X); -// java.lang.String x3=(x>0.5)? "work_for":"nwf"; -// -// // x=org2.get(GRB.DoubleAttr.X); -// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; -// model.dispose(); -// env.dispose(); -// -// } -// catch (GRBException e) -// { -// System.out.println("Error code: " + e.getErrorCode() + ". " + -// e.getMessage()); -// } -// // Return structure with highest score+loss, and loss of this structure -// return new Pair(maxC, ((double) getLoss( input, maxC, goldStruct))); -// } -// -// @Override -// public float getLoss(IInstance iInstance, IStructure iStructure, IStructure iStructure1) { -// -// float E1loss = 0; -// float E2loss=0; -// float Rloss=0; -// ERiStructurePL hyp= ((ERiStructurePL) iStructure); -// ERiStructurePL gold=((ERiStructurePL) iStructure1); -// if (hyp.Rlables.E1Label().equals(gold.Rlables.E1Label())) -// E1loss=0; -// else -// E1loss=1; -// -// if (hyp.Rlables.E2Label().equals(gold.Rlables.E2Label())) -// E2loss=0; -// else -// E2loss=1; -// -// -// if (hyp.Rlables.RelLabel().equals(gold.Rlables.RelLabel())) -// Rloss=0; -// else -// Rloss=1; -// return ((E1loss+E2loss+Rloss)/3); -// } -// /** -// * This is for prediction. -// */ -// -// -// @Override -// public IStructure getLossAugmentedBestStructure(WeightVector wv, IInstance input, IStructure iStructure) throws Exception { -// -// int blockSize=RunnerPL.lexm().getNumOfFeature(); -// WeightVector globalWeight=new WeightVector(wv.getWeightArray()); -// WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); -// WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); -// WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); -// WeightVector wvPer=new WeightVector(WeightPer,1); -// WeightVector wvOrg=new WeightVector(WeightOrg,1); -// WeightVector wvWF=new WeightVector(WeightWF,1); -// // ERqInstancePL qi = (ERqInstancePL) input; -// // List options = getOptions(qi); -// -// // double max = Double.NEGATIVE_INFINITY; -// //double score; -// Labels temp=new Labels(); -// ERiStructurePL maxC = new ERiStructurePL(temp); -// -// -// double coefper1=wvPer.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); -// double coefper2=wvPer.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); -// double coeforg1=wvOrg.dotProduct(((ERqInstancePL) input).E1fv.toFeatureVector()); -// double coeforg2=wvOrg.dotProduct(((ERqInstancePL) input).E2fv.toFeatureVector()); -// double coefWF=wvWF.dotProduct(((ERqInstancePL) input).Rfv.toFeatureVector()); -// //try -// { -// GurobiHook myGurobi=new GurobiHook(); -// double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; -// int[] vars=new int[coeff.length]; -// for (int i = 0; i < coeff.length; i++) { -// //System.out.println("adding: i : +" + coeff[i]); -// vars[i]= myGurobi.addBooleanVariable(coeff[i]); -// -// } -// -// -// // GRBEnv env = new GRBEnv("mip1.log"); -// // GRBModel model = new GRBModel(env); model. -// //create variables -// // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); -// // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); -// // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); -// // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); -// // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); -// -// // integrate the new variables -// // model.update(); -// //Set objective maximize fn(x).per -// // GRBLinExpr expr= new GRBLinExpr(); -// -// // expr.addTerm(coefper1,per1); -// // expr.addTerm(coefper2,per2); -// // expr.addTerm(coeforg1,org1); -// //expr.addTerm(coeforg2,org1); -// //expr.addTerm(coefWF,WF); -// // model.setObjective(expr,GRB.MAXIMIZE); -// // per(i)=> ~org(i) -// // work-for(i,j)=>per(i)and org(j) -// -// //add constraints -// double coeffc1[]={1,0,1,0,0}; -// myGurobi.addLessThanConstraint(vars,coeffc1,1); -// double coeffc2[]={0,1,0,1,0}; -// myGurobi.addLessThanConstraint(vars,coeffc2,1); -// double coeffc3[]={-1,0,0,0,1}; -// myGurobi.addLessThanConstraint(vars,coeffc3,0); -// double coeffc4[]={0,0,0,-1,1}; -// myGurobi.addLessThanConstraint(vars,coeffc4,0); -// -// // expr=new GRBLinExpr(); -// // expr.addTerm(1,per1); -// // expr.addTerm(1,org1); -// // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); -// -// //expr=new GRBLinExpr(); -// //expr.addTerm(1,per2); -// //expr.addTerm(1,org2); -// //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); -// -// // expr=new GRBLinExpr(); -// // expr.addTerm(-1,per1); -// // expr.addTerm(1,WF); -// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); -// -// // expr=new GRBLinExpr(); -// // expr.addTerm(-1,org2); -// // expr.addTerm(1,WF); -// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); -// -// -// // model.optimize(); -// -// myGurobi.setMaximize(true); -// boolean solved = false; -// try { -// solved = myGurobi.solve(); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// if (!solved) { -// System.out.println("ILP solver failed"); -// // System.exit(0); -// } -// -// // read the solution -// -// // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); -// java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; -// // x=per2.get(GRB.DoubleAttr.X); -// java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; -// -// if (x1.equals("npeop")){ -// // x=org1.get(GRB.DoubleAttr.X); -// x1=myGurobi.getBooleanValue(2)? "org":"norg";} -// if (x2.equals("npeop")){ -// // x=org2.get(GRB.DoubleAttr.X); -// x2=myGurobi.getBooleanValue(3)? "org":"norg";} -// // x=WF.get(GRB.DoubleAttr.X); -// java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; -// -// // x=org2.get(GRB.DoubleAttr.X); -// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; -// // model.dispose(); -// // env.dispose(); -// } -// // catch (GRBException e) -// // { -// // System.out.println("Error code: " + e.getErrorCode() + ". " + -// // e.getMessage()); -// // } -// return maxC; -// } -// -// -// -// -// -// -// public IStructure getBestStructureDirectGurobi(WeightVector wv, IInstance input) throws Exception { -// int blockSize=RunnerPL.lexm().getNumOfFeature(); -// WeightVector globalWeight=new WeightVector(wv.getWeightArray()); -// WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); -// WeightVector WeightOrg=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); -// WeightVector WeightWF=new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 2 * blockSize, 3 * blockSize - 1)); -// WeightVector wvPer=new WeightVector(WeightPer,1); -// WeightVector wvOrg=new WeightVector(WeightOrg,1); -// WeightVector wvWF=new WeightVector(WeightWF,1); -// // ERqInstancePL qi = (ERqInstancePL) input; -// // List options = getOptions(qi); -// -// // double max = Double.NEGATIVE_INFINITY; -// //double score; -// Labels temp=new Labels(); -// ERiStructurePL maxC = new ERiStructurePL(temp); -// -// -// float coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); -// float coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); -// float coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); -// float coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); -// float coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); -// try{ -// GRBEnv env = new GRBEnv("mip1.log"); -// GRBModel model = new GRBModel(env); -// //create variables -// GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); -// GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); -// GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); -// GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); -// GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); -// -// // integrate the new variables -// model.update(); -// //Set objective maximize fn(x).per -// GRBLinExpr expr= new GRBLinExpr(); -// expr.addTerm(coefper1,per1); -// expr.addTerm(coefper2,per2); -// expr.addTerm(coeforg1,org1); -// expr.addTerm(coeforg2,org1); -// expr.addTerm(coefWF,WF); -// model.setObjective(expr,GRB.MAXIMIZE); -// // per(i)=> ~org(i) -// // work-for(i,j)=>per(i)and org(j) -// //add constraints -// expr=new GRBLinExpr(); -// expr.addTerm(1,per1); -// expr.addTerm(1,org1); -// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); -// -// expr=new GRBLinExpr(); -// expr.addTerm(1,per2); -// expr.addTerm(1,org2); -// model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); -// -// expr=new GRBLinExpr(); -// expr.addTerm(-1,per1); -// expr.addTerm(1,WF); -// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); -// -// expr=new GRBLinExpr(); -// expr.addTerm(-1,org2); -// expr.addTerm(1,WF); -// model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); -// -// -// model.optimize(); -// // read the solution -// double x=per1.get(GRB.DoubleAttr.X); -// java.lang.String x1=(x>0.5)? "peop":"npeop"; -// x=per2.get(GRB.DoubleAttr.X); -// java.lang.String x2=(x>0.5)? "peop":"npeop"; -// -// if (x1.equals("npeop")){ -// x=org1.get(GRB.DoubleAttr.X); -// x1=(x>0.5)? "org":"norg";} -// if (x2.equals("npeop")){ -// x=org2.get(GRB.DoubleAttr.X); -// x2=(x>0.5)? "org":"norg";} -// x=WF.get(GRB.DoubleAttr.X); -// java.lang.String x3=(x>0.5)? "work_for":"nwf"; -// -// // x=org2.get(GRB.DoubleAttr.X); -// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; -// model.dispose(); -// env.dispose(); -// } -// catch (GRBException e) -// { -// System.out.println("Error code: " + e.getErrorCode() + ". " + -// e.getMessage()); -// } -// return maxC; -// } -// @Override -// public IStructure getBestStructure(WeightVector wv, IInstance input) throws Exception { //using GurobiHook -// int blockSize=RunnerPL.lexm().getNumOfFeature(); -// WeightVector globalWeight= new WeightVector(wv.getWeightArray()); -// WeightVector WeightPer= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(), 0,blockSize-1)); -// WeightVector WeightOrg= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),blockSize,2*blockSize-1)); -// WeightVector WeightWF= new WeightVector(Arrays.copyOfRange(globalWeight.getWeightArray(),2*blockSize,3*blockSize-1)); -// WeightVector wvPer= new WeightVector(WeightPer,1); -// WeightVector wvOrg= new WeightVector(WeightOrg,1); -// WeightVector wvWF= new WeightVector(WeightWF,1); -// JointER JE= new JointER(((ERqInstancePL) input).pair); -// ConllRelation head = JointER.findHead((ConllRelation) ((ERqInstancePL) input).pair); -// JointER inference = (JointER) InferenceManager.get("ml.wolfe.examples.parisa.iJLIS2.JointER", head); -// -// if (inference == null) -// { -// inference = new JointER(head); -// InferenceManager.put(inference); -// } -// -//// String result = null; -//// work_forClassifier __work_forClassifier = new work_forClassifier(); -//// try { -//// result = inference.valueOf((__work_forClassifier), ((ERqInstancePL) input).pair); -//// } -//// catch (Exception e) -//// { -//// System.err.println("LBJ ERROR: Fatal error while evaluating classifier RelArgsClassifier: " + e); -//// e.printStackTrace(); -//// System.exit(1); -//// } -// -// //return result; -// //JointER$subjectto JEc=new JointER$subjectto(); -// //JEc.makeConstraint(((ERqInstancePL) input).pair); -// //((ERqInstancePL) input).pair -// // ERqInstancePL qi = (ERqInstancePL) input; -// // List options = getOptions(qi); -// -// // double max = Double.NEGATIVE_INFINITY; -// //double score; -// Labels temp=new Labels(); -// ERiStructurePL maxC = new ERiStructurePL(temp); -///////// -// -// -// double coefper1=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); -// double coefper2=wvPer.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); -// double coeforg1=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E1fv); -// double coeforg2=wvOrg.dotProduct((IFeatureVector) ((ERqInstancePL) input).E2fv); -// double coefWF=wvWF.dotProduct((IFeatureVector) ((ERqInstancePL) input).Rfv); -// //try -// { -// GurobiHook myGurobi=new GurobiHook(); -// double coeff[]={coefper1,coefper2,coeforg1,coeforg2,coefWF}; -// int[] vars=new int[coeff.length]; -// for (int i = 0; i < coeff.length; i++) { -// //System.out.println("adding: i : +" + coeff[i]); -// vars[i]= myGurobi.addBooleanVariable(coeff[i]); -// -// } -// -// -// // GRBEnv env = new GRBEnv("mip1.log"); -// // GRBModel model = new GRBModel(env); model. -// //create variables -// // GRBVar per1=model.addVar(0,1,0.0,GRB.BINARY,"per1"); -// // GRBVar per2=model.addVar(0,1,0.0,GRB.BINARY,"per2"); -// // GRBVar org1=model.addVar(0,1,0.0,GRB.BINARY,"org1"); -// // GRBVar org2=model.addVar(0,1,0.0,GRB.BINARY,"org2"); -// // GRBVar WF=model.addVar(0,1,0.0,GRB.BINARY,"WF"); -// -// // integrate the new variables -// // model.update(); -// //Set objective maximize fn(x).per -// // GRBLinExpr expr= new GRBLinExpr(); -// -// // expr.addTerm(coefper1,per1); -// // expr.addTerm(coefper2,per2); -// // expr.addTerm(coeforg1,org1); -// //expr.addTerm(coeforg2,org1); -// //expr.addTerm(coefWF,WF); -// // model.setObjective(expr,GRB.MAXIMIZE); -// // per(i)=> ~org(i) -// // work-for(i,j)=>per(i)and org(j) -// -// //add constraints -// double coeffc1[]={1,0,1,0,0}; -// myGurobi.addLessThanConstraint(vars,coeffc1,1); -// double coeffc2[]={0,1,0,1,0}; -// myGurobi.addLessThanConstraint(vars,coeffc2,1); -// double coeffc3[]={-1,0,0,0,1}; -// myGurobi.addLessThanConstraint(vars,coeffc3,0); -// double coeffc4[]={0,0,0,-1,1}; -// myGurobi.addLessThanConstraint(vars,coeffc4,0); -// -// // expr=new GRBLinExpr(); -// // expr.addTerm(1,per1); -// // expr.addTerm(1,org1); -// // model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c1"); -// -// //expr=new GRBLinExpr(); -// //expr.addTerm(1,per2); -// //expr.addTerm(1,org2); -// //model.addConstr(expr,GRB.LESS_EQUAL,1.0,"c2"); -// -// // expr=new GRBLinExpr(); -// // expr.addTerm(-1,per1); -// // expr.addTerm(1,WF); -// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c3"); -// -// // expr=new GRBLinExpr(); -// // expr.addTerm(-1,org2); -// // expr.addTerm(1,WF); -// // model.addConstr(expr,GRB.LESS_EQUAL,0.0,"c4"); -// -// -// // model.optimize(); -// -// myGurobi.setMaximize(true); -// boolean solved = false; -// try { -// solved = myGurobi.solve(); -// } catch (Exception e) { -// e.printStackTrace(); -// } -// if (!solved) { -// System.out.println("ILP solver failed"); -// // System.exit(0); -// } -// -// // read the solution -// -// // x=myGurobi.getBooleanValue(0)per1.get(GRB.DoubleAttr.X); -// java.lang.String x1=myGurobi.getBooleanValue(0)? "peop":"npeop"; -// // x=per2.get(GRB.DoubleAttr.X); -// java.lang.String x2=myGurobi.getBooleanValue(1)? "peop":"npeop"; -// -// if (x1.equals("npeop")){ -// // x=org1.get(GRB.DoubleAttr.X); -// x1=myGurobi.getBooleanValue(2)? "org":"norg";} -// if (x2.equals("npeop")){ -// // x=org2.get(GRB.DoubleAttr.X); -// x2=myGurobi.getBooleanValue(3)? "org":"norg";} -// // x=WF.get(GRB.DoubleAttr.X); -// java.lang.String x3=myGurobi.getBooleanValue(4)? "work_for":"nwf"; -// -// // x=org2.get(GRB.DoubleAttr.X); -// maxC.Rlables.set(x1,x2,x3);//.E1Label=(x>0.5)? "peop":"npeop"; -// // model.dispose(); -// // env.dispose(); -// } -// // catch (GRBException e) -// // { -// // System.out.println("Error code: " + e.getErrorCode() + ". " + -// // e.getMessage()); -// // } -// return maxC; -// } -// -// -// -// /*public FirstOrderConstraint makeConstraint(Object __example) -// { -// if (!(__example instanceof ConllRelation)) -// { -// String type = __example == null ? "null" : __example.getClass().getName(); -// System.err.println("Constraint 'PersonWorkFor(ConllRelation)' defined on line 113 of LALModel.lbj received '" + type + "' as input."); -// new Exception().printStackTrace(); -// System.exit(1); -// } -// -// ConllRelation t = (ConllRelation) __example; -// infer.FirstOrderConstraint __result = new infer.FirstOrderConstant(true); -// -// { -// FirstOrderConstraint LBJ2$constraint$result$0 = null; -// { -// FirstOrderConstraint LBJ2$constraint$result$1 = null; -// LBJ2$constraint$result$1 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(__work_forClassifier, t), "" + (true)); -// FirstOrderConstraint LBJ2$constraint$result$2 = null; -// LBJ2$constraint$result$2 = new FirstOrderEqualityWithValue(true, new FirstOrderVariable(PersonClassifier, t.e1), "" + (true)); -// LBJ2$constraint$result$0 = new FirstOrderImplication(LBJ2$constraint$result$1, LBJ2$constraint$result$2); -// } -// __result = new FirstOrderConjunction(__result, LBJ2$constraint$result$0); -// } -// -// return __result; -// } -//*/ -// public iERjavaInferencePL clone() { -// return new iERjavaInferencePL(); -// } -//} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala deleted file mode 100644 index 3968ff22..00000000 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SL_SVM/iJLIS3/test.scala +++ /dev/null @@ -1,41 +0,0 @@ -//package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.SL_SVM.iJLIS3 -// -//import scala.reflect.ClassTag -// -//object Main { -// case class typeHolder [HEAD](a: List[TwoTypeClass[_,HEAD]], x: HEAD){ -// val head: HEAD = x -// } -// -//abstract class TwoTypeClass[T , HEAD ](val value: String)(implicit val xTag: ClassTag[T], -// implicit val yTag: ClassTag[HEAD]) { -// type L = T -// type R = HEAD -// -// def gen(head: HEAD): Seq[T]={ -// val s:Seq[T] = null -// s -// } -// } -// -// -// def creator[HEAD](a : TwoTypeClass[_,HEAD ])( x: typeHolder) : Unit = { -// -// def subCreator(x:typeHolder)={ -// x.head -// } -// } -// def main(args: Array[String]){ -// val x: String= null -// def funtionOfType[HEAD](a : List[TwoTypeClass[_,HEAD]])(x:typeHolder) : Unit = { -// a.foreach({ -// cf => -// val t=cf.gen(x.head.asInstanceOf[HEAD]) -// t.foreach { -// x=> creator(cf)_ -// -// } -// }) -// } -// } -//} From 0885b247870625bcc1b73e4b69d548a97c8cfb55 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 9 Jun 2016 15:45:30 -0500 Subject: [PATCH 062/118] -updated node based SLModel rather than DM based -removed redundant java files -updated the edge sensors for bugs cross training and test -starting test units for SL-Saul --- .../classifier/ConstrainedClassifier.scala | 4 +- .../classifier/SL_model/JoinSLtrain.scala | 27 +++++-------- .../SL_model/SL_FeatureGenerator.scala | 4 +- .../classifier/SL_model/SL_IOManager.scala | 8 ++-- .../classifier/SL_model/SaulSLModel.scala | 2 +- .../saul/classifier/SL_model/SaulSLTest.scala | 6 +-- .../SL_model/Saul_SL_Inference.scala | 6 +-- .../Saul_SL_Label_java_Structure.java | 23 ----------- .../SL_model/Saul_SL_java_Instance.java | 40 ------------------- .../classifier/infer/InferenceCondition.scala | 4 +- .../saul/constraint/LfsConstraint.scala | 2 +- .../EntityRelationDataModel.scala | 2 +- .../EntityRelationSensors.scala | 4 +- .../EntityRelation/EntityRelationTests.scala | 31 ++++++++++++-- 14 files changed, 60 insertions(+), 103 deletions(-) delete mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java delete mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 1546be0f..9ab0b586 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier -import edu.illinois.cs.cogcomp.lbjava.classify.{Classifier, FeatureVector, TestDiscrete} +import edu.illinois.cs.cogcomp.lbjava.classify.{ Classifier, FeatureVector, TestDiscrete } import edu.illinois.cs.cogcomp.lbjava.infer._ import edu.illinois.cs.cogcomp.lbjava.learn.Learner import edu.illinois.cs.cogcomp.saul.TestWithStorage @@ -8,7 +8,7 @@ import edu.illinois.cs.cogcomp.saul.classifier.SL_model.LossAugmentedNormalizer import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import edu.illinois.cs.cogcomp.saul.datamodel.edge.Edge -import edu.illinois.cs.cogcomp.saul.lbjrelated.{LBJClassifierEquivalent, LBJLearnerEquivalent} +import edu.illinois.cs.cogcomp.saul.lbjrelated.{ LBJClassifierEquivalent, LBJLearnerEquivalent } import edu.illinois.cs.cogcomp.saul.parser.LBJIteratorParserScala import scala.collection.mutable.ListBuffer diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala index 0b18df86..0ee3b40b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner._ @@ -10,21 +10,15 @@ import scala.reflect._ /** Created by Parisa on 12/3/15. */ object JoinSLtrain { - def apply[HEAD <: AnyRef]( - dm: DataModel, - cls: List[ConstrainedClassifier[_, HEAD]] - )( - implicit - headTag: ClassTag[HEAD] - ) = { + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]])(implicit headTag: ClassTag[HEAD]) = + { + trainSSVM[HEAD](node, cls) + } - trainSSVM[HEAD](dm, cls) - } - - def trainSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): Unit = { - val sp = SL_IOManager.makeSLProblem(dm, cls) + def trainSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): SaulSLModel[HEAD] = { + val sp = SL_IOManager.makeSLProblem(node, cls) val model = Initialize(sp, new SaulSLModel(cls)) - model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LtuTemplates, dm) + model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LTUWeightTemplates, node) val para = new SLParameters // para.STOP_CONDITION = 0.0001f // para.INNER_STOP_CONDITION= 0.0001f @@ -36,10 +30,11 @@ object JoinSLtrain { val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") + return model } - def TestSSVM[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { + def TestSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] - val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](dm, cls, testing = true) + val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](node, cls, testing = true) // val sp.instanceList.toList.map(x=> myModel.infSolver.getBestStructure(myModel.wv,x.asInstanceOf[Saul_SL_Instance].head.asInstanceOf[Saul_SL_Instance])) // def apply { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 9eaafdd2..8a3b522a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -18,7 +18,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst case (cf, indF) => val candis: Seq[_] = cf.getCandidates(myX.head) - val sparseNet = cf.onClassifier.asInstanceOf[SparseNetworkLBP] + val sparseNet = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] val fvLocal = new FeatureVectorBuffer() var localOffset = 0 candis.zipWithIndex.foreach { @@ -30,7 +30,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst val lab = myY.labels(indC) for (netI <- 0 until sparseNet.net.size()) { if (netI != 0) - localOffset = localOffset + model.LtuTemplates(ltuNum + netI - 1).length + localOffset = localOffset + model.LTUWeightTemplates(ltuNum + netI - 1).length else localOffset = 0 if (!sparseNet.getLabelLexicon.lookupKey(netI).valueEquals(lab)) { a1 = Array() diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala index 60affcb1..7212c571 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_IOManager.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core.SLProblem import edu.illinois.cs.cogcomp.sl.util.Lexiconer @@ -11,13 +11,13 @@ import scala.reflect.ClassTag */ object SL_IOManager { val lexm: Lexiconer = new Lexiconer() - def makeSLProblem[HEAD <: AnyRef](dm: DataModel, list: List[ConstrainedClassifier[_, HEAD]], testing: Boolean = false)(implicit t: ClassTag[HEAD]): SLProblem = { + def makeSLProblem[HEAD <: AnyRef](node: Node[HEAD], list: List[ConstrainedClassifier[_, HEAD]], testing: Boolean = false)(implicit t: ClassTag[HEAD]): SLProblem = { var sp: SLProblem = new SLProblem() var allHeads: Iterable[HEAD] = Iterable[HEAD]() if (testing) { - allHeads = dm.getNodeWithType[HEAD].getTestingInstances + allHeads = node.getTestingInstances } else { - allHeads = dm.getNodeWithType[HEAD].getTrainingInstances + allHeads = node.getTrainingInstances } allHeads.foreach(x => diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala index acb1295b..8637c4f3 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala @@ -10,7 +10,7 @@ import scala.collection.mutable.ListBuffer /** Created by Parisa on 4/1/16. */ class SaulSLModel[HEAD <: AnyRef](cls: List[ConstrainedClassifier[_, HEAD]], listBuffer: ListBuffer[Array[Float]] = ListBuffer()) extends SLModel with Serializable { - var LtuTemplates: ListBuffer[Array[Float]] = listBuffer + var LTUWeightTemplates: ListBuffer[Array[Float]] = listBuffer var Factors: ListBuffer[ConstrainedClassifier[_, HEAD]] = ListBuffer() cls.foreach { (c: ConstrainedClassifier[_, HEAD]) => diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala index 7f8a30e4..159fcdac 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLTest.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core.IStructure import scala.collection.JavaConversions._ @@ -19,8 +19,8 @@ object SaulSLTest { } } } - def apply[HEAD <: AnyRef](dm: DataModel, cls: List[ConstrainedClassifier[_, HEAD]], model: SaulSLModel[HEAD], inference: Saul_SL_Inference[HEAD])(implicit t: ClassTag[HEAD]): Unit = { - val sp = SL_IOManager.makeSLProblem(dm, cls, true) + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], model: SaulSLModel[HEAD], inference: Saul_SL_Inference[HEAD])(implicit t: ClassTag[HEAD]): Unit = { + val sp = SL_IOManager.makeSLProblem(node, cls, true) var a: List[IStructure] = List[IStructure]() sp.instanceList.toList.foreach { ins => diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index df92817a..da823f25 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -2,7 +2,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, SparseNetworkLBP } -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } import edu.illinois.cs.cogcomp.sl.util.WeightVector @@ -12,9 +12,9 @@ import scala.reflect.ClassTag /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, HEAD]], ltuTemplates: ListBuffer[Array[Float]], dm: DataModel)(implicit t: ClassTag[HEAD]) extends AbstractInferenceSolver { +class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, HEAD]], ltuTemplates: ListBuffer[Array[Float]], node: Node[HEAD])(implicit t: ClassTag[HEAD]) extends AbstractInferenceSolver { val a = factors - val dataM = dm + val dataM = node override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java deleted file mode 100644 index 6246e543..00000000 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_java_Structure.java +++ /dev/null @@ -1,23 +0,0 @@ -package edu.illinois.cs.cogcomp.saul.classifier.SL_model; - -import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier; -import edu.illinois.cs.cogcomp.sl.core.IStructure; -import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Parisa on 12/8/15. - */ -public class Saul_SL_Label_java_Structure<_,HEAD> implements IStructure { - - ArrayList labels; - - public Saul_SL_Label_java_Structure(ArrayList> l, HEAD x){ - - for (ConstrainedClassifier c : l){ - labels.add(c.onClassifier().classifier().discreteValue(x)); - } - } -} diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java deleted file mode 100644 index f7ced091..00000000 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_java_Instance.java +++ /dev/null @@ -1,40 +0,0 @@ -package edu.illinois.cs.cogcomp.saul.classifier.SL_model; - -import edu.illinois.cs.cogcomp.lbjava.classify.Classifier; -import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier; -import edu.illinois.cs.cogcomp.sl.core.IInstance; - -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Parisa on 12/4/15. - */ -public class Saul_SL_java_Instance<_, HEAD> implements IInstance { - - List inputFeatures; - List factorClassifiers; - - public Saul_SL_java_Instance(List> l, HEAD x){ - { - for (ConstrainedClassifier c : l) - { - Classifier oracle = c.onClassifier().getLabeler(); - List<_> cands= (List<_>) c.getCandidates(x); - for (_ ci: cands){ - c.classifier().discreteValue(ci) ; //prediction result - oracle.discreteValue(ci) ; // true lable - ; // return a Feature values and indexs - inputFeatures.add(c.onClassifier().getExampleArray(ci)); - factorClassifiers.add(c); - } - ; - -// val a0 = a(0).asInstanceOf[Array[Int]] -// val a1 = a(1).asInstanceOf[Array[Double]] - } - } - - } - } - diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 6f9bca15..3d499f1d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer -import edu.illinois.cs.cogcomp.lbjava.infer.{ILPSolver, ParameterizedConstraint} -import edu.illinois.cs.cogcomp.lbjava.learn.{IdentityNormalizer, Learner, Normalizer} +import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint } +import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Learner, Normalizer } import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import scala.reflect.ClassTag diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala index 1bfb6d68..63e7c7a2 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala @@ -35,7 +35,7 @@ abstract class LfsConstraint[T <: AnyRef](implicit val tag: ClassTag[T]) { val lc = this def createInferenceCondition[C <: AnyRef](solver: ILPSolver, normalizer: Normalizer = new IdentityNormalizer)(implicit cTag: ClassTag[C]): InferenceCondition[C, T] = { - new InferenceCondition[C, T](solver,normalizer) { + new InferenceCondition[C, T](solver, normalizer) { override def subjectTo: LfsConstraint[T] = lc } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala index 325de2d1..ad844e1a 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala @@ -116,6 +116,6 @@ object EntityRelationDataModel extends DataModel { def populateWithConllSmallSet() = { sentences.populate(EntityRelationSensors.sentencesSmallSet) - //sentences.populate(EntityRelationSensors.sentencesSmallSet2, train = false) + sentences.populate(EntityRelationSensors.sentencesSmallSet2, train = false) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index f4182206..59e09f25 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -40,10 +40,10 @@ object EntityRelationSensors { } def relationToFirstArg_MatchingSensor(r: ConllRelation, t: ConllRawToken): Boolean = { - r.sentId.equals(t.sentId) && r.e1.wordId == t.wordId + r.sentId.equals(t.sentId) && r.e1.wordId == t.wordId && r.e1.hashCode() == t.hashCode() } def relationToSecondArg_MatchingSensor(r: ConllRelation, t: ConllRawToken): Boolean = { - r.sentId.equals(t.sentId) && r.e2.wordId == t.wordId + r.sentId.equals(t.sentId) && r.e2.wordId == t.wordId && r.e2.hashCode() == t.hashCode() } } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala index 98865367..eab9e73d 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala @@ -1,13 +1,16 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils +import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers.{ WorksFor_PerOrg_ConstrainedClassifier, OrgConstrainedClassifier, PerConstrainedClassifier } +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ import org.scalatest._ class EntityRelationTests extends FlatSpec with Matchers { val minScore = 0.3 - EntityRelationDataModel.populateWithConllSmallSet() + populateWithConllSmallSet() + val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) "entity classifier " should " should work. " in { ClassifierUtils.LoadClassifier( @@ -38,7 +41,7 @@ class EntityRelationTests extends FlatSpec with Matchers { scores.foreach { case (label, score) => (score._1 > minScore) should be(true) } } - "L+I entity-relation classifiers " should " should work. " in { + "L+I entity-relation classifiers " should " work. " in { ClassifierUtils.LoadClassifier( EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, @@ -47,4 +50,26 @@ class EntityRelationTests extends FlatSpec with Matchers { val scores = PerConstrainedClassifier.test() ++ WorksFor_PerOrg_ConstrainedClassifier.test() scores.foreach { case (label, score) => (score._1 > minScore) should be(true) } } + val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) + "Structured output learning (SL)" should "get correct number of instances." in { + SLProblem.goldStructureList should be(24) + SLProblem.instanceList should be(24) + } + + val model = Initialize(SLProblem, new SaulSLModel(cls)) + "Structured output learning (SL)" should "initialize correctly." in { + model.Factors.size should be(5) + model.LTUWeightTemplates should be(10) + model.wv.getLength should be(1144) + } + + model.featureGenerator = new SL_FeatureGenerator(model) + "Structured output learning (SL)" should "do feature extraction correctly." in { + model.featureGenerator.getFeatureVector(SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0)).getValues.sum should be(96.0) + } + + "Structured output learning (SL)" should "really work in Saul." in { + val M = JoinSLtrain(pairs, cls) + M.featureGenerator.getFeatureVector(SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0)) + } } \ No newline at end of file From 66f76e1c8d09107b876e65dd03834827078bdef1 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 9 Jun 2016 15:52:33 -0500 Subject: [PATCH 063/118] -minor edits --- .../EntityRelation/EntityRelationApp_SL.scala | 51 +++++++++++++------ 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index e8b1fff2..6de07968 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -1,25 +1,46 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils -import edu.illinois.cs.cogcomp.saul.classifier.SL_model.JoinSLtrain -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ +import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ - +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ +import org.slf4j.helpers.NOPLogger +import org.slf4j.{ Logger, LoggerFactory } /** Created by Parisa on 12/8/15. */ object EntityRelationApp_SL extends App { + val logging = true + val logger: Logger = if (logging) LoggerFactory.getLogger(this.getClass) else NOPLogger.NOP_LOGGER; EntityRelationDataModel.populateWithConllSmallSet() - JoinSLtrain(EntityRelationDataModel, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) - - /* Test SL_ER */ - println("Independent Classifiers:") - ClassifierUtils.TrainClassifiers(10, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) - ClassifierUtils.TestClassifiers(PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) - println("SL Classifiers:") - PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) - OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) - LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) - LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) - WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) + val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) + + val testRels = pairs.getTestingInstances.toSet.toList + val testTokens = tokens.getTestingInstances.toSet.toList + +// val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) +// val model = Initialize(SLProblem, new SaulSLModel(cls)) +// model.featureGenerator = new SL_FeatureGenerator(model) + + val m = JoinSLtrain(pairs, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) + + // /* Test SL_ER */ + // println("Independent Classifiers:") + // ClassifierUtils.TrainClassifiers(10, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + // ClassifierUtils.TestClassifiers(PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + // println("SL Classifiers:") + // PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) + // OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) + // LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) + // LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) + // WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) + // + ClassifierUtils.TestClassifiers((testTokens, PerConstrainedClassifier), (testTokens, OrgConstrainedClassifier), + (testTokens, LocConstrainedClassifier)) + + ClassifierUtils.TestClassifiers( + (testRels, WorksFor_PerOrg_ConstrainedClassifier), + (testRels, LivesIn_PerOrg_relationConstrainedClassifier) + ) + } From 621a8e912ec8746df57d278c8539b6ae58bef2a9 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 10 Jun 2016 17:05:47 -0500 Subject: [PATCH 064/118] -made SL inference more modular - added equality for Saul IStructure -added a separate test based on ER task for SL --- .../SL_model/Saul_SL_Inference.scala | 89 ++++++++++++------- .../SL_model/Saul_SL_Label_Structure.scala | 5 +- .../EntityRelationSLTests.scala | 71 +++++++++++++++ .../EntityRelation/EntityRelationTests.scala | 23 ----- 4 files changed, 130 insertions(+), 58 deletions(-) create mode 100644 saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index da823f25..1ef03497 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -17,18 +17,15 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H val dataM = node override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { - val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - var myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) - for (i <- 0 until factors.size) { - val c = factors(i) - val candis: Seq[_] = c.getCandidates(myIns.head) - candis.foreach(x => - myStruct.labels += factors(i).classifier.discreteValue(x)) - } + //updates the weights of all factors in a + updateWeights(weight) + + // Now make the predictions using the updated constrained classifiers + val myStruct = makePredictions(ins) myStruct } - override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { //TODO check + override def getLoss(ins: IInstance, gold: IStructure, pred: IStructure): Float = { var TotalLoss: Float = 0 val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[HEAD]] @@ -54,48 +51,72 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H } override def getLossAugmentedBestStructure(weight: WeightVector, ins: IInstance, goldStructure: IStructure): IStructure = { + val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] - val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) val FactorsNum = a.size - var ltu_count = 0 - var offset = 0 - a.foreach { - cf => - for (i <- 0 until cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.size()) { - val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector - print("w", ltu_count, " size:\t", w1.size) - val myFactorJoinlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) - - val exampleFeatureIndexes = ofDim[Int](myFactorJoinlyTrainedWeight.length) - for (featureIndex <- 0 until myFactorJoinlyTrainedWeight.length) { - exampleFeatureIndexes(featureIndex) = featureIndex; - } - val p = cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] - p.weightVector.clear() - p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJoinlyTrainedWeight), 0.0) - cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) + //set the weights of the classifiers with the trained weight so far + updateWeights(weight) - offset = offset + ltuTemplates(ltu_count).length - ltu_count = ltu_count + 1 - } + // augment all factors with loss for finding mvc + a.foreach { + cf => cf.onClassifier.classifier.setLossFlag() cf.onClassifier.classifier.setCandidates(cf.getCandidates(myIns.head).size * FactorsNum) } + // Now make the predictions using the loss augmented inference + val myStruct = makePredictions(ins) + //take the classifier to use its normal inference without considering loss in the future calls + a.map(x => x.onClassifier.classifier.unsetLossFlag()) + myStruct + } + + //This module receives a global weight vector and distribute it among factors (i.e. classifiers) + + def updateWeights(weight: WeightVector): Unit = + { + var ltu_count = 0 + var offset = 0 + a.foreach { + cf => + for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].net.size()) { + val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector + print("w", ltu_count, " size:\t", w1.size) + val myFactorJoinlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) + + val exampleFeatureIndexes = ofDim[Int](myFactorJoinlyTrainedWeight.length) + for (featureIndex <- 0 until myFactorJoinlyTrainedWeight.length) { + exampleFeatureIndexes(featureIndex) = featureIndex; + } + + val p = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] + p.weightVector.clear() + p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJoinlyTrainedWeight), 0.0) + cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) + + offset = offset + ltuTemplates(ltu_count).length + ltu_count = ltu_count + 1 + } + } + } + + // Uses the current statu of the factors and makes the necessary predictions + def makePredictions(ins: IInstance): Saul_SL_Label_Structure[HEAD] = { + val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] + val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) var labelCount = 0 a.foreach { cf => cf.getCandidates(myIns.head).foreach { x => - print(cf.classifier.name.substring(80) + "\t") - print("gt:" + cf.onClassifier.getLabeler.discreteValue(x)) - myStruct.labels(labelCount) = cf.classifier.discreteValue(x) + //print(cf.onClassifier.classifier.name.substring(80) + "\t") + print("gt:" + cf.onClassifier.classifier.getLabeler.discreteValue(x)) + myStruct.labels(labelCount) = cf.onClassifier.classifier.discreteValue(x) println("\tmvc:" + myStruct.labels(labelCount)) labelCount = labelCount + 1 } } - a.map(x => x.onClassifier.classifier.unsetLossFlag()) myStruct } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala index 6e5d6a87..63d9bdea 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Label_Structure.scala @@ -12,7 +12,7 @@ import scala.collection.mutable.ListBuffer class Saul_SL_Label_Structure[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, HEAD]], x: HEAD) extends IStructure { var labels: ListBuffer[String] = ListBuffer() - + val head = x l.foreach { (c: ConstrainedClassifier[_, HEAD]) => { val oracle: Classifier = c.onClassifier.classifier.getLabeler() @@ -24,4 +24,7 @@ class Saul_SL_Label_Structure[HEAD <: AnyRef](l: List[ConstrainedClassifier[_, H } } } + def equals(a: Saul_SL_Label_Structure[HEAD]): Boolean = { + a.labels.equals(labels) + } } \ No newline at end of file diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala new file mode 100644 index 00000000..7d6a4a43 --- /dev/null +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala @@ -0,0 +1,71 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation + +import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ +import edu.illinois.cs.cogcomp.sl.core.SLParameters +import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory +import org.scalatest.{ FlatSpec, Matchers } + +/** Created by Parisa on 6/10/16. + */ +class EntityRelationSLTests extends FlatSpec with Matchers { + + populateWithConllSmallSet() + + val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) + + val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) + "Structured output learning (SL)" should "get correct number of instances." in { + SLProblem.goldStructureList.size() should be(24) + SLProblem.instanceList.size() should be(24) + } + + val model = Initialize(SLProblem, new SaulSLModel(cls)) + "Structured output learning (SL) initialization" should "work." in { + model.Factors.size should be(5) + model.LTUWeightTemplates.size should be(10) + model.wv.getLength should be(1144) + model.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) + } + + val xGold = SLProblem.instanceList.get(0) + val yGold = SLProblem.goldStructureList.get(0) + model.featureGenerator = new SL_FeatureGenerator(model) + + "Structured output learning (SL) Feature extraction" should "work." in { + model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum should be(96.0) + } + + val para = new SLParameters + para.loadConfigFile("./config/DCD.config") + model.para = para + model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates, node) + val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) + + "Structured output learning's loss" should " be calculate correctly." in { + + val yTest = new Saul_SL_Label_Structure[ConllRelation](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].head.asInstanceOf[ConllRelation]) + yTest.labels = for ( + l <- yGold.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].labels + ) yield "true" + + model.infSolver.getLoss(xGold, yGold, yGold) should be(0.00) + model.infSolver.getLoss(xGold, yGold, yTest) >= (0.8) should be(true) + } + + val weight = learner.train(SLProblem, model.wv) + "Structured output learning" should " have a correctly working inference module." in { + val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) + val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) + model.infSolver.getLoss(xGold, yGold, yPredicted) should be(0.00) + model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) + (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. + asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) + } + + "Structured output learning (SL)" should "really work in Saul." in { + + } +} diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala index eab9e73d..dc362b2e 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala @@ -1,7 +1,6 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils -import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ @@ -10,7 +9,6 @@ import org.scalatest._ class EntityRelationTests extends FlatSpec with Matchers { val minScore = 0.3 populateWithConllSmallSet() - val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) "entity classifier " should " should work. " in { ClassifierUtils.LoadClassifier( @@ -50,26 +48,5 @@ class EntityRelationTests extends FlatSpec with Matchers { val scores = PerConstrainedClassifier.test() ++ WorksFor_PerOrg_ConstrainedClassifier.test() scores.foreach { case (label, score) => (score._1 > minScore) should be(true) } } - val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) - "Structured output learning (SL)" should "get correct number of instances." in { - SLProblem.goldStructureList should be(24) - SLProblem.instanceList should be(24) - } - - val model = Initialize(SLProblem, new SaulSLModel(cls)) - "Structured output learning (SL)" should "initialize correctly." in { - model.Factors.size should be(5) - model.LTUWeightTemplates should be(10) - model.wv.getLength should be(1144) - } - model.featureGenerator = new SL_FeatureGenerator(model) - "Structured output learning (SL)" should "do feature extraction correctly." in { - model.featureGenerator.getFeatureVector(SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0)).getValues.sum should be(96.0) - } - - "Structured output learning (SL)" should "really work in Saul." in { - val M = JoinSLtrain(pairs, cls) - M.featureGenerator.getFeatureVector(SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0)) - } } \ No newline at end of file From 45a0fdac450ac15cc597c27daf7917f91f75aae1 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 10 Jun 2016 17:52:13 -0500 Subject: [PATCH 065/118] -minor edits --- .../SL_model/Saul_SL_Inference.scala | 4 +++- .../EntityRelation/EntityRelationApp_SL.scala | 23 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 1ef03497..d96ae76b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -15,6 +15,7 @@ import scala.reflect.ClassTag class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, HEAD]], ltuTemplates: ListBuffer[Array[Float]], node: Node[HEAD])(implicit t: ClassTag[HEAD]) extends AbstractInferenceSolver { val a = factors val dataM = node + override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { //updates the weights of all factors in a @@ -66,7 +67,8 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H } // Now make the predictions using the loss augmented inference val myStruct = makePredictions(ins) - //take the classifier to use its normal inference without considering loss in the future calls + + //make the classifier to use its normal inference without considering loss in the future calls a.map(x => x.onClassifier.classifier.unsetLossFlag()) myStruct } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 6de07968..f605c482 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -2,8 +2,11 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ +import edu.illinois.cs.cogcomp.sl.core.SLParameters +import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import org.slf4j.helpers.NOPLogger import org.slf4j.{ Logger, LoggerFactory } /** Created by Parisa on 12/8/15. @@ -18,11 +21,23 @@ object EntityRelationApp_SL extends App { val testRels = pairs.getTestingInstances.toSet.toList val testTokens = tokens.getTestingInstances.toSet.toList -// val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) -// val model = Initialize(SLProblem, new SaulSLModel(cls)) -// model.featureGenerator = new SL_FeatureGenerator(model) + val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) + val model = Initialize(SLProblem, new SaulSLModel(cls)) + model.featureGenerator = new SL_FeatureGenerator(model) + val para = new SLParameters + para.loadConfigFile("./config/DCD.config") + model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates, node) - val m = JoinSLtrain(pairs, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) + model.para = para + val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) + + model.wv = learner.train(SLProblem, model.wv) + + val best = model.infSolver.getBestStructure(model.wv, SLProblem.instanceList.get(0)) + val bestMVC = model.infSolver.getLossAugmentedBestStructure(model.wv, SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0)) + val loss = model.infSolver.getLoss(SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0), best) + + //val m = JoinSLtrain(pairs, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) // /* Test SL_ER */ // println("Independent Classifiers:") From e225901f444770e97a98ed27ad75c8cb09ec8035 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 10 Jun 2016 18:14:16 -0500 Subject: [PATCH 066/118] -LBJava version update --- build.sbt | 2 +- .../EntityRelation/EntityRelationApp_SL.scala | 31 +++++++------------ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/build.sbt b/build.sbt index 58216a20..8a599855 100644 --- a/build.sbt +++ b/build.sbt @@ -15,7 +15,7 @@ lazy val commonSettings = Seq( ), javaOptions ++= List("-Xmx6g"), libraryDependencies ++= Seq( - "edu.illinois.cs.cogcomp" % "LBJava" % "2.1.18-SNAPSHOT" withSources(), + "edu.illinois.cs.cogcomp" % "LBJava" % "1.2.20" withSources(), "edu.illinois.cs.cogcomp" % "illinois-core-utilities" % cogcompNLPVersion withSources, "com.gurobi" % "gurobi" % "6.0", "org.apache.commons" % "commons-math3" % "3.0", diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index f605c482..de729b07 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -2,11 +2,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ -import edu.illinois.cs.cogcomp.sl.core.SLParameters -import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import org.slf4j.helpers.NOPLogger import org.slf4j.{ Logger, LoggerFactory } /** Created by Parisa on 12/8/15. @@ -16,28 +13,24 @@ object EntityRelationApp_SL extends App { val logger: Logger = if (logging) LoggerFactory.getLogger(this.getClass) else NOPLogger.NOP_LOGGER; EntityRelationDataModel.populateWithConllSmallSet() - val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) + // val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) val testRels = pairs.getTestingInstances.toSet.toList val testTokens = tokens.getTestingInstances.toSet.toList - val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) - val model = Initialize(SLProblem, new SaulSLModel(cls)) - model.featureGenerator = new SL_FeatureGenerator(model) - val para = new SLParameters - para.loadConfigFile("./config/DCD.config") - model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates, node) - - model.para = para - val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) - - model.wv = learner.train(SLProblem, model.wv) + // val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) + // val model = Initialize(SLProblem, new SaulSLModel(cls)) + // model.featureGenerator = new SL_FeatureGenerator(model) + // val para = new SLParameters + // para.loadConfigFile("./config/DCD.config") + // model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates, node) + // + // model.para = para + // val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) - val best = model.infSolver.getBestStructure(model.wv, SLProblem.instanceList.get(0)) - val bestMVC = model.infSolver.getLossAugmentedBestStructure(model.wv, SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0)) - val loss = model.infSolver.getLoss(SLProblem.instanceList.get(0), SLProblem.goldStructureList.get(0), best) + // model.wv = learner.train(SLProblem, model.wv) - //val m = JoinSLtrain(pairs, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) + val m = JoinSLtrain(pairs, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) // /* Test SL_ER */ // println("Independent Classifiers:") From 8bde26cd3e2a2279995d85479532d8231e78936a Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 10 Jun 2016 21:07:27 -0500 Subject: [PATCH 067/118] -adapted to the new version of LBJava -dots fixed --- .../cs/cogcomp/saul/classifier/SparseNetworkLBP.scala | 2 +- .../nlp/EntityRelation/EntityRelationSensors.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala index 46213ce7..274ccb0b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala @@ -8,7 +8,7 @@ class SparseNetworkLBP extends SparseNetworkLearner { var net = network var iConjuctiveLables = conjunctiveLabels - def getLTU(i: Int): LinearThresholdUnit = { + override def getLTU(i: Int): LinearThresholdUnit = { var a: LinearThresholdUnit = net.get(i).asInstanceOf[LinearThresholdUnit] a } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index 59e09f25..bf084401 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -6,8 +6,8 @@ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{ Conll import scala.collection.JavaConverters._ object EntityRelationSensors { - val path = "./data/" - val resourcePath = "./saul-examples/src/main/resources/EntityMentionRelation/" + val path = "../data/" + val resourcePath = "../saul-examples/src/main/resources/EntityMentionRelation/" // Create single instances of Gazeteers and cache then with the object. lazy val cityGazetSensor = new GazeteerReader("gazeteer/known_city.lst", "Gaz:City", true, true) From 0d2b09994ed7d427ffc5e8c67bc4582bce3f428c Mon Sep 17 00:00:00 2001 From: kordjam Date: Sat, 11 Jun 2016 12:22:53 -0500 Subject: [PATCH 068/118] -renamed main file -added initial batch evaluation --- .../SL_model/Saul_SL_Inference.scala | 2 +- ...SLtrain.scala => StructuredLearning.scala} | 26 ++++------- .../EntityRelation/EntityRelationApp_SL.scala | 46 ++----------------- 3 files changed, 16 insertions(+), 58 deletions(-) rename saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/{JoinSLtrain.scala => StructuredLearning.scala} (71%) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index d96ae76b..dd162a8f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -102,7 +102,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H } } - // Uses the current statu of the factors and makes the necessary predictions + // Uses the current status of the factors and makes the necessary predictions def makePredictions(ins: IInstance): Saul_SL_Label_Structure[HEAD] = { val myIns = ins.asInstanceOf[Saul_SL_Instance[HEAD]] val myStruct: Saul_SL_Label_Structure[HEAD] = new Saul_SL_Label_Structure[HEAD](factors.toList, myIns.head) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala similarity index 71% rename from saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala rename to saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 0ee3b40b..44091d7e 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/JoinSLtrain.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -5,11 +5,12 @@ import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner._ +import scala.collection.JavaConversions._ import scala.reflect._ /** Created by Parisa on 12/3/15. */ -object JoinSLtrain { +object StructuredLearning { def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]])(implicit headTag: ClassTag[HEAD]) = { trainSSVM[HEAD](node, cls) @@ -32,24 +33,17 @@ object JoinSLtrain { model.saveModel("SL_ER_Model.txt") return model } - def TestSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { + def Evaluate[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](node, cls, testing = true) + myModel.asInstanceOf[Saul_SL_Inference].updateWeights(myModel.wv) + val il = for { + cf <- myModel.Factors.toList + testExamples = for (candList <- sp.instanceList) yield cf.getCandidates(candList.asInstanceOf[Saul_SL_Instance[HEAD]].head).flatten.distinct + } yield (testExamples, cf) - // val sp.instanceList.toList.map(x=> myModel.infSolver.getBestStructure(myModel.wv,x.asInstanceOf[Saul_SL_Instance].head.asInstanceOf[Saul_SL_Instance])) - // def apply { - // - // l.foreach { (c: ConstrainedClassifier[_, HEAD]) => - // { - // val oracle: Classifier = c.onClassifier.getLabeler() - // val candis: Seq[_] = c.getCandidates(x) - // candis.foreach { - // ci => - // labels.add(oracle.discreteValue(ci)) - // } - // } - // } - // } + // ClassifierUtils.TestClassifiers(il.toSeq) } } + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index de729b07..77059523 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -1,54 +1,18 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ -import org.slf4j.helpers.NOPLogger -import org.slf4j.{ Logger, LoggerFactory } /** Created by Parisa on 12/8/15. */ object EntityRelationApp_SL extends App { - val logging = true - val logger: Logger = if (logging) LoggerFactory.getLogger(this.getClass) else NOPLogger.NOP_LOGGER; EntityRelationDataModel.populateWithConllSmallSet() - // val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - val testRels = pairs.getTestingInstances.toSet.toList - val testTokens = tokens.getTestingInstances.toSet.toList - - // val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) - // val model = Initialize(SLProblem, new SaulSLModel(cls)) - // model.featureGenerator = new SL_FeatureGenerator(model) - // val para = new SLParameters - // para.loadConfigFile("./config/DCD.config") - // model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates, node) - // - // model.para = para - // val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) - - // model.wv = learner.train(SLProblem, model.wv) - - val m = JoinSLtrain(pairs, List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier)) - - // /* Test SL_ER */ - // println("Independent Classifiers:") - // ClassifierUtils.TrainClassifiers(10, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) - // ClassifierUtils.TestClassifiers(PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) - // println("SL Classifiers:") - // PerConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) - // OrgConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) - // LocConstrainedClassifier.test(EntityRelationDataModel.tokens.getTrainingInstances, outputGranularity = 10) - // LivesIn_PerOrg_relationConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) - // WorksFor_PerOrg_ConstrainedClassifier.test(EntityRelationDataModel.pairs.getTrainingInstances, outputGranularity = 10) - // - ClassifierUtils.TestClassifiers((testTokens, PerConstrainedClassifier), (testTokens, OrgConstrainedClassifier), - (testTokens, LocConstrainedClassifier)) - - ClassifierUtils.TestClassifiers( - (testRels, WorksFor_PerOrg_ConstrainedClassifier), - (testRels, LivesIn_PerOrg_relationConstrainedClassifier) - ) + val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, + LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) + val m = StructuredLearning(pairs, cls) + StructuredLearning.Evaluate(pairs, cls, "") } + From b437610b6c5f98e48fafda478c8e46f1fb5bc129 Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 13 Jun 2016 14:16:21 -0700 Subject: [PATCH 069/118] -minor --- .../cs/cogcomp/saul/classifier/ClassifierUtils.scala | 12 ++++++++++++ .../classifier/SL_model/StructuredLearning.scala | 10 ++++++---- .../nlp/EntityRelation/EntityRelationApp_SL.scala | 2 +- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala index 09aecc97..f9f73037 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala @@ -108,6 +108,18 @@ object ClassifierUtils { println(evalSeparator) testResults } + + def apply[HEAD <: AnyRef](instanceClassifierPairs: (Iterable[_], ConstrainedClassifier[_, HEAD])*)(implicit d1: DummyImplicit, d2: DummyImplicit, d3: DummyImplicit, d4: DummyImplicit): Seq[List[(String, (Double, Double, Double))]] = { + val testResults = instanceClassifierPairs.map { + case (testInstances, learner) => + learner.onClassifier.classifier.asInstanceOf[Learnable] + println(evalSeparator) + println("Evaluating " + learner.getClassSimpleNameForClassifier) + learner.test(testInstances) + } + println(evalSeparator) + testResults + } } object ForgetAll { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 44091d7e..033b3658 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier} import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner._ @@ -34,15 +34,17 @@ object StructuredLearning { return model } def Evaluate[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { + val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](node, cls, testing = true) myModel.asInstanceOf[Saul_SL_Inference].updateWeights(myModel.wv) val il = for { cf <- myModel.Factors.toList - testExamples = for (candList <- sp.instanceList) yield cf.getCandidates(candList.asInstanceOf[Saul_SL_Instance[HEAD]].head).flatten.distinct - } yield (testExamples, cf) + testExamples = for (candList <- sp.instanceList) yield + cf.getCandidates(candList.asInstanceOf[Saul_SL_Instance[HEAD]].head).flatten.distinct + } yield (testExamples, cf) - // ClassifierUtils.TestClassifiers(il.toSeq) + ClassifierUtils.TestClassifiers(il.toSeq) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 77059523..0cdacae9 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -12,7 +12,7 @@ object EntityRelationApp_SL extends App { val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - val m = StructuredLearning(pairs, cls) + StructuredLearning(pairs, cls) StructuredLearning.Evaluate(pairs, cls, "") } From c856fde2ff6b0c276f8aec1a2289a2b41a91e332 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 19 Jun 2016 08:27:32 -0500 Subject: [PATCH 070/118] -evaluation oc collection of constraint classifiers. --- .../saul/classifier/ClassifierUtils.scala | 13 +++------ .../classifier/ConstrainedClassifier.scala | 8 ++++-- .../SL_model/StructuredLearning.scala | 27 +++++++++++-------- .../EntityRelation/EntityRelationApp_SL.scala | 4 +-- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala index 2f922079..0fd59a60 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala @@ -128,19 +128,12 @@ object ClassifierUtils { testResults } - def apply[HEAD <: AnyRef](instanceClassifierPairs: (Iterable[_], ConstrainedClassifier[_, HEAD])*)(implicit d1: DummyImplicit, d2: DummyImplicit, d3: DummyImplicit, d4: DummyImplicit): Seq[List[(String, (Double, Double, Double))]] = { - val testResults = instanceClassifierPairs.map { - case (testInstances, learner) => - learner.onClassifier.classifier.asInstanceOf[Learnable] - println(evalSeparator) - println("Evaluating " + learner.getClassSimpleNameForClassifier) - learner.test(testInstances) - } + def apply1[T <: AnyRef, H <: AnyRef](insts: Iterable[T], cls: ConstrainedClassifier[T, H]): List[(String, (Double, Double, Double))] = { println(evalSeparator) - testResults + println("Evaluating " + cls.getClassSimpleNameForClassifier) + cls.test(insts) } } - object ForgetAll { def apply(c: Learnable[_]*): Unit = { c.foreach((x: Learnable[_]) => x.forget()) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 6196cf75..c59e14a5 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -26,7 +26,7 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi implicit val headType: ClassTag[HEAD] ) extends LBJClassifierEquivalent { - type LEFT = T + final type LEFT = T type RIGHT = HEAD def className: String = this.getClass.getName @@ -81,7 +81,11 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi } } - def getCandidates(head: HEAD): Seq[T] = { +// def getMultiCandidates(head: Seq[HEAD]): Seq[LEFT] = { +// head.flatMap(h => getCandidates(h)).distinct +// } + + def getCandidates(head: HEAD): Seq[LEFT] = { if (tType.equals(headType) || pathToHead.isEmpty) { head.asInstanceOf[T] :: Nil } else { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 033b3658..9b87cb93 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier} +import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, ConstrainedClassifier } import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner._ @@ -33,19 +33,24 @@ object StructuredLearning { model.saveModel("SL_ER_Model.txt") return model } - def Evaluate[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { - val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] - val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](node, cls, testing = true) - myModel.asInstanceOf[Saul_SL_Inference].updateWeights(myModel.wv) - val il = for { - cf <- myModel.Factors.toList - testExamples = for (candList <- sp.instanceList) yield - cf.getCandidates(candList.asInstanceOf[Saul_SL_Instance[HEAD]].head).flatten.distinct - } yield (testExamples, cf) + def Eval1[T <: AnyRef, H <: AnyRef](cf: ConstrainedClassifier[T, H], sp: SLProblem) = { + + val testExamples : Seq[T] = sp.instanceList.map(x => cf.getCandidates(x.asInstanceOf[Saul_SL_Instance[H]].head)).flatten.distinct + //val testExamples: Seq[T] = cf.getCandidates(sp.instanceList.map(_.asInstanceOf[Saul_SL_Instance[H]].head)).asInstanceOf[Seq[cf.LEFT]] + ClassifierUtils.TestClassifiers.apply1(testExamples, cf) + } - ClassifierUtils.TestClassifiers(il.toSeq) + //// + def Evaluate[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_ <: AnyRef, HEAD]], myModel: SaulSLModel[HEAD], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { + //val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] + val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](node, cls, testing = true) + myModel.infSolver.asInstanceOf[Saul_SL_Inference[HEAD]].updateWeights(myModel.wv) + val results = for (cf <- myModel.Factors.toList.asInstanceOf[List[ConstrainedClassifier[_ <: AnyRef, HEAD]]]) yield { + Eval1(cf, sp) + } + //ClassifierUtils.TestClassifiers.aggregate(results) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 0cdacae9..0ed452dc 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -12,7 +12,7 @@ object EntityRelationApp_SL extends App { val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - StructuredLearning(pairs, cls) - StructuredLearning.Evaluate(pairs, cls, "") + val m = StructuredLearning(pairs, cls) + StructuredLearning.Evaluate(pairs, cls, m, "") } From 27c22de99f636200aa56d321cfe546695c46a598 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 19 Jun 2016 08:28:22 -0500 Subject: [PATCH 071/118] -format --- .../cs/cogcomp/saul/classifier/ConstrainedClassifier.scala | 6 +++--- .../saul/classifier/SL_model/StructuredLearning.scala | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index c59e14a5..b3100209 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -81,9 +81,9 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi } } -// def getMultiCandidates(head: Seq[HEAD]): Seq[LEFT] = { -// head.flatMap(h => getCandidates(h)).distinct -// } + // def getMultiCandidates(head: Seq[HEAD]): Seq[LEFT] = { + // head.flatMap(h => getCandidates(h)).distinct + // } def getCandidates(head: HEAD): Seq[LEFT] = { if (tType.equals(headType) || pathToHead.isEmpty) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 9b87cb93..00b9f368 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -36,7 +36,7 @@ object StructuredLearning { def Eval1[T <: AnyRef, H <: AnyRef](cf: ConstrainedClassifier[T, H], sp: SLProblem) = { - val testExamples : Seq[T] = sp.instanceList.map(x => cf.getCandidates(x.asInstanceOf[Saul_SL_Instance[H]].head)).flatten.distinct + val testExamples: Seq[T] = sp.instanceList.map(x => cf.getCandidates(x.asInstanceOf[Saul_SL_Instance[H]].head)).flatten.distinct //val testExamples: Seq[T] = cf.getCandidates(sp.instanceList.map(_.asInstanceOf[Saul_SL_Instance[H]].head)).asInstanceOf[Seq[cf.LEFT]] ClassifierUtils.TestClassifiers.apply1(testExamples, cf) } From d17ddd37e814175bd21c11625aaca6e809e076a4 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 19 Jun 2016 14:53:29 -0500 Subject: [PATCH 072/118] format --- build.sbt | 2 +- .../saulexamples/nlp/EntityRelation/EntityRelationTests.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index e5f6b5c9..0a8b8e9f 100644 --- a/build.sbt +++ b/build.sbt @@ -46,7 +46,7 @@ lazy val saulExamples = (project in file("saul-examples")). "edu.illinois.cs.cogcomp" % "illinois-edison" % cogcompNLPVersion, "edu.illinois.cs.cogcomp" % "illinois-nlp-readers" % "0.0.2-SNAPSHOT", "edu.illinois.cs.cogcomp" % "saul-pos-tagger-models" % "1.0", - "edu.illinois.cs.cogcomp" % "saul-er-models" % "1.3", + "edu.illinois.cs.cogcomp" % "saul-er-models" % "1.4", "edu.illinois.cs.cogcomp" % "saul-srl-models" % "1.1" ) ).dependsOn(saulCore).aggregate(saulCore) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala index 52dadb25..b65e5179 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala @@ -13,7 +13,7 @@ class EntityRelationTests extends FlatSpec with Matchers { val minScore = 0.3 populateWithConllSmallSet() - "entity classifier " should " work. " in { + "entity classifier " should " work. " in { sentences.populate(EntityRelationSensors.sentencesSmallSetTest, train = false) ClassifierUtils.LoadClassifier( EntityRelationApp.jarModelPath, @@ -48,7 +48,7 @@ class EntityRelationTests extends FlatSpec with Matchers { scores.foreach { case score => (score.overall.f1 > minScore) should be(true) } } - "L+I entity-relation classifiers " should " work. " in { + "L+I entity-relation classifiers " should " work. " in { sentences.populate(EntityRelationSensors.sentencesSmallSetTest, train = false) ClassifierUtils.LoadClassifier( EntityRelationApp.jarModelPath, From a68dd4a274d8890c7f5607fb1fa8e54392a72c4d Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 19 Jun 2016 15:10:14 -0500 Subject: [PATCH 073/118] format --- .../illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala | 2 +- .../cs/cogcomp/saul/classifier/ConstrainedClassifier.scala | 4 +--- .../nlp/EntityRelation/EntityRelationDataModel.scala | 2 +- .../nlp/EntityRelation/EntityRelationSensors.scala | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala index 51b08436..1b508f41 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ClassifierUtils.scala @@ -128,7 +128,7 @@ object ClassifierUtils { testResults } - def apply1[T <: AnyRef, H <: AnyRef](insts: Iterable[T], cls: ConstrainedClassifier[T, H]): List[(String, (Double, Double, Double))] = { + def apply1[T <: AnyRef, H <: AnyRef](insts: Iterable[T], cls: ConstrainedClassifier[T, H]): Results = { println(evalSeparator) println("Evaluating " + cls.getClassSimpleNameForClassifier) cls.test(insts) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index d9e0e061..5796bc9c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -8,10 +8,8 @@ import edu.illinois.cs.cogcomp.saul.classifier.SL_model.LossAugmentedNormalizer import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import edu.illinois.cs.cogcomp.saul.datamodel.edge.Edge -import edu.illinois.cs.cogcomp.saul.lbjrelated.{ LBJLearnerEquivalent, LBJClassifierEquivalent } -import edu.illinois.cs.cogcomp.saul.parser.IterableToLBJavaParser import edu.illinois.cs.cogcomp.saul.lbjrelated.{ LBJClassifierEquivalent, LBJLearnerEquivalent } -import edu.illinois.cs.cogcomp.saul.parser.LBJIteratorParserScala +import edu.illinois.cs.cogcomp.saul.parser.IterableToLBJavaParser import scala.collection.mutable.ListBuffer import scala.reflect.ClassTag diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala index ad844e1a..1d78504f 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala @@ -116,6 +116,6 @@ object EntityRelationDataModel extends DataModel { def populateWithConllSmallSet() = { sentences.populate(EntityRelationSensors.sentencesSmallSet) - sentences.populate(EntityRelationSensors.sentencesSmallSet2, train = false) + sentences.populate(EntityRelationSensors.sentencesSmallSetTest, train = false) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index bf084401..9eb12c63 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -25,7 +25,7 @@ object EntityRelationSensors { lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_train.corp") lazy val (sentencesTest, relationsTest, entitiesTest) = readConllData(path + "EntityMentionRelation/conll04_test.corp") lazy val (sentencesSmallSet, testRelationsSmallSet, entitiesSmallSet) = readConllData(resourcePath + "conll04-smallDocument.txt") - lazy val (sentencesSmallSet2, trainRelationsSmallSet, trainEntitiesSmallSet) = readConllData(path + "EntityMentionRelation/conll04_small.corp") + lazy val (sentencesSmallSetTest, testRelationsSmallSetTest, entitiesSmallSetTest) = readConllData(path + "EntityMentionRelation/conll04_small.corp") def sentenceToRelation_GeneratingSensor(s: ConllRawSentence): List[ConllRelation] = { s.relations.asScala.toList From ecad86aee53e055b2d8fb8dd1801212530efc830 Mon Sep 17 00:00:00 2001 From: kordjam Date: Tue, 21 Jun 2016 10:22:54 -0500 Subject: [PATCH 074/118] -added the possibility of initializing with the trained classifiers -used the latest lbjava for SparseNetwork methods -removed the un necessary parameter for inference --- .../classifier/JointTrainSparseNetwork.scala | 6 +- .../saul/classifier/SL_model/Initialize.scala | 86 +++++++++++-------- .../SL_model/SL_FeatureGenerator.scala | 8 +- .../SL_model/Saul_SL_Inference.scala | 14 ++- .../SL_model/StructuredLearning.scala | 10 +-- .../saul/classifier/SparseNetworkLBP.scala | 4 +- .../classifier/infer/InferenceCondition.scala | 2 +- .../EntityRelation/EntityRelationApp_SL.scala | 14 ++- .../EntityRelationSensors.scala | 8 +- .../EntityRelationSLTests.scala | 2 +- .../EntityRelation/EntityRelationTests.scala | 2 - 11 files changed, 90 insertions(+), 66 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala index c914b5e0..1d77ef64 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala @@ -67,14 +67,14 @@ object JointTrainSparseNetwork { val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues val exampleLabels = a(2).asInstanceOf[Array[Int]] val label = exampleLabels(0) - var N = ilearner.net.size() + var N = ilearner.getNetwork.size() - if (label >= N || ilearner.net.get(label) == null) { + if (label >= N || ilearner.getNetwork.get(label) == null) { ilearner.iConjuctiveLables = ilearner.iConjuctiveLables | ilearner.getLabelLexicon.lookupKey(label).isConjunctive val ltu: LinearThresholdUnit = ilearner.getbaseLTU ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures) - ilearner.net.set(label, ltu) + ilearner.getNetwork.set(label, ltu) N = label + 1 } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 8c992158..270d1c6f 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -13,61 +13,73 @@ import scala.collection.mutable.ListBuffer */ object Initialize { - def apply[HEAD <: AnyRef](sp: SLProblem, model: SaulSLModel[HEAD]): SaulSLModel[HEAD] = { + def apply[HEAD <: AnyRef](sp: SLProblem, model: SaulSLModel[HEAD], initialize: Boolean = false): SaulSLModel[HEAD] = { - model.Factors.foreach { - cf => - sp.instanceList.toList.zipWithIndex.foreach { - case (myIns, ind) => { - val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] - //for (i <- 0 until ins.ConstraintFactors.size) { - val candis: Seq[_] = cf.getCandidates(ins.head) - val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] - val lLexicon = cf.onClassifier.classifier.getLabelLexicon - candis.foreach { - x => - val a = cf.onClassifier.classifier.getExampleArray(x) - val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures + var wvLength = 0 + var lt: ListBuffer[Array[Float]] = ListBuffer() + + if (!initialize) + model.Factors.foreach { + cf => + cf.onClassifier.classifier.forget() + sp.instanceList.toList.zipWithIndex.foreach { + case (myIns, ind) => { + val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] + val candis: Seq[_] = cf.getCandidates(ins.head) + val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val lLexicon = cf.onClassifier.classifier.getLabelLexicon + candis.foreach { + x => + val a = cf.onClassifier.classifier.getExampleArray(x) + val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues val exampleLabels = a(2).asInstanceOf[Array[Int]] - val labelValues = a(3).asInstanceOf[Array[Double]] - val label = exampleLabels(0) - var N = ilearner.net.size(); - if (label >= N || ilearner.net.get(label) == null) { - ilearner.iConjuctiveLables = ilearner.iConjuctiveLables | ilearner.getLabelLexicon.lookupKey(label).isConjunctive(); - var ltu: LinearThresholdUnit = ilearner.getbaseLTU - ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); - ilearner.net.set(label, ltu); - print("weight vector size:" + ilearner.net.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) - println("lexicon size:" + ilearner.getLexicon.size()) + val labelValues = a(3).asInstanceOf[Array[Double]] + val label = exampleLabels(0) + var N = ilearner.getNetwork.size(); + if (label >= N || ilearner.getNetwork.get(label) == null) { + ilearner.iConjuctiveLables = ilearner.iConjuctiveLables | ilearner.getLabelLexicon.lookupKey(label).isConjunctive(); + var ltu: LinearThresholdUnit = ilearner.getbaseLTU + ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); + ilearner.getNetwork.set(label, ltu); + print("weight vector size:" + ilearner.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) + println("lexicon size:" + ilearner.getLexicon.size()) - N = label + 1; - } - } // for each candidate - } // for each constraintFactor - } //end case - } //for each example + N = label + 1; + } + } // for each candidate + } // for each constraintFactor + } // for each example + } //for each factor - var wvLength = 0 - var lt: ListBuffer[Array[Float]] = ListBuffer() model.Factors.foreach( x => { val sparseNet = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] val temp = (sparseNet.getLexicon.size()) - for (i <- 0 until sparseNet.net.size()) { + for (i <- 0 until sparseNet.getNetwork.size()) { val t = Array.fill[Float](temp)(0) + if (initialize) { + val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector + for (j<- 0 until temp) + { + + t(j)= getTheWeight.getWeight(j).asInstanceOf[Float] + // if (t(j)==0) {print(j," zero/")} + } + } + lt = lt :+ t wvLength = wvLength + temp } + println(sparseNet.getLexicon.size(), "*", sparseNet.getLabelLexicon.size()) } ) - - val myWeight = Array.fill[Float](wvLength)(0) - val wv = new WeightVector(myWeight) - val m = new SaulSLModel[HEAD](model.Factors.toList, lt) + val myWeight = Array(lt.flatten: _*) + val wv = new WeightVector(myWeight) // wv this is one unified weight vector of all initialized LTUs + val m = new SaulSLModel[HEAD](model.Factors.toList, lt) // lt is the list of individual weight vectors m.wv = wv m } //end f apply diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 8a3b522a..0d8a0e50 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -14,6 +14,9 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst val fv = new FeatureVectorBuffer() var ltuNum = 0 var factorOffset = 0 + + //The features vectors are generated per classifier with local indexes and then the indexes are adjusted globally + model.Factors.zipWithIndex.foreach { case (cf, indF) => @@ -28,7 +31,8 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst var a1 = a(1).asInstanceOf[Array[Double]] val fvTemp = new FeatureVectorBuffer(a0, a1) val lab = myY.labels(indC) - for (netI <- 0 until sparseNet.net.size()) { + //keep the features for the on label (at netI index) and repeat a zero feature vector for the off labels + for (netI <- 0 until sparseNet.getNetwork.size()) { if (netI != 0) localOffset = localOffset + model.LTUWeightTemplates(ltuNum + netI - 1).length else localOffset = 0 @@ -42,7 +46,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst } } - ltuNum = ltuNum + sparseNet.net.size() + ltuNum = ltuNum + sparseNet.getNetwork.size() if (indF > 0) factorOffset = factorOffset + model.Factors(indF - 1).onClassifier.classifier.getLexicon.size() * model.Factors(indF - 1).onClassifier.getLabelLexicon.size() diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index dd162a8f..30062f6b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,9 +1,8 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit -import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, SparseNetworkLBP } -import edu.illinois.cs.cogcomp.saul.datamodel.node.Node -import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } +import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector import scala.Array._ @@ -12,9 +11,8 @@ import scala.reflect.ClassTag /** Created by Parisa on 12/8/15. */ -class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, HEAD]], ltuTemplates: ListBuffer[Array[Float]], node: Node[HEAD])(implicit t: ClassTag[HEAD]) extends AbstractInferenceSolver { +class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, HEAD]], ltuTemplates: ListBuffer[Array[Float]])(implicit t: ClassTag[HEAD]) extends AbstractInferenceSolver { val a = factors - val dataM = node override def getBestStructure(weight: WeightVector, ins: IInstance): IStructure = { @@ -81,7 +79,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H var offset = 0 a.foreach { cf => - for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].net.size()) { + for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.size()) { val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector print("w", ltu_count, " size:\t", w1.size) val myFactorJoinlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) @@ -91,10 +89,10 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H exampleFeatureIndexes(featureIndex) = featureIndex; } - val p = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] + val p = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] p.weightVector.clear() p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJoinlyTrainedWeight), 0.0) - cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) + cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) offset = offset + ltuTemplates(ltu_count).length ltu_count = ltu_count + 1 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 00b9f368..a0d5737c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -11,15 +11,15 @@ import scala.reflect._ /** Created by Parisa on 12/3/15. */ object StructuredLearning { - def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]])(implicit headTag: ClassTag[HEAD]) = + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], initialize: Boolean = false)(implicit headTag: ClassTag[HEAD]) = { - trainSSVM[HEAD](node, cls) + trainSSVM[HEAD](node, cls, initialize) } - def trainSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]])(implicit t: ClassTag[HEAD]): SaulSLModel[HEAD] = { + def trainSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], initialize: Boolean)(implicit t: ClassTag[HEAD]): SaulSLModel[HEAD] = { val sp = SL_IOManager.makeSLProblem(node, cls) - val model = Initialize(sp, new SaulSLModel(cls)) - model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LTUWeightTemplates, node) + val model = Initialize(sp, new SaulSLModel(cls), initialize) + model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LTUWeightTemplates) val para = new SLParameters // para.STOP_CONDITION = 0.0001f // para.INNER_STOP_CONDITION= 0.0001f diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala index 274ccb0b..0d2b1f69 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala @@ -6,10 +6,10 @@ import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetwork */ class SparseNetworkLBP extends SparseNetworkLearner { - var net = network + // val net = network var iConjuctiveLables = conjunctiveLabels override def getLTU(i: Int): LinearThresholdUnit = { - var a: LinearThresholdUnit = net.get(i).asInstanceOf[LinearThresholdUnit] + var a: LinearThresholdUnit = network.get(i).asInstanceOf[LinearThresholdUnit] a } def getnumExamples: Int = { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 3d499f1d..898dcd13 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -19,7 +19,7 @@ abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](solver: ILPSo override def getSubjectToInstance: ParameterizedConstraint = { subjectTo.transfer } - verbosity = 1 + //verbosity = 1 // TODO: override other functions that needed here override def getNormalizer(c: Learner): Normalizer = { normalize diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 0ed452dc..6a004193 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -1,18 +1,28 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation +import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ /** Created by Parisa on 12/8/15. */ object EntityRelationApp_SL extends App { - EntityRelationDataModel.populateWithConllSmallSet() + EntityRelationDataModel.populateWithConll() + + ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - val m = StructuredLearning(pairs, cls) + ClassifierUtils.TestClassifiers(cls:_*) + + val m = StructuredLearning(pairs, cls, initialize = false) + println("Structured evaluation.\n") + StructuredLearning.Evaluate(pairs, cls, m, "") + //ClassifierUtils.TestClassifiers(cls:_*) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index 9eb12c63..36da9512 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -6,8 +6,8 @@ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{ Conll import scala.collection.JavaConverters._ object EntityRelationSensors { - val path = "../data/" - val resourcePath = "../saul-examples/src/main/resources/EntityMentionRelation/" + val path = "./data/" + val resourcePath = "./saul-examples/src/main/resources/EntityMentionRelation/" // Create single instances of Gazeteers and cache then with the object. lazy val cityGazetSensor = new GazeteerReader("gazeteer/known_city.lst", "Gaz:City", true, true) @@ -25,7 +25,9 @@ object EntityRelationSensors { lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_train.corp") lazy val (sentencesTest, relationsTest, entitiesTest) = readConllData(path + "EntityMentionRelation/conll04_test.corp") lazy val (sentencesSmallSet, testRelationsSmallSet, entitiesSmallSet) = readConllData(resourcePath + "conll04-smallDocument.txt") - lazy val (sentencesSmallSetTest, testRelationsSmallSetTest, entitiesSmallSetTest) = readConllData(path + "EntityMentionRelation/conll04_small.corp") + lazy val (sentencesSmallSetTest, testRelationsSmallSetTest, entitiesSmallSetTest) = readConllData(path + "EntityMentionRelation/conll04_small.corp") + //readConllData(resourcePath + "conll04-smallDocument.txt") + def sentenceToRelation_GeneratingSensor(s: ConllRawSentence): List[ConllRelation] = { s.relations.asScala.toList diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala index 7d6a4a43..ed2d38e2 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala @@ -41,7 +41,7 @@ class EntityRelationSLTests extends FlatSpec with Matchers { val para = new SLParameters para.loadConfigFile("./config/DCD.config") model.para = para - model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates, node) + model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates) val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) "Structured output learning's loss" should " be calculate correctly." in { diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala index b65e5179..e315b2d6 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala @@ -2,8 +2,6 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ From 1e9afb32085eb4841c3b4a2216f957cbefaf0821 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 22 Jun 2016 08:30:22 -0500 Subject: [PATCH 075/118] -minor --- .../saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 6a004193..71e7a09c 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -9,7 +9,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDat */ object EntityRelationApp_SL extends App { - EntityRelationDataModel.populateWithConll() + EntityRelationDataModel.populateWithConllSmallSet() ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) From f7f46c53fc14bd86e683f541a137380167486d02 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 26 Jun 2016 09:26:30 +0430 Subject: [PATCH 076/118] format --- .../cogcomp/saul/classifier/SL_model/Initialize.scala | 11 +++++------ .../saul/classifier/SL_model/Saul_SL_Inference.scala | 4 ++-- .../cs/cogcomp/saul/classifier/SparseNetworkLBP.scala | 2 +- .../nlp/EntityRelation/EntityRelationApp_SL.scala | 3 +-- .../nlp/EntityRelation/EntityRelationSensors.scala | 3 +-- 5 files changed, 10 insertions(+), 13 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 270d1c6f..05baa629 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -32,8 +32,8 @@ object Initialize { x => val a = cf.onClassifier.classifier.getExampleArray(x) val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures - val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues - val exampleLabels = a(2).asInstanceOf[Array[Int]] + val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues + val exampleLabels = a(2).asInstanceOf[Array[Int]] val labelValues = a(3).asInstanceOf[Array[Double]] val label = exampleLabels(0) var N = ilearner.getNetwork.size(); @@ -62,11 +62,10 @@ object Initialize { val t = Array.fill[Float](temp)(0) if (initialize) { val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector - for (j<- 0 until temp) - { + for (j <- 0 until temp) { - t(j)= getTheWeight.getWeight(j).asInstanceOf[Float] - // if (t(j)==0) {print(j," zero/")} + t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] + // if (t(j)==0) {print(j," zero/")} } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 30062f6b..97966843 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,8 +1,8 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit -import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} -import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} +import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, SparseNetworkLBP } +import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } import edu.illinois.cs.cogcomp.sl.util.WeightVector import scala.Array._ diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala index 0d2b1f69..c18a23a0 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala @@ -6,7 +6,7 @@ import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetwork */ class SparseNetworkLBP extends SparseNetworkLearner { - // val net = network + // val net = network var iConjuctiveLables = conjunctiveLabels override def getLTU(i: Int): LinearThresholdUnit = { var a: LinearThresholdUnit = network.get(i).asInstanceOf[LinearThresholdUnit] diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 71e7a09c..fcc01d8b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -13,11 +13,10 @@ object EntityRelationApp_SL extends App { ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) - val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - ClassifierUtils.TestClassifiers(cls:_*) + ClassifierUtils.TestClassifiers(cls: _*) val m = StructuredLearning(pairs, cls, initialize = false) println("Structured evaluation.\n") diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index 36da9512..b93976da 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -25,10 +25,9 @@ object EntityRelationSensors { lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_train.corp") lazy val (sentencesTest, relationsTest, entitiesTest) = readConllData(path + "EntityMentionRelation/conll04_test.corp") lazy val (sentencesSmallSet, testRelationsSmallSet, entitiesSmallSet) = readConllData(resourcePath + "conll04-smallDocument.txt") - lazy val (sentencesSmallSetTest, testRelationsSmallSetTest, entitiesSmallSetTest) = readConllData(path + "EntityMentionRelation/conll04_small.corp") + lazy val (sentencesSmallSetTest, testRelationsSmallSetTest, entitiesSmallSetTest) = readConllData(path + "EntityMentionRelation/conll04_small.corp") //readConllData(resourcePath + "conll04-smallDocument.txt") - def sentenceToRelation_GeneratingSensor(s: ConllRawSentence): List[ConllRelation] = { s.relations.asScala.toList } From 552ea2af23ba57f6beb7013213efc5a4cab8287f Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 1 Jul 2016 03:20:48 +0430 Subject: [PATCH 077/118] -added the raw test --- .../nlp/POSTagger/POSClassifiers.scala | 4 +- .../nlp/EntityRelation/weightTest.scala | 123 ++++++++++++++++++ 2 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala index c68331b4..d15301da 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSClassifiers.scala @@ -1,9 +1,9 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.POSTagger import edu.illinois.cs.cogcomp.core.datastructures.textannotation.Constituent -import edu.illinois.cs.cogcomp.lbjava.learn.{ SparseAveragedPerceptron, SparseNetworkLearner } +import edu.illinois.cs.cogcomp.lbj.pos.POSBaselineLearner +import edu.illinois.cs.cogcomp.lbjava.learn.{SparseAveragedPerceptron, SparseNetworkLearner} import edu.illinois.cs.cogcomp.saul.classifier.Learnable -import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saulexamples.nlp.POSTagger.POSDataModel._ object POSClassifiers { diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala new file mode 100644 index 00000000..3aa2273d --- /dev/null +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -0,0 +1,123 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation + +import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{Saul_SL_Inference, StructuredLearning} +import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, Learnable, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.property.Property +import edu.illinois.cs.cogcomp.sl.util.WeightVector +import org.scalatest.{FlatSpec, Matchers} + +import scala.collection.mutable.ListBuffer + +/** + * Created by Parisa on 6/30/16. + */ +class weightTest extends FlatSpec with Matchers +{ + + "weights initializer" should "join multiple weight vectors" in { + var lt: ListBuffer[Array[Float]] = ListBuffer() + var wvLength = 0 + // Add 3 factors (size 3, 4, 7) + val length1 = 3 + val length2 = 4 + val length3 = 7 + val t1: Array[Float] = Array(4.0f, 6.0f, 8.0f) + wvLength = wvLength + length1 + val t2: Array[Float] = Array(-8.0f, -6.0f, -4.0f, 0.0f) + wvLength = wvLength + length2 + val t3: Array[Float] = Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f) + wvLength = wvLength + length3 + + // Append the individual vectors to the buffer + lt = lt :+ t1 + lt = lt :+ t2 + lt = lt :+ t3 + + // Create the complete weight vector + val myWeight = Array(lt.flatten: _*) + val wv = new WeightVector(myWeight) + wv.getWeightArray should be (Array(4.0f, 6.0f, 8.0f, -8.0f, -6.0f, -4.0f, 0.0f, 14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f)) + } + + "weight update" should "distribute the joint weight vector" in { + var lt: ListBuffer[Array[Float]] = ListBuffer() + var wvLength = 0 + // Add 3 factors (size 3, 4, 7) + val t1: Array[Float] = Array(4.0f, 6.0f, 8.0f) + wvLength = wvLength + t1.length + val t2: Array[Float] = Array(-8.0f, -6.0f, -4.0f, 0.0f) + wvLength = wvLength + t2.length + val t3: Array[Float] = Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f) + wvLength = wvLength + t3.length + + // Append the individual vectors to the buffer + lt = lt :+ t1 + lt = lt :+ t2 + lt = lt :+ t3 + + // Create the complete weight vector + val myWeight = Array(lt.flatten: _*) + val wv = new WeightVector(myWeight) + + var offset = 0 + val factorWeight1 = wv.getWeightArray.slice(offset, offset + t1.length) + factorWeight1 should be (Array(4.0f, 6.0f, 8.0f)) + offset = offset + t1.length + + val factorWeight2 = wv.getWeightArray.slice(offset, offset + t2.length) + factorWeight2 should be (Array(-8.0f, -6.0f, -4.0f, 0.0f)) + offset = offset + t2.length + + val factorWeight3 = wv.getWeightArray.slice(offset, offset + t3.length) + factorWeight3 should be (Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f)) + } + + // Testing the original functions with real classifiers + "integration test" should "work" in { + // Initialize toy model + import testModel._ + object TestClassifier extends Learnable(tokens) { + def label: Property[String] = testLabel + override def feature = using(word) + override lazy val classifier = new SparseNetworkLBP + } + object TestBiClassifier extends Learnable(tokens) { + def label: Property[String] = testLabel + override def feature = using(word, biWord) + override lazy val classifier = new SparseNetworkLBP + } + object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { + def subjectTo = null + override val pathToHead = Some(-pairs) + override def filter(t: String, h: String): Boolean = t.equals(h) + override val solver = new OJalgoHook + } + object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { + def subjectTo = null + override val pathToHead = Some(-pairs) + override def filter(t: String, h: String): Boolean = t.equals(h) + override val solver = new OJalgoHook + } + + // THIS DOESN'T WORK + val lex = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon + print(lex.size()) + + val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) + // This should combine the weights + val m = StructuredLearning(tokens, cls, initialize = false) +// // This should distribute the weights + m.infSolver.asInstanceOf[Saul_SL_Inference[String]].updateWeights(m.wv) +// + } + + object testModel extends DataModel { + val tokens = node[String] + val pairs = edge(tokens, tokens) + val testLabel = property(tokens) { x:String => x.equals("candidate") } + val word = property(tokens) { x:String => x } + val biWord = property(tokens) { x:String => x + "-" + x } + } +} From bb8d6ad374ab5bef77eacfa68a5ad3c6fdc5b40e Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 1 Jul 2016 04:42:30 +0430 Subject: [PATCH 078/118] -fixed the messages -added a positive example for the test --- .../saul/classifier/SL_model/Initialize.scala | 13 +++++++------ .../nlp/EntityRelation/weightTest.scala | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 05baa629..c081b5e3 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -22,12 +22,13 @@ object Initialize { model.Factors.foreach { cf => cf.onClassifier.classifier.forget() + val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val lLexicon = cf.onClassifier.classifier.getLabelLexicon sp.instanceList.toList.zipWithIndex.foreach { + case (myIns, ind) => { val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] val candis: Seq[_] = cf.getCandidates(ins.head) - val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] - val lLexicon = cf.onClassifier.classifier.getLabelLexicon candis.foreach { x => val a = cf.onClassifier.classifier.getExampleArray(x) @@ -42,14 +43,14 @@ object Initialize { var ltu: LinearThresholdUnit = ilearner.getbaseLTU ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); ilearner.getNetwork.set(label, ltu); - print("weight vector size:" + ilearner.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) - println("lexicon size:" + ilearner.getLexicon.size()) - N = label + 1; } } // for each candidate } // for each constraintFactor } // for each example + // print("weight vector size:" + ilearner.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) + // println("lexicon size:" + ilearner.getLexicon.size()) + } //for each factor model.Factors.foreach( @@ -73,7 +74,7 @@ object Initialize { wvLength = wvLength + temp } - println(sparseNet.getLexicon.size(), "*", sparseNet.getLabelLexicon.size()) + println("lexicon size: "+ sparseNet.getLexicon.size(), "* label lexicon size:", sparseNet.getLabelLexicon.size()) } ) val myWeight = Array(lt.flatten: _*) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index 3aa2273d..81ba5d34 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -104,7 +104,8 @@ class weightTest extends FlatSpec with Matchers // THIS DOESN'T WORK val lex = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon print(lex.size()) - + val words = List("this", "is", "a", "candidate") + tokens.populate(words) val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) // This should combine the weights val m = StructuredLearning(tokens, cls, initialize = false) From 6a271c044d0ff334ec71080ba4768f5bf4dc98ee Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 1 Jul 2016 04:47:07 +0430 Subject: [PATCH 079/118] -weight vector and factor size test --- .../saulexamples/nlp/EntityRelation/weightTest.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index 81ba5d34..9ecc3a6b 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -109,7 +109,12 @@ class weightTest extends FlatSpec with Matchers val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) // This should combine the weights val m = StructuredLearning(tokens, cls, initialize = false) -// // This should distribute the weights + + m.Factors.size should be (2) + + m.wv.getLength should be (24) + + // This should distribute the weights m.infSolver.asInstanceOf[Saul_SL_Inference[String]].updateWeights(m.wv) // } From dd9847cb767181870d10ff76ce6bd7a5bb48f6f5 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sat, 2 Jul 2016 10:37:15 +0430 Subject: [PATCH 080/118] -edited the SL-test --- .../nlp/EntityRelation/weightTest.scala | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index 9ecc3a6b..d2d976f9 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -2,7 +2,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{Saul_SL_Inference, StructuredLearning} -import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, Learnable, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier, Learnable, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.sl.util.WeightVector @@ -104,11 +104,18 @@ class weightTest extends FlatSpec with Matchers // THIS DOESN'T WORK val lex = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon print(lex.size()) - val words = List("this", "is", "a", "candidate") - tokens.populate(words) + val words_train = List("this", "is", "a", "candidate") + val words_test = List("this" , "was", "not", "true") + tokens.populate(words_train) + tokens.populate(words_test, test= true) + val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) + val cls_base = List(TestClassifier,TestBiClassifier) + + ClassifierUtils.TrainClassifiers(5, cls_base:_*) + // This should combine the weights - val m = StructuredLearning(tokens, cls, initialize = false) + val m = StructuredLearning(tokens, cls, initialize = true) m.Factors.size should be (2) From c7fa9d73ab0d05a34b2451ffc3525ce2f9f72913 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sat, 2 Jul 2016 10:41:21 +0430 Subject: [PATCH 081/118] -edited the SL-test --- .../cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index d2d976f9..f08adffe 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -107,7 +107,7 @@ class weightTest extends FlatSpec with Matchers val words_train = List("this", "is", "a", "candidate") val words_test = List("this" , "was", "not", "true") tokens.populate(words_train) - tokens.populate(words_test, test= true) + tokens.populate(words_test, train = false) val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) val cls_base = List(TestClassifier,TestBiClassifier) From 2b4b02abd271621e0eafd5fca02d48710ed2f7c6 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sat, 2 Jul 2016 11:15:59 +0430 Subject: [PATCH 082/118] -removed training -added test before and after weight split --- .../saul/classifier/SL_model/StructuredLearning.scala | 2 +- .../cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index a0d5737c..214bedfa 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -29,7 +29,7 @@ object StructuredLearning { model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - model.wv = learner.train(sp, model.wv) + // model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") return model } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index f08adffe..c48787b2 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -114,15 +114,20 @@ class weightTest extends FlatSpec with Matchers ClassifierUtils.TrainClassifiers(5, cls_base:_*) + ClassifierUtils.TestClassifiers(cls_base :_*) + // This should combine the weights val m = StructuredLearning(tokens, cls, initialize = true) + m.Factors.size should be (2) m.wv.getLength should be (24) // This should distribute the weights m.infSolver.asInstanceOf[Saul_SL_Inference[String]].updateWeights(m.wv) + + ClassifierUtils.TestClassifiers(cls_base:_*) // } From a8d697204358a70d9a572946280997827830d8ab Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 3 Jul 2016 02:11:39 +0430 Subject: [PATCH 083/118] -added a new test : combining CoNLL-SL old test with Christos String node new test --- .../saul/classifier/SL_model/Initialize.scala | 2 + .../SL_model/StructuredLearning.scala | 2 +- .../EntityRelation/EntityRelationApp_SL.scala | 1 - .../nlp/EntityRelation/SLTest2.scala | 127 ++++++++++++++++++ .../nlp/EntityRelation/weightTest.scala | 49 ++++--- 5 files changed, 154 insertions(+), 27 deletions(-) create mode 100644 saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index c081b5e3..f6adf44a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -63,9 +63,11 @@ object Initialize { val t = Array.fill[Float](temp)(0) if (initialize) { val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector + for (j <- 0 until temp) { t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] + println ("t:", t(j),"weight", getTheWeight.getWeight(j)) // if (t(j)==0) {print(j," zero/")} } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 214bedfa..70310750 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -29,7 +29,7 @@ object StructuredLearning { model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - // model.wv = learner.train(sp, model.wv) + // model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") return model } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index fcc01d8b..ff847ca6 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -20,7 +20,6 @@ object EntityRelationApp_SL extends App { val m = StructuredLearning(pairs, cls, initialize = false) println("Structured evaluation.\n") - StructuredLearning.Evaluate(pairs, cls, m, "") //ClassifierUtils.TestClassifiers(cls:_*) } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala new file mode 100644 index 00000000..5ff353ad --- /dev/null +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -0,0 +1,127 @@ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation +import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ +import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, Learnable, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.property.Property +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation +import edu.illinois.cs.cogcomp.sl.core.SLParameters +import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory +import org.scalatest.{FlatSpec, Matchers} + +/** + * Created by Parisa on 7/2/16. + */ +class SLTest2 extends FlatSpec with Matchers { + object testModel extends DataModel { + val tokens = node[String] + val pairs = edge(tokens, tokens) + val testLabel = property(tokens) { x:String => x.equals("candidate") } + val word = property(tokens) { x:String => x } + val biWord = property(tokens) { x:String => x + "-" + x } + } + // Testing the original functions with real classifiers + // "integration test" should "work" in { + // Initialize toy model + import testModel._ + object TestClassifier extends Learnable(tokens) { + def label: Property[String] = testLabel + + override def feature = using(word) + + override lazy val classifier = new SparseNetworkLBP + } + object TestBiClassifier extends Learnable(tokens) { + def label: Property[String] = testLabel + + override def feature = using(word, biWord) + + override lazy val classifier = new SparseNetworkLBP + } + object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { + def subjectTo = null + + override val pathToHead = Some(-pairs) + + override def filter(t: String, h: String): Boolean = t.equals(h) + + override val solver = new OJalgoHook + } + object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { + def subjectTo = null + + override val pathToHead = Some(-pairs) + + override def filter(t: String, h: String): Boolean = t.equals(h) + + override val solver = new OJalgoHook + } + val words_train = List("this", "is", "a", "candidate") + val words_test = List("this" , "was", "not", "true") + tokens.populate(words_train) + tokens.populate(words_test, train = false) + + val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) + val cls_base = List(TestClassifier,TestBiClassifier) + + // This should combine the weights + val m = StructuredLearning(tokens, cls, initialize = false) + + + + val SLProblem = SL_IOManager.makeSLProblem(tokens, cls) + "Structured output learning (SL)" should "get correct number of instances." in { + SLProblem.goldStructureList.size() should be(4) + SLProblem.instanceList.size() should be(4) + } + + val model = Initialize(SLProblem, new SaulSLModel(cls)) + "Structured output learning (SL) initialization" should "work." in { + model.Factors.size should be(2) + model.LTUWeightTemplates.size should be(4) + model.wv.getLength should be(24) + model.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) + } + + val xGold = SLProblem.instanceList.get(0) + val yGold = SLProblem.goldStructureList.get(0) + model.featureGenerator = new SL_FeatureGenerator(model) + + "Structured output learning (SL) Feature extraction" should "work." in { + model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum should be(3.0) + } + + val para = new SLParameters + para.loadConfigFile("./config/DCD.config") + model.para = para + model.infSolver = new Saul_SL_Inference[String](model.Factors.toList, model.LTUWeightTemplates) + val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) + + "Structured output learning's loss" should " be calculate correctly." in { + + val yTest = new Saul_SL_Label_Structure[String](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[String]].head.asInstanceOf[String]) + yTest.labels = for ( + l <- yGold.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].labels + ) yield "true" + + model.infSolver.getLoss(xGold, yGold, yGold) should be(0.00) + model.infSolver.getLoss(xGold, yGold, yTest) >= (0.8) should be(true) + } + + val weight = learner.train(SLProblem, model.wv) + "Structured output learning" should " have a correctly working inference module." in { + val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) + val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) + model.infSolver.getLoss(xGold, yGold, yPredicted) should be(0.00) + model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) + (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. + asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) + } + + "Structured output learning (SL)" should "really work in Saul." in { + + } + + // } +} + diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index c48787b2..46aee484 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -1,8 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation - import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{Saul_SL_Inference, StructuredLearning} -import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier, Learnable, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, Learnable, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.sl.util.WeightVector @@ -10,11 +10,7 @@ import org.scalatest.{FlatSpec, Matchers} import scala.collection.mutable.ListBuffer -/** - * Created by Parisa on 6/30/16. - */ -class weightTest extends FlatSpec with Matchers -{ +class weightTest extends FlatSpec with Matchers { "weights initializer" should "join multiple weight vectors" in { var lt: ListBuffer[Array[Float]] = ListBuffer() @@ -101,34 +97,37 @@ class weightTest extends FlatSpec with Matchers override val solver = new OJalgoHook } - // THIS DOESN'T WORK - val lex = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon - print(lex.size()) - val words_train = List("this", "is", "a", "candidate") - val words_test = List("this" , "was", "not", "true") - tokens.populate(words_train) - tokens.populate(words_test, train = false) + val words = List("this", "is", "a", "test") + tokens.populate(words) val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) - val cls_base = List(TestClassifier,TestBiClassifier) - - ClassifierUtils.TrainClassifiers(5, cls_base:_*) - - ClassifierUtils.TestClassifiers(cls_base :_*) - // This should combine the weights - val m = StructuredLearning(tokens, cls, initialize = true) + val m = StructuredLearning(tokens, cls, initialize = false) + + val clNet1 = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val clNet2 = TestBiConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val wv1 = clNet1.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector + val wv2 = clNet2.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector m.Factors.size should be (2) - m.wv.getLength should be (24) + wv1.size() should be (4) + wv2.size() should be (8) + // Combined size should be 12 + m.wv.getLength should be (12) - // This should distribute the weights + // This should distribute the weights m.infSolver.asInstanceOf[Saul_SL_Inference[String]].updateWeights(m.wv) - ClassifierUtils.TestClassifiers(cls_base:_*) -// + val wv1After = clNet1.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector + val wv2After = clNet2.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector + + //Everything should be the same + wv1After.size() should be (4) + wv2After.size() should be (8) + // Combined size should be 12 + m.wv.getLength should be (12) } object testModel extends DataModel { From 3b026481f08e8853d01b6a97879b19c6b3209461 Mon Sep 17 00:00:00 2001 From: kordjam Date: Thu, 7 Jul 2016 20:57:27 +0430 Subject: [PATCH 084/118] -added some prints and check values for tests --- .../saul/classifier/SL_model/Initialize.scala | 2 +- .../SL_model/Saul_SL_Inference.scala | 30 ++++++++++++++----- .../SL_model/StructuredLearning.scala | 21 +++++++++++-- .../EntityRelation/EntityRelationApp_SL.scala | 12 ++++++-- .../nlp/EntityRelation/SLTest2.scala | 26 ++++++++++++++-- 5 files changed, 74 insertions(+), 17 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index f6adf44a..318cc94d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -67,7 +67,7 @@ object Initialize { for (j <- 0 until temp) { t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] - println ("t:", t(j),"weight", getTheWeight.getWeight(j)) + // println ("t:", t(j),"weight", getTheWeight.getWeight(j)) // if (t(j)==0) {print(j," zero/")} } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 97966843..920b6e3c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,8 +1,8 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit -import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, SparseNetworkLBP } -import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } +import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector import scala.Array._ @@ -82,16 +82,30 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.size()) { val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector print("w", ltu_count, " size:\t", w1.size) - val myFactorJoinlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) - - val exampleFeatureIndexes = ofDim[Int](myFactorJoinlyTrainedWeight.length) - for (featureIndex <- 0 until myFactorJoinlyTrainedWeight.length) { - exampleFeatureIndexes(featureIndex) = featureIndex; + val per1 = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector + // val originalWeightSize = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() + var myFactorJointlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) + var count = 0 + for(k<-0 until per1.size()){ + if(per1.getWeight(k)!= myFactorJointlyTrainedWeight(k)){ + println("different!",per1.getWeight(k)," and ", myFactorJointlyTrainedWeight(k)) + count = count +1 + } } + // for (count <- cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() until w1.size) + // myFactorJointlyTrainedWeight = myFactorJointlyTrainedWeight :+ 0.asInstanceOf[Float] + // if (cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size()!= w1.size) { + // println("size mismatch!", cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size(), ",", w1.size) + // } + // val exampleFeatureIndexes = ofDim[Int](myFactorJointlyTrainedWeight.length) + val exampleFeatureIndexes = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.getMap.values.toArray.map(_.asInstanceOf[Int])//.toArray//.toArray().asInstanceOf[Array[Int]] +// for (featureIndex <- 0 until myFactorJointlyTrainedWeight.length) { +// exampleFeatureIndexes(featureIndex) = featureIndex //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; +// } val p = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] p.weightVector.clear() - p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJoinlyTrainedWeight), 0.0) + p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) offset = offset + ltuTemplates(ltu_count).length diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 70310750..1ac58b2e 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, ConstrainedClassifier } +import edu.illinois.cs.cogcomp.saul.classifier.{SparseNetworkLBP, ClassifierUtils, ConstrainedClassifier} import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner._ @@ -29,7 +29,7 @@ object StructuredLearning { model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - // model.wv = learner.train(sp, model.wv) + model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") return model } @@ -46,10 +46,27 @@ object StructuredLearning { //val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](node, cls, testing = true) + println("Before weight update:") + val results1 = for (cf <- myModel.Factors.toList.asInstanceOf[List[ConstrainedClassifier[_ <: AnyRef, HEAD]]]) yield { + Eval1(cf, sp) + } + val per1 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector + val per2 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(1).getWeightVector + + println("after weight update:") + myModel.Factors.toList.asInstanceOf[List[ConstrainedClassifier[_ <: AnyRef, HEAD]]] myModel.infSolver.asInstanceOf[Saul_SL_Inference[HEAD]].updateWeights(myModel.wv) val results = for (cf <- myModel.Factors.toList.asInstanceOf[List[ConstrainedClassifier[_ <: AnyRef, HEAD]]]) yield { Eval1(cf, sp) } + + val per3 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector + val per4 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(1).getWeightVector + for (k<- 0 until per3.size()) + { + if( per3.getWeight(k)!= per1.getWeight(k)) + print("different", k,"\t") + } //ClassifierUtils.TestClassifiers.aggregate(results) } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index ff847ca6..db0366bb 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -13,14 +13,20 @@ object EntityRelationApp_SL extends App { ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + val cls_base= List(PersonClassifier, OrganizationClassifier, LocationClassifier, + LivesInClassifier, WorksForClassifier) + + ClassifierUtils.TestClassifiers(cls_base:_*) + val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - ClassifierUtils.TestClassifiers(cls: _*) + //ClassifierUtils.TestClassifiers(cls: _*) - val m = StructuredLearning(pairs, cls, initialize = false) + val m = StructuredLearning(pairs, cls, initialize = true) println("Structured evaluation.\n") + StructuredLearning.Evaluate(pairs, cls, m, "") - //ClassifierUtils.TestClassifiers(cls:_*) + //ClassifierUtils.TestClassifiers(cls_base:_*) } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index 5ff353ad..3e2ebc17 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, Learnable, SparseNetworkLBP} +import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier, Learnable, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation @@ -76,7 +76,7 @@ class SLTest2 extends FlatSpec with Matchers { } val model = Initialize(SLProblem, new SaulSLModel(cls)) - "Structured output learning (SL) initialization" should "work." in { + "Structured output learning (SL) initialization with zero" should "work." in { model.Factors.size should be(2) model.LTUWeightTemplates.size should be(4) model.wv.getLength should be(24) @@ -91,7 +91,27 @@ class SLTest2 extends FlatSpec with Matchers { model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum should be(3.0) } - val para = new SLParameters + ClassifierUtils.TrainClassifiers(5, cls_base :_*) + val InitializedModel = Initialize(SLProblem, new SaulSLModel(cls), initialize = true) + "Structured output learning (SL) initialization with trained models" should "work." in { + println("Factors:",InitializedModel.Factors.size) + println("LTUs:",InitializedModel.LTUWeightTemplates.size) + println("modellength:",InitializedModel.wv.getLength) + println("weightArray:",InitializedModel.wv.getWeightArray) + InitializedModel.Factors.size should be(2) + InitializedModel.LTUWeightTemplates.size should be(4) + InitializedModel.wv.getLength should be(24) + + InitializedModel.Factors.foreach( + x=> { + x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector.eq(cls_base(0).classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector) should be(true) + x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(1).getWeightVector.eq(cls_base(1).classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector) should be(true) + }) + //InitializedModel.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) + + } + + val para = new SLParameters para.loadConfigFile("./config/DCD.config") model.para = para model.infSolver = new Saul_SL_Inference[String](model.Factors.toList, model.LTUWeightTemplates) From 5486800cb2d4053cc83dfd280f050dcd0b0d44c9 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 8 Jul 2016 21:25:30 +0430 Subject: [PATCH 085/118] -removed the intermediate variable for weight update --- .../SL_model/Saul_SL_Inference.scala | 40 ++++++++++--------- .../SL_model/StructuredLearning.scala | 2 +- .../EntityRelation/EntityRelationApp_SL.scala | 2 +- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 920b6e3c..3dccf632 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -1,6 +1,5 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, SparseNetworkLBP} import edu.illinois.cs.cogcomp.sl.core.{AbstractInferenceSolver, IInstance, IStructure} import edu.illinois.cs.cogcomp.sl.util.WeightVector @@ -82,32 +81,35 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.size()) { val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector print("w", ltu_count, " size:\t", w1.size) - val per1 = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector + // val per1 = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector // val originalWeightSize = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() - var myFactorJointlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) - var count = 0 - for(k<-0 until per1.size()){ - if(per1.getWeight(k)!= myFactorJointlyTrainedWeight(k)){ - println("different!",per1.getWeight(k)," and ", myFactorJointlyTrainedWeight(k)) - count = count +1 - } - } + val myFactorJointlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) + // var count = 0 // for (count <- cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() until w1.size) // myFactorJointlyTrainedWeight = myFactorJointlyTrainedWeight :+ 0.asInstanceOf[Float] // if (cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size()!= w1.size) { // println("size mismatch!", cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size(), ",", w1.size) // } - // val exampleFeatureIndexes = ofDim[Int](myFactorJointlyTrainedWeight.length) - val exampleFeatureIndexes = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.getMap.values.toArray.map(_.asInstanceOf[Int])//.toArray//.toArray().asInstanceOf[Array[Int]] -// for (featureIndex <- 0 until myFactorJointlyTrainedWeight.length) { -// exampleFeatureIndexes(featureIndex) = featureIndex //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; -// } + val exampleFeatureIndexes = ofDim[Int](myFactorJointlyTrainedWeight.length) + // val exampleFeatureIndexes = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.getMap.values.toArray.map(_.asInstanceOf[Int])//.toArray//.toArray().asInstanceOf[Array[Int]] + for (featureIndex <- 0 until myFactorJointlyTrainedWeight.length) { + exampleFeatureIndexes(featureIndex) = featureIndex //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; + } - val p = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters] - p.weightVector.clear() - p.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) - cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].setParameters(p) + //val p = + cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.clear()//.getParameters.asInstanceOf[LinearThresholdUnit.Parameters] + // p.weightVector.clear() + // p.weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) + cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) + //val per2 = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector + +// for(k<-0 until per1.size()){ +// if(per1.getWeight(k)!= per2.getWeight(k)){ +// println("different!",per1.getWeight(k)," and ",per2.getWeight(k)) +// // count = count +1 +// } +// } offset = offset + ltuTemplates(ltu_count).length ltu_count = ltu_count + 1 } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 1ac58b2e..932ad7fa 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -29,7 +29,7 @@ object StructuredLearning { model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - model.wv = learner.train(sp, model.wv) + // model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") return model } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index db0366bb..26c8ddf3 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -27,6 +27,6 @@ object EntityRelationApp_SL extends App { println("Structured evaluation.\n") StructuredLearning.Evaluate(pairs, cls, m, "") - //ClassifierUtils.TestClassifiers(cls_base:_*) + ClassifierUtils.TestClassifiers(cls_base:_*) } From 90342ad6c00d1a1858135c48814aa5f4046fc12e Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 13 Jul 2016 00:54:37 +0430 Subject: [PATCH 086/118] -updated LBJava version -updated cogcomp.nlp version -updated the new package namings of LBjava -fixed the setWeight initialization -fixed the weightUpdate -removed the debug printing messages -populate with actual data --- build.sbt | 4 +-- .../classifier/ConstrainedClassifier.scala | 7 ++-- .../cogcomp/saul/classifier/Learnable.scala | 2 +- .../saul/classifier/SL_model/Initialize.scala | 14 ++++---- .../classifier/SL_model/SaulSLModel.scala | 2 +- .../SL_model/Saul_SL_Inference.scala | 33 +++++++------------ .../SL_model/StructuredLearning.scala | 21 ++---------- .../classifier/infer/InferenceCondition.scala | 4 +-- .../saul/classifier/infer/JointTemplate.scala | 4 ++- .../saul/constraint/LfsConstraint.scala | 5 +-- .../cs/cogcomp/saul/datamodel/DataModel.scala | 2 +- .../cs/cogcomp/saul/datamodel/edge/Link.scala | 2 +- .../cs/cogcomp/saul/datamodel/node/Node.scala | 7 ++-- .../EntityRelation/EntityRelationApp_SL.scala | 10 +++--- ...EntityRelationConstrainedClassifiers.scala | 5 ++- .../nlp/POSTagger/POSTaggerApps.scala | 3 +- .../SRLConstrainedClassifiers.scala | 2 +- .../setcover/SetCoverDataModel.scala | 2 +- .../InferenceQuantifierTests.scala | 2 +- .../nlp/EntityRelation/SLTest2.scala | 2 +- .../nlp/EntityRelation/weightTest.scala | 2 +- 21 files changed, 54 insertions(+), 81 deletions(-) diff --git a/build.sbt b/build.sbt index 0a8b8e9f..4457a6a6 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,4 @@ -val cogcompNLPVersion = "3.0.20" +val cogcompNLPVersion = "3.0.55" val cogcompPipelineVersion = "0.1.16" lazy val root = (project in file(".")). @@ -15,7 +15,7 @@ lazy val commonSettings = Seq( ), javaOptions ++= List("-Xmx11g"), libraryDependencies ++= Seq( - "edu.illinois.cs.cogcomp" % "LBJava" % "1.2.20" withSources(), + "edu.illinois.cs.cogcomp" % "LBJava" % "1.2.24" withSources(), "edu.illinois.cs.cogcomp" % "illinois-core-utilities" % cogcompNLPVersion withSources, "com.gurobi" % "gurobi" % "6.0", "org.apache.commons" % "commons-math3" % "3.0", diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 5796bc9c..c2a6e48c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -1,14 +1,15 @@ package edu.illinois.cs.cogcomp.saul.classifier -import edu.illinois.cs.cogcomp.lbjava.classify.{ Classifier, FeatureVector, TestDiscrete } -import edu.illinois.cs.cogcomp.lbjava.infer._ +import edu.illinois.cs.cogcomp.infer.ilp.{GurobiHook, ILPSolver, OJalgoHook} +import edu.illinois.cs.cogcomp.lbjava.classify.{Classifier, FeatureVector, TestDiscrete} +import edu.illinois.cs.cogcomp.lbjava.infer.{FirstOrderConstraint, InferenceManager} import edu.illinois.cs.cogcomp.lbjava.learn.Learner import edu.illinois.cs.cogcomp.saul.TestWithStorage import edu.illinois.cs.cogcomp.saul.classifier.SL_model.LossAugmentedNormalizer import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint import edu.illinois.cs.cogcomp.saul.datamodel.edge.Edge -import edu.illinois.cs.cogcomp.saul.lbjrelated.{ LBJClassifierEquivalent, LBJLearnerEquivalent } +import edu.illinois.cs.cogcomp.saul.lbjrelated.{LBJClassifierEquivalent, LBJLearnerEquivalent} import edu.illinois.cs.cogcomp.saul.parser.IterableToLBJavaParser import scala.collection.mutable.ListBuffer diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala index 9a2ea542..7ed98547 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/Learnable.scala @@ -9,7 +9,7 @@ import edu.illinois.cs.cogcomp.lbjava.learn.Learner.Parameters import edu.illinois.cs.cogcomp.lbjava.learn._ import edu.illinois.cs.cogcomp.lbjava.parse.{ Parser, FoldParser } import edu.illinois.cs.cogcomp.lbjava.parse.FoldParser.SplitPolicy -import edu.illinois.cs.cogcomp.lbjava.util.ExceptionlessOutputStream +import edu.illinois.cs.cogcomp.core.datastructures.vectors.ExceptionlessOutputStream//.lbjava.util.ExceptionlessOutputStream import edu.illinois.cs.cogcomp.saul.TestContinuous import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.edge.Link diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 318cc94d..1971f43d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -1,4 +1,5 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model + import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP import edu.illinois.cs.cogcomp.sl.core.SLProblem @@ -60,19 +61,18 @@ object Initialize { val temp = (sparseNet.getLexicon.size()) for (i <- 0 until sparseNet.getNetwork.size()) { + + val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector val t = Array.fill[Float](temp)(0) + if (initialize) { - val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector - for (j <- 0 until temp) { + for (j <- 0 until temp) + t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] - t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] - // println ("t:", t(j),"weight", getTheWeight.getWeight(j)) - // if (t(j)==0) {print(j," zero/")} - } } + lt = lt :+ t - lt = lt :+ t wvLength = wvLength + temp } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala index 8637c4f3..151a5ed4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala @@ -3,7 +3,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import java.io.{ BufferedOutputStream, FileOutputStream, ObjectOutputStream } import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } +import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} import scala.collection.mutable.ListBuffer diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 3dccf632..867e4330 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -28,7 +28,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H val myGold = gold.asInstanceOf[Saul_SL_Label_Structure[HEAD]] val myPred = pred.asInstanceOf[Saul_SL_Label_Structure[HEAD]] var count = 0 - println(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) + // println(ins.asInstanceOf[Saul_SL_Instance[HEAD]].head) a.foreach { x => var localLoss = 0 @@ -44,7 +44,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H TotalLoss = TotalLoss + localLoss / candidates.size } TotalLoss = TotalLoss / factors.size - println("Loss=" + TotalLoss) + //println("Loss=" + TotalLoss) TotalLoss } @@ -80,9 +80,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H cf => for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.size()) { val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector - print("w", ltu_count, " size:\t", w1.size) - // val per1 = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector - // val originalWeightSize = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() + // print("w", ltu_count, " size:\t", w1.size) val myFactorJointlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) // var count = 0 // for (count <- cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() until w1.size) @@ -91,25 +89,16 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H // println("size mismatch!", cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size(), ",", w1.size) // } val exampleFeatureIndexes = ofDim[Int](myFactorJointlyTrainedWeight.length) + cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.clear() // val exampleFeatureIndexes = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.getMap.values.toArray.map(_.asInstanceOf[Int])//.toArray//.toArray().asInstanceOf[Array[Int]] for (featureIndex <- 0 until myFactorJointlyTrainedWeight.length) { - exampleFeatureIndexes(featureIndex) = featureIndex //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; + exampleFeatureIndexes(featureIndex) = featureIndex + cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.setWeight(featureIndex,myFactorJointlyTrainedWeight(featureIndex)) + //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; } - //val p = - cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.clear()//.getParameters.asInstanceOf[LinearThresholdUnit.Parameters] - // p.weightVector.clear() - // p.weightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) - cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) - - //val per2 = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector - -// for(k<-0 until per1.size()){ -// if(per1.getWeight(k)!= per2.getWeight(k)){ -// println("different!",per1.getWeight(k)," and ",per2.getWeight(k)) -// // count = count +1 -// } -// } + //.getParameters.asInstanceOf[LinearThresholdUnit.Parameters] + // cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) offset = offset + ltuTemplates(ltu_count).length ltu_count = ltu_count + 1 } @@ -127,9 +116,9 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H cf.getCandidates(myIns.head).foreach { x => //print(cf.onClassifier.classifier.name.substring(80) + "\t") - print("gt:" + cf.onClassifier.classifier.getLabeler.discreteValue(x)) + //print("gt:" + cf.onClassifier.classifier.getLabeler.discreteValue(x)) myStruct.labels(labelCount) = cf.onClassifier.classifier.discreteValue(x) - println("\tmvc:" + myStruct.labels(labelCount)) + //println("\tmvc:" + myStruct.labels(labelCount)) labelCount = labelCount + 1 } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 932ad7fa..c5a118c6 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.{SparseNetworkLBP, ClassifierUtils, ConstrainedClassifier} +import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier} import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.core._ import edu.illinois.cs.cogcomp.sl.learner._ @@ -29,7 +29,7 @@ object StructuredLearning { model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); - // model.wv = learner.train(sp, model.wv) + model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") return model } @@ -37,37 +37,20 @@ object StructuredLearning { def Eval1[T <: AnyRef, H <: AnyRef](cf: ConstrainedClassifier[T, H], sp: SLProblem) = { val testExamples: Seq[T] = sp.instanceList.map(x => cf.getCandidates(x.asInstanceOf[Saul_SL_Instance[H]].head)).flatten.distinct - //val testExamples: Seq[T] = cf.getCandidates(sp.instanceList.map(_.asInstanceOf[Saul_SL_Instance[H]].head)).asInstanceOf[Seq[cf.LEFT]] ClassifierUtils.TestClassifiers.apply1(testExamples, cf) } - - //// def Evaluate[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_ <: AnyRef, HEAD]], myModel: SaulSLModel[HEAD], modelPath: String)(implicit t: ClassTag[HEAD]): Unit = { - //val myModel = SLModel.loadModel(modelPath).asInstanceOf[SaulSLModel[HEAD]] val sp: SLProblem = SL_IOManager.makeSLProblem[HEAD](node, cls, testing = true) println("Before weight update:") val results1 = for (cf <- myModel.Factors.toList.asInstanceOf[List[ConstrainedClassifier[_ <: AnyRef, HEAD]]]) yield { Eval1(cf, sp) } - val per1 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector - val per2 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(1).getWeightVector - println("after weight update:") - myModel.Factors.toList.asInstanceOf[List[ConstrainedClassifier[_ <: AnyRef, HEAD]]] myModel.infSolver.asInstanceOf[Saul_SL_Inference[HEAD]].updateWeights(myModel.wv) val results = for (cf <- myModel.Factors.toList.asInstanceOf[List[ConstrainedClassifier[_ <: AnyRef, HEAD]]]) yield { Eval1(cf, sp) } - - val per3 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector - val per4 = myModel.Factors.toList.get(0).onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(1).getWeightVector - for (k<- 0 until per3.size()) - { - if( per3.getWeight(k)!= per1.getWeight(k)) - print("different", k,"\t") - } - //ClassifierUtils.TestClassifiers.aggregate(results) } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala index 898dcd13..a3c6d235 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InferenceCondition.scala @@ -1,9 +1,9 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer -import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint } +import edu.illinois.cs.cogcomp.lbjava.infer.{ ParameterizedConstraint } import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Learner, Normalizer } import edu.illinois.cs.cogcomp.saul.constraint.LfsConstraint - +import edu.illinois.cs.cogcomp.infer.ilp.ILPSolver import scala.reflect.ClassTag abstract class InferenceCondition[INPUT <: AnyRef, HEAD <: AnyRef](solver: ILPSolver, normalize: Normalizer = new IdentityNormalizer)( diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala index d6780a03..c9b9eb92 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala @@ -1,6 +1,8 @@ package edu.illinois.cs.cogcomp.saul.classifier.infer -import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint, ILPInference } +import edu.illinois.cs.cogcomp.lbjava.infer.{ILPInference, ParameterizedConstraint} + +import edu.illinois.cs.cogcomp.infer.ilp.{ILPSolver} import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Normalizer, Learner } abstract class JointTemplate[T](head: T, solver: ILPSolver, norm: Normalizer = new IdentityNormalizer) extends ILPInference(head, solver) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala index 63e7c7a2..e6df6376 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/constraint/LfsConstraint.scala @@ -1,11 +1,12 @@ package edu.illinois.cs.cogcomp.saul.constraint -import edu.illinois.cs.cogcomp.lbjava.infer.{ ILPSolver, ParameterizedConstraint, FirstOrderConstraint } +import edu.illinois.cs.cogcomp.lbjava.infer.{ ParameterizedConstraint, FirstOrderConstraint } import edu.illinois.cs.cogcomp.lbjava.learn.{ IdentityNormalizer, Normalizer } import edu.illinois.cs.cogcomp.saul.classifier.infer.InferenceCondition - +import edu.illinois.cs.cogcomp.infer.ilp.ILPSolver import scala.reflect.ClassTag + abstract class LfsConstraint[T <: AnyRef](implicit val tag: ClassTag[T]) { def makeConstrainDef(x: T): FirstOrderConstraint diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala index e10f64af..955d72c4 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/DataModel.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.datamodel -import edu.illinois.cs.cogcomp.lbjava.util.{ ExceptionlessInputStream, ExceptionlessOutputStream } +import edu.illinois.cs.cogcomp.core.datastructures.vectors.{ExceptionlessInputStream, ExceptionlessOutputStream } import edu.illinois.cs.cogcomp.saul.datamodel.edge.{ AsymmetricEdge, Edge, Link, SymmetricEdge } import edu.illinois.cs.cogcomp.saul.datamodel.node.{ JoinNode, Node, NodeProperty } import edu.illinois.cs.cogcomp.saul.datamodel.property.features.discrete._ diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala index bffdb2a2..2cd8de16 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/edge/Link.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saul.datamodel.edge -import edu.illinois.cs.cogcomp.lbjava.util.{ ExceptionlessInputStream, ExceptionlessOutputStream } +import edu.illinois.cs.cogcomp.core.datastructures.vectors.{ ExceptionlessInputStream, ExceptionlessOutputStream } import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import scala.collection.mutable diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/node/Node.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/node/Node.scala index 22e244be..5acc1f29 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/node/Node.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/datamodel/node/Node.scala @@ -1,14 +1,13 @@ package edu.illinois.cs.cogcomp.saul.datamodel.node +import edu.illinois.cs.cogcomp.core.datastructures.vectors.{ExceptionlessInputStream, ExceptionlessOutputStream} import edu.illinois.cs.cogcomp.lbjava.classify.FeatureVector -import edu.illinois.cs.cogcomp.lbjava.util.{ ExceptionlessInputStream, ExceptionlessOutputStream } -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.edge.Edge import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saul.datamodel.property.features.discrete.DiscreteProperty -import edu.illinois.cs.cogcomp.saul.datamodel.edge.Edge -import scala.collection.mutable.{ HashMap => MutableHashMap, Map => MutableMap, LinkedHashSet => MutableSet, ListBuffer, ArrayBuffer } import scala.collection.mutable +import scala.collection.mutable.{ArrayBuffer, HashMap => MutableHashMap, LinkedHashSet => MutableSet, ListBuffer, Map => MutableMap} import scala.reflect.ClassTag trait NodeProperty[T <: AnyRef] extends Property[T] { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 26c8ddf3..4d8af761 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -9,12 +9,11 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDat */ object EntityRelationApp_SL extends App { - EntityRelationDataModel.populateWithConllSmallSet() + EntityRelationDataModel.populateWithConll() ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) - val cls_base= List(PersonClassifier, OrganizationClassifier, LocationClassifier, - LivesInClassifier, WorksForClassifier) + val cls_base= List(PersonClassifier, OrganizationClassifier, LocationClassifier, LivesInClassifier, WorksForClassifier) ClassifierUtils.TestClassifiers(cls_base:_*) @@ -23,10 +22,11 @@ object EntityRelationApp_SL extends App { //ClassifierUtils.TestClassifiers(cls: _*) - val m = StructuredLearning(pairs, cls, initialize = true) + val m = StructuredLearning(pairs, cls, initialize = false) + println("Structured evaluation.\n") StructuredLearning.Evaluate(pairs, cls, m, "") - ClassifierUtils.TestClassifiers(cls_base:_*) + // ClassifierUtils.TestClassifiers(cls_base:_*) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala index 3f109cdd..77d8d1d6 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala @@ -1,9 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawToken, ConllRelation } -import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ConllRawToken, ConllRelation} import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstraints._ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSTaggerApps.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSTaggerApps.scala index 511dcbdb..6c1dbabb 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSTaggerApps.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/POSTagger/POSTaggerApps.scala @@ -4,13 +4,12 @@ import edu.illinois.cs.cogcomp.core.datastructures.textannotation.Constituent import edu.illinois.cs.cogcomp.core.utilities.configuration.{ Property, ResourceManager, Configurator } import edu.illinois.cs.cogcomp.lbj.pos.POSLabeledUnknownWordParser import edu.illinois.cs.cogcomp.lbjava.classify.TestDiscrete -import edu.illinois.cs.cogcomp.nlp.corpusreaders.PennTreebankPOSReader import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.parser.IterableToLBJavaParser import edu.illinois.cs.cogcomp.saulexamples.nlp.POSTagger.POSClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.POSTagger.POSDataModel._ import edu.illinois.cs.cogcomp.saulexamples.nlp.CommonSensors - +import edu.illinois.cs.cogcomp.nlp.corpusreaders._ import scala.collection.JavaConversions._ object POSConfigurator extends Configurator { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/SRLConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/SRLConstrainedClassifiers.scala index f1fb10ee..69bbd99b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/SRLConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/SRLConstrainedClassifiers.scala @@ -1,7 +1,7 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.SemanticRoleLabeling import edu.illinois.cs.cogcomp.core.datastructures.textannotation.{ Relation, TextAnnotation } -import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saulexamples.nlp.SemanticRoleLabeling.SRLClassifiers.{ argumentTypeLearner, argumentXuIdentifierGivenApredicate } import edu.illinois.cs.cogcomp.saulexamples.nlp.SemanticRoleLabeling.SRLConstraints._ diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/setcover/SetCoverDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/setcover/SetCoverDataModel.scala index c33a143b..e268e6ec 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/setcover/SetCoverDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/setcover/SetCoverDataModel.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saulexamples.setcover -import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/InferenceQuantifierTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/InferenceQuantifierTests.scala index 82312f26..903c4720 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/InferenceQuantifierTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/InferenceQuantifierTests.scala @@ -1,6 +1,6 @@ package edu.illinois.cs.cogcomp.saulexamples -import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ import edu.illinois.cs.cogcomp.saul.datamodel.DataModel diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index 3e2ebc17..4daa46fa 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -1,5 +1,5 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier, Learnable, SparseNetworkLBP} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index 46aee484..debec79c 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -1,5 +1,5 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.lbjava.infer.OJalgoHook +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{Saul_SL_Inference, StructuredLearning} import edu.illinois.cs.cogcomp.saul.classifier.{ConstrainedClassifier, Learnable, SparseNetworkLBP} From 1e240c1adbf1cf6b9ad6c3f148540b32289c32a8 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 29 Jul 2016 09:10:00 -0500 Subject: [PATCH 087/118] -temporary debugging changes -fixed the constrained classify call -fixed a bug in the label counter for the output labels --- .../SL_model/SL_FeatureGenerator.scala | 18 ++++++++------ .../SL_model/Saul_SL_Inference.scala | 24 +++++++++---------- .../SL_model/StructuredLearning.scala | 3 ++- .../EntityRelation/EntityRelationApp.scala | 2 +- .../EntityRelation/EntityRelationApp_SL.scala | 11 +++++---- ...EntityRelationConstrainedClassifiers.scala | 12 +++++----- .../EntityRelationConstraints.scala | 10 ++++++-- .../PopulateSRLDataModel.scala | 2 +- 8 files changed, 47 insertions(+), 35 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 0d8a0e50..a5a41e0b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -14,6 +14,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst val fv = new FeatureVectorBuffer() var ltuNum = 0 var factorOffset = 0 + var labelCount = 0 //The features vectors are generated per classifier with local indexes and then the indexes are adjusted globally @@ -23,26 +24,29 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst val candis: Seq[_] = cf.getCandidates(myX.head) val sparseNet = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] val fvLocal = new FeatureVectorBuffer() - var localOffset = 0 - candis.zipWithIndex.foreach { - case (ci, indC) => + + + candis.foreach { + (ci) => + var localOffset = 0 val a = sparseNet.getExampleArray(ci, false) var a0 = a(0).asInstanceOf[Array[Int]] var a1 = a(1).asInstanceOf[Array[Double]] val fvTemp = new FeatureVectorBuffer(a0, a1) - val lab = myY.labels(indC) + val lab = myY.labels(labelCount) + labelCount = labelCount +1 //keep the features for the on label (at netI index) and repeat a zero feature vector for the off labels for (netI <- 0 until sparseNet.getNetwork.size()) { - if (netI != 0) + if (netI != 0) localOffset = localOffset + model.LTUWeightTemplates(ltuNum + netI - 1).length - else localOffset = 0 + // else localOffset = 0 if (!sparseNet.getLabelLexicon.lookupKey(netI).valueEquals(lab)) { a1 = Array() a0 = Array() fvLocal.addFeature(new FeatureVectorBuffer(a0, a1), localOffset) } else fvLocal.addFeature(fvTemp, localOffset) - val p = fvLocal.toFeatureVector + //val p = fvLocal.toFeatureVector } } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 867e4330..95c8a4ba 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -79,26 +79,26 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H a.foreach { cf => for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.size()) { - val w1 = ltuTemplates(ltu_count) //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector - // print("w", ltu_count, " size:\t", w1.size) - val myFactorJointlyTrainedWeight = weight.getWeightArray.slice(offset, offset + w1.size) + val ltuSize = ltuTemplates(ltu_count).size //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector + // print("w", ltu_count, " size:\t", ltuSize.size) + val myLTUJointlyTrainedWeight = weight.getWeightArray.slice(offset, offset + ltuSize) // var count = 0 - // for (count <- cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() until w1.size) - // myFactorJointlyTrainedWeight = myFactorJointlyTrainedWeight :+ 0.asInstanceOf[Float] - // if (cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size()!= w1.size) { - // println("size mismatch!", cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size(), ",", w1.size) + // for (count <- cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() until ltuSize.size) + // myLTUJointlyTrainedWeight = myLTUJointlyTrainedWeight :+ 0.asInstanceOf[Float] + // if (cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size()!= ltuSize.size) { + // println("size mismatch!", cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size(), ",", ltuSize.size) // } - val exampleFeatureIndexes = ofDim[Int](myFactorJointlyTrainedWeight.length) + val exampleFeatureIndexes = ofDim[Int](myLTUJointlyTrainedWeight.length) cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.clear() // val exampleFeatureIndexes = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.getMap.values.toArray.map(_.asInstanceOf[Int])//.toArray//.toArray().asInstanceOf[Array[Int]] - for (featureIndex <- 0 until myFactorJointlyTrainedWeight.length) { + for (featureIndex <- 0 until myLTUJointlyTrainedWeight.length) { exampleFeatureIndexes(featureIndex) = featureIndex - cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.setWeight(featureIndex,myFactorJointlyTrainedWeight(featureIndex)) + cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.setWeight(featureIndex,myLTUJointlyTrainedWeight(featureIndex)) //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; } //.getParameters.asInstanceOf[LinearThresholdUnit.Parameters] - // cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myFactorJointlyTrainedWeight), 1.0) + // cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myLTUJointlyTrainedWeight), 1.0) offset = offset + ltuTemplates(ltu_count).length ltu_count = ltu_count + 1 } @@ -117,7 +117,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H x => //print(cf.onClassifier.classifier.name.substring(80) + "\t") //print("gt:" + cf.onClassifier.classifier.getLabeler.discreteValue(x)) - myStruct.labels(labelCount) = cf.onClassifier.classifier.discreteValue(x) + myStruct.labels(labelCount) = cf.classifier.discreteValue(x)//.onClassifier.classifier.discreteValue(x) //println("\tmvc:" + myStruct.labels(labelCount)) labelCount = labelCount + 1 } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index c5a118c6..4792ba72 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -25,9 +25,10 @@ object StructuredLearning { // para.INNER_STOP_CONDITION= 0.0001f // para.C_FOR_STRUCTURE = 1 // para.CHECK_INFERENCE_OPT = false - model.para = para + model.featureGenerator = new SL_FeatureGenerator(model) para.loadConfigFile("./config/DCD.config") + model.para = para val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); model.wv = learner.train(sp, model.wv) model.saveModel("SL_ER_Model.txt") diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala index a6d4d1c1..ec983456 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala @@ -12,7 +12,7 @@ object EntityRelationApp { def main(args: Array[String]): Unit = { /** Choose the experiment you're interested in by changing the following line */ - val testType = ERExperimentType.JointTraining + val testType = ERExperimentType.LPlusI//.JointTraining testType match { case ERExperimentType.IndependentClassifiers => trainIndependentClassifiers() diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 4d8af761..ed76124d 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -9,18 +9,19 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDat */ object EntityRelationApp_SL extends App { - EntityRelationDataModel.populateWithConll() + EntityRelationDataModel.populateWithConllSmallSet() //.populateWithConll() - ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + //ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) val cls_base= List(PersonClassifier, OrganizationClassifier, LocationClassifier, LivesInClassifier, WorksForClassifier) - ClassifierUtils.TestClassifiers(cls_base:_*) + ClassifierUtils.TrainClassifiers(10, cls_base) + // ClassifierUtils.TestClassifiers(cls_base:_*) val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, - LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) + LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - //ClassifierUtils.TestClassifiers(cls: _*) + ClassifierUtils.TestClassifiers(cls: _*) val m = StructuredLearning(pairs, cls, initialize = false) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala index 77d8d1d6..9fe95d1c 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstrainedClassifiers.scala @@ -10,33 +10,33 @@ object EntityRelationConstrainedClassifiers { val erSolver = new OJalgoHook object OrgConstrainedClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](OrganizationClassifier) { - def subjectTo = relationArgumentConstraints + def subjectTo = dummyConst //relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo2ndArg) override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 override val solver = erSolver } object PerConstrainedClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](PersonClassifier) { - def subjectTo = relationArgumentConstraints + def subjectTo = dummyConst // relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo1stArg) override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId1 override val solver = erSolver } object LocConstrainedClassifier extends ConstrainedClassifier[ConllRawToken, ConllRelation](LocationClassifier) { - def subjectTo = relationArgumentConstraints + def subjectTo = dummyConst // relationArgumentConstraints override val pathToHead = Some(-EntityRelationDataModel.pairTo2ndArg) override def filter(t: ConllRawToken, h: ConllRelation): Boolean = t.wordId == h.wordId2 override val solver = erSolver } object WorksFor_PerOrg_ConstrainedClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](WorksForClassifier) { - def subjectTo = relationArgumentConstraints - override val solver = new OJalgoHook + def subjectTo = dummyConst //relationArgumentConstraints + override val solver = erSolver } object LivesIn_PerOrg_relationConstrainedClassifier extends ConstrainedClassifier[ConllRelation, ConllRelation](LivesInClassifier) { - def subjectTo = relationArgumentConstraints + def subjectTo = dummyConst // relationArgumentConstraints override val solver = erSolver } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstraints.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstraints.scala index 91209d6d..8d36f5a4 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstraints.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstraints.scala @@ -1,12 +1,18 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation +import edu.illinois.cs.cogcomp.lbjava.infer.{FirstOrderConstant, FirstOrderConstraint} import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ -import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.{ ConllRawSentence, ConllRelation } -import EntityRelationClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ object EntityRelationConstraints { + val dummyConst = ConstrainedClassifier.constraint[ConllRelation] { + x => val a: FirstOrderConstraint = new FirstOrderConstant(true) + a + } + // if x is works-for relation, it shouldn't be lives-in relation. val relationArgumentConstraints = ConstrainedClassifier.constraint[ConllRelation] { x: ConllRelation => worksForConstraint(x) and livesInConstraint(x) and worksForImpliesNotLivesIn(x) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala index 867089f9..e53b4f7e 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala @@ -39,7 +39,7 @@ object PopulateSRLDataModel { case false => val nonDefaultProps = new Properties() if (parseViewName.equals(ViewNames.PARSE_GOLD)) - nonDefaultProps.setProperty(PipelineConfigurator.USE_POS.key, Configurator.FALSE) + nonDefaultProps.setProperty(PipelineConfigurator.USE_POS.key, Configurator.FALSE) nonDefaultProps.setProperty(PipelineConfigurator.USE_NER_CONLL.key, Configurator.FALSE) nonDefaultProps.setProperty(PipelineConfigurator.USE_NER_ONTONOTES.key, Configurator.FALSE) nonDefaultProps.setProperty(PipelineConfigurator.USE_SRL_VERB.key, Configurator.FALSE) From d83e610cb26891bf54da97450a94748043cdc184 Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 12 Sep 2016 23:45:06 -0500 Subject: [PATCH 088/118] -change from SparseNetworkLBP to SparseNetworkLearner -minor edits --- .../nlp/EntityRelation/EntityRelationApp_SL.scala | 2 +- .../nlp/EntityRelation/EntityRelationSensors.scala | 4 ++-- .../SemanticRoleLabeling/PopulateSRLDataModel.scala | 3 +-- .../saulexamples/nlp/EntityRelation/weightTest.scala | 12 ++++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index d959c30d..1c24f4ef 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -22,7 +22,7 @@ object EntityRelationApp_SL extends App { val cls_base = List(PersonClassifier, OrganizationClassifier, LocationClassifier, LivesInClassifier, WorksForClassifier) ClassifierUtils.TrainClassifiers(10, cls_base) - // ClassifierUtils.TestClassifiers(cls_base:_*) + ClassifierUtils.TestClassifiers(cls_base: _*) val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index 2c345308..d518bcdc 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -12,8 +12,8 @@ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{ Conll import scala.collection.JavaConverters._ object EntityRelationSensors { - val path = "../data/" - val resourcePath = "../saul-examples/src/test/resources/EntityMentionRelation/" + val path = "./data/" + val resourcePath = "./saul-examples/src/test/resources/EntityMentionRelation/" // Create single instances of Gazeteers and cache then with the object. lazy val cityGazetSensor = new GazeteerReader("gazeteer/known_city.lst", "Gaz:City", true, true) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala index e1e59670..03610e5a 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SemanticRoleLabeling/PopulateSRLDataModel.scala @@ -20,9 +20,8 @@ import edu.illinois.cs.cogcomp.nlp.pipeline.IllinoisPipelineFactory import edu.illinois.cs.cogcomp.nlp.utilities.ParseUtils import edu.illinois.cs.cogcomp.saul.util.Logging import edu.illinois.cs.cogcomp.saulexamples.data.{ SRLDataReader, SRLFrameManager } -import edu.illinois.cs.cogcomp.saulexamples.nlp.SemanticRoleLabeling.SRLSensors._ import edu.illinois.cs.cogcomp.saulexamples.nlp.CommonSensors._ -import org.slf4j.{ Logger, LoggerFactory } +import edu.illinois.cs.cogcomp.saulexamples.nlp.SemanticRoleLabeling.SRLSensors._ import scala.collection.JavaConversions._ diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index ac7ac371..0f5aa35c 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -6,9 +6,9 @@ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook -import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit +import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{ Saul_SL_Inference, StructuredLearning } -import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, Learnable, SparseNetworkLBP } +import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, Learnable } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.sl.util.WeightVector @@ -83,12 +83,12 @@ class weightTest extends FlatSpec with Matchers { object TestClassifier extends Learnable(tokens) { def label: Property[String] = testLabel override def feature = using(word) - override lazy val classifier = new SparseNetworkLBP + override lazy val classifier = new SparseNetworkLearner() } object TestBiClassifier extends Learnable(tokens) { def label: Property[String] = testLabel override def feature = using(word, biWord) - override lazy val classifier = new SparseNetworkLBP + override lazy val classifier = new SparseNetworkLearner() } object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { def subjectTo = null @@ -110,8 +110,8 @@ class weightTest extends FlatSpec with Matchers { // This should combine the weights val m = StructuredLearning(tokens, cls, initialize = false) - val clNet1 = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] - val clNet2 = TestBiConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val clNet1 = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] + val clNet2 = TestBiConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] val wv1 = clNet1.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector val wv2 = clNet2.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector From cba0ed29e90667097205e18ed630ae77614bc984 Mon Sep 17 00:00:00 2001 From: kordjam Date: Mon, 12 Sep 2016 23:58:44 -0500 Subject: [PATCH 089/118] -fixed path to config and add data --- .../SL_model/StructuredLearning.scala | 2 +- .../EntityRelationSensors.scala | 6 +- .../EntityMentionRelation/conll04_small.corp | 706 ++++++++++++++++++ 3 files changed, 710 insertions(+), 4 deletions(-) create mode 100644 saul-examples/src/test/resources/EntityMentionRelation/conll04_small.corp diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index ab418910..300b847d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -33,7 +33,7 @@ object StructuredLearning { // para.CHECK_INFERENCE_OPT = false model.featureGenerator = new SL_FeatureGenerator(model) - para.loadConfigFile("./config/DCD.config") + para.loadConfigFile("../config/DCD.config") model.para = para val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); model.wv = learner.train(sp, model.wv) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala index d518bcdc..a8ae3da9 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSensors.scala @@ -12,8 +12,8 @@ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.reader.{ Conll import scala.collection.JavaConverters._ object EntityRelationSensors { - val path = "./data/" - val resourcePath = "./saul-examples/src/test/resources/EntityMentionRelation/" + val path = "../data/" + val resourcePath = "../saul-examples/src/test/resources/EntityMentionRelation/" // Create single instances of Gazeteers and cache then with the object. lazy val cityGazetSensor = new GazeteerReader("gazeteer/known_city.lst", "Gaz:City", true, true) @@ -31,7 +31,7 @@ object EntityRelationSensors { lazy val (sentencesTrain, relationsTrain, entitiesTrain) = readConllData(path + "EntityMentionRelation/conll04_train.corp") lazy val (sentencesTest, relationsTest, entitiesTest) = readConllData(path + "EntityMentionRelation/conll04_test.corp") lazy val (sentencesSmallSet, testRelationsSmallSet, entitiesSmallSet) = readConllData(resourcePath + "conll04-smallDocument.txt") - lazy val (sentencesSmallSetTest, testRelationsSmallSetTest, entitiesSmallSetTest) = readConllData(path + "EntityMentionRelation/conll04_small.corp") + lazy val (sentencesSmallSetTest, testRelationsSmallSetTest, entitiesSmallSetTest) = readConllData(resourcePath + "conll04_small.corp") //readConllData(resourcePath + "conll04-smallDocument.txt") def sentenceToRelation_GeneratingSensor(s: ConllRawSentence): List[ConllRelation] = { diff --git a/saul-examples/src/test/resources/EntityMentionRelation/conll04_small.corp b/saul-examples/src/test/resources/EntityMentionRelation/conll04_small.corp new file mode 100644 index 00000000..f3cc8501 --- /dev/null +++ b/saul-examples/src/test/resources/EntityMentionRelation/conll04_small.corp @@ -0,0 +1,706 @@ +0 Other 0 O JJ Palestinian O O O +0 O 1 O NNP Uprising O O O +0 O 2 O NNP Affects O O O +0 Other 3 O NNP Israeli O O O +0 O 4 O NNP Artists O O O + + +1 O 0 O IN By O O O +1 Peop 1 O NNP/NNP RONI/RABIN O O O + + +2 Org 0 O NNP/NNP Associated/Press O O O +2 O 1 O NNP Writer O O O + + +3 O 0 O DT The O O O +3 O 1 O JJ long O O O +3 Other 2 O JJ Palestinian O O O +3 O 3 O NN uprising O O O +3 O 4 O VBZ has O O O +3 O 5 O VBN brought O O O +3 O 6 O NN bitterness O O O +3 O 7 O TO to O O O +3 Other 8 O JJ Israeli O O O +3 O 9 O NN humor O O O +3 O 10 O , COMMA O O O +3 O 11 O CC and O O O +3 O 12 O DT the O O O +3 O 13 O NN comedian O O O +3 O 14 O POS 's O O O +3 O 15 O NN opener O O O +3 O 16 O VBD was O O O +3 O 17 O RB not O O O +3 O 18 O VBN meant O O O +3 O 19 O TO to O O O +3 O 20 O VB put O O O +3 O 21 O PP$ his O O O +3 O 22 O NN audience O O O +3 O 23 O IN at O O O +3 O 24 O NN ease O O O +3 O 25 O . . O O O + + +4 O 0 O `` ` O O O +4 O 1 O `` ` O O O +4 O 2 O NNS Soldiers O O O +4 O 3 O IN in O O O +4 O 4 O NN uniform O O O +4 O 5 O VBP get O O O +4 O 6 O IN in O O O +4 O 7 O IN with O O O +4 O 8 O DT a O O O +4 O 9 O NN discount O O O +4 O 10 O , COMMA O O O +4 O 11 O '' ' O O O +4 O 12 O '' ' O O O +4 Peop 13 O NNP/NNP Yonathan/Geffen O O O +4 O 14 O VBD said O O O +4 O 15 O , COMMA O O O +4 O 16 O CC and O O O +4 O 17 O IN after O O O +4 O 18 O DT a O O O +4 O 19 O NN pause O O O +4 O 20 O : : O O O +4 O 21 O `` ` O O O +4 O 22 O `` ` O O O +4 O 23 O NNS Soldiers O O O +4 O 24 O IN with O O O +4 O 25 O NNS clubs O O O +4 O 26 O VBP get O O O +4 O 27 O IN in O O O +4 O 28 O NN free. O O O +4 O 29 O '' ' O O O +4 O 30 O '' ' O O O + + +5 O 0 O PRP He O O O +5 O 1 O VBD referred O O O +5 O 2 O TO to O O O +5 O 3 O NNS beatings O O O +5 O 4 O IN by O O O +5 O 5 O NNS soldiers O O O +5 O 6 O IN of O O O +5 O 7 O NNS protesters O O O +5 O 8 O IN in O O O +5 O 9 O DT the O O O +5 O 10 O VBD occupied O O O +5 Loc 11 O NNP/NNP West/Bank O O O +5 O 12 O CC and O O O +5 Loc 13 O NNP/NNP Gaza/Strip O O O +5 O 14 O , COMMA O O O +5 O 15 O WRB where O O O +5 O 16 O RBR more O O O +5 O 17 O IN than O O O +5 O 18 O CD 300 O O O +5 Other 19 O NNPS Palestinians O O O +5 O 20 O VBP have O O O +5 O 21 O VBN been O O O +5 O 22 O VBN killed O O O +5 O 23 O CC and O O O +5 O 24 O NNS thousands O O O +5 O 25 O VBN wounded O O O +5 O 26 O . . O O O + + +6 O 0 O PDT Such O O O +6 O 1 O DT a O O O +6 O 2 O NN joke O O O +6 O 3 O MD would O O O +6 O 4 O VB have O O O +6 O 5 O VBN been O O O +6 O 6 O JJ unthinkable O O O +6 O 7 O IN before O O O +6 O 8 O DT the O O O +6 O 9 O NN rebellion O O O +6 O 10 O VBD began O O O +6 Other 11 O NNP/CD/,/CD Dec./8/COMMA/1987 O O O +6 O 12 O . . O O O + + +7 O 0 O IN In O O O +7 O 1 O NN night O O O +7 O 2 O NNS clubs O O O +7 O 3 O , COMMA O O O +7 O 4 O NNS theaters O O O +7 O 5 O CC and O O O +7 O 6 O NNS galleries O O O +7 O 7 O , COMMA O O O +7 O 8 O NNS artists O O O +7 O 9 O IN of O O O +7 O 10 O JJ various O O O +7 O 11 O NNS kinds O O O +7 O 12 O VB grapple O O O +7 O 13 O IN with O O O +7 O 14 O NNS questions O O O +7 O 15 O IN about O O O +7 O 16 O DT the O O O +7 O 17 O NN violence O O O +7 O 18 O IN of O O O +7 O 19 O NN occupation O O O +7 O 20 O CC and O O O +7 O 21 O DT the O O O +7 O 22 O JJ brutalizing O O O +7 O 23 O NN effect O O O +7 O 24 O IN on O O O +7 Other 25 O JJ Israeli O O O +7 O 26 O NN society O O O +7 O 27 O IN of O O O +7 O 28 O DT the O O O +7 O 29 O NN army O O O +7 O 30 O POS 's O O O +7 O 31 O NN handling O O O +7 O 32 O IN of O O O +7 O 33 O DT the O O O +7 O 34 O NN uprising O O O +7 O 35 O . . O O O + + +8 O 0 O DT A O O O +8 O 1 O NN satire O O O +8 O 2 O IN by O O O +8 O 3 O NN nightclub O O O +8 O 4 O JJ performer O O O +8 Peop 5 O NNP/NNP Dudu/Topaz O O O +8 O 6 O VBZ takes O O O +8 O 7 O DT the O O O +8 O 8 O NN form O O O +8 O 9 O IN of O O O +8 O 10 O DT an O O O +8 O 11 O NN army O O O +8 O 12 O NN radio O O O +8 O 13 O VBP report O O O +8 O 14 O IN of O O O +8 O 15 O DT an O O O +8 O 16 O NN incident O O O +8 O 17 O VBD said O O O +8 O 18 O TO to O O O +8 O 19 O VB have O O O +8 O 20 O VBN begun O O O +8 O 21 O WRB when O O O +8 O 22 O DT a O O O +8 O 23 O JJ young O O O +8 Other 24 O NN Palestinian O O O +8 O 25 O VBN urinated O O O +8 O 26 O IN on O O O +8 O 27 O DT a O O O +8 O 28 O NN soldier O O O +8 O 29 O POS 's O O O +8 O 30 O NN leg O O O +8 O 31 O . . O O O + + +9 Peop 0 O NNP Topaz O O O +9 O 1 O VBD was O O O +9 O 2 O VBN barred O O O +9 O 3 O IN from O O O +9 O 4 O DT a O O O +9 O 5 O NN radio O O O +9 O 6 O VBP talk O O O +9 O 7 O VBP show O O O +9 O 8 O IN for O O O +9 Other 9 O CD/NNS two/weeks O O O +9 O 10 O IN for O O O +9 O 11 O NNS comments O O O +9 O 12 O JJ critical O O O +9 O 13 O IN of O O O +9 O 14 O DT the O O O +9 O 15 O NN army O O O +9 O 16 O . . O O O + + +10 Loc 0 O NNP Israel O O O +10 O 1 O NN television O O O +10 O 2 O VBD rejected O O O +10 O 3 O DT a O O O +10 O 4 O NN skit O O O +10 O 5 O IN by O O O +10 O 6 O NN comedian O O O +10 Peop 7 O NNP/NNP Tuvia/Tzafir O O O +10 O 8 O IN that O O O +10 O 9 O VBN attacked O O O +10 O 10 O JJ public O O O +10 O 11 O NN apathy O O O +10 O 12 O IN by O O O +10 O 13 O VBG depicting O O O +10 O 14 O DT an O O O +10 Other 15 O JJ Israeli O O O +10 O 16 O NN family O O O +10 O 17 O VBG watching O O O +10 O 18 O NN TV O O O +10 O 19 O IN while O O O +10 O 20 O DT a O O O +10 O 21 O NN fire O O O +10 O 22 O VBD raged O O O +10 O 23 O IN outside O O O +10 O 24 O . . O O O + +7 0 Live_In + +11 O 0 O NNS Lyrics O O O +11 O 1 O IN in O O O +11 O 2 O `` ` O O O +11 O 3 O `` ` O O O +11 Other 4 O NNP/IN/NNP Coexistence/With/Love O O O +11 O 5 O , COMMA O O O +11 O 6 O '' ' O O O +11 O 7 O '' ' O O O +11 O 8 O DT a O O O +11 O 9 O JJ new O O O +11 O 10 O NN album O O O +11 O 11 O IN by O O O +11 O 12 O NN vocalist O O O +11 Peop 13 O NNP/NNP Astar/Shamir O O O +11 O 14 O , COMMA O O O +11 O 15 O VBP accuse O O O +11 O 16 O DT the O O O +11 O 17 O NN government O O O +11 O 18 O IN of O O O +11 O 19 O VBG failing O O O +11 O 20 O TO to O O O +11 O 21 O VB explore O O O +11 O 22 O NNS options O O O +11 O 23 O IN for O O O +11 O 24 O NN peace O O O +11 O 25 O IN while O O O +11 O 26 O JJ young O O O +11 O 27 O NNS soldiers O O O +11 O 28 O VBP do O O O +11 O 29 O DT the O O O +11 O 30 O JJ dirty O O O +11 O 31 O NN work O O O +11 O 32 O IN of O O O +11 O 33 O NN occupation O O O +11 O 34 O . . O O O + + +12 O 0 O IN As O O O +12 O 1 O CD one O O O +12 O 2 O IN of O O O +12 O 3 O PP$ her O O O +12 O 4 O NNS songs O O O +12 O 5 O , COMMA O O O +12 O 6 O `` ` O O O +12 O 7 O `` ` O O O +12 Other 8 O DT/NNP/IN/DT/NN A/Moment/Before/the/Storm O O O +12 O 9 O , COMMA O O O +12 O 10 O '' ' O O O +12 O 11 O '' ' O O O +12 O 12 O VBZ puts O O O +12 O 13 O PRP it O O O +12 O 14 O : : O O O +12 O 15 O `` ` O O O +12 O 16 O `` ` O O O +12 O 17 O PP$ My O O O +12 O 18 O NN brother O O O +12 O 19 O NN isn O O O +12 O 20 O NN 't O O O +12 O 21 O DT a O O O +12 O 22 O JJ cruel O O O +12 O 23 O NN soldier O O O +12 O 24 O , COMMA O O O +12 O 25 O CC but O O O +12 O 26 O PRP he O O O +12 O 27 O VBZ 's O O O +12 O 28 O NN cold O O O +12 O 29 O IN in O O O +12 O 30 O PP$ his O O O +12 O 31 O NN soul O O O +12 O 32 O . . O O O + + +13 O 0 O RB Early O O O +13 O 1 O JJ last O O O +13 O 2 O NN year O O O +13 O 3 O , COMMA O O O +13 O 4 O NN army O O O +13 O 5 O NN radio O O O +13 O 6 O VBD banned O O O +13 O 7 O NN pop O O O +13 O 8 O NN singer O O O +13 Peop 9 O NNP/NNP Si/Hyman O O O +13 O 10 O POS 's O O O +13 O 11 O NN song O O O +13 O 12 O `` ` O O O +13 O 13 O `` ` O O O +13 Other 14 O NN/CC/NNP Shooting/and/Crying O O O +13 O 15 O '' ' O O O +13 O 16 O '' ' O O O +13 O 17 O IN about O O O +13 O 18 O NNS soldiers O O O +13 O 19 O WP who O O O +13 O 20 O VBD used O O O +13 O 21 O DT a O O O +13 O 22 O NN bulldozer O O O +13 O 23 O TO to O O O +13 O 24 O VB bury O O O +13 O 25 O CD four O O O +13 O 26 O JJ young O O O +13 Other 27 O NNPS Palestinians O O O +13 O 28 O JJ alive O O O +13 O 29 O IN in O O O +13 O 30 O DT a O O O +13 Loc 31 O NNP/NNP West/Bank O O O +13 O 32 O NN village O O O +13 O 33 O . . O O O + + +14 Peop 0 O NNP Hyman O O O +14 O 1 O VBZ asks O O O +14 O 2 O IN in O O O +14 O 3 O DT the O O O +14 O 4 O NN chorus O O O +14 O 5 O , COMMA O O O +14 O 6 O VBG alluding O O O +14 O 7 O TO to O O O +14 O 8 O DT the O O O +14 Org 9 O JJ Nazi O O O +14 O 10 O NN extermination O O O +14 O 11 O IN of O O O +14 Other 12 O CD/CD 6/million O O O +14 Other 13 O NNPS Jews O O O +14 O 14 O . . O O O + + +15 O 0 O IN In O O O +15 O 1 O DT a O O O +15 Loc 2 O NNP Jaffa O O O +15 O 3 O NN nightclub O O O +15 O 4 O , COMMA O O O +15 Peop 5 O NNP Tzafir O O O +15 O 6 O VBZ performs O O O +15 O 7 O DT a O O O +15 O 8 O NN skit O O O +15 O 9 O VBG accusing O O O +15 O 10 O NNP Prime O O O +15 Peop 11 O NNP/NNP Yitzhak/Shamir O O O +15 O 12 O IN of O O O +15 O 13 O VBG ignoring O O O +15 O 14 O NNS opportunities O O O +15 O 15 O IN for O O O +15 O 16 O NN peace O O O +15 O 17 O . . O O O + + +16 Other 0 O NNPS Palestinians O O O +16 O 1 O VBP have O O O +16 O 2 O VBN incorporated O O O +16 O 3 O NNS themes O O O +16 O 4 O IN of O O O +16 O 5 O DT the O O O +16 O 6 O NN uprising O O O +16 O 7 O IN into O O O +16 O 8 O NNS songs O O O +16 O 9 O CC and O O O +16 O 10 O NNS plays O O O +16 O 11 O . . O O O + + +17 O 0 O DT An O O O +17 O 1 O NN art O O O +17 O 2 O NN exhibit O O O +17 O 3 O IN at O O O +17 O 4 O DT the O O O +17 Org 5 O NNP/NNP Hakawati/Theatre O O O +17 O 6 O IN in O O O +17 Other 7 O JJ Arab O O O +17 O 8 O JJ east O O O +17 Loc 9 O NNP Jerusalem O O O +17 O 10 O VBD was O O O +17 O 11 O DT a O O O +17 O 12 O NN series O O O +17 O 13 O IN of O O O +17 O 14 O NNS portraits O O O +17 O 15 O IN of O O O +17 Other 16 O NNPS Palestinians O O O +17 O 17 O VBN killed O O O +17 O 18 O IN in O O O +17 O 19 O DT the O O O +17 O 20 O NN rebellion O O O +17 O 21 O . . O O O + +5 9 OrgBased_In + +18 O 0 O DT The O O O +18 O 1 O JJ new O O O +18 O 2 O NN play O O O +18 O 3 O `` ` O O O +18 O 4 O `` ` O O O +18 Other 5 O VBG/IN/DT/NN Waiting/for/the/Savior O O O +18 O 6 O POS ' O O O +18 O 7 O '' ' O O O +18 O 8 O VBZ depicts O O O +18 O 9 O JJ buffoon-like O O O +18 Other 10 O JJ Israeli O O O +18 O 11 O NNS soldiers O O O +18 O 12 O VBG harassing O O O +18 Other 13 O NNPS Palestinians O O O +18 O 14 O VBG going O O O +18 O 15 O IN about O O O +18 O 16 O PP$ their O O O +18 O 17 O NN daily O O O +18 O 18 O NNS lives O O O +18 O 19 O . . O O O + + +19 O 0 O `` ` O O O +19 O 1 O `` ` O O O +19 O 2 O NN Everything O O O +19 O 3 O VBZ is O O O +19 O 4 O JJ political O O O +19 O 5 O , COMMA O O O +19 O 6 O '' ' O O O +19 O 7 O '' ' O O O +19 O 8 O VBD said O O O +19 Peop 9 O NNP/NNP Jamal/Ghosheh O O O +19 O 10 O , COMMA O O O +19 O 11 O NN director O O O +19 O 12 O IN of O O O +19 O 13 O DT the O O O +19 O 14 O FW theatre O O O +19 O 15 O . . O O O + + +20 O 0 O IN For O O O +20 Other 1 O JJ Israeli O O O +20 O 2 O NNS performers O O O +20 O 3 O , COMMA O O O +20 O 4 O WP who O O O +20 O 5 O VBP do O O O +20 O 6 O JJ active O O O +20 O 7 O CC and O O O +20 O 8 O JJ reserve O O O +20 O 9 O NN army O O O +20 O 10 O NN duty O O O +20 O 11 O IN like O O O +20 O 12 O NN everyone O O O +20 O 13 O JJ else O O O +20 O 14 O , COMMA O O O +20 O 15 O PRP it O O O +20 O 16 O VBZ is O O O +20 O 17 O RBR more O O O +20 O 18 O VBN complicated O O O +20 O 19 O . . O O O + + +21 O 0 O DT The O O O +21 O 1 O NN comedian O O O +21 O 2 O , COMMA O O O +21 O 3 O WP$ whose O O O +21 O 4 O NN father O O O +21 O 5 O VBD came O O O +21 O 6 O RB here O O O +21 O 7 O IN from O O O +21 O 8 O DT the O O O +21 Loc 9 O NNP/NNP Soviet/Union O O O +21 O 10 O , COMMA O O O +21 O 11 O VBD said O O O +21 O 12 O IN in O O O +21 O 13 O DT an O O O +21 O 14 O NN interview O O O +21 O 15 O : : O O O +21 O 16 O `` ` O O O +21 O 17 O `` ` O O O +21 O 18 O DT This O O O +21 O 19 O VBZ is O O O +21 O 20 O RB not O O O +21 O 21 O DT the O O O +21 O 22 O NN country O O O +21 O 23 O PRP I O O O +21 O 24 O VBD wanted O O O +21 O 25 O . . O O O + + +22 Other 0 O JJ Italian O O O +22 O 1 O NNS Police O O O +22 O 2 O VB Find O O O +22 Other 3 O NN/CD $10/Million O O O +22 O 4 O IN in O O O +22 O 5 O NNP Fake O O O +22 Loc 6 O NNP U.S. O O O +22 O 7 O NNS Bills O O O + + +23 Loc 0 O NNP PERUGIA O O O +23 O 1 O , COMMA O O O +23 Loc 2 O NNP Italy O O O +23 O 3 O -LRB- -LRB- O O O +23 Org 4 O NNP AP O O O +23 O 5 O -RRB- -RRB- O O O + +0 2 Located_In +4 0 OrgBased_In +4 2 OrgBased_In + +24 O 0 O NNS Police O O O +24 O 1 O VBD arrested O O O +24 O 2 O CD 10 O O O +24 O 3 O NNS people O O O +24 O 4 O CC and O O O +24 O 5 O VBD confiscated O O O +24 Other 6 O NN/CD $10/million O O O +24 O 7 O IN in O O O +24 O 8 O JJ counterfeit O O O +24 Loc 9 O NNP U.S. O O O +24 O 10 O NN currency O O O +24 O 11 O , COMMA O O O +24 O 12 O DT an O O O +24 Other 13 O JJ Italian O O O +24 O 14 O NN news O O O +24 O 15 O NN agency O O O +24 O 16 O VBD reported O O O +24 O 17 O . . O O O + + +25 O 0 O DT The O O O +25 O 1 O NNS bills O O O +25 O 2 O VBD were O O O +25 O 3 O RB reportedly O O O +25 O 4 O VBN distributed O O O +25 O 5 O IN through O O O +25 O 6 O JJ central O O O +25 Loc 7 O NNP Italy O O O +25 O 8 O IN after O O O +25 O 9 O VBG being O O O +25 O 10 O VBN manufactured O O O +25 O 11 O IN in O O O +25 Loc 12 O NNP Rome O O O +25 O 13 O , COMMA O O O +25 O 14 O WRB where O O O +25 O 15 O NNS police O O O +25 O 16 O VBD seized O O O +25 O 17 O DT a O O O +25 O 18 O NN printing O O O +25 O 19 O NN press O O O +25 O 20 O . . O O O + + +26 O 0 O NNS Officials O O O +26 O 1 O IN in O O O +26 Loc 2 O NNP Perugia O O O +26 O 3 O IN in O O O +26 Loc 4 O NNP Umbria O O O +26 O 5 O NN province O O O +26 O 6 O VBD said O O O +26 O 7 O CD five O O O +26 O 8 O NNS people O O O +26 O 9 O VBD were O O O +26 O 10 O VBN arrested O O O +26 O 11 O RB there O O O +26 O 12 O NNP Tuesday O O O +26 O 13 O NN night O O O +26 O 14 O IN after O O O +26 O 15 O NNS police O O O +26 O 16 O VBD stopped O O O +26 O 17 O PP$ their O O O +26 O 18 O NN car O O O +26 O 19 O CC and O O O +26 O 20 O VBD found O O O +26 Other 21 O NN/CD $1/million O O O +26 O 22 O IN in O O O +26 O 23 O JJ bogus O O O +26 O 24 O NNS bills O O O +26 O 25 O IN in O O O +26 O 26 O DT the O O O +26 O 27 O NN trunk O O O +26 O 28 O . . O O O + +2 4 Located_In + +27 O 0 O DT The O O O +27 Org 1 O NNP ANSA O O O +27 O 2 O NN news O O O +27 O 3 O NN agency O O O +27 O 4 O VBD said O O O +27 O 5 O DT the O O O +27 O 6 O NN operation O O O +27 O 7 O VBD involved O O O +27 O 8 O NN police O O O +27 O 9 O IN in O O O +27 Loc 10 O NNP Umbria O O O +27 O 11 O CC and O O O +27 Loc 12 O NNP Lazio O O O +27 O 13 O NNS provinces O O O +27 O 14 O IN in O O O +27 O 15 O JJ central O O O +27 Loc 16 O NNP Italy O O O +27 O 17 O CC and O O O +27 Loc 18 O NNP Campania O O O +27 O 19 O NN province O O O +27 O 20 O IN in O O O +27 O 21 O DT the O O O +27 O 22 O NN south O O O +27 O 23 O , COMMA O O O +27 O 24 O IN without O O O +27 O 25 O VBG specifying O O O +27 O 26 O JJ exact O O O +27 O 27 O NN arrest O O O +27 O 28 O NNS locations O O O +27 O 29 O . . O O O + +10 16 Located_In +12 16 Located_In +18 16 Located_In + +28 Loc 0 O NNP Rome O O O +28 O 1 O VBZ is O O O +28 O 2 O IN in O O O +28 Loc 3 O NNP Lazio O O O +28 O 4 O NN province O O O +28 O 5 O CC and O O O +28 Loc 6 O NNP Naples O O O +28 O 7 O IN in O O O +28 Loc 8 O NNP Campania O O O +28 O 9 O . . O O O + +0 3 Located_In +6 8 Located_In + +29 O 0 O NNS Police O O O +29 O 1 O VBD began O O O +29 O 2 O VBG investigating O O O +29 O 3 O IN after O O O +29 O 4 O VBG getting O O O +29 O 5 O NNS reports O O O +29 O 6 O IN that O O O +29 O 7 O DT an O O O +29 O 8 O RB unusually O O O +29 O 9 O JJ large O O O +29 O 10 O NN number O O O +29 O 11 O IN of O O O +29 Loc 12 O NNP U.S. O O O +29 O 13 O NNS dollars O O O +29 O 14 O VBD was O O O +29 O 15 O VBG being O O O +29 O 16 O VBN used O O O +29 O 17 O TO to O O O +29 O 18 O VB pay O O O +29 O 19 O IN for O O O +29 O 20 O NNS goods O O O +29 O 21 O CC and O O O +29 O 22 O NNS services O O O +29 O 23 O IN in O O O +29 O 24 O NN tourist O O O +29 O 25 O NNS centers O O O +29 O 26 O . . O O O + + +30 Other 0 O NNP/NNP WASHINGTON/TODAY O O O +30 O 1 O : : O O O +30 Peop 2 O NNP Reagan O O O +30 O 3 O VBZ Takes O O O +30 O 4 O NNP High O O O +30 O 5 O NNP Road O O O +30 O 6 O IN in O O O +30 O 7 O NNP Farewell O O O +30 O 8 O NNP Speech O O O + + +31 O 0 O IN By O O O +31 Peop 1 O NNP/NNP/NNP W./DALE/NELSON O O O + + +32 Org 0 O NNP/NNP Associated/Press O O O +32 O 1 O NNP Writer O O O + + From a7640c7ae715a35ac1d95f80f8ccc66cff61e768 Mon Sep 17 00:00:00 2001 From: Bhargav Mangipudi Date: Tue, 13 Sep 2016 22:25:59 -0500 Subject: [PATCH 090/118] Remove SparseNetworkLBP, JoinTrainSparseNetwork file usages. --- .../classifier/JoinTrainSparseNetwork.scala | 0 .../saul/classifier/SL_model/Initialize.scala | 22 +++++++------- .../SL_model/LossAugmentedNormalizer.scala | 5 ++-- .../SL_model/SL_FeatureGenerator.scala | 4 +-- .../SL_model/Saul_SL_Inference.scala | 13 ++++---- .../SL_model/lossAugmentedClassifier.scala | 5 ++-- .../saul/classifier/SparseNetworkLBP.scala | 30 ------------------- .../EntityRelationSLTests.scala | 2 +- .../nlp/EntityRelation/SLTest2.scala | 20 +++++++++---- 9 files changed, 40 insertions(+), 61 deletions(-) delete mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala delete mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JoinTrainSparseNetwork.scala deleted file mode 100644 index e69de29b..00000000 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 2034ec99..ce9f0645 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -6,8 +6,7 @@ */ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit -import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP +import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.sl.core.SLProblem import edu.illinois.cs.cogcomp.sl.util.WeightVector @@ -29,7 +28,7 @@ object Initialize { model.Factors.foreach { cf => cf.onClassifier.classifier.forget() - val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] val lLexicon = cf.onClassifier.classifier.getLabelLexicon sp.instanceList.toList.zipWithIndex.foreach { @@ -44,13 +43,14 @@ object Initialize { val exampleLabels = a(2).asInstanceOf[Array[Int]] val labelValues = a(3).asInstanceOf[Array[Double]] val label = exampleLabels(0) - var N = ilearner.getNetwork.size(); + var N = ilearner.getNetwork.size() if (label >= N || ilearner.getNetwork.get(label) == null) { - ilearner.iConjuctiveLables = ilearner.iConjuctiveLables | ilearner.getLabelLexicon.lookupKey(label).isConjunctive(); - var ltu: LinearThresholdUnit = ilearner.getbaseLTU - ltu.initialize(ilearner.getnumExamples, ilearner.getnumFeatures); - ilearner.getNetwork.set(label, ltu); - N = label + 1; + val isConjunctiveLabels = ilearner.isUsingConjunctiveLabels | ilearner.getLabelLexicon.lookupKey(label).isConjunctive + ilearner.setConjunctiveLabels(isConjunctiveLabels) + val ltu: LinearThresholdUnit = ilearner.getBaseLTU + ltu.initialize(ilearner.getNumExamples, ilearner.getNumFeatures) + ilearner.getNetwork.set(label, ltu) + N = label + 1 } } // for each candidate } // for each constraintFactor @@ -63,12 +63,12 @@ object Initialize { model.Factors.foreach( x => { - val sparseNet = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val sparseNet = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] val temp = (sparseNet.getLexicon.size()) for (i <- 0 until sparseNet.getNetwork.size()) { - val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector + val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector val t = Array.fill[Float](temp)(0) if (initialize) { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala index e48c22e6..663ca717 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/LossAugmentedNormalizer.scala @@ -7,8 +7,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.classify.ScoreSet -import edu.illinois.cs.cogcomp.lbjava.learn.{ Learner, Normalizer } -import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP +import edu.illinois.cs.cogcomp.lbjava.learn.{ Learner, Normalizer, SparseNetworkLearner } /** Created by Parisa on 4/18/16. */ @@ -21,7 +20,7 @@ class LossAugmentedNormalizer(cand_num: Int, c: Learner, example: AnyRef) extend def normalize(scores: ScoreSet): ScoreSet = { if (cand_num == 0) print("There is no relevant component of this type in the head to be classified.") - val cf = c.asInstanceOf[SparseNetworkLBP] + val cf = c.asInstanceOf[SparseNetworkLearner] val gold = cf.getLabeler.discreteValue(example) val lLexicon = cf.getLabelLexicon diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index a00dc5e8..9c7d3955 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -6,7 +6,7 @@ */ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP +import edu.illinois.cs.cogcomp.lbjava.learn.SparseNetworkLearner import edu.illinois.cs.cogcomp.sl.core.{ AbstractFeatureGenerator, IInstance, IStructure } import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, IFeatureVector } @@ -28,7 +28,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst case (cf, indF) => val candis: Seq[_] = cf.getCandidates(myX.head) - val sparseNet = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP] + val sparseNet = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] val fvLocal = new FeatureVectorBuffer() candis.foreach { diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index bc79bc59..7e27998b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -6,7 +6,8 @@ */ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, SparseNetworkLBP } +import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.sl.core.{ AbstractInferenceSolver, IInstance, IStructure } import edu.illinois.cs.cogcomp.sl.util.WeightVector @@ -84,7 +85,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H var offset = 0 a.foreach { cf => - for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.size()) { + for (i <- 0 until cf.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.size()) { val ltuSize = ltuTemplates(ltu_count).size //cf.onClassifier.asInstanceOf[SparseNetworkLBP].net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector // print("w", ltu_count, " size:\t", ltuSize.size) val myLTUJointlyTrainedWeight = weight.getWeightArray.slice(offset, offset + ltuSize) @@ -95,11 +96,13 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H // println("size mismatch!", cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size(), ",", ltuSize.size) // } val exampleFeatureIndexes = ofDim[Int](myLTUJointlyTrainedWeight.length) - cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.clear() + val weightVector = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(i).asInstanceOf[LinearThresholdUnit].getWeightVector + weightVector.clear() + // val exampleFeatureIndexes = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.getMap.values.toArray.map(_.asInstanceOf[Int])//.toArray//.toArray().asInstanceOf[Array[Int]] - for (featureIndex <- 0 until myLTUJointlyTrainedWeight.length) { + for (featureIndex <- myLTUJointlyTrainedWeight.indices) { exampleFeatureIndexes(featureIndex) = featureIndex - cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.setWeight(featureIndex, myLTUJointlyTrainedWeight(featureIndex)) + weightVector.setWeight(featureIndex, myLTUJointlyTrainedWeight(featureIndex)) //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala index 6a7e1bc4..620eff6c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/lossAugmentedClassifier.scala @@ -8,8 +8,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import java.io.PrintStream import edu.illinois.cs.cogcomp.lbjava.classify.{ FeatureVector, ScoreSet } -import edu.illinois.cs.cogcomp.lbjava.learn.Learner -import edu.illinois.cs.cogcomp.saul.classifier.SparseNetworkLBP +import edu.illinois.cs.cogcomp.lbjava.learn.{ Learner, SparseNetworkLearner } /** Created by Parisa on 4/1/16. */ @@ -26,7 +25,7 @@ class lossAugmentedClassifier[T <: AnyRef](c: Learner, cand_num: Int = 1) extend override def scores(example: AnyRef): ScoreSet = { if (cand_num == 0) print("There is no relevant component of this type in the head to be classified.") - val cf = c.asInstanceOf[SparseNetworkLBP] + val cf = c.asInstanceOf[SparseNetworkLearner] val gold = cf.getLabeler.discreteValue(example) val lLexicon = cf.getLabelLexicon val resultS: ScoreSet = c.scores(example) //new ScoreSet diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala deleted file mode 100644 index ea29b6d5..00000000 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SparseNetworkLBP.scala +++ /dev/null @@ -1,30 +0,0 @@ -/** This software is released under the University of Illinois/Research and Academic Use License. See - * the LICENSE file in the root folder for details. Copyright (c) 2016 - * - * Developed by: The Cognitive Computations Group, University of Illinois at Urbana-Champaign - * http://cogcomp.cs.illinois.edu/ - */ -package edu.illinois.cs.cogcomp.saul.classifier - -import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } - -/** Created by Parisa on 5/24/15. - */ -class SparseNetworkLBP extends SparseNetworkLearner { - - // val net = network - var iConjuctiveLables = conjunctiveLabels - override def getLTU(i: Int): LinearThresholdUnit = { - var a: LinearThresholdUnit = network.get(i).asInstanceOf[LinearThresholdUnit] - a - } - def getnumExamples: Int = { - numExamples - } - def getnumFeatures: Int = { - numFeatures - } - def getbaseLTU: LinearThresholdUnit = { - baseLTU - } -} diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala index b9e25fec..a3a53288 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala @@ -45,7 +45,7 @@ class EntityRelationSLTests extends FlatSpec with Matchers { } val para = new SLParameters - para.loadConfigFile("./config/DCD.config") + para.loadConfigFile("../config/DCD.config") model.para = para model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates) val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index e13b18ba..644eff5f 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -6,8 +6,9 @@ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook +import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, ConstrainedClassifier, Learnable, SparseNetworkLBP } +import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, ConstrainedClassifier, Learnable } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation @@ -34,14 +35,14 @@ class SLTest2 extends FlatSpec with Matchers { override def feature = using(word) - override lazy val classifier = new SparseNetworkLBP + override lazy val classifier = new SparseNetworkLearner() } object TestBiClassifier extends Learnable(tokens) { def label: Property[String] = testLabel override def feature = using(word, biWord) - override lazy val classifier = new SparseNetworkLBP + override lazy val classifier = new SparseNetworkLearner() } object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { def subjectTo = null @@ -107,8 +108,15 @@ class SLTest2 extends FlatSpec with Matchers { InitializedModel.Factors.foreach( x => { - x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector.eq(cls_base(0).classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector) should be(true) - x.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(1).getWeightVector.eq(cls_base(1).classifier.asInstanceOf[SparseNetworkLBP].getLTU(0).getWeightVector) should be(true) + val classifierWeightVector0 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + val baseWeightVector0 = cls_base(0).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + + classifierWeightVector0 should be(baseWeightVector0) + + val classifierWeightVector1 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector + val baseWeightVector1 = cls_base(1).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + + classifierWeightVector1 should be(baseWeightVector1) } ) //InitializedModel.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) @@ -116,7 +124,7 @@ class SLTest2 extends FlatSpec with Matchers { } val para = new SLParameters - para.loadConfigFile("./config/DCD.config") + para.loadConfigFile("../config/DCD.config") model.para = para model.infSolver = new Saul_SL_Inference[String](model.Factors.toList, model.LTUWeightTemplates) val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) From 0e52509b3259d30a7c0327bd3d0f6e6c6ad3f724 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 16 Sep 2016 08:54:32 -0500 Subject: [PATCH 091/118] -add SL documentation --- .../saul/classifier/SL_model/README.md | 37 +++++++++++++++++++ .../EntityRelation/EntityRelationApp_SL.scala | 10 ++--- 2 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md new file mode 100644 index 00000000..c7d7294c --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md @@ -0,0 +1,37 @@ +The `SL_model` package aims at providing the possibility of designing structured output prediction models, based on generalized linear models such as structured SVMs and structured Perceptrons. +For implementating any structured learning problem in SL, we need to implement the following classes, [see here.](http://cogcomp.cs.illinois.edu/software/illinois-sl/) +
    +
  • The input structure, x. This should implement the IInstance interface.
  • + +
  • The output structure, y. This should implement the IStructure interface.
  • + +
  • A procedure to compute the feature vector Φ(x,y). For this you need to extned the AbstractFeatureGenerator class and override its getFeatureVector method.
  • + +
  • A procedure InferenceSolver to perform the loss-augmented inference, + +argmaxy′wTΦ(x,y′)+Δ(y,y′) + +For this you need to extend the AbstractInferenceSolver class.
  • + +
  • At test time, we need to solve + +argmaxy′wTΦ(x,y′) +We will call this the MAP inference problem. For this we can just set Δ(y,y′) to zero in the loss-augmented inference solver.
  • + +
+ +Now here in Saul-SL, what we do is that the way we define our model is based on Saul's conceptual abstraction rather than the SL abstraction. In other words Saul user writes the program in terms of Classifiers and Constraints and the above mentioned modules are provided by Saul. +-The input structure is the collection of the input components of each individual classifier. +-The output structure is the collection of the labels +-The feature vector is the concatination of input-feature * output-label for each individual classifier and a global join feature function is built automatically based on that. +-The inference is done using the constraints that express the correlations between the Classifiers. + +This view implements the idea of collective classification in the framework of structured output prediction models and provides the possibility of using global first order constraints and domain knowledge easily in the structured learning model. + + The underlying inference is performed using ILP techniques. + + + + + + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 1c24f4ef..3392080e 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -17,23 +17,23 @@ object EntityRelationApp_SL extends App { EntityRelationDataModel.populateWithConllSmallSet() //.populateWithConll() - //ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) val cls_base = List(PersonClassifier, OrganizationClassifier, LocationClassifier, LivesInClassifier, WorksForClassifier) - ClassifierUtils.TrainClassifiers(10, cls_base) - ClassifierUtils.TestClassifiers(cls_base: _*) + //ClassifierUtils.TrainClassifiers(10, cls_base) + //ClassifierUtils.TestClassifiers(cls_base: _*) val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) ClassifierUtils.TestClassifiers(cls: _*) - val m = StructuredLearning(pairs, cls, initialize = false) + val m = StructuredLearning(pairs, cls, initialize = true) println("Structured evaluation.\n") StructuredLearning.Evaluate(pairs, cls, m, "") - // ClassifierUtils.TestClassifiers(cls_base:_*) + //ClassifierUtils.TestClassifiers(cls_base:_*) } From 831f1d9e2af3b2259b5fadca1480de8465be14ce Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 16 Sep 2016 16:01:44 -0500 Subject: [PATCH 092/118] -improve ER documentation -Reference it in ER --- .../saul/classifier/SL_model/README.md | 14 ++++++++++-- .../saulexamples/nlp/EntityRelation/README.md | 22 ++++++++++--------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md index c7d7294c..ac3467ea 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md @@ -22,13 +22,23 @@ We will call this the MAP inference problem. For this we can just set Δ(y,y′) Now here in Saul-SL, what we do is that the way we define our model is based on Saul's conceptual abstraction rather than the SL abstraction. In other words Saul user writes the program in terms of Classifiers and Constraints and the above mentioned modules are provided by Saul. -The input structure is the collection of the input components of each individual classifier. + -The output structure is the collection of the labels --The feature vector is the concatination of input-feature * output-label for each individual classifier and a global join feature function is built automatically based on that. + +-The feature vector is the concatenation of the vectors generated by (input-feature * output-label) for each individual classifier and a global join feature function is built automatically based on those join features of the independent classifiers. + -The inference is done using the constraints that express the correlations between the Classifiers. This view implements the idea of collective classification in the framework of structured output prediction models and provides the possibility of using global first order constraints and domain knowledge easily in the structured learning model. - The underlying inference is performed using ILP techniques. +The underlying inference is performed using ILP techniques. + +###Walk trough the ER example + +The explanation of the ER problem can be found in the [EntityRelation example](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/README.md). +To solve this problem and extract the relations and entities jointly using SL, we use the same problem specification of this problem that is used for other configurations. This specification includes defining the +[ER data model](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala), [classifiers](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala) and [constraints](saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstraints.scala). + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/README.md b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/README.md index 44940131..8219bc06 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/README.md +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/README.md @@ -1,13 +1,15 @@ # Entity-Relation classification -This is the problem of recognizing the `kill (KFJ, Oswald)` relation in the sentence "J. V. -Oswald was murdered at JFK after his assassin, R. U. KFJ..." This task requires making several -local decisions, such as identifying named entities in the sentence, in order to support the -relation identification. For example, it may be useful to identify that Oswald and KFJ are -people, and JFK is a location. This, in turn, may help to identify that the kill action is -described in the sentence. At the same time, the relation kill constrains its arguments to -be people (or at least, not to be locations) and helps to enforce that Oswald and KFJ are -likely to be people, while JFK is not. +This is the problem of recognizing the `kill (KFJ, Oswald)` relation in the sentence + +"J. V. Oswald was murdered at JFK after his assassin, R. U. KFJ..." + +This task requires making several local decisions, such as identifying named entities in the sentence, in order to support the +relation identification. For example, it may be useful to identify that `Oswald` and `KFJ` are +people, and `JFK` is a location. This, in turn, may help to identify that the kill action is +described in the sentence. At the same time, the relation `kill` constrains its arguments to +be people (or at least, not to be locations) and helps to enforce that `Oswald` and `KFJ` are +likely to be people, while `JFK` is not. The problem is defined in terms of a collection of discrete random variables representing binary relations and their arguments; we seek an optimal assignment to the variables in @@ -15,9 +17,9 @@ the presence of the constraints on the binary relations between variables and th types. To read more on the formulation of the problem please refer to [1]. One important goal in this task is to show the training with different paradigms, which are -described in the next secion. +described in the next section. -We evaluate the current systems on the Conll-2004 data. We use 2942 train sentences (6955 entities and 1079 relations) +The type of entities that we extract in this example are E={Person, Location, Organization} and the typ of relations are R={WorksFor, LivesIn, LocatedIn, OrgBasedIn}. We evaluate the current systems on the Conll-2004 data. We use 2942 train sentences (6955 entities and 1079 relations) and 2573 test sentences (7219 entities and 969 relations). ## Training and inference paradigms From ffee0b13f73ad14203f9a383ea32617d1a52b78f Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 16 Sep 2016 17:28:59 -0500 Subject: [PATCH 093/118] SAul-SL documentation --- .../saul/classifier/SL_model/README.md | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md index ac3467ea..878fc922 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md @@ -33,12 +33,24 @@ This view implements the idea of collective classification in the framework of s The underlying inference is performed using ILP techniques. -###Walk trough the ER example +###The ER example The explanation of the ER problem can be found in the [EntityRelation example](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/README.md). -To solve this problem and extract the relations and entities jointly using SL, we use the same problem specification of this problem that is used for other configurations. This specification includes defining the -[ER data model](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala), [classifiers](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala) and [constraints](saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstraints.scala). - +To solve this problem and extract the relations and entities jointly using SL's structured output prediction models, we use the same problem specification of this problem that is used for other configurations in Saul. This specification includes defining the +[ER data model](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationDataModel.scala), + [classifiers](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationClassifiers.scala) and [constraints](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationConstraints.scala). + The only different part is the end ER application is to simply call `StructuredLearning("NodeType_Name", "ListOfConstrainedClassifiers_Name")`, where `NodeTyeName` is a node type in our dataModel and indicates the type of examples that our model receives. + In fact, this specifies the type of most global object that is used as an independent example. The evaluation of the model also is done by calling def `Evaluate("NodeType_Name", "ListOfConstrainedClassifiers_Name",myModelName, modelPath)`. This is the + [end ER application](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala) that uses SL to train and test. + +###Saul-SL provided components + +
    +
  • A __Saul IInstance__ (`Saul_SL_Instance`), is simply a node in the data model graph. We call is a head because it is a global object and will be the head of a potential inference module later. Normally, we will have a classifier that applies on the head node and also other local classifiers that are applied on other nodes which are connected to the head node.
  • +
  • A __Saul Structure__ (`Saul_SL_Label_Structure`), is simply a list of labels collected fro the labels of all the engaged classifiers in the structured model.
  • +
  • __Saul Inference__ (`Saul_SL_Inference`), simply receives the list of constrained classifiers, one of these is a classifier which applies on the head object and the others are parts of the objective function and all of these share a set of constraints. Hence, inference is easily done by calling Lbjava on the list of constrained classifiers.
  • +
  • __Saul loss__ this is simply the normalized aggregation (average) of the hamming loss of the classifiers labels, this is not weighted but can be extended to consider weights.
  • +
From 00841b047c3caa7e40cc75722fd1a005679e1a18 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 16 Sep 2016 21:26:40 -0500 Subject: [PATCH 094/118] SAul-SL documentation --- .../cs/cogcomp/saul/classifier/SL_model/README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md index 878fc922..0f7a512c 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/README.md @@ -1,3 +1,4 @@ + The `SL_model` package aims at providing the possibility of designing structured output prediction models, based on generalized linear models such as structured SVMs and structured Perceptrons. For implementating any structured learning problem in SL, we need to implement the following classes, [see here.](http://cogcomp.cs.illinois.edu/software/illinois-sl/)
    @@ -5,7 +6,7 @@ For implementating any structured learning problem in SL, we need to implement t
  • The output structure, y. This should implement the IStructure interface.
  • -
  • A procedure to compute the feature vector Φ(x,y). For this you need to extned the AbstractFeatureGenerator class and override its getFeatureVector method.
  • +
  • A procedure to compute the feature vector Φ(x,y). For this you need to extend the AbstractFeatureGenerator class and override its getFeatureVector method.
  • A procedure InferenceSolver to perform the loss-augmented inference, @@ -29,7 +30,7 @@ Now here in Saul-SL, what we do is that the way we define our model is based on -The inference is done using the constraints that express the correlations between the Classifiers. -This view implements the idea of collective classification in the framework of structured output prediction models and provides the possibility of using global first order constraints and domain knowledge easily in the structured learning model. +This model implements the idea of collective classification in the framework of structured output prediction models and provides the possibility of using global first order constraints and domain knowledge easily in the structured learning model. The underlying inference is performed using ILP techniques. @@ -43,13 +44,15 @@ To solve this problem and extract the relations and entities jointly using SL's In fact, this specifies the type of most global object that is used as an independent example. The evaluation of the model also is done by calling def `Evaluate("NodeType_Name", "ListOfConstrainedClassifiers_Name",myModelName, modelPath)`. This is the [end ER application](/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala) that uses SL to train and test. -###Saul-SL provided components +###Saul-SL provided components for developer's information
    • A __Saul IInstance__ (`Saul_SL_Instance`), is simply a node in the data model graph. We call is a head because it is a global object and will be the head of a potential inference module later. Normally, we will have a classifier that applies on the head node and also other local classifiers that are applied on other nodes which are connected to the head node.
    • A __Saul Structure__ (`Saul_SL_Label_Structure`), is simply a list of labels collected fro the labels of all the engaged classifiers in the structured model.
    • -
    • __Saul Inference__ (`Saul_SL_Inference`), simply receives the list of constrained classifiers, one of these is a classifier which applies on the head object and the others are parts of the objective function and all of these share a set of constraints. Hence, inference is easily done by calling Lbjava on the list of constrained classifiers.
    • -
    • __Saul loss__ this is simply the normalized aggregation (average) of the hamming loss of the classifiers labels, this is not weighted but can be extended to consider weights.
    • +
    • __Feature Generation__ (`SL_FeatureGenerator`), The global feature function is made by adding up (and concatenation) of the join feature functions of all involved classifiers. The SparseNetwork structure is used for keeping the information of the classifiers and the LTU keeping the vectors of weights. +
    • __Saul Inference__ (`Saul_SL_Inference`), simply receives the list of constrained classifiers, one of these is a classifier which applies on the head object and the others are parts of the objective function and all of these share a set of constraints. Hence, inference is easily done by calling LBJava on the list of constrained classifiers.
    • +
    • __Saul Loss__ this is simply the normalized aggregation (average) of the hamming loss of the classifiers assigned labels, this is by default equally weighted but can be extended to input weights.
    • +
    • __Loss augmented Inference__ the score of each classifier is augmented by its loss, before the inference is performed in LBJava. This is done by using a method (that we have added) in LBJava's Learner, called `scoresAugmented`. For this modified score to be returned we set a flag called lossFlag before calling inference and after inference this flag is unset.
    From 96fefc19d71273a3454521c6b2be30f8597df3f0 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 16 Sep 2016 23:42:38 -0500 Subject: [PATCH 095/118] -SL-tests modified `subject to` to be true --- .../nlp/EntityRelation/SLTest2.scala | 5 ++-- .../nlp/EntityRelation/weightTest.scala | 23 ++++++++++--------- .../SpRLDataModelReaderTests.scala | 6 +++++ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index 644eff5f..c65e36bf 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -6,6 +6,7 @@ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook +import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, ConstrainedClassifier, Learnable } @@ -45,7 +46,7 @@ class SLTest2 extends FlatSpec with Matchers { override lazy val classifier = new SparseNetworkLearner() } object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { - def subjectTo = null + def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } override val pathToHead = Some(-pairs) @@ -54,7 +55,7 @@ class SLTest2 extends FlatSpec with Matchers { override val solver = new OJalgoHook } object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { - def subjectTo = null + def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } override val pathToHead = Some(-pairs) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index 0f5aa35c..e5f144e3 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -5,12 +5,13 @@ * http://cogcomp.cs.illinois.edu/ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation + import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook +import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{ Saul_SL_Inference, StructuredLearning } import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, Learnable } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.sl.util.WeightVector import org.scalatest.{ FlatSpec, Matchers } @@ -81,25 +82,25 @@ class weightTest extends FlatSpec with Matchers { // Initialize toy model import testModel._ object TestClassifier extends Learnable(tokens) { - def label: Property[String] = testLabel + def label = testLabel override def feature = using(word) override lazy val classifier = new SparseNetworkLearner() } object TestBiClassifier extends Learnable(tokens) { - def label: Property[String] = testLabel + def label = testLabel override def feature = using(word, biWord) override lazy val classifier = new SparseNetworkLearner() } object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { - def subjectTo = null - override val pathToHead = Some(-pairs) - override def filter(t: String, h: String): Boolean = t.equals(h) + def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } + //override val pathToHead = Some(-iEdge) + // override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook } object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { - def subjectTo = null - override val pathToHead = Some(-pairs) - override def filter(t: String, h: String): Boolean = t.equals(h) + def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } + // override val pathToHead = Some(-iEdge) + //override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook } @@ -108,7 +109,7 @@ class weightTest extends FlatSpec with Matchers { val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) // This should combine the weights - val m = StructuredLearning(tokens, cls, initialize = false) + val m = StructuredLearning(tokens, cls, initialize = true) val clNet1 = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] val clNet2 = TestBiConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] @@ -137,7 +138,7 @@ class weightTest extends FlatSpec with Matchers { object testModel extends DataModel { val tokens = node[String] - val pairs = edge(tokens, tokens) + val iEdge = edge(tokens, tokens) val testLabel = property(tokens) { x: String => x.equals("candidate") } val word = property(tokens) { x: String => x } val biWord = property(tokens) { x: String => x + "-" + x } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SpatialRoleLabeling/SpRLDataModelReaderTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SpatialRoleLabeling/SpRLDataModelReaderTests.scala index 89fb6a05..44cd16ca 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SpatialRoleLabeling/SpRLDataModelReaderTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/SpatialRoleLabeling/SpRLDataModelReaderTests.scala @@ -1,3 +1,9 @@ +/** This software is released under the University of Illinois/Research and Academic Use License. See + * the LICENSE file in the root folder for details. Copyright (c) 2016 + * + * Developed by: The Cognitive Computations Group, University of Illinois at Urbana-Champaign + * http://cogcomp.cs.illinois.edu/ + */ package edu.illinois.cs.cogcomp.saulexamples.nlp.SpatialRoleLabeling import edu.illinois.cs.cogcomp.saulexamples.nlp.SpatialRoleLabeling.Triplet.{ SpRelation, SpRelationLabels } From 320dad6b3d666a8a081c1131c5ddda63fc987a57 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 16 Sep 2016 23:56:27 -0500 Subject: [PATCH 096/118] -add SL config --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0945580a..697c4c0f 100644 --- a/.gitignore +++ b/.gitignore @@ -13,7 +13,6 @@ target/ .projectFilesBackup *.class annotation-cache/ -/config *.lc *.lex *~ From a8b96ff580617a044ec290f359419773034c0a09 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 16 Sep 2016 23:58:17 -0500 Subject: [PATCH 097/118] add config --- config/DCD.config | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 config/DCD.config diff --git a/config/DCD.config b/config/DCD.config new file mode 100644 index 00000000..3353e037 --- /dev/null +++ b/config/DCD.config @@ -0,0 +1,26 @@ +# {L2LossSSVM, StructuredPerceptron} +# LEARNING_MODEL = L2LossSSVM +LEARNING_MODEL = StructuredPerceptron +MAX_NUM_ITER = 1 +# {DCDSolver, ParallelDCDSolver, DEMIParallelDCDSolver}; +L2_LOSS_SSVM_SOLVER_TYPE = DCDSolver + +NUMBER_OF_THREADS = 1 +C_FOR_STRUCTURE = 1.0 +TRAINMINI = false +TRAINMINI_SIZE = 1000 +STOP_CONDITION = 0.0001 +CHECK_INFERENCE_OPT = false +# MAX_NUM_ITER = 250 +PROGRESS_REPORT_ITER = 10 +INNER_STOP_CONDITION = 0.00001 +MAX_ITER_INNER = 250 +MAX_ITER_INNER_FINAL = 2500 +TOTAL_NUMBER_FEATURE = -1 +CLEAN_CACHE = true +CLEAN_CACHE_ITER = 5 +DEMIDCD_NUMBER_OF_UPDATES_BEFORE_UPDATE_BUFFER = 100 +DEMIDCD_NUMBER_OF_INF_PARSE_BEFORE_UPDATE_WV = 10 +LEARNING_RATE = 0.01 +DECAY_LEARNING_RATE = false +NUMBER_OF_FEATURE_BITS = 26 From 6eed15ed89033ebacafddd37bc6609b20b9aec73 Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 18 Sep 2016 11:27:29 -0500 Subject: [PATCH 098/118] -add some documentation to the code for initialization --- .../saul/classifier/SL_model/Initialize.scala | 8 +++--- .../EntityRelation/EntityRelationApp_SL.scala | 9 ++++--- .../nlp/EntityRelation/SLTest2.scala | 26 ++++++++----------- .../nlp/EntityRelation/weightTest.scala | 6 ++--- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index ce9f0645..e2e5c6ff 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -24,7 +24,7 @@ object Initialize { var wvLength = 0 var lt: ListBuffer[Array[Float]] = ListBuffer() - if (!initialize) + if (!initialize) //this means we are not reading any model into the SparseNetworks but we forget all the models and go over the data to build the right size for the lexicon and the right number of the ltu s model.Factors.foreach { cf => cf.onClassifier.classifier.forget() @@ -59,7 +59,7 @@ object Initialize { // println("lexicon size:" + ilearner.getLexicon.size()) } //for each factor - +//In this step or we have built the lexicon by going over the data in the above block or we use the loaded lexicons in the case of initialization==true, the goal is to build a global weight vector using all classifiers and initialize it accordingly model.Factors.foreach( x => { @@ -71,7 +71,7 @@ object Initialize { val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector val t = Array.fill[Float](temp)(0) - if (initialize) { + if (initialize) { //if we are going to initialize we get the loaded weights otherwise the weights are filled with zeros for (j <- 0 until temp) t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] @@ -85,6 +85,8 @@ object Initialize { println("lexicon size: " + sparseNet.getLexicon.size(), "* label lexicon size:", sparseNet.getLabelLexicon.size()) } ) + // wv = Concatenate_(over factors)Concatenate_(over ltu) => size(wv)=sum_(over factors)sum_(over ltu)(size(ltu_i)) + val myWeight = Array(lt.flatten: _*) val wv = new WeightVector(myWeight) // wv this is one unified weight vector of all initialized LTUs val m = new SaulSLModel[HEAD](model.Factors.toList, lt) // lt is the list of individual weight vectors diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 3392080e..febd8282 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -7,13 +7,14 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils -import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.StructuredLearning import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ + /** Created by Parisa on 12/8/15. */ object EntityRelationApp_SL extends App { + import EntityRelationDataModel._ EntityRelationDataModel.populateWithConllSmallSet() //.populateWithConll() @@ -27,13 +28,15 @@ object EntityRelationApp_SL extends App { val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) + //JointTrainSparseNetwork.train[ConllRelation](pairs, cls, 5 ) + ClassifierUtils.TestClassifiers(cls: _*) val m = StructuredLearning(pairs, cls, initialize = true) println("Structured evaluation.\n") - StructuredLearning.Evaluate(pairs, cls, m, "") + //StructuredLearning.Evaluate(pairs, cls, m, "") //ClassifierUtils.TestClassifiers(cls_base:_*) } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index c65e36bf..7eda7e22 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -9,7 +9,7 @@ import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, ConstrainedClassifier, Learnable } +import edu.illinois.cs.cogcomp.saul.classifier.{JointTrainSparseNetwork, ClassifierUtils, ConstrainedClassifier, Learnable} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation @@ -33,36 +33,30 @@ class SLTest2 extends FlatSpec with Matchers { import testModel._ object TestClassifier extends Learnable(tokens) { def label: Property[String] = testLabel - override def feature = using(word) - override lazy val classifier = new SparseNetworkLearner() } + object TestBiClassifier extends Learnable(tokens) { def label: Property[String] = testLabel - override def feature = using(word, biWord) - override lazy val classifier = new SparseNetworkLearner() } - object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { - def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } + object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { + def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } override val pathToHead = Some(-pairs) - override def filter(t: String, h: String): Boolean = t.equals(h) - override val solver = new OJalgoHook } - object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { - def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } + object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { + def subjectTo = ConstrainedClassifier.constraint{ _ => new FirstOrderConstant(true) } override val pathToHead = Some(-pairs) - override def filter(t: String, h: String): Boolean = t.equals(h) - override val solver = new OJalgoHook } + val words_train = List("this", "is", "a", "candidate") val words_test = List("this", "was", "not", "true") tokens.populate(words_train) @@ -70,9 +64,11 @@ class SLTest2 extends FlatSpec with Matchers { val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) val cls_base = List(TestClassifier, TestBiClassifier) + val model = Initialize(SLProblem, new SaulSLModel(cls), initialize = true) + JointTrainSparseNetwork(tokens,cls,3) // This should combine the weights - val m = StructuredLearning(tokens, cls, initialize = false) + // val m = StructuredLearning(tokens, cls, initialize = false) val SLProblem = SL_IOManager.makeSLProblem(tokens, cls) "Structured output learning (SL)" should "get correct number of instances." in { @@ -80,7 +76,7 @@ class SLTest2 extends FlatSpec with Matchers { SLProblem.instanceList.size() should be(4) } - val model = Initialize(SLProblem, new SaulSLModel(cls)) + "Structured output learning (SL) initialization with zero" should "work." in { model.Factors.size should be(2) model.LTUWeightTemplates.size should be(4) diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index e5f144e3..b5d36506 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -92,13 +92,13 @@ class weightTest extends FlatSpec with Matchers { override lazy val classifier = new SparseNetworkLearner() } object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { - def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } + def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } //override val pathToHead = Some(-iEdge) // override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook } object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { - def subjectTo = ConstrainedClassifier.constraint[String] { x => new FirstOrderConstant(true) } + def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } // override val pathToHead = Some(-iEdge) //override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook @@ -109,7 +109,7 @@ class weightTest extends FlatSpec with Matchers { val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) // This should combine the weights - val m = StructuredLearning(tokens, cls, initialize = true) + val m = StructuredLearning(tokens, cls) val clNet1 = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] val clNet2 = TestBiConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] From 40dcfa79081ad16b715ac4f8af1a21561cc2cede Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 21 Sep 2016 20:37:44 -0500 Subject: [PATCH 099/118] -use the new SparseNetworkInit module --- .../saul/classifier/SL_model/Initialize.scala | 55 +++++-------------- .../SL_model/StructuredLearning.scala | 3 +- .../nlp/EntityRelation/SLTest2.scala | 13 ++--- 3 files changed, 23 insertions(+), 48 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index e2e5c6ff..49f31854 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -7,10 +7,10 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } -import edu.illinois.cs.cogcomp.sl.core.SLProblem +import edu.illinois.cs.cogcomp.saul.classifier.infer.InitSparseNetwork +import edu.illinois.cs.cogcomp.saul.datamodel.node.Node import edu.illinois.cs.cogcomp.sl.util.WeightVector -import scala.collection.JavaConversions._ import scala.collection.mutable.ListBuffer /** Created by Parisa on 4/1/16. @@ -19,50 +19,25 @@ import scala.collection.mutable.ListBuffer */ object Initialize { - def apply[HEAD <: AnyRef](sp: SLProblem, model: SaulSLModel[HEAD], initialize: Boolean = false): SaulSLModel[HEAD] = { + def apply[HEAD <: AnyRef](node: Node[HEAD], model: SaulSLModel[HEAD], usePreTrained: Boolean = false): SaulSLModel[HEAD] = { var wvLength = 0 var lt: ListBuffer[Array[Float]] = ListBuffer() - if (!initialize) //this means we are not reading any model into the SparseNetworks but we forget all the models and go over the data to build the right size for the lexicon and the right number of the ltu s + /*this means we are not reading any model into the SparseNetworks but + we forget all the models and go over the data to build the right size + for the lexicon and the right number of the ltu s*/ + + if (!usePreTrained) model.Factors.foreach { - cf => - cf.onClassifier.classifier.forget() - val ilearner = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] - val lLexicon = cf.onClassifier.classifier.getLabelLexicon - sp.instanceList.toList.zipWithIndex.foreach { - - case (myIns, ind) => { - val ins = myIns.asInstanceOf[Saul_SL_Instance[HEAD]] - val candis: Seq[_] = cf.getCandidates(ins.head) - candis.foreach { - x => - val a = cf.onClassifier.classifier.getExampleArray(x) - val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures - val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues - val exampleLabels = a(2).asInstanceOf[Array[Int]] - val labelValues = a(3).asInstanceOf[Array[Double]] - val label = exampleLabels(0) - var N = ilearner.getNetwork.size() - if (label >= N || ilearner.getNetwork.get(label) == null) { - val isConjunctiveLabels = ilearner.isUsingConjunctiveLabels | ilearner.getLabelLexicon.lookupKey(label).isConjunctive - ilearner.setConjunctiveLabels(isConjunctiveLabels) - val ltu: LinearThresholdUnit = ilearner.getBaseLTU - ltu.initialize(ilearner.getNumExamples, ilearner.getNumFeatures) - ilearner.getNetwork.set(label, ltu) - N = label + 1 - } - } // for each candidate - } // for each constraintFactor - } // for each example - // print("weight vector size:" + ilearner.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector.size()) - // println("lexicon size:" + ilearner.getLexicon.size()) - - } //for each factor -//In this step or we have built the lexicon by going over the data in the above block or we use the loaded lexicons in the case of initialization==true, the goal is to build a global weight vector using all classifiers and initialize it accordingly + cf => InitSparseNetwork(node, cf) + } + /*In this step or we have built the lexicon by going over the data in the above block or +we use the loaded lexicons in the case of uesPreTrained == true, the goal is to build + a global weight vector using all classifiers and initialize it accordingly to have a fixed size*/ + model.Factors.foreach( x => { - val sparseNet = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] val temp = (sparseNet.getLexicon.size()) @@ -71,7 +46,7 @@ object Initialize { val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector val t = Array.fill[Float](temp)(0) - if (initialize) { //if we are going to initialize we get the loaded weights otherwise the weights are filled with zeros + if (usePreTrained) { //if we are going to initialize we get the loaded weights otherwise the weights are filled with zeros for (j <- 0 until temp) t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 300b847d..46c2c5fc 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -24,7 +24,8 @@ object StructuredLearning { def trainSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], initialize: Boolean)(implicit t: ClassTag[HEAD]): SaulSLModel[HEAD] = { val sp = SL_IOManager.makeSLProblem(node, cls) - val model = Initialize(sp, new SaulSLModel(cls), initialize) + val model = Initialize(node, new SaulSLModel(cls), initialize) + model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LTUWeightTemplates) val para = new SLParameters // para.STOP_CONDITION = 0.0001f diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index 7eda7e22..768749d8 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -9,7 +9,7 @@ import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saul.classifier.{JointTrainSparseNetwork, ClassifierUtils, ConstrainedClassifier, Learnable} +import edu.illinois.cs.cogcomp.saul.classifier.{ JointTrainSparseNetwork, ClassifierUtils, ConstrainedClassifier, Learnable } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation @@ -51,7 +51,7 @@ class SLTest2 extends FlatSpec with Matchers { } object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { - def subjectTo = ConstrainedClassifier.constraint{ _ => new FirstOrderConstant(true) } + def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } override val pathToHead = Some(-pairs) override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook @@ -64,11 +64,11 @@ class SLTest2 extends FlatSpec with Matchers { val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) val cls_base = List(TestClassifier, TestBiClassifier) - val model = Initialize(SLProblem, new SaulSLModel(cls), initialize = true) + val model = Initialize(SLProblem, new SaulSLModel(cls), usePreTrained = true) - JointTrainSparseNetwork(tokens,cls,3) + JointTrainSparseNetwork(tokens, cls, 3) // This should combine the weights - // val m = StructuredLearning(tokens, cls, initialize = false) + // val m = StructuredLearning(tokens, cls, initialize = false) val SLProblem = SL_IOManager.makeSLProblem(tokens, cls) "Structured output learning (SL)" should "get correct number of instances." in { @@ -76,7 +76,6 @@ class SLTest2 extends FlatSpec with Matchers { SLProblem.instanceList.size() should be(4) } - "Structured output learning (SL) initialization with zero" should "work." in { model.Factors.size should be(2) model.LTUWeightTemplates.size should be(4) @@ -93,7 +92,7 @@ class SLTest2 extends FlatSpec with Matchers { } ClassifierUtils.TrainClassifiers(5, cls_base: _*) - val InitializedModel = Initialize(SLProblem, new SaulSLModel(cls), initialize = true) + val InitializedModel = Initialize(SLProblem, new SaulSLModel(cls), usePreTrained = true) "Structured output learning (SL) initialization with trained models" should "work." in { println("Factors:", InitializedModel.Factors.size) println("LTUs:", InitializedModel.LTUWeightTemplates.size) From d4fcdf4124d931aa29eb35cf8fc27a066ac4dbdd Mon Sep 17 00:00:00 2001 From: kordjam Date: Sun, 25 Sep 2016 00:18:47 -0500 Subject: [PATCH 100/118] -some documentation -some tests -some documentation --- .../saul/classifier/SL_model/Initialize.scala | 21 +++---- .../SL_model/SL_FeatureGenerator.scala | 1 + .../SL_model/StructuredLearning.scala | 8 +-- .../classifier/infer/InitSparseNetwork.scala | 3 +- .../EntityRelation/EntityRelationApp_SL.scala | 8 +-- .../EntityRelationSLTests.scala | 60 +++++++++++++------ .../EntityRelation/EntityRelationTests.scala | 7 ++- .../nlp/EntityRelation/SLTest2.scala | 34 +++++------ .../nlp/EntityRelation/weightTest.scala | 22 ++++++- 9 files changed, 107 insertions(+), 57 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala index 49f31854..b08bc001 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Initialize.scala @@ -22,7 +22,7 @@ object Initialize { def apply[HEAD <: AnyRef](node: Node[HEAD], model: SaulSLModel[HEAD], usePreTrained: Boolean = false): SaulSLModel[HEAD] = { var wvLength = 0 - var lt: ListBuffer[Array[Float]] = ListBuffer() + var fullWeightList: ListBuffer[Array[Float]] = ListBuffer() /*this means we are not reading any model into the SparseNetworks but we forget all the models and go over the data to build the right size @@ -39,22 +39,22 @@ we use the loaded lexicons in the case of uesPreTrained == true, the goal is to model.Factors.foreach( x => { val sparseNet = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] - val temp = (sparseNet.getLexicon.size()) + val lexiconSize = (sparseNet.getLexicon.size()) for (i <- 0 until sparseNet.getNetwork.size()) { - val getTheWeight = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector - val t = Array.fill[Float](temp)(0) + val trainedWeighs = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector + val fullWeights = Array.fill[Float](lexiconSize)(0) if (usePreTrained) { //if we are going to initialize we get the loaded weights otherwise the weights are filled with zeros - for (j <- 0 until temp) - t(j) = getTheWeight.getWeight(j).asInstanceOf[Float] + for (j <- 0 until lexiconSize) + fullWeights(j) = trainedWeighs.getWeight(j).asInstanceOf[Float] } - lt = lt :+ t + fullWeightList = fullWeightList :+ fullWeights - wvLength = wvLength + temp + wvLength = wvLength + lexiconSize } println("lexicon size: " + sparseNet.getLexicon.size(), "* label lexicon size:", sparseNet.getLabelLexicon.size()) @@ -62,10 +62,11 @@ we use the loaded lexicons in the case of uesPreTrained == true, the goal is to ) // wv = Concatenate_(over factors)Concatenate_(over ltu) => size(wv)=sum_(over factors)sum_(over ltu)(size(ltu_i)) - val myWeight = Array(lt.flatten: _*) + val myWeight = Array(fullWeightList.flatten: _*) val wv = new WeightVector(myWeight) // wv this is one unified weight vector of all initialized LTUs - val m = new SaulSLModel[HEAD](model.Factors.toList, lt) // lt is the list of individual weight vectors + val m = new SaulSLModel[HEAD](model.Factors.toList, fullWeightList) // lt is the list of individual weight vectors m.wv = wv m + /*This weigh vector is a a flat vector containing one block of weights per each ltu*/ } //end f apply } // end of object diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala index 9c7d3955..77af2478 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SL_FeatureGenerator.scala @@ -34,6 +34,7 @@ class SL_FeatureGenerator[HEAD <: AnyRef](model: SaulSLModel[HEAD]) extends Abst candis.foreach { (ci) => var localOffset = 0 + //This block is the conversion from Lbjava to SL feature vectors val a = sparseNet.getExampleArray(ci, false) var a0 = a(0).asInstanceOf[Array[Int]] var a1 = a(1).asInstanceOf[Array[Double]] diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 46c2c5fc..73a8fd2b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -17,14 +17,14 @@ import scala.reflect._ /** Created by Parisa on 12/3/15. */ object StructuredLearning { - def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], initialize: Boolean = false)(implicit headTag: ClassTag[HEAD]) = + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], usePreTrained: Boolean = false)(implicit headTag: ClassTag[HEAD]) = { - trainSSVM[HEAD](node, cls, initialize) + trainSSVM[HEAD](node, cls, usePreTrained) } - def trainSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], initialize: Boolean)(implicit t: ClassTag[HEAD]): SaulSLModel[HEAD] = { + def trainSSVM[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], usePreTrained: Boolean)(implicit t: ClassTag[HEAD]): SaulSLModel[HEAD] = { val sp = SL_IOManager.makeSLProblem(node, cls) - val model = Initialize(node, new SaulSLModel(cls), initialize) + val model = Initialize(node, new SaulSLModel(cls), usePreTrained) model.infSolver = new Saul_SL_Inference[HEAD](model.Factors.toList, model.LTUWeightTemplates) val para = new SLParameters diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala index a9df6c4c..8a73191a 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala @@ -14,10 +14,11 @@ import edu.illinois.cs.cogcomp.saul.datamodel.node.Node */ object InitSparseNetwork { def apply[HEAD <: AnyRef](node: Node[HEAD], cClassifier: ConstrainedClassifier[_, HEAD]) = { + val allHeads = node.getTrainingInstances //this means we are not reading any model into the SparseNetworks // but we forget all the models and go over the data to build the right - // size for the lexicon and the right number of the ltu s + // size for the lexicon and the right number of ltu s cClassifier.onClassifier.classifier.forget() val iLearner = cClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] allHeads.foreach { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index febd8282..2d82ed65 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -16,7 +16,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationCon object EntityRelationApp_SL extends App { import EntityRelationDataModel._ - EntityRelationDataModel.populateWithConllSmallSet() //.populateWithConll() + EntityRelationDataModel.populateWithConll() //.populateWithConll() ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) @@ -30,13 +30,13 @@ object EntityRelationApp_SL extends App { //JointTrainSparseNetwork.train[ConllRelation](pairs, cls, 5 ) - ClassifierUtils.TestClassifiers(cls: _*) + //ClassifierUtils.TestClassifiers(cls: _*) - val m = StructuredLearning(pairs, cls, initialize = true) + val m = StructuredLearning(pairs, cls, usePreTrained = true) println("Structured evaluation.\n") - //StructuredLearning.Evaluate(pairs, cls, m, "") + StructuredLearning.Evaluate(pairs, cls, m, "") //ClassifierUtils.TestClassifiers(cls_base:_*) } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala index a3a53288..e4f7c77d 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationSLTests.scala @@ -6,51 +6,72 @@ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation +import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation +import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ import edu.illinois.cs.cogcomp.sl.core.SLParameters -import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory import org.scalatest.{ FlatSpec, Matchers } /** Created by Parisa on 6/10/16. */ class EntityRelationSLTests extends FlatSpec with Matchers { + /*this lines of setting are used in all the tests below them*/ + populateWithConllSmallSet() val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) + val cls_base = List(PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) val SLProblem = SL_IOManager.makeSLProblem(pairs, cls) + val para = new SLParameters + para.loadConfigFile("../config/DCD.config") + + val xGold = SLProblem.instanceList.get(0) + val yGold = SLProblem.goldStructureList.get(0) + + /*Tests*/ + "Structured output learning (SL)" should "get correct number of instances." in { SLProblem.goldStructureList.size() should be(24) SLProblem.instanceList.size() should be(24) } - val model = Initialize(SLProblem, new SaulSLModel(cls)) "Structured output learning (SL) initialization" should "work." in { + val model = Initialize(pairs, new SaulSLModel(cls), usePreTrained = false) model.Factors.size should be(5) model.LTUWeightTemplates.size should be(10) model.wv.getLength should be(1144) model.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) } + "Structured output learning (SL) without initialization using trained models" should "work." in { + ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, cls_base: _*) + val model = Initialize(pairs, new SaulSLModel(cls), usePreTrained = true) + model.Factors.size should be(5) + model.LTUWeightTemplates.size should be(10) + model.wv.getLength should be(171582) + (model.wv.getWeightArray.filter(p => (p > 0.00)).length < 20000) should be(true) + // model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum should be(96.0) + } - val xGold = SLProblem.instanceList.get(0) - val yGold = SLProblem.goldStructureList.get(0) - model.featureGenerator = new SL_FeatureGenerator(model) + // val a = sparseNet.getExampleArray(ci, false) + // var a0 = a(0).asInstanceOf[Array[Int]] + // var a1 = a(1).asInstanceOf[Array[Double]] + // val fvTemp = new FeatureVectorBuffer(a0, a1) "Structured output learning (SL) Feature extraction" should "work." in { - model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum should be(96.0) - } + // val model = Initialize(pairs, new SaulSLModel(cls), usePreTrained = false) - val para = new SLParameters - para.loadConfigFile("../config/DCD.config") - model.para = para - model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates) - val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) + } "Structured output learning's loss" should " be calculate correctly." in { + val model = Initialize(pairs, new SaulSLModel(cls), usePreTrained = false) + model.para = para + model.infSolver = new Saul_SL_Inference[ConllRelation](model.Factors.toList, model.LTUWeightTemplates) + //val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) val yTest = new Saul_SL_Label_Structure[ConllRelation](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].head.asInstanceOf[ConllRelation]) yTest.labels = for ( @@ -61,14 +82,15 @@ class EntityRelationSLTests extends FlatSpec with Matchers { model.infSolver.getLoss(xGold, yGold, yTest) >= (0.8) should be(true) } - val weight = learner.train(SLProblem, model.wv) + // val weight = learner.train(SLProblem, model.wv) "Structured output learning" should " have a correctly working inference module." in { - val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) - val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) - model.infSolver.getLoss(xGold, yGold, yPredicted) should be(0.00) - model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) - (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. - asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) + // val model = Initialize(pairs, new SaulSLModel(cls), usePreTrained = false) + // val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) + // val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) + // // model.infSolver.getLoss(xGold, yGold, yPredicted) should be(0.00) + // // model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) + // (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. + // asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) } "Structured output learning (SL)" should "really work in Saul." in { diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala index b2982d91..cf1adec0 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationTests.scala @@ -92,6 +92,9 @@ class EntityRelationTests extends FlatSpec with Matchers { ClassifierUtils.TrainClassifiers(1, cls_base) + PerConstrainedClassifier.onClassifier.classifier.getLabelLexicon.size() should be(2) + PerConstrainedClassifier.onClassifier.classifier.getLexicon.size() should be(1661) + PerConstrainedClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector.size() should be(1661) val jointTrainIteration = 1 @@ -99,7 +102,9 @@ class EntityRelationTests extends FlatSpec with Matchers { pairs, cls, jointTrainIteration, init = true ) - PerConstrainedClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector.size() should be(50) + PerConstrainedClassifier.onClassifier.classifier.getLabelLexicon.size() should be(2) + PerConstrainedClassifier.onClassifier.classifier.getLexicon.size() should be(84) + PerConstrainedClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector.size() should be(84) } } \ No newline at end of file diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index 768749d8..fea24072 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -22,7 +22,7 @@ import org.scalatest.{ FlatSpec, Matchers } class SLTest2 extends FlatSpec with Matchers { object testModel extends DataModel { val tokens = node[String] - val pairs = edge(tokens, tokens) + // val pairs = edge(tokens, tokens) val testLabel = property(tokens) { x: String => x.equals("candidate") } val word = property(tokens) { x: String => x } val biWord = property(tokens) { x: String => x + "-" + x } @@ -45,15 +45,15 @@ class SLTest2 extends FlatSpec with Matchers { object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } - override val pathToHead = Some(-pairs) - override def filter(t: String, h: String): Boolean = t.equals(h) + // override val pathToHead = Some(-pairs) + //override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook } object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } - override val pathToHead = Some(-pairs) - override def filter(t: String, h: String): Boolean = t.equals(h) + // override val pathToHead = Some(-pairs) + //override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook } @@ -64,9 +64,9 @@ class SLTest2 extends FlatSpec with Matchers { val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) val cls_base = List(TestClassifier, TestBiClassifier) - val model = Initialize(SLProblem, new SaulSLModel(cls), usePreTrained = true) + val model = Initialize(tokens, new SaulSLModel(cls), usePreTrained = true) - JointTrainSparseNetwork(tokens, cls, 3) + JointTrainSparseNetwork(tokens, cls, 3, true) // This should combine the weights // val m = StructuredLearning(tokens, cls, initialize = false) @@ -92,7 +92,7 @@ class SLTest2 extends FlatSpec with Matchers { } ClassifierUtils.TrainClassifiers(5, cls_base: _*) - val InitializedModel = Initialize(SLProblem, new SaulSLModel(cls), usePreTrained = true) + val InitializedModel = Initialize(tokens, new SaulSLModel(cls), usePreTrained = true) "Structured output learning (SL) initialization with trained models" should "work." in { println("Factors:", InitializedModel.Factors.size) println("LTUs:", InitializedModel.LTUWeightTemplates.size) @@ -136,15 +136,15 @@ class SLTest2 extends FlatSpec with Matchers { model.infSolver.getLoss(xGold, yGold, yTest) >= (0.8) should be(true) } - val weight = learner.train(SLProblem, model.wv) - "Structured output learning" should " have a correctly working inference module." in { - val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) - val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) - model.infSolver.getLoss(xGold, yGold, yPredicted) should be(0.00) - model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) - (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. - asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) - } + // val weight = learner.train(SLProblem, model.wv) + // "Structured output learning" should " have a correctly working inference module." in { + // val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) + // val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) + // model.infSolver.getLoss(xGold, yGold, yPredicted) should be(0.00) + // model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) + // (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. + // asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) + // } "Structured output learning (SL)" should "really work in Saul." in { diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala index b5d36506..8be17f26 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala @@ -12,7 +12,7 @@ import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetwork import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{ Saul_SL_Inference, StructuredLearning } import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, Learnable } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.util.WeightVector +import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, WeightVector } import org.scalatest.{ FlatSpec, Matchers } import scala.collection.mutable.ListBuffer @@ -76,6 +76,19 @@ class weightTest extends FlatSpec with Matchers { val factorWeight3 = wv.getWeightArray.slice(offset, offset + t3.length) factorWeight3 should be(Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f)) } + "featureVector operations" should "work" in { + val fvGlobal = new FeatureVectorBuffer() + val fv = new FeatureVectorBuffer() + val a0: Array[Int] = Array(1, 2, 3) + val a1: Array[Double] = Array(0.1, 0.2, 0.3) + val fvTemp = new FeatureVectorBuffer(a0, a1) + fvGlobal.addFeature(fvTemp) + fvTemp.toFeatureVector.getIndices should be(Array(1, 2, 3)) + fvGlobal.addFeature(fvTemp, 3) + fvGlobal.addFeature(fvTemp, 3) + fvGlobal.shift(1) + fvGlobal.toFeatureVector.getIndices should be(Array(2, 3, 4, 5, 6, 7)) + } // Testing the original functions with real classifiers "integration test" should "work" in { @@ -83,22 +96,28 @@ class weightTest extends FlatSpec with Matchers { import testModel._ object TestClassifier extends Learnable(tokens) { def label = testLabel + override def feature = using(word) + override lazy val classifier = new SparseNetworkLearner() } object TestBiClassifier extends Learnable(tokens) { def label = testLabel + override def feature = using(word, biWord) + override lazy val classifier = new SparseNetworkLearner() } object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } + //override val pathToHead = Some(-iEdge) // override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook } object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } + // override val pathToHead = Some(-iEdge) //override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook @@ -143,4 +162,5 @@ class weightTest extends FlatSpec with Matchers { val word = property(tokens) { x: String => x } val biWord = property(tokens) { x: String => x + "-" + x } } + } From 0ff34ef117141835f360c7fa800ebc9a4b6eca3c Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 28 Sep 2016 13:08:15 -0500 Subject: [PATCH 101/118] -changed configuration -omitted logger info from constrained classifier (for easily tracing the SL messages) --- config/DCD.config | 2 +- .../saul/classifier/ConstrainedClassifier.scala | 13 +++++++------ .../classifier/SL_model/Saul_SL_Inference.scala | 2 +- .../nlp/EntityRelation/EntityRelationApp.scala | 2 +- .../EntityRelation/EntityRelationApp_SL.scala | 7 +++---- .../nlp/EntityRelation/SLTest2.scala | 17 ++++++++++++++--- 6 files changed, 27 insertions(+), 16 deletions(-) diff --git a/config/DCD.config b/config/DCD.config index 3353e037..77fd5f6e 100644 --- a/config/DCD.config +++ b/config/DCD.config @@ -1,7 +1,7 @@ # {L2LossSSVM, StructuredPerceptron} # LEARNING_MODEL = L2LossSSVM LEARNING_MODEL = StructuredPerceptron -MAX_NUM_ITER = 1 +MAX_NUM_ITER = 20 # {DCDSolver, ParallelDCDSolver, DEMIParallelDCDSolver}; L2_LOSS_SSVM_SOLVER_TYPE = DCDSolver diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 8e0d1bb0..6c18c270 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -72,13 +72,13 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi val l = pathToHead.get.forward.neighborsOf(x).toSet.toList if (l.isEmpty) { - logger.error("Warning: Failed to find head") + // logger.error("Warning: Failed to find head") None } else if (l.size != 1) { - logger.warn("Find too many heads") + // logger.warn("Find too many heads") Some(l.head) } else { - logger.info(s"Found head ${l.head} for child $x") + /// logger.info(s"Found head ${l.head} for child $x") Some(l.head) } } @@ -95,7 +95,7 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi val l = pathToHead.get.backward.neighborsOf(head) if (l.isEmpty) { - logger.error("Failed to find part") + // logger.error("Failed to find part") Seq.empty[T] } else { l.filter(filter(_, head)).toSeq @@ -110,7 +110,7 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi var inference = InferenceManager.get(name, head) if (inference == null) { inference = infer(head) - logger.warn(s"Inference ${name} has not been cached; running inference . . . ") + // logger.warn(s"Inference ${name} has not been cached; running inference . . . ") InferenceManager.put(name, inference) } inference.valueOf(cls, t) @@ -158,7 +158,8 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi .orElse({ onClassifier match { case clf: Learnable[T] => Some(clf.node) - case _ => logger.error("pathToHead is not provided and the onClassifier is not a Learnable!"); None + case _ => None + // logger.error("pathToHead is not provided and the onClassifier is not a Learnable!"); None } }) .map(node => node.getTestingInstances) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala index 7e27998b..4e907ddf 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/Saul_SL_Inference.scala @@ -51,7 +51,7 @@ class Saul_SL_Inference[HEAD <: AnyRef](factors: List[ConstrainedClassifier[_, H TotalLoss = TotalLoss + localLoss / candidates.size } TotalLoss = TotalLoss / factors.size - //println("Loss=" + TotalLoss) + println("Loss=" + TotalLoss) TotalLoss } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala index 624bf122..7e1da20a 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala @@ -13,7 +13,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationCla import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ -object EntityRelationApp extends Logging { +object EntityRelationApp extends Logging { // learned models from the "saul-er-models" jar package val jarModelPath = "edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/models/" diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 2d82ed65..9e56a065 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -6,7 +6,6 @@ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation -import edu.illinois.cs.cogcomp.saul.classifier.ClassifierUtils import edu.illinois.cs.cogcomp.saul.classifier.SL_model.StructuredLearning import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ @@ -18,7 +17,7 @@ object EntityRelationApp_SL extends App { EntityRelationDataModel.populateWithConll() //.populateWithConll() - ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + // ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) val cls_base = List(PersonClassifier, OrganizationClassifier, LocationClassifier, LivesInClassifier, WorksForClassifier) @@ -32,11 +31,11 @@ object EntityRelationApp_SL extends App { //ClassifierUtils.TestClassifiers(cls: _*) - val m = StructuredLearning(pairs, cls, usePreTrained = true) + val m = StructuredLearning(pairs, cls, usePreTrained = false) println("Structured evaluation.\n") - StructuredLearning.Evaluate(pairs, cls, m, "") + // StructuredLearning.Evaluate(pairs, cls, m, "") //ClassifierUtils.TestClassifiers(cls_base:_*) } diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index fea24072..a93e2037 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -5,21 +5,23 @@ * http://cogcomp.cs.illinois.edu/ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation + import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant -import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } +import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseNetworkLearner} import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saul.classifier.{ JointTrainSparseNetwork, ClassifierUtils, ConstrainedClassifier, Learnable } +import edu.illinois.cs.cogcomp.saul.classifier.{JointTrainSparseNetwork, ClassifierUtils, ConstrainedClassifier, Learnable} import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation import edu.illinois.cs.cogcomp.sl.core.SLParameters import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory -import org.scalatest.{ FlatSpec, Matchers } +import org.scalatest.{FlatSpec, Matchers} /** Created by Parisa on 7/2/16. */ class SLTest2 extends FlatSpec with Matchers { + object testModel extends DataModel { val tokens = node[String] // val pairs = edge(tokens, tokens) @@ -27,24 +29,32 @@ class SLTest2 extends FlatSpec with Matchers { val word = property(tokens) { x: String => x } val biWord = property(tokens) { x: String => x + "-" + x } } + // Testing the original functions with real classifiers // "integration test" should "work" in { // Initialize toy model + import testModel._ + object TestClassifier extends Learnable(tokens) { def label: Property[String] = testLabel + override def feature = using(word) + override lazy val classifier = new SparseNetworkLearner() } object TestBiClassifier extends Learnable(tokens) { def label: Property[String] = testLabel + override def feature = using(word, biWord) + override lazy val classifier = new SparseNetworkLearner() } object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } + // override val pathToHead = Some(-pairs) //override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook @@ -52,6 +62,7 @@ class SLTest2 extends FlatSpec with Matchers { object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } + // override val pathToHead = Some(-pairs) //override def filter(t: String, h: String): Boolean = t.equals(h) override val solver = new OJalgoHook From 1cdf1dce9636baec6c457041d5aa2d5acb7dde09 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 28 Sep 2016 14:00:19 -0500 Subject: [PATCH 102/118] -add a traceable test before a unit test --- .../nlp/EntityRelation/preTest.scala | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala new file mode 100644 index 00000000..e8407a2c --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala @@ -0,0 +1,171 @@ +/** This software is released under the University of Illinois/Research and Academic Use License. See + * the LICENSE file in the root folder for details. Copyright (c) 2016 + * + * Developed by: The Cognitive Computations Group, University of Illinois at Urbana-Champaign + * http://cogcomp.cs.illinois.edu/ + */ +package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation + +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook +import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant +import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseNetworkLearner} +import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ +import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier, Learnable} +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel +import edu.illinois.cs.cogcomp.saul.datamodel.property.Property +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation +import edu.illinois.cs.cogcomp.sl.core.SLParameters +import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory + +/** + * Created by Parisa on 9/27/16. + */ +object preTest extends App{ + + + object testModel extends DataModel { + val tokens = node[String] + // val pairs = edge(tokens, tokens) + val testLabel = property(tokens) { x: String => x.equals("candidate") } + val word = property(tokens) { x: String => x } + val biWord = property(tokens) { x: String => x + "-" + x } + } + + // Testing the original functions with real classifiers + // "integration test" should "work" in { + // Initialize toy model + + import testModel._ + + object TestClassifier extends Learnable(tokens) { + def label: Property[String] = testLabel + + override def feature = using(word) + + override lazy val classifier = new SparseNetworkLearner() + } + + object TestBiClassifier extends Learnable(tokens) { + def label: Property[String] = testLabel + + override def feature = using(word, biWord) + + override lazy val classifier = new SparseNetworkLearner() + } + + object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { + def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } + + // override val pathToHead = Some(-pairs) + //override def filter(t: String, h: String): Boolean = t.equals(h) + override val solver = new OJalgoHook + } + + object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { + def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } + + // override val pathToHead = Some(-pairs) + //override def filter(t: String, h: String): Boolean = t.equals(h) + override val solver = new OJalgoHook + } + + val words_train = List("this", "is", "a", "candidate") + val words_test = List("this", "was", "not", "true") + tokens.populate(words_train) + tokens.populate(words_test, train = false) + + val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) + val cls_base = List(TestClassifier, TestBiClassifier) + val model = Initialize(tokens, new SaulSLModel(cls), usePreTrained = false) + + // JointTrainSparseNetwork(tokens, cls, 3, true) + // This should combine the weights + // val m = StructuredLearning(tokens, cls, initialize = false) + + val SLProblem = SL_IOManager.makeSLProblem(tokens, cls) + + println("lables:", SLProblem.goldStructureList.size()) + println("examples",SLProblem.instanceList.size()) + + println("factors:",model.Factors.size) + println("ltus:",model.LTUWeightTemplates.size) + model.wv.getLength + model.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty + + + val xGold = SLProblem.instanceList.get(0) + val yGold = SLProblem.goldStructureList.get(0) + model.featureGenerator = new SL_FeatureGenerator(model) + + + model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum //should be(3.0) + + + ClassifierUtils.TrainClassifiers(5, cls_base: _*) + val InitializedModel = Initialize(tokens, new SaulSLModel(cls), usePreTrained = true) + // "Structured output learning (SL) initialization with trained models" should "work." in + + println("Factors:", InitializedModel.Factors.size) + println("LTUs:", InitializedModel.LTUWeightTemplates.size) + println("modellength:", InitializedModel.wv.getLength) + println("weightArray:", InitializedModel.wv.getWeightArray) + InitializedModel.Factors.size //should be(2) + InitializedModel.LTUWeightTemplates.size //should be(4) + InitializedModel.wv.getLength //should be(24) + + InitializedModel.Factors.foreach( + x => { + val classifierWeightVector0 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + val baseWeightVector0 = cls_base(0).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + + classifierWeightVector0 //should be(baseWeightVector0) + + val classifierWeightVector1 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector + val baseWeightVector1 = cls_base(1).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + + classifierWeightVector1 //should be(baseWeightVector1) + } + ) + //InitializedModel.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) + + + + val para = new SLParameters + para.loadConfigFile("../config/DCD.config") + model.para = para + model.infSolver = new Saul_SL_Inference[String](model.Factors.toList, model.LTUWeightTemplates) + val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para) + + //"Structured output learning's loss" should " be calculate correctly." in { + + val yTest = new Saul_SL_Label_Structure[String](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[String]].head.asInstanceOf[String]) + yTest.labels = for ( + l <- yGold.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].labels + ) yield "true" + + val yTest2 = new Saul_SL_Label_Structure[String](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[String]].head.asInstanceOf[String]) + yTest2.labels(0)= "true" + yTest2.labels(1)="false" + print(model.infSolver.getLoss(xGold, yGold, yTest2),"here") + + print(model.infSolver.getLoss(xGold, yGold, yGold),"here") //should be(0.00) + println(model.infSolver.getLoss(xGold, yGold, yTest),"here" )//>= (0.8) //should be(true) + // } + + val weight = learner.train(SLProblem, model.wv) + // "Structured output learning" should " have a correctly working inference module." in { + val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) + val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) + println(model.infSolver.getLoss(xGold, yGold, yPredicted),"here")// should be(0.00) + // model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) + // (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. + // asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) + // } + + // "Structured output learning (SL)" should "really work in Saul." in { + + //} + + // } + +} From ff5f788e464a3927c7de904e98a83ac70175c992 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 28 Sep 2016 14:01:12 -0500 Subject: [PATCH 103/118] -format --- .../classifier/ConstrainedClassifier.scala | 12 +-- .../EntityRelation/EntityRelationApp.scala | 2 +- .../EntityRelation/EntityRelationApp_SL.scala | 4 +- .../nlp/EntityRelation/preTest.scala | 101 ++++++++---------- .../nlp/EntityRelation/SLTest2.scala | 6 +- 5 files changed, 59 insertions(+), 66 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala index 6c18c270..7c66a9bf 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/ConstrainedClassifier.scala @@ -72,13 +72,13 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi val l = pathToHead.get.forward.neighborsOf(x).toSet.toList if (l.isEmpty) { - // logger.error("Warning: Failed to find head") + // logger.error("Warning: Failed to find head") None } else if (l.size != 1) { - // logger.warn("Find too many heads") + // logger.warn("Find too many heads") Some(l.head) } else { - /// logger.info(s"Found head ${l.head} for child $x") + /// logger.info(s"Found head ${l.head} for child $x") Some(l.head) } } @@ -95,7 +95,7 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi val l = pathToHead.get.backward.neighborsOf(head) if (l.isEmpty) { - // logger.error("Failed to find part") + // logger.error("Failed to find part") Seq.empty[T] } else { l.filter(filter(_, head)).toSeq @@ -110,7 +110,7 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi var inference = InferenceManager.get(name, head) if (inference == null) { inference = infer(head) - // logger.warn(s"Inference ${name} has not been cached; running inference . . . ") + // logger.warn(s"Inference ${name} has not been cached; running inference . . . ") InferenceManager.put(name, inference) } inference.valueOf(cls, t) @@ -159,7 +159,7 @@ abstract class ConstrainedClassifier[T <: AnyRef, HEAD <: AnyRef](val onClassifi onClassifier match { case clf: Learnable[T] => Some(clf.node) case _ => None - // logger.error("pathToHead is not provided and the onClassifier is not a Learnable!"); None + // logger.error("pathToHead is not provided and the onClassifier is not a Learnable!"); None } }) .map(node => node.getTestingInstances) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala index 7e1da20a..624bf122 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp.scala @@ -13,7 +13,7 @@ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationCla import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationDataModel._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ -object EntityRelationApp extends Logging { +object EntityRelationApp extends Logging { // learned models from the "saul-er-models" jar package val jarModelPath = "edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/models/" diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 9e56a065..ddbda473 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -17,7 +17,7 @@ object EntityRelationApp_SL extends App { EntityRelationDataModel.populateWithConll() //.populateWithConll() - // ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) + // ClassifierUtils.LoadClassifier(EntityRelationApp.jarModelPath, PersonClassifier, OrganizationClassifier, LocationClassifier, WorksForClassifier, LivesInClassifier) val cls_base = List(PersonClassifier, OrganizationClassifier, LocationClassifier, LivesInClassifier, WorksForClassifier) @@ -35,7 +35,7 @@ object EntityRelationApp_SL extends App { println("Structured evaluation.\n") - // StructuredLearning.Evaluate(pairs, cls, m, "") + // StructuredLearning.Evaluate(pairs, cls, m, "") //ClassifierUtils.TestClassifiers(cls_base:_*) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala index e8407a2c..a150f5ca 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/preTest.scala @@ -8,20 +8,18 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant -import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseNetworkLearner} +import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, ConstrainedClassifier, Learnable} +import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, ConstrainedClassifier, Learnable } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation import edu.illinois.cs.cogcomp.sl.core.SLParameters import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory -/** - * Created by Parisa on 9/27/16. - */ -object preTest extends App{ - +/** Created by Parisa on 9/27/16. + */ +object preTest extends App { object testModel extends DataModel { val tokens = node[String] @@ -78,57 +76,52 @@ object preTest extends App{ val cls_base = List(TestClassifier, TestBiClassifier) val model = Initialize(tokens, new SaulSLModel(cls), usePreTrained = false) - // JointTrainSparseNetwork(tokens, cls, 3, true) + // JointTrainSparseNetwork(tokens, cls, 3, true) // This should combine the weights // val m = StructuredLearning(tokens, cls, initialize = false) val SLProblem = SL_IOManager.makeSLProblem(tokens, cls) - println("lables:", SLProblem.goldStructureList.size()) - println("examples",SLProblem.instanceList.size()) - - println("factors:",model.Factors.size) - println("ltus:",model.LTUWeightTemplates.size) - model.wv.getLength - model.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty + println("lables:", SLProblem.goldStructureList.size()) + println("examples", SLProblem.instanceList.size()) + println("factors:", model.Factors.size) + println("ltus:", model.LTUWeightTemplates.size) + model.wv.getLength + model.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty val xGold = SLProblem.instanceList.get(0) val yGold = SLProblem.goldStructureList.get(0) model.featureGenerator = new SL_FeatureGenerator(model) - - model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum //should be(3.0) - + model.featureGenerator.getFeatureVector(xGold, yGold).getValues.sum //should be(3.0) ClassifierUtils.TrainClassifiers(5, cls_base: _*) val InitializedModel = Initialize(tokens, new SaulSLModel(cls), usePreTrained = true) - // "Structured output learning (SL) initialization with trained models" should "work." in - - println("Factors:", InitializedModel.Factors.size) - println("LTUs:", InitializedModel.LTUWeightTemplates.size) - println("modellength:", InitializedModel.wv.getLength) - println("weightArray:", InitializedModel.wv.getWeightArray) - InitializedModel.Factors.size //should be(2) - InitializedModel.LTUWeightTemplates.size //should be(4) - InitializedModel.wv.getLength //should be(24) + // "Structured output learning (SL) initialization with trained models" should "work." in - InitializedModel.Factors.foreach( - x => { - val classifierWeightVector0 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector - val baseWeightVector0 = cls_base(0).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + println("Factors:", InitializedModel.Factors.size) + println("LTUs:", InitializedModel.LTUWeightTemplates.size) + println("modellength:", InitializedModel.wv.getLength) + println("weightArray:", InitializedModel.wv.getWeightArray) + InitializedModel.Factors.size //should be(2) + InitializedModel.LTUWeightTemplates.size //should be(4) + InitializedModel.wv.getLength //should be(24) - classifierWeightVector0 //should be(baseWeightVector0) + InitializedModel.Factors.foreach( + x => { + val classifierWeightVector0 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + val baseWeightVector0 = cls_base(0).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector - val classifierWeightVector1 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector - val baseWeightVector1 = cls_base(1).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector - - classifierWeightVector1 //should be(baseWeightVector1) - } - ) - //InitializedModel.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) + classifierWeightVector0 //should be(baseWeightVector0) + val classifierWeightVector1 = x.onClassifier.classifier.asInstanceOf[SparseNetworkLearner].getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector + val baseWeightVector1 = cls_base(1).classifier.asInstanceOf[SparseNetworkLearner].getLTU(0).asInstanceOf[LinearThresholdUnit].getWeightVector + classifierWeightVector1 //should be(baseWeightVector1) + } + ) + //InitializedModel.wv.getWeightArray.filter(p => (p > 0.00)).isEmpty should be(true) val para = new SLParameters para.loadConfigFile("../config/DCD.config") @@ -138,31 +131,31 @@ object preTest extends App{ //"Structured output learning's loss" should " be calculate correctly." in { - val yTest = new Saul_SL_Label_Structure[String](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[String]].head.asInstanceOf[String]) - yTest.labels = for ( - l <- yGold.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].labels - ) yield "true" + val yTest = new Saul_SL_Label_Structure[String](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[String]].head.asInstanceOf[String]) + yTest.labels = for ( + l <- yGold.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].labels + ) yield "true" val yTest2 = new Saul_SL_Label_Structure[String](cls, yGold.asInstanceOf[Saul_SL_Label_Structure[String]].head.asInstanceOf[String]) - yTest2.labels(0)= "true" - yTest2.labels(1)="false" - print(model.infSolver.getLoss(xGold, yGold, yTest2),"here") + yTest2.labels(0) = "true" + yTest2.labels(1) = "false" + print(model.infSolver.getLoss(xGold, yGold, yTest2), "here") - print(model.infSolver.getLoss(xGold, yGold, yGold),"here") //should be(0.00) - println(model.infSolver.getLoss(xGold, yGold, yTest),"here" )//>= (0.8) //should be(true) - // } + print(model.infSolver.getLoss(xGold, yGold, yGold), "here") //should be(0.00) + println(model.infSolver.getLoss(xGold, yGold, yTest), "here") //>= (0.8) //should be(true) + // } - val weight = learner.train(SLProblem, model.wv) + val weight = learner.train(SLProblem, model.wv) // "Structured output learning" should " have a correctly working inference module." in { - val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) - val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) - println(model.infSolver.getLoss(xGold, yGold, yPredicted),"here")// should be(0.00) + val yPredicted = model.infSolver.getBestStructure(model.wv, xGold) + val yMostViolated = model.infSolver.getLossAugmentedBestStructure(model.wv, xGold, yGold) + println(model.infSolver.getLoss(xGold, yGold, yPredicted), "here") // should be(0.00) // model.infSolver.getLoss(xGold, yPredicted, yMostViolated) should be(0.00) // (yPredicted.asInstanceOf[Saul_SL_Label_Structure[ConllRelation]].equals(yMostViolated. // asInstanceOf[Saul_SL_Label_Structure[ConllRelation]])) should be(true) // } - // "Structured output learning (SL)" should "really work in Saul." in { + // "Structured output learning (SL)" should "really work in Saul." in { //} diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala index a93e2037..29ff7f40 100644 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/SLTest2.scala @@ -8,15 +8,15 @@ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant -import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseNetworkLearner} +import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } import edu.illinois.cs.cogcomp.saul.classifier.SL_model._ -import edu.illinois.cs.cogcomp.saul.classifier.{JointTrainSparseNetwork, ClassifierUtils, ConstrainedClassifier, Learnable} +import edu.illinois.cs.cogcomp.saul.classifier.{ JointTrainSparseNetwork, ClassifierUtils, ConstrainedClassifier, Learnable } import edu.illinois.cs.cogcomp.saul.datamodel.DataModel import edu.illinois.cs.cogcomp.saul.datamodel.property.Property import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation import edu.illinois.cs.cogcomp.sl.core.SLParameters import edu.illinois.cs.cogcomp.sl.learner.LearnerFactory -import org.scalatest.{FlatSpec, Matchers} +import org.scalatest.{ FlatSpec, Matchers } /** Created by Parisa on 7/2/16. */ From 0b97c471f88f9defaeb42ee6695509e563c406ad Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 21 Oct 2016 15:30:24 -0500 Subject: [PATCH 104/118] -added a simple constraint to the binary classifier --- build.sbt | 2 -- .../saul/classifier/SL_model/SUtils.java | 3 ++- .../test/scala/ssvm/binaryConstraints.scala | 21 +++++++++++++++++++ .../src/test/scala/ssvm/randomDataApp.scala | 5 +++++ 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 saul-core/src/test/scala/ssvm/binaryConstraints.scala diff --git a/build.sbt b/build.sbt index c9c4a39f..13633711 100644 --- a/build.sbt +++ b/build.sbt @@ -70,8 +70,6 @@ lazy val commonSettings = Seq( "org.apache.commons" % "commons-math3" % "3.0", "org.scalatest" % "scalatest_2.11" % "2.2.4", "ch.qos.logback" % "logback-classic" % "1.1.7", - "org.scalanlp" %% "breeze" % "0.12", - "org.scalanlp" %% "breeze-natives" % "0.12", "org.scalanlp" %% "breeze-viz" % "0.12", "edu.illinois.cs.cogcomp" % "illinois-sl" % "1.3.6" withSources ), diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java index 304eb22d..5b7cf82d 100755 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java @@ -7,7 +7,8 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang.ArrayUtils; + import java.util.ArrayList; import java.util.List; diff --git a/saul-core/src/test/scala/ssvm/binaryConstraints.scala b/saul-core/src/test/scala/ssvm/binaryConstraints.scala new file mode 100644 index 00000000..f60a0cb9 --- /dev/null +++ b/saul-core/src/test/scala/ssvm/binaryConstraints.scala @@ -0,0 +1,21 @@ +package ssvm + +/** + * Created by Parisa on 10/21/16. + */ + +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import ssvm.randomClassifiers.bClassifier + +object binaryConstraints { + + val binaryConstraint = ConstrainedClassifier.constraint[String]{ + + x: String => bClassifier on x is "-1" + } +} +object binaryConstrainedClassifier extends ConstrainedClassifier[String,String](bClassifier){ + def subjectTo = binaryConstraints.binaryConstraint + override val solver = new OJalgoHook +} \ No newline at end of file diff --git a/saul-core/src/test/scala/ssvm/randomDataApp.scala b/saul-core/src/test/scala/ssvm/randomDataApp.scala index 374aa533..eb3661f0 100644 --- a/saul-core/src/test/scala/ssvm/randomDataApp.scala +++ b/saul-core/src/test/scala/ssvm/randomDataApp.scala @@ -17,11 +17,16 @@ object randomDataApp extends App { val graphCacheFile = "models/temp.model" randomDataModel.deriveInstances() randomDataModel.write(graphCacheFile) + bClassifier.learn(30) bClassifier.test(ex) + + binaryConstrainedClassifier.test(ex) + val w = bClassifier.classifier.getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector val p2 = (randomNode() prop randomProperty) zip (randomNode() prop randomLabel) + val x2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(0)).toArray) val y2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(1)).toArray) val x_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(0)).toArray) From 68a277339667c96c089ab936a8b762dcf23a14eb Mon Sep 17 00:00:00 2001 From: kordjam Date: Sat, 22 Oct 2016 00:11:57 -0500 Subject: [PATCH 105/118] -test sparse averaged perceptron --- saul-core/doc/INSTALLATION.md | 1 + .../saul/classifier/infer/JointTemplate.scala | 2 + .../src/test/scala/ssvm/randomDataApp.scala | 46 +++++++++---------- .../src/test/scala/ssvm/randomDataModel.scala | 6 +++ .../test/scala/ssvm/randomclassifiers.scala | 6 +-- 5 files changed, 33 insertions(+), 28 deletions(-) diff --git a/saul-core/doc/INSTALLATION.md b/saul-core/doc/INSTALLATION.md index 03c2affd..c6cbbd48 100644 --- a/saul-core/doc/INSTALLATION.md +++ b/saul-core/doc/INSTALLATION.md @@ -81,3 +81,4 @@ We suggest using [IntelliJ IDEA](https://www.jetbrains.com/idea/download/). If you are interested in contributing to the Saul project, either by your ideas or codes, you are welcome to create pull requests here. + diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala index 5fdb08b7..355de0fe 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/JointTemplate.scala @@ -17,6 +17,8 @@ abstract class JointTemplate[T](head: T, solver: ILPSolver, norm: Normalizer = n "T" } + verbosity = 2 + override def getHeadFinderTypes: Array[String] = { Array[String](null, null) } diff --git a/saul-core/src/test/scala/ssvm/randomDataApp.scala b/saul-core/src/test/scala/ssvm/randomDataApp.scala index eb3661f0..88f475c7 100644 --- a/saul-core/src/test/scala/ssvm/randomDataApp.scala +++ b/saul-core/src/test/scala/ssvm/randomDataApp.scala @@ -1,8 +1,4 @@ package ssvm -import breeze.linalg._ -import breeze.plot.Figure -import breeze.plot._ -import edu.illinois.cs.cogcomp.lbjava.learn.LinearThresholdUnit import ssvm.randomClassifiers.bClassifier /** Created by Parisa on 10/13/16. @@ -23,25 +19,25 @@ object randomDataApp extends App { binaryConstrainedClassifier.test(ex) - val w = bClassifier.classifier.getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector - - val p2 = (randomNode() prop randomProperty) zip (randomNode() prop randomLabel) - - val x2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(0)).toArray) - val y2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(1)).toArray) - val x_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(0)).toArray) - val y_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(1)).toArray) - - val f = Figure() - val p = f.subplot(0) - p.ylim(-3.0, 3) - p.xlim(-3, 3) - val x = linspace(0.0, 1.0) - p += plot(x2, y2, '.') - p += plot(x_minus, y_minus, '.') - p += plot(DenseVector(0, w.getWeight(0)), DenseVector(0, w.getWeight(1))) - p += plot(DenseVector(10 * w.getWeight(1), (-10) * w.getWeight(1)), DenseVector(-10 * w.getWeight(0), 10 * w.getWeight(0))) - p.xlabel = "x axis" - p.ylabel = "y axis" - f.saveas("lines.png") +// val w = bClassifier.classifier.getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector +// +// val p2 = (randomNode() prop randomProperty) zip (randomNode() prop randomLabel) +// +// val x2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(0)).toArray) +// val y2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(1)).toArray) +// val x_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(0)).toArray) +// val y_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(1)).toArray) +// +// val f = Figure() +// val p = f.subplot(0) +// p.ylim(-3.0, 3) +// p.xlim(-3, 3) +// val x = linspace(0.0, 1.0) +// p += plot(x2, y2, '.') +// p += plot(x_minus, y_minus, '.') +// p += plot(DenseVector(0, w.getWeight(0)), DenseVector(0, w.getWeight(1))) +// p += plot(DenseVector(10 * w.getWeight(1), (-10) * w.getWeight(1)), DenseVector(-10 * w.getWeight(0), 10 * w.getWeight(0))) +// p.xlabel = "x axis" +// p.ylabel = "y axis" +// f.saveas("lines.png") } diff --git a/saul-core/src/test/scala/ssvm/randomDataModel.scala b/saul-core/src/test/scala/ssvm/randomDataModel.scala index dfaaa22c..2c2fc050 100644 --- a/saul-core/src/test/scala/ssvm/randomDataModel.scala +++ b/saul-core/src/test/scala/ssvm/randomDataModel.scala @@ -14,10 +14,16 @@ object randomDataModel extends DataModel { val r = scala.util.Random r.setSeed(0) + val randomLabel = property(randomNode, cache = true) { x: String => (2 * (if (r.nextGaussian() > 0) 1 else 0) - 1).toString } + val binaryLabel = property(randomNode, cache = true) { + x: String => + if (randomLabel== "-1") false + else true + } val randomProperty = property(randomNode, cache = true) { x: String => diff --git a/saul-core/src/test/scala/ssvm/randomclassifiers.scala b/saul-core/src/test/scala/ssvm/randomclassifiers.scala index ed520e06..7c4da843 100644 --- a/saul-core/src/test/scala/ssvm/randomclassifiers.scala +++ b/saul-core/src/test/scala/ssvm/randomclassifiers.scala @@ -1,6 +1,6 @@ package ssvm -import edu.illinois.cs.cogcomp.lbjava.learn.SparseNetworkLearner +import edu.illinois.cs.cogcomp.lbjava.learn.SparseAveragedPerceptron import edu.illinois.cs.cogcomp.saul.classifier.Learnable /** Created by Parisa on 10/14/16. @@ -8,9 +8,9 @@ import edu.illinois.cs.cogcomp.saul.classifier.Learnable object randomClassifiers { import randomDataModel._ object bClassifier extends Learnable[String](randomNode) { - def label = randomLabel + def label = binaryLabel override def feature = using(randomProperty) - override lazy val classifier = new SparseNetworkLearner() + override lazy val classifier = new SparseAveragedPerceptron() override val useCache = true } } From 77bb959698c60b8b6e89acec9bff94e13420f642 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 28 Oct 2016 09:59:39 -0500 Subject: [PATCH 106/118] -merged with master -added simple binaryClassifier --- .../cogcomp/saul/classifier/SL_model/SUtils.java | 2 +- .../BinaryConstraints.scala | 14 ++++++++++++++ .../RandomDataApp.scala | 5 ++++- .../RandomDataModel.scala | 5 +++++ .../Randomclassifiers.scala | 7 +++++++ 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java index 304eb22d..a948491c 100755 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java @@ -7,7 +7,7 @@ package edu.illinois.cs.cogcomp.saul.classifier.SL_model; import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; -import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang.ArrayUtils; import java.util.ArrayList; import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala index d695d2c4..795344c5 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala @@ -1,8 +1,22 @@ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{OppositClassifier, BinaryClassifier} +import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ /** * Created by Parisa on 10/28/16. */ object BinaryConstraints { + val binaryConstraint = ConstrainedClassifier.constraint[String]{ + x: String => + (BinaryClassifier on x is "-1") ==> (OppositClassifier on x is "-1") + } } + +object binaryConstrainedClassifier extends ConstrainedClassifier[String,String](BinaryClassifier){ + def subjectTo = BinaryConstraints.binaryConstraint + override val solver = new OJalgoHook +} + diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala index 4ec2402a..8873e8bc 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala @@ -5,7 +5,7 @@ * http://cogcomp.cs.illinois.edu/ */ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData -import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.BinaryClassifier +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{OppositClassifier, BinaryClassifier} object RandomDataApp extends App { @@ -19,4 +19,7 @@ object RandomDataApp extends App { RandomDataModel.write(graphCacheFile) BinaryClassifier.learn(30) BinaryClassifier.test(examples) + OppositClassifier.learn(30) + OppositClassifier.test(examples) + binaryConstrainedClassifier.test(examples) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala index 9dee0917..8f638ee7 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala @@ -29,4 +29,9 @@ object RandomDataModel extends DataModel { val p1new = p(1) + randomLabel(x).toDouble List(c * p1new - s * p(1), c * p1new + s * p(1)) } + + val oppositRandomLabel = property(randomNode, cache = true) { + x: String => + if (randomLabel(x).equals("1") ) "-1" else "1" + } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala index 4eb3c50c..2fb8fc1f 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala @@ -17,4 +17,11 @@ object RandomClassifiers { override lazy val classifier = new SparseNetworkLearner() override val useCache = true } + +object OppositClassifier extends Learnable[String](randomNode) { + def label = oppositRandomLabel + override def feature = using(randomProperty) + override lazy val classifier = new SparseNetworkLearner() + override val useCache = true + } } From 6eea007baf99ff3627cb89003dab2737535ddbfc Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 28 Oct 2016 11:20:14 -0500 Subject: [PATCH 107/118] - test jointTrainSparseNetwork using the randomApp --- build.sbt | 6 ----- .../saul/classifier/SL_model/SUtils.java | 5 ---- .../BinaryConstraints.scala | 25 +++++++++++++------ .../RandomDataApp.scala | 10 ++++++-- .../EntityRelation/EntityRelationApp_SL.scala | 4 ++- 5 files changed, 29 insertions(+), 21 deletions(-) diff --git a/build.sbt b/build.sbt index f4a87078..e928aeca 100644 --- a/build.sbt +++ b/build.sbt @@ -68,14 +68,8 @@ lazy val commonSettings = Seq( "org.apache.commons" % "commons-math3" % "3.0", "org.scalatest" % "scalatest_2.11" % "2.2.4", "ch.qos.logback" % "logback-classic" % "1.1.7", -<<<<<<< HEAD - "org.scalanlp" %% "breeze" % "0.12", - "org.scalanlp" %% "breeze-natives" % "0.12", - "org.scalanlp" %% "breeze-viz" % "0.12" -======= "org.scalanlp" %% "breeze-viz" % "0.12", "edu.illinois.cs.cogcomp" % "illinois-sl" % "1.3.6" withSources ->>>>>>> 68a277339667c96c089ab936a8b762dcf23a14eb ), fork := true, connectInput in run := true, diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java index 1a03a298..04f7a2a0 100755 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SUtils.java @@ -8,11 +8,6 @@ import edu.illinois.cs.cogcomp.sl.util.FeatureVectorBuffer; import org.apache.commons.lang.ArrayUtils; -<<<<<<< HEAD -======= - ->>>>>>> 68a277339667c96c089ab936a8b762dcf23a14eb - import java.util.ArrayList; import java.util.List; diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala index 795344c5..457bc7c4 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala @@ -1,3 +1,9 @@ +/** This software is released under the University of Illinois/Research and Academic Use License. See + * the LICENSE file in the root folder for details. Copyright (c) 2016 + * + * Developed by: The Cognitive Computations Group, University of Illinois at Urbana-Champaign + * http://cogcomp.cs.illinois.edu/ + */ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook @@ -8,15 +14,20 @@ import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ * Created by Parisa on 10/28/16. */ object BinaryConstraints { - val binaryConstraint = ConstrainedClassifier.constraint[String]{ - + val binaryConstraint = ConstrainedClassifier.constraint[String] { x: String => - (BinaryClassifier on x is "-1") ==> (OppositClassifier on x is "-1") + (BinaryClassifier on x is "-1") ==> (OppositClassifier on x is "1") + } + + object binaryConstrainedClassifier extends ConstrainedClassifier[String, String](BinaryClassifier) { + def subjectTo = BinaryConstraints.binaryConstraint + override val solver = new OJalgoHook + } + + object oppositBinaryConstrainedClassifier extends ConstrainedClassifier[String, String](OppositClassifier) { + def subjectTo = BinaryConstraints.binaryConstraint + override val solver = new OJalgoHook } -} -object binaryConstrainedClassifier extends ConstrainedClassifier[String,String](BinaryClassifier){ - def subjectTo = BinaryConstraints.binaryConstraint - override val solver = new OJalgoHook } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala index 8873e8bc..de54abef 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala @@ -5,9 +5,12 @@ * http://cogcomp.cs.illinois.edu/ */ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData -import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{OppositClassifier, BinaryClassifier} -object RandomDataApp extends App { +import edu.illinois.cs.cogcomp.saul.classifier.JointTrainSparseNetwork +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.BinaryConstraints.{binaryConstrainedClassifier, oppositBinaryConstrainedClassifier} +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{BinaryClassifier, OppositClassifier} + +object RandomDataApp extends App{ import RandomDataModel._ for (i <- 1 to 100) { @@ -22,4 +25,7 @@ object RandomDataApp extends App { OppositClassifier.learn(30) OppositClassifier.test(examples) binaryConstrainedClassifier.test(examples) + val ccl= List(binaryConstrainedClassifier,oppositBinaryConstrainedClassifier) + JointTrainSparseNetwork.train(randomNode,ccl ,10, false) + binaryConstrainedClassifier.test(examples) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index ddbda473..168437f5 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -6,7 +6,9 @@ */ package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation +import edu.illinois.cs.cogcomp.saul.classifier.JointTrainSparseNetwork import edu.illinois.cs.cogcomp.saul.classifier.SL_model.StructuredLearning +import edu.illinois.cs.cogcomp.saulexamples.EntityMentionRelation.datastruct.ConllRelation import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation.EntityRelationConstrainedClassifiers._ @@ -27,7 +29,7 @@ object EntityRelationApp_SL extends App { val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - //JointTrainSparseNetwork.train[ConllRelation](pairs, cls, 5 ) + JointTrainSparseNetwork.train[ConllRelation](pairs, cls, 5, true ) //ClassifierUtils.TestClassifiers(cls: _*) From 733cb221be46d5efc763eef1081963a72c77ac73 Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 28 Oct 2016 11:21:51 -0500 Subject: [PATCH 108/118] -change the name --- .../{RandomDataApp.scala => RandomApp.scala} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/{RandomDataApp.scala => RandomApp.scala} (97%) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala similarity index 97% rename from saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala rename to saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala index de54abef..98c781a6 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala @@ -10,7 +10,7 @@ import edu.illinois.cs.cogcomp.saul.classifier.JointTrainSparseNetwork import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.BinaryConstraints.{binaryConstrainedClassifier, oppositBinaryConstrainedClassifier} import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{BinaryClassifier, OppositClassifier} -object RandomDataApp extends App{ +object RandomApp extends App{ import RandomDataModel._ for (i <- 1 to 100) { From ac1ef28e664ad1db8ddbda8e8f61c58edfbcc526 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 10:18:46 -0500 Subject: [PATCH 109/118] -change the name --- .../saulexamples/Badge/BadgeClassifiers.scala | 34 ++++++++++++++++ .../saulexamples/Badge/BadgeDataModel.scala | 38 ++++++++++++++++++ .../cogcomp/saulexamples/Badge/BagesApp.scala | 39 +++++++++++++++++++ .../BinaryConstraints.scala | 1 - .../RandomApp.scala | 30 +++++++++----- .../RandomDataModel.scala | 4 +- .../Randomclassifiers.scala | 10 ++--- .../DrugResponse/KnowEngDataModel.scala | 4 +- .../saulexamples/DrugResponse/myApp.scala | 2 +- 9 files changed, 143 insertions(+), 19 deletions(-) create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala new file mode 100644 index 00000000..61965192 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala @@ -0,0 +1,34 @@ +package edu.illinois.cs.cogcomp.saulexamples.Badge + +import edu.illinois.cs.cogcomp.lbjava.learn.{SparseNetworkLearner, SparsePerceptron} + +/** + * Created by Parisa on 9/13/16. + */ + +object BadgeClassifiers { + import BadgeDataModel._ + import edu.illinois.cs.cogcomp.saul.classifier.Learnable + object BadgeClassifier extends Learnable[String](badge) { + def label = BadgeLabel + override lazy val classifier = new SparsePerceptron() + override def feature = using(BadgeFeature1) + } + object BadgeOppositClassifier extends Learnable[String](badge) { + def label = BadgeOppositLabel + override lazy val classifier = new SparsePerceptron() + override def feature = using(BadgeFeature1) + } + + object BadgeClassifierMulti extends Learnable[String](badge) { + def label = BadgeLabel + override lazy val classifier = new SparseNetworkLearner() + override def feature = using(BadgeFeature1) + } + + object BadgeOppositClassifierMulti extends Learnable[String](badge) { + def label = BadgeOppositLabel + override lazy val classifier = new SparseNetworkLearner() + override def feature = using(BadgeFeature1) + } +} \ No newline at end of file diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala new file mode 100644 index 00000000..14d180d7 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala @@ -0,0 +1,38 @@ +package edu.illinois.cs.cogcomp.saulexamples.Badge + +import edu.illinois.cs.cogcomp.saul.datamodel.DataModel + +/** + * Created by Parisa on 9/13/16. + */ +object BadgeDataModel extends DataModel{ + + val badge= node[String] + + val BadgeFeature1= property(badge){ + x: String => { + val tokens= x.split(" ") + tokens(1).charAt(1).toString + } + } + + val BadgeLabel =property(badge)("true","false"){ + x: String => { + val tokens= x.split(" ") + if (tokens(0).equals("+")) + "true" + else + "false" + } + } + + val BadgeOppositLabel =property(badge)("true","false"){ + x: String => { + val tokens= x.split(" ") + if (tokens(0).equals("+")) + "false" + else + "true" + } + } +} diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala new file mode 100644 index 00000000..73757297 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala @@ -0,0 +1,39 @@ +package edu.illinois.cs.cogcomp.saulexamples.Badge + +/** + * Created by Parisa on 9/13/16. + */ + +import edu.illinois.cs.cogcomp.saul.classifier.{JointTrain, JointTrainSparseNetwork} +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeDataModel._ + +import scala.collection.JavaConversions._ +object BadgesApp extends App{ + + val allNamesTrain= new BadgeReader("data/badges/badges.train").badges + val allNamesTest= new BadgeReader("data/badges/badges.test").badges + + badge.populate(allNamesTrain) + badge.populate(allNamesTest,false) + +/*Test the join training with SparsePerceptron*/ + + BadgeClassifier.test() + BadgeOppositClassifier.test() + JointTrain.train(BadgeDataModel.badge,List(badgeConstrainedClassifier,oppositBadgeConstrainedClassifier),5) + badgeConstrainedClassifier.test() + BadgeClassifier.test() + oppositBadgeConstrainedClassifier.test() + +/*Test the joinTraining with SparseNetwork*/ + + BadgeClassifierMulti.test() + BadgeOppositClassifierMulti.test() + JointTrainSparseNetwork.train(badge,List(badgeConstrainedClassifierMulti,oppositBadgeConstrainedClassifierMulti),5,true) + badgeConstrainedClassifierMulti.test() + BadgeClassifierMulti.test() + oppositBadgeConstrainedClassifierMulti.test() + +} \ No newline at end of file diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala index 457bc7c4..4a5a6823 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala @@ -28,6 +28,5 @@ object BinaryConstraints { def subjectTo = BinaryConstraints.binaryConstraint override val solver = new OJalgoHook } - } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala index 98c781a6..f79c333f 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala @@ -6,7 +6,7 @@ */ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData -import edu.illinois.cs.cogcomp.saul.classifier.JointTrainSparseNetwork +import edu.illinois.cs.cogcomp.lbjava.learn.SparsePerceptron import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.BinaryConstraints.{binaryConstrainedClassifier, oppositBinaryConstrainedClassifier} import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{BinaryClassifier, OppositClassifier} @@ -17,15 +17,27 @@ object RandomApp extends App{ randomNode.addInstance(i.toString) } val examples = randomNode.getAllInstances - val graphCacheFile = "models/temp.model" - RandomDataModel.deriveInstances() - RandomDataModel.write(graphCacheFile) - BinaryClassifier.learn(30) + BinaryClassifier.classifier.asInstanceOf[SparsePerceptron].setInitialWeight(0.01) + OppositClassifier.classifier.asInstanceOf[SparsePerceptron].setInitialWeight(0.02) + + // val graphCacheFile = "models/temp.model" + //RandomDataModel.deriveInstances() + // RandomDataModel.write(graphCacheFile) + //BinaryClassifier.learn(30) BinaryClassifier.test(examples) - OppositClassifier.learn(30) - OppositClassifier.test(examples) - binaryConstrainedClassifier.test(examples) + //OppositClassifier.learn(30) + //OppositClassifier.test(examples) + //binaryConstrainedClassifier.test(examples) val ccl= List(binaryConstrainedClassifier,oppositBinaryConstrainedClassifier) - JointTrainSparseNetwork.train(randomNode,ccl ,10, false) + + // JointTrain.train(randomNode,ccl ,10) + + //binaryConstrainedClassifier.classifier.asInstanceOf[SparsePerceptron].setInitialWeight(0.01) + + BinaryClassifier.test(examples) + + OppositClassifier.test(examples) binaryConstrainedClassifier.test(examples) + oppositBinaryConstrainedClassifier.test(examples) + } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala index 8f638ee7..0501b7e8 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala @@ -18,7 +18,7 @@ object RandomDataModel extends DataModel { val r = scala.util.Random r.setSeed(0) - val randomLabel = property(randomNode, cache = true) { + val randomLabel = property(randomNode, cache = true) ("1", "-1") { x: String => (2 * (if (r.nextGaussian() > 0) 1 else 0) - 1).toString } @@ -30,7 +30,7 @@ object RandomDataModel extends DataModel { List(c * p1new - s * p(1), c * p1new + s * p(1)) } - val oppositRandomLabel = property(randomNode, cache = true) { + val oppositRandomLabel = property(randomNode, cache = true) ("1", "-1") { x: String => if (randomLabel(x).equals("1") ) "-1" else "1" } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala index 2fb8fc1f..d76ddea4 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala @@ -6,7 +6,7 @@ */ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData -import edu.illinois.cs.cogcomp.lbjava.learn.SparseNetworkLearner +import edu.illinois.cs.cogcomp.lbjava.learn.SparsePerceptron import edu.illinois.cs.cogcomp.saul.classifier.Learnable object RandomClassifiers { @@ -14,14 +14,14 @@ object RandomClassifiers { object BinaryClassifier extends Learnable[String](randomNode) { def label = randomLabel override def feature = using(randomProperty) - override lazy val classifier = new SparseNetworkLearner() - override val useCache = true + override lazy val classifier = new SparsePerceptron() + //override val useCache = true } object OppositClassifier extends Learnable[String](randomNode) { def label = oppositRandomLabel override def feature = using(randomProperty) - override lazy val classifier = new SparseNetworkLearner() - override val useCache = true + override lazy val classifier = new SparsePerceptron() + //override val useCache = true } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala index 8bb56eb3..890e2d87 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala @@ -81,7 +81,9 @@ object KnowEngDataModel extends DataModel { } val drugResponse = property(patientDrug) { - x: PatientDrug => x.response.doubleValue() + x: PatientDrug => + val temp= x.response.doubleValue() + if (temp> 100) "+" else "-" } val genesGroupedPerPathway = genes().map(x => x.KEGG.map(y => (x.GeneName, y))).flatten.groupBy(_._2).map(x => (x._1, x._2.map(t1 => t1._1))) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/myApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/myApp.scala index 5c5ca870..1804bb5b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/myApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/myApp.scala @@ -63,7 +63,7 @@ object myApp extends Logging { val genesGroupedPerPathway = genes().map(x => x.KEGG.map(y => (x.GeneName, y))).flatten.groupBy(_._2).map(x => (x._1, x._2.map(t1 => t1._1))) - patientDrug().filter(x => drugResponse(x) > 12) + //patientDrug().filter(x => drugResponse(x) > 12) (patients() ~> -pgPatient ~> pgGenes) prop gene_KEGG From 59d7f552490522d62135e47c9c43c974ee6eb36f Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 10:20:58 -0500 Subject: [PATCH 110/118] -Added badge example with binary constraint --- .../saulexamples/Badge/BadgeReader.java | 27 +++++++++++++ .../Badge/BadgeConstraintClassifiers.scala | 40 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 saul-examples/src/main/java/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeReader.java create mode 100644 saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala diff --git a/saul-examples/src/main/java/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeReader.java b/saul-examples/src/main/java/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeReader.java new file mode 100644 index 00000000..6f1e0d47 --- /dev/null +++ b/saul-examples/src/main/java/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeReader.java @@ -0,0 +1,27 @@ +package edu.illinois.cs.cogcomp.saulexamples.Badge; + +import java.io.BufferedReader; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; + +public class BadgeReader { + public List badges; + // int currentBadge; + + public BadgeReader(String dataFile) { + badges = new ArrayList(); + + try { + BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(dataFile))); + + String str; + while ((str = br.readLine()) != null) { + badges.add(str); + } + + br.close(); + }catch (Exception e) {} + } +} \ No newline at end of file diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala new file mode 100644 index 00000000..7a0ed5d4 --- /dev/null +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala @@ -0,0 +1,40 @@ +package edu.illinois.cs.cogcomp.saulexamples.Badge + +import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook +import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier +import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers.{BadgeOppositClassifierMulti, BadgeClassifierMulti, BadgeClassifier, BadgeOppositClassifier} +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.BinaryConstraints +/** + * Created by Parisa on 11/1/16. + */ +object BadgeConstraintClassifiers { + + + val binaryConstraint = ConstrainedClassifier.constraint[String] { + x: String => + (BadgeClassifier on x is "negative") ==> (BadgeOppositClassifier on x is "positive") + } + + object badgeConstrainedClassifier extends ConstrainedClassifier[String, String](BadgeClassifier) { + def subjectTo = BinaryConstraints.binaryConstraint + override val solver = new OJalgoHook + } + + object oppositBadgeConstrainedClassifier extends ConstrainedClassifier[String, String](BadgeOppositClassifier) { + def subjectTo = BinaryConstraints.binaryConstraint + override val solver = new OJalgoHook + } + + + object badgeConstrainedClassifierMulti extends ConstrainedClassifier[String, String](BadgeClassifierMulti) { + def subjectTo = BinaryConstraints.binaryConstraint + override val solver = new OJalgoHook + } + + object oppositBadgeConstrainedClassifierMulti extends ConstrainedClassifier[String, String](BadgeOppositClassifierMulti) { + def subjectTo = BinaryConstraints.binaryConstraint + override val solver = new OJalgoHook + } + +} From 616ce07259d511749b2fbbe73059f2a017ab5cb6 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 14:15:11 -0500 Subject: [PATCH 111/118] -made a simple SparseNetwork Learner without join --- .../classifier/JointTrainSparseNetwork.scala | 34 +++++++------- .../cogcomp/saulexamples/Badge/BagesApp.scala | 47 ++++++++++--------- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala index 4ac33f82..ab72a0fe 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala @@ -44,18 +44,16 @@ object JointTrainSparseNetwork { logger.info(s"Training: $idx examples inferred.") cls.foreach { - case classifier: ConstrainedClassifier[_, HEAD] => - val typedClassifier = classifier.asInstanceOf[ConstrainedClassifier[_, HEAD]] - val oracle = typedClassifier.onClassifier.getLabeler - - typedClassifier.getCandidates(h) foreach { + currentClassifier: ConstrainedClassifier[_, HEAD] => + val oracle = currentClassifier.onClassifier.getLabeler + val baseClassifier = currentClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] + currentClassifier.getCandidates(h) foreach { candidate => { def trainOnce() = { - val result = typedClassifier.classifier.discreteValue(candidate) + val result = currentClassifier.classifier.discreteValue(candidate) val trueLabel = oracle.discreteValue(candidate) - val ilearner = typedClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] - val lLexicon = typedClassifier.onClassifier.getLabelLexicon + val lLexicon = currentClassifier.onClassifier.getLabelLexicon var LTU_actual: Int = 0 var LTU_predicted: Int = 0 for (i <- 0 until lLexicon.size()) { @@ -69,26 +67,26 @@ object JointTrainSparseNetwork { // and the LTU of the predicted class should be demoted. if (!result.equals(trueLabel)) //equals("true") && trueLabel.equals("false") ) { - val a = typedClassifier.onClassifier.getExampleArray(candidate) + val a = currentClassifier.onClassifier.getExampleArray(candidate) val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues val exampleLabels = a(2).asInstanceOf[Array[Int]] val label = exampleLabels(0) - var N = ilearner.getNetwork.size + var N = baseClassifier.getNetwork.size - if (label >= N || ilearner.getNetwork.get(label) == null) { - val conjugateLabels = ilearner.isUsingConjunctiveLabels | ilearner.getLabelLexicon.lookupKey(label).isConjunctive - ilearner.setConjunctiveLabels(conjugateLabels) + if (label >= N || baseClassifier.getNetwork.get(label) == null) { + val conjugateLabels = baseClassifier.isUsingConjunctiveLabels | baseClassifier.getLabelLexicon.lookupKey(label).isConjunctive + baseClassifier.setConjunctiveLabels(conjugateLabels) - val ltu: LinearThresholdUnit = ilearner.getBaseLTU - ltu.initialize(ilearner.getNumExamples, ilearner.getNumFeatures) - ilearner.getNetwork.set(label, ltu) + val ltu: LinearThresholdUnit = baseClassifier.getBaseLTU + ltu.initialize(baseClassifier.getNumExamples, baseClassifier.getNumFeatures) + baseClassifier.getNetwork.set(label, ltu) N = label + 1 } // test push - val ltu_actual = ilearner.getLTU(LTU_actual).asInstanceOf[LinearThresholdUnit] - val ltu_predicted = ilearner.getLTU(LTU_predicted).asInstanceOf[LinearThresholdUnit] + val ltu_actual = baseClassifier.getLTU(LTU_actual).asInstanceOf[LinearThresholdUnit] + val ltu_predicted = baseClassifier.getLTU(LTU_predicted).asInstanceOf[LinearThresholdUnit] if (ltu_actual != null) ltu_actual.promote(a0, a1, 0.1) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala index 73757297..a596bdfc 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala @@ -1,39 +1,42 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge -/** - * Created by Parisa on 9/13/16. +/** Created by Parisa on 9/13/16. */ -import edu.illinois.cs.cogcomp.saul.classifier.{JointTrain, JointTrainSparseNetwork} +import edu.illinois.cs.cogcomp.saul.classifier.SimpleSparseNetwork import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers._ import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeDataModel._ import scala.collection.JavaConversions._ -object BadgesApp extends App{ +object BadgesApp extends App { - val allNamesTrain= new BadgeReader("data/badges/badges.train").badges - val allNamesTest= new BadgeReader("data/badges/badges.test").badges + val allNamesTrain = new BadgeReader("data/badges/badges.train").badges + val allNamesTest = new BadgeReader("data/badges/badges.test").badges badge.populate(allNamesTrain) - badge.populate(allNamesTest,false) + badge.populate(allNamesTest, false) -/*Test the join training with SparsePerceptron*/ + /*Test the join training with SparsePerceptron*/ - BadgeClassifier.test() - BadgeOppositClassifier.test() - JointTrain.train(BadgeDataModel.badge,List(badgeConstrainedClassifier,oppositBadgeConstrainedClassifier),5) - badgeConstrainedClassifier.test() - BadgeClassifier.test() - oppositBadgeConstrainedClassifier.test() + // BadgeClassifier.test() + // BadgeOppositClassifier.test() + // JointTrain.train(BadgeDataModel.badge,List(badgeConstrainedClassifier,oppositBadgeConstrainedClassifier),5) + // badgeConstrainedClassifier.test() + // BadgeClassifier.test() + // oppositBadgeConstrainedClassifier.test() -/*Test the joinTraining with SparseNetwork*/ + /*Test the joinTraining with SparseNetwork*/ - BadgeClassifierMulti.test() - BadgeOppositClassifierMulti.test() - JointTrainSparseNetwork.train(badge,List(badgeConstrainedClassifierMulti,oppositBadgeConstrainedClassifierMulti),5,true) - badgeConstrainedClassifierMulti.test() - BadgeClassifierMulti.test() - oppositBadgeConstrainedClassifierMulti.test() + // BadgeClassifierMulti.test() + //BadgeOppositClassifierMulti.test() + //val cls=List(badgeConstrainedClassifierMulti,oppositBadgeConstrainedClassifierMulti) + + // ClassifierUtils.InitializeClassifiers(badge, cls: _*) + // JointTrainSparseNetwork.train(badge,cls,5,false) + // badgeConstrainedClassifierMulti.test() + + //oppositBadgeConstrainedClassifierMulti.test() + SimpleSparseNetwork.train(badge, BadgeClassifierMulti, 5, false) + BadgeClassifierMulti.test() } \ No newline at end of file From d3466ce7b3f1fe38e5a64b2d24c386a19adad84c Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 14:19:00 -0500 Subject: [PATCH 112/118] -made a simple SparseNetwork Learner without join -format --- .../saul/classifier/SimpleSparseNetwork.scala | 97 +++++++++++++++++++ .../test/scala/ssvm/binaryConstraints.scala | 13 ++- .../src/test/scala/ssvm/randomDataApp.scala | 42 ++++---- .../src/test/scala/ssvm/randomDataModel.scala | 3 +- .../saulexamples/Badge/BadgeClassifiers.scala | 5 +- .../Badge/BadgeConstraintClassifiers.scala | 9 +- .../saulexamples/Badge/BadgeDataModel.scala | 54 ++++++----- .../BinaryConstraints.scala | 7 +- .../RandomApp.scala | 14 +-- .../RandomDataModel.scala | 6 +- .../Randomclassifiers.scala | 2 +- .../DrugResponse/KnowEngDataModel.scala | 4 +- .../EntityRelation/EntityRelationApp_SL.scala | 2 +- 13 files changed, 175 insertions(+), 83 deletions(-) create mode 100644 saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala new file mode 100644 index 00000000..d99dd9d6 --- /dev/null +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala @@ -0,0 +1,97 @@ +package edu.illinois.cs.cogcomp.saul.classifier + +/** Created by Parisa on 11/2/16. + */ + +import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } +import edu.illinois.cs.cogcomp.saul.datamodel.node.Node +import org.slf4j.{ Logger, LoggerFactory } + +import scala.reflect.ClassTag + +object SimpleSparseNetwork { + + val logger: Logger = LoggerFactory.getLogger(this.getClass) + var difference = 0 + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: Learnable[HEAD], init: Boolean)(implicit headTag: ClassTag[HEAD]) = { + train[HEAD](node, cls, 1, init) + } + + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: Learnable[HEAD], it: Int, init: Boolean)(implicit headTag: ClassTag[HEAD]) = { + train[HEAD](node, cls, it, init) + } + + @scala.annotation.tailrec + def train[HEAD <: AnyRef](node: Node[HEAD], currentClassifier: Learnable[HEAD], it: Int, init: Boolean)(implicit headTag: ClassTag[HEAD]): Unit = { + // forall members in collection of the head (dm.t) do + logger.info("Training iteration: " + it) + if (it == 0) { + // Done + println("difference=", difference) + } else { + val allHeads = node.getTrainingInstances + difference = 0 + allHeads.zipWithIndex.foreach { + case (candidate, idx) => + { + if (idx % 5000 == 0) + logger.info(s"Training: $idx examples inferred.") + currentClassifier: Learnable[HEAD] => + val oracle = currentClassifier.getLabeler + val baseClassifier = currentClassifier.asInstanceOf[SparseNetworkLearner] + + { + def trainOnce() = { + val result = currentClassifier.classifier.discreteValue(candidate) + val trueLabel = oracle.discreteValue(candidate) + val lLexicon = currentClassifier.getLabelLexicon + var LTU_actual: Int = 0 + var LTU_predicted: Int = 0 + for (i <- 0 until lLexicon.size()) { + if (lLexicon.lookupKey(i).valueEquals(result)) + LTU_predicted = i + if (lLexicon.lookupKey(i).valueEquals(trueLabel)) + LTU_actual = i + } + + // The idea is that when the prediction is wrong the LTU of the actual class should be promoted + // and the LTU of the predicted class should be demoted. + if (!result.equals(trueLabel)) //equals("true") && trueLabel.equals("false") ) + { + val a = currentClassifier.getExampleArray(candidate) + val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures + val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues + val exampleLabels = a(2).asInstanceOf[Array[Int]] + val label = exampleLabels(0) + var N = baseClassifier.getNetwork.size + + if (label >= N || baseClassifier.getNetwork.get(label) == null) { + val conjugateLabels = baseClassifier.isUsingConjunctiveLabels | baseClassifier.getLabelLexicon.lookupKey(label).isConjunctive + baseClassifier.setConjunctiveLabels(conjugateLabels) + + val ltu: LinearThresholdUnit = baseClassifier.getBaseLTU + ltu.initialize(baseClassifier.getNumExamples, baseClassifier.getNumFeatures) + baseClassifier.getNetwork.set(label, ltu) + N = label + 1 + } + + // test push + val ltu_actual = baseClassifier.getLTU(LTU_actual).asInstanceOf[LinearThresholdUnit] + val ltu_predicted = baseClassifier.getLTU(LTU_predicted).asInstanceOf[LinearThresholdUnit] + + if (ltu_actual != null) + ltu_actual.promote(a0, a1, 0.1) + if (ltu_predicted != null) + ltu_predicted.demote(a0, a1, 0.1) + } + } + + trainOnce() + } + } + } + train(node, currentClassifier, it - 1, false) + } + } +} + diff --git a/saul-core/src/test/scala/ssvm/binaryConstraints.scala b/saul-core/src/test/scala/ssvm/binaryConstraints.scala index f60a0cb9..0e76932c 100644 --- a/saul-core/src/test/scala/ssvm/binaryConstraints.scala +++ b/saul-core/src/test/scala/ssvm/binaryConstraints.scala @@ -1,8 +1,7 @@ package ssvm -/** - * Created by Parisa on 10/21/16. - */ +/** Created by Parisa on 10/21/16. + */ import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier @@ -10,12 +9,12 @@ import ssvm.randomClassifiers.bClassifier object binaryConstraints { - val binaryConstraint = ConstrainedClassifier.constraint[String]{ + val binaryConstraint = ConstrainedClassifier.constraint[String] { - x: String => bClassifier on x is "-1" - } + x: String => bClassifier on x is "-1" + } } -object binaryConstrainedClassifier extends ConstrainedClassifier[String,String](bClassifier){ +object binaryConstrainedClassifier extends ConstrainedClassifier[String, String](bClassifier) { def subjectTo = binaryConstraints.binaryConstraint override val solver = new OJalgoHook } \ No newline at end of file diff --git a/saul-core/src/test/scala/ssvm/randomDataApp.scala b/saul-core/src/test/scala/ssvm/randomDataApp.scala index 88f475c7..6666fe43 100644 --- a/saul-core/src/test/scala/ssvm/randomDataApp.scala +++ b/saul-core/src/test/scala/ssvm/randomDataApp.scala @@ -19,25 +19,25 @@ object randomDataApp extends App { binaryConstrainedClassifier.test(ex) -// val w = bClassifier.classifier.getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector -// -// val p2 = (randomNode() prop randomProperty) zip (randomNode() prop randomLabel) -// -// val x2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(0)).toArray) -// val y2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(1)).toArray) -// val x_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(0)).toArray) -// val y_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(1)).toArray) -// -// val f = Figure() -// val p = f.subplot(0) -// p.ylim(-3.0, 3) -// p.xlim(-3, 3) -// val x = linspace(0.0, 1.0) -// p += plot(x2, y2, '.') -// p += plot(x_minus, y_minus, '.') -// p += plot(DenseVector(0, w.getWeight(0)), DenseVector(0, w.getWeight(1))) -// p += plot(DenseVector(10 * w.getWeight(1), (-10) * w.getWeight(1)), DenseVector(-10 * w.getWeight(0), 10 * w.getWeight(0))) -// p.xlabel = "x axis" -// p.ylabel = "y axis" -// f.saveas("lines.png") + // val w = bClassifier.classifier.getLTU(1).asInstanceOf[LinearThresholdUnit].getWeightVector + // + // val p2 = (randomNode() prop randomProperty) zip (randomNode() prop randomLabel) + // + // val x2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(0)).toArray) + // val y2 = DenseVector(p2.filter(x => x._2.equals("1")).map(x => x._1(1)).toArray) + // val x_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(0)).toArray) + // val y_minus = DenseVector(p2.filter(x => x._2.equals("-1")).map(x => x._1(1)).toArray) + // + // val f = Figure() + // val p = f.subplot(0) + // p.ylim(-3.0, 3) + // p.xlim(-3, 3) + // val x = linspace(0.0, 1.0) + // p += plot(x2, y2, '.') + // p += plot(x_minus, y_minus, '.') + // p += plot(DenseVector(0, w.getWeight(0)), DenseVector(0, w.getWeight(1))) + // p += plot(DenseVector(10 * w.getWeight(1), (-10) * w.getWeight(1)), DenseVector(-10 * w.getWeight(0), 10 * w.getWeight(0))) + // p.xlabel = "x axis" + // p.ylabel = "y axis" + // f.saveas("lines.png") } diff --git a/saul-core/src/test/scala/ssvm/randomDataModel.scala b/saul-core/src/test/scala/ssvm/randomDataModel.scala index 2c2fc050..fe72f050 100644 --- a/saul-core/src/test/scala/ssvm/randomDataModel.scala +++ b/saul-core/src/test/scala/ssvm/randomDataModel.scala @@ -14,14 +14,13 @@ object randomDataModel extends DataModel { val r = scala.util.Random r.setSeed(0) - val randomLabel = property(randomNode, cache = true) { x: String => (2 * (if (r.nextGaussian() > 0) 1 else 0) - 1).toString } val binaryLabel = property(randomNode, cache = true) { x: String => - if (randomLabel== "-1") false + if (randomLabel == "-1") false else true } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala index 61965192..344599ab 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeClassifiers.scala @@ -1,9 +1,8 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge -import edu.illinois.cs.cogcomp.lbjava.learn.{SparseNetworkLearner, SparsePerceptron} +import edu.illinois.cs.cogcomp.lbjava.learn.{ SparseNetworkLearner, SparsePerceptron } -/** - * Created by Parisa on 9/13/16. +/** Created by Parisa on 9/13/16. */ object BadgeClassifiers { diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala index 7a0ed5d4..b613d94d 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeConstraintClassifiers.scala @@ -3,14 +3,12 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ -import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers.{BadgeOppositClassifierMulti, BadgeClassifierMulti, BadgeClassifier, BadgeOppositClassifier} +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers.{ BadgeOppositClassifierMulti, BadgeClassifierMulti, BadgeClassifier, BadgeOppositClassifier } import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.BinaryConstraints -/** - * Created by Parisa on 11/1/16. - */ +/** Created by Parisa on 11/1/16. + */ object BadgeConstraintClassifiers { - val binaryConstraint = ConstrainedClassifier.constraint[String] { x: String => (BadgeClassifier on x is "negative") ==> (BadgeOppositClassifier on x is "positive") @@ -26,7 +24,6 @@ object BadgeConstraintClassifiers { override val solver = new OJalgoHook } - object badgeConstrainedClassifierMulti extends ConstrainedClassifier[String, String](BadgeClassifierMulti) { def subjectTo = BinaryConstraints.binaryConstraint override val solver = new OJalgoHook diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala index 14d180d7..70d7a1bf 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BadgeDataModel.scala @@ -2,37 +2,39 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -/** - * Created by Parisa on 9/13/16. - */ -object BadgeDataModel extends DataModel{ +/** Created by Parisa on 9/13/16. + */ +object BadgeDataModel extends DataModel { - val badge= node[String] + val badge = node[String] - val BadgeFeature1= property(badge){ - x: String => { - val tokens= x.split(" ") - tokens(1).charAt(1).toString - } + val BadgeFeature1 = property(badge) { + x: String => + { + val tokens = x.split(" ") + tokens(1).charAt(1).toString + } } - val BadgeLabel =property(badge)("true","false"){ - x: String => { - val tokens= x.split(" ") - if (tokens(0).equals("+")) - "true" - else - "false" - } + val BadgeLabel = property(badge)("true", "false") { + x: String => + { + val tokens = x.split(" ") + if (tokens(0).equals("+")) + "true" + else + "false" + } } - val BadgeOppositLabel =property(badge)("true","false"){ - x: String => { - val tokens= x.split(" ") - if (tokens(0).equals("+")) - "false" - else - "true" - } + val BadgeOppositLabel = property(badge)("true", "false") { + x: String => + { + val tokens = x.split(" ") + if (tokens(0).equals("+")) + "false" + else + "true" + } } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala index 4a5a6823..0dae89a0 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/BinaryConstraints.scala @@ -8,11 +8,10 @@ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{OppositClassifier, BinaryClassifier} +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{ OppositClassifier, BinaryClassifier } import edu.illinois.cs.cogcomp.saul.constraint.ConstraintTypeConversion._ -/** - * Created by Parisa on 10/28/16. - */ +/** Created by Parisa on 10/28/16. + */ object BinaryConstraints { val binaryConstraint = ConstrainedClassifier.constraint[String] { x: String => diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala index f79c333f..77b5972c 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomApp.scala @@ -7,10 +7,10 @@ package edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData import edu.illinois.cs.cogcomp.lbjava.learn.SparsePerceptron -import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.BinaryConstraints.{binaryConstrainedClassifier, oppositBinaryConstrainedClassifier} -import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{BinaryClassifier, OppositClassifier} +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.BinaryConstraints.{ binaryConstrainedClassifier, oppositBinaryConstrainedClassifier } +import edu.illinois.cs.cogcomp.saulexamples.BasicClassifierWithRandomData.RandomClassifiers.{ BinaryClassifier, OppositClassifier } -object RandomApp extends App{ +object RandomApp extends App { import RandomDataModel._ for (i <- 1 to 100) { @@ -20,17 +20,17 @@ object RandomApp extends App{ BinaryClassifier.classifier.asInstanceOf[SparsePerceptron].setInitialWeight(0.01) OppositClassifier.classifier.asInstanceOf[SparsePerceptron].setInitialWeight(0.02) - // val graphCacheFile = "models/temp.model" + // val graphCacheFile = "models/temp.model" //RandomDataModel.deriveInstances() - // RandomDataModel.write(graphCacheFile) + // RandomDataModel.write(graphCacheFile) //BinaryClassifier.learn(30) BinaryClassifier.test(examples) //OppositClassifier.learn(30) //OppositClassifier.test(examples) //binaryConstrainedClassifier.test(examples) - val ccl= List(binaryConstrainedClassifier,oppositBinaryConstrainedClassifier) + val ccl = List(binaryConstrainedClassifier, oppositBinaryConstrainedClassifier) - // JointTrain.train(randomNode,ccl ,10) + // JointTrain.train(randomNode,ccl ,10) //binaryConstrainedClassifier.classifier.asInstanceOf[SparsePerceptron].setInitialWeight(0.01) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala index 0501b7e8..9b47e37b 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/RandomDataModel.scala @@ -18,7 +18,7 @@ object RandomDataModel extends DataModel { val r = scala.util.Random r.setSeed(0) - val randomLabel = property(randomNode, cache = true) ("1", "-1") { + val randomLabel = property(randomNode, cache = true)("1", "-1") { x: String => (2 * (if (r.nextGaussian() > 0) 1 else 0) - 1).toString } @@ -30,8 +30,8 @@ object RandomDataModel extends DataModel { List(c * p1new - s * p(1), c * p1new + s * p(1)) } - val oppositRandomLabel = property(randomNode, cache = true) ("1", "-1") { + val oppositRandomLabel = property(randomNode, cache = true)("1", "-1") { x: String => - if (randomLabel(x).equals("1") ) "-1" else "1" + if (randomLabel(x).equals("1")) "-1" else "1" } } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala index d76ddea4..14255dc0 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/BasicClassifierWithRandomData/Randomclassifiers.scala @@ -18,7 +18,7 @@ object RandomClassifiers { //override val useCache = true } -object OppositClassifier extends Learnable[String](randomNode) { + object OppositClassifier extends Learnable[String](randomNode) { def label = oppositRandomLabel override def feature = using(randomProperty) override lazy val classifier = new SparsePerceptron() diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala index 890e2d87..bc591cf5 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/DrugResponse/KnowEngDataModel.scala @@ -82,8 +82,8 @@ object KnowEngDataModel extends DataModel { val drugResponse = property(patientDrug) { x: PatientDrug => - val temp= x.response.doubleValue() - if (temp> 100) "+" else "-" + val temp = x.response.doubleValue() + if (temp > 100) "+" else "-" } val genesGroupedPerPathway = genes().map(x => x.KEGG.map(y => (x.GeneName, y))).flatten.groupBy(_._2).map(x => (x._1, x._2.map(t1 => t1._1))) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala index 168437f5..e329adef 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/EntityRelationApp_SL.scala @@ -29,7 +29,7 @@ object EntityRelationApp_SL extends App { val cls = List(PerConstrainedClassifier, OrgConstrainedClassifier, LocConstrainedClassifier, LivesIn_PerOrg_relationConstrainedClassifier, WorksFor_PerOrg_ConstrainedClassifier) - JointTrainSparseNetwork.train[ConllRelation](pairs, cls, 5, true ) + JointTrainSparseNetwork.train[ConllRelation](pairs, cls, 5, true) //ClassifierUtils.TestClassifiers(cls: _*) From f95e74f165f1e8011f2f80251ac1684c7fa11a76 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 15:01:25 -0500 Subject: [PATCH 113/118] -fixed minor --- .../cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala index d99dd9d6..138d423b 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala @@ -36,9 +36,8 @@ object SimpleSparseNetwork { { if (idx % 5000 == 0) logger.info(s"Training: $idx examples inferred.") - currentClassifier: Learnable[HEAD] => val oracle = currentClassifier.getLabeler - val baseClassifier = currentClassifier.asInstanceOf[SparseNetworkLearner] + val baseClassifier = currentClassifier.classifier.asInstanceOf[SparseNetworkLearner] { def trainOnce() = { From 0ec7d3eb67b3698d41f5c849179c2a38397fe28d Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 16:11:19 -0500 Subject: [PATCH 114/118] -fixed minor --- .../cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala | 9 +++++---- .../cs/cogcomp/saulexamples/Badge/BagesApp.scala | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala index 138d423b..d198a765 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala @@ -33,8 +33,8 @@ object SimpleSparseNetwork { difference = 0 allHeads.zipWithIndex.foreach { case (candidate, idx) => - { - if (idx % 5000 == 0) + + // if (idx % 5000 == 0) logger.info(s"Training: $idx examples inferred.") val oracle = currentClassifier.getLabeler val baseClassifier = currentClassifier.classifier.asInstanceOf[SparseNetworkLearner] @@ -88,9 +88,10 @@ object SimpleSparseNetwork { trainOnce() } } - } train(node, currentClassifier, it - 1, false) + } + } - } + } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala index a596bdfc..c3bf11f7 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala @@ -3,8 +3,9 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge /** Created by Parisa on 9/13/16. */ -import edu.illinois.cs.cogcomp.saul.classifier.SimpleSparseNetwork +import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, SimpleSparseNetwork} import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers._ +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers.{oppositBadgeConstrainedClassifierMulti, badgeConstrainedClassifierMulti} import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeDataModel._ import scala.collection.JavaConversions._ @@ -29,14 +30,14 @@ object BadgesApp extends App { // BadgeClassifierMulti.test() //BadgeOppositClassifierMulti.test() - //val cls=List(badgeConstrainedClassifierMulti,oppositBadgeConstrainedClassifierMulti) + val cls=List(badgeConstrainedClassifierMulti,oppositBadgeConstrainedClassifierMulti) - // ClassifierUtils.InitializeClassifiers(badge, cls: _*) + ClassifierUtils.InitializeClassifiers(badge, cls: _*) // JointTrainSparseNetwork.train(badge,cls,5,false) // badgeConstrainedClassifierMulti.test() //oppositBadgeConstrainedClassifierMulti.test() - SimpleSparseNetwork.train(badge, BadgeClassifierMulti, 5, false) + SimpleSparseNetwork.train(badge, BadgeClassifierMulti, 1, false) BadgeClassifierMulti.test() } \ No newline at end of file From e8d07df51c816621f58b6e65e954bcb4f9a198f7 Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 16:31:37 -0500 Subject: [PATCH 115/118] -fixed minor --- .../cs/cogcomp/saulexamples/Badge/BagesApp.scala | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala index c3bf11f7..c7c41611 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala @@ -3,9 +3,9 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge /** Created by Parisa on 9/13/16. */ -import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, SimpleSparseNetwork} +import edu.illinois.cs.cogcomp.saul.classifier.SimpleSparseNetwork import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers.{oppositBadgeConstrainedClassifierMulti, badgeConstrainedClassifierMulti} +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers.{badgeConstrainedClassifierMulti, oppositBadgeConstrainedClassifierMulti} import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeDataModel._ import scala.collection.JavaConversions._ @@ -32,12 +32,18 @@ object BadgesApp extends App { //BadgeOppositClassifierMulti.test() val cls=List(badgeConstrainedClassifierMulti,oppositBadgeConstrainedClassifierMulti) - ClassifierUtils.InitializeClassifiers(badge, cls: _*) + // ClassifierUtils.InitializeClassifiers(badge, cls: _*) // JointTrainSparseNetwork.train(badge,cls,5,false) // badgeConstrainedClassifierMulti.test() //oppositBadgeConstrainedClassifierMulti.test() + for (i<- 0 until 100) + BadgeClassifierMulti.classifier.learn(allNamesTrain.get(i)) + + BadgeClassifierMulti.test() + SimpleSparseNetwork.train(badge, BadgeClassifierMulti, 1, false) + BadgeClassifierMulti.test() } \ No newline at end of file From 94c6bf2cb0851f1fdffe3e3f2bbbd7143ebb5fdd Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 16:58:03 -0500 Subject: [PATCH 116/118] -call the exampleArray with true --- .../cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala | 2 +- .../cogcomp/saulexamples/nlp/EmailSpam/SpamClassifiers.scala | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala index d198a765..bb64b39d 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala @@ -57,7 +57,7 @@ object SimpleSparseNetwork { // and the LTU of the predicted class should be demoted. if (!result.equals(trueLabel)) //equals("true") && trueLabel.equals("false") ) { - val a = currentClassifier.getExampleArray(candidate) + val a = currentClassifier.getExampleArray(candidate,true) val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues val exampleLabels = a(2).asInstanceOf[Array[Int]] diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EmailSpam/SpamClassifiers.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EmailSpam/SpamClassifiers.scala index 986228f9..0ba5c3db 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EmailSpam/SpamClassifiers.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EmailSpam/SpamClassifiers.scala @@ -10,7 +10,7 @@ import edu.illinois.cs.cogcomp.lbjava.learn.SupportVectorMachine import edu.illinois.cs.cogcomp.saul.classifier.Learnable import edu.illinois.cs.cogcomp.saul.learn.SaulWekaWrapper import edu.illinois.cs.cogcomp.saulexamples.nlp.EmailSpam.SpamDataModel._ -import weka.classifiers.bayes.NaiveBayes +import weka.classifiers.`lazy`.IBk object SpamClassifiers { object SpamClassifier extends Learnable(email) { @@ -33,7 +33,7 @@ object SpamClassifiers { } object SpamClassifierWeka extends Learnable(email) { def label = spamLabel - override lazy val classifier = new SaulWekaWrapper(new NaiveBayes()) + override lazy val classifier = new SaulWekaWrapper(new IBk(3)) override def feature = using(words) } } From 44a9e33b7389c1f3d652a8998e352402fde2c61f Mon Sep 17 00:00:00 2001 From: kordjam Date: Wed, 2 Nov 2016 20:55:36 -0500 Subject: [PATCH 117/118] -thanks bhargav, fixed the initialization cloning - Added better organized jointraining tests --- .../classifier/JointTrainSparseNetwork.scala | 2 +- .../SL_model/StructuredLearning.scala | 2 +- .../saul/classifier/SimpleSparseNetwork.scala | 99 ++++++++++--------- .../classifier/infer/InitSparseNetwork.scala | 2 +- .../cogcomp/saulexamples/Badge/BagesApp.scala | 69 ++++++++----- 5 files changed, 99 insertions(+), 75 deletions(-) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala index ab72a0fe..ae268829 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala @@ -78,7 +78,7 @@ object JointTrainSparseNetwork { val conjugateLabels = baseClassifier.isUsingConjunctiveLabels | baseClassifier.getLabelLexicon.lookupKey(label).isConjunctive baseClassifier.setConjunctiveLabels(conjugateLabels) - val ltu: LinearThresholdUnit = baseClassifier.getBaseLTU + val ltu: LinearThresholdUnit = baseClassifier.getBaseLTU.clone().asInstanceOf[LinearThresholdUnit] ltu.initialize(baseClassifier.getNumExamples, baseClassifier.getNumFeatures) baseClassifier.getNetwork.set(label, ltu) N = label + 1 diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala index 73a8fd2b..66c699e1 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/StructuredLearning.scala @@ -34,7 +34,7 @@ object StructuredLearning { // para.CHECK_INFERENCE_OPT = false model.featureGenerator = new SL_FeatureGenerator(model) - para.loadConfigFile("../config/DCD.config") + para.loadConfigFile("./config/DCD.config") model.para = para val learner = LearnerFactory.getLearner(model.infSolver, model.featureGenerator, para); model.wv = learner.train(sp, model.wv) diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala index bb64b39d..4484fc07 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SimpleSparseNetwork.scala @@ -35,63 +35,64 @@ object SimpleSparseNetwork { case (candidate, idx) => // if (idx % 5000 == 0) - logger.info(s"Training: $idx examples inferred.") - val oracle = currentClassifier.getLabeler - val baseClassifier = currentClassifier.classifier.asInstanceOf[SparseNetworkLearner] + logger.info(s"Training: $idx examples inferred.") + val oracle = currentClassifier.getLabeler + val baseClassifier = currentClassifier.classifier.asInstanceOf[SparseNetworkLearner] + + { + def trainOnce() = { + val result = currentClassifier.classifier.discreteValue(candidate) + val trueLabel = oracle.discreteValue(candidate) + val lLexicon = currentClassifier.getLabelLexicon + var LTU_actual: Int = 0 + var LTU_predicted: Int = 0 + for (i <- 0 until lLexicon.size()) { + if (lLexicon.lookupKey(i).valueEquals(result)) + LTU_predicted = i + if (lLexicon.lookupKey(i).valueEquals(trueLabel)) + LTU_actual = i + } + // The idea is that when the prediction is wrong the LTU of the actual class should be promoted + // and the LTU of the predicted class should be demoted. + if (!result.equals(trueLabel)) //equals("true") && trueLabel.equals("false") ) { - def trainOnce() = { - val result = currentClassifier.classifier.discreteValue(candidate) - val trueLabel = oracle.discreteValue(candidate) - val lLexicon = currentClassifier.getLabelLexicon - var LTU_actual: Int = 0 - var LTU_predicted: Int = 0 - for (i <- 0 until lLexicon.size()) { - if (lLexicon.lookupKey(i).valueEquals(result)) - LTU_predicted = i - if (lLexicon.lookupKey(i).valueEquals(trueLabel)) - LTU_actual = i - } - - // The idea is that when the prediction is wrong the LTU of the actual class should be promoted - // and the LTU of the predicted class should be demoted. - if (!result.equals(trueLabel)) //equals("true") && trueLabel.equals("false") ) - { - val a = currentClassifier.getExampleArray(candidate,true) - val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures - val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues - val exampleLabels = a(2).asInstanceOf[Array[Int]] - val label = exampleLabels(0) - var N = baseClassifier.getNetwork.size - - if (label >= N || baseClassifier.getNetwork.get(label) == null) { - val conjugateLabels = baseClassifier.isUsingConjunctiveLabels | baseClassifier.getLabelLexicon.lookupKey(label).isConjunctive - baseClassifier.setConjunctiveLabels(conjugateLabels) - - val ltu: LinearThresholdUnit = baseClassifier.getBaseLTU - ltu.initialize(baseClassifier.getNumExamples, baseClassifier.getNumFeatures) - baseClassifier.getNetwork.set(label, ltu) - N = label + 1 - } - - // test push - val ltu_actual = baseClassifier.getLTU(LTU_actual).asInstanceOf[LinearThresholdUnit] - val ltu_predicted = baseClassifier.getLTU(LTU_predicted).asInstanceOf[LinearThresholdUnit] - - if (ltu_actual != null) - ltu_actual.promote(a0, a1, 0.1) - if (ltu_predicted != null) - ltu_predicted.demote(a0, a1, 0.1) - } + val a = currentClassifier.getExampleArray(candidate) + val a0 = a(0).asInstanceOf[Array[Int]] //exampleFeatures + val a1 = a(1).asInstanceOf[Array[Double]] // exampleValues + val exampleLabels = a(2).asInstanceOf[Array[Int]] + val labelValues = a(3).asInstanceOf[Array[Double]] + val label = exampleLabels(0) + var N = baseClassifier.getNetwork.size + + if (label >= N || baseClassifier.getNetwork.get(label) == null) { + val conjugateLabels = baseClassifier.isUsingConjunctiveLabels | baseClassifier.getLabelLexicon.lookupKey(label).isConjunctive + baseClassifier.setConjunctiveLabels(conjugateLabels) + + val ltu: LinearThresholdUnit = baseClassifier.getBaseLTU.clone.asInstanceOf[LinearThresholdUnit] + ltu.initialize(baseClassifier.getNumExamples, baseClassifier.getNumFeatures) + baseClassifier.getNetwork.set(label, ltu) + N = label + 1 } - trainOnce() + // test push + val ltu_actual = baseClassifier.getLTU(LTU_actual).asInstanceOf[LinearThresholdUnit] + val ltu_predicted = baseClassifier.getLTU(LTU_predicted).asInstanceOf[LinearThresholdUnit] + + if (ltu_actual != null) + ltu_actual.promote(a0, a1, 0.1) + if (ltu_predicted != null) + ltu_predicted.demote(a0, a1, 0.1) } + } + + trainOnce() } - train(node, currentClassifier, it - 1, false) } - + train(node, currentClassifier, it - 1, false) } + } + } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala index 8a73191a..94c04cef 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/infer/InitSparseNetwork.scala @@ -34,7 +34,7 @@ object InitSparseNetwork { if (label >= N || iLearner.getNetwork.get(label) == null) { val isConjunctiveLabels = iLearner.isUsingConjunctiveLabels | iLearner.getLabelLexicon.lookupKey(label).isConjunctive iLearner.setConjunctiveLabels(isConjunctiveLabels) - val ltu: LinearThresholdUnit = iLearner.getBaseLTU + val ltu: LinearThresholdUnit = iLearner.getBaseLTU.clone().asInstanceOf[LinearThresholdUnit] ltu.initialize(iLearner.getNumExamples, iLearner.getNumFeatures) iLearner.getNetwork.set(label, ltu) } diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala index c7c41611..f7da61a8 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala @@ -3,13 +3,14 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge /** Created by Parisa on 9/13/16. */ -import edu.illinois.cs.cogcomp.saul.classifier.SimpleSparseNetwork -import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers._ -import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers.{badgeConstrainedClassifierMulti, oppositBadgeConstrainedClassifierMulti} +import edu.illinois.cs.cogcomp.saul.classifier.SL_model.StructuredLearning +import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, JointTrain, JointTrainSparseNetwork } +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers.{ BadgeClassifier, BadgeOppositClassifier } +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers.{ badgeConstrainedClassifier, badgeConstrainedClassifierMulti, oppositBadgeConstrainedClassifier, oppositBadgeConstrainedClassifierMulti } import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeDataModel._ import scala.collection.JavaConversions._ -object BadgesApp extends App { +object BadgesApp { val allNamesTrain = new BadgeReader("data/badges/badges.train").badges val allNamesTest = new BadgeReader("data/badges/badges.test").badges @@ -17,33 +18,55 @@ object BadgesApp extends App { badge.populate(allNamesTrain) badge.populate(allNamesTest, false) - /*Test the join training with SparsePerceptron*/ + val cls = List(badgeConstrainedClassifierMulti, oppositBadgeConstrainedClassifierMulti) + + object BadgeExperimentType extends Enumeration { + val JoinTrainSparsePerceptron, JoinTrainSparseNetwork, JoinTrainSL = Value + } - // BadgeClassifier.test() - // BadgeOppositClassifier.test() - // JointTrain.train(BadgeDataModel.badge,List(badgeConstrainedClassifier,oppositBadgeConstrainedClassifier),5) - // badgeConstrainedClassifier.test() - // BadgeClassifier.test() - // oppositBadgeConstrainedClassifier.test() + def main(args: Array[String]): Unit = { + /** Choose the experiment you're interested in by changing the following line */ + val testType = BadgeExperimentType.JoinTrainSL + + testType match { + case BadgeExperimentType.JoinTrainSparsePerceptron => JoinTrainSparsePerceptron() + case BadgeExperimentType.JoinTrainSparseNetwork => JoinTrainSparseNetwork() + case BadgeExperimentType.JoinTrainSL => JoinTrainSL() + } + } + + /*Test the join training with SparsePerceptron*/ + def JoinTrainSparsePerceptron(): Unit = { + BadgeClassifier.test() + BadgeOppositClassifier.test() + JointTrain.train(BadgeDataModel.badge, List(badgeConstrainedClassifier, oppositBadgeConstrainedClassifier), 5) + badgeConstrainedClassifier.test() + BadgeClassifier.test() + oppositBadgeConstrainedClassifier.test() + } /*Test the joinTraining with SparseNetwork*/ + def JoinTrainSparseNetwork(): Unit = { + + ClassifierUtils.InitializeClassifiers(badge, cls: _*) + + JointTrainSparseNetwork.train(badge, cls, 5, false) - // BadgeClassifierMulti.test() - //BadgeOppositClassifierMulti.test() - val cls=List(badgeConstrainedClassifierMulti,oppositBadgeConstrainedClassifierMulti) + badgeConstrainedClassifierMulti.test() + oppositBadgeConstrainedClassifier.test() + } - // ClassifierUtils.InitializeClassifiers(badge, cls: _*) + /*Test the joinTraining with Structured output prediction in SL*/ + def JoinTrainSL(): Unit = { - // JointTrainSparseNetwork.train(badge,cls,5,false) - // badgeConstrainedClassifierMulti.test() + ClassifierUtils.InitializeClassifiers(badge, cls: _*) + val m = StructuredLearning(badge, cls, usePreTrained = false) - //oppositBadgeConstrainedClassifierMulti.test() - for (i<- 0 until 100) - BadgeClassifierMulti.classifier.learn(allNamesTrain.get(i)) + badgeConstrainedClassifierMulti.test() + oppositBadgeConstrainedClassifier.test() - BadgeClassifierMulti.test() + StructuredLearning.Evaluate(badge, cls, m, "") - SimpleSparseNetwork.train(badge, BadgeClassifierMulti, 1, false) + } - BadgeClassifierMulti.test() } \ No newline at end of file From c14755b7b52fc2a7dd2cd4ce6d1c47cdef522ffc Mon Sep 17 00:00:00 2001 From: kordjam Date: Fri, 4 Nov 2016 11:55:34 -0500 Subject: [PATCH 118/118] -loss augmented inference with SparseNetworks added -some tests edited --- .../classifier/JointTrainSparseNetwork.scala | 22 +- .../classifier/SL_model/SaulSLModel.scala | 8 +- .../cogcomp/saulexamples/Badge/BagesApp.scala | 28 +- .../saulexamples/nlp/Badge/weightTest.scala | 248 ++++++++++++++++++ .../nlp/EntityRelation/weightTest.scala | 166 ------------ 5 files changed, 287 insertions(+), 185 deletions(-) create mode 100644 saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/Badge/weightTest.scala delete mode 100644 saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala index ae268829..62924d19 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/JointTrainSparseNetwork.scala @@ -18,16 +18,16 @@ object JointTrainSparseNetwork { val logger: Logger = LoggerFactory.getLogger(this.getClass) var difference = 0 - def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], init: Boolean)(implicit headTag: ClassTag[HEAD]) = { - train[HEAD](node, cls, 1, init) + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], init: Boolean,lossAugmented: Boolean)(implicit headTag: ClassTag[HEAD]) = { + train[HEAD](node, cls, 1, init,lossAugmented) } - def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], it: Int, init: Boolean)(implicit headTag: ClassTag[HEAD]) = { - train[HEAD](node, cls, it, init) + def apply[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], it: Int, init: Boolean, lossAugmented: Boolean=false)(implicit headTag: ClassTag[HEAD]) = { + train[HEAD](node, cls, it, init, lossAugmented) } @scala.annotation.tailrec - def train[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], it: Int, init: Boolean)(implicit headTag: ClassTag[HEAD]): Unit = { + def train[HEAD <: AnyRef](node: Node[HEAD], cls: List[ConstrainedClassifier[_, HEAD]], it: Int, init: Boolean, lossAugmented: Boolean=false)(implicit headTag: ClassTag[HEAD]): Unit = { // forall members in collection of the head (dm.t) do logger.info("Training iteration: " + it) if (init) ClassifierUtils.InitializeClassifiers(node, cls: _*) @@ -43,6 +43,12 @@ object JointTrainSparseNetwork { if (idx % 5000 == 0) logger.info(s"Training: $idx examples inferred.") + if (lossAugmented) + cls.foreach{ cls_i => + cls_i.onClassifier.classifier.setLossFlag() + cls_i.onClassifier.classifier.setCandidates(cls_i.getCandidates(h).size * cls.size) + } + cls.foreach { currentClassifier: ConstrainedClassifier[_, HEAD] => val oracle = currentClassifier.onClassifier.getLabeler @@ -51,6 +57,7 @@ object JointTrainSparseNetwork { candidate => { def trainOnce() = { + val result = currentClassifier.classifier.discreteValue(candidate) val trueLabel = oracle.discreteValue(candidate) val lLexicon = currentClassifier.onClassifier.getLabelLexicon @@ -98,8 +105,13 @@ object JointTrainSparseNetwork { trainOnce() } } + } } + if (lossAugmented) + cls.foreach{ cls_i => + cls_i.onClassifier.classifier.unsetLossFlag() + } } train(node, cls, it - 1, false) } diff --git a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala index 30db7cdd..b61edbe8 100644 --- a/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala +++ b/saul-core/src/main/scala/edu/illinois/cs/cogcomp/saul/classifier/SL_model/SaulSLModel.scala @@ -6,18 +6,18 @@ */ package edu.illinois.cs.cogcomp.saul.classifier.SL_model -import java.io.{ BufferedOutputStream, FileOutputStream, ObjectOutputStream } +import java.io.{BufferedOutputStream, FileOutputStream, ObjectOutputStream} import edu.illinois.cs.cogcomp.saul.classifier.ConstrainedClassifier -import edu.illinois.cs.cogcomp.sl.core.{ SLModel, SLParameters } +import edu.illinois.cs.cogcomp.sl.core.{SLModel, SLParameters} import scala.collection.mutable.ListBuffer /** Created by Parisa on 4/1/16. */ class SaulSLModel[HEAD <: AnyRef](cls: List[ConstrainedClassifier[_, HEAD]], listBuffer: ListBuffer[Array[Float]] = ListBuffer()) extends SLModel with Serializable { - var LTUWeightTemplates: ListBuffer[Array[Float]] = listBuffer - var Factors: ListBuffer[ConstrainedClassifier[_, HEAD]] = ListBuffer() + val LTUWeightTemplates: ListBuffer[Array[Float]] = listBuffer + val Factors: ListBuffer[ConstrainedClassifier[_, HEAD]] = ListBuffer() cls.foreach { (c: ConstrainedClassifier[_, HEAD]) => Factors += (c) diff --git a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala index f7da61a8..d0d37dcc 100644 --- a/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala +++ b/saul-examples/src/main/scala/edu/illinois/cs/cogcomp/saulexamples/Badge/BagesApp.scala @@ -4,9 +4,9 @@ package edu.illinois.cs.cogcomp.saulexamples.Badge */ import edu.illinois.cs.cogcomp.saul.classifier.SL_model.StructuredLearning -import edu.illinois.cs.cogcomp.saul.classifier.{ ClassifierUtils, JointTrain, JointTrainSparseNetwork } -import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers.{ BadgeClassifier, BadgeOppositClassifier } -import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers.{ badgeConstrainedClassifier, badgeConstrainedClassifierMulti, oppositBadgeConstrainedClassifier, oppositBadgeConstrainedClassifierMulti } +import edu.illinois.cs.cogcomp.saul.classifier.{ClassifierUtils, JointTrain, JointTrainSparseNetwork} +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers.{BadgeOppositClassifier, BadgeClassifier} +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeConstraintClassifiers.{badgeConstrainedClassifier, badgeConstrainedClassifierMulti, oppositBadgeConstrainedClassifier, oppositBadgeConstrainedClassifierMulti} import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeDataModel._ import scala.collection.JavaConversions._ @@ -21,16 +21,17 @@ object BadgesApp { val cls = List(badgeConstrainedClassifierMulti, oppositBadgeConstrainedClassifierMulti) object BadgeExperimentType extends Enumeration { - val JoinTrainSparsePerceptron, JoinTrainSparseNetwork, JoinTrainSL = Value + val JoinTrainSparsePerceptron, JointTrainSparseNetwork, JointTrainSparseNetworkLossAugmented, JoinTrainSL = Value } def main(args: Array[String]): Unit = { /** Choose the experiment you're interested in by changing the following line */ - val testType = BadgeExperimentType.JoinTrainSL + val testType = BadgeExperimentType.JointTrainSparseNetworkLossAugmented testType match { case BadgeExperimentType.JoinTrainSparsePerceptron => JoinTrainSparsePerceptron() - case BadgeExperimentType.JoinTrainSparseNetwork => JoinTrainSparseNetwork() + case BadgeExperimentType.JointTrainSparseNetwork => JoinTrainSparseNetwork() + case BadgeExperimentType.JointTrainSparseNetworkLossAugmented => LossAugmentedJoinTrainSparseNetwork() case BadgeExperimentType.JoinTrainSL => JoinTrainSL() } } @@ -40,20 +41,27 @@ object BadgesApp { BadgeClassifier.test() BadgeOppositClassifier.test() JointTrain.train(BadgeDataModel.badge, List(badgeConstrainedClassifier, oppositBadgeConstrainedClassifier), 5) + oppositBadgeConstrainedClassifier.test() badgeConstrainedClassifier.test() BadgeClassifier.test() - oppositBadgeConstrainedClassifier.test() } /*Test the joinTraining with SparseNetwork*/ def JoinTrainSparseNetwork(): Unit = { - ClassifierUtils.InitializeClassifiers(badge, cls: _*) + JointTrainSparseNetwork.train(badge, cls, 5, init = true) + + badgeConstrainedClassifierMulti.test() + oppositBadgeConstrainedClassifierMulti.test() + } - JointTrainSparseNetwork.train(badge, cls, 5, false) + /*Test the joinTraining with SparseNetwork and doing loss augmented inference*/ + def LossAugmentedJoinTrainSparseNetwork(): Unit = { + + JointTrainSparseNetwork.train(badge, cls, 5, init = true,lossAugmented = true) badgeConstrainedClassifierMulti.test() - oppositBadgeConstrainedClassifier.test() + oppositBadgeConstrainedClassifierMulti.test() } /*Test the joinTraining with Structured output prediction in SL*/ diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/Badge/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/Badge/weightTest.scala new file mode 100644 index 00000000..4201ee5f --- /dev/null +++ b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/Badge/weightTest.scala @@ -0,0 +1,248 @@ +/** This software is released under the University of Illinois/Research and Academic Use License. See + * the LICENSE file in the root folder for details. Copyright (c) 2016 + * + * Developed by: The Cognitive Computations Group, University of Illinois at Urbana-Champaign + * http://cogcomp.cs.illinois.edu/ + */ +package edu.illinois.cs.cogcomp.saulexamples.nlp.Badge + +import edu.illinois.cs.cogcomp.lbjava.learn.{LinearThresholdUnit, SparseNetworkLearner} +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeClassifiers.{BadgeClassifierMulti, BadgeOppositClassifierMulti} +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeDataModel._ +import edu.illinois.cs.cogcomp.saulexamples.Badge.BadgeReader +import edu.illinois.cs.cogcomp.sl.util.WeightVector +import org.scalatest.{FlatSpec, Matchers} + +import scala.Array._ +import scala.collection.JavaConversions._ +import scala.collection.mutable.ListBuffer + +class weightTest extends FlatSpec with Matchers { + + val allNamesTrain = new BadgeReader("/Users/Parisa/iSoftware/Github_forked/ParisaVersion/ParisaPublicVersion/saul/data/badges/badges.train").badges + val allNamesTest = new BadgeReader("/Users/Parisa/iSoftware/Github_forked/ParisaVersion/ParisaPublicVersion/saul/data/badges/badges.test").badges + + badge.populate(allNamesTrain) + badge.populate(allNamesTest,false) + BadgeClassifierMulti.learn(2) + BadgeOppositClassifierMulti.learn(2) + BadgeClassifierMulti.test() + BadgeOppositClassifierMulti.test() + var fullWeightList: ListBuffer[Array[Float]] = ListBuffer() + var wvLength = 0 + "update weight" should "work" in { + List(BadgeClassifierMulti,BadgeOppositClassifierMulti).foreach{ + x => { + val sparseNet = x.classifier.asInstanceOf[SparseNetworkLearner] + val lexiconSize = (sparseNet.getLexicon.size()) + + for (i <- 0 until sparseNet.getNetwork.size()) { + val fullWeights = Array.fill[Float](lexiconSize)(0) + val trainedWeighs = x.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector + println("joint before ", trainedWeighs,", s=", trainedWeighs.size()) + + for (j <- 0 until lexiconSize) + fullWeights(j) = trainedWeighs.getWeight(j).asInstanceOf[Float] + + fullWeightList = fullWeightList :+ fullWeights + + wvLength = wvLength + lexiconSize + } + + println("lexicon size: " + sparseNet.getLexicon.size(), "* label lexicon size:", sparseNet.getLabelLexicon.size()) + } + } + + // wv = Concatenate_(over factors)Concatenate_(over ltu) => size(wv)=sum_(over factors)sum_(over ltu)(size(ltu_i)) + + val myWeight = Array(fullWeightList.flatten: _*) + val wv = new WeightVector(myWeight) // wv this is one unified weight vector of all initialized LTUs + wvLength should be (72) + + BadgeClassifierMulti.test() + + var ltu_count = 0 + var offset = 0 + List(BadgeClassifierMulti,BadgeOppositClassifierMulti).foreach { + cf => + for (i <- 0 until cf.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.size()) { + val ltuSize = cf.classifier.asInstanceOf[SparseNetworkLearner].getLexicon.size()//.net.get(i).asInstanceOf[LinearThresholdUnit].getParameters.asInstanceOf[LinearThresholdUnit.Parameters].weightVector + // print("w", ltu_count, " size:\t", ltuSize.size) + val myLTUJointlyTrainedWeight = wv.getWeightArray.slice(offset, offset + ltuSize) + // var count = 0 + // for (count <- cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size() until ltuSize.size) + // myLTUJointlyTrainedWeight = myLTUJointlyTrainedWeight :+ 0.asInstanceOf[Float] + // if (cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size()!= ltuSize.size) { + // println("size mismatch!", cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector.size(), ",", ltuSize.size) + // } + val exampleFeatureIndexes = ofDim[Int](myLTUJointlyTrainedWeight.length) + val weightVector = cf.classifier.asInstanceOf[SparseNetworkLearner].getLTU(i).asInstanceOf[LinearThresholdUnit].getWeightVector + weightVector.clear() + + // val exampleFeatureIndexes = cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.getMap.values.toArray.map(_.asInstanceOf[Int])//.toArray//.toArray().asInstanceOf[Array[Int]] + for (featureIndex <- myLTUJointlyTrainedWeight.indices) { + exampleFeatureIndexes(featureIndex) = featureIndex + weightVector.setWeight(featureIndex, myLTUJointlyTrainedWeight(featureIndex)) + //cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLexicon.; + } + + //.getParameters.asInstanceOf[LinearThresholdUnit.Parameters] + // cf.onClassifier.classifier.asInstanceOf[SparseNetworkLBP].getLTU(i).getWeightVector.scaledAdd(exampleFeatureIndexes, Utils.converFarrayToD(myLTUJointlyTrainedWeight), 1.0) + offset = offset + ltuSize//ltuTemplates(ltu_count).length + ltu_count = ltu_count + 1 + val trainedWeighs2 = cf.classifier.asInstanceOf[SparseNetworkLearner].getNetwork.get(i).asInstanceOf[LinearThresholdUnit].getWeightVector + println("after joint ", trainedWeighs2, ", s=", trainedWeighs2.size()) + } + } + + BadgeClassifierMulti.test() + + + } + +// "weights initializer" should "join multiple weight vectors" in { +// var lt: ListBuffer[Array[Float]] = ListBuffer() +// var wvLength = 0 +// // Add 3 factors (size 3, 4, 7) +// val length1 = 3 +// val length2 = 4 +// val length3 = 7 +// val t1: Array[Float] = Array(4.0f, 6.0f, 8.0f) +// wvLength = wvLength + length1 +// val t2: Array[Float] = Array(-8.0f, -6.0f, -4.0f, 0.0f) +// wvLength = wvLength + length2 +// val t3: Array[Float] = Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f) +// wvLength = wvLength + length3 +// +// // Append the individual vectors to the buffer +// lt = lt :+ t1 +// lt = lt :+ t2 +// lt = lt :+ t3 +// +// // Create the complete weight vector +// val myWeight = Array(lt.flatten: _*) +// val wv = new WeightVector(myWeight) +// wv.getWeightArray should be(Array(4.0f, 6.0f, 8.0f, -8.0f, -6.0f, -4.0f, 0.0f, 14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f)) +// } +// +// "weight update" should "distribute the joint weight vector" in { +// var lt: ListBuffer[Array[Float]] = ListBuffer() +// var wvLength = 0 +// // Add 3 factors (size 3, 4, 7) +// val t1: Array[Float] = Array(4.0f, 6.0f, 8.0f) +// wvLength = wvLength + t1.length +// val t2: Array[Float] = Array(-8.0f, -6.0f, -4.0f, 0.0f) +// wvLength = wvLength + t2.length +// val t3: Array[Float] = Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f) +// wvLength = wvLength + t3.length +// +// // Append the individual vectors to the buffer +// lt = lt :+ t1 +// lt = lt :+ t2 +// lt = lt :+ t3 +// +// // Create the complete weight vector +// val myWeight = Array(lt.flatten: _*) +// val wv = new WeightVector(myWeight) +// +// var offset = 0 +// val factorWeight1 = wv.getWeightArray.slice(offset, offset + t1.length) +// factorWeight1 should be(Array(4.0f, 6.0f, 8.0f)) +// offset = offset + t1.length +// +// val factorWeight2 = wv.getWeightArray.slice(offset, offset + t2.length) +// factorWeight2 should be(Array(-8.0f, -6.0f, -4.0f, 0.0f)) +// offset = offset + t2.length +// +// val factorWeight3 = wv.getWeightArray.slice(offset, offset + t3.length) +// factorWeight3 should be(Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f)) +// } +// "featureVector operations" should "work" in { +// val fvGlobal = new FeatureVectorBuffer() +// val fv = new FeatureVectorBuffer() +// val a0: Array[Int] = Array(1, 2, 3) +// val a1: Array[Double] = Array(0.1, 0.2, 0.3) +// val fvTemp = new FeatureVectorBuffer(a0, a1) +// fvGlobal.addFeature(fvTemp) +// fvTemp.toFeatureVector.getIndices should be(Array(1, 2, 3)) +// fvGlobal.addFeature(fvTemp, 3) +// fvGlobal.addFeature(fvTemp, 3) +// fvGlobal.shift(1) +// fvGlobal.toFeatureVector.getIndices should be(Array(2, 3, 4, 5, 6, 7)) +// } +// +// +// // Testing the original functions with real classifiers +// "integration test" should "work" in { +// // Initialize toy model +// import testModel._ +// object TestClassifier extends Learnable(tokens) { +// def label = testLabel +// +// override def feature = using(word) +// +// override lazy val classifier = new SparseNetworkLearner() +// } +// object TestBiClassifier extends Learnable(tokens) { +// def label = testLabel +// +// override def feature = using(word, biWord) +// +// override lazy val classifier = new SparseNetworkLearner() +// } +// object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { +// def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } +// +// //override val pathToHead = Some(-iEdge) +// // override def filter(t: String, h: String): Boolean = t.equals(h) +// override val solver = new OJalgoHook +// } +// object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { +// def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } +// +// // override val pathToHead = Some(-iEdge) +// //override def filter(t: String, h: String): Boolean = t.equals(h) +// override val solver = new OJalgoHook +// } +// +// val words = List("this", "is", "a", "test") +// tokens.populate(words) +// +// val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) +// // This should combine the weights +// val m = StructuredLearning(tokens, cls) +// +// val clNet1 = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] +// val clNet2 = TestBiConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] +// val wv1 = clNet1.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector +// val wv2 = clNet2.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector +// +// m.Factors.size should be(2) +// +// wv1.size() should be(4) +// wv2.size() should be(8) +// // Combined size should be 12 +// m.wv.getLength should be(12) +// +// // This should distribute the weights +// m.infSolver.asInstanceOf[Saul_SL_Inference[String]].updateWeights(m.wv) +// +// val wv1After = clNet1.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector +// val wv2After = clNet2.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector +// +// //Everything should be the same +// wv1After.size() should be(4) +// wv2After.size() should be(8) +// // Combined size should be 12 +// m.wv.getLength should be(12) +// } +// +// object testModel extends DataModel { +// val tokens = node[String] +// val iEdge = edge(tokens, tokens) +// val testLabel = property(tokens) { x: String => x.equals("candidate") } +// val word = property(tokens) { x: String => x } +// val biWord = property(tokens) { x: String => x + "-" + x } +// } + +} diff --git a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala b/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala deleted file mode 100644 index 8be17f26..00000000 --- a/saul-examples/src/test/scala/edu/illinois/cs/cogcomp/saulexamples/nlp/EntityRelation/weightTest.scala +++ /dev/null @@ -1,166 +0,0 @@ -/** This software is released under the University of Illinois/Research and Academic Use License. See - * the LICENSE file in the root folder for details. Copyright (c) 2016 - * - * Developed by: The Cognitive Computations Group, University of Illinois at Urbana-Champaign - * http://cogcomp.cs.illinois.edu/ - */ -package edu.illinois.cs.cogcomp.saulexamples.nlp.EntityRelation - -import edu.illinois.cs.cogcomp.infer.ilp.OJalgoHook -import edu.illinois.cs.cogcomp.lbjava.infer.FirstOrderConstant -import edu.illinois.cs.cogcomp.lbjava.learn.{ LinearThresholdUnit, SparseNetworkLearner } -import edu.illinois.cs.cogcomp.saul.classifier.SL_model.{ Saul_SL_Inference, StructuredLearning } -import edu.illinois.cs.cogcomp.saul.classifier.{ ConstrainedClassifier, Learnable } -import edu.illinois.cs.cogcomp.saul.datamodel.DataModel -import edu.illinois.cs.cogcomp.sl.util.{ FeatureVectorBuffer, WeightVector } -import org.scalatest.{ FlatSpec, Matchers } - -import scala.collection.mutable.ListBuffer - -class weightTest extends FlatSpec with Matchers { - - "weights initializer" should "join multiple weight vectors" in { - var lt: ListBuffer[Array[Float]] = ListBuffer() - var wvLength = 0 - // Add 3 factors (size 3, 4, 7) - val length1 = 3 - val length2 = 4 - val length3 = 7 - val t1: Array[Float] = Array(4.0f, 6.0f, 8.0f) - wvLength = wvLength + length1 - val t2: Array[Float] = Array(-8.0f, -6.0f, -4.0f, 0.0f) - wvLength = wvLength + length2 - val t3: Array[Float] = Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f) - wvLength = wvLength + length3 - - // Append the individual vectors to the buffer - lt = lt :+ t1 - lt = lt :+ t2 - lt = lt :+ t3 - - // Create the complete weight vector - val myWeight = Array(lt.flatten: _*) - val wv = new WeightVector(myWeight) - wv.getWeightArray should be(Array(4.0f, 6.0f, 8.0f, -8.0f, -6.0f, -4.0f, 0.0f, 14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f)) - } - - "weight update" should "distribute the joint weight vector" in { - var lt: ListBuffer[Array[Float]] = ListBuffer() - var wvLength = 0 - // Add 3 factors (size 3, 4, 7) - val t1: Array[Float] = Array(4.0f, 6.0f, 8.0f) - wvLength = wvLength + t1.length - val t2: Array[Float] = Array(-8.0f, -6.0f, -4.0f, 0.0f) - wvLength = wvLength + t2.length - val t3: Array[Float] = Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f) - wvLength = wvLength + t3.length - - // Append the individual vectors to the buffer - lt = lt :+ t1 - lt = lt :+ t2 - lt = lt :+ t3 - - // Create the complete weight vector - val myWeight = Array(lt.flatten: _*) - val wv = new WeightVector(myWeight) - - var offset = 0 - val factorWeight1 = wv.getWeightArray.slice(offset, offset + t1.length) - factorWeight1 should be(Array(4.0f, 6.0f, 8.0f)) - offset = offset + t1.length - - val factorWeight2 = wv.getWeightArray.slice(offset, offset + t2.length) - factorWeight2 should be(Array(-8.0f, -6.0f, -4.0f, 0.0f)) - offset = offset + t2.length - - val factorWeight3 = wv.getWeightArray.slice(offset, offset + t3.length) - factorWeight3 should be(Array(14.0f, 16.0f, 18.0f, 24.0f, 35.5f, 78.32f, 567.865f)) - } - "featureVector operations" should "work" in { - val fvGlobal = new FeatureVectorBuffer() - val fv = new FeatureVectorBuffer() - val a0: Array[Int] = Array(1, 2, 3) - val a1: Array[Double] = Array(0.1, 0.2, 0.3) - val fvTemp = new FeatureVectorBuffer(a0, a1) - fvGlobal.addFeature(fvTemp) - fvTemp.toFeatureVector.getIndices should be(Array(1, 2, 3)) - fvGlobal.addFeature(fvTemp, 3) - fvGlobal.addFeature(fvTemp, 3) - fvGlobal.shift(1) - fvGlobal.toFeatureVector.getIndices should be(Array(2, 3, 4, 5, 6, 7)) - } - - // Testing the original functions with real classifiers - "integration test" should "work" in { - // Initialize toy model - import testModel._ - object TestClassifier extends Learnable(tokens) { - def label = testLabel - - override def feature = using(word) - - override lazy val classifier = new SparseNetworkLearner() - } - object TestBiClassifier extends Learnable(tokens) { - def label = testLabel - - override def feature = using(word, biWord) - - override lazy val classifier = new SparseNetworkLearner() - } - object TestConstraintClassifier extends ConstrainedClassifier[String, String](TestClassifier) { - def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } - - //override val pathToHead = Some(-iEdge) - // override def filter(t: String, h: String): Boolean = t.equals(h) - override val solver = new OJalgoHook - } - object TestBiConstraintClassifier extends ConstrainedClassifier[String, String](TestBiClassifier) { - def subjectTo = ConstrainedClassifier.constraint { _ => new FirstOrderConstant(true) } - - // override val pathToHead = Some(-iEdge) - //override def filter(t: String, h: String): Boolean = t.equals(h) - override val solver = new OJalgoHook - } - - val words = List("this", "is", "a", "test") - tokens.populate(words) - - val cls = List(TestConstraintClassifier, TestBiConstraintClassifier) - // This should combine the weights - val m = StructuredLearning(tokens, cls) - - val clNet1 = TestConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] - val clNet2 = TestBiConstraintClassifier.onClassifier.classifier.asInstanceOf[SparseNetworkLearner] - val wv1 = clNet1.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector - val wv2 = clNet2.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector - - m.Factors.size should be(2) - - wv1.size() should be(4) - wv2.size() should be(8) - // Combined size should be 12 - m.wv.getLength should be(12) - - // This should distribute the weights - m.infSolver.asInstanceOf[Saul_SL_Inference[String]].updateWeights(m.wv) - - val wv1After = clNet1.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector - val wv2After = clNet2.getNetwork.get(0).asInstanceOf[LinearThresholdUnit].getWeightVector - - //Everything should be the same - wv1After.size() should be(4) - wv2After.size() should be(8) - // Combined size should be 12 - m.wv.getLength should be(12) - } - - object testModel extends DataModel { - val tokens = node[String] - val iEdge = edge(tokens, tokens) - val testLabel = property(tokens) { x: String => x.equals("candidate") } - val word = property(tokens) { x: String => x } - val biWord = property(tokens) { x: String => x + "-" + x } - } - -}