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 multithreading #3

Open
katjahauser opened this issue Aug 10, 2016 · 3 comments
Open

Error when using multithreading #3

katjahauser opened this issue Aug 10, 2016 · 3 comments

Comments

@katjahauser
Copy link

Hello,

I'm running several threads each executing GermaNER and keep getting occasional

java.lang.IllegalStateException: The number of extracted classified labels is not equivalent with the number of instanzes (0!=632)

exceptions (with varying numbers of instances) caused by

 at org.cleartk.ml.crfsuite.CrfSuiteWrapper.classifyFeatures(CrfSuiteWrapper.java:235)

at org.cleartk.ml.crfsuite.CrfSuiteWrapper.classifyFeatures(CrfSuiteWrapper.java:304)
at org.cleartk.ml.crfsuite.CrfSuiteStringOutcomeClassifier.classify(CrfSuiteStringOutcomeClassifier.java:79)
at org.cleartk.ml.CleartkSequenceAnnotator.classify(CleartkSequenceAnnotator.java:191)
at de.tu.darmstadt.lt.ner.annotator.NERAnnotator.classify(NERAnnotator.java:188)
at de.tu.darmstadt.lt.ner.annotator.NERAnnotator.process(NERAnnotator.java:178)
at org.apache.uima.analysis_component.JCasAnnotator_ImplBase.process(JCasAnnotator_ImplBase.java:48)
at org.apache.uima.analysis_engine.impl.PrimitiveAnalysisEngine_impl.callAnalysisComponentProcess(PrimitiveAnalysisEngine_impl.java:385)
... 6 more

I do not encounter this problem when running GermaNER with only one thread.

Having had a look at CrfSuiteWrapper I'd suppose this error stems from a race condition related to the occasionally(?) used temporary file. Can you reproduce this error and confirm my assumption?
I think a very simple workaround would be to simply add a random number to the name of the temp-file to avoid the race condition. Do you have other ideas how to avoid this or any tips in regard to running multiple instances of GermaNER in parallel?

Best regards,
Katja

@seyyaw
Copy link
Contributor

seyyaw commented Dec 4, 2016

@katjahauser Can you share us your multi-thread code you run for GermaNER? This will help us to quickly test the bug and find out a solution
Thanks

@katjahauser
Copy link
Author

katjahauser commented Jan 8, 2017 via email

@OfferFuture
Copy link

I encounter this problem compiling cleartk as well. The CrfSuiteClassiferTest failed due to this error.

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

3 participants