Description
Hello
i am trying to get the similarity score on the search result
below is the result fetching structure
~~~
result = collection.query.near_text(
query=query,
limit=3, # number of results
return_properties=\["chunk", "page", "source"\],
distance=True
)
)
for obj in result.objects:
score = obj.metadata.score
print(score)
~~~
but the score return None
My need to get the score on result to determine if the score is good enough to feed into the LLM/Prompting
Any help?
Umesh_Narayanan:
Hello
i am trying to get the similarity score on the search result
below is the result fetching structure
result = collection.query.near_text(
```
query=query,
limit=3, # number of results
return_properties=\["chunk", "page", "source"\],
distance=True
```
)
)
for obj in result.objects:
```
score = obj.metadata.score
print(score)
```
but the score return None
My need to get the score on result to determine if the score is good enough to feed into the LLM/Prompting
Any help?
Hi @Umesh_Narayanan ,
Good Day!
Welcome to Weaviate Community!
As you are using near_text or pure vector searching, the result will include a distance value, not a score. If you would like to obtain score as a result, this is available when using hybrid search or BM25
See related post here
Hope this helps.