Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
This package provides a document recognition component that recognizes text from images of documents.
It contains the following classes:
MLDocumentSetting: Provides APIs for setting analyzer parameters.
MLDocument: Provides APIs for obtaining information detected in images of documents.
MLDocumentAnalyzer: Provides APIs for creating analyzers that detect text in images of documents.
| Class name | Class description |
| MLDocument | Represents the document information detected in an image. Two attributes are included: 1. All text content detected in an image; 2. All text blocks detected in an image, including the text content, text block bounding box, and language. |
| MLDocument.Base | Represents the parent class of document information, which is the basic document information detected in an image. Five attributes are included: 1. List of detected languages; 2. Text interval; 3. Corner points of the text bounding box; 4. Detected text content; 5. Confidence of the detection result. |
| MLDocument.Block | Represents a detected text block. Six attributes inherited from Base are included: 1. getLanguageList(): Obtains the language of the text block; 2. getInterval(): Obtains the interval type of the text block; 3. getBorder(): Obtains the text block bounding box; 4. getStringValue(): Obtains text content of the text block; 5. getPossibility(): Obtains the detection result confidence; 6. getSections(): Obtains all sections contained in the text block. |
| MLDocument.Character | Represents a detected character. It is the smallest element that can be identified by the model. Five attributes inherited from Base are included: 1. Character language; 2. Character interval type; 3. Character bounding box; 4. Character content; 5. Confidence of the detection result. |
| MLDocument.Interval | Represents a text interval. Three attributes are included: 1. Space; 2. Newline character; 3. Unknown interval type. |
| MLDocument.Line | Represents a detected line. Seven attributes inherited from Base are included: 1. getLanguageList(): Obtains the language of the line; 2. getInterval(): Obtains the interval type of the line; 3. getBorder(): Obtains the line bounding box; 4. getPoints(): Obtains the corner points of the line bounding box; 5. getStringValue(): Obtains text content of the line; 6. getPossibility(): Obtains the detection result confidence; 7. getWordList(): Obtains all words contained in the line. |
| MLDocument.Section | Represents a detected section. Seven attributes inherited from Base are included: 1. getLanguageList(): Obtains the language of the section; 2. getInterval(): Obtains the interval type of the section; 3. getBorder(): Obtains the section bounding box; 4. getStringValue(): Obtains text content of the section; 5. getPossibility(): Obtains the detection result confidence; 6. getWordList(): Obtains all words contained in the section; 7. getLineList(): Obtains all lines in the section. |
| MLDocument.Word | Represents a detected word. Six attributes inherited from Base are included: 1. getLanguageList(): Obtains the language of the word; 2. getInterval(): Obtains the interval type of the word; 3. getBorder(): Obtains the word bounding box; 4. getStringValue(): Obtains the word content; 5. getPossibility(): Obtains the detection result confidence; 6. getCharacterList(): Obtains all characters contained in the word. |
| MLDocumentAnalyzer | Detects document information (MLDocument) in images of documents by calling the cloud API. An on-device image analyzer can be created in either of the following ways: 1. Default mode: MLAnalyzerFactory.getInstance().getRemoteDocumentAnalyzer(). By default, the system automatically identifies languages without verifying the certificate fingerprint. 2. Customized mode: MLAnalyzerFactory.getInstance().getRemoteDocumentAnalyzer( MLDocumentSetting setting). You can set the languages to be detected and whether to enable certificate fingerprint verification. |
| MLDocumentSetting | Sets the attributes of the document analyzer (MLDocumentAnalyzer). The attributes of the analyzer include: 1. Preset languages: Set languages for the analyzer correctly to ensure fast and accurate detection. 2. Whether to enable certificate fingerprint verification. If this parameter is set to true, only registered apps that pass the verification are allowed to access the cloud API for document detection. 3. Type of the text line bounding box. The value can be NGON or ARC. NGON: Returns the coordinates of the four corner points of the text line bounding box that is a quadrilateral. ARC: Returns the coordinates of up to 72 corner points of the text line bounding box that is a polygon for text in a curved layout. |
| MLDocumentSetting.Factory | Creates an instance of the document analysis configurator to set document detection attributes. |