allenai / allenai/pawls

BUG: duplicated tokens should not be allowed in pdf_structure tokens list

Aperta
#186 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
435
Fork
80
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

In the pdfplumber preprocess pipeline I've found that duplicated tokens may exist. Specifically in the `obtain_word_tokens` of the `pdfplumber.py` file, one should put a `.drop_duplicates` before converting the dataframe to list.

```
word_tokens = df.apply(self.convert_to_pagetoken, axis=1).drop_duplicates(keep="first").tolist()
```
It can happen in some cases that the tokens from a PAWLS pdf structure appear duplicated and this messes up things a bit when indexing from the annotation file.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.