有没有一种方法可以使用AWS理解中的两个经过训练的模型来检测实体



我有两个经过训练的实体识别器模型,它们可以检测不同的实体类型,我已经为这两个模型创建了端点,但我似乎找不到可以实现这两个模式来从简单的字符串文本中检测实体的用法。

一种模型从文本中检测客户(如"耐克"(和其他指标(如"销售额"([如下所示]。

text="find net sales of Nike"
comprehend.detect_entities(Text=text,LanguageCode="en",EndpointArn='arn:aws:comprehend:xyz-1:760825412989:entity-recognizer-endpoint/xyz-1')

有没有一种方法可以在给定的文本上使用端点来实现这两个模型?

理解支持针对每个请求的一个模型进行推理。如果您有多个模型,您可以在lambda中链接推理请求,并按顺序调用这些模型。

使用上面的示例代码:

text="find net sales of Nike"
comprehend.detect_entities(Text=text,LanguageCode="en",EndpointArn='arn:aws:comprehend:region:760825412989:entity-recognizer-endpoint/xyz-1')
comprehend.detect_entities(Text=text,LanguageCode="en",EndpointArn='arn:aws:comprehend:region:760825412989:entity-recognizer-endpoint/xyz-2')

相关内容

最新更新