CaptionResult Class

  • java.lang.Object
    • com.azure.ai.vision.imageanalysis.models.CaptionResult

Implements

public final class CaptionResult
implements JsonSerializable<CaptionResult>

Represents a generated phrase that describes the content of the whole image.

Method Summary

Modifier and Type Method and Description
static CaptionResult fromJson(JsonReader jsonReader)

Reads an instance of CaptionResult from the JsonReader.

double getConfidence()

Get the confidence property: A score, in the range of 0 to 1 (inclusive), representing the confidence that this description is accurate.

String getText()

Get the text property: The text of the caption.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static CaptionResult fromJson(JsonReader jsonReader)

Reads an instance of CaptionResult from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of CaptionResult if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getConfidence

public double getConfidence()

Get the confidence property: A score, in the range of 0 to 1 (inclusive), representing the confidence that this description is accurate. Higher values indicating higher confidence.

Returns:

the confidence value.

getText

public String getText()

Get the text property: The text of the caption.

Returns:

the text value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to