DocumentLanguage Class

An object representing the detected language for a given text span.

Inheritance
builtins.object
DocumentLanguage

Constructor

DocumentLanguage(**kwargs: Any)

Methods

from_dict

Converts a dict in the shape of a DocumentLanguage to the model itself.

to_dict

Returns a dict representation of DocumentLanguage.

from_dict

Converts a dict in the shape of a DocumentLanguage to the model itself.

from_dict(data: Dict) -> DocumentLanguage

Parameters

Name Description
data
Required

A dictionary in the shape of DocumentLanguage.

Returns

Type Description

DocumentLanguage

to_dict

Returns a dict representation of DocumentLanguage.

to_dict() -> Dict

Returns

Type Description

dict

Attributes

confidence

Confidence of correctly identifying the language.

confidence: float

locale

Detected language code. Value may be an ISO 639-1 language code (ex. "en", "fr") or a BCP 47 language tag (ex. "zh-Hans").

locale: str

spans

Location of the text elements in the concatenated content that the language applies to.

spans: List[DocumentSpan]