import{s as gt,n as vt,o as kt}from"../chunks/scheduler.9bc65507.js";import{S as bt,i as Tt,g as o,s as i,u as C,A as wt,h as n,f as t,c,j as m,v as x,y as p,k as l,o as a,a as s,w as z,d as P,t as W,x as V}from"../chunks/index.78c82d43.js";import{D as de}from"../chunks/Docstring.4e7352e2.js";import{I as Oe}from"../chunks/IconCopyLink.bedaa44d.js";function yt(je){let f,le,re,pe,_,k,ae,q,Le,X,Be="Wav2Vec2Phoneme",me,g,b,se,L,$e,J,Xe="Overview",he,$,Je=`The Wav2Vec2Phoneme model was proposed in <a href="https://arxiv.org/abs/2109.11680" rel="nofollow">Simple and Effective Zero-shot Cross-lingual Phoneme Recognition (Xu et al.,
2021</a> by Qiantong Xu, Alexei Baevski, Michael Auli.`,ue,F,Qe="The abstract from the paper is the following:",fe,N,Ze=`<em>Recent progress in self-training, self-supervised pretraining and unsupervised learning enabled well performing speech
recognition systems without any labeled data. However, in many cases there is labeled data available for related
languages which is not utilized by these methods. This paper extends previous work on zero-shot cross-lingual transfer
learning by fine-tuning a multilingually pretrained wav2vec 2.0 model to transcribe unseen languages. This is done by
mapping phonemes of the training languages to the target language using articulatory features. Experiments show that
this simple method significantly outperforms prior work which introduced task-specific architectures and used only part
of a monolingually pretrained model.</em>`,_e,E,Ge="Tips:",ge,I,Ke=`<li>Wav2Vec2Phoneme uses the exact same architecture as Wav2Vec2</li> <li>Wav2Vec2Phoneme is a speech model that accepts a float array corresponding to the raw waveform of the speech signal.</li> <li>Wav2Vec2Phoneme model was trained using connectionist temporal classification (CTC) so the model output has to be
decoded using <a href="/docs/transformers/v4.34.0/en/model_doc/wav2vec2_phoneme#transformers.Wav2Vec2PhonemeCTCTokenizer">Wav2Vec2PhonemeCTCTokenizer</a>.</li> <li>Wav2Vec2Phoneme can be fine-tuned on multiple language at once and decode unseen languages in a single forward pass
to a sequence of phonemes</li> <li>By default the model outputs a sequence of phonemes. In order to transform the phonemes to a sequence of words one
should make use of a dictionary and language model.</li>`,ve,A,Ye='Relevant checkpoints can be found under <a href="https://huggingface.co/models?other=phoneme-recognition" rel="nofollow">https://huggingface.co/models?other=phoneme-recognition</a>.',ke,D,et='This model was contributed by <a href="https://huggingface.co/patrickvonplaten" rel="nofollow">patrickvonplaten</a>',be,H,tt='The original code can be found <a href="https://github.com/pytorch/fairseq/tree/master/fairseq/models/wav2vec" rel="nofollow">here</a>.',Te,M,ot="Wav2Vec2Phoneme’s architecture is based on the Wav2Vec2 model, so one can refer to <code>Wav2Vec2</code>’s documentation page except for the tokenizer.",we,v,T,ie,S,Fe,Q,nt="Wav2Vec2PhonemeCTCTokenizer",ye,d,R,Ne,Z,rt="Constructs a Wav2Vec2PhonemeCTC tokenizer.",Ee,G,at=`This tokenizer inherits from <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains some of the main methods. Users should refer to
the superclass for more information regarding such methods.`,Ie,w,U,Ae,K,st=`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`,De,y,O,He,Y,it="Convert a list of lists of token ids into a list of strings by calling decode.",Me,u,j,Se,ee,ct=`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`,Re,te,dt="Similar to doing <code>self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))</code>.",Ue,oe,B,Ce,ce,xe;return q=new Oe({}),L=new Oe({}),S=new Oe({}),R=new de({props:{name:"class transformers.Wav2Vec2PhonemeCTCTokenizer",anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"phone_delimiter_token",val:" = ' '"},{name:"word_delimiter_token",val:" = None"},{name:"do_phonemize",val:" = True"},{name:"phonemizer_lang",val:" = 'en-us'"},{name:"phonemizer_backend",val:" = 'espeak'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
File containing the vocabulary.`,name:"vocab_file"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sentence token.`,name:"bos_token"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sentence token.`,name:"eos_token"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.do_phonemize",description:`<strong>do_phonemize</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether the tokenizer should phonetize the input or not. Only if a sequence of phonemes is passed to the
tokenizer, <code>do_phonemize</code> should be set to <code>False</code>.`,name:"do_phonemize"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.phonemizer_lang",description:`<strong>phonemizer_lang</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;en-us&quot;</code>) &#x2014;
The language of the phoneme set to which the tokenizer should phonetize the input text to.`,name:"phonemizer_lang"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.phonemizer_backend",description:`<strong>phonemizer_backend</strong> (<code>str</code>, <em>optional</em>. defaults to <code>&quot;espeak&quot;</code>) &#x2014;
The backend phonetization library that shall be used by the phonemizer library. Defaults to <code>espeak-ng</code>.
See the <a href="https://github.com/bootphon/phonemizer#readme" rel="nofollow">phonemizer package</a>. for more information.</p>
<p>**kwargs &#x2014;
Additional keyword arguments passed along to <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a>`,name:"phonemizer_backend"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py#L94"}}),U=new de({props:{name:"__call__",anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.text_target",description:`<strong>text_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_target"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.text_pair_target",description:`<strong>text_pair_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair_target"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to add special tokens when encoding the sequences. This will use the underlying
<code>PretrainedTokenizerBase.build_inputs_with_special_tokens</code> function, which defines which tokens are
automatically added to the input ids. This is usefull if you want to add <code>bos</code> or <code>eos</code> tokens
automatically.`,name:"add_special_tokens"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.34.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.34.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.34.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/tokenization_utils_base.py#L2732",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> — List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> — List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>“token_type_ids”</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> — List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>“attention_mask”</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>overflowing_tokens</strong> — List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> — Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> — List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> — The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.34.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),O=new de({props:{name:"batch_decode",anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.batch_decode",parameters:[{name:"sequences",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"output_char_offsets",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.batch_decode.sequences",description:`<strong>sequences</strong> (<code>Union[List[int], List[List[int]], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"sequences"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.batch_decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.batch_decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.batch_decode.output_char_offsets",description:`<strong>output_char_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output character offsets. Character offsets can be used in combination with the
sampling rate and model downsampling rate to compute the time-stamps of transcribed characters.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the Example of <code>~models.wav2vec2.tokenization_wav2vec2.decode</code> to better
understand how to make use of <code>output_word_offsets</code>.
<code>~model.wav2vec2_phoneme.tokenization_wav2vec2_phoneme.batch_decode</code> works analogous with phonemes
and batched output.</p>

					</div>`,name:"output_char_offsets"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.batch_decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py#L523",returnDescription:`
<p>The
decoded sentence. Will be a
<code>~models.wav2vec2.tokenization_wav2vec2_phoneme.Wav2Vec2PhonemeCTCTokenizerOutput</code> when
<code>output_char_offsets == True</code>.</p>
`,returnType:`
<p><code>List[str]</code> or <code>~models.wav2vec2.tokenization_wav2vec2_phoneme.Wav2Vec2PhonemeCTCTokenizerOutput</code></p>
`}}),j=new de({props:{name:"decode",anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"output_char_offsets",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.decode.output_char_offsets",description:`<strong>output_char_offsets</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to output character offsets. Character offsets can be used in combination with the
sampling rate and model downsampling rate to compute the time-stamps of transcribed characters.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>Please take a look at the Example of <code>~models.wav2vec2.tokenization_wav2vec2.decode</code> to better
understand how to make use of <code>output_word_offsets</code>.
<code>~model.wav2vec2_phoneme.tokenization_wav2vec2_phoneme.batch_decode</code> works the same way with
phonemes.</p>

					</div>`,name:"output_char_offsets"},{anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py#L467",returnDescription:`
<p>The decoded
sentence. Will be a <code>~models.wav2vec2.tokenization_wav2vec2_phoneme.Wav2Vec2PhonemeCTCTokenizerOutput</code>
when <code>output_char_offsets == True</code>.</p>
`,returnType:`
<p><code>str</code> or <code>~models.wav2vec2.tokenization_wav2vec2_phoneme.Wav2Vec2PhonemeCTCTokenizerOutput</code></p>
`}}),B=new de({props:{name:"phonemize",anchor:"transformers.Wav2Vec2PhonemeCTCTokenizer.phonemize",parameters:[{name:"text",val:": str"},{name:"phonemizer_lang",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.34.0/src/transformers/models/wav2vec2_phoneme/tokenization_wav2vec2_phoneme.py#L268"}}),{c(){f=o("meta"),le=i(),re=o("p"),pe=i(),_=o("h1"),k=o("a"),ae=o("span"),C(q.$$.fragment),Le=i(),X=o("span"),X.textContent=Be,me=i(),g=o("h2"),b=o("a"),se=o("span"),C(L.$$.fragment),$e=i(),J=o("span"),J.textContent=Xe,he=i(),$=o("p"),$.innerHTML=Je,ue=i(),F=o("p"),F.textContent=Qe,fe=i(),N=o("p"),N.innerHTML=Ze,_e=i(),E=o("p"),E.textContent=Ge,ge=i(),I=o("ul"),I.innerHTML=Ke,ve=i(),A=o("p"),A.innerHTML=Ye,ke=i(),D=o("p"),D.innerHTML=et,be=i(),H=o("p"),H.innerHTML=tt,Te=i(),M=o("p"),M.innerHTML=ot,we=i(),v=o("h2"),T=o("a"),ie=o("span"),C(S.$$.fragment),Fe=i(),Q=o("span"),Q.textContent=nt,ye=i(),d=o("div"),C(R.$$.fragment),Ne=i(),Z=o("p"),Z.textContent=rt,Ee=i(),G=o("p"),G.innerHTML=at,Ie=i(),w=o("div"),C(U.$$.fragment),Ae=i(),K=o("p"),K.textContent=st,De=i(),y=o("div"),C(O.$$.fragment),He=i(),Y=o("p"),Y.textContent=it,Me=i(),u=o("div"),C(j.$$.fragment),Se=i(),ee=o("p"),ee.textContent=ct,Re=i(),te=o("p"),te.innerHTML=dt,Ue=i(),oe=o("div"),C(B.$$.fragment),Ce=i(),ce=o("p"),this.h()},l(e){const r=wt("svelte-1phssyn",document.head);f=n(r,"META",{name:!0,content:!0}),r.forEach(t),le=c(e),re=n(e,"P",{}),m(re).forEach(t),pe=c(e),_=n(e,"H1",{class:!0});var ze=m(_);k=n(ze,"A",{id:!0,class:!0,href:!0});var lt=m(k);ae=n(lt,"SPAN",{});var pt=m(ae);x(q.$$.fragment,pt),pt.forEach(t),lt.forEach(t),Le=c(ze),X=n(ze,"SPAN",{"data-svelte-h":!0}),p(X)!=="svelte-dw0x3d"&&(X.textContent=Be),ze.forEach(t),me=c(e),g=n(e,"H2",{class:!0});var Pe=m(g);b=n(Pe,"A",{id:!0,class:!0,href:!0});var mt=m(b);se=n(mt,"SPAN",{});var ht=m(se);x(L.$$.fragment,ht),ht.forEach(t),mt.forEach(t),$e=c(Pe),J=n(Pe,"SPAN",{"data-svelte-h":!0}),p(J)!=="svelte-1jsw1pg"&&(J.textContent=Xe),Pe.forEach(t),he=c(e),$=n(e,"P",{"data-svelte-h":!0}),p($)!=="svelte-1gxcmtl"&&($.innerHTML=Je),ue=c(e),F=n(e,"P",{"data-svelte-h":!0}),p(F)!=="svelte-vfdo9a"&&(F.textContent=Qe),fe=c(e),N=n(e,"P",{"data-svelte-h":!0}),p(N)!=="svelte-148nuc2"&&(N.innerHTML=Ze),_e=c(e),E=n(e,"P",{"data-svelte-h":!0}),p(E)!=="svelte-axv494"&&(E.textContent=Ge),ge=c(e),I=n(e,"UL",{"data-svelte-h":!0}),p(I)!=="svelte-1o1weh8"&&(I.innerHTML=Ke),ve=c(e),A=n(e,"P",{"data-svelte-h":!0}),p(A)!=="svelte-5tdu8e"&&(A.innerHTML=Ye),ke=c(e),D=n(e,"P",{"data-svelte-h":!0}),p(D)!=="svelte-13jbx2b"&&(D.innerHTML=et),be=c(e),H=n(e,"P",{"data-svelte-h":!0}),p(H)!=="svelte-12gzw10"&&(H.innerHTML=tt),Te=c(e),M=n(e,"P",{"data-svelte-h":!0}),p(M)!=="svelte-1o8zv3q"&&(M.innerHTML=ot),we=c(e),v=n(e,"H2",{class:!0});var We=m(v);T=n(We,"A",{id:!0,class:!0,href:!0});var ut=m(T);ie=n(ut,"SPAN",{});var ft=m(ie);x(S.$$.fragment,ft),ft.forEach(t),ut.forEach(t),Fe=c(We),Q=n(We,"SPAN",{"data-svelte-h":!0}),p(Q)!=="svelte-n06dd4"&&(Q.textContent=nt),We.forEach(t),ye=c(e),d=n(e,"DIV",{class:!0});var h=m(d);x(R.$$.fragment,h),Ne=c(h),Z=n(h,"P",{"data-svelte-h":!0}),p(Z)!=="svelte-1g1me1i"&&(Z.textContent=rt),Ee=c(h),G=n(h,"P",{"data-svelte-h":!0}),p(G)!=="svelte-1ery4iu"&&(G.innerHTML=at),Ie=c(h),w=n(h,"DIV",{class:!0});var Ve=m(w);x(U.$$.fragment,Ve),Ae=c(Ve),K=n(Ve,"P",{"data-svelte-h":!0}),p(K)!=="svelte-kpxj0c"&&(K.textContent=st),Ve.forEach(t),De=c(h),y=n(h,"DIV",{class:!0});var qe=m(y);x(O.$$.fragment,qe),He=c(qe),Y=n(qe,"P",{"data-svelte-h":!0}),p(Y)!=="svelte-1deng2j"&&(Y.textContent=it),qe.forEach(t),Me=c(h),u=n(h,"DIV",{class:!0});var ne=m(u);x(j.$$.fragment,ne),Se=c(ne),ee=n(ne,"P",{"data-svelte-h":!0}),p(ee)!=="svelte-vbfkpu"&&(ee.textContent=ct),Re=c(ne),te=n(ne,"P",{"data-svelte-h":!0}),p(te)!=="svelte-125uxon"&&(te.innerHTML=dt),ne.forEach(t),Ue=c(h),oe=n(h,"DIV",{class:!0});var _t=m(oe);x(B.$$.fragment,_t),_t.forEach(t),h.forEach(t),Ce=c(e),ce=n(e,"P",{}),m(ce).forEach(t),this.h()},h(){l(f,"name","hf:doc:metadata"),l(f,"content",JSON.stringify(Ct)),l(k,"id","wav2vec2phoneme"),l(k,"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"),l(k,"href","#wav2vec2phoneme"),l(_,"class","relative group"),l(b,"id","overview"),l(b,"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"),l(b,"href","#overview"),l(g,"class","relative group"),l(T,"id","transformers.Wav2Vec2PhonemeCTCTokenizer"),l(T,"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"),l(T,"href","#transformers.Wav2Vec2PhonemeCTCTokenizer"),l(v,"class","relative group"),l(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(u,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,r){a(document.head,f),s(e,le,r),s(e,re,r),s(e,pe,r),s(e,_,r),a(_,k),a(k,ae),z(q,ae,null),a(_,Le),a(_,X),s(e,me,r),s(e,g,r),a(g,b),a(b,se),z(L,se,null),a(g,$e),a(g,J),s(e,he,r),s(e,$,r),s(e,ue,r),s(e,F,r),s(e,fe,r),s(e,N,r),s(e,_e,r),s(e,E,r),s(e,ge,r),s(e,I,r),s(e,ve,r),s(e,A,r),s(e,ke,r),s(e,D,r),s(e,be,r),s(e,H,r),s(e,Te,r),s(e,M,r),s(e,we,r),s(e,v,r),a(v,T),a(T,ie),z(S,ie,null),a(v,Fe),a(v,Q),s(e,ye,r),s(e,d,r),z(R,d,null),a(d,Ne),a(d,Z),a(d,Ee),a(d,G),a(d,Ie),a(d,w),z(U,w,null),a(w,Ae),a(w,K),a(d,De),a(d,y),z(O,y,null),a(y,He),a(y,Y),a(d,Me),a(d,u),z(j,u,null),a(u,Se),a(u,ee),a(u,Re),a(u,te),a(d,Ue),a(d,oe),z(B,oe,null),s(e,Ce,r),s(e,ce,r),xe=!0},p:vt,i(e){xe||(P(q.$$.fragment,e),P(L.$$.fragment,e),P(S.$$.fragment,e),P(R.$$.fragment,e),P(U.$$.fragment,e),P(O.$$.fragment,e),P(j.$$.fragment,e),P(B.$$.fragment,e),xe=!0)},o(e){W(q.$$.fragment,e),W(L.$$.fragment,e),W(S.$$.fragment,e),W(R.$$.fragment,e),W(U.$$.fragment,e),W(O.$$.fragment,e),W(j.$$.fragment,e),W(B.$$.fragment,e),xe=!1},d(e){e&&(t(le),t(re),t(pe),t(_),t(me),t(g),t(he),t($),t(ue),t(F),t(fe),t(N),t(_e),t(E),t(ge),t(I),t(ve),t(A),t(ke),t(D),t(be),t(H),t(Te),t(M),t(we),t(v),t(ye),t(d),t(Ce),t(ce)),t(f),V(q),V(L),V(S),V(R),V(U),V(O),V(j),V(B)}}}const Ct={local:"wav2vec2phoneme",sections:[{local:"overview",title:"Overview"},{local:"transformers.Wav2Vec2PhonemeCTCTokenizer",title:"Wav2Vec2PhonemeCTCTokenizer"}],title:"Wav2Vec2Phoneme"};function xt(je){return kt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qt extends bt{constructor(f){super(),Tt(this,f,xt,yt,gt,{})}}export{qt as component};
