從音訊與影像中擷取資訊

已完成

小提示

有關更多詳細信息,請參閱 文本和圖像 選項卡!

商業資訊越來越多地以多媒體格式呈現,如音訊和影片檔案。 例如,企業常會錄音通話以便日後分析。 視訊會議的發展意味著有用的資訊常常會在錄音或錄影的會議中被記錄。 Azure 內容理解支援音訊與視訊資料擷取與分析。

從音訊中擷取結構化資料

你可以使用 Azure Content Understanding 從音訊檔案中提供轉錄、摘要及其他關鍵見解。

假設您想要讓 AI 摘要您的語音信箱。 您可以定義要從每個記錄呼叫擷取之重要深入解析的架構,如下所示:

  • 來電者
  • 訊息摘要
  • 要求的動作
  • 回撥號碼
  • 替代聯絡方式

現在假設來電者會留下下列語音訊息:

Hi, this is Ava from Contoso.

Just calling to follow up on our meeting last week.

I wanted to let you know that I've run the numbers and I think we can meet your price expectations.

Please call me back on 555-12345 or send me an e-mail at Ava@contoso.com and we'll discuss next steps.

Thanks, bye!

使用 Azure Content Understanding 分析音訊錄音並套用你的結構,會產生以下結果:

  • 來電者:Contoso 的 Ava
  • 訊息摘要:Contoso 的 Ava 打電話對會議進行後續追蹤,並提到他們可以符合價格期望。 他們要求回電或寄電子郵件討論下一步。
  • 要求的動作:回呼或傳送電子郵件來討論後續步驟。
  • 回呼號碼:555-12345
  • 替代聯絡人詳細資料: Ava@contoso.com

在 Foundry 入口網站分析音訊

與文件分析一樣,在 新的 Foundry 入口網站中使用內容理解,是快速驗證分析器是否回傳預期欄位的方法,然後再自動化程式碼工作流程。

在入口網站中,你可以:

  • 選擇音訊或影像分析儀,並於媒體檔案上執行。
  • 檢閱輸出,例如轉錄文字 (適用於音訊) 與根據您結構描述擷取的深入解析。
  • 查看回傳的 JSON 結果 ,以便在下游系統中進一步處理。

讓我們來看看如何利用內容理解來分析通話錄音。 與其聽完整通電話,你可以使用預設的音訊分析器從音訊中提取資訊。 分析完成後,你可以看到通話的書面逐字稿。

新版 Foundry 入口網站的截圖,其中的音訊已使用 Azure Content Understanding 分析。

在回傳的結果中,你可以看到通話的具體資訊。 與其他內容理解分析器一樣,結果以 JSON 格式進行後續處理。

新 Foundry 入口網站的截圖,音訊會被分析並回傳 JSON 檔案。

從影片中擷取結構化資料

Azure Content Understanding 也支援影片分析。 例如,你可以分析錄影視訊會議,擷取出席情況、地點及其他資訊。

我們先來看會議室攝影機拍攝的一張影像。 假設你定義了以下模式:

  • 地點
  • 親自出席者
  • 遠端出席者
  • 出席者總數

你可以使用 Azure Content Understanding 分析會議室攝影機的影像:

會議室中一個人的照片,他正在與三位遠端參加者通話。

在將結構套用到映像後,Azure Content Understanding 回傳了結構化資料:

  • 位置:會議室
  • 親自出席者:1
  • 遠端出席者:3
  • 出席者總數:4

考慮你可能為會議錄影的架構加入什麼。 你可以包含不同時間間隔的出席人數、通話中發言者及其內容的詳細資料、討論摘要,以及會議中分配的行動清單。

建立帶有音訊或視訊分析器的用戶端應用程式

若要程式化分析音訊或影片,你可以使用 Content Understanding API 建立輕量級客戶端應用程式。

讓我們來看看使用 Python SDK 的範例。 當你執行以下程式碼時,它會用預先建構的分析器分析音訊檔案。 預建分析儀被識別為 prebuilt-audioSearch。

import os
from azure.ai.contentunderstanding import ContentUnderstandingClient
from azure.core.credentials import AzureKeyCredential

# Endpoint and key for your Foundry resource
endpoint = os.environ["FOUNDRY_ENDPOINT"]  # e.g., "https://<resource>.services.ai.azure.com/"
key = os.environ["FOUNDRY_KEY"]

client = ContentUnderstandingClient(
    endpoint=endpoint,
    credential=AzureKeyCredential(key)
)

# Choose a prebuilt analyzer for audio
# (The documents module lists examples like prebuilt-audioSearch / prebuilt-videoSearch.)
analyzer_id = "prebuilt-audioSearch"

# Provide an input audio file (URL shown here; you can swap in your own accessible media URL)
inputs = [
    {"url": "https://<your-host>/samples/voicemail.wav"}
]

# Start analysis (asynchronous long-running operation)
poller = client.begin_analyze(analyzer_id=analyzer_id, inputs=inputs)

# Wait for completion (SDK polls under the hood)
result = poller.result()

# Inspect the structured output (JSON-like objects)
for content in result.contents:
    # Some analyzers may return a transcript and/or extracted fields depending on the analyzer and schema
    print("=== MARKDOWN / TRANSCRIPT (if provided) ===")
    print(getattr(content, "markdown", None))

    print("\n=== EXTRACTED FIELDS ===")
    print(getattr(content, "fields", None))

在 Microsoft Foundry 中結合內容理解的音訊與影片分析,開啟了多種機會,讓你能釋放任何格式的商業數據潛力。 接著,自己試試內容理解。