實際影片長度:11:03.000。原文、繁中、雙語可點擊句子跳轉影片。
0:00.480–0:09.280
hey everyone welcome to nning IO I'm JDand today we're going to be looking atreal time in browser speech recognition
0:09.280–0:19.720
using web GPU and Transformer JS toactually use speech in the browser sowith that let's go ahead and getstarted all right the first thing that
0:19.720–0:26.160
we're going to do everyone is we'regoing to go to this hugging face spaceand basically what we're going to do is
0:26.160–0:36.520
look at this demo for the whisper webGPO uh it's real time in browserecognition it's using the whisper basewhich is a 73 million parameter speech
0:36.520–0:45.000
recognition mod model and using onx andTransformer JS so you can see that theaudio audio visualizer is already
0:45.000–0:53.960
picking up my voice from the microphoneand uh able to do some kind of uh visualwhat we're going to do is actually load
0:53.960–1:04.159
this model and then we should be able tosee real time uh transcription but whatwe want to showis also that if you go and look at your
1:04.159–1:11.920
network uh right now I have I'm on thiswasm tab and we want to pay attention toboth Fetch and wasm so we're going to go
1:11.920–1:22.680
ahead and look at the model and you cansee it pulled it in really quickly uhcould be uh because it's cached but uh
1:22.680–1:30.079
this was incredibly fast and it'salready doing the the transcription inreal time you can see that it's trying
1:30.079–1:38.560
addpunctuation and uh the token count downhere if we go over to the wasm tab thisall that was loaded it's going
1:38.560–1:48.040
through a worker to establish this andthe size was 4 megabytes so again thiscrazy fast for doing real time uh
1:48.040–1:56.200
transcription in the browser superhelpful if you were trying to do uh likechat based systems where you actually
1:56.200–2:07.439
wanted to have voice in with your chatas without having to go out to open AIor some otherum closed Source or even open source
2:07.439–2:14.560
model that uh requires a backend callright again we didn't fetch anythingfrom our back end this was just loaded
2:14.560–2:22.680
through the browser so now what we'regoing to do is we're going to take thisand we're going to actually look at the
2:22.680–2:34.400
repo and and dig into the code so if youcome over here to Transformers Jsthe thing you want to note is you wanto be on uh the
2:34.400–2:42.680
V3 Branch this is the the new Branchit's still experimental but it's goingto be the next version of Transformer JS
2:42.680–2:46.920
a lot of great examples we've beentrying to go through some of them itfeels like every day they're coming out
2:46.920–2:56.959
with a new demo a new model that they'reable to implement um definitely reallycool stuff so if we look at this example
2:56.959–3:04.239
so we go into Transformer JS examplesand Whisper then we're able to actuallyD dive into this code so what we're
3:04.239–3:08.959
going to do is we're just going to pullthis down get this running on our localmachine and then we'll start digging
3:08.959–3:20.519
into the code so I'm going to use cursorI'm already I already have it pulledown but you can do uh get clone andthen come over
3:20.519–3:34.640
here and just dothis uh we are so I'm in the root sowhat we need to do is go toexamples and then we're going to do web
3:34.640–3:49.680
GPU and go towhisper and we'll do an npminstall and then we'll go ahead and doan npm runDev and what we're going to do is we
3:49.680–4:00.079
have our Local Host here so we can gethis up and running we'll watch reallyquickly if we can gethis uh loaded again super quick you saw
4:00.079–4:06.400
how quickly the the load time was forthat again some of it sometimes it'scashed and the first one's going to be
4:06.400–4:20.280
slower but still reallyimpressive so if we look at some of thecore files in here we have our app whichis the main main file and what we're
4:20.280–4:27.680
going to be looking at is how we'reactually pulling in this worker so thisworker. JS is where we're actually going
4:27.680–4:34.160
to do our Logic for Transformer Js we'repulling in the model we're actuallysending messages back and forth where
4:34.160–4:44.199
you can see right here that as messagesare coming being received we're actuallygoing to be looking for the type of
4:44.199–4:58.479
event that is being pass and then sendthat uh data as wellso you can see most of this is for likeloading there's uh some update which is
4:58.479–5:12.520
where you're updating the textwe're actually going to look and seewhere this is uh is working so if wecontinue down and we are looking at the
5:12.520–5:19.639
recorder this is all the informationabout starting and stopping therecording and then what's Happening Here
5:19.639–5:31.479
is we are actually looking at how thisinformation is being sent with this codeso righthere it's saying as the recording is
5:31.479–5:41.960
coming in we're going to take a blob andchunk it and so then we're going to makea file reader and read those and then
5:41.960–5:57.400
send that on when the file is beingread get that bit information that'sdecoded slice it and then send thoseslices over to our worker so we're
5:57.400–6:06.039
posting the message to generate ourtranscription on the Fly then this isjust our uh our HTML that we're going to
6:06.039–6:15.599
be pullingin so what we'll do is we'll jump overto the worker and then we'll take a lookat how this is actually functioning real
6:15.599–6:21.319
quick everyone if you haven't alreadyplease remember to like And subscribe ithelps more than you know if you have any
6:21.319–6:28.120
questions please leave them in thecomments and with that let's get back toit all right so now that we're in our
6:28.120–6:36.960
worker file we're going to startlooking at how this actually functionsfirst thing is we're loading inTransformers we're going to pull in our
6:36.960–6:49.000
Autokenizer our Auto processor and then uhwhisper and text stream as well as fullso if we look at what we're first doing
6:49.000–6:55.280
we have this class which is our Pipelineand then we're actually using ourinstance where we're getting our model
6:55.280–7:03.240
so we're saying this is our model ID wehave our tokenizer our processor we'reactually getting the model based on our
7:03.240–7:14.280
ID at this point uh we're telling itwhat our dtype is and then specificallywe're using device webGPU and once all of these have processed
7:14.280–7:24.160
uh then our git instance has beenestablished if we scroll down to thebottom we can kind of look at like someof the loader functions so you can see
7:24.160–7:32.840
here there's the load this happens likewhere we're actually posting backmessages to actually see see theprogress bar things like that we're
7:32.840–7:42.639
stablishing some events based on ourmessage and then once the the browser uhor once the model is actually loaded
7:42.639–7:51.159
we're going to be looking for thisgenerate function this function is whatreally is going to be taking the audio
7:51.159–8:00.120
and taking the language and thenactually processing it so the firsthing we'll be doing is saying is if ifprocessing return
8:00.120–8:06.800
if it is not processing then go aheadand set that processing to Truemaintaining State we're actually going
8:06.800–8:13.000
to send a message back to say that we'retrans that the thread is starting sowe're saying start as our status and
8:13.000–8:21.840
then we're actually pulling in ourinstance so again where we set ourtokenizer and our processor and modelwe're actually pulling that from our um
8:21.840–8:29.199
instance and we're starting to actuallyprocess so we have our call backfunction which is going to give us the
8:29.199–8:40.320
output of our post message of update andinformation about our TPS our tokens andour actual output and then we we have
8:40.320–8:51.480
our streamer and we this is where we'reactuallyprocessing our information so what we'resaying is our input we're taking our AO
8:51.480–8:59.440
audio and we're uh putting it throughour processor we then this is ourtranscription our transcription BAS
8:59.440–9:05.560
based on our model and our generatewe're saying we're passing our sameinputs our language and we're actually
9:05.560–9:12.000
streaming the events or streaming theoutput so now we have our tokenizer thisgives us the information that's
9:12.000–9:19.519
displayed in the bottom right of howmany tokens we're actually using andthen we're posting back that chunk of
9:19.519–9:27.519
text as it is complete and so rememberif we are looking at what these postmessages are we're coming back here and
9:27.519–9:39.240
that is the information that is being onmessage received so if we look downtoupdate we're seeing that we're setting
9:39.240–9:50.040
our TPS here as well as uh our messageso our on message right here this iswhere we're being sending theinformation back and then that's how
9:50.040–10:02.800
e're actually passing information downhere so this is where ourTPS is and then uhthe this the rest of the progress bar in
10:02.800–10:14.399
the audio I'm looking fortheactual uh information around the text ohit's right here so on ready we'repassing the information of the text
10:14.399–10:22.240
hat's beingupdated and that's how this works is webasically are taking this informationfrom after after it passes passes
10:22.240–10:29.920
through the model and then right here sobeing generated by the model and thenposting that information back
10:29.920–10:39.639
so it's processing the auto chunk it isaudio chunk and it's uh then convertingthat and doing a transcription on this
10:39.639–10:46.160
generation then it's streaming it'sdoing the tokenizer and posting all thatinformation back all right everyone
10:46.160–10:57.040
that's it for us today what we coveredwas using real time speech recognitionin the browser with web GPU andTransformers JS we're able to dig
10:57.040–11:03.000
through some of the repo and actuallyget their demo up and running and sowith that happy nerding
0:00.480–0:09.280
嗨,大家好,歡迎來到 Nning IO,我是 JD,今天我們將探討在瀏覽器中即時進行語音辨識。
0:09.280–0:19.720
使用 Web GPU 和 Transformer JS 來實際在瀏覽器中使用語音,那麼讓我們開始吧。首先,
0:19.720–0:26.160
我們要做的第一件事是前往這個 Hugging Face 空間,基本上我們要做的就是
0:26.160–0:36.520
查看這個 Whisper WebGPU 的示範,它是瀏覽器中的即時辨識,使用的是 Whisper Base,這是一個擁有 7300 萬參數的語音
0:36.520–0:45.000
辨識模型,並使用 ONNX 和 Transformer JS,所以你可以看到音訊視覺化器已經
0:45.000–0:53.960
從麥克風捕捉到我的聲音,並且能夠進行某種視覺呈現,我們將實際載入
0:53.960–1:04.159
這個模型,然後我們應該能夠看到實時的轉錄,但我們想展示的是,如果你去查看你的
1:04.159–1:11.920
網路,嗯,現在我在這個 WASM 標籤頁,我們要注意 Fetch 和 WASM,所以我們將前往
1:11.920–1:22.680
查看模型,你可以看到它非常快速地載入,嗯,可能是因為它被快取了,但嗯
1:22.680–1:30.079
這非常快速,它已經在即時進行轉錄,你可以看到它正在嘗試
1:30.079–1:38.560
添加標點符號,嗯,以及這裡的計數器,如果我們切換到 WASM 標籤頁,所有這些都已載入,它將
1:38.560–1:48.040
透過一個 worker 來建立這個,大小為 4 MB,所以再次強調,這對於在瀏覽器中進行即時轉錄來說非常快速,超級
1:48.040–1:56.200
在瀏覽器中進行轉錄非常有用,如果你試圖建立基於聊天的系統,而這些系統實際上
1:56.200–2:07.439
希望將語音整合到你的聊天中,而不需要去呼叫 Open AI 或其他某些
2:07.439–2:14.560
閉源或甚至開源的模型,這些模型需要後端呼叫,再次強調,我們沒有從後端獲取任何東西,這只是透過
2:14.560–2:22.680
透過瀏覽器進行,那麼現在我們要做的就是,我們將採取這個方法,並實際查看
2:22.680–2:34.400
儲存庫拿過來,並深入研究程式碼,所以如果你來到這裡的 Transformer JS,你要注意的是,你要在
2:34.400–2:42.680
V3 分支上,這是新的分支,它仍然是實驗性的,但它將是 Transformer JS 的下一個版本
2:42.680–2:46.920
有很多很棒的範例,我們一直在嘗試瀏覽其中一些,感覺他們每天都在推出
2:46.920–2:56.959
新的示範,新的模型,他們能夠實現,嗯,絕對非常酷的東西,所以如果我們查看這個範例
2:56.959–3:04.239
所以我們進入 Transformer JS 範例和 Whisper,然後我們能夠實際深入這個程式碼,所以我們要做的就是將這個
3:04.239–3:08.959
下載下來,在我們的本機機器上運行它,然後我們開始深入研究
3:08.959–3:20.519
程式碼,所以我將使用 Cursor,我已經將它拉下來了,但你可以執行 git clone,然後來到
3:20.519–3:34.640
這裡,只是執行這個,嗯,我在根目錄,所以我們需要做的是前往 examples,然後我們將執行 web
3:34.640–3:49.680
GPU 並前往 whisper,我們將執行 npm install,然後我們將執行 npm run dev,而我們要做的就是
3:49.680–4:00.079
在這裡有我們的本機主機,所以我們可以啟動它,我們將非常快速地查看我們是否能再次載入它,超級快,你看到了
4:00.079–4:06.400
載入時間有多快,再次強調,其中一些有時會被快取,而第一次載入會
4:06.400–4:20.280
較慢,但仍然非常令人印象深刻,所以如果我們查看這裡的一些核心檔案,我們有 app,這是主要的檔案,而我們要
4:20.280–4:27.680
查看的是我們如何實際載入這個 worker,所以這個 worker.js 是我們實際上要
4:27.680–4:34.160
執行 Transformer JS 邏輯的地方,我們正在載入模型,我們實際上正在發送訊息來回傳遞,其中
4:34.160–4:44.199
你可以看到這裡當訊息被接收時,我們實際上會去尋找事件的類型
4:44.199–4:58.479
正在傳遞的事件類型,然後發送該資料,所以你可以看到大部分這都是為了載入,有一些更新,這是
4:58.479–5:12.520
你更新文字的地方,我們實際上將查看並查看這是在哪裡運作,所以如果我們繼續向下查看,我們正在查看
5:12.520–5:19.639
recorder,這是關於開始和停止錄音的所有資訊,然後這裡發生了什麼
5:19.639–5:31.479
是我們實際上正在查看這段程式碼如何發送這些資訊,所以在這裡,它說當錄音
5:31.479–5:41.960
進來時,我們將取得一個 blob 並將其分塊,然後我們將建立一個檔案讀取器並讀取這些,然後
5:41.960–5:57.400
在讀取檔案時發送這些,取得該位元資訊,解碼它,分割它,然後將這些分割部分發送給我們的 worker,所以我們
5:57.400–6:06.039
發送訊息以即時生成我們的轉錄,然後這只是我們將要
6:06.039–6:15.599
載入的 HTML,所以我們將跳轉到 worker,然後我們將查看這實際上是如何即時運作
6:15.599–6:21.319
的,大家,如果你還沒有,請記得按讚和訂閱,這比你知道的更有帮助,如果你有任何
6:21.319–6:28.120
請在留言區留下你的問題,接下來讓我們回到正題,好的,現在我們已經進入我們的
6:28.120–6:36.960
現在我們進入了 worker 檔案,我們將開始查看它實際上的運作方式。第一件事是載入 Transformers,我們將引入 AutoTokenizer、AutoProcessor,以及 whisper 和 text streamer,還有 full。
6:36.960–6:49.000
如果我們查看首先執行的動作,我們有一個類別,這是我們的 Pipeline,然後我們實際上使用我們的執行個體,在這裡取得我們的模型。
6:49.000–6:55.280
所以我們說這是我們的模型 ID,我們有 tokenizer 和 processor,我們實際上是根據我們的 ID 來取得模型。
6:55.280–7:03.240
在這個階段,我們告訴它 dtype 是什麼,然後特別使用 device webGPU,一旦這些都處理完成。
7:03.240–7:14.280
我們的 git 執行個體就建立了。如果我們滾動到底部,我們可以大致查看一些載入函數,所以你可以看到這裡有 load,這發生在我們實際發送訊息回來以查看進度條等事項的地方。
7:14.280–7:24.160
我們根據我們的訊息建立了一些事件,然後一旦瀏覽器或模型實際載入。
7:24.160–7:32.840
這裡有載入,這發生在我們實際回傳訊息以查看進度條等內容時,我們
7:32.840–7:42.639
並處理語言,然後實際處理它,所以我們首先要做的是說,如果處理返回。
7:42.639–7:51.159
如果它不是處理中,則繼續將處理狀態設為 True,維持狀態,我們實際上要發送訊息回來,表示執行緒正在啟動,所以我們將 start 設為狀態。
7:51.159–8:00.120
然後我們實際引入我們的執行個體,所以再次設定我們的 tokenizer、processor 和模型的地方,我們實際上是從我們的執行個體中取得它。
8:00.120–8:06.800
然後我們開始實際處理,所以我們有回呼函數,它將提供我們 post message 的 update 輸出,以及關於我們的 TPS、tokens 和實際輸出的資訊,然後我們有。
8:06.800–8:13.000
我們的 streamer,這裡是我們實際處理資訊的地方,所以我們說的是輸入,我們取得音訊,然後透過我們的 processor 處理它,然後這是我們的轉錄,我們的轉錄基於我們的模型和 generate。
8:13.000–8:21.840
我們說我們傳遞相同的輸入、語言,並且我們實際上是串流事件或串流輸出,所以現在我們有 tokenizer,這給我們顯示在右下角的資訊,關於我們實際使用了多少 tokens,然後我們發送回那部分。
8:21.840–8:29.199
文字作為完成,所以請記住,如果我們查看這些 post messages 是什麼,我們回到這裡,這就是 onmessage received 接收的資訊,所以如果我們向下查看 update,我們看到我們設定。
8:29.199–8:40.320
這裡的 TPS 以及我們的訊息,所以我們的 on message 就在這裡,這是我們發送資訊回來的地方,然後這就是。
8:40.320–8:51.480
我們實際上下傳資訊的地方,所以這裡是我們的 TPS,然後音訊的其餘進度條,我在尋找實際的文字資訊,哦,就在這裡,所以在 ready 時,我們傳遞文字的資訊。
8:51.480–8:59.440
正在更新,這就是它運作的方式,我們基本上是在取用這個資訊,在通過模型之後,然後就在這裡,由模型產生,然後發送回資訊。
8:59.440–9:05.560
所以它正在處理自動區塊,它是音訊區塊,然後轉換它並對此進行轉錄,然後它正在串流,它正在進行 tokenizer 並發送所有這些資訊回來,大家好。
9:05.560–9:12.000
今天到此為止,我們涵蓋了使用 Web GPU 和 Transformers JS 在瀏覽器中進行即時語音辨識,我們能夠深入研究一些程式碼庫,並實際讓他們的示範運作起來,所以很高興能與大家分享。
9:12.000–9:19.519
在右下角顯示我們實際使用了多少 token,然後我們將完成的那部分
9:19.519–9:27.519
文字作為其完成狀態回傳,所以請記住,如果我們查看這些 postMessage 是什麼,我們會回到這裡,並且
9:27.519–9:39.240
這就是正在接收的 onmessage 資訊,所以如果我們向下查看以進行更新,我們會看到我們正在設定
9:39.240–9:50.040
我們這裡的 TPS 以及訊息,所以我們的 onmessage 就在這裡,我們正在將資訊傳送回去,然後這就是
9:50.040–10:02.800
我們實際上將資訊傳遞到這裡的方式,所以這裡就是我們的 TPS,然後進度條的其餘部分在
10:02.800–10:14.399
音訊中,我在尋找關於文字的實際資訊,哦,就在這裡,所以在 ready 時,我們傳遞文字的資訊
10:14.399–10:22.240
正在更新的內容,這就是運作方式,我們基本上是在模型通過之後,從
10:22.240–10:29.920
通過模型然後就在這裡由模型生成然後將該資訊回傳
10:29.920–10:39.639
所以它正在處理自動區塊,也就是音訊區塊,然後轉換它並對此進行轉錄
10:39.639–10:46.160
生成,然後串流傳輸,進行 tokenizer 並將所有這些資訊傳送回去,各位好
10:46.160–10:57.040
今天我們就講到這裡,我們介紹了如何在瀏覽器中使用 Web GPU 和 Transformers JS 進行即時語音辨識,我們能夠深入
10:57.040–11:03.000
深入這個倉庫,實際啟動他們的示範,然後,快樂地探索技術
0:00.480–0:09.280
hey everyone welcome to nning IO I'm JDand today we're going to be looking atreal time in browser speech recognition
嗨,大家好,歡迎來到 Nning IO,我是 JD,今天我們將探討在瀏覽器中即時進行語音辨識。
0:09.280–0:19.720
using web GPU and Transformer JS toactually use speech in the browser sowith that let's go ahead and getstarted all right the first thing that
使用 Web GPU 和 Transformer JS 來實際在瀏覽器中使用語音,那麼讓我們開始吧。首先,
0:19.720–0:26.160
we're going to do everyone is we'regoing to go to this hugging face spaceand basically what we're going to do is
我們要做的第一件事是前往這個 Hugging Face 空間,基本上我們要做的就是
0:26.160–0:36.520
look at this demo for the whisper webGPO uh it's real time in browserecognition it's using the whisper basewhich is a 73 million parameter speech
查看這個 Whisper WebGPU 的示範,它是瀏覽器中的即時辨識,使用的是 Whisper Base,這是一個擁有 7300 萬參數的語音
0:36.520–0:45.000
recognition mod model and using onx andTransformer JS so you can see that theaudio audio visualizer is already
辨識模型,並使用 ONNX 和 Transformer JS,所以你可以看到音訊視覺化器已經
0:45.000–0:53.960
picking up my voice from the microphoneand uh able to do some kind of uh visualwhat we're going to do is actually load
從麥克風捕捉到我的聲音,並且能夠進行某種視覺呈現,我們將實際載入
0:53.960–1:04.159
this model and then we should be able tosee real time uh transcription but whatwe want to showis also that if you go and look at your
這個模型,然後我們應該能夠看到實時的轉錄,但我們想展示的是,如果你去查看你的
1:04.159–1:11.920
network uh right now I have I'm on thiswasm tab and we want to pay attention toboth Fetch and wasm so we're going to go
網路,嗯,現在我在這個 WASM 標籤頁,我們要注意 Fetch 和 WASM,所以我們將前往
1:11.920–1:22.680
ahead and look at the model and you cansee it pulled it in really quickly uhcould be uh because it's cached but uh
查看模型,你可以看到它非常快速地載入,嗯,可能是因為它被快取了,但嗯
1:22.680–1:30.079
this was incredibly fast and it'salready doing the the transcription inreal time you can see that it's trying
這非常快速,它已經在即時進行轉錄,你可以看到它正在嘗試
1:30.079–1:38.560
addpunctuation and uh the token count downhere if we go over to the wasm tab thisall that was loaded it's going
添加標點符號,嗯,以及這裡的計數器,如果我們切換到 WASM 標籤頁,所有這些都已載入,它將
1:38.560–1:48.040
through a worker to establish this andthe size was 4 megabytes so again thiscrazy fast for doing real time uh
透過一個 worker 來建立這個,大小為 4 MB,所以再次強調,這對於在瀏覽器中進行即時轉錄來說非常快速,超級
1:48.040–1:56.200
transcription in the browser superhelpful if you were trying to do uh likechat based systems where you actually
在瀏覽器中進行轉錄非常有用,如果你試圖建立基於聊天的系統,而這些系統實際上
1:56.200–2:07.439
wanted to have voice in with your chatas without having to go out to open AIor some otherum closed Source or even open source
希望將語音整合到你的聊天中,而不需要去呼叫 Open AI 或其他某些
2:07.439–2:14.560
model that uh requires a backend callright again we didn't fetch anythingfrom our back end this was just loaded
閉源或甚至開源的模型,這些模型需要後端呼叫,再次強調,我們沒有從後端獲取任何東西,這只是透過
2:14.560–2:22.680
through the browser so now what we'regoing to do is we're going to take thisand we're going to actually look at the
透過瀏覽器進行,那麼現在我們要做的就是,我們將採取這個方法,並實際查看
2:22.680–2:34.400
repo and and dig into the code so if youcome over here to Transformers Jsthe thing you want to note is you wanto be on uh the
儲存庫拿過來,並深入研究程式碼,所以如果你來到這裡的 Transformer JS,你要注意的是,你要在
2:34.400–2:42.680
V3 Branch this is the the new Branchit's still experimental but it's goingto be the next version of Transformer JS
V3 分支上,這是新的分支,它仍然是實驗性的,但它將是 Transformer JS 的下一個版本
2:42.680–2:46.920
a lot of great examples we've beentrying to go through some of them itfeels like every day they're coming out
有很多很棒的範例,我們一直在嘗試瀏覽其中一些,感覺他們每天都在推出
2:46.920–2:56.959
with a new demo a new model that they'reable to implement um definitely reallycool stuff so if we look at this example
新的示範,新的模型,他們能夠實現,嗯,絕對非常酷的東西,所以如果我們查看這個範例
2:56.959–3:04.239
so we go into Transformer JS examplesand Whisper then we're able to actuallyD dive into this code so what we're
所以我們進入 Transformer JS 範例和 Whisper,然後我們能夠實際深入這個程式碼,所以我們要做的就是將這個
3:04.239–3:08.959
going to do is we're just going to pullthis down get this running on our localmachine and then we'll start digging
下載下來,在我們的本機機器上運行它,然後我們開始深入研究
3:08.959–3:20.519
into the code so I'm going to use cursorI'm already I already have it pulledown but you can do uh get clone andthen come over
程式碼,所以我將使用 Cursor,我已經將它拉下來了,但你可以執行 git clone,然後來到
3:20.519–3:34.640
here and just dothis uh we are so I'm in the root sowhat we need to do is go toexamples and then we're going to do web
這裡,只是執行這個,嗯,我在根目錄,所以我們需要做的是前往 examples,然後我們將執行 web
3:34.640–3:49.680
GPU and go towhisper and we'll do an npminstall and then we'll go ahead and doan npm runDev and what we're going to do is we
GPU 並前往 whisper,我們將執行 npm install,然後我們將執行 npm run dev,而我們要做的就是
3:49.680–4:00.079
have our Local Host here so we can gethis up and running we'll watch reallyquickly if we can gethis uh loaded again super quick you saw
在這裡有我們的本機主機,所以我們可以啟動它,我們將非常快速地查看我們是否能再次載入它,超級快,你看到了
4:00.079–4:06.400
how quickly the the load time was forthat again some of it sometimes it'scashed and the first one's going to be
載入時間有多快,再次強調,其中一些有時會被快取,而第一次載入會
4:06.400–4:20.280
slower but still reallyimpressive so if we look at some of thecore files in here we have our app whichis the main main file and what we're
較慢,但仍然非常令人印象深刻,所以如果我們查看這裡的一些核心檔案,我們有 app,這是主要的檔案,而我們要
4:20.280–4:27.680
going to be looking at is how we'reactually pulling in this worker so thisworker. JS is where we're actually going
查看的是我們如何實際載入這個 worker,所以這個 worker.js 是我們實際上要
4:27.680–4:34.160
to do our Logic for Transformer Js we'repulling in the model we're actuallysending messages back and forth where
執行 Transformer JS 邏輯的地方,我們正在載入模型,我們實際上正在發送訊息來回傳遞,其中
4:34.160–4:44.199
you can see right here that as messagesare coming being received we're actuallygoing to be looking for the type of
你可以看到這裡當訊息被接收時,我們實際上會去尋找事件的類型
4:44.199–4:58.479
event that is being pass and then sendthat uh data as wellso you can see most of this is for likeloading there's uh some update which is
正在傳遞的事件類型,然後發送該資料,所以你可以看到大部分這都是為了載入,有一些更新,這是
4:58.479–5:12.520
where you're updating the textwe're actually going to look and seewhere this is uh is working so if wecontinue down and we are looking at the
你更新文字的地方,我們實際上將查看並查看這是在哪裡運作,所以如果我們繼續向下查看,我們正在查看
5:12.520–5:19.639
recorder this is all the informationabout starting and stopping therecording and then what's Happening Here
recorder,這是關於開始和停止錄音的所有資訊,然後這裡發生了什麼
5:19.639–5:31.479
is we are actually looking at how thisinformation is being sent with this codeso righthere it's saying as the recording is
是我們實際上正在查看這段程式碼如何發送這些資訊,所以在這裡,它說當錄音
5:31.479–5:41.960
coming in we're going to take a blob andchunk it and so then we're going to makea file reader and read those and then
進來時,我們將取得一個 blob 並將其分塊,然後我們將建立一個檔案讀取器並讀取這些,然後
5:41.960–5:57.400
send that on when the file is beingread get that bit information that'sdecoded slice it and then send thoseslices over to our worker so we're
在讀取檔案時發送這些,取得該位元資訊,解碼它,分割它,然後將這些分割部分發送給我們的 worker,所以我們
5:57.400–6:06.039
posting the message to generate ourtranscription on the Fly then this isjust our uh our HTML that we're going to
發送訊息以即時生成我們的轉錄,然後這只是我們將要
6:06.039–6:15.599
be pullingin so what we'll do is we'll jump overto the worker and then we'll take a lookat how this is actually functioning real
載入的 HTML,所以我們將跳轉到 worker,然後我們將查看這實際上是如何即時運作
6:15.599–6:21.319
quick everyone if you haven't alreadyplease remember to like And subscribe ithelps more than you know if you have any
的,大家,如果你還沒有,請記得按讚和訂閱,這比你知道的更有帮助,如果你有任何
6:21.319–6:28.120
questions please leave them in thecomments and with that let's get back toit all right so now that we're in our
請在留言區留下你的問題,接下來讓我們回到正題,好的,現在我們已經進入我們的
6:28.120–6:36.960
worker file we're going to startlooking at how this actually functionsfirst thing is we're loading inTransformers we're going to pull in our
現在我們進入了 worker 檔案,我們將開始查看它實際上的運作方式。第一件事是載入 Transformers,我們將引入 AutoTokenizer、AutoProcessor,以及 whisper 和 text streamer,還有 full。
6:36.960–6:49.000
Autokenizer our Auto processor and then uhwhisper and text stream as well as fullso if we look at what we're first doing
如果我們查看首先執行的動作,我們有一個類別,這是我們的 Pipeline,然後我們實際上使用我們的執行個體,在這裡取得我們的模型。
6:49.000–6:55.280
we have this class which is our Pipelineand then we're actually using ourinstance where we're getting our model
所以我們說這是我們的模型 ID,我們有 tokenizer 和 processor,我們實際上是根據我們的 ID 來取得模型。
6:55.280–7:03.240
so we're saying this is our model ID wehave our tokenizer our processor we'reactually getting the model based on our
在這個階段,我們告訴它 dtype 是什麼,然後特別使用 device webGPU,一旦這些都處理完成。
7:03.240–7:14.280
ID at this point uh we're telling itwhat our dtype is and then specificallywe're using device webGPU and once all of these have processed
我們的 git 執行個體就建立了。如果我們滾動到底部,我們可以大致查看一些載入函數,所以你可以看到這裡有 load,這發生在我們實際發送訊息回來以查看進度條等事項的地方。
7:14.280–7:24.160
uh then our git instance has beenestablished if we scroll down to thebottom we can kind of look at like someof the loader functions so you can see
我們根據我們的訊息建立了一些事件,然後一旦瀏覽器或模型實際載入。
7:24.160–7:32.840
here there's the load this happens likewhere we're actually posting backmessages to actually see see theprogress bar things like that we're
這裡有載入,這發生在我們實際回傳訊息以查看進度條等內容時,我們
7:32.840–7:42.639
stablishing some events based on ourmessage and then once the the browser uhor once the model is actually loaded
並處理語言,然後實際處理它,所以我們首先要做的是說,如果處理返回。
7:42.639–7:51.159
we're going to be looking for thisgenerate function this function is whatreally is going to be taking the audio
如果它不是處理中,則繼續將處理狀態設為 True,維持狀態,我們實際上要發送訊息回來,表示執行緒正在啟動,所以我們將 start 設為狀態。
7:51.159–8:00.120
and taking the language and thenactually processing it so the firsthing we'll be doing is saying is if ifprocessing return
然後我們實際引入我們的執行個體,所以再次設定我們的 tokenizer、processor 和模型的地方,我們實際上是從我們的執行個體中取得它。
8:00.120–8:06.800
if it is not processing then go aheadand set that processing to Truemaintaining State we're actually going
然後我們開始實際處理,所以我們有回呼函數,它將提供我們 post message 的 update 輸出,以及關於我們的 TPS、tokens 和實際輸出的資訊,然後我們有。
8:06.800–8:13.000
to send a message back to say that we'retrans that the thread is starting sowe're saying start as our status and
我們的 streamer,這裡是我們實際處理資訊的地方,所以我們說的是輸入,我們取得音訊,然後透過我們的 processor 處理它,然後這是我們的轉錄,我們的轉錄基於我們的模型和 generate。
8:13.000–8:21.840
then we're actually pulling in ourinstance so again where we set ourtokenizer and our processor and modelwe're actually pulling that from our um
我們說我們傳遞相同的輸入、語言,並且我們實際上是串流事件或串流輸出,所以現在我們有 tokenizer,這給我們顯示在右下角的資訊,關於我們實際使用了多少 tokens,然後我們發送回那部分。
8:21.840–8:29.199
instance and we're starting to actuallyprocess so we have our call backfunction which is going to give us the
文字作為完成,所以請記住,如果我們查看這些 post messages 是什麼,我們回到這裡,這就是 onmessage received 接收的資訊,所以如果我們向下查看 update,我們看到我們設定。
8:29.199–8:40.320
output of our post message of update andinformation about our TPS our tokens andour actual output and then we we have
這裡的 TPS 以及我們的訊息,所以我們的 on message 就在這裡,這是我們發送資訊回來的地方,然後這就是。
8:40.320–8:51.480
our streamer and we this is where we'reactuallyprocessing our information so what we'resaying is our input we're taking our AO
我們實際上下傳資訊的地方,所以這裡是我們的 TPS,然後音訊的其餘進度條,我在尋找實際的文字資訊,哦,就在這裡,所以在 ready 時,我們傳遞文字的資訊。
8:51.480–8:59.440
audio and we're uh putting it throughour processor we then this is ourtranscription our transcription BAS
正在更新,這就是它運作的方式,我們基本上是在取用這個資訊,在通過模型之後,然後就在這裡,由模型產生,然後發送回資訊。
8:59.440–9:05.560
based on our model and our generatewe're saying we're passing our sameinputs our language and we're actually
所以它正在處理自動區塊,它是音訊區塊,然後轉換它並對此進行轉錄,然後它正在串流,它正在進行 tokenizer 並發送所有這些資訊回來,大家好。
9:05.560–9:12.000
streaming the events or streaming theoutput so now we have our tokenizer thisgives us the information that's
今天到此為止,我們涵蓋了使用 Web GPU 和 Transformers JS 在瀏覽器中進行即時語音辨識,我們能夠深入研究一些程式碼庫,並實際讓他們的示範運作起來,所以很高興能與大家分享。
9:12.000–9:19.519
displayed in the bottom right of howmany tokens we're actually using andthen we're posting back that chunk of
在右下角顯示我們實際使用了多少 token,然後我們將完成的那部分
9:19.519–9:27.519
text as it is complete and so rememberif we are looking at what these postmessages are we're coming back here and
文字作為其完成狀態回傳,所以請記住,如果我們查看這些 postMessage 是什麼,我們會回到這裡,並且
9:27.519–9:39.240
that is the information that is being onmessage received so if we look downtoupdate we're seeing that we're setting
這就是正在接收的 onmessage 資訊,所以如果我們向下查看以進行更新,我們會看到我們正在設定
9:39.240–9:50.040
our TPS here as well as uh our messageso our on message right here this iswhere we're being sending theinformation back and then that's how
我們這裡的 TPS 以及訊息,所以我們的 onmessage 就在這裡,我們正在將資訊傳送回去,然後這就是
9:50.040–10:02.800
e're actually passing information downhere so this is where ourTPS is and then uhthe this the rest of the progress bar in
我們實際上將資訊傳遞到這裡的方式,所以這裡就是我們的 TPS,然後進度條的其餘部分在
10:02.800–10:14.399
the audio I'm looking fortheactual uh information around the text ohit's right here so on ready we'repassing the information of the text
音訊中,我在尋找關於文字的實際資訊,哦,就在這裡,所以在 ready 時,我們傳遞文字的資訊
10:14.399–10:22.240
hat's beingupdated and that's how this works is webasically are taking this informationfrom after after it passes passes
正在更新的內容,這就是運作方式,我們基本上是在模型通過之後,從
10:22.240–10:29.920
through the model and then right here sobeing generated by the model and thenposting that information back
通過模型然後就在這裡由模型生成然後將該資訊回傳
10:29.920–10:39.639
so it's processing the auto chunk it isaudio chunk and it's uh then convertingthat and doing a transcription on this
所以它正在處理自動區塊,也就是音訊區塊,然後轉換它並對此進行轉錄
10:39.639–10:46.160
generation then it's streaming it'sdoing the tokenizer and posting all thatinformation back all right everyone
生成,然後串流傳輸,進行 tokenizer 並將所有這些資訊傳送回去,各位好
10:46.160–10:57.040
that's it for us today what we coveredwas using real time speech recognitionin the browser with web GPU andTransformers JS we're able to dig
今天我們就講到這裡,我們介紹了如何在瀏覽器中使用 Web GPU 和 Transformers JS 進行即時語音辨識,我們能夠深入
10:57.040–11:03.000
through some of the repo and actuallyget their demo up and running and sowith that happy nerding
深入這個倉庫,實際啟動他們的示範,然後,快樂地探索技術

影片筆記:How to use Real Time In-Browser Transcription with WebGPU Whisper and Transformer.js

<!-- VIDEONOTE_PUBLICATION_WARNINGS_BEGIN -->

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

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

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

<!-- VIDEONOTE_PUBLICATION_WARNINGS_END -->

一句話總結

本影片演示如何使用 WebGPU 與 Transformers.js (V3 Branch) 在瀏覽器端實現即時語音辨識,透過 Whisper Base 模型與 Web Worker 架構,在不依賴後端伺服器的情況下,於客戶端完成音訊切片、模型推理與即時轉錄。

核心重點

  • 瀏覽器端即時轉錄:利用 WebGPU 加速與 Transformers.js 庫,直接在瀏覽器內運行 Whisper 模型,無需將音訊傳送至後端(如 OpenAI API)。
  • 技術堆疊:
  • WebGPU:提供硬體加速。
  • Transformers.js (V3):實驗性分支,支援瀏覽器端的模型運行。
  • Whisper Base:7300 萬參數的語音辨識模型,轉換為 ONNX 格式以適應瀏覽器環境。
  • Web Worker:將模型載入與推理邏輯移至背景執行緒,避免阻塞主 UI 執行緒。
  • 效能表現:模型載入速度快(約 4MB),透過 Fetch 與 WASM 技術實現快速初始化。
  • 架構設計:
  • 主執行緒 (Main Thread):負責 UI 渲染、錄音控制(開始/停止)、音訊切片(Chunking)及透過 postMessage 傳遞資料。
  • Worker 執行緒:負責載入模型、建立 Pipeline、執行推理(Generate)、處理 Tokenizer 與串流輸出(Streamer),並回傳轉錄結果與效能指標(TPS、Token 數量)。

詳細大綱

1. 演示與概念介紹

  • 歡迎與主題:介紹如何在瀏覽器內實現即時語音辨識(Real-time in-browser speech recognition)。
  • 技術優勢:
  • 無需後端呼叫,避免依賴 OpenAI 或其他需後端支援的閉源/開源模型。
  • 應用場景:聊天系統中整合語音輸入。
  • Hugging Face Space 演示:
  • 展示 Whisper WebGPU 範例。
  • 使用 Whisper Base 模型(73 million parameter speech recognition model)。
  • 結合 ONNX 與 Transformers.js。
  • 即時顯示音訊視覺化與轉錄文字。
  • 效能觀察:Fetch 與 WASM 載入速度極快(約 4MB)。

2. 程式碼結構與環境設置

  • 倉庫位置:進入 Transformers.js 倉庫(Repo)。
  • 版本要求:必須使用 V3 Branch(實驗性,下一版本)。
  • 本地運行步驟:
  • 路徑:examples -> web GPU -> whisper。
  • 指令:執行 npm install 後,運行 npm run Dev。
  • 透過 Localhost 啟動開發伺服器。

3. 核心檔案邏輯分析

  • App 檔案 (app.js):主要入口點。
  • Worker 檔案 (worker.js):
  • 負責 Transformers.js 的核心邏輯。
  • 載入模型並透過 postMessage 與主執行緒通訊。
  • 監聽事件類型並傳遞資料。
  • Recorder 邏輯(主執行緒):
  • 控制開始/停止錄音。
  • 將音訊 Blob 切片(Chunk)。
  • 使用 FileReader 讀取並解碼音訊。
  • 切片後透過 postMessage 發送給 Worker 進行即時轉錄。
  • HTML:負責介面顯示。

4. Worker 內部運作機制

  • 載入階段:
  • 匯入模組:Transformers、AutoTokenizer、AutoProcessor、Whisper、TextStreamer、pipeline。
  • 建立 Pipeline 類別與 instance。
  • 設定模型 ID、Tokenizer、Processor。
  • 設定 dtype 與 device: webGPU。
  • 建立 Git instance(註:逐字稿用詞,疑點見下文)。
  • 載入函數與狀態管理:
  • 處理進度條訊息。
  • 監聽 generate 函數。
  • 檢查處理狀態(processing),若未處理則設為 True。
  • 發送 start 狀態訊息。
  • 生成與串流處理 (generate):
  • 獲取 Tokenizer、Processor 與 Model instance。
  • 回呼函數(Callback):處理 postMessage 的 update 訊息,提供 TPS、Token 數量與輸出。
  • Streamer:處理音訊輸入,透過 Processor 處理。
  • 基於模型與 generate 進行轉錄。
  • 傳遞相同輸入與語言設定,串流輸出事件。
  • Tokenizer 顯示右下角 Token 數量。
  • 發送完成文字區塊。
  • 訊息傳遞循環:
  • onmessage 接收 Worker 回傳的 TPS 與訊息。
  • on ready 傳遞更新後的文字資訊。
  • 流程總結:音訊切片 -> 模型處理 -> 轉錄生成 -> Tokenizer -> 串流回傳 -> 更新 UI。

工具 / 模型 / 名詞整理

  • Nning IO:影片頻道名稱(逐字稿聽寫,疑點見下文)。
  • JD:講者名稱。
  • Hugging Face Space:演示平台。
  • Whisper WebGPU:演示專案名稱。
  • Whisper Base:模型名稱,73 million parameter speech recognition model。
  • ONNX:模型格式。
  • Transformer JS / Transformers.js:JavaScript 版本的 Hugging Face Transformers 庫。
  • WASM:WebAssembly,用於提升瀏覽器端效能。
  • Open AI:提及作為需後端呼叫的閉源模型範例。
  • Cursor:開發工具。
  • Git:版本控制工具(逐字稿提及 "git instance",疑點見下文)。
  • NPM:套件管理工具。
  • Web Worker:瀏覽器背景執行緒技術。
  • postMessage:Worker 與主執行緒通訊的 API。
  • Pipeline:Transformers.js 中的高階抽象,用於簡化模型推理流程。
  • Tokenizer:將文字轉換為 Token 的組件。
  • Processor:處理音訊輸入的組件。
  • Streamer:處理串流輸出的組件。
  • TPS:Tokens Per Second,效能指標。

操作流程整理

  1. 環境準備:
  • 克隆或進入 Transformers.js 倉庫。
  • 切換至 V3 Branch。
  • 進入 examples/web GPU/whisper 目錄。
  • 執行 npm install 安裝依賴。
  • 執行 npm run Dev 啟動本地伺服器。
  1. 主執行緒 (UI) 操作:
  • 使用者點擊錄音按鈕。
  • Recorder 邏輯啟動,開始錄製音訊 Blob。
  • 音訊被切片(Chunk)。
  • 使用 FileReader 解碼音訊。
  • 透過 postMessage 將切片音訊發送給 Worker。
  1. Worker 執行緒 (後台) 操作:
  • 初始化:匯入必要模組,建立 Pipeline,設定 device: webGPU 與 dtype。
  • 載入模型:下載並載入 Whisper Base 模型(ONNX 格式)。
  • 接收音訊:監聽來自主執行緒的音訊資料。
  • 推理處理:
  • 使用 Processor 處理音訊輸入。
  • 呼叫 generate 函數進行轉錄。
  • 使用 Streamer 處理串流輸出。
  • 狀態回報:
  • 計算並回報 TPS 與 Token 數量。
  • 透過 postMessage 將轉錄文字與狀態更新發送回主執行緒。
  1. 結果顯示:
  • 主執行緒接收 Worker 回傳的文字。
  • 更新 UI 顯示即時轉錄內容。
  • 顯示效能指標(TPS、Token 數量)。

值得注意的限制或風險

  • 版本依賴:需使用 Transformers.js 的 V3 Branch(實驗性版本),穩定性可能較低。
  • 硬體要求:依賴 WebGPU,需瀏覽器與硬體支援 WebGPU 技術。
  • 模型大小:雖為 Base 模型(73 million parameter),但仍需下載約 4MB 的模型檔案,首次載入需時間。
  • 瀏覽器相容性:WebGPU 與特定瀏覽器 API 的相容性可能影響功能運作。
  • 音訊切片策略:即時轉錄依賴音訊切片(Chunking),切片大小與頻率可能影響轉錄準確性與延遲。

逐字稿辨識疑點

  • Nning IO:逐字稿開頭為 "hey everyone welcome to nning IO",疑為頻道名稱聽寫錯誤,需查證正確頻道名稱。
  • whisper webGPO:逐字稿中出現 "webGPO",疑為 "WebGPU" 之聽寫錯誤。
  • speech recognition mod model:重複單字 "mod model",疑為口誤或聽寫錯誤。
  • audio audio visualizer:重複單字 "audio",疑為口誤。
  • addpunctuation:逐字稿寫為 "addpunctuation",疑為 "add punctuation" 之連寫或聽寫錯誤。
  • token count downhere:語意稍顯模糊,指代畫面下方的 token 計數。
  • wasm tab:指瀏覽器開發者工具中的 WASM 標籤頁。
  • V3 Branch:指 Transformers.js 的分支版本。
  • git instance:逐字稿中說 "our git instance has been established",在程式碼上下文通常指 "pipeline instance" 或 "model instance","git" 疑為聽寫錯誤。
  • firsthing:逐字稿寫為 "firsthing",疑為 "first thing" 之聽寫錯誤。
  • AO audio:逐字稿寫為 "AO audio",疑為 "audio" 之聽寫錯誤或口誤。
  • transcription BAS:逐字稿寫為 "transcription BAS",疑為 "transcription based" 之聽寫錯誤。
  • e're:逐字稿寫為 "e're actually passing",疑為 "we're" 之聽寫錯誤。
  • hat's being updated:逐字稿寫為 "hat's being updated",疑為 "that's" 之聽寫錯誤。
  • after after it passes passes:重複單字,疑為口誤。
  • happy nerding:逐字稿結尾用語,疑為頻道或社群特定用語。

可延伸追問

  • WebGPU 在不同瀏覽器(Chrome, Firefox, Safari)中的支援程度與效能差異為何?
  • Whisper Base 模型在瀏覽器端的轉錄準確率與伺服器端相比如何?
  • 如何優化音訊切片(Chunking)策略以平衡延遲與準確性?
  • Transformers.js V3 Branch 的穩定性與未來版本規劃為何?
  • 除了 Whisper,是否支援其他語音辨識模型在瀏覽器端運行?

生字列表

生字讀音類型中文
real time/ˌriːəl ˈtaɪm/adjective即時、即時處理
demo/ˈdɛmoʊ/noun示範、展示
parameter/pəˈræmɪtər/noun參數
transcription/trænsˈkrɪpʃən/noun轉錄、文字轉錄
punctuation/ˈpʌŋktʃuˈeɪʃən/noun標點符號
cached/kæʃt/adjective快取的、暫存的
worker/ˈwɜːrkər/noun工作線程、Web Worker
repo/ˈrɛpoʊ/noun倉庫、程式碼庫
experimental/ˌɛksprɪˈmɛntəl/adjective實驗性的
implement/ˈɪmplɪmɛnt/verb實現、實施
blob/blɑːb/noun二進制大物件
instance/ˈɪnstəns/noun執行個體、實例
dtype/diː taɪp/noun數據類型
streaming/ˈstriːmɪŋ/verb串流、串流傳輸
nerding/ˈnɜːrdɪŋ/verb沉迷於技術細節、極客精神

生字解說

real time /ˌriːəl ˈtaɪm/

adjective · B2

意思:即時、即時處理

解說:指數據處理或反應發生在極短的時間內,幾乎沒有延遲。在技術語境中,常形容系統能立即回應輸入。

影片原句
today we're going to be looking at real time in browser speech recognition
今天我們將探討在瀏覽器中即時進行語音辨識。
延伸例句
The real time translation feature helps travelers communicate instantly.
即時翻譯功能幫助旅客立即溝通。

demo /ˈdɛmoʊ/

noun · B1

意思:示範、展示

解說:Demonstration 的縮寫,指展示產品功能或軟體運作方式的簡短演示。

影片原句
look at this demo for the whisper webGPO
查看這個 Whisper WebGPU 的示範。
延伸例句
The company released a demo of their new software.
公司發布了新軟體的示範版本。

parameter /pəˈræmɪtər/

noun · C1

意思:參數

解說:在機器學習中,指模型內部用於學習數據模式的數值。參數越多,模型通常越複雜且準確。

影片原句
it's using the whisper base which is a 73 million parameter speech recognition model
使用的是 Whisper Base,這是一個擁有 7300 萬參數的語音辨識模型。
延伸例句
Adjusting the learning rate parameter is crucial for training.
調整學習率參數對於訓練至關重要。

transcription /trænsˈkrɪpʃən/

noun · C1

意思:轉錄、文字轉錄

解說:將語音轉換為文字的過程或結果。在 AI 語音辨識中,指模型輸出的文字內容。

影片原句
we should be able to see real time uh transcription
我們應該能夠看到實時的轉錄。
延伸例句
The transcription of the meeting was sent to all attendees.
會議的轉錄文字已發送給所有與會者。

punctuation /ˈpʌŋktʃuˈeɪʃən/

noun · B1

意思:標點符號

解說:用於分隔句子結構的符號,如句號、逗號等。現代語音模型能自動添加標點以提升可讀性。

影片原句
it's trying to add punctuation
它正在嘗試添加標點符號。
延伸例句
Proper punctuation makes the text easier to read.
正確的標點符號使文本更易閱讀。

cached /kæʃt/

adjective · B2

意思:快取的、暫存的

解說:指數據已被瀏覽器或系統暫存,以便下次快速載入,無需重新從伺服器下載。

影片原句
could be uh because it's cached
可能是因為它被快取了。
延伸例句
The website loads faster because the images are cached.
網站載入更快,因為圖片已被快取。

worker /ˈwɜːrkər/

noun · C1

意思:工作線程、Web Worker

解說:在瀏覽器環境中,指在背景執行腳本操作的物件,不影響主執行緒的 UI 渲染。

影片原句
it's going through a worker to establish this
它將透過一個 worker 來建立這個。
延伸例句
We use a Web Worker to handle heavy calculations.
我們使用 Web Worker 來處理繁重的計算。

repo /ˈrɛpoʊ/

noun · B2

意思:倉庫、程式碼庫

解說:Repository 的縮寫,指存放程式碼、文件和其他專案檔案的目錄或伺服器位置。

影片原句
look at the repo and and dig into the code
查看儲存庫拿過來,並深入研究程式碼。
延伸例句
The open source repo contains all the necessary scripts.
開源倉庫包含所有必要的腳本。

experimental /ˌɛksprɪˈmɛntəl/

adjective · B2

意思:實驗性的

解說:指功能或技術尚處於測試階段,可能不穩定或尚未正式發布。

影片原句
it's still experimental but it's going to be the next version
它仍然是實驗性的,但它將是下一個版本。
延伸例句
This feature is currently experimental and may change.
此功能目前處於實驗階段,可能會變更。

implement /ˈɪmplɪmɛnt/

verb · B2

意思:實現、實施

解說:指將理論或設計轉化為實際可運作的程式碼或功能。

影片原句
a new model that they're able to implement
新的模型,他們能夠實現。
延伸例句
The team implemented a new security protocol.
團隊實施了新的安全協議。

blob /blɑːb/

noun · C1

意思:二進制大物件

解說:Binary Large Object 的縮寫,指二進制數據的集合,常用於儲存音訊、影像等文件。

影片原句
we're going to take a blob and chunk it
我們將取得一個 blob 並將其分塊。
延伸例句
The API returns audio data as a blob.
API 以 blob 形式返回音訊數據。

instance /ˈɪnstəns/

noun · B2

意思:執行個體、實例

解說:指類別(Class)被具體化後的對象,擁有特定的狀態和行為。

影片原句
we're actually using our instance where we're getting our model
我們實際上使用我們的執行個體,在這裡取得我們的模型。
延伸例句
Each user has their own instance of the application.
每個用戶都有自己應用程式的執行個體。

dtype /diː taɪp/

noun · C1

意思:數據類型

解說:Data Type 的縮寫,指數據在記憶體中的格式(如 float32, int64),影響計算精度和速度。

影片原句
we're telling it what our dtype is
我們告訴它 dtype 是什麼。
延伸例句
Setting the correct dtype can improve performance.
設定正確的數據類型可以提高效能。

streaming /ˈstriːmɪŋ/

verb · B2

意思:串流、串流傳輸

解說:指數據以連續流的形式發送和接收,而非等待整個文件下載完成。

影片原句
we're actually streaming the events or streaming the output
我們實際上是串流事件或串流輸出。
延伸例句
Video streaming services deliver content in real time.
視訊串流服務即時提供內容。

nerding /ˈnɜːrdɪŋ/

verb · C1

意思:沉迷於技術細節、極客精神

解說:源於 'nerd',指對技術、科學或特定領域有濃厚興趣並深入鑽研的行為,此處為幽默用法。

影片原句
with that happy nerding
快樂地探索技術。
延伸例句
He enjoys nerding out over new programming languages.
他喜歡沉迷於研究新的程式語言。

句型解說(含實例)

going to be [verb]ing

意思:將要進行(進行式未來)

接續:Subject + going to be + Present Participle (V-ing)

解說:用於強調未來某個時間點正在進行的動作,或表達一種持續的狀態。比簡單的 'will' 更具體和生動。

影片原句
today we're going to be looking at real time in browser speech recognition
今天我們將探討在瀏覽器中即時進行語音辨識。
實例
  1. We are going to be testing the new algorithm tomorrow.
    我們明天將要測試新演算法。
  2. They are going to be working on the project all week.
    他們將要整週都在處理這個專案。

what we're going to do is [verb]

意思:我們要做的就是...

接續:What + Subject + going to do + is + Base Verb

解說:用於引導觀眾或聽眾關注接下來的具體步驟或行動,常見於教學或演示影片中。

影片原句
basically what we're going to do is look at this demo
基本上我們要做的就是查看這個示範。
實例
  1. What we're going to do is install the package first.
    我們要做的就是先安裝套件。
  2. What we're going to do is analyze the data carefully.
    我們要做的就是仔細分析數據。

if you go and [verb]

意思:如果你去...

接續:If + Subject + go and + Base Verb

解說:用於引導聽眾執行某個動作並觀察結果,常帶有建議或指示的語氣。

影片原句
if you go and look at your network
如果你去查看你的網路。
實例
  1. If you go and check the logs, you'll see the error.
    如果你去檢查日誌,你會看到錯誤。
  2. If you go and run the script, it will generate the file.
    如果你去執行腳本,它將生成文件。

we're going to [verb] and [verb]

意思:我們將要...並且...

接續:Subject + going to + Verb 1 + and + Verb 2

解說:連接兩個連續的動作,表示一系列即將執行的步驟。

影片原句
we're going to go ahead and look at the model
我們將前往查看模型。
實例
  1. We're going to download and install the library.
    我們將下載並安裝函式庫。
  2. You're going to click and drag the element.
    你將要點擊並拖曳該元素。

so [conjunction] [clause]

意思:所以...

接續:So + Clause

解說:用於總結前文或引出結論,在口語中常作為連接詞使用,表示因果或順承關係。

影片原句
so you can see that the audio visualizer is already picking up my voice
所以你可以看到音訊視覺化器已經從麥克風捕捉到我的聲音。
實例
  1. So the system automatically saves your progress.
    所以系統會自動保存你的進度。
  2. So we need to configure the settings correctly.
    所以我們需要正確設定設定。

what we're going to do is we're going to [verb]

意思:我們要做的就是我們將要...

接續:What + Subject + going to do + is + Subject + going to + Verb

解說:強調接下來的具體行動,重複 'going to' 以加強語氣,常見於口語解釋中。

影片原句
what we're going to do is we're going to take this and we're going to actually look at the repo
現在我們要做的就是,我們將採取這個方法,並實際查看儲存庫。
實例
  1. What we're going to do is we're going to restart the server.
    我們要做的就是重新啟動伺服器。
  2. What we're going to do is we're going to review the code.
    我們要做的就是審查程式碼。

if we [verb] [noun], we're going to [verb]

意思:如果我們...,我們將要...

接續:If + Subject + Verb + Object, Subject + going to + Verb

解說:條件句,描述在特定動作發生後將產生的結果或採取的後續行動。

影片原句
if we look at some of the core files in here we have our app
所以如果我們查看這裡的一些核心檔案,我們有 app。
實例
  1. If we check the documentation, we'll find the answer.
    如果我們查閱文件,我們會找到答案。
  2. If we run the test, we'll see the results.
    如果我們執行測試,我們會看到結果。

where [clause]

意思:在那裡/在...情況下

接續:Relative Clause starting with 'where'

解說:關係副詞引導的從句,用於描述位置、情況或抽象的「場合」。

影片原句
this worker. JS is where we're actually going to do our Logic
所以這個 worker.js 是我們實際上要執行 Transformer JS 邏輯的地方。
實例
  1. This is the folder where we store our assets.
    這是我們存放資產的資料夾。
  2. That's the point where the process stops.
    那就是流程停止的點。