dlwh / epic

**Archived** Epic is a high performance statistical parser written in Scala, along with a framework for building complex structured prediction models.
http://scalanlp.org/
Apache License 2.0
469 stars 82 forks source link

French models can't be used with last Epic version #36

Closed pommedeterresautee closed 9 years ago

pommedeterresautee commented 9 years ago

When I call the French model of the dependency parser I get:

Loading parser from serialized file edu/stanford/nlp/models/lexparser/frenchFactored.ser.gz ...  done [2,8 sec].
Exception in thread "main" java.io.InvalidClassException: epic.parser.models.ParserTrainer$$anonfun$2; local class incompatible: stream classdesc serialVersionUID = 0, local class serialVersionUID = 5531977503861241212
    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.readObject(ObjectInputStream.java:371)
    at epic.models.ClassPathModelLoader.load(ModelLoader.scala:23)
    at epic.models.DelegatingLoader.load(ModelLoader.scala:33)
    at epic.models.ParserSelector$.loadParser(ParserSelector.scala:15)
    at prepare.data.Parser$.delayedEndpoint$prepare$data$Parser$1(Parser.scala:19)
    at prepare.data.Parser$delayedInit$body.apply(Parser.scala:6)

Seems to be very related to #26

Is there a way to download new models?

Kind regards, Michaël

pommedeterresautee commented 9 years ago

Got the model from http://www.scalanlp.org/models/

pommedeterresautee commented 9 years ago

Also tried :

Always same error.

reactormonk commented 9 years ago

Try a newer version via https://search.maven.org/#search%7Cga%7C1%7Corg.scalanlp%20epic-parser

pommedeterresautee commented 9 years ago

Thanks. I have not seen it. Just tried... it works :-)

However I see these errors when I ask for evicted in sbt:

[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]  * org.scalanlp:epic_2.11:0.2 -> 0.3.1 (caller: j-data:j-data_2.11:1.1, org.scalanlp:epic-parser-fr-span_2.11:2014.11.09)
[warn]  * xml-apis:xml-apis:(1.3.03, 2.0.2) -> 1.4.01 (caller: xerces:xercesImpl:2.10.0, xerces:xercesImpl:2.8.0, com.io7m.xom:xom:1.2.10, xerces:xercesImpl:2.8.1, xalan:xalan:2.7.0)
[warn]  * org.scalanlp:breeze_2.11:(0.8, 0.9) -> 0.11-M0 (caller: org.scalanlp:epic_2.11:0.3.1, org.scalanlp:nak_2.11:1.3, org.scalanlp:breeze-natives_2.11:0.8)
[info] Here are other libraries that were evicted:
[info]  * xerces:xercesImpl:(2.8.1, 2.8.0) -> 2.10.0 (caller: com.drewnoakes:metadata-extractor:2.6.2, com.io7m.xom:xom:1.2.10, net.sourceforge.nekohtml:nekohtml:1.9.21)
[info]  * org.apache.tika:tika-core:1.0 -> 1.5 (caller: org.apache.tika:tika-parsers:1.5, org.gagravarr:vorbis-java-tika:0.1)
[info]  * org.slf4j:slf4j-api:(1.7.5, 1.7.6) -> 1.7.7 (caller: com.typesafe.scala-logging:scala-logging-slf4j_2.11:2.1.2, org.slf4j:slf4j-simple:1.7.6, org.scalanlp:breeze_2.11:0.11-M0)
[info]  * com.github.fommil.netlib:core:1.1 -> 1.1.2 (caller: com.github.fommil.netlib:native_ref-java:1.1, com.github.fommil.netlib:all:1.1.2, org.scalanlp:breeze_2.11:0.11-M0, com.github.fommil.netlib:native_system-java:1.1)
[info]  * org.scala-lang:scala-reflect:(2.11.1, 2.11.0) -> 2.11.4 (caller: org.rogach:scallop_2.11:0.9.5, com.typesafe.scala-logging:scala-logging-slf4j_2.11:2.1.2, org.spire-math:spire_2.11:0.7.4, org.spire-math:spire-macros_2.11:0.7.4, org.scalanlp:breeze-macros_2.11:0.11-M0, org.scalanlp:breeze-config_2.11:0.9.1)
[info]  * org.scala-lang.modules:scala-xml_2.11:1.0.1 -> 1.0.4 (caller: justice-data:justice-data_2.11:1.1, org.scalanlp:epic_2.11:0.3.1)
[info]  * org.scala-lang:scala-library:(2.11.2, 2.11.1, 2.11.0, 2.11.5, 2.11.4) -> 2.11.6 (caller: justice-data:justice-data_2.11:1.1, org.scalanlp:epic_2.11:0.3.1, com.typesafe.scala-logging:scala-logging-slf4j_2.11:2.1.2, com.typesafe.akka:akka-actor_2.11:2.3.11, org.spire-math:spire_2.11:0.7.4, org.scalanlp:nak_2.11:1.3, com.typesafe.scala-logging:scala-logging-api_2.11:2.1.2, org.scala-lang.modules:scala-xml_2.11:1.0.4, org.scalanlp:breeze-config_2.11:0.9.1, com.typesafe.akka:akka-stream-experimental_2.11:1.0-RC4, org.rogach:scallop_2.11:0.9.5, org.spire-math:spire-macros_2.11:0.7.4, org.scalanlp:breeze-natives_2.11:0.8, org.scalanlp:epic-parser-fr-span_2.11:2014.11.09, org.scalanlp:breeze_2.11:0.11-M0, org.scalanlp:breeze-macros_2.11:0.11-M0, org.scala-lang:scala-reflect:2.11.4 ())
[success] Total time: 5 s, completed 14 juil. 2015 07:58:49

Seems there are some dep issues... Moreover POS tagger model for Scala 2.11 only exist for English.

I close the issue as the original one is fixed. Let me know if you want me to open a new one for POS tagger model (I don t need them for my project) and dep issue.

Kind regards, Michael

pommedeterresautee commented 9 years ago

In case you wonder:

libraryDependencies ++= Seq(
  "org.scala-lang.modules" %% "scala-xml" % "1.0.4" withSources() withJavadoc(),
  "edu.stanford.nlp" % "stanford-corenlp" % "3.5.2" withSources() withJavadoc(),
  "com.typesafe.akka" %% "akka-stream-experimental" % "1.0-RC4" withSources() withJavadoc(),
  "org.scalanlp" %% "epic" % "0.3.1" withSources() withJavadoc(),
  "org.scalanlp" %% "epic-parser-fr-span" % "2014.11.09" withSources() withJavadoc()
)