-
Notifications
You must be signed in to change notification settings - Fork 100
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
TestLemmatizer failing with BalaurProcessor #741
Comments
Most likely unrelated, this also fails:
|
@MihaiSurdeanu, the processors branch balaur is not compiling for me. Is there a commit that hasn't made it to github? The latest there is 48a754 and it looks incomplete. |
Sorry! Yes, the |
I had done that, but the problem seems to be in the processors code :-( |
Hmm. Then I'm not sure. Can you please paste in the error? |
I've seen this on two separate computers now, so I don't think it's a fluke. The problem might be that there are two Eisner files and they are getting mixed up.
|
Interesting. I don't see this error on my Mac or a linux box. |
On the first one, there is an edge from -2 to 83. In EisnerEnsembleParser.generateOutput there is a case where Eisner fails, so there is a reversion to the greedy inference. A bestDep of -47 is found when i = 45. head ends up being -2. The programming here probably needs to be more defensive. Let me know if I should mess with the code. |
On the second problem, it looks like ToEnhancedDependencies.collapsePrepositionsUniversalDueTo is failing because it needs lemmas and lemmatize has apparently not yet been run on the document. |
Please go ahead and "mess with the code" :) |
OK. That line 25 is just before depHead - 1, which results in the -2. |
I'm trying to understand the nearby code. In PostProcessor.parserPostProcessing it looks like you are trying to account for "due to" and wanting to change the headsWithLabels(i + 1) to (i, "mwe"), but only if that's not already the case. If so, the condition at processors/main/src/main/scala/org/clulab/processors/clu/PostProcessor.scala Lines 42 to 43 in 23436a4
might need to have an || instead: (headsWithLabels(i + 1)._1 != i || headsWithLabels(i + 1)._2 != "mwe") |
I think you're right. Nice catch! |
The code is complicated enough to be hiding problems. For example, the value processors/main/src/main/scala/org/clulab/processors/clu/EisnerEnsembleParser.scala Line 291 in 23436a4
is already an int not needing conversion and the exception handler processors/main/src/main/scala/org/clulab/processors/clu/EisnerEnsembleParser.scala Line 304 in 23436a4
should probably be guarding the line all the way over here:
|
@MihaiSurdeanu, when BalaurProcessor.assignDependencyLabels gets called, are the original headLabels coming out of the neural network using absolute or relative values? It looks like relative because of
but then absolute because of processors/main/src/main/scala/org/clulab/processors/clu/EisnerEnsembleParser.scala Line 234 in 23436a4
|
Yes, the ML predicts relative head positions (the classifier generalizes much better with relative positions). The code in the processor then converts them to absolute values, and then construct a DependencyGraph. |
I think you're right. Thanks for catching it! |
@MihaiSurdeanu, the model 0.0.4 should be available now. Next time I will be daring and number it 0.1.0! |
Thank you! |
I hope to ask tomorrow about some of this code, because there are too many words (for me) for different stages of the same numbers. Here's a code question, though. In processors/main/src/main/scala/org/clulab/processors/clu/EisnerEnsembleParser.scala Lines 294 to 295 in 23436a4
relHead being 0 has special meaning, because something can't be its own head. However, mod + relHead can also be zero, I think, and that doesn't mean quite the same thing: mod + relHead == 0 => i + 1 + relHead == 0 => i + relHead == -1 => absHead == -1 which is invalid. It might be OK to say that in that case it goes to root just like an actual relHead of 0 would. However, then if mod + relHead == -1 => absHead == -2, the same going to root option is not taken because the condition in the second line is not satisfied. If that is the case, I have an urge to rearrange some things so as not to get into that situation. |
Let's discuss in our meeting today! |
Yet another question... AFAICT, the data coming into assignDependencyLabels for the heads and labels have heads all originating from the tasks.3.labels file. These are 160 values ranging from -127 to +77 with some gaps. There are no duplicates. That seems like a constant. I don't think there should be any issue converting any of the heads to integers so that the exception handling is not necessary. If the values are distinct, then code like processors/main/src/main/scala/org/clulab/processors/clu/EisnerEnsembleParser.scala Line 296 in 23436a4
would not seem necessary, either. For this particular task it looks like the scores are already delivered sorted so that processors/main/src/main/scala/org/clulab/processors/clu/EisnerEnsembleParser.scala Line 283 in 23436a4
is similarly unnecessary. I'll see if it works without these things. |
The older classifier based on dynet could generate some strings labels. But this is no longer true with transformers. So that exception is no longer needed. |
In the
balaur
branch, TestLemmatizer fails as follows:@kwalcock: can you please look into this? Thank you!
The text was updated successfully, but these errors were encountered: