knowitall / srlie

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

requirement failed exception #4

Closed schmmd closed 11 years ago

schmmd commented 11 years ago

I should split this into two separate issues. Here are more detailed for one of the issues.

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

java.lang.IllegalArgumentException: requirement failed: Invalid relation name: :p
    at scala.Predef$.require(Predef.scala:233)
    at edu.knowitall.tool.srl.Relation.<init>(Frame.scala:28)
    at edu.knowitall.tool.srl.Relation$.fromString(Frame.scala:35)
    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

This problem happens because :P is identified as a verb used in a semantic frame. : is a reserved character. Ideally I would have escaping so this wouldn't cause a problem, but I'm unlikely to do this now. I could move reserved characters {[, ], :} to a close approximate (, ), -. This is probably better than an exception. What do you think?

rbart commented 11 years ago

Yeah, for now I think that would be better as long as it doesn't change the length of the string.

schmmd commented 11 years ago

Seeing as you won't upgrade srlie, it's not going to help you out at all on your present project.

On Thu, Jun 27, 2013 at 9:51 AM, Rob notifications@github.com wrote:

Yeah, for now I think that would be better as long as it doesn't change the length of the string.

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

schmmd commented 11 years ago

Fixed by https://github.com/knowitall/nlptools/pull/10. Here is the new output:

frames:
live_1.01:[A0=I_0, AM-LOC=near_3]
be_8.01:[A1=healthy_7, A2=far_9]
describe_14.01:[R-AM-MNR=how_11, A0=I_12, AM-MOD=would_13, A1=them_15]
consider_24.01:[A0=some_20, AM-MOD=should_23, A1=laying_25]
lay_25.02:[A0=some_20, C-V=off_26, A2=on_27]
-p_36.01:[AM-TMP=again_32, AM-MOD=should_34, A0=I_35, A1=configuration_38]

hierarchical frames:
-p.01:[AM-TMP=again, AM-MOD=should, A0=I, A1=configuration]
be.01:[A1=healthy, A2=far]
describe.01:[R-AM-MNR=how, A0=I, AM-MOD=would, A1=them]
consider.01:[A0=some, AM-MOD=should, A1=laying] < live.01:[A0=I, AM-LOC=near], lay.02:[A0=some, C-V=off, A2=on]

extractions:
0.46: (healthy; is; far from how I would describe them)
0.31: (I; would describe; them)
0.60: (some of them; should consider; laying off on the donuts)
0.43: some of them should consider:(I; live healthy; L:near Fort Gordon)
0.60: some of them should consider:(some of them; should consider laying off; on the donuts)

triples:
(healthy; is; far from how I would describe them)
(I; would describe; them)
(some of them; should consider; laying off on the donuts)
some of them should consider:(I; live healthy near; L:Fort Gordon)
some of them should consider:(some of them; should consider laying off on; the donuts)