jina.types.arrays.mixins.content module

class jina.types.arrays.mixins.content.ContentPropertyMixin[source]

Bases: object

Helpers that provide faster getter & setter for content by using protobuf directly.

property embeddings: Optional[ArrayType]

Return a ArrayType stacking all the embedding attributes as rows.

Return type

Optional[ForwardRef]

Returns

a ArrayType of embedding

property blobs: Optional[ArrayType]

Return a ArrayType stacking all blob.

The blob attributes are stacked together along a newly created first dimension (as if you would stack using np.stack(X, axis=0)).

Warning

This operation assumes all blobs have the same shape and dtype. All dtype and shape values are assumed to be equal to the values of the first element in the DocumentArray / DocumentArrayMemmap

Return type

Optional[ForwardRef]

Returns

a ArrayType of blobs

property texts: Optional[List[str]]

Get text of all Documents

Return type

Optional[List[str]]

Returns

a list of texts

property buffers: Optional[List[bytes]]

Get the buffer attribute of all Documents.

Return type

Optional[List[bytes]]

Returns

a list of buffers

property contents: Optional[Union[Sequence[DocumentContentType], ArrayType]]

Get the content of all Documents.

Return type

Union[Sequence[ForwardRef], ForwardRef, None]

Returns

a list of texts, buffers or ArrayType