Skip to content

[ContentUnderstanding] Add ContentRange samples for document, video, and audio.#48366

Draft
changjian-wang wants to merge 1 commit intomainfrom
changjian-wang/add-contentrange-samples-doc-audio-video
Draft

[ContentUnderstanding] Add ContentRange samples for document, video, and audio.#48366
changjian-wang wants to merge 1 commit intomainfrom
changjian-wang/add-contentrange-samples-doc-audio-video

Conversation

@changjian-wang
Copy link
Member

@changjian-wang changjian-wang commented Mar 11, 2026

This pull request enhances the Azure AI Content Understanding Java SDK samples by adding comprehensive demonstrations of the ContentRange feature. The updates show how to analyze specific parts of documents, images, audio, and video by specifying page or time ranges, both synchronously and asynchronously. This helps users understand how to target analysis to particular sections of their content rather than processing entire files.

Key additions and improvements:

ContentRange usage in binary document analysis:

  • Added examples to Sample01_AnalyzeBinary.java showing how to analyze specific pages or page ranges of a multi-page document using ContentRange methods like pagesFrom, page, pages, and combine. Demonstrates both standard and out-of-range scenarios. [1] [2] [3]

ContentRange usage in asynchronous binary document analysis:

  • Updated Sample01_AnalyzeBinaryAsync.java to include asynchronous demonstrations of ContentRange, using reactive streams to analyze specific pages and combinations of pages in a multi-page document. Includes error handling and sequential chaining of operations. [1] [2] [3]

ContentRange usage in URL-based analysis:

  • Modified Sample02_AnalyzeUrl.java to introduce examples for analyzing specific content ranges in documents, images, audio, and video accessed via URLs, including the necessary imports and method calls. [1] [2] [3]

- Enhance ContentRangeTest with additional unit tests for various scenarios including:
  - Handling same start and end times.
  - Rejecting negative start times.
  - Validating time ranges and content range combinations.

- Update Sample01_AnalyzeBinaryAsyncTest and Sample01_AnalyzeBinaryTest to include tests for analyzing binary documents with page content ranges.

- Introduce new tests in Sample02_AnalyzeUrlAsyncTest and Sample02_AnalyzeUrlTest for analyzing URLs with page and time content ranges, ensuring proper functionality for both document and audio/video analyses.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant