jina.types.sets.document¶
-
class
jina.types.sets.document.
DocumentSet
(docs_proto)[source]¶ Bases:
collections.abc.MutableSequence
DocumentSet
is a mutable sequence ofDocument
, it gives an efficient view of a list of Document. One can iterate over it like a generator but ALSO modify it, count it, get item, or union two ‘DocumentSet’s using the ‘+’ and ‘+=’ operators.-
extend
(iterable)[source]¶ S.extend(iterable) – extend sequence by appending elements from the iterable
- Return type
None
-
build
()[source]¶ Build a doc_id to doc mapping so one can later index a Document using doc_id as string key
-
property
all_embeddings
¶ Return all embeddings from every document in this set as a ndarray
- :return a tuple of embedding in
np.ndarray
, the corresponding documents in a
DocumentSet
, and the documents have no embedding in aDocumentSet
.
- Return type
Tuple
[ndarray
,DocumentSet
,DocumentSet
]
- :return a tuple of embedding in
-
property
all_contents
¶ Return all embeddings from every document in this set as a ndarray
- Return type
Tuple
[ndarray
,DocumentSet
,DocumentSet
]- Returns
a tuple of embedding in
np.ndarray
, the corresponding documents in aDocumentSet
, and the documents have no contents in aDocumentSet
.
-