回答此问题可获得 20 贡献值,回答如果被采纳可获得 50 分。
<p>我正在尝试将Azure语音到文本转录服务(json)的输出转换为pd数据帧</p>
<p>以下是获得的json示例:</p>
<pre><code>{
"source": "https://batchtranscriptionstore1.blob.core.windows.net/recordings/20210221-1022043b576ef4.wav?fakecredentials123456789",
"timestamp": "2020-06-16T09:30:21Z",
"durationInTicks": 41200000,
"duration": "PT4.12S",
"combinedRecognizedPhrases": [
{
"channel": 0,
"lexical": "hello world",
"itn": "hello world",
"maskedITN": "hello world",
"display": "Hello world."
}
],
"recognizedPhrases": [
{
"recognitionStatus": "Success",
"speaker": 1,
"channel": 0,
"offset": "PT0.07S",
"duration": "PT1.59S",
"offsetInTicks": 700000,
"durationInTicks": 15900000,
"nBest": [
{
"confidence": 0.898652852,
"lexical": "hello world",
"itn": "hello world",
"maskedITN": "hello world",
"display": "Hello world.",
"words": [
{
"word": "hello",
"offset": "PT0.09S",
"duration": "PT0.48S",
"offsetInTicks": 900000,
"durationInTicks": 4800000,
"confidence": 0.987572
},
{
"word": "world",
"offset": "PT0.59S",
"duration": "PT0.16S",
"offsetInTicks": 5900000,
"durationInTicks": 1600000,
"confidence": 0.906032
}
]
}
]
}
]
}
</code></pre>
<p>使用下面的代码,我成功地用以下列创建了一个df:<code>source</code>,<code>timestamp</code>,<code>durationInTicks</code>,<code>duration</code>,<code>combinedRecognizedPhrases</code></p>
<pre><code>with open('file.json') as json_data:
data = json.load(json_data)
ll = pd.DataFrame(dict(list(data.items())[0:5]))
</code></pre>
<p>但我还需要在单独的列中列出“combinedRecognizedPhrases”的各个值。我该怎么做</p>