public BatchResponse sendBatchRequest()

in source/src/main/java/com/amazonaws/comprehend/esproxy/lambda/processor/operations/DetectEntities.java [66:83]


    public BatchResponse sendBatchRequest(@NonNull final List<BatchFieldLocator> fieldLocatorList,
                                          @NonNull final List<String> contentList,
                                          @NonNull final LanguageCode languageCode,
                                          @NonNull final AmazonComprehend comprehendClient) {
        BatchDetectEntitiesRequest request
                = new BatchDetectEntitiesRequest().withTextList(contentList).withLanguageCode(languageCode.toString());
        BatchDetectEntitiesResult batchDetectEntitiesResult = comprehendClient.batchDetectEntities(request);

        List<JSONObject> flattenedEntityList = new ArrayList<>();
        for (BatchDetectEntitiesItemResult resultItem : batchDetectEntitiesResult.getResultList()) {
            flattenedEntityList.add(flattenEntityList(resultItem.getEntities()));
        }

        return new BatchResponse<>(
                fieldLocatorList,
                batchDetectEntitiesResult.getResultList(),
                batchDetectEntitiesResult.getErrorList(), flattenedEntityList);
    }