Replies: 1 comment
-
🤖 Hello, The error you're encountering is a return VectorStoreQueryResult(
nodes=nodes,
similarities=results["score"].tolist(),
ids=results["id"].tolist(),
) If the 'score' field is not present in the results dataframe, a KeyError will be raised when trying to access To fix this issue, you need to ensure that the 'score' field is included in the results returned by the LanceDB query. If the 'score' field is not available in the LanceDB query results, you may need to calculate it separately or check if there's a different field that represents the score in the results. The 'score' field in the LanceDBVectorStore class in the LlamaIndex codebase is used to store the similarity scores of the query results. When a query is made to the LanceDBVectorStore, it returns a DataFrame of results. Each row in this DataFrame represents a node that matches the query, and the 'score' field in each row represents the similarity score of that node to the query. You can refer to the source code of the I hope this helps! If you have any other questions, feel free to ask. Best, SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Question Validation
Question
File c:\Python311\Lib\site-packages\pandas\core\indexes\base.py:3653, in Index.get_loc(self, key)
3652 try:
-> 3653 return self._engine.get_loc(casted_key)
3654 except KeyError as err:
File c:\Python311\Lib\site-packages\pandas_libs\index.pyx:147, in pandas._libs.index.IndexEngine.get_loc()
File c:\Python311\Lib\site-packages\pandas_libs\index.pyx:176, in pandas._libs.index.IndexEngine.get_loc()
File pandas_libs\hashtable_class_helper.pxi:7080, in pandas._libs.hashtable.PyObjectHashTable.get_item()
File pandas_libs\hashtable_class_helper.pxi:7088, in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'score'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
Cell In[34], line 1
----> 1 response = query_engine.query("What is p53?")
2 print(response)
File c:\Python311\Lib\site-packages\llama_index\indices\query\base.py:23, in BaseQueryEngine.query(self, str_or_query_bundle)
...
3658 # InvalidIndexError. Otherwise we fall through and re-raise
3659 # the TypeError.
3660 self._check_indexing_error(key)
may i know why has this issue when dong indexretive
Beta Was this translation helpful? Give feedback.
All reactions