This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchQ.filter = filter; | |
} | |
else if(beds || rooms) { | |
let filter = { "$and" : []} | |
if (beds) { | |
filter.$and.push({"beds" : {"$gte" : parseInt(beds) }}) | |
} | |
if (rooms) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$vectorSearch:{ | |
"index": "default", | |
"queryVector": embedding, | |
"path": "doc_embedding", | |
"k": 100, | |
"numCandidates": 1000 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{$vectorSearch:{ | |
"index": "default", | |
"queryVector": embedding, | |
"path": "doc_embedding", | |
"filter" : { "$and" : [{"beds": {"$gte" : 1}} , "score": {"$gte" : 91}}]}, | |
"k": 100, | |
"numCandidates": 1000 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$vectorSearch": { | |
"index":"default", | |
"queryVector": vector_query, | |
"path": "embedding", | |
"limit": 5, | |
"numCandidates": 50 | |
} | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "vectorSearch, | |
"fields": [{ | |
"path": "embedding", | |
"dimensions": 768, # the dimension of `mpnet-base` model | |
"similarity": "euclidean", | |
"type": "vector" | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "vectorSearch, | |
"fields": [{ | |
"path": "embedding", | |
"dimensions": 1536, | |
"similarity": "cosine", | |
"type": "vector" | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "vectorSearch, | |
"fields": [{ | |
"path": "plot_embedding_hf", | |
"dimensions": 384, | |
"similarity": "dotProduct", | |
"type": "vector" | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "vectorSearch, | |
"fields": [{ | |
"path": "plot_embedding", | |
"dimensions": 1536, | |
"similarity": "cosine", | |
"type": "vector" | |
}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$search": { | |
"index":'1M_sphere_index', | |
"knnBeta": { | |
"path": "vector", | |
"vector": embedding.tolist(), | |
"k": k * multiplier, | |
# "filter":{ | |
# "equals":{ | |
# "path":"low_card", | |
# "value":1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compute_overlap(exact_result_set: List, approx_result_set: List) -> float: | |
# each result set is a list of urls, order not considered | |
return len(exact_result_set.intersection(set(approx_result_set)) / len(set(exact_result_set)) |
NewerOlder