Skip to content

detect_sentiment api has limits of input size of 5kb #299

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ppeiris
Copy link

@ppeiris ppeiris commented Mar 21, 2025

Code has been updated to make sure the api does not failed

Issue #, if available:

When the audio transcribe results are more than 5000 bytes, the detect_sentiment API call fails due to its input limitations
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/comprehend/client/detect_sentiment.html

Description of changes:
Check the input text size to make sure it's within the 5000 bytes limit, and if it exists, then truncate it to use the first 5000 bytes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Code has been updated to make sure the api does not failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant