knowitall / srlie

The SRL-based Open IE extractor. A principal component of Open IE 4.0.
Other
19 stars 9 forks source link

MatchError in SrlExtractor #3

Closed rbart closed 11 years ago

rbart commented 11 years ago

Can be reproduced in nlpweb - example sentence:

Wikipedia is saying.28 au for Cc (the planet is question), several different online Kepler's 3rd calculators are giving me different numbers as well.

Stack trace:

scala.MatchError: [Ljava.lang.String;@13db7229 (of class [Ljava.lang.String;)
    at edu.knowitall.tool.srl.Relation$.fromString(Frame.scala:34)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5$$anonfun$apply$4.apply(ClearSrl.scala:68)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5$$anonfun$apply$4.apply(ClearSrl.scala:68)
    at scala.Option.map(Option.scala:145)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5.apply(ClearSrl.scala:68)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5.apply(ClearSrl.scala:66)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.Iterator$class.foreach(Iterator.scala:727)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
    at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
    at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
    at edu.knowitall.tool.srl.ClearSrl.apply(ClearSrl.scala:66)
    at edu.knowitall.srlie.SrlExtractor.apply(SrlExtractor.scala:21)
    at edu.knowitall.tac2013.openie.KbpSrlExtractor.extract(KbpExtractor.scala:145)
    at edu.knowitall.tac2013.openie.KbpCombinedExtractor.extract(KbpExtractor.scala:108)
    at edu.knowitall.tac2013.openie.KbpExtractor$$anonfun$8$$anonfun$9.apply(KbpExtractor.scala:87)
    at edu.knowitall.tac2013.openie.KbpExtractor$$anonfun$8$$anonfun$9.apply(KbpExtractor.scala:86)
    at scala.collection.parallel.AugmentedIterableIterator$class.flatmap2combiner(RemainsIterator.scala:136)
    at scala.collection.parallel.immutable.ParVector$ParVectorIterator.flatmap2combiner(ParVector.scala:67)
    at scala.collection.parallel.ParIterableLike$FlatMap.leaf(ParIterableLike.scala:1075)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply$mcV$sp(Tasks.scala:54)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:53)
    at scala.collection.parallel.Task$$anonfun$tryLeaf$1.apply(Tasks.scala:53)
    at scala.collection.parallel.Task$class.tryLeaf(Tasks.scala:56)
    at scala.collection.parallel.ParIterableLike$FlatMap.tryLeaf(ParIterableLike.scala:1071)
    at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask$class.internal(Tasks.scala:172)
    at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.internal(Tasks.scala:514)
    at scala.collection.parallel.AdaptiveWorkStealingTasks$WrappedTask$class.compute(Tasks.scala:162)
    at scala.collection.parallel.AdaptiveWorkStealingForkJoinTasks$WrappedTask.compute(Tasks.scala:514)
    at scala.concurrent.forkjoin.RecursiveAction.exec(RecursiveAction.java:160)
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262)
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975)
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478)
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
schmmd commented 11 years ago

This is a frame deserialization issue from the ClearNlp representation. Thanks for the example, I've needed to dig into this. I made a change in nlptools to improve the error message at least. I was using val Array(foo, bar) = something.split. When it fails, the error is quite uninformative.

schmmd commented 11 years ago

My guess is that there is a relation type that clear sometimes gives that's malformed or undocumented.

rbart commented 11 years ago

Not too big of a deal, since it only happened on 12 sentences out of 44367 in the test I ran.

There is also a very similar "requirement failed" exception error, example sentence:

I live (near Fort Gordon) healthy is far from how I would describe them, in other words some of them should consider laying off on the donuts but then again so should I :p lol

Here's the top of the stack trace, the rest is the same, I think

java.lang.IllegalArgumentException: requirement failed
    at scala.Predef$.require(Predef.scala:221)
    at edu.knowitall.tool.srl.Relation.<init>(Frame.scala:28)
    at edu.knowitall.tool.srl.Relation$.fromString(Frame.scala:35)
schmmd commented 11 years ago

Thanks for those numbers--they are helpful.

The requirement one I'm guessing is ClearNlp giving me something very weird. Here's line 28:

require(!(name matches """.*[:\[\]].*"""))

I'll improve the error message now (should always do this first time around ;-P)

On Wed, Jun 26, 2013 at 3:25 PM, Rob notifications@github.com wrote:

Not too big of a deal, since it only happened on 12 sentences out of 44367 in the test I ran.

There is also a very similar "requirement failed" exception error, example sentence:

I live (near Fort Gordon) healthy is far from how I would describe them, in other words some of them should consider laying off on the donuts but then again so should I :p lol

Here's the top of the stack trace, the rest is the same, I think java.lang.IllegalArgumentException: requirement failed at scala.Predef$.require(Predef.scala:221) at edu.knowitall.tool.srl.Relation.(Frame.scala:28) at edu.knowitall.tool.srl.Relation$.fromString(Frame.scala:35)

— Reply to this email directly or view it on GitHubhttps://github.com/knowitall/srlie/issues/3#issuecomment-20084701 .

schmmd commented 11 years ago

Split issue into two: https://github.com/knowitall/srlie/issues/4

schmmd commented 11 years ago

I think that saying.28 is being interpreted as a relation because it has the same format as an SRL relation.

schmmd commented 11 years ago

Wikipedia is saying.28 au for Cc (the planet is question), several different online Kepler's 3rd calculators are giving me different numbers as well.

scala.MatchError: Could not create relation with node saying.28_VBN_2 from string: saying.0.01 (of class java.lang.String)
    at edu.knowitall.tool.srl.Relation$.fromString(Frame.scala:36)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5$$anonfun$apply$4.apply(ClearSrl.scala:68)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5$$anonfun$apply$4.apply(ClearSrl.scala:68)
    at scala.Option.map(Option.scala:145)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5.apply(ClearSrl.scala:68)
    at edu.knowitall.tool.srl.ClearSrl$$anonfun$5.apply(ClearSrl.scala:66)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.TraversableLike$$anonfun$flatMap$1.apply(TraversableLike.scala:251)
    at scala.collection.Iterator$class.foreach(Iterator.scala:727)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
    at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
    at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
    at scala.collection.TraversableLike$class.flatMap(TraversableLike.scala:251)
    at scala.collection.AbstractTraversable.flatMap(Traversable.scala:105)
    at edu.knowitall.tool.srl.ClearSrl.apply(ClearSrl.scala:66)
    at edu.knowitall.srlie.SrlExtractor.apply(SrlExtractor.scala:22)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1$$anonfun$apply$9$$anonfun$apply$1$$anonfun$apply$mcV$sp$1.apply(SrlExtractor.scala:134)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1$$anonfun$apply$9$$anonfun$apply$1$$anonfun$apply$mcV$sp$1.apply(SrlExtractor.scala:131)
    at scala.collection.Iterator$class.foreach(Iterator.scala:727)
    at scala.collection.AbstractIterator.foreach(Iterator.scala:1157)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1$$anonfun$apply$9$$anonfun$apply$1.apply$mcV$sp(SrlExtractor.scala:131)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1$$anonfun$apply$9$$anonfun$apply$1.apply(SrlExtractor.scala:131)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1$$anonfun$apply$9$$anonfun$apply$1.apply(SrlExtractor.scala:131)
    at edu.knowitall.common.Timing$.time(Timing.scala:50)
    at edu.knowitall.common.Timing$.timeThen(Timing.scala:72)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1$$anonfun$apply$9.apply(SrlExtractor.scala:188)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1$$anonfun$apply$9.apply(SrlExtractor.scala:129)
    at edu.knowitall.common.Resource$.using(Resource.scala:14)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1.apply(SrlExtractor.scala:129)
    at edu.knowitall.srlie.SrlExtractor$$anonfun$run$1.apply(SrlExtractor.scala:128)
    at edu.knowitall.common.Resource$.using(Resource.scala:14)
    at edu.knowitall.srlie.SrlExtractor$.run(SrlExtractor.scala:128)
    at edu.knowitall.srlie.SrlExtractor$delayedInit$body.apply(SrlExtractor.scala:111)
    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 edu.knowitall.srlie.SrlExtractor$.main(SrlExtractor.scala:35)
    at edu.knowitall.srlie.SrlExtractor.main(SrlExtractor.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at sbt.Run.invokeMain(Run.scala:68)
    at sbt.Run.run0(Run.scala:61)
    at sbt.Run.execute$1(Run.scala:50)
    at sbt.Run$$anonfun$run$1.apply$mcV$sp(Run.scala:54)
    at sbt.TrapExit$.executeMain$1(TrapExit.scala:33)
    at sbt.TrapExit$$anon$1.run(TrapExit.scala:42)
schmmd commented 11 years ago

Fixed by https://github.com/knowitall/nlptools/pull/9.