ModelSelector is broken.
sammerry opened this issue · comments
This probably has a simple answer, but Loading the english training data through maven and calling it with NerSelector.loadNer
breaks. However, calling it directly with epic.parser.models.en.span.EnglishSpanParser.load()
works.
POM dependency
<dependency>
<groupId>org.scalanlp</groupId>
<artifactId>epic-parser-en-span_2.10</artifactId>
<version>0.1</version>
</dependency>
Load the NerSelector
val tagger = epic.models.NerSelector.loadNer("en").get
epic.models.NerSelector.loadNer("en")
returns none and explodes all over the .get
On line 24 in the ModelSelector: The serviceLoader.asScala
returns 0 which causes the filter to return none.
Scala code runner version 2.11.1
java version "1.8.0_11"
You're including the wrong dependency for NER. That dependency is for the
parser.
You want
- Named Entity Recognizers
- English: "org.scalanlp" % "epic-ner-en-conll_2.10" % "0.1"
On Sun, Aug 10, 2014 at 7:47 PM, Sam Merry notifications@github.com wrote:
Scala code runner version 2.11.1
java version "1.8.0_11"—
Reply to this email directly or view it on GitHub
#10 (comment).
Thanks! Can you help me with one more thing. I've updated my pom and serviceLoader.asScala
finds the ner
package, but i get a Illegal configuration-file syntax
stack trace.
<dependency>
<groupId>org.scalanlp</groupId>
<artifactId>epic-ner-en-conll_2.10</artifactId>
<version>0.1</version>
</dependency>
Exception in thread "main" java.util.ServiceConfigurationError: epic.models.NerModelLoader: jar:file:/Users/sammerry/.m2/repository/org/scalanlp/epic-ner-en-conll_2.10/0.1/epic-ner-en-conll_2.10-0.1.jar!/META-INF/services/epic.models.NerModelLoader:1: Illegal configuration-file syntax
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.fail(ServiceLoader.java:245)
at java.util.ServiceLoader.parseLine(ServiceLoader.java:265)
at java.util.ServiceLoader.parse(ServiceLoader.java:307)
at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
at scala.collection.convert.Wrappers$JIteratorWrapper.hasNext(Wrappers.scala:41)
at scala.collection.Iterator$class.find(Iterator.scala:778)
at scala.collection.AbstractIterator.find(Iterator.scala:1157)
at scala.collection.IterableLike$class.find(IterableLike.scala:79)
at scala.collection.AbstractIterable.find(Iterable.scala:54)
at epic.models.ModelSelector$class.findModel(ModelSelector.scala:24)
at epic.models.NerSelector$.findModel(NerModelLoader.scala:9)
at epic.models.ModelSelector$class.findModel(ModelSelector.scala:20)
at epic.models.NerSelector$.loadNer(NerModelLoader.scala:12)
at Main$delayedInit$body.apply(Main.scala:19)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at Main$.main(Main.scala:8)
at Main.main(Main.scala)
ugh, looks like I didn't test the 0.1 release like I should have.
Could you try using Epic 0.2 SNAPSHOT and the new NER release that goes
with it. Follow the demo project here: https://github.com/dlwh/epic-demo
(the build.sbt file has the dependencies)
Things are a bit in flux right now. I'm trying to release 0.2 this week,
but I'm juggling a lot of things.
-- David
On Mon, Aug 11, 2014 at 4:00 PM, Sam Merry notifications@github.com wrote:
Thanks! Can you help me with one more thing. I've updated my pom and
serviceLoader.asScala finds the ner package, but i get the following
stack trace.<dependency> <groupId>org.scalanlp</groupId> <artifactId>epic-ner-en-conll_2.10</artifactId> <version>0.1</version> </dependency>
Exception in thread "main" java.util.ServiceConfigurationError: epic.models.NerModelLoader: jar:file:/Users/sammerry/.m2/repository/org/scalanlp/epic-ner-en-conll_2.10/0.1/epic-ner-en-conll_2.10-0.1.jar!/META-INF/services/epic.models.NerModelLoader:1: Illegal configuration-file syntax
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.fail(ServiceLoader.java:245)
at java.util.ServiceLoader.parseLine(ServiceLoader.java:265)
at java.util.ServiceLoader.parse(ServiceLoader.java:307)
at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
at scala.collection.convert.Wrappers$JIteratorWrapper.hasNext(Wrappers.scala:41)
at scala.collection.Iterator$class.find(Iterator.scala:778)
at scala.collection.AbstractIterator.find(Iterator.scala:1157)
at scala.collection.IterableLike$class.find(IterableLike.scala:79)
at scala.collection.AbstractIterable.find(Iterable.scala:54)
at epic.models.ModelSelector$class.findModel(ModelSelector.scala:24)
at epic.models.NerSelector$.findModel(NerModelLoader.scala:9)
at epic.models.ModelSelector$class.findModel(ModelSelector.scala:20)
at epic.models.NerSelector$.loadNer(NerModelLoader.scala:12)
at Main$delayedInit$body.apply(Main.scala:19)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at Main$.main(Main.scala:8)
at Main.main(Main.scala)—
Reply to this email directly or view it on GitHub
#10 (comment).
This demo worked perfectly!! Thanks!
Hey there David,
I am hitting the same issue, but am stuck on scala 2.10.4. It seems that the new snapshots for the parser and ner are only built with 2.11.1. Is there an update for the next release? Or could you post a snapshot for 2.10?
Thanks!
marc
@splittingfield You can build your own. sbt publish-local
and add
resolvers ++= Seq(
"Local Maven Repository" at Path.userHome.asFile.toURI.toURL + ".m2/repository"
)
to the build.sbt
in your project.
Thanks! Already did that for dev use, just wanted to grab a timeline before having to go play the update internal artifactory with dependency dance.
Hey sorry,
I'll publish models for 2.10.4 soon. The serialized model files are different with each version of Scala, so I have to build separate models for every version of Scala.