Skip to content

Commit

Permalink
Add ANN Search field
Browse files Browse the repository at this point in the history
Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>

Resize img

Signed-off-by: shiyu22 <shiyu.chen@zilliz.com>
  • Loading branch information
shiyu22 committed Jul 22, 2022
1 parent f8bac33 commit 5f2c352
Show file tree
Hide file tree
Showing 11 changed files with 64 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ann_insert/description.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
task-name: "ANN Insert"
description: "The ANN Insert Operator is used to insert embeddings and create ANN indexes for fast similarity searches."
img-credit: "Insert Vectors and Build ANN(Approximate Nearest Neighbor) Index"
img-ref: "https://engineering.fb.com/2017/03/29/data-infrastructure/faiss-a-library-for-efficient-similarity-search/"
operator-implementations:
- milvus:
implementation: "Milvus"
op-name: "ann_insert.milvus"
op-link: "https://towhee.io/ann-insert/milvus"
7 changes: 7 additions & 0 deletions ann_insert/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```python
import towhee

towhee.dc['vec'](your_embeddings) \
.ann_insert.milvus['vec', 'results'](collection=collection) \
.show()
```
Binary file added ann_insert/example_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ann_insert/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions ann_insert/interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**Parameters:**

*data: list*

The embedding data to be inserted.


**Returns:**

*mr*

Return milvus results with `milvus.insert`.
13 changes: 13 additions & 0 deletions ann_search/description.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
task-name: "ANN Search"
description: "The ANN search operator is used to find the closest (or most similar) point to a given point in a given set, i.e. find similar embeddings."
img-credit: "ANN(Approximate Nearest Neighbor) Search Algorithm"
img-ref: "https://www.researchgate.net/publication/328484020_Fast_Feature_Matching_Based_on_r-Nearest_k-Means_Searching"
operator-implementations:
- faiss:
implementation: "Faiss"
op-name: "ann_search.faiss"
op-link: "https://towhee.io/ann-search/faiss"
- milvus:
implementation: "Milvus"
op-name: "ann_search.milvus"
op-link: "https://towhee.io/ann-search/milvus"
7 changes: 7 additions & 0 deletions ann_search/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```python
import towhee

towhee.dc['vec'](query) \
.ann_search.milvus['vec', 'result'](collection=collection) \
.show()
```
Binary file added ann_search/example_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ann_search/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions ann_search/interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**Parameters:**

*query: list*

Query embeddings in Milvus.


**Returns:**

*Entity*

Return the results in Milvus, such as `id`, `score` or other query fields.
4 changes: 4 additions & 0 deletions fields/anns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
field-name: "ANN Search"
tasks:
- ann_search
- ann_insert

0 comments on commit 5f2c352

Please sign in to comment.