Skip to content

Commit

Permalink
Remove grpcio dependancy
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelsty committed Oct 27, 2022
1 parent 75268dc commit 159973d
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cherche/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
VERSION = (1, 0, 0)
VERSION = (1, 0, 1)

__version__ = ".".join(map(str, VERSION))
4 changes: 2 additions & 2 deletions docs/api/rank/DPR.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ DPR ranks documents using distinct models to encode the query and document conte

Number of documents to reorder. The default value is None, i.e. all documents will be reordered and returned.

- **similarity** – defaults to `<function dot at 0x16684bc10>`
- **similarity** – defaults to `<function dot at 0x16beca040>`

Similarity measure to compare documents embeddings and query embedding (similarity.cosine or similarity.dot).

- **store** – defaults to `<cherche.rank.base.MemoryStore object at 0x166806cd0>`
- **store** – defaults to `<cherche.rank.base.MemoryStore object at 0x16be3f910>`

- **path** (*'str | typing.Optionnal'*) – defaults to `None`

Expand Down
4 changes: 2 additions & 2 deletions docs/api/rank/Encoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ SentenceBert Ranker.

Number of documents to reorder. The default value is None, i.e. all documents will be reordered and returned.

- **similarity** – defaults to `<function cosine at 0x16684bb80>`
- **similarity** – defaults to `<function cosine at 0x16bec7f70>`

Similarity measure to compare documents embeddings and query embedding (similarity.cosine or similarity.dot).

- **store** – defaults to `<cherche.rank.base.MemoryStore object at 0x166841730>`
- **store** – defaults to `<cherche.rank.base.MemoryStore object at 0x16bebabb0>`

- **path** (*'str | typing.Optionnal'*) – defaults to `None`

Expand Down
6 changes: 3 additions & 3 deletions docs/api/rank/Recommend.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ Collaborative filtering as a ranker. Recommend is compatible with the library [I

Number of documents to retrieve. Default is `None`, i.e all documents that match the query will be retrieved.

- **similarity** – defaults to `<function cosine at 0x16684bb80>`
- **similarity** – defaults to `<function cosine at 0x16bec7f70>`

- **store_items** – defaults to `<cherche.rank.base.MemoryStore object at 0x166841ee0>`
- **store_items** – defaults to `<cherche.rank.base.MemoryStore object at 0x16becd160>`

- **store_users** – defaults to `<cherche.rank.base.MemoryStore object at 0x166841f40>`
- **store_users** – defaults to `<cherche.rank.base.MemoryStore object at 0x16becd1c0>`


## Attributes
Expand Down
2 changes: 1 addition & 1 deletion docs/api/retrieve/Fuzz.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

Number of documents to retrieve. Default is `None`, i.e all documents that match the query will be retrieved.

- **fuzzer** – defaults to `<cyfunction partial_ratio at 0x16700dad0>`
- **fuzzer** – defaults to `<cyfunction partial_ratio at 0x16c465040>`

[RapidFuzz scorer](https://maxbachmann.github.io/RapidFuzz/Usage/fuzz.html): fuzz.ratio, fuzz.partial_ratio, fuzz.token_set_ratio, fuzz.partial_token_set_ratio, fuzz.token_sort_ratio, fuzz.partial_token_sort_ratio, fuzz.token_ratio, fuzz.partial_token_ratio, fuzz.WRatio, fuzz.QRatio, string_metric.levenshtein, string_metric.normalized_levenshtein

Expand Down
2 changes: 1 addition & 1 deletion docs/api/retrieve/Meilisearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Meilisearch is a RESTful search API. It aims to be a ready-to-go solution for ev

Meilisearch index. Meilisearch will create the index if it does not exist.

- **k** (*Union[int, NoneType]*) – defaults to `None`
- **k** (*Optional[int]*) – defaults to `None`

Number of documents to retrieve. Default is `None`, i.e all documents that match the query will be retrieved.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/retrieve/Recommend.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Collaborative filtering as a retriever. Recommend is compatible with the library

Index that will store the embeddings of documents and perform the similarity search. The default index is Faiss. We can choose index.Milvus also.

- **store** – defaults to `<cherche.retrieve.recommend.MemoryStore object at 0x168b6ca30>`
- **store** – defaults to `<cherche.retrieve.recommend.MemoryStore object at 0x16f7a4a30>`

Index that will store the embeddings of users. By default, it store users embeddings in memory. We can choose index.Milvus also.

Expand Down
2 changes: 1 addition & 1 deletion docs/api/retrieve/Retriever.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Retriever base class.

Fields to use to match the query to the documents.

- **k** (*Union[int, NoneType]*)
- **k** (*Optional[int]*)

Number of documents to retrieve. Default is None, i.e all documents that match the query will be retrieved.

Expand Down
4 changes: 2 additions & 2 deletions docs/api/retrieve/Typesense.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Typesense retriever.

- **collection**

- **k** (*Union[int, NoneType]*) – defaults to `None`
- **k** (*Optional[int]*) – defaults to `None`


## Attributes
Expand Down Expand Up @@ -82,7 +82,7 @@ Typesense retriever
**Parameters**

- **q** (*str*)
- **query** (*Union[dict, NoneType]*) – defaults to `None`
- **query** (*Optional[dict]*) – defaults to `None`
- **kwargs**

???- note "add"
Expand Down
6 changes: 6 additions & 0 deletions docs/rank/rank.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ sudo docker-compose down

Before pre-computing documents embeddings, it is necessary to create a collection. We will use the Milvus Python API: [pymilvus](https://milvus.io/api-reference/pymilvus/v2.1.1/About.md).

First we will install the python client pymilvus.

```sh
pip install pymilvus
```

The first step is to connect to the Milvus database:

```python
Expand Down
6 changes: 6 additions & 0 deletions docs/retrieve/dpr.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ sudo docker-compose down

Before indexing the documents, it is necessary to create a collection. We will use the Milvus Python API: [pymilvus](https://milvus.io/api-reference/pymilvus/v2.1.1/About.md).

First we will install the python client pymilvus.

```sh
pip install pymilvus
```

The first step is to connect to the Milvus database:

```python
Expand Down
6 changes: 6 additions & 0 deletions docs/retrieve/encoder.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ sudo docker-compose down

Before indexing the documents, it is necessary to create a collection. We will use the Milvus Python API: [pymilvus](https://milvus.io/api-reference/pymilvus/v2.1.1/About.md).

First we will install the python client pymilvus.

```sh
pip install pymilvus
```

The first step is to connect to the Milvus database:

```python
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"meilisearch >= 0.22.1",
"more-itertools >= 9.0.0",
"numpy >= 1.19.0",
"pymilvus >= 2.1.3",
"rank-bm25 == 0.2.1",
"rapidfuzz >= 1.9.1",
"river >= 0.8.0",
Expand All @@ -26,6 +25,8 @@
"typesense >= 0.14.0",
]

milvus = ["pymilvus >= 2.1.3"]

onnx = ["onnx >= 1.10.2", "onnxruntime >= 1.9.0"]

onnxgpu = ["onnx >= 1.10.2", "onnxruntime-gpu >= 1.9.0"]
Expand Down Expand Up @@ -63,6 +64,7 @@
"onnx": base_packages + onnx,
"onnxgpu": base_packages + onnxgpu,
"doc": base_packages + doc,
"milvus": base_packages + milvus,
},
package_data={
"cherche": ["data/towns.json", "data/semanlink/*.json", "data/norvig.txt"]
Expand Down

0 comments on commit 159973d

Please sign in to comment.