Indexing bug? Swapping the wrong word

#3
by marisajh - opened

Hi, love this dataset! I'm not sure if this is a bug, or how widespread it might be. I've only looked at the Latin subset. It seems potentially, when the head is the very first word, the head index is wrong, and so the "wrong sentence" has not swapped out the head word, but another word in the sentence. Let me know if I'm misunderstanding something. I don't think this affects many examples!

Line 19:
sen: fuit tamen retinendi ordinis causa facienda iactura
head: fuit
head index: 5 <---- this should be 0?
swap head: fuerunt
wrong_sen: fuit tamen retinendi ordinis causa fuerunt iactura

fuit should be replaced, not facienda

Line 210:
sen: erat autem non longe ab illis grex porcorum multorum pascens
head: erat
head index: 9 <---- should be 0?
swap head: erant
wrong_sen: erat autem non longe ab illis grex porcorum multorum erant

erat should be replaced, not pascens

Owner

Sorry for the late response, didn't get a notification for this. That's a very odd bug indeed, I'm gonna look into this!

Hi, thanks again for noticing this issue. It is definitely a bug, and I've identified why this happens: when the verb has a copula that is at the first position of the sentence I set the wrong index for the head because I did this in my code:
main_verb_idx = cop_idx or verb_idx

This was done under the assumption that cop_idx is either None or an int, but in Python 0 also acts as being False in such an expression. Stupid oversight but easy to fix.

The good thing though is that this is quite rare, for Latin it happened in 12 of the 3149 minimal pairs (0.38%). Across all languages it happens 222 times in total out of 121,507 pairs (0.18%). So the overall model performance shouldn't be impacted too much by it.

Along with a few other small bug fixes I was planning to release a v1.1 sometime soon, in which this will be fixed as well.

that's great it was such an easy fix, and that it wasn't very widespread! thanks

Sign up or log in to comment