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

Does the parser special-treat relation subtypes? #83

Open
msklvsk opened this issue Oct 12, 2018 · 5 comments
Open

Does the parser special-treat relation subtypes? #83

msklvsk opened this issue Oct 12, 2018 · 5 comments

Comments

@msklvsk
Copy link

msklvsk commented Oct 12, 2018

Imagine the parser is trying to decide between rela:subtype1, rela:subtype2 and relb. Let them have probabilities 0.25, 0.2 and 0.3 respectively. Will UDPipe simply select relb or will it select rela:subtype1 because universal rela is more probable (0.25+0.2)?

@foxik
Copy link
Member

foxik commented Oct 13, 2018

UDPipe indeed simply selects relb, is has no knowledge of universal deprels. I am leaving this open to evaluate the possibility of aggregating over universal types first (with the upcoming UDPipe 2 it will be easy to do so).

@ryszardtuora
Copy link

ryszardtuora commented Jan 13, 2021

I have a related question. I know that the conll18_ud_eval.py script skips consideration of relation subtypes, and I have been under the impression (can't really pinpoint as to where that impression came from) that UDPipe also does that during training, and thus does not treat rela:subtype1 as an error when the gold is rela:subtype2. I can't find any mention of this on the website or in the article now, maybe I just assumed for no reason, that UDPipe uses the conll18_ud_eval.py script for choosing between models from different epochs. I'd appreciate your input on this @foxik.

EDIT: To be more precise, I am concerned with all the stages of training, evaluation, and prediction, i.e. does the loss function ignore subtypes, does the evaluation process for choosing the best iteration ignore the subtypes, and does this apply in any way during the stage of prediction (this last question I think is answered by your last post here).

@foxik
Copy link
Member

foxik commented Jan 14, 2021

UDPipe 1 significantly pre-dates the conll18_ud_eval.py script, and it just considers the given deprels to be strings, without interpreting them in any way. Therefore, rela:subtype1 and relb:subtype2 are different during training (loss computation and heldout data evaluation) and prediction (each is predicted independently).

There is however one place where the subtypes are ignored -- when running udpipe --accuracy https://ufal.mff.cuni.cz/udpipe/1/users-manual#udpipe_accuracy , which measures the accuracy of a given model. In that case, the subtypes are really ignored (to report numbers same as the conll17_ud_eval script).

This is a design choice -- we try to reconstruct whatever the user has given us. If you are interested only in deprels without subtypes, you can remove them from the training data :-)

@ryszardtuora
Copy link

I see, in the meantime I have found this piece of code: github.com/ufal/udpipe/blob/master/src/model/evaluator.cpp lines 252-256, I take it that this is used only when running udpipe --accuracy, and does not affect the training in any way. Am I right?

@foxik
Copy link
Member

foxik commented Jan 15, 2021

Exactly. During training, https://github.com/ufal/udpipe/blob/master/src/parsito/parser/parser_nn_trainer.cpp#L476 is used, which compares the whole deprels.

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