dalab / pboh-entity-linking

Source code for the paper "Probabilistic Bag-Of-Hyperlinks Model for Entity Linking" , http://dl.acm.org/citation.cfm?id=2882988
58 stars 15 forks source link

Error when processing csv #5

Open gvishal opened 7 years ago

gvishal commented 7 years ago

I modified the code to read from a csv file. Every line has around 3k n-grams from a single article. But, it fails with the following error. Any ideas how to fix it?

java.lang.AssertionError: assertion failed at scala.Predef$.assert(Predef.scala:156) at index.MentEntsFreqIndexWrapper.computeCandidatesForOneName(MentEntsFreqIndexWrapper.scala:57) at index.MentEntsFreqIndexWrapper.containsMention(MentEntsFreqIndexWrapper.scala:67) at console_el.ConsoleEntityLinking$$anonfun$extractInputVectors$3.apply(ConsoleEntityLinking.scala:72) at console_el.ConsoleEntityLinking$$anonfun$extractInputVectors$3.apply(ConsoleEntityLinking.scala:71) at scala.collection.immutable.Range.foreach(Range.scala:160) at console_el.ConsoleEntityLinking.extractInputVectors(ConsoleEntityLinking.scala:71) at console_el.ConsoleEntityLinking.EntityLinkingAPI(ConsoleEntityLinking.scala:127) at console_el.ConsoleEntityLinking.batchProcessCsvNgrams(ConsoleEntityLinking.scala:200) at el.EL_LBP_Spark$.main(EL_LBP_Spark.scala:111) at el.EL_LBP_Spark.main(EL_LBP_Spark.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at scala.reflect.internal.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:70) at scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31) at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:101) at scala.reflect.internal.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:70) at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101) at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:22) at scala.tools.nsc.JarRunner$.run(MainGenericRunner.scala:13) at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:29) at scala.tools.nsc.JarRunner$.runJar(MainGenericRunner.scala:25) at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:69) at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87) at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98) at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103) at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

gvishal commented 7 years ago

I removed the assertion that was failing to get it working for now.

octavian-ganea commented 7 years ago

That assertion makes sure that the head of the sorted list of entity candidates is also the entity with the highest rho score. What I suspect is that you have more than one entity with the same highest score, in which case it will fail. If that's the case, then you can remove the assertion. Otherwise, you might want to print the list of candidates to understand what's going on.

gvishal commented 7 years ago

Yep! I removed it for the time being.