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

rank function, sorting images according to text returns empty results, only scores #922

Open
kkiskkk opened this issue Jul 10, 2023 · 3 comments

Comments

@kkiskkk
Copy link

kkiskkk commented Jul 10, 2023

image
no image name displayed

@ZiniuYu
Copy link
Member

ZiniuYu commented Jul 10, 2023

Hi, could you please provide a minimum code snippet and a data sample that demonstrate how you obtained the result shown in your screenshot?

@kindziora
Copy link

Hi,

i have the same issue using the sample from the docs:
"Given sentence, rank images"
https://clip-as-service.jina.ai/user-guides/client/#rank-api

code:

from docarray import Document
from client.clip_client import Client

c = Client('grpc://172.17.0.2:51000')
# c.profile()

d = Document(
    text='a photo of a table',
    matches=[
        Document(uri='imagexyzsdfdsf'),
        Document(uri='imagexyz45435'),
        Document(uri='imagexyz68768'),
        Document(uri='imagexyz7865756'),
    ],
)
r = c.rank([d])

**replace image urls

result:

[['', '', '', ''], [0.9542718529701233, 0.0419040322303772, 0.002422966528683901, 0.0014011985622346401]]

@kindziora
Copy link

kindziora commented Jul 26, 2023

found the problem, the docs are using the wrong label in the sample:

print(c.rank(da)['@m', ['text', 'scores__clip_score__value']])
print(c.rank(da)['@m', ['uri', 'scores__clip_score__value']])

text --> uri

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants