Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make unit tests compile without dynet #742

Open
MihaiSurdeanu opened this issue Aug 29, 2023 · 4 comments
Open

Make unit tests compile without dynet #742

MihaiSurdeanu opened this issue Aug 29, 2023 · 4 comments
Assignees

Comments

@MihaiSurdeanu
Copy link
Contributor

@kwalcock : I removed dynet from processors in the branch balaur-minus-dynet. I adjusted most unit tests, but this one does not compile:

[info] compiling 79 Scala sources to /home/msurdeanu/github/processors/main/target/scala-2.12/test-classes ...
[error] /home/msurdeanu/github/processors/main/src/test/scala/org/clulab/numeric/TestNumericEntityRecognition.scala:45:78: value tokenizer is not a member of org.clulab.processors.clu.BalaurProcessor
[error]     lazy val habitusTokenizer: HabitusTokenizer = new HabitusTokenizer(super.tokenizer)
[error]                                                                              ^
[error] one error found
[error] (main / Test / compileIncremental) Compilation failed

Can you please adjust it when you have a moment?

@MihaiSurdeanu
Copy link
Contributor Author

Thanks to your PR, this test now passes. However, others failures showed up in the corenlp subproject. They are all caused by this error:

11:31:34.023 [pool-1-thread-1-ScalaTest-running-TestCoreNLPSentimentAnalyzer] INFO edu.stanford.nlp.parser.lexparser.LexicalizedParser - Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ... done [0.1 sec].
[info] - should correctly assign sentiment scores for negative cases *** FAILED ***
[info]   java.lang.NullPointerException:
[info]   at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:83)
[info]   at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:77)
[info]   at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:91)
[info]   at org.clulab.processors.shallownlp.ShallowNLPProcessor.mkChunker(ShallowNLPProcessor.scala:84)
[info]   at org.clulab.processors.shallownlp.ShallowNLPProcessor.chunker$lzycompute(ShallowNLPProcessor.scala:53)
[info]   at org.clulab.processors.shallownlp.ShallowNLPProcessor.chunker(ShallowNLPProcessor.scala:53)
[info]   at org.clulab.processors.shallownlp.ShallowNLPProcessor.$anonfun$chunking$1(ShallowNLPProcessor.scala:289)
[info]   at org.clulab.processors.shallownlp.ShallowNLPProcessor.$anonfun$chunking$1$adapted(ShallowNLPProcessor.scala:286)
[info]   at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:36)
[info]   at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:33)
[info]   ...

This error happens because this model:
https://github.com/clulab/processors/blob/balaur-minus-dynet/corenlp/src/main/scala/org/clulab/processors/shallownlp/ShallowNLPProcessor.scala#L82
is no longer available because I removed the dependency to processors-models, which includes it.
Can you please create a new jar file, let's call it corenlp-additional-models, which contains just this model?

Thank you!
Mihai

@kwalcock
Copy link
Member

The file is 50MB and would fit on maven and github. Although it is nice to have all the models in the same place (artifactory), it also requires the custom resolver in order to use. Which would you rather have: maven/github or artifactory? It could be github and artifactory. Usually I don't make a github repo just to publish a resource on artifactory.

@kwalcock
Copy link
Member

Perhaps even better, the file could be added to the processors-corenlp subproject as a resource and there wouldn't be an external dependency.

@MihaiSurdeanu
Copy link
Contributor Author

MihaiSurdeanu commented Aug 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants