Skip to content

Commit 34e6952

Browse files
committed
Added kwargs support for vicinity
1 parent 66536d0 commit 34e6952

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ deduplicated_texts = semhash.self_deduplicate()
325325
<summary> Using custom ANN backends </summary>
326326
<br>
327327

328-
The following code snippet shows how to use a custom ANN backend with SemHash:
328+
The following code snippet shows how to use a custom ANN backend and custom args with SemHash:
329329

330330
```python
331331
from datasets import load_dataset
@@ -335,14 +335,14 @@ from vicinity import Backend
335335
# Load a dataset to deduplicate
336336
texts = load_dataset("ag_news", split="train")["text"]
337337

338-
# Initialize a SemHash with the model and custom ann backend
339-
semhash = SemHash.from_records(records=texts, ann_backend=Backend.FAISS)
338+
# Initialize a SemHash with the model and custom ann backend and custom args
339+
semhash = SemHash.from_records(records=texts, ann_backend=Backend.FAISS, nlist=50)
340340

341341
# Deduplicate the texts
342342
deduplicated_texts = semhash.self_deduplicate()
343343
```
344344

345-
For the full list of supported ANN backends, see the [Vicinity docs](https://github.com/MinishLab/vicinity/tree/main?tab=readme-ov-file#supported-backends).
345+
For the full list of supported ANN backends and args, see the [Vicinity docs](https://github.com/MinishLab/vicinity/tree/main?tab=readme-ov-file#supported-backends).
346346

347347
</details>
348348

0 commit comments

Comments
 (0)