如何在没有事先语音注册的情况下使用 Microsoft 语音转文本进行说话者识别(分类)?

问题描述 投票:0回答:3

在我的应用程序中,我需要记录人与人之间的对话,而物理工作流程中没有空间对每个人的声音进行 20 秒的采样来训练识别器,也没有要求每个人读取预设的密码短语训练。但据我所知,如果不这样做,就无法识别说话者。

有没有什么方法可以只记录 5 个人的讲话,然后让识别器自动将返回的文本分类为属于 5 个不同的人之一,而无需事先进行训练?

(无论如何,IBM Watson 可以做到这一点,尽管在我的测试中它做得不太准确。)

speech-to-text azure-cognitive-services microsoft-speech-platform
3个回答
2
投票

如果我正确理解你的问题,那么对话转录应该是适合你的场景的解决方案,因为如果你没有事先生成用户配置文件,它会将演讲者显示为

Speaker[x]
并迭代每个新演讲者。

用户语音样本是可选的。如果没有这个输入,转录 将显示不同的扬声器,但显示为“Speaker1”、“Speaker2”、 等等,而不是识别为预先注册的特定演讲者姓名。

您可以开始使用实时对话转录快速入门


0
投票

Microsoft Conversation Transcription 处于预览状态,现在针对麦克风阵列设备。因此输入录音应该由麦克风阵列进行录制。如果您的录音来自普通麦克风,则可能无法正常工作,您需要特殊配置。您还可以尝试批量分类,它目前支持离线转录,分类2个说话者,很快就会支持2个以上说话者,可能在这个月。


0
投票

如果您使用 REST API 那么它将很有帮助。 您可以使用“diarizationEnabled”属性为 true 的批量转录,您将只需要使用 1 个通道,并且您还需要提供最小和最大发言者数量(它最多可以识别 36 个发言者)。也使用 3.1 版本而不是 3.0 的 REST API

我是如何使用它的:

url = f'{<speech_resourse_endpoint>}/speechtotext/v3.0/transcriptions'
data = {
    'displayName': 'name that you would like for transcription',
    "description": "Description of your task",
    'locale': 'en-US',
    'contentUrls': [<audio_url>],
    'properties': {
        'diarizationEnabled': True,
        'wordLevelTimestampsEnabled': True,
        "displayFormWordLevelTimestampsEnabled": True,
        "channels": [0],
        "diarization": {
          "speakers": {
            "minCount": 1,
            "maxCount": 20
          }
        }
        
    },
    "languageIdentification": {
        "candidateLocales": ["en-US","en-CA"],
    },
    "customProperties": {}
}

# intializer of transcription process
response = requests.post(url, headers=headers, json=data)

# Get the URL of the transcription status and output files  
self_url = response.json()['self']  
print(self_url)
files_url = response.json()['links']['files']

status = ""  
while status != "Succeeded":  
    # Send a GET request to get the transcription status  
    response = requests.get(self_url, headers=headers)  
    status = response.json()['status']
    print(f"Transcription status: {status}")  
    time.sleep(2)

#request to access list of files
response = requests.get(files_url, headers=headers)

response_json = response.json()

file_url = response_json["values"][0]["links"]["contentUrl"]
print(f"file_url = {file_url}")

转到打印的“file_url”,在名为“recognizedPhrases”的字段中,您将看到已识别说话者的短语

示例输出:

{


"source": "-----",
  "timestamp": "2023-10-16T18:13:54Z",
  "durationInTicks": 4697600000,
  "duration": "PT7M49.76S",
  "combinedRecognizedPhrases": [
    {
      "channel": 0,
      "lexical": "....whole transcription....",
      "itn": ".....whole transcription....",
      "display": ".....whole transcription...."
    }
  ],
  "recognizedPhrases": [
    {
      "recognitionStatus": "Success",
      "channel": 0,
      "speaker": 1,
      "offset": "PT0.72S",
      "duration": "PT19.28S",
      "offsetInTicks": 7200000.0,
      "durationInTicks": 192800000.0,
      "nBest": [
        {
          "confidence": 0.27163595,
          "lexical": "----phrash----",
          "itn": "-----phrase---",
          "maskedITN": "-----phrase----",
          "display": "-----phrase----"
    },...]

      
© www.soinside.com 2019 - 2024. All rights reserved.