dlwh / epic

**Archived** Epic is a high performance statistical parser written in Scala, along with a framework for building complex structured prediction models.

Home Page:http://scalanlp.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with English Parser in Scala 2.10

dice89 opened this issue · comments

Hi Epic Team,

I love using your library but get an error when using the english parser in scala 2.10:

Exception in thread "main" java.io.InvalidClassException: breeze.linalg.Counter2$$anon$1; local class incompatible: stream classdesc serialVersionUID = -8653601685403516672, local class serialVersionUID = 6118148492784004600
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:621)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1623)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1518)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1707)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1345)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1993)
    at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1918)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1801)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
    at epic.models.ClassPathModelLoader.load(ModelLoader.scala:23)
    at epic.models.DelegatingLoader.load(ModelLoader.scala:33)
    at epic.models.PosTagSelector$.loadTagger(PosTagModelLoader.scala:13)
    at de.unima.dws.oamatching.measures.StringMeasureHelper$.addPosTag(StringMeasureHelper.scala:116)
    at de.unima.dws.oamatching.measures.StringMeasureHelper$delayedInit$body.apply(StringMeasureHelper.scala:18)
    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 de.unima.dws.oamatching.measures.StringMeasureHelper$.main(StringMeasureHelper.scala:15)
    at de.unima.dws.oamatching.measures.StringMeasureHelper.main(StringMeasureHelper.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:483)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)

Could you paste your build.sbt file, at least the epic parts?
On Feb 2, 2015 1:32 PM, "reactormonk" notifications@github.com wrote:

That looks like you're using incompatible versions of the model and the
epic library. @dlwh https://github.com/dlwh could you mark the
dependencies of the model jars to be more clear?


Reply to this email directly or view it on GitHub
#26 (comment).

name := "ontologymatcher"

version := "1.0"

scalaVersion := "2.10.4"

libraryDependencies += "org.apache.spark" %% "spark-core" % "1.2.0"

libraryDependencies += "org.apache.spark" %% "spark-mllib" % "1.2.0"

libraryDependencies += "net.sourceforge.owlapi" % "owlapi-distribution" % "4.0.1"

libraryDependencies += "org.apache.jena" % "jena-core" % "2.12.1"

libraryDependencies += "edu.cmu.lti" % "ws4j" % "1.0.1"

libraryDependencies += "com.github.tototoshi" %% "scala-csv" % "1.1.1"

libraryDependencies += "net.debasishg" %% "redisclient" % "2.13"

libraryDependencies += "org.slf4j" % "slf4j-log4j12" % "1.7.8"

libraryDependencies += "secondstring" % "secondstring" % "20120620"

libraryDependencies += "net.sf.jwordnet" % "jwnl" % "1.4_rc3"

libraryDependencies += "fr.inrialpes.exmo" % "ontosim" % "2.4"

libraryDependencies += "org.apache.lucene" % "lucene-analyzers-common" % "4.10.3"

libraryDependencies += "org.slf4j" % "slf4j-log4j12" % "1.7.8"

libraryDependencies += "de.unima.alex" % "owlsimflood" % "1.0"

libraryDependencies +=  "org.scalaj" %% "scalaj-http" % "1.1.1"

libraryDependencies += "org.scalanlp" % "epic_2.10" % "0.3"

libraryDependencies += "org.scalanlp" % "english_2.10" % "2015.1.25"

resolvers += "Local Maven Repository" at "file:///Users/mueller/.m2/repository/"

resolvers += "Third Party" at "http://trianacode.org/maven/"

I must have messed up the objects. I'll see if I can fix tonight, otherwise
it'll be a couple of weeks.
On Feb 2, 2015 1:57 PM, "Alexander Mueller" notifications@github.com
wrote:

name := "ontologymatcher"

version := "1.0"

scalaVersion := "2.10.4"

libraryDependencies += "org.apache.spark" %% "spark-core" % "1.2.0"

libraryDependencies += "org.apache.spark" %% "spark-mllib" % "1.2.0"

libraryDependencies += "net.sourceforge.owlapi" % "owlapi-distribution" %
"4.0.1"

libraryDependencies += "org.apache.jena" % "jena-core" % "2.12.1"

libraryDependencies += "edu.cmu.lti" % "ws4j" % "1.0.1"

libraryDependencies += "com.github.tototoshi" %% "scala-csv" % "1.1.1"

libraryDependencies += "net.debasishg" %% "redisclient" % "2.13"

libraryDependencies += "org.slf4j" % "slf4j-log4j12" % "1.7.8"

libraryDependencies += "secondstring" % "secondstring" % "20120620"

libraryDependencies += "net.sf.jwordnet" % "jwnl" % "1.4_rc3"

libraryDependencies += "fr.inrialpes.exmo" % "ontosim" % "2.4"

libraryDependencies += "org.apache.lucene" % "lucene-analyzers-common" %
"4.10.3"

libraryDependencies += "org.slf4j" % "slf4j-log4j12" % "1.7.8"

libraryDependencies += "de.unima.alex" % "owlsimflood" % "1.0"

libraryDependencies += "org.scalaj" %% "scalaj-http" % "1.1.1"

libraryDependencies += "org.scalanlp" % "epic_2.10" % "0.3"

libraryDependencies += "org.scalanlp" % "english_2.10" % "2015.1.25"

resolvers += "Local Maven Repository" at
"file:///Users/mueller/.m2/repository/"

resolvers += "Third Party" at "http://trianacode.org/maven/"


Reply to this email directly or view it on GitHub
#26 (comment).

i just double checked. i packaged up the parser right; it's on your end. I can't resolve two of your artifacts:

unresolved dependency: fr.inrialpes.exmo#ontosim;2.4: not found
unresolved dependency: de.unima.alex#owlsimflood;1.0: not found

do maybe one of them depend on an old version of epic?

Hi,

sorry for the ontosim problem, this is local library of mine, but which is definetly not depending on epic. I just tested the english parsing with a new fresh project and a minimum example. I still get the same problem.

I pushed it to github and you can check it out on your own:

https://github.com/dice89/EpicTest

Best wishes

Alex

@dlwh It's only the scala 2.10 versions that are incorrect, the 2.11 versions work.

Throwing my hat into the fray here...I have this exact same problem.

Ok, should be fixed. epic release 0.3.1, model versions 2015.2.19 (will take an hour or so to make it into maven central.)

Also included is a much improved sentence boundary detector.