how to rank cross model matches in the client CLIP as service according to Clip scores in Jina?
Question:
I am using CLIP-as-service client API for uploading text and images to server. I need to rank images and text data based on match scores.
Do CLIP supports ranking feature? What would be the syntax for this?
Answers:
Yes. Clip-as-a-service Client API supports the ranking feature and more about the syntax is available in the documentation.
https://clip-as-service.jina.ai/user-guides/client/#ranking
Also, ranking works well with both images and text.
Yes, you can rank based on the match scores. Example syntax-
from docarray import Document
d = Document(
uri='.github/README-img/rerank.png',
matches=[
Document(text=f'a photo of a {p}')
for p in (
'control room',
'lecture room',
'conference room',
'podium indoor',
'television studio',
)
],
)
Once you feeded documents with the list you can call rank function.
from clip_client import Client
c = Client(server='grpc://0.0.0.0:23456')
r = c.rank([d])
print(r['@m', ['text', 'scores__clip_score__value']])
Learn more here.
I am using CLIP-as-service client API for uploading text and images to server. I need to rank images and text data based on match scores.
Do CLIP supports ranking feature? What would be the syntax for this?
Yes. Clip-as-a-service Client API supports the ranking feature and more about the syntax is available in the documentation.
https://clip-as-service.jina.ai/user-guides/client/#ranking
Also, ranking works well with both images and text.
Yes, you can rank based on the match scores. Example syntax-
from docarray import Document
d = Document(
uri='.github/README-img/rerank.png',
matches=[
Document(text=f'a photo of a {p}')
for p in (
'control room',
'lecture room',
'conference room',
'podium indoor',
'television studio',
)
],
)
Once you feeded documents with the list you can call rank function.
from clip_client import Client
c = Client(server='grpc://0.0.0.0:23456')
r = c.rank([d])
print(r['@m', ['text', 'scores__clip_score__value']])
Learn more here.