Skip to content

Commit

Permalink
Feature/similarity score threshold (#127)
Browse files Browse the repository at this point in the history
* remove bm25 query

* understanding queries

* move notebook

* moving notebook to notebooks folder

* setting similar score threshold

* linting

* fixing unit tests

---------

Co-authored-by: nora-errouhly <[email protected]>
Co-authored-by: Tash Boyse <[email protected]>
Co-authored-by: Natasha Boyse <[email protected]>
  • Loading branch information
4 people authored Feb 28, 2025
1 parent 6ebecd4 commit b030950
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion redbox-core/redbox/retriever/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def build_document_query(

return {
"size": ai_settings.rag_k,
"min_score": 0.65,
"query": {
"bool": {
"must": [
Expand All @@ -138,7 +139,7 @@ def build_document_query(
"vector_field": {
"vector": query_vector,
"k": ai_settings.rag_num_candidates,
"boost": ai_settings.knn_boost,
# "boost": ai_settings.knn_boost,
"filter": query_filter,
}
}
Expand Down
4 changes: 2 additions & 2 deletions redbox-core/tests/retriever/test_retriever.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

TEST_CHAIN_PARAMETERS = (
{
"rag_k": 1,
"rag_k": 0,
"rag_num_candidates": 100,
"match_boost": 1,
"knn_boost": 2,
Expand All @@ -19,7 +19,7 @@
"rag_gauss_scale_max": 2.0,
},
{
"rag_k": 2,
"rag_k": 0,
"rag_num_candidates": 100,
"match_boost": 1,
"knn_boost": 2,
Expand Down

0 comments on commit b030950

Please sign in to comment.