ArneBinder / pytorch-ie

PyTorch-IE: State-of-the-art Information Extraction in PyTorch
MIT License
75 stars 7 forks source link

fix `TokenBasedDocument`: convert tokens to tuple if they are a list #380

Closed ArneBinder closed 11 months ago

ArneBinder commented 11 months ago

When used in a dataset, the document gets serialized to json like structure which does not know tuples, so they get converted to lists. This is a workaround to automatically convert the tokens field back to tuples when the document is created from a dataset.