Views
No views yet
Note: This model is supposed to be used with Qdrant. Vectors have to be configured with Modifier.IDF.
1from fastembed import SparseTextEmbedding
2
3documents = [
4 "You should stay, study and sprint.",
5 "History can only prepare us to be surprised yet again.",
6]
7
8model = SparseTextEmbedding(model_name="Qdrant/bm25")
9embeddings = list(model.embed(documents))
10
11# [
12# SparseEmbedding(
13# values=array([1.67419738, 1.67419738, 1.67419738, 1.67419738]),
14# indices=array([171321964, 1881538586, 150760872, 1932363795])),
15# SparseEmbedding(values=array(
16# [1.66973021, 1.66973021, 1.66973021, 1.66973021, 1.66973021]),
17# indices=array([
18# 578407224, 1849833631, 1008800696, 2090661150,
19# 1117393019
20# ]))
21# ]