【问题标题】:TextSizeLimitExceededException when calling the DetectPiiEntities operation调用 DetectPiiEntities 操作时出现 TextSizeLimitExceededException
【发布时间】:2022-03-07 15:59:33
【问题描述】:

我正在使用 aws comprehend 进行 PII 编辑,想法是检测实体,然后从中编辑 PII。

现在的问题是这个 API 有输入文本大小限制。如何提高限​​额??也许到 1 MB ??或者有没有其他方法可以检测大文本的实体。

错误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

【问题讨论】:

  • 这方面有什么更新吗?

标签: amazon-web-services nlp entity amazon-comprehend


【解决方案1】:

无法提高此限制。 对于大于 5000 字节的输入文本,您可以将文本拆分为多个 5000 字节的块,然后将结果聚合回来。 请注意,您在不同的块之间保留一些重叠,以便从前一个块中继承一些上下文。

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

【讨论】:

    猜你喜欢
    • 2020-06-08
    • 2011-11-02
    • 2019-04-22
    • 2020-12-11
    • 1970-01-01
    • 2012-06-25
    • 1970-01-01
    • 1970-01-01
    • 2020-08-09
    相关资源
    最近更新 更多