Class PredictedTagsUtil

java.lang.Object
com.adobe.acs.commons.reports.internal.PredictedTagsUtil

public class PredictedTagsUtil extends Object
  • Field Details

    • MINIMUM_LOWER_CONFIDENCE_THRESHOLD_VALUE

      public static final double MINIMUM_LOWER_CONFIDENCE_THRESHOLD_VALUE
      See Also:
  • Constructor Details

    • PredictedTagsUtil

      public PredictedTagsUtil()
  • Method Details

    • getPredictedTags

      public List<PredictedTag> getPredictedTags(org.apache.sling.api.resource.Resource resource, String relativePropertyPath, Double lowerConfidenceThreshold)
      For the given resource and relative property path: Validate that the resource is an asset, extract all predicted tags below the relative property path, adapt them to PredictedTags and filter out those whose confidence value is lower than the lowerConfidenceThreshold
      Parameters:
      resource - the resource
      relativePropertyPath - the property path of the predicted tags, relative to the resource
      lowerConfidenceThreshold - the lower threshold for confidence values
      Returns:
      the list of predicted tags, sorted (desc) by confidence
    • sortByConfidence

      protected void sortByConfidence(List<PredictedTag> tagList)
      Sort the list of predicted tag sorted by confidence
      Parameters:
      tagList -
    • resolveToAsset

      public com.day.cq.dam.api.Asset resolveToAsset(org.apache.sling.api.resource.Resource resource)
      Resolve the resource to an asset. Return null if the resource cannot be resolved to an asset
      Parameters:
      resource - the resource
      Returns:
      the resource as asset. Return null if the resource cannot be resolved to an asset
    • getPredictedTagsResource

      protected org.apache.sling.api.resource.Resource getPredictedTagsResource(org.apache.sling.api.resource.Resource resource, com.day.cq.dam.api.Asset asset, String relativePropertyPath)
    • validateLowerConfidenceThreshold

      protected double validateLowerConfidenceThreshold(Double lowerConfidenceThresholdValue)
      Validate and return lower confidence threshold. Value must be a double and not less than 0.0
      Parameters:
      lowerConfidenceThresholdValue - the input threshold value
      Returns:
      the validated lower confidence threshold