allenai / allenai/SciREX

Key error in predict_salient_mentions.py

Abierto
#13 8 comentarios 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
141
Forks
33
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I trained the baseline SciREX model, and then tried to make predictions for it, but ran into a problem in the step to predict salient mentions. When I tried running:
```
python scirex/predictors/predict_salient_mentions.py $scirex_archive $test_output_folder/ner_predictions.jsonl $test_output_folder/salient_mentions_predictions.jsonl $cuda_device
```

I got the error:
```
span_ix = span_mask.view(-1).nonzero().squeeze(1).long()
36it [00:02, 15.88it/s]
Traceback (most recent call last):
File "scirex/predictors/predict_salient_mentions.py", line 92, in
main()
File "scirex/predictors/predict_salient_mentions.py", line 88, in main
predict(archive_folder, test_file, output_file, cuda_device)
File "scirex/predictors/predict_salient_mentions.py", line 57, in predict
metadata = output_res['metadata']
KeyError: 'metadata'
```
It seems that one in every so often, the output of the salient mention prediction decoder is missing the `metadata` field.

As a stopgap solution, I'm just skipping batches with this issue, but am concerned that I'll accidentally bias my evaluation somehow by doing this.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.