Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for filter out AWS Kendra search by score confidence #12920

Merged
merged 35 commits into from
Mar 8, 2024

Conversation

Smit-Parmar
Copy link
Contributor

@Smit-Parmar Smit-Parmar commented Nov 6, 2023

Description: It will add support for filter out kendra search by score confidence which will make result more accurate.
For example

retriever = AmazonKendraRetriever(
     index_id=kendra_index_id, top_k=5, region_name=region,
     score_confidence="HIGH"
 )

Result will not include the records which has score confidence "LOW" or "MEDIUM".
Relevant docs
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/query.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/retrieve.html

Issue: the issue # it resolve #11801
twitter: @SmitCode

Copy link

vercel bot commented Nov 6, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Mar 6, 2024 5:34pm

@dosubot dosubot bot added 🤖:improvement Medium size change to existing code to handle new use-cases 🔌: aws Primarily related to Amazon Web Services (AWS) integrations labels Nov 6, 2023
@baskaryan
Copy link
Collaborator

cc @3coins

@eyurtsev eyurtsev self-assigned this Nov 6, 2023
@Smit-Parmar
Copy link
Contributor Author

@eyurtsev Please review.

Copy link
Collaborator

@eyurtsev eyurtsev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, included minor nits.

libs/langchain/langchain/retrievers/kendra.py Outdated Show resolved Hide resolved
libs/langchain/langchain/retrievers/kendra.py Outdated Show resolved Hide resolved
libs/langchain/langchain/retrievers/kendra.py Outdated Show resolved Hide resolved
@eyurtsev
Copy link
Collaborator

@3coins let us know if you want to review prior to merge. Will merge as soon as nits are resolved

@Smit-Parmar
Copy link
Contributor Author

@eyurtsev Please review.

Copy link
Contributor

@3coins 3coins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Smit-Parmar
Thanks for adding this change. Few minor comments, looks good otherwise.

libs/langchain/langchain/retrievers/kendra.py Outdated Show resolved Hide resolved
libs/langchain/langchain/retrievers/kendra.py Outdated Show resolved Hide resolved
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 13, 2023
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Dec 13, 2023
@hwchase17 hwchase17 closed this Jan 30, 2024
@baskaryan baskaryan reopened this Jan 30, 2024
@shabie
Copy link

shabie commented Mar 2, 2024

When will it get merged?

@Smit-Parmar
Copy link
Contributor Author

@eyurtsev @baskaryan @hwchase17 Please review.

@baskaryan baskaryan merged commit aed46cd into langchain-ai:master Mar 8, 2024
59 checks passed
bechbd pushed a commit to bechbd/langchain that referenced this pull request Mar 29, 2024
…core confidence (langchain-ai#12920)

**Description:** It will add support for filter out kendra search by
score confidence which will make result more accurate.
    For example
   ```
retriever = AmazonKendraRetriever(
        index_id=kendra_index_id, top_k=5, region_name=region,
        score_confidence="HIGH"
    )
```
Result will not include the records which has score confidence "LOW" or "MEDIUM". 
Relevant docs 
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/query.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/retrieve.html

 **Issue:** the issue # it resolve langchain-ai#11801 
**twitter:** [@smitcode](https://twitter.com/SmitCode)
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
…core confidence (langchain-ai#12920)

**Description:** It will add support for filter out kendra search by
score confidence which will make result more accurate.
    For example
   ```
retriever = AmazonKendraRetriever(
        index_id=kendra_index_id, top_k=5, region_name=region,
        score_confidence="HIGH"
    )
```
Result will not include the records which has score confidence "LOW" or "MEDIUM". 
Relevant docs 
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/query.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/retrieve.html

 **Issue:** the issue # it resolve langchain-ai#11801 
**twitter:** [@smitcode](https://twitter.com/SmitCode)
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
…core confidence (#12920)

**Description:** It will add support for filter out kendra search by
score confidence which will make result more accurate.
    For example
   ```
retriever = AmazonKendraRetriever(
        index_id=kendra_index_id, top_k=5, region_name=region,
        score_confidence="HIGH"
    )
```
Result will not include the records which has score confidence "LOW" or "MEDIUM". 
Relevant docs 
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/query.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/kendra/client/retrieve.html

 **Issue:** the issue # it resolve #11801 
**twitter:** [@smitcode](https://twitter.com/SmitCode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: aws Primarily related to Amazon Web Services (AWS) integrations 🤖:improvement Medium size change to existing code to handle new use-cases size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for AWS Kendra ScoreConfidence filter.
6 participants