實際影片長度:8:41.000。原文、繁中、雙語可點擊句子跳轉影片。
0:00.240–0:05.920
Can the open AI whisper model dostreaming ASR? My name is Bai. I'm a
0:05.920–0:12.000
chine learning engineer and a PhD inatural language processing. And today Iwill answer this question. So if you
0:12.000–0:19.840
haven't seen the whisper model, it is aspeechtoext model. It is trained onabout 100 languages on 680,000 hours of
0:19.840–0:27.279
data. The model architecture is aencoder decoder transformer model and itcomes in five different sizes and it is
0:27.279–0:33.520
growing in popularity recently becauseit is robust to noise and accents. Sothe question of the day is can this
0:33.520–0:40.320
model do streaming speech recognition.So first of all what do we mean bystreaming ASR? Well, automated speech
0:40.320–0:46.320
recognition can come in two forms batchand streaming. Batch means that themodel needs to take a bunch of speech
0:46.320–0:57.680
and produce a bunch of text. Butstreaming ASR is when the model needs toproduce an output as the speaker isaying things with a delay of not more
0:57.680–1:04.960
than a few seconds. So for example, ifyou're listening to a live broadcast,you don't want to first record the
1:04.960–1:12.400
ntire broadcast and then produce thesubtitles, you want it to appear at mosta few seconds after it is said. And
1:12.400–1:19.840
generally you'll expect streaming ASR tobe a few percentage points loweraccuracy than batch ASR because the
1:19.840–1:27.040
model does not have access to all thecontext only the point up until thecurrent word. The question of how to do
1:27.040–1:35.840
streaming ASR came up when I wasbuilding the voice writer. This is an AIwriting assistant that works in twosteps. In the first step, you just speak
1:35.840–1:41.680
your thoughts without worrying too muchabout the grammar. And in the secondstep, the AI corrects the grammar for
1:41.680–1:47.920
you. I've been finding it super helpfulfor writing all kinds of things,including emails, blog posts, and Slack
1:47.920–1:54.560
messages. You can try it out for free inthe link here. And I'll also post a linkin the description of the video. Now,
1:54.560–1:59.600
back to the video. First of all, why isthis even difficult? Why is it not so
1:59.600–2:04.719
easy to use the Whisper model forstreaming ASR? The issue is Whisper is
2:04.719–2:12.640
trained to process input audio of 30seconds long. If the audio is less than30 seconds, you can pad it to be longer.
2:12.640–2:20.080
So, this is not too much of a problem.But what if your audio is longer than 30seconds? There is no way to feed into
2:20.080–2:26.560
Whisper anything longer than 30 seconds.So, the first thing you might think ofis what if you just split it up into
2:26.560–2:33.680
chunks of 30 seconds at a time andprocess each chunk one at a time. Well,the first problem is you might split it
2:33.680–2:42.160
in the middle of the word. Like if yousplit it while in the middle of theword, this word will probably not berecognized correctly. The second problem
2:42.160–2:49.120
is the latency will be really high. Soimagine if you're processing audio,you're waiting for audio to fill up
2:49.120–2:57.519
these 30 seconds and only then will youprocess this entire chunk and then thelatency um for for the first word will
2:57.519–3:05.120
be up to 30 seconds. Fortunately, thereis an open source report called WhisperStreaming that does this for you and it
3:05.120–3:13.519
urns the Whisper model into a streamingASR system. There are instructions onhow to set this up. So, let's try it
3:13.519–3:21.120
out. So, I run this command to start amodel running um it's using a whispersmall model and then I go to this tab
3:21.120–3:30.000
and run another command and I just startspeaking. So you can pretty quickly seethat it's um picking it up and it's
3:30.000–3:37.519
pretty quick and responsive and it evengives timestamps. So um it's pretty cooldemo. Um now let's talk about how this
3:37.519–3:46.319
works. So we start with this audio fileand what we do is we feed chunks ofincreasing size into whisper. The size
3:46.319–3:54.879
of these chunks is configured by theminimum chunk size parameter which bydefault is 1 second. So in eachiteration, we increase the size of this
3:54.879–4:02.560
buffer by 1 second and feed all of itinto whisper. And this process continuesuntil we hit a end of sentence marker
4:02.560–4:09.680
like a period or a question mark. Thenwe move the buffer forward and start theprocess again. So each piece of audio is
4:09.680–4:16.079
processed by whisper multiple times asmany times as it takes until we hit thend of the sentence. The reasons for
4:16.079–4:22.960
this is whisper is trained on sentences.So, it gives the best result when thestart of the audio aligns with the start
4:22.960–4:29.680
of a sentence. And that's why the bufferonly moves forward when the previousentence is complete and we're beginning
4:29.680–4:35.520
a new sentence. This way, Whisper neverneeds to start transcribing from themiddle of a sentence, which would give
4:35.520–4:42.320
suboptimal results. In manyapplications, it is useful to have someresults available as soon as possible,
4:42.320–4:48.960
even if they're not completely accurate.In the voice writer, I am showing theincomplete results in gray whereas the
4:48.960–4:57.120
confirmed results are in black. Thedifference is the gray part of thesentence is unconfirmed. So it maychange as the model gets new
4:57.120–5:07.520
information. But the black part is theconfirmed results and they arepermanent. How this works is using analgorithm called local agreement with n
5:07.520–5:14.720
equals 2. This means that for a token tobe confirmed, it needs to be generatedin two consecutive audio buffers. Let's
5:14.720–5:22.320
give an example. Let's say in the firstep, the worst per model outputs thethree tokens if you like and nothing is
5:22.320–5:28.960
confirmed at this step. In the secondstep, the model produces more tokens,but only the first two tokens agree with
5:28.960–5:36.000
e previous step. So those two areconfirmed. In the third and the fourthsteps, more tokens are generated. But at
5:36.000–5:44.320
each step, it does not confirm anytokens until it is at least generated intwo consecutive chunks. So anything in
5:44.320–5:53.280
the gray part is possible to change andgiven new information. For example, theword view might change to video once the
5:53.280–6:00.160
model hears the rest of the sentence.But anything in the black part ispermanent. So even if the model wants to
6:00.160–6:07.120
change it to something else after moreiterations it cannot be changed anymore.One last thing that this model does when
6:07.120–6:15.039
it generates a new sentence is it feedsthe previous sentence into the model asprompt tokens. So this is something that
6:15.039–6:22.000
you can do in the whisper format is youcan give it a bunch of prompt tokensbefore you start generating and this
6:22.000–6:28.720
tends to improve the accuracy a littlebit because more context is always good.So in summary, the algorithm can be
6:28.720–6:37.360
summarized in three basic ideas. Thefirst idea is we feed longer and longerconsecutive audio buffers into whisper
6:37.360–6:45.280
and then we emit tokens as soon asthey're confirmed by two iterations. Andfinally, we scroll forward the audio
6:45.280–6:52.400
buffer whenever a sentence is completed.So, it's a pretty simple algorithm thatyou can apply to any speech to text
6:52.400–6:58.720
model that does not support streamingand basically turn it into a streamingmodel. If you like, you can check out
6:58.720–7:05.039
all the details in this paper, whichI'll link in the description. One of thelimitations comes from the fact that
7:05.039–7:12.479
whisper was not really designed to be astreaming model. And because of this, itassumes that each audio buffer has to
7:12.479–7:18.400
start at the beginning of a sentence.Therefore, if you have a sentence thatis quite long, then the beginning of the
7:18.400–7:27.280
sentence has to be fed into the modeland processed many times. This isinefficient and not necessary if themodel was trained from the beginning to
7:27.280–7:36.080
do streaming ASR. Now, if we look at anarchitecture that was designedspecifically to do streaming speechrecognition, it looks a little bit
7:36.080–7:46.319
different. Here is a model that wasproposed in 2021. At each step, itpredicts a token and it has access to afixed amount of past context and future
7:46.319–7:53.199
context. During training, this rule isenforced by having an intention maskthat is mostly zeros, meaning that the
7:53.199–8:00.080
model cannot use information that isoutside of this fixed window. And duringprediction, the model predicts a token
8:00.080–8:07.360
given a limited amount of fixed context.To make the next prediction, the entireceptive field moves forward by one
8:07.360–8:13.759
chunk, but the size of the receptivefield is fixed. This way, the beginningof the sentence will not be processed
8:13.759–8:20.240
multiple times. However, this is notpossible with the whisper model becauseit requires modifying the architecture
8:20.240–8:26.560
and retraining the model and we do nothave access to whisper's training data.That's it for this video and I hope you
8:26.560–8:33.279
enjoyed my explanation of how Whispercan be turned into a streaming model. Ifyou enjoyed this video, please leave a
8:33.279–8:41.000
comment, hit the subscribe button, andring the bell icon to stay notified whenI release future videos. Goodbye.
0:00.240–0:05.920
開放式AI的Whisper模型能進行串流語音辨識嗎?我叫白,是一名
0:05.920–0:12.000
機器學習工程師,擁有自然語言處理博士學位。今天我將回答這個問題。所以如果你
0:12.000–0:19.840
還沒看過Whisper模型,它是一個語音轉文字模型。它是在約100種語言、68萬小時的
0:19.840–0:27.279
數據上訓練而成的。模型架構是編碼器-解碼器Transformer模型,它有五種不同的尺寸,最近
0:27.279–0:33.520
因為對噪音和口音具有魯棒性而日益受歡迎。所以今天的问题是,這個
0:33.520–0:40.320
模型能進行串流語音辨識嗎?首先,什麼是串流語音辨識?自動語音
0:40.320–0:46.320
辨識可以分為兩種形式:批次和串流。批次意味著模型需要接收一堆語音
0:46.320–0:57.680
並產生一堆文字。但串流語音辨識是指模型需要在說話者說話的同時產生輸出,延遲不超過
0:57.680–1:04.960
幾秒鐘。例如,如果你正在收聽現場直播,你不想先錄下整場
1:04.960–1:12.400
直播再產生字幕,你希望它在說出的幾秒後就出現。而且
1:12.400–1:19.840
通常你會預期串流語音辨識的準確率比批次語音辨識低幾個百分點,因為
1:19.840–1:27.040
模型無法取得所有上下文,只能取得直到當前詞彙為止的點。關於如何進行
1:27.040–1:35.840
串流語音辨識的問題,是在我開發Voice Writer時出現的。這是一個AI
1:35.840–1:41.680
寫作助手,分兩步運作。第一步,你只需說出你的想法,不用太擔心
1:41.680–1:47.920
語法。第二步,AI會幫你修正語法。我發現它對撰寫各種內容都非常有幫助,
1:47.920–1:54.560
包括電子郵件、部落格文章和Slack訊息。你可以透過這裡的連結免費試用。我也會在影片描述中附上連結。現在,
1:54.560–1:59.600
回到影片。首先,為什麼這很困難?為什麼不容易
1:59.600–2:04.719
使用Whisper模型進行串流語音辨識?問題在於Whisper是
2:04.719–2:12.640
為了處理長達30秒的輸入音訊而訓練的。如果音訊少於30秒,你可以填充使其更長。
2:12.640–2:20.080
所以,這不算太大問題。但如果你的音訊超過30秒怎麼辦?無法將
2:20.080–2:26.560
超過30秒的內容輸入Whisper。所以,你可能會想到的第一件事是,如果將其分割成
2:26.560–2:33.680
每次30秒的區塊並逐一處理每個區塊會怎樣?嗯,第一個問題是你可能會在
2:33.680–2:42.160
單字中間分割。例如,如果你在單字中間分割,這個單字可能無法被正確辨識。第二個問題
2:42.160–2:49.120
是延遲會非常高。所以想象一下,如果你正在處理音訊,你需要等待音訊填滿
2:49.120–2:57.519
這些 30 秒的片段,然後才處理整個片段,接著延遲對於第一個單詞來說
2:57.519–3:05.120
可能會高達30秒。幸運的是,有一個開源報告稱為WhisperStreaming,它可以為你完成這項工作,並將
3:05.120–3:13.519
Whisper模型轉換為串流語音辨識系統。這裡有設置說明。所以,讓我們試試看
3:13.519–3:21.120
吧。所以我執行這個命令來啟動模型運行,它使用的是Whisper small模型,然後我進入這個標籤
3:21.120–3:30.000
並執行另一個命令,我開始說話。所以你可以很快地看到它
3:30.000–3:37.519
相當快速且具回應性,甚至還提供時間戳記。所以這是一個很酷的示範。嗯,現在讓我們討論它是如何運作的。所以我們從這個音訊檔案開始,我們的做法是將大小逐漸增加的區塊輸入Whisper。這些區塊的大小由最小區塊大小參數配置,預設為1秒。所以在每次迭代中,我們將這個緩衝區的大小增加1秒,並將所有內容輸入Whisper。這個過程持續進行,直到我們遇到句號或問號等句子結束標記。然後我們將緩衝區向前移動,並重新開始這個過程。所以每段音訊都會被Whisper多次處理,直到我們遇到句子結束為止。這樣做的原因是
3:37.519–3:46.319
運作。所以我們從這個音訊檔案開始,我們的做法是將大小遞增的片段輸入 Whisper。大小
3:46.319–3:54.879
這些片段的大小由最小片段大小參數配置,預設為 1 秒。所以在每次迭代中,我們增加這個
3:54.879–4:02.560
緩衝區的大小 1 秒,並將所有內容輸入 Whisper。這個過程持續進行,直到我們遇到句號或問號等句子結束標記
4:02.560–4:09.680
然後我們將緩衝區向前移動,並重新開始這個過程。因此,每段音訊
4:09.680–4:16.079
會被 Whisper 多次處理,次數取決於直到我們遇到句子結束標記為止。原因在於
4:16.079–4:22.960
Whisper是在句子上訓練的。所以,當音訊的開始與句子的開始對齊時,它會給出最佳結果。這就是為什麼緩衝區只在上一個句子完成且我們開始
4:22.960–4:29.680
新句子時才向前移動。這樣,Whisper永遠不需要從句子中間開始轉錄,這會給出
4:29.680–4:35.520
新句子。這樣,Whisper 永遠不需要從句子中間開始轉錄,這會導致
4:35.520–4:42.320
即使它們不完全準確。在Voice Writer中,我顯示不完整的結果為灰色,而
4:42.320–4:48.960
即使它們不完全準確。在 Voice Writer 中,我將不完整的結果顯示為灰色,而
4:48.960–4:57.120
確認的結果以黑色顯示。差異在於句子的灰色部分尚未確認,因此可能會隨著模型獲得新資訊而改變。
4:57.120–5:07.520
但黑色部分是已確認的結果,它們是永久性的。其運作方式是使用一種稱為「局部一致性(local agreement)」且 n 等於 2 的演算法。
5:07.520–5:14.720
這意味著對於一個 token 要獲得確認,它必須在兩個連續的音訊緩衝區中都被生成。讓我們
5:14.720–5:22.320
舉個例子。假設在第一個步驟中,模型輸出了三個 token「如果你喜歡」,且此步驟中沒有任何內容
5:22.320–5:28.960
獲得確認。在第二個步驟中,模型生成了更多 token,但只有前兩個 token 與
5:28.960–5:36.000
前一個步驟一致。因此這兩個獲得確認。在第三和第四個步驟中,生成了更多 token。但在
5:36.000–5:44.320
每個步驟中,它不會確認任何 token,直到該 token 至少在兩個連續的區塊中被生成。因此,任何在
5:44.320–5:53.280
灰色部分的內容都有可能隨著新資訊而改變。例如,一旦模型
5:53.280–6:00.160
聽到句子的其餘部分,「view」一詞可能會變成「video」。但黑色部分的任何內容都是
6:00.160–6:07.120
永久性的。因此,即使模型在更多迭代後想將其更改為其他內容,也無法再進行更改。這個模型在生成新句子時做的最後一件事是,它將前一個句子作為提示 token 輸入模型。所以這是
6:07.120–6:15.039
在 Whisper 格式中你可以做到的一件事,你可以在開始生成之前提供一堆提示 token,而這
6:15.039–6:22.000
通常會稍微提高準確性,因為更多的上下文總是好的。總而言之,該演算法可以
6:22.000–6:28.720
歸納為三個基本概念。第一個概念是我們將越來越長的連續音訊緩衝區輸入 Whisper,
6:28.720–6:37.360
然後一旦 token 經過兩次迭代確認就立即輸出它們。最後,當句子完成時,我們會向前滾動音訊
6:37.360–6:45.280
緩衝區。因此,這是一個相當簡單的演算法,你可以將其應用於任何不支援串流的語音轉文字
6:45.280–6:52.400
模型,並基本上將其轉變為串流模型。如果你喜歡,你可以查看
6:52.400–6:58.720
這篇論文中的所有詳細資訊,我會在描述中提供連結。其中一個限制來自於
6:58.720–7:05.039
Whisper 並非真正設計為串流模型的事實。正因為如此,它假設每個音訊緩衝區必須
7:05.039–7:12.479
從句子的開頭開始。因此,如果你有一個相當長的句子,那麼句子的開頭必須
7:12.479–7:18.400
被輸入模型並多次處理。這是不高效的,如果模型從一開始就接受訓練以進行
7:18.400–7:27.280
串流語音辨識,則是不必要的。現在,如果我們查看專門為串流語音辨識設計的架構,它看起來會
7:27.280–7:36.080
有些不同。這裡有一個在 2021 年提出的模型。在每個步驟中,它預測一個 token,並且可以存取固定數量的過去上下文和未來
7:36.080–7:46.319
上下文。在訓練期間,這個規則透過擁有一個主要是零的意圖遮罩來強制執行,這意味著
7:46.319–7:53.199
模型無法使用此固定視窗之外的資訊。在預測期間,模型根據有限的固定上下文預測一個 token。為了進行下一個預測,整個感受野向前移動一個
7:53.199–8:00.080
區塊,但感受野的大小是固定的。這樣,句子的開頭就不會被
8:00.080–8:07.360
在給定有限且固定的上下文下,為了進行下一個預測,整個感受野會向前移動一個區塊
8:07.360–8:13.759
但感受野的大小是固定的。這樣做可以避免句子開頭的部分被處理
8:13.759–8:20.240
並重新訓練模型,而我們無法存取 Whisper 的訓練數據。這個影片就到這裡,我希望你
8:20.240–8:26.560
喜歡我關於如何將 Whisper 轉變為串流模型的解釋。如果你喜歡這個影片,請留下
8:26.560–8:33.279
評論,點擊訂閱按鈕,並點擊鈴鐺圖示,以便在我發布未來影片時收到通知。再見。
8:33.279–8:41.000
留言、訂閱按鈕,並點擊鈴鐺圖示,以便在我發布未來影片時收到通知。再見。
0:00.240–0:05.920
Can the open AI whisper model dostreaming ASR? My name is Bai. I'm a
開放式AI的Whisper模型能進行串流語音辨識嗎?我叫白,是一名
0:05.920–0:12.000
chine learning engineer and a PhD inatural language processing. And today Iwill answer this question. So if you
機器學習工程師,擁有自然語言處理博士學位。今天我將回答這個問題。所以如果你
0:12.000–0:19.840
haven't seen the whisper model, it is aspeechtoext model. It is trained onabout 100 languages on 680,000 hours of
還沒看過Whisper模型,它是一個語音轉文字模型。它是在約100種語言、68萬小時的
0:19.840–0:27.279
data. The model architecture is aencoder decoder transformer model and itcomes in five different sizes and it is
數據上訓練而成的。模型架構是編碼器-解碼器Transformer模型,它有五種不同的尺寸,最近
0:27.279–0:33.520
growing in popularity recently becauseit is robust to noise and accents. Sothe question of the day is can this
因為對噪音和口音具有魯棒性而日益受歡迎。所以今天的问题是,這個
0:33.520–0:40.320
model do streaming speech recognition.So first of all what do we mean bystreaming ASR? Well, automated speech
模型能進行串流語音辨識嗎?首先,什麼是串流語音辨識?自動語音
0:40.320–0:46.320
recognition can come in two forms batchand streaming. Batch means that themodel needs to take a bunch of speech
辨識可以分為兩種形式:批次和串流。批次意味著模型需要接收一堆語音
0:46.320–0:57.680
and produce a bunch of text. Butstreaming ASR is when the model needs toproduce an output as the speaker isaying things with a delay of not more
並產生一堆文字。但串流語音辨識是指模型需要在說話者說話的同時產生輸出,延遲不超過
0:57.680–1:04.960
than a few seconds. So for example, ifyou're listening to a live broadcast,you don't want to first record the
幾秒鐘。例如,如果你正在收聽現場直播,你不想先錄下整場
1:04.960–1:12.400
ntire broadcast and then produce thesubtitles, you want it to appear at mosta few seconds after it is said. And
直播再產生字幕,你希望它在說出的幾秒後就出現。而且
1:12.400–1:19.840
generally you'll expect streaming ASR tobe a few percentage points loweraccuracy than batch ASR because the
通常你會預期串流語音辨識的準確率比批次語音辨識低幾個百分點,因為
1:19.840–1:27.040
model does not have access to all thecontext only the point up until thecurrent word. The question of how to do
模型無法取得所有上下文,只能取得直到當前詞彙為止的點。關於如何進行
1:27.040–1:35.840
streaming ASR came up when I wasbuilding the voice writer. This is an AIwriting assistant that works in twosteps. In the first step, you just speak
串流語音辨識的問題,是在我開發Voice Writer時出現的。這是一個AI
1:35.840–1:41.680
your thoughts without worrying too muchabout the grammar. And in the secondstep, the AI corrects the grammar for
寫作助手,分兩步運作。第一步,你只需說出你的想法,不用太擔心
1:41.680–1:47.920
you. I've been finding it super helpfulfor writing all kinds of things,including emails, blog posts, and Slack
語法。第二步,AI會幫你修正語法。我發現它對撰寫各種內容都非常有幫助,
1:47.920–1:54.560
messages. You can try it out for free inthe link here. And I'll also post a linkin the description of the video. Now,
包括電子郵件、部落格文章和Slack訊息。你可以透過這裡的連結免費試用。我也會在影片描述中附上連結。現在,
1:54.560–1:59.600
back to the video. First of all, why isthis even difficult? Why is it not so
回到影片。首先,為什麼這很困難?為什麼不容易
1:59.600–2:04.719
easy to use the Whisper model forstreaming ASR? The issue is Whisper is
使用Whisper模型進行串流語音辨識?問題在於Whisper是
2:04.719–2:12.640
trained to process input audio of 30seconds long. If the audio is less than30 seconds, you can pad it to be longer.
為了處理長達30秒的輸入音訊而訓練的。如果音訊少於30秒,你可以填充使其更長。
2:12.640–2:20.080
So, this is not too much of a problem.But what if your audio is longer than 30seconds? There is no way to feed into
所以,這不算太大問題。但如果你的音訊超過30秒怎麼辦?無法將
2:20.080–2:26.560
Whisper anything longer than 30 seconds.So, the first thing you might think ofis what if you just split it up into
超過30秒的內容輸入Whisper。所以,你可能會想到的第一件事是,如果將其分割成
2:26.560–2:33.680
chunks of 30 seconds at a time andprocess each chunk one at a time. Well,the first problem is you might split it
每次30秒的區塊並逐一處理每個區塊會怎樣?嗯,第一個問題是你可能會在
2:33.680–2:42.160
in the middle of the word. Like if yousplit it while in the middle of theword, this word will probably not berecognized correctly. The second problem
單字中間分割。例如,如果你在單字中間分割,這個單字可能無法被正確辨識。第二個問題
2:42.160–2:49.120
is the latency will be really high. Soimagine if you're processing audio,you're waiting for audio to fill up
是延遲會非常高。所以想象一下,如果你正在處理音訊,你需要等待音訊填滿
2:49.120–2:57.519
these 30 seconds and only then will youprocess this entire chunk and then thelatency um for for the first word will
這些 30 秒的片段,然後才處理整個片段,接著延遲對於第一個單詞來說
2:57.519–3:05.120
be up to 30 seconds. Fortunately, thereis an open source report called WhisperStreaming that does this for you and it
可能會高達30秒。幸運的是,有一個開源報告稱為WhisperStreaming,它可以為你完成這項工作,並將
3:05.120–3:13.519
urns the Whisper model into a streamingASR system. There are instructions onhow to set this up. So, let's try it
Whisper模型轉換為串流語音辨識系統。這裡有設置說明。所以,讓我們試試看
3:13.519–3:21.120
out. So, I run this command to start amodel running um it's using a whispersmall model and then I go to this tab
吧。所以我執行這個命令來啟動模型運行,它使用的是Whisper small模型,然後我進入這個標籤
3:21.120–3:30.000
and run another command and I just startspeaking. So you can pretty quickly seethat it's um picking it up and it's
並執行另一個命令,我開始說話。所以你可以很快地看到它
3:30.000–3:37.519
pretty quick and responsive and it evengives timestamps. So um it's pretty cooldemo. Um now let's talk about how this
相當快速且具回應性,甚至還提供時間戳記。所以這是一個很酷的示範。嗯,現在讓我們討論它是如何運作的。所以我們從這個音訊檔案開始,我們的做法是將大小逐漸增加的區塊輸入Whisper。這些區塊的大小由最小區塊大小參數配置,預設為1秒。所以在每次迭代中,我們將這個緩衝區的大小增加1秒,並將所有內容輸入Whisper。這個過程持續進行,直到我們遇到句號或問號等句子結束標記。然後我們將緩衝區向前移動,並重新開始這個過程。所以每段音訊都會被Whisper多次處理,直到我們遇到句子結束為止。這樣做的原因是
3:37.519–3:46.319
works. So we start with this audio fileand what we do is we feed chunks ofincreasing size into whisper. The size
運作。所以我們從這個音訊檔案開始,我們的做法是將大小遞增的片段輸入 Whisper。大小
3:46.319–3:54.879
of these chunks is configured by theminimum chunk size parameter which bydefault is 1 second. So in eachiteration, we increase the size of this
這些片段的大小由最小片段大小參數配置,預設為 1 秒。所以在每次迭代中,我們增加這個
3:54.879–4:02.560
buffer by 1 second and feed all of itinto whisper. And this process continuesuntil we hit a end of sentence marker
緩衝區的大小 1 秒,並將所有內容輸入 Whisper。這個過程持續進行,直到我們遇到句號或問號等句子結束標記
4:02.560–4:09.680
like a period or a question mark. Thenwe move the buffer forward and start theprocess again. So each piece of audio is
然後我們將緩衝區向前移動,並重新開始這個過程。因此,每段音訊
4:09.680–4:16.079
processed by whisper multiple times asmany times as it takes until we hit thend of the sentence. The reasons for
會被 Whisper 多次處理,次數取決於直到我們遇到句子結束標記為止。原因在於
4:16.079–4:22.960
this is whisper is trained on sentences.So, it gives the best result when thestart of the audio aligns with the start
Whisper是在句子上訓練的。所以,當音訊的開始與句子的開始對齊時,它會給出最佳結果。這就是為什麼緩衝區只在上一個句子完成且我們開始
4:22.960–4:29.680
of a sentence. And that's why the bufferonly moves forward when the previousentence is complete and we're beginning
新句子時才向前移動。這樣,Whisper永遠不需要從句子中間開始轉錄,這會給出
4:29.680–4:35.520
a new sentence. This way, Whisper neverneeds to start transcribing from themiddle of a sentence, which would give
新句子。這樣,Whisper 永遠不需要從句子中間開始轉錄,這會導致
4:35.520–4:42.320
suboptimal results. In manyapplications, it is useful to have someresults available as soon as possible,
即使它們不完全準確。在Voice Writer中,我顯示不完整的結果為灰色,而
4:42.320–4:48.960
even if they're not completely accurate.In the voice writer, I am showing theincomplete results in gray whereas the
即使它們不完全準確。在 Voice Writer 中,我將不完整的結果顯示為灰色,而
4:48.960–4:57.120
confirmed results are in black. Thedifference is the gray part of thesentence is unconfirmed. So it maychange as the model gets new
確認的結果以黑色顯示。差異在於句子的灰色部分尚未確認,因此可能會隨著模型獲得新資訊而改變。
4:57.120–5:07.520
information. But the black part is theconfirmed results and they arepermanent. How this works is using analgorithm called local agreement with n
但黑色部分是已確認的結果,它們是永久性的。其運作方式是使用一種稱為「局部一致性(local agreement)」且 n 等於 2 的演算法。
5:07.520–5:14.720
equals 2. This means that for a token tobe confirmed, it needs to be generatedin two consecutive audio buffers. Let's
這意味著對於一個 token 要獲得確認,它必須在兩個連續的音訊緩衝區中都被生成。讓我們
5:14.720–5:22.320
give an example. Let's say in the firstep, the worst per model outputs thethree tokens if you like and nothing is
舉個例子。假設在第一個步驟中,模型輸出了三個 token「如果你喜歡」,且此步驟中沒有任何內容
5:22.320–5:28.960
confirmed at this step. In the secondstep, the model produces more tokens,but only the first two tokens agree with
獲得確認。在第二個步驟中,模型生成了更多 token,但只有前兩個 token 與
5:28.960–5:36.000
e previous step. So those two areconfirmed. In the third and the fourthsteps, more tokens are generated. But at
前一個步驟一致。因此這兩個獲得確認。在第三和第四個步驟中,生成了更多 token。但在
5:36.000–5:44.320
each step, it does not confirm anytokens until it is at least generated intwo consecutive chunks. So anything in
每個步驟中,它不會確認任何 token,直到該 token 至少在兩個連續的區塊中被生成。因此,任何在
5:44.320–5:53.280
the gray part is possible to change andgiven new information. For example, theword view might change to video once the
灰色部分的內容都有可能隨著新資訊而改變。例如,一旦模型
5:53.280–6:00.160
model hears the rest of the sentence.But anything in the black part ispermanent. So even if the model wants to
聽到句子的其餘部分,「view」一詞可能會變成「video」。但黑色部分的任何內容都是
6:00.160–6:07.120
change it to something else after moreiterations it cannot be changed anymore.One last thing that this model does when
永久性的。因此,即使模型在更多迭代後想將其更改為其他內容,也無法再進行更改。這個模型在生成新句子時做的最後一件事是,它將前一個句子作為提示 token 輸入模型。所以這是
6:07.120–6:15.039
it generates a new sentence is it feedsthe previous sentence into the model asprompt tokens. So this is something that
在 Whisper 格式中你可以做到的一件事,你可以在開始生成之前提供一堆提示 token,而這
6:15.039–6:22.000
you can do in the whisper format is youcan give it a bunch of prompt tokensbefore you start generating and this
通常會稍微提高準確性,因為更多的上下文總是好的。總而言之,該演算法可以
6:22.000–6:28.720
tends to improve the accuracy a littlebit because more context is always good.So in summary, the algorithm can be
歸納為三個基本概念。第一個概念是我們將越來越長的連續音訊緩衝區輸入 Whisper,
6:28.720–6:37.360
summarized in three basic ideas. Thefirst idea is we feed longer and longerconsecutive audio buffers into whisper
然後一旦 token 經過兩次迭代確認就立即輸出它們。最後,當句子完成時,我們會向前滾動音訊
6:37.360–6:45.280
and then we emit tokens as soon asthey're confirmed by two iterations. Andfinally, we scroll forward the audio
緩衝區。因此,這是一個相當簡單的演算法,你可以將其應用於任何不支援串流的語音轉文字
6:45.280–6:52.400
buffer whenever a sentence is completed.So, it's a pretty simple algorithm thatyou can apply to any speech to text
模型,並基本上將其轉變為串流模型。如果你喜歡,你可以查看
6:52.400–6:58.720
model that does not support streamingand basically turn it into a streamingmodel. If you like, you can check out
這篇論文中的所有詳細資訊,我會在描述中提供連結。其中一個限制來自於
6:58.720–7:05.039
all the details in this paper, whichI'll link in the description. One of thelimitations comes from the fact that
Whisper 並非真正設計為串流模型的事實。正因為如此,它假設每個音訊緩衝區必須
7:05.039–7:12.479
whisper was not really designed to be astreaming model. And because of this, itassumes that each audio buffer has to
從句子的開頭開始。因此,如果你有一個相當長的句子,那麼句子的開頭必須
7:12.479–7:18.400
start at the beginning of a sentence.Therefore, if you have a sentence thatis quite long, then the beginning of the
被輸入模型並多次處理。這是不高效的,如果模型從一開始就接受訓練以進行
7:18.400–7:27.280
sentence has to be fed into the modeland processed many times. This isinefficient and not necessary if themodel was trained from the beginning to
串流語音辨識,則是不必要的。現在,如果我們查看專門為串流語音辨識設計的架構,它看起來會
7:27.280–7:36.080
do streaming ASR. Now, if we look at anarchitecture that was designedspecifically to do streaming speechrecognition, it looks a little bit
有些不同。這裡有一個在 2021 年提出的模型。在每個步驟中,它預測一個 token,並且可以存取固定數量的過去上下文和未來
7:36.080–7:46.319
different. Here is a model that wasproposed in 2021. At each step, itpredicts a token and it has access to afixed amount of past context and future
上下文。在訓練期間,這個規則透過擁有一個主要是零的意圖遮罩來強制執行,這意味著
7:46.319–7:53.199
context. During training, this rule isenforced by having an intention maskthat is mostly zeros, meaning that the
模型無法使用此固定視窗之外的資訊。在預測期間,模型根據有限的固定上下文預測一個 token。為了進行下一個預測,整個感受野向前移動一個
7:53.199–8:00.080
model cannot use information that isoutside of this fixed window. And duringprediction, the model predicts a token
區塊,但感受野的大小是固定的。這樣,句子的開頭就不會被
8:00.080–8:07.360
given a limited amount of fixed context.To make the next prediction, the entireceptive field moves forward by one
在給定有限且固定的上下文下,為了進行下一個預測,整個感受野會向前移動一個區塊
8:07.360–8:13.759
chunk, but the size of the receptivefield is fixed. This way, the beginningof the sentence will not be processed
但感受野的大小是固定的。這樣做可以避免句子開頭的部分被處理
8:13.759–8:20.240
multiple times. However, this is notpossible with the whisper model becauseit requires modifying the architecture
並重新訓練模型,而我們無法存取 Whisper 的訓練數據。這個影片就到這裡,我希望你
8:20.240–8:26.560
and retraining the model and we do nothave access to whisper's training data.That's it for this video and I hope you
喜歡我關於如何將 Whisper 轉變為串流模型的解釋。如果你喜歡這個影片,請留下
8:26.560–8:33.279
enjoyed my explanation of how Whispercan be turned into a streaming model. Ifyou enjoyed this video, please leave a
評論,點擊訂閱按鈕,並點擊鈴鐺圖示,以便在我發布未來影片時收到通知。再見。
8:33.279–8:41.000
comment, hit the subscribe button, andring the bell icon to stay notified whenI release future videos. Goodbye.
留言、訂閱按鈕,並點擊鈴鐺圖示,以便在我發布未來影片時收到通知。再見。

影片筆記:Can Whisper be used for real-time streaming ASR?

<!-- VIDEONOTE_PUBLICATION_WARNINGS_BEGIN -->

⚠️ 可先使用,仍有待修正項目

本筆記已完成可閱讀的逐字稿與時間跳轉;下列為待處理問題,建議播放原片確認。

  • 待修正:逐字稿全文快速校讀未完成(已保留自動字幕/原始逐字稿並繼續生成筆記。;未完成的全文速讀項目可在精進模式回聽確認。)

<!-- VIDEONOTE_PUBLICATION_WARNINGS_END -->

一句話總結

影片由機器學習工程師 Bai 講解如何透過開源專案 WhisperStreaming,利用緩衝區機制與「局部一致性」演算法,將原生設計為非串流、30秒長度的 OpenAI Whisper 模型,轉化為具備低延遲特性的串流語音辨識(Streaming ASR)系統。

核心重點

  1. Whisper 的原生限制:OpenAI Whisper 是針對 30 秒長度的非串流(Batch)語音設計,若直接用於串流,會面臨切分點導致單字辨識錯誤以及高延遲的問題。
  2. WhisperStreaming 解決方案:透過動態增加音訊緩衝區長度(從 1 秒開始逐步增加),直到遇到句子結束標記(如句號、問號),將 Whisper 轉化為串流系統。
  3. 局部一致性演算法(Local Agreement, n=2):為了確保文字輸出的穩定性,只有當某個 Token 在連續兩個音訊緩衝區迭代中都被生成時,該 Token 才會被確認為最終結果(黑色文字),否則維持為未完成結果(灰色文字)。
  4. 提示詞優化:在生成新句子時,將前一句子作為 Prompt Tokens 輸入模型,以提升準確率。
  5. 架構差異對比:針對串流設計的模型(如 2021 年提出的架構)採用固定視窗與掩碼訓練,無需像 Whisper 這樣重複處理句子開頭,因此在效率上更具優勢。

詳細大綱

一、背景與定義

  • 講者背景:Bai,機器學習工程師,自然語言處理博士。
  • Whisper 模型特性:
  • 類型:Speech-to-text 模型。
  • 訓練數據:涵蓋約 100 種語言,總計 680,000 小時數據。
  • 架構:Encoder-decoder Transformer。
  • 特點:具備五種不同大小,對噪音和口音具有魯棒性(Robust)。
  • ASR 兩種形式比較:
  • Batch ASR:模型需接收大量音訊後,一次性產出大量文字。
  • Streaming ASR:在說話者發聲的同時即時產出輸出,延遲不超過幾秒。
  • 準確率差異:串流 ASR 的準確率通常比批量 ASR 低幾個百分點,因為模型僅能存取到目前為止的上下文,無法預知未來內容。

二、應用場景與動機

  • Voice Writer 應用:
  • 這是一個 AI 寫作助手,分為兩步驟:
  1. 用戶口述想法(不擔心語法)。
  2. AI 修正語法。
  • 用途:用於電子郵件、部落格文章、Slack 訊息等場景。
  • 問題起源:在開發 Voice Writer 時,面臨如何進行高效且準確的串流 ASR 的技術挑戰。

三、Whisper 用於串流 ASR 的挑戰

  • 原生限制:Whisper 訓練用於處理長度為 30 秒的輸入音訊。
  • 若音訊少於 30 秒:可填充(Pad)至更長。
  • 若音訊多於 30 秒:無法直接輸入 Whisper。
  • 直接分塊處理的問題:
  1. 切分點問題:可能在單字中間切分音訊,導致該單字無法被正確辨識。
  2. 高延遲(Latency):若等待 30 秒填滿緩衝區才處理,第一個字的延遲可達 30 秒。

四、解決方案:WhisperStreaming

  • 專案介紹:開源報告/專案 WhisperStreaming,旨在將 Whisper 轉為串流 ASR 系統。
  • 操作演示:
  • 使用 whisper small 模型。
  • 透過命令啟動模型並輸入音訊。
  • 特點:快速、具回應性,並提供時間戳記(Timestamps)。
  • 核心演算法原理:
  1. 緩衝區機制:
  • 初始最小緩衝區大小(Minimum chunk size)預設為 1 秒。
  • 每次迭代增加緩衝區大小 1 秒,並將所有內容輸入 Whisper。
  • 持續此過程直到遇到「句號」或「問號」等句子結束標記。
  • 遇到句子結束標記後,緩衝區向前移動並重新開始。
  1. 為何需要多次處理:
  • Whisper 是在句子層級訓練的。
  • 當音訊起點與句子起點對齊時,結果最佳。
  • 確保 Whisper 不需要從句子中間開始轉錄,以避免次優結果。
  1. 結果顯示策略(Voice Writer 應用):
  • 灰色部分:未完成結果(Unconfirmed),可能隨新資訊改變。
  • 黑色部分:已確認結果(Confirmed),永久不變。
  1. 確認演算法:局部一致性(Local Agreement with n=2):
  • 規則:Token 需在連續兩個音訊緩衝區中生成,才能被確認。
  • 範例:
  • 第一步:模型輸出 token "if", "you", "like",無確認。
  • 第二步:模型輸出更多 token,但僅前兩個 token 與上一步一致,因此這兩個被確認。
  • 後續步驟:持續生成,直到 token 在至少兩個連續區塊中生成才確認。
  • 例子:單字 "view" 可能因後續資訊變更為 "video"(灰色部分),但黑色部分一旦確認即永久固定。
  1. 提示詞優化:
  • 當生成新句子時,將前一句子作為 Prompt Tokens 輸入模型。
  • 目的:提供更多上下文,略微提升準確率。

五、總結與限制

  • 演算法三要素總結:
  1. 將越來越長的連續音訊緩衝區輸入 Whisper。
  2. 一旦 token 被兩次迭代確認,即發出該 token。
  3. 句子完成時,將音訊緩衝區向前滾動。
  • 適用性:此簡單演算法可應用於任何不支援串流的 Speech-to-text 模型,將其轉為串流模型。
  • Whisper 的局限性:
  • Whisper 非為串流設計,假設每個音訊緩衝區必須從句子開頭開始。
  • 長句子開頭需被多次輸入並處理,效率低下。
  • 若模型從訓練開始就設計為串流 ASR,則無需此步驟。
  • 對比:針對串流設計的模型架構(2021 年提出):
  • 預測機制:每步預測一個 token,存取固定量的過去與未來上下文。
  • 訓練規則:透過掩碼(Mask)強制執行,掩碼主要為零,表示模型不能使用固定視窗外的資訊。
  • 推論機制:基於有限固定上下文預測 token。
  • 視窗移動:整個接收場(Receptive field)向前移動一個區塊,但大小固定。
  • 優勢:句子開頭不會被多次處理。
  • Whisper 無法實現的原因:需要修改架構並重新訓練模型,且無法取得 Whisper 的訓練數據。

工具 / 模型 / 名詞整理

  • OpenAI Whisper:OpenAI 推出的 Speech-to-text 模型,支援多種語言與口音。
  • WhisperStreaming:開源專案/報告,提供將 Whisper 轉為串流 ASR 的演算法實現。
  • Voice Writer:講者開發的 AI 寫作助手應用。
  • Encoder-decoder Transformer:Whisper 模型所使用的神經網路架構。
  • Whisper small:演示中使用的 Whisper 模型大小版本。
  • Local Agreement (n=2):用於確認 Token 的演算法名稱,指 Token 需在連續兩個緩衝區迭代中出現才被確認。
  • Prompt Tokens:用於提升準確率的提示詞機制,將前一句子作為上下文輸入。
  • Batch ASR:批量語音辨識,需接收完整音訊後輸出。
  • Streaming ASR:串流語音辨識,即時輸出文字,低延遲。
  • Receptive field:接收場,指模型在推論時所能夠存取到的上下文範圍。

操作流程整理

  1. 初始化:設定最小緩衝區大小為 1 秒。
  2. 緩衝區累積:
  • 每次迭代將緩衝區大小增加 1 秒。
  • 將累積的音訊輸入 Whisper 模型進行辨識。
  1. 檢查句子結束標記:
  • 若未遇到句號或問號,重複步驟 2。
  • 若遇到句子結束標記,執行步驟 4。
  1. 局部一致性確認:
  • 比較當前迭代與前一次迭代的輸出。
  • 若 Token 在連續兩個緩衝區中一致,則將其標記為「已確認」(黑色)。
  • 未確認的 Token 標記為「未完成」(灰色),可能隨後續資訊變更。
  1. 滾動緩衝區:
  • 句子完成後,將音訊緩衝區向前滾動,清除已確認部分。
  • 將前一句子作為 Prompt Tokens 輸入,以優化下一句子的辨識準確率。
  • 重新開始累積新的緩衝區。

值得注意的限制或風險

  1. 效率問題:由於 Whisper 非為串流設計,長句子的開頭部分需要被多次輸入並處理,導致計算資源浪費與效率低下。
  2. 準確率折損:串流 ASR 因無法預知未來內容,準確率通常低於批量 ASR。
  3. 架構限制:無法直接將 Whisper 改為類似 2021 年提出的串流模型架構(固定視窗、掩碼訓練),因為這需要修改架構並重新訓練,且無法取得 Whisper 的原始訓練數據。
  4. 延遲與切分風險:若未採用適當的緩衝區演算法,直接分塊處理會導致單字被切分而辨識錯誤,或產生高達 30 秒的延遲。

逐字稿辨識疑點

  • dostreaming:逐字稿中出現 "Can the open AI whisper model dostreaming ASR?",疑為口誤或聽寫錯誤,實際語意應為 "do streaming ASR" 或 "support streaming ASR"。
  • chine learning:逐字稿中出現 "I'm a chine learning engineer",疑為 "machine learning" 的聽寫錯誤。
  • inatural:逐字稿中出現 "PhD inatural language processing",疑為 "in natural language processing" 的聽寫錯誤。
  • Iwill:逐字稿中出現 "today Iwill answer",疑為 "I will" 的連寫。
  • aspeechtoext:逐字稿中出現 "it is aspeechtoext model",疑為 "a speech-to-text model" 的聽寫錯誤。
  • ntire:逐字稿中出現 "record the ntire broadcast",疑為 "the entire broadcast" 的聽寫錯誤。
  • ep:逐字稿中出現 "Let's say in the firstep",疑為 "first step" 的聽寫錯誤。
  • worst per:逐字稿中出現 "the worst per model outputs",疑為 "whisper model" 的聽寫錯誤。
  • e previous:逐字稿中出現 "agree with e previous step",疑為 "the previous step" 的聽寫錯誤。
  • intention mask:逐字稿中出現 "having an intention mask",疑點,通常語音模型中稱為 "attention mask"(注意力遮罩),此處聽寫為 "intention",需查證是否為講者口誤或特定術語。
  • ceptive field:逐字稿中出現 "the entireceptive field moves forward",疑為 "receptive field"(接收場)的聽寫錯誤。

可延伸追問

  1. WhisperStreaming 的 n=2 局部一致性參數是否可調整?調整為 n=3 或更高會對延遲和準確率產生什麼影響?
  2. 對於極長句子(超過 Whisper 30 秒限制),WhisperStreaming 的緩衝區滾動機制是否會導致上下文丟失,進而影響長距離依賴的辨識準確率?
  3. 除了 Whisper,其他非串流設計的 Speech-to-text 模型(如 wav2vec 2.0)是否也能套用此 WhisperStreaming 的演算法邏輯?
  4. 講者提到的 2021 年針對串流設計的模型架構,具體是指哪篇論文或哪個專案?其掩碼訓練細節為何?
  5. 在 Voice Writer 應用中,若用戶說話速度極快或極慢,WhisperStreaming 的 1 秒緩衝區增量是否仍為最佳設定?

生字列表

生字讀音類型中文
streaming/ˈstriːmɪŋ/串流的
robust/roʊˈbʌst/adjective魯棒的;健壯的
latency/ˈleɪtənsi/noun延遲
chunk/tʃʌŋk/noun區塊;片段
pad/pæd/verb填充
buffer/ˈbʌfər/noun緩衝區
token/ˈtoʊkən/noun詞元;記號
prompt/prɑːmpt/noun提示
receptive field/rɪˈsɛptɪv fiːld/noun感受野
mask/mæsk/noun遮罩
align/əˈlaɪn/verb對齊
emit/ɪˈmɪt/verb發出;產生
scroll/skoʊl/verb滾動
limitation/ˌlɪmɪˈteɪʃən/noun限制
architecture/ˈɑːrkɪtektʃər/noun架構
consecutive/kənˈsekjətɪv/adjective連續的
suboptimal/ˌsʌbˈɑːptɪməl/adjective次優的

生字解說

streaming /ˈstriːmɪŋ/

· C1

意思:串流的

解說:指數據以連續流動的方式傳輸或處理,而非一次性全部下載或處理。在語音辨識中,指邊接收邊處理的即時模式。

影片原句
Can the open AI whisper model do streaming ASR?
開放式AI的Whisper模型能進行串流語音辨識嗎?
延伸例句
Streaming video allows users to watch content without downloading the entire file.
串流影片讓使用者能夠在不下載整個檔案的情況下觀看內容。

robust /roʊˈbʌst/

adjective · C1

意思:魯棒的;健壯的

解說:在技術語境中,指系統對干擾(如噪音、口音)具有強大的抵抗力或穩定性,不易受影響而出錯。

影片原句
It is growing in popularity recently because it is robust to noise and accents.
因為對噪音和口音具有魯棒性而日益受歡迎。
延伸例句
A robust software system can handle high traffic without crashing.
一個魯棒的軟體系統能夠在高流量下運行而不崩潰。

latency /ˈleɪtənsi/

noun · C1

意思:延遲

解說:指從輸入到輸出之間的時間差。在串流處理中,低延遲意味著反應速度快,用戶體驗更即時。

影片原句
The second problem is the latency will be really high.
第二個問題是延遲會非常高。
延伸例句
Low latency is crucial for online gaming to ensure real-time responsiveness.
低延遲對於線上遊戲至關重要,以確保即時回應。

chunk /tʃʌŋk/

noun · B2

意思:區塊;片段

解說:指將整體數據分割成的較小、可管理的部分。在串流處理中,音訊常被分割成多個區塊進行處理。

影片原句
What if you just split it up into chunks of 30 seconds at a time?
如果將其分割成每次30秒的區塊會怎樣?
延伸例句
Please break the large document into smaller chunks for easier editing.
請將大型文件分割成較小的區塊,以便於編輯。

pad /pæd/

verb · B2

意思:填充

解說:指在數據末尾添加無效或靜音數據,以達到模型所需的特定長度或格式要求。

影片原句
If the audio is less than 30 seconds, you can pad it to be longer.
如果音訊少於30秒,你可以填充使其更長。
延伸例句
You need to pad the array with zeros to match the required length.
你需要用零填充陣列以符合所需的長度。

buffer /ˈbʌfər/

noun · C1

意思:緩衝區

解說:指用於暫時儲存數據的記憶體區域,常用於平衡數據處理速度與輸入速度之間的差異。

影片原句
So in each iteration, we increase the size of this buffer by 1 second.
所以在每次迭代中,我們增加這個緩衝區的大小 1 秒。
延伸例句
The video player uses a buffer to prevent stuttering during playback.
影片播放器使用緩衝區來防止播放時的卡頓。

token /ˈtoʊkən/

noun · C1

意思:詞元;記號

解說:在自然語言處理中,指文本被分割後的最小處理單位,可以是單字、子單字或標點符號。

影片原句
This means that for a token to be confirmed, it needs to be generated in two consecutive audio buffers.
這意味著對於一個 token 要獲得確認,它必須在兩個連續的音訊緩衝區中都被生成。
延伸例句
The model converts each word into a token before processing.
模型在處理之前會將每個單字轉換為詞元。

prompt /prɑːmpt/

noun · C1

意思:提示

解說:指輸入給模型的初始文本或數據,用於引導模型生成後續的內容或提高準確性。

影片原句
It feeds the previous sentence into the model as prompt tokens.
它將前一個句子作為提示 token 輸入模型。
延伸例句
Providing a clear prompt helps the AI generate more relevant answers.
提供清晰的提示有助於 AI 生成更相關的回答。

receptive field /rɪˈsɛptɪv fiːld/

noun · C2

意思:感受野

解說:神經網路術語,指模型在當前輸出中所能「看到」或處理的輸入數據範圍。

影片原句
To make the next prediction, the entire receptive field moves forward by one chunk.
為了進行下一個預測,整個感受野會向前移動一個區塊。
延伸例句
A larger receptive field allows the model to capture broader context.
更大的感受野允許模型捕捉更廣泛的上下文。

mask /mæsk/

noun · C1

意思:遮罩

解說:指用於隱藏或屏蔽數據中某些部分的矩陣或結構,常見於注意力機制中以防止模型查看未來資訊。

影片原句
During training, this rule is enforced by having an intention mask that is mostly zeros.
在訓練期間,這個規則透過擁有一個主要是零的意圖遮罩來強制執行。
延伸例句
The attention mask prevents the model from attending to padding tokens.
注意力遮罩防止模型關注填充詞元。

align /əˈlaɪn/

verb · B2

意思:對齊

解說:指使兩個或多個元素在時間或空間上保持一致或對應。在語音辨識中,指音訊與文字時間點的匹配。

影片原句
It gives the best result when the start of the audio aligns with the start of a sentence.
當音訊的開始與句子的開始對齊時,它會給出最佳結果。
延伸例句
Please align the text with the images for better readability.
請將文字與圖片對齊,以提高可讀性。

emit /ɪˈmɪt/

verb · C1

意思:發出;產生

解說:指模型生成並輸出結果。在串流語音辨識中,指將確認後的詞元輸出給用戶。

影片原句
And then we emit tokens as soon as they're confirmed by two iterations.
然後我們立即輸出詞元,只要它們經過兩次迭代確認。
延伸例句
The sensor emits a signal when motion is detected.
當檢測到運動時,感測器會發出訊號。

scroll /skoʊl/

verb · B2

意思:滾動

解說:指將視窗或數據視圖向前移動以查看新內容。在此處指處理完一個句子後,將處理視窗向前移動。

影片原句
And finally, we scroll forward the audio buffer whenever a sentence is completed.
最後,當句子完成時,我們會向前滾動音訊緩衝區。
延伸例句
You can scroll down to see more comments on the post.
你可以向下滾動以查看帖子上的更多評論。

limitation /ˌlɪmɪˈteɪʃən/

noun · B2

意思:限制

解說:指系統或方法所具有的約束條件或不足之處,可能影響其性能或適用範圍。

影片原句
One of the limitations comes from the fact that whisper was not really designed to be a streaming model.
其中一個限制來自於 Whisper 並非真正設計為串流模型的事實。
延伸例句
The main limitation of this study is the small sample size.
這項研究的主要限制是樣本數量較少。

architecture /ˈɑːrkɪtektʃər/

noun · C1

意思:架構

解說:指系統、軟體或神經網路的整體結構設計,包括其組件及其相互關係。

影片原句
The model architecture is a encoder decoder transformer model.
模型架構是編碼器-解碼器Transformer模型。
延伸例句
The new software architecture improves scalability and performance.
新的軟體架構提高了可擴展性和性能。

consecutive /kənˈsekjətɪv/

adjective · C1

意思:連續的

解說:指一個接一個、沒有間斷地發生或排列。在串流處理中,指相鄰的處理步驟或區塊。

影片原句
It needs to be generated in two consecutive audio buffers.
它必須在兩個連續的音訊緩衝區中都被生成。
延伸例句
The company reported three consecutive years of profit growth.
該公司報告了連續三年的利潤增長。

suboptimal /ˌsʌbˈɑːptɪməl/

adjective · C1

意思:次優的

解說:指結果不如預期理想,但未達到最差狀態。在語音辨識中,指因處理方式不當導致的較低準確率。

影片原句
Which would give suboptimal results.
這會導致即使它們不完全準確的次優結果。
延伸例句
Using outdated software may lead to suboptimal performance.
使用過時的軟體可能會導致次優的性能。

句型解說(含實例)

Can [Subject] do [Object]?

意思:[主詞] 能進行/處理 [賓語] 嗎?

接續:Can + 主詞 + 動詞 + 賓語 + ?

解說:用於詢問某個系統、模型或人是否具有執行特定任務的能力。這裡的「do」泛指處理或執行。

影片原句
Can the open AI whisper model do streaming ASR?
開放式AI的Whisper模型能進行串流語音辨識嗎?
實例
  1. Can this software handle large datasets?
    這個軟體能處理大型數據集嗎?
  2. Can the new algorithm solve complex problems?
    新演算法能解決複雜問題嗎?

It is trained on [Data/Context]

意思:它是在 [數據/上下文] 上訓練而成的

接續:It + is + trained + on + 數據/上下文

解說:描述模型或系統學習所依據的數據集或環境。強調訓練數據的規模或類型。

影片原句
It is trained on about 100 languages on 680,000 hours of data.
它是在約100種語言、68萬小時的數據上訓練而成的。
實例
  1. The model is trained on diverse medical records.
    該模型是在多樣化的醫療記錄上訓練而成的。
  2. This AI is trained on millions of customer reviews.
    這個 AI 是在數百萬條客戶評論上訓練而成的。

What do we mean by [Term]?

意思:我們對 [術語] 的定義是什麼?/ 什麼是 [術語]?

接續:What + do + we + mean + by + 術語 + ?

解說:用於引入並解釋一個專業術語或概念,通常出現在講解的開頭。

影片原句
So first of all what do we mean by streaming ASR?
首先,什麼是串流語音辨識?
實例
  1. What do we mean by artificial intelligence?
    我們對人工智慧的定義是什麼?
  2. What do we mean by sustainable development?
    什麼是永續發展?

The issue is [Clause]

意思:問題在於 [子句內容]

接續:The issue + is + that/零連接詞 + 子句

解說:用於指出某個情況中的主要困難、障礙或核心問題。

影片原句
The issue is Whisper is trained to process input audio of 30 seconds long.
問題在於 Whisper 是為了處理長達30秒的輸入音訊而訓練的。
實例
  1. The issue is that we don't have enough resources.
    問題在於我們沒有足夠的資源。
  2. The issue is the lack of clear communication.
    問題在於缺乏清晰的溝通。

What if [Condition]?

意思:如果 [條件] 會怎樣?

接續:What if + 條件子句

解說:用於提出假設性情況,探討在特定條件下可能發生的結果或應對策略。

影片原句
So, the first thing you might think of is what if you just split it up into chunks of 30 seconds at a time?
所以,你可能會想到的第一件事是,如果將其分割成每次30秒的區塊會怎樣?
實例
  1. What if we change the deadline to next week?
    如果我們將截止日期改為下週會怎樣?
  2. What if the system fails during the update?
    如果系統在更新期間失敗會怎樣?

It is [Adjective] to [Verb]

意思:[動詞] 是 [形容詞] 的

接續:It + is + 形容詞 + to + 動詞原形

解說:用於描述執行某個動作的性質或難度。這裡的「It」是形式主詞,真正的主詞是後面的不定詞片語。

影片原句
Why is it not so easy to use the Whisper model for streaming ASR?
為什麼不容易使用 Whisper 模型進行串流語音辨識?
實例
  1. It is crucial to back up your data regularly.
    定期備份你的數據是至關重要的。
  2. It is difficult to predict the market trends.
    預測市場趨勢是很困難的。

Summarized in [Number] [Noun]

意思:歸納為 [數量] 個 [名詞]

接續:[Subject] + can be + summarized + in + 數量 + 名詞

解說:用於將複雜的概念或過程簡化為幾個核心要點或原則。

影片原句
So in summary, the algorithm can be summarized in three basic ideas.
總而言之,該演算法可以歸納為三個基本概念。
實例
  1. The strategy can be summarized in three key steps.
    該策略可以歸納為三個關鍵步驟。
  2. The theory can be summarized in a few simple equations.
    該理論可以歸納為幾個簡單的方程式。