Describe the bug
The usage example in the FastembedSparseDocumentEmbedder docstring ends with
print(f"Sparse Embedding Dimension: {len(result['documents'][0].sparse_embedding)}")
SparseEmbedding does not define __len__, so running the example as written fails:
TypeError: object of type 'SparseEmbedding' has no len()
Happy to open a PR with the one-line fix.
To Reproduce
Run the usage example from the FastembedSparseDocumentEmbedder docstring as is
(integrations/fastembed/src/haystack_integrations/components/embedders/fastembed/fastembed_sparse_document_embedder.py).
Describe your environment (please complete the following information):
- OS: Ubuntu 24.04 LTS
- Haystack version: 3.0.0
- Integration version: current
main
Describe the bug
The usage example in the
FastembedSparseDocumentEmbedderdocstring ends withSparseEmbeddingdoes not define__len__, so running the example as written fails:Happy to open a PR with the one-line fix.
To Reproduce
Run the usage example from the
FastembedSparseDocumentEmbedderdocstring as is(
integrations/fastembed/src/haystack_integrations/components/embedders/fastembed/fastembed_sparse_document_embedder.py).Describe your environment (please complete the following information):
main