简体   繁体   English

调用 DetectPiiEntities 操作时出现 TextSizeLimitExceededException

[英]TextSizeLimitExceededException when calling the DetectPiiEntities operation

I am using aws comprehend for PII redaction, Idea is to detect entities and then redact PII from it.我正在使用 aws comprehend 进行 PII 编辑,想法是检测实体,然后从中编辑 PII。

Now the problem is this API has a Input text size limit.现在的问题是这个 API 有输入文本大小限制。 How can I increase the limit??我怎样才能增加限制? Maybe to 1 MB??也许到 1 MB? Or is there any other way to detect entities for large text.或者是否有任何其他方法来检测大文本的实体。

ERROR : botocore.errorfactory.TextSizeLimitExceededException: An error occurred (TextSizeLimitExceededException) when calling the DetectPiiEntities operation: Input text size exceeds limit. Max length of request text allowed is 5000 bytes while in this request the text size is 7776 bytes错误botocore.errorfactory.TextSizeLimitExceededException: An error occurred (TextSizeLimitExceededException) when calling the DetectPiiEntities operation: Input text size exceeds limit. Max length of request text allowed is 5000 bytes while in this request the text size is 7776 bytes botocore.errorfactory.TextSizeLimitExceededException: An error occurred (TextSizeLimitExceededException) when calling the DetectPiiEntities operation: Input text size exceeds limit. Max length of request text allowed is 5000 bytes while in this request the text size is 7776 bytes

There's no way to increase this limit.没有办法增加这个限制。 For input text greater than 5000 bytes, you can split the text into multiple chunks of 5000 bytes each and then aggregate the results back.对于大于 5000 字节的输入文本,您可以将文本拆分为多个块,每个块 5000 字节,然后将结果聚合回来。 Please do mind that you keep some overlap between different chunks, to carry over some context from previous chunk.请注意,您在不同的块之间保留一些重叠,以继承前一个块的一些上下文。

For reference you can use similar solution exposed by Comprehend team itself.作为参考,您可以使用 Comprehend 团队本身公开的类似解决方案。 https://github.com/aws-samples/amazon-comprehend-s3-object-lambda-functions/blob/main/src/processors.py#L172 https://github.com/aws-samples/amazon-comprehend-s3-object-lambda-functions/blob/main/src/processors.py#L172

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 调用 PutSubscriptionFilter 操作时发生错误(InvalidParameterException) - An error occurred (InvalidParameterException) when calling the PutSubscriptionFilter operation 调用 DescribeTaskDefinition 操作时发生错误(ClientException) - An error occurred (ClientException) when calling the DescribeTaskDefinition operation 调用 DescribeLaunchTemplates 操作时发生错误(UnauthorizedOperation)? - An error occurred (UnauthorizedOperation) when calling the DescribeLaunchTemplates operation? 调用 ImportImage 操作时的 AWS InvalidParameter - AWS InvalidParameter when calling the ImportImage operation 调用 UploadServerCertificate 操作时发生客户端错误(SignatureDoesNotMatch) - A client error (SignatureDoesNotMatch) occurred when calling the UploadServerCertificate operation 调用HeadObject操作时出现错误(404):Key“”不存在 - An error occurred (404) when calling the HeadObject operation: Key "" does not exist AWS boto3 - 调用 GetObject 操作时出现 InvalidToken 错误 - AWS boto3 - InvalidToken Error when calling the GetObject operation SageMaker Endpoint:调用 InvokeEndpoint 操作时 ServiceUnavailable 503 - SageMaker Endpoint: ServiceUnavailable 503 when calling the InvokeEndpoint operation ClientError:调用HeadObject操作时发生错误(403):尝试上传视频时被禁止 - ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden when trying to upload video 使用批处理作业时“调用 ListObjectsV2 操作时发生错误 (AccessDenied):访问被拒绝” - "An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied" when using batch jobs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM