UppsalaNLP / uuparser

A transition-based parser for Universal Dependencies with BiLSTM word and character representations.
Apache License 2.0
80 stars 25 forks source link

How do you generate predictions on test file? #13

Open ButteredGroove opened 5 years ago

ButteredGroove commented 5 years ago

How do I generate predictions from a test file? I've tried each of the following, but all used the dev file instead of the test file:

python3 src/parser.py --predict --outdir ./Indonesian --datadir /gpfs-volume --include id_gsd --ext-word-emb-file ~/embeddings/Indonesian/id.vectors.xz --testfile=/gpfs-volume/UD_Indonesian-GSD/id_gsd-ud-test.conllu
python3 src/parser.py --predict --outdir ./Indonesian --datadir /gpfs-volume --include id_gsd --ext-word-emb-file ~/embeddings/Indonesian/id.vectors.xz --devfile=/gpfs-volume/UD_Indonesian-GSD/id_gsd-ud-test.conllu

I had to rename the test data file as the dev file to generate test predictions. What did I miss?

mdelhoneux commented 5 years ago

You do not need to use the --include flag when using directly the --trainfile or --testfile options and in fact, doing so ignores your argument to --testfile. This is not great design, will try to fix this.

chen955 commented 4 years ago

why yield osentence in Predict of arc_hybrid.py? Is it really predictable?

mdelhoneux commented 4 years ago

I don't understand your question?

chen955 commented 4 years ago

I means it looks like only reading tagged label from the dev file when I predict.

mdelhoneux commented 4 years ago

Ah ok, no, we do predict inside the Predict function, see https://github.com/UppsalaNLP/uuparser/blob/a7632d7483edcf264ef949a83275ae2637de54c9/barchybrid/src/arc_hybrid.py#L146 and https://github.com/UppsalaNLP/uuparser/blob/a7632d7483edcf264ef949a83275ae2637de54c9/barchybrid/src/arc_hybrid.py#L147

in the apply_transition function