Browse our Products

Aspose.OCR for Python via .NET 25.3.0 - Release Notes

What was changed

KeySummaryCategory
OCRNET‑87Added automatic detection of image language, supporting: English (Latin), Cyrillic, Arabic, Chinese, Japanese, Korean, Hindi, Tamil, Telugu, and Kannada.New feature

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for Python via .NET 25.3.0 that may affect the code of existing applications.

Added public APIs:

The following public APIs have been introduced in this release:

DetectedLanguage

This class is responsible for storing the detected language.

PropertyTypeDescription
languageLanguageDetected language
accuracyfloatThe confidence level of the language detection, which can be used to assess the accuracy.

LanguageDetectionOutput class

This class stores the results of language detection.

PropertyTypeDescription
sourcestringThe full path or URL of the source file. If the file is provided as a MemoryStream object, an array of pixels, or a Base64 string, this value will be empty.
pageintPage number. When working with single-page images, this value is always 0.
languagesArrayLists the languages (DetectedLanguage) detected in the image along with their probabilities.

detect_languages method

Identify languages on the images provided in OcrInput object and return them as an array of LanguageDetectionOutput objects.

Updated public APIs:

No changes.

Removed public APIs:

No changes.

Examples

The code samples below illustrate the changes introduced in this release:

Detect languages on the image

# Instantiate Aspose.OCR API
api = AsposeOcr()
# Add image to the recognition batch
input = OcrInput(InputType.SINGLE_IMAGE)
input.add("source.png")
# Detect languages
result = api.detect_languages(input)
for lang in result[0].languages:
    print(lang.language)
    print(lang.accuracy)