How to include custom attributes in the Doc.from_docs function? #10770
Unanswered
miknab
asked this question in
Help: Coding & Implementations
Replies: 1 comment
-
Copying my answer from SO (https://stackoverflow.com/a/72171599):
(What value should the final merged doc include for |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
There is a method
Doc.from_docs()
in spaCy3 (here are links to the code and the high-level documentation) which would come in handy for a project I'm working on. This method concatenates a list of Doc objects into a single Doc object.On a high level, here's what the method does:
Doc.to_array()
Doc.from_array()
I would like to find out how to make this
from_docs
method take into account also custom attributes. Currently, native spaCy attributes like e.g. "POS" or "DEP" are considered and any related tags are transferred from the original input Doc objects to the resulting concatenated Doc object. However, any custom attribute extensions (i.e.Doc._.*
) are lost when executing this method.Does anyone know how to include custom attributes in the
Doc.from_docs()
method?Thank you for any hints.
Beta Was this translation helpful? Give feedback.
All reactions