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

Error when using neural network rules #12

Closed
cattaneod opened this issue Oct 3, 2019 · 4 comments
Closed

Error when using neural network rules #12

cattaneod opened this issue Oct 3, 2019 · 4 comments
Assignees
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch

Comments

@cattaneod
Copy link

cattaneod commented Oct 3, 2019

When getting suggestions based on neural network rules, it gives me the following error:

[Error - 12:46:12] Request textDocument/codeAction failed. Message: Internal error. Code: -32603 java.util.concurrent.CompletionException: java.lang.NullPointerException at java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source) at java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source) at java.util.concurrent.CompletableFuture.uniApply(Unknown Source) at java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source) at java.util.concurrent.CompletableFuture.postComplete(Unknown Source) at java.util.concurrent.CompletableFuture.complete(Unknown Source) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:212) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NullPointerException

However, the suggestions still work normally, just the console give that error.

@cattaneod cattaneod added 1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Oct 3, 2019
@valentjn
Copy link
Owner

valentjn commented Oct 4, 2019

@catta202000 The stack trace only tells us there is a NullPointerException somewhere, so I need to reproduce this. I've never used neural network rules. Could you add steps to reproduce this (what do I have to install, to which directory did you set ltex.additionalRules.neuralNetworkModel, etc.) or point me to some instructions?

@valentjn valentjn added the 2-needs-info Issue status: We need more information (usually) from the submitter before continuing label Oct 4, 2019
@cattaneod
Copy link
Author

cattaneod commented Oct 5, 2019

Ok, my settings are:

"ltex.additionalRules.languageModel": "C:\\LanguageTool\\ngrams", "ltex.additionalRules.word2VecModel": "C:\\LanguageTool\\word2vec", "ltex.additionalRules.motherTongue": "it", "ltex.language": "en-GB",

Both n-grams and word2vec are the models downloaded from the languagetool website.

A sentence that gives the error:
"And the taken."

@valentjn
Copy link
Owner

valentjn commented Oct 7, 2019

Ah, I didn't realize that word2vec is also based on neural networks. The stack trace is a bit longer for me:

Caused by: java.lang.NullPointerException
	at org.bsplines.languagetool_languageserver.LanguageToolLanguageServer$1.lambda$codeAction$0(LanguageToolLanguageServer.java:268)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	... 13 more

match.getSentence() seems to be null, which is due to the match being constructed by the word2vec rules with a constructor of RuleMatch that does not take an AnalyzedSentence (which has been deprecated since LT 4.0). Hence, no quick fixes are offered, so it wasn't only an error message in the log.

The workaround is to not support ignoring word2vec matches until AnalyzedSentence is provided.

@valentjn valentjn self-assigned this Oct 7, 2019
@valentjn valentjn added 2-confirmed Issue status: Confirmed, reproducible bug in LTeX and removed 2-needs-info Issue status: We need more information (usually) from the submitter before continuing 2-unconfirmed Issue status: Bug that needs to be reproduced (all new bugs have this label) labels Oct 7, 2019
@valentjn
Copy link
Owner

valentjn commented Oct 7, 2019

Fix released in 4.7.3.

@valentjn valentjn added 3-fixed Issue resolution: Issue has been fixed on the develop branch 2-confirmed Issue status: Confirmed, reproducible bug in LTeX and removed 2-confirmed Issue status: Confirmed, reproducible bug in LTeX labels Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1-bug 🐛 Issue type: Bug report (something isn't working as expected) 2-confirmed Issue status: Confirmed, reproducible bug in LTeX 3-fixed Issue resolution: Issue has been fixed on the develop branch
Projects
None yet
Development

No branches or pull requests

2 participants