I am trying to retrieve most similar documents based on question and i am getting top_k =5 docs. but, How does similarity_search_with_score() calculate the scores while retrieving the most similar document from embedding.
I want to know the mathematics behind the similarity_search_with_score() method.also need to understand how they re-rank documents based or score.