import{S as $a,i as Wa,s as Sa,e as l,k as h,w as d,t as r,M as Ea,c as n,d as t,m as c,a as o,x as m,h as p,b as y,N as Aa,G as a,g as i,y as M,q as w,o as f,B as u,v as _a}from"../../chunks/vendor-hf-doc-builder.js";import{T as Na}from"../../chunks/Tip-hf-doc-builder.js";import{I as Yt}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as U}from"../../chunks/CodeBlock-hf-doc-builder.js";function xa(Pe){let T,G,b,I,k,j,F;return{c(){T=r("You can also instantiate the "),G=l("code"),b=r("ASRDiarizationPipeline"),I=r(` directly from pre-trained by specifying the model id
    of an ASR model on the Hub:
    `),k=l("p"),j=l("code"),F=r('pipeline = ASRDiarizationPipeline.from_pretrained("openai/whisper-base")')},l(J){T=p(J,"You can also instantiate the "),G=n(J,"CODE",{});var C=o(G);b=p(C,"ASRDiarizationPipeline"),C.forEach(t),I=p(J,` directly from pre-trained by specifying the model id
    of an ASR model on the Hub:
    `),k=n(J,"P",{});var q=o(k);j=n(q,"CODE",{});var g=o(j);F=p(g,'pipeline = ASRDiarizationPipeline.from_pretrained("openai/whisper-base")'),g.forEach(t),q.forEach(t)},m(J,C){i(J,T,C),i(J,G,C),a(G,b),i(J,I,C),i(J,k,C),a(k,j),a(j,F)},d(J){J&&t(T),J&&t(G),J&&t(I),J&&t(k)}}}function Qa(Pe){let T,G,b,I,k,j,F,J,C,q,g,Ht,Ae,Dt,Pt,Y,Lt,Kt,Le,H,_e,Ys,Ke,Z,E,Ne,D,Ot,xe,es,Oe,Ie,ts,et,A,ss,P,as,is,tt,L,st,B,ls,K,ns,os,O,rs,ps,at,je,hs,it,ee,lt,_,cs,te,ys,ds,nt,se,ot,ge,ms,rt,ae,pt,N,Ms,Qe,ws,fs,ht,ie,ct,le,yt,ke,us,dt,$,x,ze,ne,Js,Re,Us,mt,v,Ts,oe,bs,Is,re,js,gs,Mt,pe,wt,Q,ks,Xe,Gs,Cs,ft,he,ut,ce,Jt,Ge,Bs,Ut,W,z,Ve,ye,vs,Fe,Zs,Tt,Ce,$s,bt,R,Ws,qe,Ss,Es,It,de,jt,X,As,me,Ye,_s,Ns,gt,Me,kt,V,Gt,Be,xs,Ct,we,Bt,fe,vt,ve,Qs,Zt,Ze,zs,$t,ue,Wt,$e,Rs,St,Je,Et,Ue,At,S,Xs,He,Vs,Fs,Te,qs,_t;return j=new Yt({}),D=new Yt({}),L=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMC0tdXBncmFkZSUyMHB5YW5ub3RlLmF1ZGlv",highlighted:"pip install --upgrade pyannote.audio"}}),ee=new U({props:{code:"ZnJvbSUyMHB5YW5ub3RlLmF1ZGlvJTIwaW1wb3J0JTIwUGlwZWxpbmUlMEElMEFkaWFyaXphdGlvbl9waXBlbGluZSUyMCUzRCUyMFBpcGVsaW5lLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJweWFubm90ZSUyRnNwZWFrZXItZGlhcml6YXRpb24lNDAyLjElMjIlMkMlMjB1c2VfYXV0aF90b2tlbiUzRFRydWUlMEEp",highlighted:`<span class="hljs-keyword">from</span> pyannote.audio <span class="hljs-keyword">import</span> Pipeline

diarization_pipeline = Pipeline.from_pretrained(
    <span class="hljs-string">&quot;pyannote/speaker-diarization@2.1&quot;</span>, use_auth_token=<span class="hljs-literal">True</span>
)`}}),se=new U({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBY29uY2F0ZW5hdGVkX2xpYnJpc3BlZWNoJTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMCUyMnNhbmNoaXQtZ2FuZGhpJTJGY29uY2F0ZW5hdGVkX2xpYnJpc3BlZWNoJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiUyMiUyQyUyMHN0cmVhbWluZyUzRFRydWUlMEEpJTBBc2FtcGxlJTIwJTNEJTIwbmV4dChpdGVyKGNvbmNhdGVuYXRlZF9saWJyaXNwZWVjaCkp",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

concatenated_librispeech = load_dataset(
    <span class="hljs-string">&quot;sanchit-gandhi/concatenated_librispeech&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>, streaming=<span class="hljs-literal">True</span>
)
sample = <span class="hljs-built_in">next</span>(<span class="hljs-built_in">iter</span>(concatenated_librispeech))`}}),ae=new U({props:{code:"ZnJvbSUyMElQeXRob24uZGlzcGxheSUyMGltcG9ydCUyMEF1ZGlvJTBBJTBBQXVkaW8oc2FtcGxlJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHJhdGUlM0RzYW1wbGUlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMnNhbXBsaW5nX3JhdGUlMjIlNUQp",highlighted:`<span class="hljs-keyword">from</span> IPython.display <span class="hljs-keyword">import</span> Audio

Audio(sample[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], rate=sample[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;sampling_rate&quot;</span>])`}}),ie=new U({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFpbnB1dF90ZW5zb3IlMjAlM0QlMjB0b3JjaC5mcm9tX251bXB5KHNhbXBsZSU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIyYXJyYXklMjIlNUQlNUJOb25lJTJDJTIwJTNBJTVEKS5mbG9hdCgpJTBBb3V0cHV0cyUyMCUzRCUyMGRpYXJpemF0aW9uX3BpcGVsaW5lKCUwQSUyMCUyMCUyMCUyMCU3QiUyMndhdmVmb3JtJTIyJTNBJTIwaW5wdXRfdGVuc29yJTJDJTIwJTIyc2FtcGxlX3JhdGUlMjIlM0ElMjBzYW1wbGUlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMnNhbXBsaW5nX3JhdGUlMjIlNUQlN0QlMEEpJTBBJTBBb3V0cHV0cy5mb3JfanNvbigpJTVCJTIyY29udGVudCUyMiU1RA==",highlighted:`<span class="hljs-keyword">import</span> torch

input_tensor = torch.from_numpy(sample[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>][<span class="hljs-literal">None</span>, :]).<span class="hljs-built_in">float</span>()
outputs = diarization_pipeline(
    {<span class="hljs-string">&quot;waveform&quot;</span>: input_tensor, <span class="hljs-string">&quot;sample_rate&quot;</span>: sample[<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;sampling_rate&quot;</span>]}
)

outputs.for_json()[<span class="hljs-string">&quot;content&quot;</span>]`}}),le=new U({props:{code:"JTVCJTdCJ3NlZ21lbnQnJTNBJTIwJTdCJ3N0YXJ0JyUzQSUyMDAuNDk3ODEyNSUyQyUyMCdlbmQnJTNBJTIwMTQuNTIwOTM3NTAwMDAwMDAyJTdEJTJDJTBBJTIwJTIwJ3RyYWNrJyUzQSUyMCdCJyUyQyUwQSUyMCUyMCdsYWJlbCclM0ElMjAnU1BFQUtFUl8wMSclN0QlMkMlMEElMjAlN0Inc2VnbWVudCclM0ElMjAlN0Inc3RhcnQnJTNBJTIwMTUuMzY0Njg3NTAwMDAwMDAyJTJDJTIwJ2VuZCclM0ElMjAyMS4zNzIxODc1JTdEJTJDJTBBJTIwJTIwJ3RyYWNrJyUzQSUyMCdBJyUyQyUwQSUyMCUyMCdsYWJlbCclM0ElMjAnU1BFQUtFUl8wMCclN0QlNUQ=",highlighted:`[{&#x27;segment&#x27;: {&#x27;start&#x27;: 0.4978125, &#x27;end&#x27;: 14.520937500000002},
  &#x27;track&#x27;: &#x27;B&#x27;,
  &#x27;label&#x27;: &#x27;SPEAKER_01&#x27;},
 {&#x27;segment&#x27;: {&#x27;start&#x27;: 15.364687500000002, &#x27;end&#x27;: 21.3721875},
  &#x27;track&#x27;: &#x27;A&#x27;,
  &#x27;label&#x27;: &#x27;SPEAKER_00&#x27;}]`}}),ne=new Yt({}),pe=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBYXNyX3BpcGVsaW5lJTIwJTNEJTIwcGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwJTIyYXV0b21hdGljLXNwZWVjaC1yZWNvZ25pdGlvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyb3BlbmFpJTJGd2hpc3Blci1iYXNlJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

asr_pipeline = pipeline(
    <span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>,
    model=<span class="hljs-string">&quot;openai/whisper-base&quot;</span>,
)`}}),he=new U({props:{code:"YXNyX3BpcGVsaW5lKCUwQSUyMCUyMCUyMCUyMHNhbXBsZSU1QiUyMmF1ZGlvJTIyJTVELmNvcHkoKSUyQyUwQSUyMCUyMCUyMCUyMGdlbmVyYXRlX2t3YXJncyUzRCU3QiUyMm1heF9uZXdfdG9rZW5zJTIyJTNBJTIwMjU2JTdEJTJDJTBBJTIwJTIwJTIwJTIwcmV0dXJuX3RpbWVzdGFtcHMlM0RUcnVlJTJDJTBBKQ==",highlighted:`asr_pipeline(
    sample[<span class="hljs-string">&quot;audio&quot;</span>].copy(),
    generate_kwargs={<span class="hljs-string">&quot;max_new_tokens&quot;</span>: <span class="hljs-number">256</span>},
    return_timestamps=<span class="hljs-literal">True</span>,
)`}}),ce=new U({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJTIydGV4dCUyMiUzQSUyMCUyMiUyMFRoZSUyMHNlY29uZCUyMGFuZCUyMGltcG9ydGFuY2UlMjBpcyUyMGFzJTIwZm9sbG93cy4lMjBTb3ZlcmVpZ250eSUyMG1heSUyMGJlJTIwZGVmaW5lZCUyMHRvJTIwYmUlMjB0aGUlMjByaWdodCUyMG9mJTIwbWFraW5nJTIwbGF3cy4lMjBJbiUyMEZyYW5jZSUyQyUyMHRoZSUyMGtpbmclMjByZWFsbHklMjBleGVyY2lzZXMlMjBhJTIwcG9ydGlvbiUyMG9mJTIwdGhlJTIwc292ZXJlaWduJTIwcG93ZXIlMkMlMjBzaW5jZSUyMHRoZSUyMGxhd3MlMjBoYXZlJTIwbm8lMjB3ZWlnaHQuJTIwSGUlMjB3YXMlMjBpbiUyMGElMjBmYXZvcmVkJTIwc3RhdGUlMjBvZiUyMG1pbmQlMkMlMjBvd2luZyUyMHRvJTIwdGhlJTIwYmxpZ2h0JTIwaGlzJTIwd2lmZSdzJTIwYWN0aW9uJTIwdGhyZWF0ZW5lZCUyMHRvJTIwY2FzdCUyMHVwb24lMjBoaXMlMjBlbnRpcmUlMjBmdXR1cmUuJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyY2h1bmtzJTIyJTNBJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTIydGltZXN0YW1wJTIyJTNBJTIwKDAuMCUyQyUyMDMuNTYpJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMiUyMFRoZSUyMHNlY29uZCUyMGFuZCUyMGltcG9ydGFuY2UlMjBpcyUyMGFzJTIwZm9sbG93cy4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJ0aW1lc3RhbXAlMjIlM0ElMjAoMy41NiUyQyUyMDcuODQpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydGV4dCUyMiUzQSUyMCUyMiUyMFNvdmVyZWlnbnR5JTIwbWF5JTIwYmUlMjBkZWZpbmVkJTIwdG8lMjBiZSUyMHRoZSUyMHJpZ2h0JTIwb2YlMjBtYWtpbmclMjBsYXdzLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnRpbWVzdGFtcCUyMiUzQSUyMCg3Ljg0JTJDJTIwMTMuODgpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydGV4dCUyMiUzQSUyMCUyMiUyMEluJTIwRnJhbmNlJTJDJTIwdGhlJTIwa2luZyUyMHJlYWxseSUyMGV4ZXJjaXNlcyUyMGElMjBwb3J0aW9uJTIwb2YlMjB0aGUlMjBzb3ZlcmVpZ24lMjBwb3dlciUyQyUyMHNpbmNlJTIwdGhlJTIwbGF3cyUyMGhhdmUlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0IlMjJ0aW1lc3RhbXAlMjIlM0ElMjAoMTMuODglMkMlMjAxNS40OCklMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyJTIwbm8lMjB3ZWlnaHQuJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydGltZXN0YW1wJTIyJTNBJTIwKDE1LjQ4JTJDJTIwMTkuNDQpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIydGV4dCUyMiUzQSUyMCUyMiUyMEhlJTIwd2FzJTIwaW4lMjBhJTIwZmF2b3JlZCUyMHN0YXRlJTIwb2YlMjBtaW5kJTJDJTIwb3dpbmclMjB0byUyMHRoZSUyMGJsaWdodCUyMGhpcyUyMHdpZmUncyUyMGFjdGlvbiUyMHRocmVhdGVuZWQlMjB0byUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUyMnRpbWVzdGFtcCUyMiUzQSUyMCgxOS40NCUyQyUyMDIxLjI4KSUyQyUyMCUyMnRleHQlMjIlM0ElMjAlMjIlMjBjYXN0JTIwdXBvbiUyMGhpcyUyMGVudGlyZSUyMGZ1dHVyZS4lMjIlN0QlMkMlMEElMjAlMjAlMjAlMjAlNUQlMkMlMEElN0Q=",highlighted:`{
    &quot;text&quot;: &quot; The second and importance is as follows. Sovereignty may be defined to be the right of making laws. In France, the king really exercises a portion of the sovereign power, since the laws have no weight. He was in a favored state of mind, owing to the blight his wife&#x27;s action threatened to cast upon his entire future.&quot;,
    &quot;chunks&quot;: [
        {&quot;timestamp&quot;: (0.0, 3.56), &quot;text&quot;: &quot; The second and importance is as follows.&quot;},
        {
            &quot;timestamp&quot;: (3.56, 7.84),
            &quot;text&quot;: &quot; Sovereignty may be defined to be the right of making laws.&quot;,
        },
        {
            &quot;timestamp&quot;: (7.84, 13.88),
            &quot;text&quot;: &quot; In France, the king really exercises a portion of the sovereign power, since the laws have&quot;,
        },
        {&quot;timestamp&quot;: (13.88, 15.48), &quot;text&quot;: &quot; no weight.&quot;},
        {
            &quot;timestamp&quot;: (15.48, 19.44),
            &quot;text&quot;: &quot; He was in a favored state of mind, owing to the blight his wife&#x27;s action threatened to&quot;,
        },
        {&quot;timestamp&quot;: (19.44, 21.28), &quot;text&quot;: &quot; cast upon his entire future.&quot;},
    ],
}`}}),ye=new Yt({}),de=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMGdpdCUyQmh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmh1Z2dpbmdmYWNlJTJGc3BlZWNoYm94",highlighted:"pip install git+https://github.com/huggingface/speechbox"}}),Me=new U({props:{code:"ZnJvbSUyMHNwZWVjaGJveCUyMGltcG9ydCUyMEFTUkRpYXJpemF0aW9uUGlwZWxpbmUlMEElMEFwaXBlbGluZSUyMCUzRCUyMEFTUkRpYXJpemF0aW9uUGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwYXNyX3BpcGVsaW5lJTNEYXNyX3BpcGVsaW5lJTJDJTIwZGlhcml6YXRpb25fcGlwZWxpbmUlM0RkaWFyaXphdGlvbl9waXBlbGluZSUwQSk=",highlighted:`<span class="hljs-keyword">from</span> speechbox <span class="hljs-keyword">import</span> ASRDiarizationPipeline

pipeline = ASRDiarizationPipeline(
    asr_pipeline=asr_pipeline, diarization_pipeline=diarization_pipeline
)`}}),V=new Na({props:{$$slots:{default:[xa]},$$scope:{ctx:Pe}}}),we=new U({props:{code:"cGlwZWxpbmUoc2FtcGxlJTVCJTIyYXVkaW8lMjIlNUQuY29weSgpKQ==",highlighted:'pipeline(sample[<span class="hljs-string">&quot;audio&quot;</span>].copy())'}}),fe=new U({props:{code:"JTVCJTdCJ3NwZWFrZXInJTNBJTIwJ1NQRUFLRVJfMDEnJTJDJTBBJTIwJTIwJ3RleHQnJTNBJTIwJyUyMFRoZSUyMHNlY29uZCUyMGFuZCUyMGltcG9ydGFuY2UlMjBpcyUyMGFzJTIwZm9sbG93cy4lMjBTb3ZlcmVpZ250eSUyMG1heSUyMGJlJTIwZGVmaW5lZCUyMHRvJTIwYmUlMjB0aGUlMjByaWdodCUyMG9mJTIwbWFraW5nJTIwbGF3cy4lMjBJbiUyMEZyYW5jZSUyQyUyMHRoZSUyMGtpbmclMjByZWFsbHklMjBleGVyY2lzZXMlMjBhJTIwcG9ydGlvbiUyMG9mJTIwdGhlJTIwc292ZXJlaWduJTIwcG93ZXIlMkMlMjBzaW5jZSUyMHRoZSUyMGxhd3MlMjBoYXZlJTIwbm8lMjB3ZWlnaHQuJyUyQyUwQSUyMCUyMCd0aW1lc3RhbXAnJTNBJTIwKDAuMCUyQyUyMDE1LjQ4KSU3RCUyQyUwQSUyMCU3QidzcGVha2VyJyUzQSUyMCdTUEVBS0VSXzAwJyUyQyUwQSUyMCUyMCd0ZXh0JyUzQSUyMCUyMiUyMEhlJTIwd2FzJTIwaW4lMjBhJTIwZmF2b3JlZCUyMHN0YXRlJTIwb2YlMjBtaW5kJTJDJTIwb3dpbmclMjB0byUyMHRoZSUyMGJsaWdodCUyMGhpcyUyMHdpZmUncyUyMGFjdGlvbiUyMHRocmVhdGVuZWQlMjB0byUyMGNhc3QlMjB1cG9uJTIwaGlzJTIwZW50aXJlJTIwZnV0dXJlLiUyMiUyQyUwQSUyMCUyMCd0aW1lc3RhbXAnJTNBJTIwKDE1LjQ4JTJDJTIwMjEuMjgpJTdEJTVE",highlighted:`[{&#x27;speaker&#x27;: &#x27;SPEAKER_01&#x27;,
  &#x27;text&#x27;: &#x27; The second and importance is as follows. Sovereignty may be defined to be the right of making laws. In France, the king really exercises a portion of the sovereign power, since the laws have no weight.&#x27;,
  &#x27;timestamp&#x27;: (0.0, 15.48)},
 {&#x27;speaker&#x27;: &#x27;SPEAKER_00&#x27;,
  &#x27;text&#x27;: &quot; He was in a favored state of mind, owing to the blight his wife&#x27;s action threatened to cast upon his entire future.&quot;,
  &#x27;timestamp&#x27;: (15.48, 21.28)}]`}}),ue=new U({props:{code:"ZGVmJTIwdHVwbGVfdG9fc3RyaW5nKHN0YXJ0X2VuZF90dXBsZSUyQyUyMG5kaWdpdHMlM0QxKSUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMHN0cigocm91bmQoc3RhcnRfZW5kX3R1cGxlJTVCMCU1RCUyQyUyMG5kaWdpdHMpJTJDJTIwcm91bmQoc3RhcnRfZW5kX3R1cGxlJTVCMSU1RCUyQyUyMG5kaWdpdHMpKSklMEElMEElMEFkZWYlMjBmb3JtYXRfYXNfdHJhbnNjcmlwdGlvbihyYXdfc2VnbWVudHMpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTIyJTVDbiU1Q24lMjIuam9pbiglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBjaHVuayU1QiUyMnNwZWFrZXIlMjIlNUQlMjAlMkIlMjAlMjIlMjAlMjIlMjAlMkIlMjB0dXBsZV90b19zdHJpbmcoY2h1bmslNUIlMjJ0aW1lc3RhbXAlMjIlNUQpJTIwJTJCJTIwY2h1bmslNUIlMjJ0ZXh0JTIyJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZm9yJTIwY2h1bmslMjBpbiUyMHJhd19zZWdtZW50cyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1RCUwQSUyMCUyMCUyMCUyMCk=",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">tuple_to_string</span>(<span class="hljs-params">start_end_tuple, ndigits=<span class="hljs-number">1</span></span>):
    <span class="hljs-keyword">return</span> <span class="hljs-built_in">str</span>((<span class="hljs-built_in">round</span>(start_end_tuple[<span class="hljs-number">0</span>], ndigits), <span class="hljs-built_in">round</span>(start_end_tuple[<span class="hljs-number">1</span>], ndigits)))


<span class="hljs-keyword">def</span> <span class="hljs-title function_">format_as_transcription</span>(<span class="hljs-params">raw_segments</span>):
    <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;\\n\\n&quot;</span>.join(
        [
            chunk[<span class="hljs-string">&quot;speaker&quot;</span>] + <span class="hljs-string">&quot; &quot;</span> + tuple_to_string(chunk[<span class="hljs-string">&quot;timestamp&quot;</span>]) + chunk[<span class="hljs-string">&quot;text&quot;</span>]
            <span class="hljs-keyword">for</span> chunk <span class="hljs-keyword">in</span> raw_segments
        ]
    )`}}),Je=new U({props:{code:"b3V0cHV0cyUyMCUzRCUyMHBpcGVsaW5lKHNhbXBsZSU1QiUyMmF1ZGlvJTIyJTVELmNvcHkoKSklMEElMEFmb3JtYXRfYXNfdHJhbnNjcmlwdGlvbihvdXRwdXRzKQ==",highlighted:`outputs = pipeline(sample[<span class="hljs-string">&quot;audio&quot;</span>].copy())

format_as_transcription(outputs)`}}),Ue=new U({props:{code:"U1BFQUtFUl8wMSUyMCgwLjAlMkMlMjAxNS41KSUyMFRoZSUyMHNlY29uZCUyMGFuZCUyMGltcG9ydGFuY2UlMjBpcyUyMGFzJTIwZm9sbG93cy4lMjBTb3ZlcmVpZ250eSUyMG1heSUyMGJlJTIwZGVmaW5lZCUyMHRvJTIwYmUlMjB0aGUlMjByaWdodCUyMG9mJTIwbWFraW5nJTIwbGF3cy4lMEFJbiUyMEZyYW5jZSUyQyUyMHRoZSUyMGtpbmclMjByZWFsbHklMjBleGVyY2lzZXMlMjBhJTIwcG9ydGlvbiUyMG9mJTIwdGhlJTIwc292ZXJlaWduJTIwcG93ZXIlMkMlMjBzaW5jZSUyMHRoZSUyMGxhd3MlMjBoYXZlJTIwbm8lMjB3ZWlnaHQuJTBBJTBBU1BFQUtFUl8wMCUyMCgxNS41JTJDJTIwMjEuMyklMjBIZSUyMHdhcyUyMGluJTIwYSUyMGZhdm9yZWQlMjBzdGF0ZSUyMG9mJTIwbWluZCUyQyUyMG93aW5nJTIwdG8lMjB0aGUlMjBibGlnaHQlMjBoaXMlMjB3aWZlJ3MlMjBhY3Rpb24lMjB0aHJlYXRlbmVkJTIwdG8lMjBjYXN0JTIwdXBvbiUwQWhpcyUyMGVudGlyZSUyMGZ1dHVyZS4=",highlighted:`SPEAKER_01 (0.0, 15.5) The second and importance is as follows. Sovereignty may be defined to be the right of making laws.
In France, the king really exercises a portion of the sovereign power, since the laws have no weight.

SPEAKER_00 (15.5, 21.3) He was in a favored state of mind, owing to the blight his wife&#x27;s action threatened to cast upon
his entire future.`}}),{c(){T=l("meta"),G=h(),b=l("h1"),I=l("a"),k=l("span"),d(j.$$.fragment),F=h(),J=l("span"),C=r("Transcribe a meeting"),q=h(),g=l("p"),Ht=r(`In this final section, we\u2019ll use the Whisper model to generate a transcription for a conversation or meeting between
two or more speakers. We\u2019ll then pair it with a `),Ae=l("em"),Dt=r("speaker diarization"),Pt=r(` model to predict \u201Cwho spoke when\u201D. By matching
the timestamps from the Whisper transcriptions with the timestamps from the speaker diarization model, we can predict an
end-to-end meeting transcription with fully formatted start / end times for each speaker. This is a basic version of
the meeting transcription services you might have seen online from the likes of `),Y=l("a"),Lt=r("Otter.ai"),Kt=r(" and co:"),Le=h(),H=l("div"),_e=l("img"),Ke=h(),Z=l("h2"),E=l("a"),Ne=l("span"),d(D.$$.fragment),Ot=h(),xe=l("span"),es=r("Speaker Diarization"),Oe=h(),Ie=l("p"),ts=r(`Speaker diarization (or diarisation) is the task of taking an unlabelled audio input and predicting \u201Cwho spoke when\u201D.
In doing so, we can predict start / end timestamps for each speaker turn, corresponding to when each speaker starts
speaking and when they finish.`),et=h(),A=l("p"),ss=r(`\u{1F917} Transformers currently does not have a model for speaker diarization included in the library, but there are checkpoints
on the Hub that can be used with relative ease. In this example, we\u2019ll use the pre-trained speaker diarization model from
`),P=l("a"),as=r("pyannote.audio"),is=r(". Let\u2019s get started and pip install the package:"),tt=h(),d(L.$$.fragment),st=h(),B=l("p"),ls=r(`Great! The weights for this model are hosted on the Hugging Face Hub. To access them, we first have to agree to the speaker diarization model\u2019s
terms of use: `),K=l("a"),ns=r("pyannote/speaker-diarization"),os=r(`. And subsequently the
segmentation model\u2019s terms of use: `),O=l("a"),rs=r("pyannote/segmentation"),ps=r("."),at=h(),je=l("p"),hs=r("Once complete, we can load the pre-trained speaker diarization pipeline locally on our device:"),it=h(),d(ee.$$.fragment),lt=h(),_=l("p"),cs=r("Let\u2019s try it out on a sample audio file! For this, we\u2019ll load a sample of the "),te=l("a"),ys=r("LibriSpeech ASR"),ds=r(`
dataset that consists of two different speakers that have been concatenated together to give a single audio file:`),nt=h(),d(se.$$.fragment),ot=h(),ge=l("p"),ms=r("We can listen to the audio to see what it sounds like:"),rt=h(),d(ae.$$.fragment),pt=h(),N=l("p"),Ms=r(`Cool! We can clearly hear two different speakers, with a transition roughly 15s of the way through. Let\u2019s pass this audio
file to the diarization model to get the speaker start / end times. Note that pyannote.audio expects the audio input to be a
PyTorch tensor of shape `),Qe=l("code"),ws=r("(channels, seq_len)"),fs=r(", so we need to perform this conversion prior to running the model:"),ht=h(),d(ie.$$.fragment),ct=h(),d(le.$$.fragment),yt=h(),ke=l("p"),us=r(`This looks pretty good! We can see that the first speaker is predicted as speaking up until the 14.5 second mark, and the
second speaker from 15.4s onwards. Now we need to get our transcription!`),dt=h(),$=l("h2"),x=l("a"),ze=l("span"),d(ne.$$.fragment),Js=h(),Re=l("span"),Us=r("Speech transcription"),mt=h(),v=l("p"),Ts=r(`For the third time in this Unit, we\u2019ll use the Whisper model for our speech transcription system. Specifically, we\u2019ll load the
`),oe=l("a"),bs=r("Whisper Base"),Is=r(` checkpoint, since it\u2019s small enough to give good
inference speed with reasonable transcription accuracy. As before, feel free to use any speech recognition checkpoint
on `),re=l("a"),js=r("the Hub"),gs=r(`,
including Wav2Vec2, MMS ASR or other Whisper checkpoints:`),Mt=h(),d(pe.$$.fragment),wt=h(),Q=l("p"),ks=r(`Let\u2019s get the transcription for our sample audio, returning the segment level timestamps as well so that we know the
start / end times for each segment. You\u2019ll remember from Unit 5 that we need to pass the argument
`),Xe=l("code"),Gs=r("return_timestamps=True"),Cs=r(" to activate the timestamp prediction task for Whisper:"),ft=h(),d(he.$$.fragment),ut=h(),d(ce.$$.fragment),Jt=h(),Ge=l("p"),Bs=r(`Alright! We see that each segment of the transcript has a start and end time, with the speakers changing at the 15.48 second
mark. We can now pair this transcription with the speaker timestamps that we got from our diarization model to get our
final transcription.`),Ut=h(),W=l("h2"),z=l("a"),Ve=l("span"),d(ye.$$.fragment),vs=h(),Fe=l("span"),Zs=r("Speechbox"),Tt=h(),Ce=l("p"),$s=r(`To get the final transcription, we\u2019ll align the timestamps from the diarization model with those from the Whisper model.
The diarization model predicted the first speaker to end at 14.5 seconds, and the second speaker to start at 15.4s, whereas Whisper predicted segment boundaries at
13.88, 15.48 and 19.44 seconds respectively. Since the timestamps from Whisper don\u2019t match perfectly with those from the
diarization model, we need to find which of these boundaries are closest to 14.5 and 15.4 seconds, and segment the transcription by
speakers accordingly. Specifically, we\u2019ll find the closest alignment between diarization and transcription timestamps by
minimising the absolute distance between both.`),bt=h(),R=l("p"),Ws=r("Luckily for us, we can use the \u{1F917} Speechbox package to perform this alignment. First, let\u2019s pip install "),qe=l("code"),Ss=r("speechbox"),Es=r(` from
main:`),It=h(),d(de.$$.fragment),jt=h(),X=l("p"),As=r(`We can now instantiate our combined diarization plus transcription pipeline, by passing the diarization model and
ASR model to the `),me=l("a"),Ye=l("code"),_s=r("ASRDiarizationPipeline"),Ns=r(" class:"),gt=h(),d(Me.$$.fragment),kt=h(),d(V.$$.fragment),Gt=h(),Be=l("p"),xs=r("Let\u2019s pass the audio file to the composite pipeline and see what we get out:"),Ct=h(),d(we.$$.fragment),Bt=h(),d(fe.$$.fragment),vt=h(),ve=l("p"),Qs=r(`Excellent! The first speaker is segmented as speaking from 0 to 15.48 seconds, and the second speaker from 15.48 to 21.28 seconds,
with the corresponding transcriptions for each.`),Zt=h(),Ze=l("p"),zs=r(`We can format the timestamps a little more nicely by defining two helper functions. The first converts a tuple of
timestamps to a string, rounded to a set number of decimal places. The second combines the speaker id, timestamp and text
information onto one line, and splits each speaker onto their own line for ease of reading:`),$t=h(),d(ue.$$.fragment),Wt=h(),$e=l("p"),Rs=r("Let\u2019s re-run the pipeline, this time formatting the transcription according to the function we\u2019ve just defined:"),St=h(),d(Je.$$.fragment),Et=h(),d(Ue.$$.fragment),At=h(),S=l("p"),Xs=r(`There we go! With that, we\u2019ve both diarized and transcribe our input audio and returned speaker-segmented transcriptions.
While the minimum distance algoirthm to align the diarized timestamps and transcribed timestamps is simple, it
works well in practice. If you want to explore more advanced methods for combining the timestamps, the
source code for the `),He=l("code"),Vs=r("ASRDiarizationPipeline"),Fs=r(" is a good place to start: "),Te=l("a"),qs=r("speechbox/diarize.py"),this.h()},l(e){const s=Ea('[data-svelte="svelte-1phssyn"]',document.head);T=n(s,"META",{name:!0,content:!0}),s.forEach(t),G=c(e),b=n(e,"H1",{class:!0});var be=o(b);I=n(be,"A",{id:!0,class:!0,href:!0});var Hs=o(I);k=n(Hs,"SPAN",{});var Ds=o(k);m(j.$$.fragment,Ds),Ds.forEach(t),Hs.forEach(t),F=c(be),J=n(be,"SPAN",{});var Ps=o(J);C=p(Ps,"Transcribe a meeting"),Ps.forEach(t),be.forEach(t),q=c(e),g=n(e,"P",{});var We=o(g);Ht=p(We,`In this final section, we\u2019ll use the Whisper model to generate a transcription for a conversation or meeting between
two or more speakers. We\u2019ll then pair it with a `),Ae=n(We,"EM",{});var Ls=o(Ae);Dt=p(Ls,"speaker diarization"),Ls.forEach(t),Pt=p(We,` model to predict \u201Cwho spoke when\u201D. By matching
the timestamps from the Whisper transcriptions with the timestamps from the speaker diarization model, we can predict an
end-to-end meeting transcription with fully formatted start / end times for each speaker. This is a basic version of
the meeting transcription services you might have seen online from the likes of `),Y=n(We,"A",{href:!0,rel:!0});var Ks=o(Y);Lt=p(Ks,"Otter.ai"),Ks.forEach(t),Kt=p(We," and co:"),We.forEach(t),Le=c(e),H=n(e,"DIV",{class:!0});var Os=o(H);_e=n(Os,"IMG",{src:!0}),Os.forEach(t),Ke=c(e),Z=n(e,"H2",{class:!0});var Nt=o(Z);E=n(Nt,"A",{id:!0,class:!0,href:!0});var ea=o(E);Ne=n(ea,"SPAN",{});var ta=o(Ne);m(D.$$.fragment,ta),ta.forEach(t),ea.forEach(t),Ot=c(Nt),xe=n(Nt,"SPAN",{});var sa=o(xe);es=p(sa,"Speaker Diarization"),sa.forEach(t),Nt.forEach(t),Oe=c(e),Ie=n(e,"P",{});var aa=o(Ie);ts=p(aa,`Speaker diarization (or diarisation) is the task of taking an unlabelled audio input and predicting \u201Cwho spoke when\u201D.
In doing so, we can predict start / end timestamps for each speaker turn, corresponding to when each speaker starts
speaking and when they finish.`),aa.forEach(t),et=c(e),A=n(e,"P",{});var xt=o(A);ss=p(xt,`\u{1F917} Transformers currently does not have a model for speaker diarization included in the library, but there are checkpoints
on the Hub that can be used with relative ease. In this example, we\u2019ll use the pre-trained speaker diarization model from
`),P=n(xt,"A",{href:!0,rel:!0});var ia=o(P);as=p(ia,"pyannote.audio"),ia.forEach(t),is=p(xt,". Let\u2019s get started and pip install the package:"),xt.forEach(t),tt=c(e),m(L.$$.fragment,e),st=c(e),B=n(e,"P",{});var Se=o(B);ls=p(Se,`Great! The weights for this model are hosted on the Hugging Face Hub. To access them, we first have to agree to the speaker diarization model\u2019s
terms of use: `),K=n(Se,"A",{href:!0,rel:!0});var la=o(K);ns=p(la,"pyannote/speaker-diarization"),la.forEach(t),os=p(Se,`. And subsequently the
segmentation model\u2019s terms of use: `),O=n(Se,"A",{href:!0,rel:!0});var na=o(O);rs=p(na,"pyannote/segmentation"),na.forEach(t),ps=p(Se,"."),Se.forEach(t),at=c(e),je=n(e,"P",{});var oa=o(je);hs=p(oa,"Once complete, we can load the pre-trained speaker diarization pipeline locally on our device:"),oa.forEach(t),it=c(e),m(ee.$$.fragment,e),lt=c(e),_=n(e,"P",{});var Qt=o(_);cs=p(Qt,"Let\u2019s try it out on a sample audio file! For this, we\u2019ll load a sample of the "),te=n(Qt,"A",{href:!0,rel:!0});var ra=o(te);ys=p(ra,"LibriSpeech ASR"),ra.forEach(t),ds=p(Qt,`
dataset that consists of two different speakers that have been concatenated together to give a single audio file:`),Qt.forEach(t),nt=c(e),m(se.$$.fragment,e),ot=c(e),ge=n(e,"P",{});var pa=o(ge);ms=p(pa,"We can listen to the audio to see what it sounds like:"),pa.forEach(t),rt=c(e),m(ae.$$.fragment,e),pt=c(e),N=n(e,"P",{});var zt=o(N);Ms=p(zt,`Cool! We can clearly hear two different speakers, with a transition roughly 15s of the way through. Let\u2019s pass this audio
file to the diarization model to get the speaker start / end times. Note that pyannote.audio expects the audio input to be a
PyTorch tensor of shape `),Qe=n(zt,"CODE",{});var ha=o(Qe);ws=p(ha,"(channels, seq_len)"),ha.forEach(t),fs=p(zt,", so we need to perform this conversion prior to running the model:"),zt.forEach(t),ht=c(e),m(ie.$$.fragment,e),ct=c(e),m(le.$$.fragment,e),yt=c(e),ke=n(e,"P",{});var ca=o(ke);us=p(ca,`This looks pretty good! We can see that the first speaker is predicted as speaking up until the 14.5 second mark, and the
second speaker from 15.4s onwards. Now we need to get our transcription!`),ca.forEach(t),dt=c(e),$=n(e,"H2",{class:!0});var Rt=o($);x=n(Rt,"A",{id:!0,class:!0,href:!0});var ya=o(x);ze=n(ya,"SPAN",{});var da=o(ze);m(ne.$$.fragment,da),da.forEach(t),ya.forEach(t),Js=c(Rt),Re=n(Rt,"SPAN",{});var ma=o(Re);Us=p(ma,"Speech transcription"),ma.forEach(t),Rt.forEach(t),mt=c(e),v=n(e,"P",{});var Ee=o(v);Ts=p(Ee,`For the third time in this Unit, we\u2019ll use the Whisper model for our speech transcription system. Specifically, we\u2019ll load the
`),oe=n(Ee,"A",{href:!0,rel:!0});var Ma=o(oe);bs=p(Ma,"Whisper Base"),Ma.forEach(t),Is=p(Ee,` checkpoint, since it\u2019s small enough to give good
inference speed with reasonable transcription accuracy. As before, feel free to use any speech recognition checkpoint
on `),re=n(Ee,"A",{href:!0,rel:!0});var wa=o(re);js=p(wa,"the Hub"),wa.forEach(t),gs=p(Ee,`,
including Wav2Vec2, MMS ASR or other Whisper checkpoints:`),Ee.forEach(t),Mt=c(e),m(pe.$$.fragment,e),wt=c(e),Q=n(e,"P",{});var Xt=o(Q);ks=p(Xt,`Let\u2019s get the transcription for our sample audio, returning the segment level timestamps as well so that we know the
start / end times for each segment. You\u2019ll remember from Unit 5 that we need to pass the argument
`),Xe=n(Xt,"CODE",{});var fa=o(Xe);Gs=p(fa,"return_timestamps=True"),fa.forEach(t),Cs=p(Xt," to activate the timestamp prediction task for Whisper:"),Xt.forEach(t),ft=c(e),m(he.$$.fragment,e),ut=c(e),m(ce.$$.fragment,e),Jt=c(e),Ge=n(e,"P",{});var ua=o(Ge);Bs=p(ua,`Alright! We see that each segment of the transcript has a start and end time, with the speakers changing at the 15.48 second
mark. We can now pair this transcription with the speaker timestamps that we got from our diarization model to get our
final transcription.`),ua.forEach(t),Ut=c(e),W=n(e,"H2",{class:!0});var Vt=o(W);z=n(Vt,"A",{id:!0,class:!0,href:!0});var Ja=o(z);Ve=n(Ja,"SPAN",{});var Ua=o(Ve);m(ye.$$.fragment,Ua),Ua.forEach(t),Ja.forEach(t),vs=c(Vt),Fe=n(Vt,"SPAN",{});var Ta=o(Fe);Zs=p(Ta,"Speechbox"),Ta.forEach(t),Vt.forEach(t),Tt=c(e),Ce=n(e,"P",{});var ba=o(Ce);$s=p(ba,`To get the final transcription, we\u2019ll align the timestamps from the diarization model with those from the Whisper model.
The diarization model predicted the first speaker to end at 14.5 seconds, and the second speaker to start at 15.4s, whereas Whisper predicted segment boundaries at
13.88, 15.48 and 19.44 seconds respectively. Since the timestamps from Whisper don\u2019t match perfectly with those from the
diarization model, we need to find which of these boundaries are closest to 14.5 and 15.4 seconds, and segment the transcription by
speakers accordingly. Specifically, we\u2019ll find the closest alignment between diarization and transcription timestamps by
minimising the absolute distance between both.`),ba.forEach(t),bt=c(e),R=n(e,"P",{});var Ft=o(R);Ws=p(Ft,"Luckily for us, we can use the \u{1F917} Speechbox package to perform this alignment. First, let\u2019s pip install "),qe=n(Ft,"CODE",{});var Ia=o(qe);Ss=p(Ia,"speechbox"),Ia.forEach(t),Es=p(Ft,` from
main:`),Ft.forEach(t),It=c(e),m(de.$$.fragment,e),jt=c(e),X=n(e,"P",{});var qt=o(X);As=p(qt,`We can now instantiate our combined diarization plus transcription pipeline, by passing the diarization model and
ASR model to the `),me=n(qt,"A",{href:!0,rel:!0});var ja=o(me);Ye=n(ja,"CODE",{});var ga=o(Ye);_s=p(ga,"ASRDiarizationPipeline"),ga.forEach(t),ja.forEach(t),Ns=p(qt," class:"),qt.forEach(t),gt=c(e),m(Me.$$.fragment,e),kt=c(e),m(V.$$.fragment,e),Gt=c(e),Be=n(e,"P",{});var ka=o(Be);xs=p(ka,"Let\u2019s pass the audio file to the composite pipeline and see what we get out:"),ka.forEach(t),Ct=c(e),m(we.$$.fragment,e),Bt=c(e),m(fe.$$.fragment,e),vt=c(e),ve=n(e,"P",{});var Ga=o(ve);Qs=p(Ga,`Excellent! The first speaker is segmented as speaking from 0 to 15.48 seconds, and the second speaker from 15.48 to 21.28 seconds,
with the corresponding transcriptions for each.`),Ga.forEach(t),Zt=c(e),Ze=n(e,"P",{});var Ca=o(Ze);zs=p(Ca,`We can format the timestamps a little more nicely by defining two helper functions. The first converts a tuple of
timestamps to a string, rounded to a set number of decimal places. The second combines the speaker id, timestamp and text
information onto one line, and splits each speaker onto their own line for ease of reading:`),Ca.forEach(t),$t=c(e),m(ue.$$.fragment,e),Wt=c(e),$e=n(e,"P",{});var Ba=o($e);Rs=p(Ba,"Let\u2019s re-run the pipeline, this time formatting the transcription according to the function we\u2019ve just defined:"),Ba.forEach(t),St=c(e),m(Je.$$.fragment,e),Et=c(e),m(Ue.$$.fragment,e),At=c(e),S=n(e,"P",{});var De=o(S);Xs=p(De,`There we go! With that, we\u2019ve both diarized and transcribe our input audio and returned speaker-segmented transcriptions.
While the minimum distance algoirthm to align the diarized timestamps and transcribed timestamps is simple, it
works well in practice. If you want to explore more advanced methods for combining the timestamps, the
source code for the `),He=n(De,"CODE",{});var va=o(He);Vs=p(va,"ASRDiarizationPipeline"),va.forEach(t),Fs=p(De," is a good place to start: "),Te=n(De,"A",{href:!0,rel:!0});var Za=o(Te);qs=p(Za,"speechbox/diarize.py"),Za.forEach(t),De.forEach(t),this.h()},h(){y(T,"name","hf:doc:metadata"),y(T,"content",JSON.stringify(za)),y(I,"id","transcribe-a-meeting"),y(I,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),y(I,"href","#transcribe-a-meeting"),y(b,"class","relative group"),y(Y,"href","https://otter.ai"),y(Y,"rel","nofollow"),Aa(_e.src,Ys="https://huggingface.co/datasets/huggingface-course/audio-course-images/resolve/main/diarization_transcription.png")||y(_e,"src",Ys),y(H,"class","flex justify-center"),y(E,"id","speaker-diarization"),y(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),y(E,"href","#speaker-diarization"),y(Z,"class","relative group"),y(P,"href","https://github.com/pyannote/pyannote-audio"),y(P,"rel","nofollow"),y(K,"href","https://huggingface.co/pyannote/speaker-diarization"),y(K,"rel","nofollow"),y(O,"href","https://huggingface.co/pyannote/segmentation"),y(O,"rel","nofollow"),y(te,"href","https://huggingface.co/datasets/librispeech_asr"),y(te,"rel","nofollow"),y(x,"id","speech-transcription"),y(x,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),y(x,"href","#speech-transcription"),y($,"class","relative group"),y(oe,"href","https://huggingface.co/openai/whisper-base"),y(oe,"rel","nofollow"),y(re,"href","https://huggingface.co/models?pipeline_tag=automatic-speech-recognition&library=transformers&sort=trending"),y(re,"rel","nofollow"),y(z,"id","speechbox"),y(z,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),y(z,"href","#speechbox"),y(W,"class","relative group"),y(me,"href","https://github.com/huggingface/speechbox/tree/main#asr-with-speaker-diarization"),y(me,"rel","nofollow"),y(Te,"href","https://github.com/huggingface/speechbox/blob/96d2d1a180252d92263f862a1cd25a48860f1aed/src/speechbox/diarize.py#L12"),y(Te,"rel","nofollow")},m(e,s){a(document.head,T),i(e,G,s),i(e,b,s),a(b,I),a(I,k),M(j,k,null),a(b,F),a(b,J),a(J,C),i(e,q,s),i(e,g,s),a(g,Ht),a(g,Ae),a(Ae,Dt),a(g,Pt),a(g,Y),a(Y,Lt),a(g,Kt),i(e,Le,s),i(e,H,s),a(H,_e),i(e,Ke,s),i(e,Z,s),a(Z,E),a(E,Ne),M(D,Ne,null),a(Z,Ot),a(Z,xe),a(xe,es),i(e,Oe,s),i(e,Ie,s),a(Ie,ts),i(e,et,s),i(e,A,s),a(A,ss),a(A,P),a(P,as),a(A,is),i(e,tt,s),M(L,e,s),i(e,st,s),i(e,B,s),a(B,ls),a(B,K),a(K,ns),a(B,os),a(B,O),a(O,rs),a(B,ps),i(e,at,s),i(e,je,s),a(je,hs),i(e,it,s),M(ee,e,s),i(e,lt,s),i(e,_,s),a(_,cs),a(_,te),a(te,ys),a(_,ds),i(e,nt,s),M(se,e,s),i(e,ot,s),i(e,ge,s),a(ge,ms),i(e,rt,s),M(ae,e,s),i(e,pt,s),i(e,N,s),a(N,Ms),a(N,Qe),a(Qe,ws),a(N,fs),i(e,ht,s),M(ie,e,s),i(e,ct,s),M(le,e,s),i(e,yt,s),i(e,ke,s),a(ke,us),i(e,dt,s),i(e,$,s),a($,x),a(x,ze),M(ne,ze,null),a($,Js),a($,Re),a(Re,Us),i(e,mt,s),i(e,v,s),a(v,Ts),a(v,oe),a(oe,bs),a(v,Is),a(v,re),a(re,js),a(v,gs),i(e,Mt,s),M(pe,e,s),i(e,wt,s),i(e,Q,s),a(Q,ks),a(Q,Xe),a(Xe,Gs),a(Q,Cs),i(e,ft,s),M(he,e,s),i(e,ut,s),M(ce,e,s),i(e,Jt,s),i(e,Ge,s),a(Ge,Bs),i(e,Ut,s),i(e,W,s),a(W,z),a(z,Ve),M(ye,Ve,null),a(W,vs),a(W,Fe),a(Fe,Zs),i(e,Tt,s),i(e,Ce,s),a(Ce,$s),i(e,bt,s),i(e,R,s),a(R,Ws),a(R,qe),a(qe,Ss),a(R,Es),i(e,It,s),M(de,e,s),i(e,jt,s),i(e,X,s),a(X,As),a(X,me),a(me,Ye),a(Ye,_s),a(X,Ns),i(e,gt,s),M(Me,e,s),i(e,kt,s),M(V,e,s),i(e,Gt,s),i(e,Be,s),a(Be,xs),i(e,Ct,s),M(we,e,s),i(e,Bt,s),M(fe,e,s),i(e,vt,s),i(e,ve,s),a(ve,Qs),i(e,Zt,s),i(e,Ze,s),a(Ze,zs),i(e,$t,s),M(ue,e,s),i(e,Wt,s),i(e,$e,s),a($e,Rs),i(e,St,s),M(Je,e,s),i(e,Et,s),M(Ue,e,s),i(e,At,s),i(e,S,s),a(S,Xs),a(S,He),a(He,Vs),a(S,Fs),a(S,Te),a(Te,qs),_t=!0},p(e,[s]){const be={};s&2&&(be.$$scope={dirty:s,ctx:e}),V.$set(be)},i(e){_t||(w(j.$$.fragment,e),w(D.$$.fragment,e),w(L.$$.fragment,e),w(ee.$$.fragment,e),w(se.$$.fragment,e),w(ae.$$.fragment,e),w(ie.$$.fragment,e),w(le.$$.fragment,e),w(ne.$$.fragment,e),w(pe.$$.fragment,e),w(he.$$.fragment,e),w(ce.$$.fragment,e),w(ye.$$.fragment,e),w(de.$$.fragment,e),w(Me.$$.fragment,e),w(V.$$.fragment,e),w(we.$$.fragment,e),w(fe.$$.fragment,e),w(ue.$$.fragment,e),w(Je.$$.fragment,e),w(Ue.$$.fragment,e),_t=!0)},o(e){f(j.$$.fragment,e),f(D.$$.fragment,e),f(L.$$.fragment,e),f(ee.$$.fragment,e),f(se.$$.fragment,e),f(ae.$$.fragment,e),f(ie.$$.fragment,e),f(le.$$.fragment,e),f(ne.$$.fragment,e),f(pe.$$.fragment,e),f(he.$$.fragment,e),f(ce.$$.fragment,e),f(ye.$$.fragment,e),f(de.$$.fragment,e),f(Me.$$.fragment,e),f(V.$$.fragment,e),f(we.$$.fragment,e),f(fe.$$.fragment,e),f(ue.$$.fragment,e),f(Je.$$.fragment,e),f(Ue.$$.fragment,e),_t=!1},d(e){t(T),e&&t(G),e&&t(b),u(j),e&&t(q),e&&t(g),e&&t(Le),e&&t(H),e&&t(Ke),e&&t(Z),u(D),e&&t(Oe),e&&t(Ie),e&&t(et),e&&t(A),e&&t(tt),u(L,e),e&&t(st),e&&t(B),e&&t(at),e&&t(je),e&&t(it),u(ee,e),e&&t(lt),e&&t(_),e&&t(nt),u(se,e),e&&t(ot),e&&t(ge),e&&t(rt),u(ae,e),e&&t(pt),e&&t(N),e&&t(ht),u(ie,e),e&&t(ct),u(le,e),e&&t(yt),e&&t(ke),e&&t(dt),e&&t($),u(ne),e&&t(mt),e&&t(v),e&&t(Mt),u(pe,e),e&&t(wt),e&&t(Q),e&&t(ft),u(he,e),e&&t(ut),u(ce,e),e&&t(Jt),e&&t(Ge),e&&t(Ut),e&&t(W),u(ye),e&&t(Tt),e&&t(Ce),e&&t(bt),e&&t(R),e&&t(It),u(de,e),e&&t(jt),e&&t(X),e&&t(gt),u(Me,e),e&&t(kt),u(V,e),e&&t(Gt),e&&t(Be),e&&t(Ct),u(we,e),e&&t(Bt),u(fe,e),e&&t(vt),e&&t(ve),e&&t(Zt),e&&t(Ze),e&&t($t),u(ue,e),e&&t(Wt),e&&t($e),e&&t(St),u(Je,e),e&&t(Et),u(Ue,e),e&&t(At),e&&t(S)}}}const za={local:"transcribe-a-meeting",sections:[{local:"speaker-diarization",title:"Speaker Diarization"},{local:"speech-transcription",title:"Speech transcription"},{local:"speechbox",title:"Speechbox"}],title:"Transcribe a meeting"};function Ra(Pe){return _a(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ya extends $a{constructor(T){super();Wa(this,T,Ra,Qa,Sa,{})}}export{Ya as default,za as metadata};
