Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kreciprocal evaluation. #191

Merged
merged 1 commit into from
Apr 13, 2023
Merged

Add kreciprocal evaluation. #191

merged 1 commit into from
Apr 13, 2023

Conversation

wxywb
Copy link
Collaborator

@wxywb wxywb commented Apr 13, 2023

No description provided.

if src_question == cache_question:
return 1
candidates = list(self.vectordb.search(cache_dict['embedding_data'], self.top_k))
top_k_candidates = candidates[: self.top_k]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improve it, like

top_k_candidates=self.vectordb.search(cache_dict['embedding_data'], self.top_k)

"""


def __init__(self, vectordb: 'gptcache.manager.vector_data.base.VectorBase', top_k: int = 3):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like: vectordb: VectorBase


:return: minimum and maximum of similarity score.
"""
return 0.0, 1.0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it may be the same as SearchDistanceEvaluation

gptcache/manager/vector_data/milvus.py Show resolved Hide resolved
gptcache/manager/vector_data/faiss.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Apr 13, 2023

Codecov Report

Merging #191 (d0f7961) into dev (5122c27) will increase coverage by 0.46%.
The diff coverage is 97.56%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #191      +/-   ##
==========================================
+ Coverage   80.33%   80.79%   +0.46%     
==========================================
  Files          41       42       +1     
  Lines        1200     1234      +34     
==========================================
+ Hits          964      997      +33     
- Misses        236      237       +1     
Impacted Files Coverage Δ
gptcache/similarity_evaluation/kreciprocal.py 95.65% <95.65%> (ø)
gptcache/manager/vector_data/base.py 79.16% <100.00%> (ø)
gptcache/manager/vector_data/chroma.py 84.37% <100.00%> (+1.04%) ⬆️
gptcache/manager/vector_data/faiss.py 100.00% <100.00%> (ø)
gptcache/manager/vector_data/hnswlib_store.py 95.74% <100.00%> (+0.18%) ⬆️
gptcache/manager/vector_data/milvus.py 85.52% <100.00%> (+0.39%) ⬆️
gptcache/similarity_evaluation/__init__.py 83.33% <100.00%> (+3.33%) ⬆️

@mergify mergify bot added ci-passed and removed ci-passed labels Apr 13, 2023
Signed-off-by: wxywb <xy.wang@zilliz.com>
@mergify mergify bot added the ci-passed label Apr 13, 2023
@SimFG
Copy link
Collaborator

SimFG commented Apr 13, 2023

/lgtm
/approve

@sre-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SimFG, wxywb

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sre-ci-robot sre-ci-robot merged commit 1148f55 into zilliztech:dev Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants