Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Commit

Permalink
update the demo to the most recent epic release
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwh committed Oct 27, 2014
1 parent fe434cd commit 9443c13
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
23 changes: 4 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version := "0.1-SNAPSHOT"

organization := "org.scalanlp"

scalaVersion := "2.11.1"
scalaVersion := "2.11.2"

resolvers ++= Seq(
"ScalaNLP Maven2" at "http://repo.scalanlp.org/repo",
Expand All @@ -15,28 +15,13 @@ resolvers ++= Seq(
)

libraryDependencies ++= Seq(
"org.scalanlp" %% "breeze" % "0.8.1",
"org.scalanlp" %% "epic" % "0.2-SNAPSHOT",
"org.scalanlp" %% "epic-parser-en-span" % "2014.7.29-SNAPSHOT",
"org.scalanlp" %% "epic-ner-en-conll" % "2014.7.29-SNAPSHOT",
//"org.scalanlp" %% "epic-pos-en" % "2014.6.3-SNAPSHOT",
"org.scalanlp" %% "epic" % "0.2",
"org.scalanlp" %% "epic-parser-en-span" % "2014.9.15",
"org.scalanlp" %% "epic-ner-en-conll" % "2014.10.26",
"junit" % "junit" % "4.5" % "test"
)


libraryDependencies <<= (scalaVersion, libraryDependencies) { (sv, deps) =>
sv match {
case "2.9.2" =>
(deps :+ ("org.scalatest" % "scalatest" % "1.4.RC2" % "test"))
case x if x.startsWith("2.8") =>
(deps :+ ("org.scalatest" % "scalatest" % "1.3" % "test")
:+ ("org.scala-tools.testing" % "scalacheck_2.8.1" % "1.8" % "test"))
case _ =>
(deps :+ ("org.scalacheck" %% "scalacheck" % "1.10.0" % "test")
:+ ("org.scalatest" %% "scalatest" % "2.0.M5b" % "test"))
}
}

credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")


Expand Down
12 changes: 7 additions & 5 deletions src/main/scala/epic/demo/EpicSeqDemo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ import java.io.File
import java.net.URL

import epic.models.{NerSelector, ParserSelector}
import epic.parser.ParserAnnotator
import epic.preprocess
import epic.preprocess.{TreebankTokenizer, MLSentenceSegmenter}
import epic.sequences.{SemiCRF, Segmenter}
import epic.slab.{EntityMention, Token, Sentence}
import epic.trees.{AnnotatedLabel, Tree}
import epic.util.SafeLogging

/**
Expand All @@ -30,6 +25,13 @@ object EpicSeqDemo extends SafeLogging {

val preprocessed = preprocess.preprocess(preprocess.TextExtractor.extractText(url))

for(sent <- preprocessed) {
println(sent)
println(sent.length)
println("===")
println(parser(sent) render sent)
println("======")
}
logger.info(s"==== parses for $arg ====")
val parsed = preprocessed.par.map(parser).seq
for((tree, sentence) <- parsed zip preprocessed) {
Expand Down

0 comments on commit 9443c13

Please sign in to comment.