Doc.from_docs to retain custom attributes #9106
Replies: 1 comment 4 replies
-
That's an interesting idea, but I think it's generally not safe for us to make assumptions about I don't think there's any performance hit to manually managing |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I guess this is more of a feature request.
It is possible to merge Docs into a single Doc with Docs.from_docs. This is useful if you are iteratively creating Doc and only at the end want to retrieve a single Doc. The initial Docs will then serve as (multiple) sentence spans (Doc.sents). It would appear, however, that custom Doc attributes are lost when using
Docs.from_docs
.This throws a warning right here: "Skipping Doc custom extension 'metadata' while merging docs.". I would have expected that the doc extensions would be saved as a list (for each initial Doc) in user_data or something similar.
spaCy/spacy/tokens/doc.pyx
Line 1140 in f803a84
Is there any way to preserve custom data that has been passed via single Docs into Doc.from_docs?
Beta Was this translation helpful? Give feedback.
All reactions