idio / spotlight-model-editor

Tool for tweaking dbpedia spotlight's models
Apache License 2.0
16 stars 8 forks source link

Error with latest en model #16

Closed grivescorbett closed 8 years ago

grivescorbett commented 8 years ago

After running sh target/bin/model-editor explore /home/ubuntu/spotlight/en/model/ 20 against this model file: http://spotlight.sztaki.hu/downloads/latest_models/en.tar.gz

I'm getting this error:

ubuntu@ip-172-31-18-202:~/spotlight-model-editor$ sh target/bin/model-editor explore /home/ubuntu/spotlight/en/model/ 20
INFO 2016-04-13 16:14:52,837 main [MemoryStore$] - Loading MemoryQuantizedCountStore...
 INFO 2016-04-13 16:14:52,912 main [MemoryStore$] - Done (75 ms)
 INFO 2016-04-13 16:14:52,912 main [MemoryStore$] - Loading MemorySurfaceFormStore...
 INFO 2016-04-13 16:14:55,656 main [MemorySurfaceFormStore] - Summing total SF counts.
 INFO 2016-04-13 16:14:56,131 main [MemorySurfaceFormStore] - Creating reverse-lookup for surface forms, adding normalized surface forms.
 INFO 2016-04-13 16:14:57,039 main [MemoryStore$] - Done (4127 ms)
-1
 INFO 2016-04-13 16:15:05,788 main [MemoryStore$] - Loading MemoryResourceStore...
Error during Java deserialization.
Serialization trace:
ontologyTypeStore (org.dbpedia.spotlight.db.memory.MemoryResourceStore)
Exception in thread "main" java.lang.NullPointerException
    at org.idio.dbpedia.spotlight.CustomSpotlightModel$$anonfun$showSomeSurfaceForms$1.apply(CustomSpotlightModel.scala:440)
    at org.idio.dbpedia.spotlight.CustomSpotlightModel$$anonfun$showSomeSurfaceForms$1.apply(CustomSpotlightModel.scala:438)
    at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:70)
    at org.idio.dbpedia.spotlight.CustomSpotlightModel.showSomeSurfaceForms(CustomSpotlightModel.scala:438)
    at org.idio.dbpedia.spotlight.Main$.runCommand(SpotlightModelReader.scala:180)
    at org.idio.dbpedia.spotlight.Main$.main(SpotlightModelReader.scala:40)
    at org.idio.dbpedia.spotlight.Main.main(SpotlightModelReader.scala)
dav009 commented 8 years ago

For models using spotlight 7 you should use this branch: https://github.com/idio/spotlight-model-editor/tree/feature/code-clean-up-0-7

dav009 commented 8 years ago

@grivescorbett did using that branch solved the problem?

grivescorbett commented 8 years ago

My apologies for the delay, I'm still getting this error in a couple of different environments. In OS X / Intellij these are the steps I took:

- extract http://spotlight.sztaki.hu/downloads/latest_models/en.tar.gz to /Users/grivescorbett/projects/untapt/spotlight/en
- git clone https://github.com/idio/spotlight-model-editor.git
- cd spotlight-model-editor
- git checkout feature/code-clean-up-0-7
- Open IntelliJ, import POM project, select JDK 1.7
- Run scala console
- var spotlightModel = org.idio.dbpedia.spotlight.Main.getSpotlightModel("/Users/grivescorbett/projects/untapt/spotlight/en/model")
scala> spotlightModel.showSomeSurfaceForms(10)
 INFO 2016-05-04 11:15:12,048 Thread-14 [MemoryStore$] - Loading MemoryQuantizedCountStore...
 INFO 2016-05-04 11:15:12,123 Thread-14 [MemoryStore$] - Done (74 ms)
 INFO 2016-05-04 11:15:12,123 Thread-14 [MemoryStore$] - Loading MemorySurfaceFormStore...
 INFO 2016-05-04 11:15:20,177 Thread-14 [MemorySurfaceFormStore] - Summing total SF counts.
 INFO 2016-05-04 11:15:21,100 Thread-14 [MemorySurfaceFormStore] - Creating reverse-lookup for surface forms, adding normalized surface forms.
 INFO 2016-05-04 11:15:25,391 Thread-14 [MemoryStore$] - Done (13268 ms)
 INFO 2016-05-04 11:15:39,343 Thread-14 [MemoryStore$] - Loading MemoryResourceStore...
-1
Error during Java deserialization.
Serialization trace:
ontologyTypeStore (org.dbpedia.spotlight.db.memory.MemoryResourceStore)
java.lang.NullPointerException
    at org.idio.dbpedia.spotlight.CustomSpotlightModel$$anonfun$showSomeSurfaceForms$1.apply(CustomSpotlightModel.scala:440)
    at org.idio.dbpedia.spotlight.CustomSpotlightModel$$anonfun$showSomeSurfaceForms$1.apply(CustomSpotlightModel.scala:438)
    at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:70)
    at org.idio.dbpedia.spotlight.CustomSpotlightModel.showSomeSurfaceForms(CustomSpotlightModel.scala:438)
    at .<init>(<console>:12)
    at .<clinit>(<console>)
    at .<init>(<console>:11)
    at .<clinit>(<console>)
    at $print(<console>)
    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 scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:704)
    at scala.tools.nsc.interpreter.IMain$Request$$anonfun$14.apply(IMain.scala:920)
    at scala.tools.nsc.interpreter.Line$$anonfun$1.apply$mcV$sp(Line.scala:43)
    at scala.tools.nsc.io.package$$anon$2.run(package.scala:25)
    at java.lang.Thread.run(Thread.java:745)

Ubuntu with JDK 7, branch feature/code-clean-up-0-7 gives the same results.

dav009 commented 8 years ago

mm sounds like something could have changed in spotlight's code base. I'm going to try to reproduce it

dav009 commented 8 years ago

Yeah a new jar was used to serialize the stores.

I updated the jar that : https://github.com/idio/spotlight-model-editor/tree/feature/code-clean-up-0-7 depends on. That made it work for me.

could you please delete the folder : ~/.m2/repository/org/dbpedia/spotlight/0.7 and give it another go. That should make it work

grivescorbett commented 8 years ago

Looks great, thanks!