generall93 Anush008 commited on
Commit
cfff50d
1 Parent(s): 7ae3a4f

Added a model card. (#1)

Browse files

- Added a model card. (be9738f6bd7665c97fc9386a05c16ecffb8b6cee)
- Update README.md (1d8655a6fa49e9f492196a05bedd55b636a12dfc)


Co-authored-by: Anush Shetty <Anush008@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +38 -3
README.md CHANGED
@@ -1,3 +1,38 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ pipeline_tag: sentence-similarity
6
+ ---
7
+ Repository with files to perform BM25 searches with [FastEmbed](https://github.com/qdrant/fastembed).
8
+
9
+ [BM25 (Best Matching 25)](https://en.wikipedia.org/wiki/Okapi_BM25) is a ranking function used by search engines to estimate the relevance of documents to a given search query.
10
+
11
+ ### Usage
12
+
13
+ Here's an example of BM25 with [FastEmbed](https://github.com/qdrant/fastembed).
14
+
15
+ ```py
16
+ from fastembed import SparseTextEmbedding
17
+
18
+ documents = [
19
+ "You should stay, study and sprint.",
20
+ "History can only prepare us to be surprised yet again.",
21
+ ]
22
+
23
+ model = SparseTextEmbedding(model_name="Qdrant/bm25")
24
+ embeddings = list(model.embed(documents))
25
+
26
+ # [
27
+ # SparseEmbedding(
28
+ # values=array([1.67419738, 1.67419738, 1.67419738, 1.67419738]),
29
+ # indices=array([171321964, 1881538586, 150760872, 1932363795])),
30
+ # SparseEmbedding(values=array(
31
+ # [1.66973021, 1.66973021, 1.66973021, 1.66973021, 1.66973021]),
32
+ # indices=array([
33
+ # 578407224, 1849833631, 1008800696, 2090661150,
34
+ # 1117393019
35
+ # ]))
36
+ # ]
37
+
38
+ ```