Skip to content
Discussion options

You must be logged in to vote

The right way to do this depends on your access pattern.

A simple thing you can do is, if the data can be serialized easily, you can put it in a custom extension attribute (_ attribute) and use a DocBin to serialize things. However DocBins aren't designed for random access.

If you need random access, you'll want to serialize Docs individually, so you could just create a tuple like (doc, stuff) and serialize it, with some kind of separate index structure. However that will be very inefficient due to the way Vocabs work, so if you need to do that you should copy just the parts of the Doc you need into another data structure.

If you give more details about the type of data you have in "conte…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@polm
Comment options

Comment options

You must be logged in to vote
6 replies
@polm
Comment options

@fatihbozdag
Comment options

@kinghuang
Comment options

@fatihbozdag
Comment options

@pmbaumgartner
Comment options

Answer selected by adrianeboyd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / serialize Feature: Serialization, saving and loading
4 participants