Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5c80a34
Add an SRL Annotator.
Apr 14, 2017
246fb33
Fix prerequisites.
Apr 14, 2017
c429ea6
SRL DataModel change to object instead of a class.
Apr 14, 2017
02a0e96
Formatting fixes.
Apr 14, 2017
b28e070
Fix some unit tests.
Apr 14, 2017
78ca26c
Add a unit test for the annotator.
Apr 14, 2017
0abd4d4
Update dependencies.
Apr 16, 2017
26e8907
Some fixes to SRLApps and Pipeline usage.
Apr 18, 2017
0a11468
Some fixes.
May 1, 2017
a579ecb
Update SRL Model and minor changes to annotator.
May 2, 2017
84ec2cb
Merge remote-tracking branch 'upstream/master' into srl_annotator
May 2, 2017
130f0b7
Replace Gurobi -> OJAlgo so that unit test passes.
May 2, 2017
7b038d4
Some fixes for unit tests.
May 2, 2017
ac3b3d6
Disable Pipeline caching for an SRL unit test.
May 2, 2017
8523221
Add the matching sensor.
May 3, 2017
fda3710
Make SRLMultiGraphDataModel a class again.
May 4, 2017
a6f92bf
Mark SRL Annotator unit test as HighMemoryTest
May 4, 2017
683e4f5
Minor updates.
Jun 27, 2017
33b40f6
Fixes to population.
Jun 27, 2017
25bfbc7
Some updates to the annotator.
Jun 28, 2017
d805a9e
Add an SRL Evaluation using the SRL Annotator.
Jun 28, 2017
cb3367f
Add some comments to the SRL Evaluator.
Jun 28, 2017
a148186
Updates to annotator: Add configuration.
Jun 28, 2017
ac12007
Fix some configuration: Remove PARSE_VIEW option.y
Jun 28, 2017
1043287
Fix a SRL DataModel unit test.
Jun 29, 2017
745dd60
Add a Greedy Decoder for SRL Arguments.
Jul 1, 2017
4e12063
Update SRLEvaluation to skip the "V" class.
Jul 2, 2017
dee019e
Add changes to support PARSE_CHARNIAK
Jul 3, 2017
b85a5b4
Fix incorrect count of data model.
Jul 3, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import sbtrelease.ReleaseStateTransformations._

scalaVersion in ThisBuild := "2.11.7"

val cogcompNLPVersion = "3.0.71"
val cogcompPipelineVersion = "0.1.25"
val cogcompNLPVersion = "3.1.7"
val lbjavaVersion = "1.2.27"
val ccgGroupId = "edu.illinois.cs.cogcomp"
val headerMsg = """/** 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
Expand Down Expand Up @@ -61,12 +61,12 @@ lazy val commonSettings = Seq(
),
javaOptions ++= List("-Xmx11g"),
libraryDependencies ++= Seq(
ccgGroupId % "LBJava" % "1.2.25" withSources,
ccgGroupId % "LBJava" % lbjavaVersion withSources,
ccgGroupId % "illinois-core-utilities" % cogcompNLPVersion withSources,
"com.gurobi" % "gurobi" % "6.0",
"com.gurobi" % "gurobi" % "7.0.1",
"org.apache.commons" % "commons-math3" % "3.0",
"org.scalatest" % "scalatest_2.11" % "2.2.4",
"ch.qos.logback" % "logback-classic" % "1.1.7"
"ch.qos.logback" % "logback-classic" % "1.2.3"
),
fork := true,
connectInput in run := true,
Expand Down Expand Up @@ -95,14 +95,14 @@ lazy val saulExamples = (project in file("saul-examples")).
settings(
name := "saul-examples",
libraryDependencies ++= Seq(
ccgGroupId % "illinois-nlp-pipeline" % cogcompPipelineVersion withSources,
ccgGroupId % "illinois-nlp-pipeline" % cogcompNLPVersion withSources,
ccgGroupId % "illinois-curator" % cogcompNLPVersion,
ccgGroupId % "illinois-edison" % cogcompNLPVersion,
ccgGroupId % "illinois-corpusreaders" % cogcompNLPVersion,
ccgGroupId % "illinois-pos" % cogcompNLPVersion,
ccgGroupId % "saul-pos-tagger-models" % "1.4",
ccgGroupId % "saul-er-models" % "1.8",
ccgGroupId % "saul-srl-models" % "1.3",
ccgGroupId % "saul-srl-models" % "1.4" classifier "verb-gold",
"org.json" % "json" % "20140107",
"com.twitter" % "hbc-core" % "2.2.0",
"org.rogach" %% "scallop" % "2.0.5"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import edu.illinois.cs.cogcomp.core.datastructures.textannotation.{ Constituent,
import edu.illinois.cs.cogcomp.curator.CuratorFactory
import edu.illinois.cs.cogcomp.edison.features.factory.WordFeatureExtractorFactory
import edu.illinois.cs.cogcomp.edison.features.{ FeatureExtractor, FeatureUtilities }
import edu.illinois.cs.cogcomp.nlp.pipeline.IllinoisPipelineFactory
import edu.illinois.cs.cogcomp.pipeline.main.PipelineFactory
import edu.illinois.cs.cogcomp.saul.util.Logging
import edu.illinois.cs.cogcomp.saulexamples.data.Document

Expand Down Expand Up @@ -87,9 +87,8 @@ object CommonSensors extends Logging {
}

def annotateWithPipeline(content: String, id: String): TextAnnotation = {
val annotatorService = IllinoisPipelineFactory.buildPipeline()
val annotatorService = PipelineFactory.buildPipeline()
processDocumentWith(annotatorService, "corpus", id, content)
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import java.io.File
import java.util.Properties

import edu.illinois.cs.cogcomp.core.datastructures.ViewNames
import edu.illinois.cs.cogcomp.nlp.common.PipelineConfigurator._
import edu.illinois.cs.cogcomp.pipeline.common.PipelineConfigurator._
import edu.illinois.cs.cogcomp.saulexamples.nlp.TextAnnotationFactory

import scala.io.Source
Expand All @@ -23,7 +23,9 @@ object QuestionTypeClassificationSensors {

lazy val pipeline = {
val settings = new Properties()
TextAnnotationFactory.disableSettings(settings, USE_SRL_NOM)
TextAnnotationFactory.enableSettings(settings, USE_POS, USE_DEP, USE_LEMMA, USE_SHALLOW_PARSE, USE_NER_CONLL,
USE_NER_ONTONOTES, USE_STANFORD_DEP, USE_STANFORD_PARSE, USE_SRL_VERB, USE_SRL_PREP, USE_SRL_COMMA,
USE_QUANTIFIER)
TextAnnotationFactory.createPipelineAnnotatorService(settings)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/** 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.SemanticRoleLabeling

import edu.illinois.cs.cogcomp.core.datastructures.textannotation.Relation
import edu.illinois.cs.cogcomp.lbjava.classify.{ Score, ScoreSet }

import scala.collection.mutable

// Note: Targeted to in PredicateArgumentViews only.
// Used in SRL Annotation.
object GreedyDecoder {
def decodeNoOverlap(inputRelationWithScores: Seq[(Relation, ScoreSet)], labelsToExclude: Set[String] = Set.empty): Seq[(Relation, Score)] = {
val filterExcludes = inputRelationWithScores.map({
case (relation, scoreset) =>
val highScoreLabel = scoreset.highScoreValue()
(relation, scoreset.getScore(highScoreLabel))
}).filterNot(x => labelsToExclude.contains(x._2.value))

if (filterExcludes.isEmpty) {
return Seq.empty
}

val minSpan = filterExcludes.map(_._1.getTarget.getStartSpan).min
val maxSpan = filterExcludes.map(_._1.getTarget.getEndSpan).max

val range = maxSpan - minSpan + 1
val spanPosition = new mutable.BitSet(range)

// Check if the sorting is stable
filterExcludes.sortBy(x => -x._2.score) // Sort from largest to lowest scores
.flatMap({
case (relation, score) =>
val startSpan = relation.getTarget.getStartSpan
val endSpan = relation.getTarget.getEndSpan - 1
val hasOverlap = (startSpan to endSpan).exists(sp => spanPosition.contains(sp - minSpan))

if (!hasOverlap) {
spanPosition ++= Range(startSpan - minSpan, endSpan - minSpan + 1)
Some((relation, score))
} else {
None
}
})
}
}
Loading