import{S as cp,i as pp,s as hp,e as s,k as m,w as v,t as i,M as up,c as r,d as t,m as f,a,x as T,h as l,b as p,G as e,g as b,y as w,q as y,o as C,B as $,v as mp,L as re}from"../../chunks/vendor-hf-doc-builder.js";import{T as wo}from"../../chunks/Tip-hf-doc-builder.js";import{D as R}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ae}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as O}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as se}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function fp(z){let d,k;return d=new ae({props:{code:`from transformers import RoCBertModel, RoCBertConfig

# Initializing a RoCBert weiweishi/roc-bert-base-zh style configuration
configuration = RoCBertConfig()

# Initializing a model from the weiweishi/roc-bert-base-zh style configuration
model = RoCBertModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RoCBertModel, RoCBertConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a RoCBert weiweishi/roc-bert-base-zh style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = RoCBertConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the weiweishi/roc-bert-base-zh style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertModel(configuration)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){v(d.$$.fragment)},l(u){T(d.$$.fragment,u)},m(u,h){w(d,u,h),k=!0},p:re,i(u){k||(y(d.$$.fragment,u),k=!0)},o(u){C(d.$$.fragment,u),k=!1},d(u){$(d,u)}}}function gp(z){let d,k,u,h,_;return h=new ae({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=s("p"),k=i("pair mask has the following format:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"pair mask has the following format:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function _p(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function bp(z){let d,k,u,h,_;return h=new ae({props:{code:`from transformers import AutoTokenizer, RoCBertModel
import torch

tokenizer = AutoTokenizer.from_pretrained("weiweishi/roc-bert-base-zh")
model = RoCBertModel.from_pretrained("weiweishi/roc-bert-base-zh")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
outputs = model(**inputs)

last_hidden_states = outputs.last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertModel.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=s("p"),k=i("Example:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function kp(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function vp(z){let d,k,u,h,_;return h=new ae({props:{code:`from transformers import AutoTokenizer, RoCBertForPreTraining
import torch

tokenizer = AutoTokenizer.from_pretrained("weiweishi/roc-bert-base-zh")
model = RoCBertForPreTraining.from_pretrained("weiweishi/roc-bert-base-zh")

inputs = tokenizer("\u4F60\u597D\uFF0C\u5F88\u9AD8\u5174\u8BA4\u8BC6\u4F60", return_tensors="pt")
attack_inputs = {}
for key in list(inputs.keys()):
    attack_inputs[f"attack_{key}"] = inputs[key]
label_inputs = {}
for key in list(inputs.keys()):
    label_inputs[f"labels_{key}"] = inputs[key]

inputs.update(label_inputs)
inputs.update(attack_inputs)
outputs = model(**inputs)

logits = outputs.logits
logits.shape`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertForPreTraining
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForPreTraining.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;\u4F60\u597D\uFF0C\u5F88\u9AD8\u5174\u8BA4\u8BC6\u4F60&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>attack_inputs = {}
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> key <span class="hljs-keyword">in</span> <span class="hljs-built_in">list</span>(inputs.keys()):
<span class="hljs-meta">... </span>    attack_inputs[<span class="hljs-string">f&quot;attack_<span class="hljs-subst">{key}</span>&quot;</span>] = inputs[key]
<span class="hljs-meta">&gt;&gt;&gt; </span>label_inputs = {}
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> key <span class="hljs-keyword">in</span> <span class="hljs-built_in">list</span>(inputs.keys()):
<span class="hljs-meta">... </span>    label_inputs[<span class="hljs-string">f&quot;labels_<span class="hljs-subst">{key}</span>&quot;</span>] = inputs[key]

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs.update(label_inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs.update(attack_inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>logits.shape
torch.Size([<span class="hljs-number">1</span>, <span class="hljs-number">11</span>, <span class="hljs-number">21128</span>])`}}),{c(){d=s("p"),k=i("Example:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function Tp(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function wp(z){let d,k,u,h,_;return h=new ae({props:{code:`from transformers import AutoTokenizer, RoCBertForCausalLM, RoCBertConfig
import torch

tokenizer = AutoTokenizer.from_pretrained("weiweishi/roc-bert-base-zh")
config = RoCBertConfig.from_pretrained("weiweishi/roc-bert-base-zh")
config.is_decoder = True
model = RoCBertForCausalLM.from_pretrained("weiweishi/roc-bert-base-zh", config=config)

inputs = tokenizer("\u4F60\u597D\uFF0C\u5F88\u9AD8\u5174\u8BA4\u8BC6\u4F60", return_tensors="pt")
outputs = model(**inputs)

prediction_logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertForCausalLM, RoCBertConfig
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config = RoCBertConfig.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>config.is_decoder = <span class="hljs-literal">True</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForCausalLM.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>, config=config)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;\u4F60\u597D\uFF0C\u5F88\u9AD8\u5174\u8BA4\u8BC6\u4F60&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>prediction_logits = outputs.logits`}}),{c(){d=s("p"),k=i("Example:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function yp(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Cp(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function $p(z){let d,k,u,h,_;return h=new ae({props:{code:`import torch
from transformers import AutoTokenizer, RoCBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("ArthurZ/dummy-rocbert-seq")
model = RoCBertForSequenceClassification.from_pretrained("ArthurZ/dummy-rocbert-seq")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()
model.config.id2label[predicted_class_id]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = RoCBertForSequenceClassification.from_pretrained("ArthurZ/dummy-rocbert-seq", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-seq&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-seq&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;financial news&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-seq&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">2.31</span>`}}),{c(){d=s("p"),k=i("Example of single-label classification:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example of single-label classification:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function zp(z){let d,k,u,h,_;return h=new ae({props:{code:`import torch
from transformers import AutoTokenizer, RoCBertForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("ArthurZ/dummy-rocbert-seq")
model = RoCBertForSequenceClassification.from_pretrained("ArthurZ/dummy-rocbert-seq", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = RoCBertForSequenceClassification.from_pretrained(
    "ArthurZ/dummy-rocbert-seq", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-seq&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-seq&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;ArthurZ/dummy-rocbert-seq&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=s("p"),k=i("Example of multi-label classification:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example of multi-label classification:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function Bp(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Rp(z){let d,k,u,h,_;return h=new ae({props:{code:`from transformers import AutoTokenizer, RoCBertForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("weiweishi/roc-bert-base-zh")
model = RoCBertForMultipleChoice.from_pretrained("weiweishi/roc-bert-base-zh")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;weiweishi/roc-bert-base-zh&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=s("p"),k=i("Example:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function xp(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function qp(z){let d,k,u,h,_;return h=new ae({props:{code:`from transformers import AutoTokenizer, RoCBertForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("ArthurZ/dummy-rocbert-ner")
model = RoCBertForTokenClassification.from_pretrained("ArthurZ/dummy-rocbert-ner")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]
predicted_tokens_classes

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-ner&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForTokenClassification.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-ner&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes
[<span class="hljs-string">&#x27;S-EVENT&#x27;</span>, <span class="hljs-string">&#x27;S-FAC&#x27;</span>, <span class="hljs-string">&#x27;I-ORDINAL&#x27;</span>, <span class="hljs-string">&#x27;I-ORDINAL&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;E-LANGUAGE&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;I-EVENT&#x27;</span>, <span class="hljs-string">&#x27;S-TIME&#x27;</span>, <span class="hljs-string">&#x27;S-TIME&#x27;</span>, <span class="hljs-string">&#x27;E-LANGUAGE&#x27;</span>, <span class="hljs-string">&#x27;S-TIME&#x27;</span>, <span class="hljs-string">&#x27;E-DATE&#x27;</span>, <span class="hljs-string">&#x27;I-ORDINAL&#x27;</span>, <span class="hljs-string">&#x27;E-QUANTITY&#x27;</span>, <span class="hljs-string">&#x27;E-LANGUAGE&#x27;</span>, <span class="hljs-string">&#x27;S-TIME&#x27;</span>, <span class="hljs-string">&#x27;B-ORDINAL&#x27;</span>, <span class="hljs-string">&#x27;S-PRODUCT&#x27;</span>, <span class="hljs-string">&#x27;E-LANGUAGE&#x27;</span>, <span class="hljs-string">&#x27;E-LANGUAGE&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;E-LOC&#x27;</span>, <span class="hljs-string">&#x27;S-TIME&#x27;</span>, <span class="hljs-string">&#x27;I-ORDINAL&#x27;</span>, <span class="hljs-string">&#x27;S-FAC&#x27;</span>, <span class="hljs-string">&#x27;O&#x27;</span>, <span class="hljs-string">&#x27;S-GPE&#x27;</span>, <span class="hljs-string">&#x27;I-EVENT&#x27;</span>, <span class="hljs-string">&#x27;S-GPE&#x27;</span>, <span class="hljs-string">&#x27;E-LANGUAGE&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;S-EVENT&#x27;</span>, <span class="hljs-string">&#x27;S-FAC&#x27;</span>, <span class="hljs-string">&#x27;S-FAC&#x27;</span>, <span class="hljs-string">&#x27;S-FAC&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;S-FAC&#x27;</span>, <span class="hljs-string">&#x27;E-ORG&#x27;</span>, <span class="hljs-string">&#x27;S-GPE&#x27;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">3.62</span>`}}),{c(){d=s("p"),k=i("Example:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function Mp(z){let d,k,u,h,_;return{c(){d=s("p"),k=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var B=a(u);h=l(B,"Module"),B.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,k),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Fp(z){let d,k,u,h,_;return h=new ae({props:{code:`from transformers import AutoTokenizer, RoCBertForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("ArthurZ/dummy-rocbert-qa")
model = RoCBertForQuestionAnswering.from_pretrained("ArthurZ/dummy-rocbert-qa")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens, skip_special_tokens=True)

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss
round(loss.item(), 2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-qa&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RoCBertForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;ArthurZ/dummy-rocbert-qa&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = outputs.start_logits.argmax()
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = outputs.end_logits.argmax()

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer.decode(predict_answer_tokens, skip_special_tokens=<span class="hljs-literal">True</span>)
<span class="hljs-string">&#x27;&#x27;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">3.75</span>`}}),{c(){d=s("p"),k=i("Example:"),u=m(),v(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);k=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,k),b(n,u,c),w(h,n,c),_=!0},p:re,i(n){_||(y(h.$$.fragment,n),_=!0)},o(n){C(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),$(h,n)}}}function Ep(z){let d,k,u,h,_,n,c,B,Br,js,ie,Fe,bn,yo,Rr,kn,xr,As,Ee,qr,Co,Mr,Fr,Ps,Rt,Er,Os,xt,vn,jr,Is,je,Ar,$o,Pr,Or,Ls,le,Ae,Tn,zo,Ir,wn,Lr,Ss,q,yn,qt,Sr,Nr,Cn,Mt,Dr,Wr,$n,Ft,Qr,Ur,zn,Et,Hr,Gr,Bn,jt,Vr,Zr,Rn,At,Jr,Ns,de,Pe,xn,Bo,Kr,qn,Xr,Ds,A,Ro,Yr,ce,ea,Pt,oa,ta,xo,na,sa,ra,pe,aa,Ot,ia,la,It,da,ca,pa,Oe,Ws,he,Ie,Mn,qo,ha,Fn,ua,Qs,M,Mo,ma,Y,Fo,fa,En,ga,_a,Eo,Lt,ba,jn,ka,va,St,Ta,An,wa,ya,Le,jo,Ca,Ao,$a,Pn,za,Ba,Ra,I,Po,xa,On,qa,Ma,Se,Fa,ue,Ea,In,ja,Aa,Ln,Pa,Oa,Ia,Nt,Oo,Us,me,Ne,Sn,Io,La,Nn,Sa,Hs,F,Lo,Na,So,Da,No,Wa,Qa,Ua,Do,Ha,Wo,Ga,Va,Za,x,Ja,Dn,Ka,Xa,Wn,Ya,ei,Qn,oi,ti,Un,ni,si,Hn,ri,ai,Gn,ii,li,di,L,Qo,ci,fe,pi,Dt,hi,ui,Vn,mi,fi,gi,De,_i,We,Gs,ge,Qe,Zn,Uo,bi,Jn,ki,Vs,P,Ho,vi,Kn,Ti,wi,Go,yi,Vo,Ci,$i,zi,S,Zo,Bi,_e,Ri,Wt,xi,qi,Xn,Mi,Fi,Ei,Ue,ji,He,Zs,be,Ge,Yn,Jo,Ai,es,Pi,Js,H,Ko,Oi,ke,Ii,os,Li,Si,Xo,Ni,Di,Wi,N,Yo,Qi,ve,Ui,Qt,Hi,Gi,ts,Vi,Zi,Ji,Ve,Ki,Ze,Ks,Te,Je,ns,et,Xi,ss,Yi,Xs,G,ot,el,we,ol,rs,tl,nl,tt,sl,rl,al,ee,nt,il,ye,ll,Ut,dl,cl,as,pl,hl,ul,Ke,Ys,Ce,Xe,is,st,ml,ls,fl,er,V,rt,gl,at,_l,it,bl,kl,vl,E,lt,Tl,$e,wl,Ht,yl,Cl,ds,$l,zl,Bl,Ye,Rl,eo,xl,oo,or,ze,to,cs,dt,ql,ps,Ml,tr,Z,ct,Fl,pt,El,ht,jl,Al,Pl,D,ut,Ol,Be,Il,Gt,Ll,Sl,hs,Nl,Dl,Wl,no,Ql,so,nr,Re,ro,us,mt,Ul,ms,Hl,sr,J,ft,Gl,gt,Vl,_t,Zl,Jl,Kl,W,bt,Xl,xe,Yl,Vt,ed,od,fs,td,nd,sd,ao,rd,io,rr,qe,lo,gs,kt,ad,_s,id,ar,K,vt,ld,X,dd,bs,cd,pd,ks,hd,ud,Tt,md,fd,gd,Q,wt,_d,Me,bd,Zt,kd,vd,vs,Td,wd,yd,co,Cd,po,ir;return n=new O({}),yo=new O({}),zo=new O({}),Bo=new O({}),Ro=new R({props:{name:"class transformers.RoCBertConfig",anchor:"transformers.RoCBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"classifier_dropout",val:" = None"},{name:"enable_pronunciation",val:" = True"},{name:"enable_shape",val:" = True"},{name:"pronunciation_embed_dim",val:" = 768"},{name:"pronunciation_vocab_size",val:" = 910"},{name:"shape_embed_dim",val:" = 512"},{name:"shape_vocab_size",val:" = 24858"},{name:"concat_input",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RoCBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the RoCBert model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertModel">RoCBertModel</a>.`,name:"vocab_size"},{anchor:"transformers.RoCBertConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.RoCBertConfig.num_hidden_layers",description:`<strong>num_hidden_layers</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"num_hidden_layers"},{anchor:"transformers.RoCBertConfig.num_attention_heads",description:`<strong>num_attention_heads</strong> (<code>int</code>, <em>optional</em>, defaults to 12) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"num_attention_heads"},{anchor:"transformers.RoCBertConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimension of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.RoCBertConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;selu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.RoCBertConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.RoCBertConfig.attention_probs_dropout_prob",description:`<strong>attention_probs_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the attention probabilities.`,name:"attention_probs_dropout_prob"},{anchor:"transformers.RoCBertConfig.max_position_embeddings",description:`<strong>max_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
The maximum sequence length that this model might ever be used with. Typically set this to something large
just in case (e.g., 512 or 1024 or 2048).`,name:"max_position_embeddings"},{anchor:"transformers.RoCBertConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertModel">RoCBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.RoCBertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.RoCBertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.RoCBertConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.RoCBertConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.RoCBertConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.RoCBertConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.RoCBertConfig.enable_pronunciation",description:`<strong>enable_pronunciation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model use pronunciation embed when training.`,name:"enable_pronunciation"},{anchor:"transformers.RoCBertConfig.enable_shape",description:`<strong>enable_shape</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model use shape embed when training.`,name:"enable_shape"},{anchor:"transformers.RoCBertConfig.pronunciation_embed_dim",description:`<strong>pronunciation_embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the pronunciation_embed.`,name:"pronunciation_embed_dim"},{anchor:"transformers.RoCBertConfig.pronunciation_vocab_size",description:`<strong>pronunciation_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 910) &#x2014;
Pronunciation Vocabulary size of the RoCBert model. Defines the number of different tokens that can be
represented by the <code>input_pronunciation_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertModel">RoCBertModel</a>.`,name:"pronunciation_vocab_size"},{anchor:"transformers.RoCBertConfig.shape_embed_dim",description:`<strong>shape_embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 512) &#x2014;
Dimension of the shape_embed.`,name:"shape_embed_dim"},{anchor:"transformers.RoCBertConfig.shape_vocab_size",description:`<strong>shape_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 24858) &#x2014;
Shape Vocabulary size of the RoCBert model. Defines the number of different tokens that can be represented
by the <code>input_shape_ids</code> passed when calling <a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertModel">RoCBertModel</a>.`,name:"shape_vocab_size"},{anchor:"transformers.RoCBertConfig.concat_input",description:`<strong>concat_input</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Defines the way of merging the shape_embed, pronunciation_embed and word_embed, if the value is true,
output_embed = torch.cat((word_embed, shape_embed, pronunciation_embed), -1), else output_embed =
(word_embed + shape_embed + pronunciation_embed) / 3
Example &#x2014;`,name:"concat_input"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/configuration_roc_bert.py#L28"}}),Oe=new se({props:{anchor:"transformers.RoCBertConfig.example",$$slots:{default:[fp]},$$scope:{ctx:z}}}),qo=new O({}),Mo=new R({props:{name:"class transformers.RoCBertTokenizer",anchor:"transformers.RoCBertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"word_shape_file",val:""},{name:"word_pronunciation_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.Construct",description:'<strong>Construct</strong> a RoCBert tokenizer. Based on WordPiece. This tokenizer inherits from <a href="/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which &#x2014;',name:"Construct"},{anchor:"transformers.RoCBertTokenizer.contains",description:`<strong>contains</strong> most of the main methods. Users should refer to this superclass for more information regarding those &#x2014;
methods. &#x2014;
vocab_file (<code>str</code>):
File containing the vocabulary.
word_shape_file (<code>str</code>):
File containing the word =&gt; shape info.
word_pronunciation_file (<code>str</code>):
File containing the word =&gt; pronunciation info.
do_lower_case (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>):
Whether or not to lowercase the input when tokenizing.
do_basic_tokenize (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>):
Whether or not to do basic tokenization before WordPiece.
never_split (<code>Iterable</code>, <em>optional</em>):
Collection of tokens which will never be split during tokenization. Only has an effect when
<code>do_basic_tokenize=True</code>
unk_token (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[UNK]&quot;</code>):
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.
sep_token (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[SEP]&quot;</code>):
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.
pad_token (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[PAD]&quot;</code>):
The token used for padding, for example when batching sequences of different lengths.
cls_token (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[CLS]&quot;</code>):
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.
mask_token (<code>str</code>, <em>optional</em>, defaults to <code>&quot;[MASK]&quot;</code>):
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.
tokenize_chinese_chars (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>):
Whether or not to tokenize Chinese characters. This should likely be deactivated for Japanese (see this
<a href="https://github.com/huggingface/transformers/issues/328" rel="nofollow">issue</a>).
strip_accents (<code>bool</code>, <em>optional</em>):
Whether or not to strip all accents. If this option is not specified, then it will be determined by the
value for <code>lowercase</code> (as in the original BERT).`,name:"contains"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L95"}}),Fo=new R({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.RoCBertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"cls_token_id",val:": int = None"},{name:"sep_token_id",val:": int = None"}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.RoCBertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L782",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),jo=new R({props:{name:"get_special_tokens_mask",anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L812",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Po=new R({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L841",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Se=new se({props:{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[gp]},$$scope:{ctx:z}}}),Oo=new R({props:{name:"save_vocabulary",anchor:"transformers.RoCBertTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L870"}}),Io=new O({}),Lo=new R({props:{name:"class transformers.RoCBertModel",anchor:"transformers.RoCBertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.RoCBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L882"}}),Qo=new R({props:{name:"forward",anchor:"transformers.RoCBertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertModel.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertModel.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.RoCBertModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.RoCBertModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.RoCBertModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code> of length <code>config.n_layers</code> with each tuple having 4 tensors of shape <code>(batch_size, num_heads, sequence_length - 1, embed_size_per_head)</code>) &#x2014;
Contains precomputed key and value hidden states of the attention blocks. Can be used to speed up decoding.
If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.RoCBertModel.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L937",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig"
>RoCBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new wo({props:{$$slots:{default:[_p]},$$scope:{ctx:z}}}),We=new se({props:{anchor:"transformers.RoCBertModel.forward.example",$$slots:{default:[bp]},$$scope:{ctx:z}}}),Uo=new O({}),Ho=new R({props:{name:"class transformers.RoCBertForPreTraining",anchor:"transformers.RoCBertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1083"}}),Zo=new R({props:{name:"forward",anchor:"transformers.RoCBertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForPreTraining.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.</p>
<p>attack_input_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
attack sample ids for computing the contrastive loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked),
the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
attack_input_shape_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
attack sample shape ids for computing the contrastive loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked),
the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
attack_input_pronunciation_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
attack sample pronunciation ids for computing the contrastive loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
labels_input_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
target ids for computing the contrastive loss and masked_lm_loss . Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked),
the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
labels_input_shape_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
target shape ids for computing the contrastive loss and masked_lm_loss . Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored
(masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>
labels_input_pronunciation_ids (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>):
target pronunciation ids for computing the contrastive loss and masked_lm_loss . Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code></p>
<p>kwargs (<code>Dict[str, any]</code>, optional, defaults to <em>{}</em>):
Used to hide legacy arguments that have been deprecated.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1103",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig"
>RoCBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new wo({props:{$$slots:{default:[kp]},$$scope:{ctx:z}}}),He=new se({props:{anchor:"transformers.RoCBertForPreTraining.forward.example",$$slots:{default:[vp]},$$scope:{ctx:z}}}),Jo=new O({}),Ko=new R({props:{name:"class transformers.RoCBertForCausalLM",anchor:"transformers.RoCBertForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1409"}}),Yo=new R({props:{name:"forward",anchor:"transformers.RoCBertForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.RoCBertForCausalLM.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong>  (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Sequence of hidden-states at the output of the last layer of the encoder. Used in the cross-attention if
the model is configured as a decoder.`,name:"encoder_hidden_states"},{anchor:"transformers.RoCBertForCausalLM.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on the padding token indices of the encoder input. This mask is used in
the cross-attention if the model is configured as a decoder. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>`,name:"encoder_attention_mask"},{anchor:"transformers.RoCBertForCausalLM.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) &#x2014;
Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and 2 additional tensors of shape
<code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>. The two additional tensors are
only required when the model is used as a decoder in a Sequence to Sequence model.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used (see <code>past_key_values</code> input) to speed up sequential decoding.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>decoder_input_ids</code> (those that
don&#x2019;t have their past key value states given to this model) of shape <code>(batch_size, 1)</code> instead of all
<code>decoder_input_ids</code> of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.RoCBertForCausalLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
<code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are
ignored (masked), the loss is only computed for the tokens with labels n <code>[0, ..., config.vocab_size]</code>.`,name:"labels"},{anchor:"transformers.RoCBertForCausalLM.forward.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, <code>past_key_values</code> key value states are returned and can be used to speed up decoding (see
<code>past_key_values</code>).`,name:"use_cache"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1434",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig"
>RoCBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Cross attentions weights after the attention softmax, used to compute the weighted average in the
cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> tuples of length <code>config.n_layers</code>, with each tuple containing the cached key,
value states of the self-attention and the cross-attention layers if model is used in encoder-decoder
setting. Only relevant if <code>config.is_decoder = True</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
<code>past_key_values</code> input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new wo({props:{$$slots:{default:[Tp]},$$scope:{ctx:z}}}),Ze=new se({props:{anchor:"transformers.RoCBertForCausalLM.forward.example",$$slots:{default:[wp]},$$scope:{ctx:z}}}),et=new O({}),ot=new R({props:{name:"class transformers.RoCBertForMaskedLM",anchor:"transformers.RoCBertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1268"}}),nt=new R({props:{name:"forward",anchor:"transformers.RoCBertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.RoCBertForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>.</p>
<p>Example &#x2014;`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1296"}}),Ke=new wo({props:{$$slots:{default:[yp]},$$scope:{ctx:z}}}),st=new O({}),rt=new R({props:{name:"class transformers.RoCBertForSequenceClassification",anchor:"transformers.RoCBertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1592"}}),lt=new R({props:{name:"forward",anchor:"transformers.RoCBertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.RoCBertForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1609",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig"
>RoCBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ye=new wo({props:{$$slots:{default:[Cp]},$$scope:{ctx:z}}}),eo=new se({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example",$$slots:{default:[$p]},$$scope:{ctx:z}}}),oo=new se({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example-2",$$slots:{default:[zp]},$$scope:{ctx:z}}}),dt=new O({}),ct=new R({props:{name:"class transformers.RoCBertForMultipleChoice",anchor:"transformers.RoCBertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1698"}}),ut=new R({props:{name:"forward",anchor:"transformers.RoCBertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.RoCBertForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1713",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig"
>RoCBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),no=new wo({props:{$$slots:{default:[Bp]},$$scope:{ctx:z}}}),so=new se({props:{anchor:"transformers.RoCBertForMultipleChoice.forward.example",$$slots:{default:[Rp]},$$scope:{ctx:z}}}),mt=new O({}),ft=new R({props:{name:"class transformers.RoCBertForTokenClassification",anchor:"transformers.RoCBertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1803"}}),bt=new R({props:{name:"forward",anchor:"transformers.RoCBertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.RoCBertForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1821",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig"
>RoCBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ao=new wo({props:{$$slots:{default:[xp]},$$scope:{ctx:z}}}),io=new se({props:{anchor:"transformers.RoCBertForTokenClassification.forward.example",$$slots:{default:[qp]},$$scope:{ctx:z}}}),kt=new O({}),vt=new R({props:{name:"class transformers.RoCBertForQuestionAnswering",anchor:"transformers.RoCBertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig">RoCBertConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1891"}}),wt=new R({props:{name:"forward",anchor:"transformers.RoCBertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1905",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertConfig"
>RoCBertConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.27.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),co=new wo({props:{$$slots:{default:[Mp]},$$scope:{ctx:z}}}),po=new se({props:{anchor:"transformers.RoCBertForQuestionAnswering.forward.example",$$slots:{default:[Fp]},$$scope:{ctx:z}}}),{c(){d=s("meta"),k=m(),u=s("h1"),h=s("a"),_=s("span"),v(n.$$.fragment),c=m(),B=s("span"),Br=i("RoCBert"),js=m(),ie=s("h2"),Fe=s("a"),bn=s("span"),v(yo.$$.fragment),Rr=m(),kn=s("span"),xr=i("Overview"),As=m(),Ee=s("p"),qr=i("The RoCBert model was proposed in "),Co=s("a"),Mr=i("RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining"),Fr=i(`  by HuiSu, WeiweiShi, XiaoyuShen, XiaoZhou, TuoJi, JiaruiFang, JieZhou.
It\u2019s a pretrained Chinese language model that is robust under various forms of adversarial attacks.`),Ps=m(),Rt=s("p"),Er=i("The abstract from the paper is the following:"),Os=m(),xt=s("p"),vn=s("em"),jr=i(`Large-scale pretrained language models have achieved SOTA results on NLP tasks. However, they have been shown
vulnerable to adversarial attacks especially for logographic languages like Chinese. In this work, we propose
ROCBERT: a pretrained Chinese Bert that is robust to various forms of adversarial attacks like word perturbation,
synonyms, typos, etc. It is pretrained with the contrastive learning objective which maximizes the label consistency
under different synthesized adversarial examples. The model takes as input multimodal information including the
semantic, phonetic and visual features. We show all these features are important to the model robustness since the
attack can be performed in all the three forms. Across 5 Chinese NLU tasks, ROCBERT outperforms strong baselines under
three blackbox adversarial algorithms without sacrificing the performance on clean testset. It also performs the best
in the toxic content detection task under human-made attacks.`),Is=m(),je=s("p"),Ar=i("This model was contributed by "),$o=s("a"),Pr=i("weiweishi"),Or=i("."),Ls=m(),le=s("h2"),Ae=s("a"),Tn=s("span"),v(zo.$$.fragment),Ir=m(),wn=s("span"),Lr=i("Documentation resources"),Ss=m(),q=s("ul"),yn=s("li"),qt=s("a"),Sr=i("Text classification task guide"),Nr=m(),Cn=s("li"),Mt=s("a"),Dr=i("Token classification task guide"),Wr=m(),$n=s("li"),Ft=s("a"),Qr=i("Question answering task guide"),Ur=m(),zn=s("li"),Et=s("a"),Hr=i("Causal language modeling task guide"),Gr=m(),Bn=s("li"),jt=s("a"),Vr=i("Masked language modeling task guide"),Zr=m(),Rn=s("li"),At=s("a"),Jr=i("Multiple choice task guide"),Ns=m(),de=s("h2"),Pe=s("a"),xn=s("span"),v(Bo.$$.fragment),Kr=m(),qn=s("span"),Xr=i("RoCBertConfig"),Ds=m(),A=s("div"),v(Ro.$$.fragment),Yr=m(),ce=s("p"),ea=i("This is the configuration class to store the configuration of a "),Pt=s("a"),oa=i("RoCBertModel"),ta=i(`. It is used to instantiate a
RoCBert model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the RoCBert
`),xo=s("a"),na=i("weiweishi/roc-bert-base-zh"),sa=i(" architecture."),ra=m(),pe=s("p"),aa=i("Configuration objects inherit from "),Ot=s("a"),ia=i("PretrainedConfig"),la=i(` and can be used to control the model outputs. Read the
documentation from `),It=s("a"),da=i("PretrainedConfig"),ca=i(" for more information."),pa=m(),v(Oe.$$.fragment),Ws=m(),he=s("h2"),Ie=s("a"),Mn=s("span"),v(qo.$$.fragment),ha=m(),Fn=s("span"),ua=i("RoCBertTokenizer"),Qs=m(),M=s("div"),v(Mo.$$.fragment),ma=m(),Y=s("div"),v(Fo.$$.fragment),fa=m(),En=s("p"),ga=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),_a=m(),Eo=s("ul"),Lt=s("li"),ba=i("single sequence: "),jn=s("code"),ka=i("[CLS] X [SEP]"),va=m(),St=s("li"),Ta=i("pair of sequences: "),An=s("code"),wa=i("[CLS] A [SEP] B [SEP]"),ya=m(),Le=s("div"),v(jo.$$.fragment),Ca=m(),Ao=s("p"),$a=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Pn=s("code"),za=i("prepare_for_model"),Ba=i(" method."),Ra=m(),I=s("div"),v(Po.$$.fragment),xa=m(),On=s("p"),qa=i("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),Ma=m(),v(Se.$$.fragment),Fa=m(),ue=s("p"),Ea=i("If "),In=s("code"),ja=i("token_ids_1"),Aa=i(" is "),Ln=s("code"),Pa=i("None"),Oa=i(", this method only returns the first portion of the mask (0s)."),Ia=m(),Nt=s("div"),v(Oo.$$.fragment),Us=m(),me=s("h2"),Ne=s("a"),Sn=s("span"),v(Io.$$.fragment),La=m(),Nn=s("span"),Sa=i("RoCBertModel"),Hs=m(),F=s("div"),v(Lo.$$.fragment),Na=m(),So=s("p"),Da=i(`The bare RoCBert Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),No=s("a"),Wa=i("torch.nn.Module"),Qa=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ua=m(),Do=s("p"),Ha=i(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Wo=s("a"),Ga=i(`Attention is
all you need`),Va=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Za=m(),x=s("p"),Ja=i("To behave as an decoder the model needs to be initialized with the "),Dn=s("code"),Ka=i("is_decoder"),Xa=i(` argument of the configuration set
to `),Wn=s("code"),Ya=i("True"),ei=i(". To be used in a Seq2Seq model, the model needs to be initialized with both "),Qn=s("code"),oi=i("is_decoder"),ti=i(` argument and
`),Un=s("code"),ni=i("add_cross_attention"),si=i(" set to "),Hn=s("code"),ri=i("True"),ai=i("; an "),Gn=s("code"),ii=i("encoder_hidden_states"),li=i(" is then expected as an input to the forward pass."),di=m(),L=s("div"),v(Qo.$$.fragment),ci=m(),fe=s("p"),pi=i("The "),Dt=s("a"),hi=i("RoCBertModel"),ui=i(" forward method, overrides the "),Vn=s("code"),mi=i("__call__"),fi=i(" special method."),gi=m(),v(De.$$.fragment),_i=m(),v(We.$$.fragment),Gs=m(),ge=s("h2"),Qe=s("a"),Zn=s("span"),v(Uo.$$.fragment),bi=m(),Jn=s("span"),ki=i("RoCBertForPreTraining"),Vs=m(),P=s("div"),v(Ho.$$.fragment),vi=m(),Kn=s("p"),Ti=i("RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),wi=m(),Go=s("p"),yi=i("This model is a PyTorch "),Vo=s("a"),Ci=i("torch.nn.Module"),$i=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),zi=m(),S=s("div"),v(Zo.$$.fragment),Bi=m(),_e=s("p"),Ri=i("The "),Wt=s("a"),xi=i("RoCBertForPreTraining"),qi=i(" forward method, overrides the "),Xn=s("code"),Mi=i("__call__"),Fi=i(" special method."),Ei=m(),v(Ue.$$.fragment),ji=m(),v(He.$$.fragment),Zs=m(),be=s("h2"),Ge=s("a"),Yn=s("span"),v(Jo.$$.fragment),Ai=m(),es=s("span"),Pi=i("RoCBertForCausalLM"),Js=m(),H=s("div"),v(Ko.$$.fragment),Oi=m(),ke=s("p"),Ii=i("RoCBert Model with a "),os=s("code"),Li=i("language modeling"),Si=i(` head on top for CLM fine-tuning.
This model is a PyTorch `),Xo=s("a"),Ni=i("torch.nn.Module"),Di=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Wi=m(),N=s("div"),v(Yo.$$.fragment),Qi=m(),ve=s("p"),Ui=i("The "),Qt=s("a"),Hi=i("RoCBertForCausalLM"),Gi=i(" forward method, overrides the "),ts=s("code"),Vi=i("__call__"),Zi=i(" special method."),Ji=m(),v(Ve.$$.fragment),Ki=m(),v(Ze.$$.fragment),Ks=m(),Te=s("h2"),Je=s("a"),ns=s("span"),v(et.$$.fragment),Xi=m(),ss=s("span"),Yi=i("RoCBertForMaskedLM"),Xs=m(),G=s("div"),v(ot.$$.fragment),el=m(),we=s("p"),ol=i("RoCBert Model with a "),rs=s("code"),tl=i("language modeling"),nl=i(` head on top.
This model is a PyTorch `),tt=s("a"),sl=i("torch.nn.Module"),rl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),al=m(),ee=s("div"),v(nt.$$.fragment),il=m(),ye=s("p"),ll=i("The "),Ut=s("a"),dl=i("RoCBertForMaskedLM"),cl=i(" forward method, overrides the "),as=s("code"),pl=i("__call__"),hl=i(" special method."),ul=m(),v(Ke.$$.fragment),Ys=m(),Ce=s("h2"),Xe=s("a"),is=s("span"),v(st.$$.fragment),ml=m(),ls=s("span"),fl=i("RoCBertForSequenceClassification"),er=m(),V=s("div"),v(rt.$$.fragment),gl=m(),at=s("p"),_l=i(`RoCBert Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),it=s("a"),bl=i("torch.nn.Module"),kl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vl=m(),E=s("div"),v(lt.$$.fragment),Tl=m(),$e=s("p"),wl=i("The "),Ht=s("a"),yl=i("RoCBertForSequenceClassification"),Cl=i(" forward method, overrides the "),ds=s("code"),$l=i("__call__"),zl=i(" special method."),Bl=m(),v(Ye.$$.fragment),Rl=m(),v(eo.$$.fragment),xl=m(),v(oo.$$.fragment),or=m(),ze=s("h2"),to=s("a"),cs=s("span"),v(dt.$$.fragment),ql=m(),ps=s("span"),Ml=i("RoCBertForMultipleChoice"),tr=m(),Z=s("div"),v(ct.$$.fragment),Fl=m(),pt=s("p"),El=i(`RoCBert Model with a multiple choice classification head on top (a linear layer on top of
the pooled output and a softmax) e.g. for RocStories/SWAG tasks.
This model is a PyTorch `),ht=s("a"),jl=i("torch.nn.Module"),Al=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pl=m(),D=s("div"),v(ut.$$.fragment),Ol=m(),Be=s("p"),Il=i("The "),Gt=s("a"),Ll=i("RoCBertForMultipleChoice"),Sl=i(" forward method, overrides the "),hs=s("code"),Nl=i("__call__"),Dl=i(" special method."),Wl=m(),v(no.$$.fragment),Ql=m(),v(so.$$.fragment),nr=m(),Re=s("h2"),ro=s("a"),us=s("span"),v(mt.$$.fragment),Ul=m(),ms=s("span"),Hl=i("RoCBertForTokenClassification"),sr=m(),J=s("div"),v(ft.$$.fragment),Gl=m(),gt=s("p"),Vl=i(`RoCBert Model with a token classification head on top (a linear layer on top of
the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.
This model is a PyTorch `),_t=s("a"),Zl=i("torch.nn.Module"),Jl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Kl=m(),W=s("div"),v(bt.$$.fragment),Xl=m(),xe=s("p"),Yl=i("The "),Vt=s("a"),ed=i("RoCBertForTokenClassification"),od=i(" forward method, overrides the "),fs=s("code"),td=i("__call__"),nd=i(" special method."),sd=m(),v(ao.$$.fragment),rd=m(),v(io.$$.fragment),rr=m(),qe=s("h2"),lo=s("a"),gs=s("span"),v(kt.$$.fragment),ad=m(),_s=s("span"),id=i("RoCBertForQuestionAnswering"),ar=m(),K=s("div"),v(vt.$$.fragment),ld=m(),X=s("p"),dd=i(`RoCBert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),bs=s("code"),cd=i("span start logits"),pd=i(" and "),ks=s("code"),hd=i("span end logits"),ud=i(`).
This model is a PyTorch `),Tt=s("a"),md=i("torch.nn.Module"),fd=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gd=m(),Q=s("div"),v(wt.$$.fragment),_d=m(),Me=s("p"),bd=i("The "),Zt=s("a"),kd=i("RoCBertForQuestionAnswering"),vd=i(" forward method, overrides the "),vs=s("code"),Td=i("__call__"),wd=i(" special method."),yd=m(),v(co.$$.fragment),Cd=m(),v(po.$$.fragment),this.h()},l(o){const g=up('[data-svelte="svelte-1phssyn"]',document.head);d=r(g,"META",{name:!0,content:!0}),g.forEach(t),k=f(o),u=r(o,"H1",{class:!0});var yt=a(u);h=r(yt,"A",{id:!0,class:!0,href:!0});var Ts=a(h);_=r(Ts,"SPAN",{});var ws=a(_);T(n.$$.fragment,ws),ws.forEach(t),Ts.forEach(t),c=f(yt),B=r(yt,"SPAN",{});var ys=a(B);Br=l(ys,"RoCBert"),ys.forEach(t),yt.forEach(t),js=f(o),ie=r(o,"H2",{class:!0});var Ct=a(ie);Fe=r(Ct,"A",{id:!0,class:!0,href:!0});var Cs=a(Fe);bn=r(Cs,"SPAN",{});var $s=a(bn);T(yo.$$.fragment,$s),$s.forEach(t),Cs.forEach(t),Rr=f(Ct),kn=r(Ct,"SPAN",{});var zs=a(kn);xr=l(zs,"Overview"),zs.forEach(t),Ct.forEach(t),As=f(o),Ee=r(o,"P",{});var $t=a(Ee);qr=l($t,"The RoCBert model was proposed in "),Co=r($t,"A",{href:!0,rel:!0});var Bs=a(Co);Mr=l(Bs,"RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining"),Bs.forEach(t),Fr=l($t,`  by HuiSu, WeiweiShi, XiaoyuShen, XiaoZhou, TuoJi, JiaruiFang, JieZhou.
It\u2019s a pretrained Chinese language model that is robust under various forms of adversarial attacks.`),$t.forEach(t),Ps=f(o),Rt=r(o,"P",{});var Rs=a(Rt);Er=l(Rs,"The abstract from the paper is the following:"),Rs.forEach(t),Os=f(o),xt=r(o,"P",{});var xs=a(xt);vn=r(xs,"EM",{});var qs=a(vn);jr=l(qs,`Large-scale pretrained language models have achieved SOTA results on NLP tasks. However, they have been shown
vulnerable to adversarial attacks especially for logographic languages like Chinese. In this work, we propose
ROCBERT: a pretrained Chinese Bert that is robust to various forms of adversarial attacks like word perturbation,
synonyms, typos, etc. It is pretrained with the contrastive learning objective which maximizes the label consistency
under different synthesized adversarial examples. The model takes as input multimodal information including the
semantic, phonetic and visual features. We show all these features are important to the model robustness since the
attack can be performed in all the three forms. Across 5 Chinese NLU tasks, ROCBERT outperforms strong baselines under
three blackbox adversarial algorithms without sacrificing the performance on clean testset. It also performs the best
in the toxic content detection task under human-made attacks.`),qs.forEach(t),xs.forEach(t),Is=f(o),je=r(o,"P",{});var zt=a(je);Ar=l(zt,"This model was contributed by "),$o=r(zt,"A",{href:!0,rel:!0});var Ms=a($o);Pr=l(Ms,"weiweishi"),Ms.forEach(t),Or=l(zt,"."),zt.forEach(t),Ls=f(o),le=r(o,"H2",{class:!0});var Bt=a(le);Ae=r(Bt,"A",{id:!0,class:!0,href:!0});var Fs=a(Ae);Tn=r(Fs,"SPAN",{});var Es=a(Tn);T(zo.$$.fragment,Es),Es.forEach(t),Fs.forEach(t),Ir=f(Bt),wn=r(Bt,"SPAN",{});var Bd=a(wn);Lr=l(Bd,"Documentation resources"),Bd.forEach(t),Bt.forEach(t),Ss=f(o),q=r(o,"UL",{});var U=a(q);yn=r(U,"LI",{});var Rd=a(yn);qt=r(Rd,"A",{href:!0});var xd=a(qt);Sr=l(xd,"Text classification task guide"),xd.forEach(t),Rd.forEach(t),Nr=f(U),Cn=r(U,"LI",{});var qd=a(Cn);Mt=r(qd,"A",{href:!0});var Md=a(Mt);Dr=l(Md,"Token classification task guide"),Md.forEach(t),qd.forEach(t),Wr=f(U),$n=r(U,"LI",{});var Fd=a($n);Ft=r(Fd,"A",{href:!0});var Ed=a(Ft);Qr=l(Ed,"Question answering task guide"),Ed.forEach(t),Fd.forEach(t),Ur=f(U),zn=r(U,"LI",{});var jd=a(zn);Et=r(jd,"A",{href:!0});var Ad=a(Et);Hr=l(Ad,"Causal language modeling task guide"),Ad.forEach(t),jd.forEach(t),Gr=f(U),Bn=r(U,"LI",{});var Pd=a(Bn);jt=r(Pd,"A",{href:!0});var Od=a(jt);Vr=l(Od,"Masked language modeling task guide"),Od.forEach(t),Pd.forEach(t),Zr=f(U),Rn=r(U,"LI",{});var Id=a(Rn);At=r(Id,"A",{href:!0});var Ld=a(At);Jr=l(Ld,"Multiple choice task guide"),Ld.forEach(t),Id.forEach(t),U.forEach(t),Ns=f(o),de=r(o,"H2",{class:!0});var lr=a(de);Pe=r(lr,"A",{id:!0,class:!0,href:!0});var Sd=a(Pe);xn=r(Sd,"SPAN",{});var Nd=a(xn);T(Bo.$$.fragment,Nd),Nd.forEach(t),Sd.forEach(t),Kr=f(lr),qn=r(lr,"SPAN",{});var Dd=a(qn);Xr=l(Dd,"RoCBertConfig"),Dd.forEach(t),lr.forEach(t),Ds=f(o),A=r(o,"DIV",{class:!0});var ho=a(A);T(Ro.$$.fragment,ho),Yr=f(ho),ce=r(ho,"P",{});var Jt=a(ce);ea=l(Jt,"This is the configuration class to store the configuration of a "),Pt=r(Jt,"A",{href:!0});var Wd=a(Pt);oa=l(Wd,"RoCBertModel"),Wd.forEach(t),ta=l(Jt,`. It is used to instantiate a
RoCBert model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the RoCBert
`),xo=r(Jt,"A",{href:!0,rel:!0});var Qd=a(xo);na=l(Qd,"weiweishi/roc-bert-base-zh"),Qd.forEach(t),sa=l(Jt," architecture."),Jt.forEach(t),ra=f(ho),pe=r(ho,"P",{});var Kt=a(pe);aa=l(Kt,"Configuration objects inherit from "),Ot=r(Kt,"A",{href:!0});var Ud=a(Ot);ia=l(Ud,"PretrainedConfig"),Ud.forEach(t),la=l(Kt,` and can be used to control the model outputs. Read the
documentation from `),It=r(Kt,"A",{href:!0});var Hd=a(It);da=l(Hd,"PretrainedConfig"),Hd.forEach(t),ca=l(Kt," for more information."),Kt.forEach(t),pa=f(ho),T(Oe.$$.fragment,ho),ho.forEach(t),Ws=f(o),he=r(o,"H2",{class:!0});var dr=a(he);Ie=r(dr,"A",{id:!0,class:!0,href:!0});var Gd=a(Ie);Mn=r(Gd,"SPAN",{});var Vd=a(Mn);T(qo.$$.fragment,Vd),Vd.forEach(t),Gd.forEach(t),ha=f(dr),Fn=r(dr,"SPAN",{});var Zd=a(Fn);ua=l(Zd,"RoCBertTokenizer"),Zd.forEach(t),dr.forEach(t),Qs=f(o),M=r(o,"DIV",{class:!0});var oe=a(M);T(Mo.$$.fragment,oe),ma=f(oe),Y=r(oe,"DIV",{class:!0});var Xt=a(Y);T(Fo.$$.fragment,Xt),fa=f(Xt),En=r(Xt,"P",{});var Jd=a(En);ga=l(Jd,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),Jd.forEach(t),_a=f(Xt),Eo=r(Xt,"UL",{});var cr=a(Eo);Lt=r(cr,"LI",{});var $d=a(Lt);ba=l($d,"single sequence: "),jn=r($d,"CODE",{});var Kd=a(jn);ka=l(Kd,"[CLS] X [SEP]"),Kd.forEach(t),$d.forEach(t),va=f(cr),St=r(cr,"LI",{});var zd=a(St);Ta=l(zd,"pair of sequences: "),An=r(zd,"CODE",{});var Xd=a(An);wa=l(Xd,"[CLS] A [SEP] B [SEP]"),Xd.forEach(t),zd.forEach(t),cr.forEach(t),Xt.forEach(t),ya=f(oe),Le=r(oe,"DIV",{class:!0});var pr=a(Le);T(jo.$$.fragment,pr),Ca=f(pr),Ao=r(pr,"P",{});var hr=a(Ao);$a=l(hr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Pn=r(hr,"CODE",{});var Yd=a(Pn);za=l(Yd,"prepare_for_model"),Yd.forEach(t),Ba=l(hr," method."),hr.forEach(t),pr.forEach(t),Ra=f(oe),I=r(oe,"DIV",{class:!0});var uo=a(I);T(Po.$$.fragment,uo),xa=f(uo),On=r(uo,"P",{});var ec=a(On);qa=l(ec,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),ec.forEach(t),Ma=f(uo),T(Se.$$.fragment,uo),Fa=f(uo),ue=r(uo,"P",{});var Yt=a(ue);Ea=l(Yt,"If "),In=r(Yt,"CODE",{});var oc=a(In);ja=l(oc,"token_ids_1"),oc.forEach(t),Aa=l(Yt," is "),Ln=r(Yt,"CODE",{});var tc=a(Ln);Pa=l(tc,"None"),tc.forEach(t),Oa=l(Yt,", this method only returns the first portion of the mask (0s)."),Yt.forEach(t),uo.forEach(t),Ia=f(oe),Nt=r(oe,"DIV",{class:!0});var nc=a(Nt);T(Oo.$$.fragment,nc),nc.forEach(t),oe.forEach(t),Us=f(o),me=r(o,"H2",{class:!0});var ur=a(me);Ne=r(ur,"A",{id:!0,class:!0,href:!0});var sc=a(Ne);Sn=r(sc,"SPAN",{});var rc=a(Sn);T(Io.$$.fragment,rc),rc.forEach(t),sc.forEach(t),La=f(ur),Nn=r(ur,"SPAN",{});var ac=a(Nn);Sa=l(ac,"RoCBertModel"),ac.forEach(t),ur.forEach(t),Hs=f(o),F=r(o,"DIV",{class:!0});var te=a(F);T(Lo.$$.fragment,te),Na=f(te),So=r(te,"P",{});var mr=a(So);Da=l(mr,`The bare RoCBert Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),No=r(mr,"A",{href:!0,rel:!0});var ic=a(No);Wa=l(ic,"torch.nn.Module"),ic.forEach(t),Qa=l(mr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),mr.forEach(t),Ua=f(te),Do=r(te,"P",{});var fr=a(Do);Ha=l(fr,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Wo=r(fr,"A",{href:!0,rel:!0});var lc=a(Wo);Ga=l(lc,`Attention is
all you need`),lc.forEach(t),Va=l(fr,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),fr.forEach(t),Za=f(te),x=r(te,"P",{});var j=a(x);Ja=l(j,"To behave as an decoder the model needs to be initialized with the "),Dn=r(j,"CODE",{});var dc=a(Dn);Ka=l(dc,"is_decoder"),dc.forEach(t),Xa=l(j,` argument of the configuration set
to `),Wn=r(j,"CODE",{});var cc=a(Wn);Ya=l(cc,"True"),cc.forEach(t),ei=l(j,". To be used in a Seq2Seq model, the model needs to be initialized with both "),Qn=r(j,"CODE",{});var pc=a(Qn);oi=l(pc,"is_decoder"),pc.forEach(t),ti=l(j,` argument and
`),Un=r(j,"CODE",{});var hc=a(Un);ni=l(hc,"add_cross_attention"),hc.forEach(t),si=l(j," set to "),Hn=r(j,"CODE",{});var uc=a(Hn);ri=l(uc,"True"),uc.forEach(t),ai=l(j,"; an "),Gn=r(j,"CODE",{});var mc=a(Gn);ii=l(mc,"encoder_hidden_states"),mc.forEach(t),li=l(j," is then expected as an input to the forward pass."),j.forEach(t),di=f(te),L=r(te,"DIV",{class:!0});var mo=a(L);T(Qo.$$.fragment,mo),ci=f(mo),fe=r(mo,"P",{});var en=a(fe);pi=l(en,"The "),Dt=r(en,"A",{href:!0});var fc=a(Dt);hi=l(fc,"RoCBertModel"),fc.forEach(t),ui=l(en," forward method, overrides the "),Vn=r(en,"CODE",{});var gc=a(Vn);mi=l(gc,"__call__"),gc.forEach(t),fi=l(en," special method."),en.forEach(t),gi=f(mo),T(De.$$.fragment,mo),_i=f(mo),T(We.$$.fragment,mo),mo.forEach(t),te.forEach(t),Gs=f(o),ge=r(o,"H2",{class:!0});var gr=a(ge);Qe=r(gr,"A",{id:!0,class:!0,href:!0});var _c=a(Qe);Zn=r(_c,"SPAN",{});var bc=a(Zn);T(Uo.$$.fragment,bc),bc.forEach(t),_c.forEach(t),bi=f(gr),Jn=r(gr,"SPAN",{});var kc=a(Jn);ki=l(kc,"RoCBertForPreTraining"),kc.forEach(t),gr.forEach(t),Vs=f(o),P=r(o,"DIV",{class:!0});var fo=a(P);T(Ho.$$.fragment,fo),vi=f(fo),Kn=r(fo,"P",{});var vc=a(Kn);Ti=l(vc,"RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),vc.forEach(t),wi=f(fo),Go=r(fo,"P",{});var _r=a(Go);yi=l(_r,"This model is a PyTorch "),Vo=r(_r,"A",{href:!0,rel:!0});var Tc=a(Vo);Ci=l(Tc,"torch.nn.Module"),Tc.forEach(t),$i=l(_r,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_r.forEach(t),zi=f(fo),S=r(fo,"DIV",{class:!0});var go=a(S);T(Zo.$$.fragment,go),Bi=f(go),_e=r(go,"P",{});var on=a(_e);Ri=l(on,"The "),Wt=r(on,"A",{href:!0});var wc=a(Wt);xi=l(wc,"RoCBertForPreTraining"),wc.forEach(t),qi=l(on," forward method, overrides the "),Xn=r(on,"CODE",{});var yc=a(Xn);Mi=l(yc,"__call__"),yc.forEach(t),Fi=l(on," special method."),on.forEach(t),Ei=f(go),T(Ue.$$.fragment,go),ji=f(go),T(He.$$.fragment,go),go.forEach(t),fo.forEach(t),Zs=f(o),be=r(o,"H2",{class:!0});var br=a(be);Ge=r(br,"A",{id:!0,class:!0,href:!0});var Cc=a(Ge);Yn=r(Cc,"SPAN",{});var $c=a(Yn);T(Jo.$$.fragment,$c),$c.forEach(t),Cc.forEach(t),Ai=f(br),es=r(br,"SPAN",{});var zc=a(es);Pi=l(zc,"RoCBertForCausalLM"),zc.forEach(t),br.forEach(t),Js=f(o),H=r(o,"DIV",{class:!0});var tn=a(H);T(Ko.$$.fragment,tn),Oi=f(tn),ke=r(tn,"P",{});var nn=a(ke);Ii=l(nn,"RoCBert Model with a "),os=r(nn,"CODE",{});var Bc=a(os);Li=l(Bc,"language modeling"),Bc.forEach(t),Si=l(nn,` head on top for CLM fine-tuning.
This model is a PyTorch `),Xo=r(nn,"A",{href:!0,rel:!0});var Rc=a(Xo);Ni=l(Rc,"torch.nn.Module"),Rc.forEach(t),Di=l(nn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),nn.forEach(t),Wi=f(tn),N=r(tn,"DIV",{class:!0});var _o=a(N);T(Yo.$$.fragment,_o),Qi=f(_o),ve=r(_o,"P",{});var sn=a(ve);Ui=l(sn,"The "),Qt=r(sn,"A",{href:!0});var xc=a(Qt);Hi=l(xc,"RoCBertForCausalLM"),xc.forEach(t),Gi=l(sn," forward method, overrides the "),ts=r(sn,"CODE",{});var qc=a(ts);Vi=l(qc,"__call__"),qc.forEach(t),Zi=l(sn," special method."),sn.forEach(t),Ji=f(_o),T(Ve.$$.fragment,_o),Ki=f(_o),T(Ze.$$.fragment,_o),_o.forEach(t),tn.forEach(t),Ks=f(o),Te=r(o,"H2",{class:!0});var kr=a(Te);Je=r(kr,"A",{id:!0,class:!0,href:!0});var Mc=a(Je);ns=r(Mc,"SPAN",{});var Fc=a(ns);T(et.$$.fragment,Fc),Fc.forEach(t),Mc.forEach(t),Xi=f(kr),ss=r(kr,"SPAN",{});var Ec=a(ss);Yi=l(Ec,"RoCBertForMaskedLM"),Ec.forEach(t),kr.forEach(t),Xs=f(o),G=r(o,"DIV",{class:!0});var rn=a(G);T(ot.$$.fragment,rn),el=f(rn),we=r(rn,"P",{});var an=a(we);ol=l(an,"RoCBert Model with a "),rs=r(an,"CODE",{});var jc=a(rs);tl=l(jc,"language modeling"),jc.forEach(t),nl=l(an,` head on top.
This model is a PyTorch `),tt=r(an,"A",{href:!0,rel:!0});var Ac=a(tt);sl=l(Ac,"torch.nn.Module"),Ac.forEach(t),rl=l(an,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),an.forEach(t),al=f(rn),ee=r(rn,"DIV",{class:!0});var ln=a(ee);T(nt.$$.fragment,ln),il=f(ln),ye=r(ln,"P",{});var dn=a(ye);ll=l(dn,"The "),Ut=r(dn,"A",{href:!0});var Pc=a(Ut);dl=l(Pc,"RoCBertForMaskedLM"),Pc.forEach(t),cl=l(dn," forward method, overrides the "),as=r(dn,"CODE",{});var Oc=a(as);pl=l(Oc,"__call__"),Oc.forEach(t),hl=l(dn," special method."),dn.forEach(t),ul=f(ln),T(Ke.$$.fragment,ln),ln.forEach(t),rn.forEach(t),Ys=f(o),Ce=r(o,"H2",{class:!0});var vr=a(Ce);Xe=r(vr,"A",{id:!0,class:!0,href:!0});var Ic=a(Xe);is=r(Ic,"SPAN",{});var Lc=a(is);T(st.$$.fragment,Lc),Lc.forEach(t),Ic.forEach(t),ml=f(vr),ls=r(vr,"SPAN",{});var Sc=a(ls);fl=l(Sc,"RoCBertForSequenceClassification"),Sc.forEach(t),vr.forEach(t),er=f(o),V=r(o,"DIV",{class:!0});var cn=a(V);T(rt.$$.fragment,cn),gl=f(cn),at=r(cn,"P",{});var Tr=a(at);_l=l(Tr,`RoCBert Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),it=r(Tr,"A",{href:!0,rel:!0});var Nc=a(it);bl=l(Nc,"torch.nn.Module"),Nc.forEach(t),kl=l(Tr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tr.forEach(t),vl=f(cn),E=r(cn,"DIV",{class:!0});var ne=a(E);T(lt.$$.fragment,ne),Tl=f(ne),$e=r(ne,"P",{});var pn=a($e);wl=l(pn,"The "),Ht=r(pn,"A",{href:!0});var Dc=a(Ht);yl=l(Dc,"RoCBertForSequenceClassification"),Dc.forEach(t),Cl=l(pn," forward method, overrides the "),ds=r(pn,"CODE",{});var Wc=a(ds);$l=l(Wc,"__call__"),Wc.forEach(t),zl=l(pn," special method."),pn.forEach(t),Bl=f(ne),T(Ye.$$.fragment,ne),Rl=f(ne),T(eo.$$.fragment,ne),xl=f(ne),T(oo.$$.fragment,ne),ne.forEach(t),cn.forEach(t),or=f(o),ze=r(o,"H2",{class:!0});var wr=a(ze);to=r(wr,"A",{id:!0,class:!0,href:!0});var Qc=a(to);cs=r(Qc,"SPAN",{});var Uc=a(cs);T(dt.$$.fragment,Uc),Uc.forEach(t),Qc.forEach(t),ql=f(wr),ps=r(wr,"SPAN",{});var Hc=a(ps);Ml=l(Hc,"RoCBertForMultipleChoice"),Hc.forEach(t),wr.forEach(t),tr=f(o),Z=r(o,"DIV",{class:!0});var hn=a(Z);T(ct.$$.fragment,hn),Fl=f(hn),pt=r(hn,"P",{});var yr=a(pt);El=l(yr,`RoCBert Model with a multiple choice classification head on top (a linear layer on top of
the pooled output and a softmax) e.g. for RocStories/SWAG tasks.
This model is a PyTorch `),ht=r(yr,"A",{href:!0,rel:!0});var Gc=a(ht);jl=l(Gc,"torch.nn.Module"),Gc.forEach(t),Al=l(yr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yr.forEach(t),Pl=f(hn),D=r(hn,"DIV",{class:!0});var bo=a(D);T(ut.$$.fragment,bo),Ol=f(bo),Be=r(bo,"P",{});var un=a(Be);Il=l(un,"The "),Gt=r(un,"A",{href:!0});var Vc=a(Gt);Ll=l(Vc,"RoCBertForMultipleChoice"),Vc.forEach(t),Sl=l(un," forward method, overrides the "),hs=r(un,"CODE",{});var Zc=a(hs);Nl=l(Zc,"__call__"),Zc.forEach(t),Dl=l(un," special method."),un.forEach(t),Wl=f(bo),T(no.$$.fragment,bo),Ql=f(bo),T(so.$$.fragment,bo),bo.forEach(t),hn.forEach(t),nr=f(o),Re=r(o,"H2",{class:!0});var Cr=a(Re);ro=r(Cr,"A",{id:!0,class:!0,href:!0});var Jc=a(ro);us=r(Jc,"SPAN",{});var Kc=a(us);T(mt.$$.fragment,Kc),Kc.forEach(t),Jc.forEach(t),Ul=f(Cr),ms=r(Cr,"SPAN",{});var Xc=a(ms);Hl=l(Xc,"RoCBertForTokenClassification"),Xc.forEach(t),Cr.forEach(t),sr=f(o),J=r(o,"DIV",{class:!0});var mn=a(J);T(ft.$$.fragment,mn),Gl=f(mn),gt=r(mn,"P",{});var $r=a(gt);Vl=l($r,`RoCBert Model with a token classification head on top (a linear layer on top of
the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.
This model is a PyTorch `),_t=r($r,"A",{href:!0,rel:!0});var Yc=a(_t);Zl=l(Yc,"torch.nn.Module"),Yc.forEach(t),Jl=l($r,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),$r.forEach(t),Kl=f(mn),W=r(mn,"DIV",{class:!0});var ko=a(W);T(bt.$$.fragment,ko),Xl=f(ko),xe=r(ko,"P",{});var fn=a(xe);Yl=l(fn,"The "),Vt=r(fn,"A",{href:!0});var ep=a(Vt);ed=l(ep,"RoCBertForTokenClassification"),ep.forEach(t),od=l(fn," forward method, overrides the "),fs=r(fn,"CODE",{});var op=a(fs);td=l(op,"__call__"),op.forEach(t),nd=l(fn," special method."),fn.forEach(t),sd=f(ko),T(ao.$$.fragment,ko),rd=f(ko),T(io.$$.fragment,ko),ko.forEach(t),mn.forEach(t),rr=f(o),qe=r(o,"H2",{class:!0});var zr=a(qe);lo=r(zr,"A",{id:!0,class:!0,href:!0});var tp=a(lo);gs=r(tp,"SPAN",{});var np=a(gs);T(kt.$$.fragment,np),np.forEach(t),tp.forEach(t),ad=f(zr),_s=r(zr,"SPAN",{});var sp=a(_s);id=l(sp,"RoCBertForQuestionAnswering"),sp.forEach(t),zr.forEach(t),ar=f(o),K=r(o,"DIV",{class:!0});var gn=a(K);T(vt.$$.fragment,gn),ld=f(gn),X=r(gn,"P",{});var vo=a(X);dd=l(vo,`RoCBert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),bs=r(vo,"CODE",{});var rp=a(bs);cd=l(rp,"span start logits"),rp.forEach(t),pd=l(vo," and "),ks=r(vo,"CODE",{});var ap=a(ks);hd=l(ap,"span end logits"),ap.forEach(t),ud=l(vo,`).
This model is a PyTorch `),Tt=r(vo,"A",{href:!0,rel:!0});var ip=a(Tt);md=l(ip,"torch.nn.Module"),ip.forEach(t),fd=l(vo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),vo.forEach(t),gd=f(gn),Q=r(gn,"DIV",{class:!0});var To=a(Q);T(wt.$$.fragment,To),_d=f(To),Me=r(To,"P",{});var _n=a(Me);bd=l(_n,"The "),Zt=r(_n,"A",{href:!0});var lp=a(Zt);kd=l(lp,"RoCBertForQuestionAnswering"),lp.forEach(t),vd=l(_n," forward method, overrides the "),vs=r(_n,"CODE",{});var dp=a(vs);Td=l(dp,"__call__"),dp.forEach(t),wd=l(_n," special method."),_n.forEach(t),yd=f(To),T(co.$$.fragment,To),Cd=f(To),T(po.$$.fragment,To),To.forEach(t),gn.forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(jp)),p(h,"id","rocbert"),p(h,"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"),p(h,"href","#rocbert"),p(u,"class","relative group"),p(Fe,"id","overview"),p(Fe,"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"),p(Fe,"href","#overview"),p(ie,"class","relative group"),p(Co,"href","https://aclanthology.org/2022.acl-long.65.pdf"),p(Co,"rel","nofollow"),p($o,"href","https://huggingface.co/weiweishi"),p($o,"rel","nofollow"),p(Ae,"id","documentation-resources"),p(Ae,"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"),p(Ae,"href","#documentation-resources"),p(le,"class","relative group"),p(qt,"href","./tasks/sequence_classification"),p(Mt,"href","./tasks/token_classification"),p(Ft,"href","./tasks/question_answering"),p(Et,"href","./tasks/language_modeling"),p(jt,"href","./tasks/masked_language_modeling"),p(At,"href","./tasks/multiple_choice"),p(Pe,"id","transformers.RoCBertConfig"),p(Pe,"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"),p(Pe,"href","#transformers.RoCBertConfig"),p(de,"class","relative group"),p(Pt,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertModel"),p(xo,"href","https://huggingface.co/weiweishi/roc-bert-base-zh"),p(xo,"rel","nofollow"),p(Ot,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),p(It,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ie,"id","transformers.RoCBertTokenizer"),p(Ie,"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"),p(Ie,"href","#transformers.RoCBertTokenizer"),p(he,"class","relative group"),p(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ne,"id","transformers.RoCBertModel"),p(Ne,"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"),p(Ne,"href","#transformers.RoCBertModel"),p(me,"class","relative group"),p(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(No,"rel","nofollow"),p(Wo,"href","https://arxiv.org/abs/1706.03762"),p(Wo,"rel","nofollow"),p(Dt,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertModel"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Qe,"id","transformers.RoCBertForPreTraining"),p(Qe,"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"),p(Qe,"href","#transformers.RoCBertForPreTraining"),p(ge,"class","relative group"),p(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Vo,"rel","nofollow"),p(Wt,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertForPreTraining"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ge,"id","transformers.RoCBertForCausalLM"),p(Ge,"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"),p(Ge,"href","#transformers.RoCBertForCausalLM"),p(be,"class","relative group"),p(Xo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Xo,"rel","nofollow"),p(Qt,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertForCausalLM"),p(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Je,"id","transformers.RoCBertForMaskedLM"),p(Je,"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"),p(Je,"href","#transformers.RoCBertForMaskedLM"),p(Te,"class","relative group"),p(tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(tt,"rel","nofollow"),p(Ut,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertForMaskedLM"),p(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Xe,"id","transformers.RoCBertForSequenceClassification"),p(Xe,"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"),p(Xe,"href","#transformers.RoCBertForSequenceClassification"),p(Ce,"class","relative group"),p(it,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(it,"rel","nofollow"),p(Ht,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertForSequenceClassification"),p(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(to,"id","transformers.RoCBertForMultipleChoice"),p(to,"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"),p(to,"href","#transformers.RoCBertForMultipleChoice"),p(ze,"class","relative group"),p(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ht,"rel","nofollow"),p(Gt,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertForMultipleChoice"),p(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ro,"id","transformers.RoCBertForTokenClassification"),p(ro,"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"),p(ro,"href","#transformers.RoCBertForTokenClassification"),p(Re,"class","relative group"),p(_t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(_t,"rel","nofollow"),p(Vt,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertForTokenClassification"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(lo,"id","transformers.RoCBertForQuestionAnswering"),p(lo,"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"),p(lo,"href","#transformers.RoCBertForQuestionAnswering"),p(qe,"class","relative group"),p(Tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Tt,"rel","nofollow"),p(Zt,"href","/docs/transformers/v4.27.1/en/model_doc/roc_bert#transformers.RoCBertForQuestionAnswering"),p(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,d),b(o,k,g),b(o,u,g),e(u,h),e(h,_),w(n,_,null),e(u,c),e(u,B),e(B,Br),b(o,js,g),b(o,ie,g),e(ie,Fe),e(Fe,bn),w(yo,bn,null),e(ie,Rr),e(ie,kn),e(kn,xr),b(o,As,g),b(o,Ee,g),e(Ee,qr),e(Ee,Co),e(Co,Mr),e(Ee,Fr),b(o,Ps,g),b(o,Rt,g),e(Rt,Er),b(o,Os,g),b(o,xt,g),e(xt,vn),e(vn,jr),b(o,Is,g),b(o,je,g),e(je,Ar),e(je,$o),e($o,Pr),e(je,Or),b(o,Ls,g),b(o,le,g),e(le,Ae),e(Ae,Tn),w(zo,Tn,null),e(le,Ir),e(le,wn),e(wn,Lr),b(o,Ss,g),b(o,q,g),e(q,yn),e(yn,qt),e(qt,Sr),e(q,Nr),e(q,Cn),e(Cn,Mt),e(Mt,Dr),e(q,Wr),e(q,$n),e($n,Ft),e(Ft,Qr),e(q,Ur),e(q,zn),e(zn,Et),e(Et,Hr),e(q,Gr),e(q,Bn),e(Bn,jt),e(jt,Vr),e(q,Zr),e(q,Rn),e(Rn,At),e(At,Jr),b(o,Ns,g),b(o,de,g),e(de,Pe),e(Pe,xn),w(Bo,xn,null),e(de,Kr),e(de,qn),e(qn,Xr),b(o,Ds,g),b(o,A,g),w(Ro,A,null),e(A,Yr),e(A,ce),e(ce,ea),e(ce,Pt),e(Pt,oa),e(ce,ta),e(ce,xo),e(xo,na),e(ce,sa),e(A,ra),e(A,pe),e(pe,aa),e(pe,Ot),e(Ot,ia),e(pe,la),e(pe,It),e(It,da),e(pe,ca),e(A,pa),w(Oe,A,null),b(o,Ws,g),b(o,he,g),e(he,Ie),e(Ie,Mn),w(qo,Mn,null),e(he,ha),e(he,Fn),e(Fn,ua),b(o,Qs,g),b(o,M,g),w(Mo,M,null),e(M,ma),e(M,Y),w(Fo,Y,null),e(Y,fa),e(Y,En),e(En,ga),e(Y,_a),e(Y,Eo),e(Eo,Lt),e(Lt,ba),e(Lt,jn),e(jn,ka),e(Eo,va),e(Eo,St),e(St,Ta),e(St,An),e(An,wa),e(M,ya),e(M,Le),w(jo,Le,null),e(Le,Ca),e(Le,Ao),e(Ao,$a),e(Ao,Pn),e(Pn,za),e(Ao,Ba),e(M,Ra),e(M,I),w(Po,I,null),e(I,xa),e(I,On),e(On,qa),e(I,Ma),w(Se,I,null),e(I,Fa),e(I,ue),e(ue,Ea),e(ue,In),e(In,ja),e(ue,Aa),e(ue,Ln),e(Ln,Pa),e(ue,Oa),e(M,Ia),e(M,Nt),w(Oo,Nt,null),b(o,Us,g),b(o,me,g),e(me,Ne),e(Ne,Sn),w(Io,Sn,null),e(me,La),e(me,Nn),e(Nn,Sa),b(o,Hs,g),b(o,F,g),w(Lo,F,null),e(F,Na),e(F,So),e(So,Da),e(So,No),e(No,Wa),e(So,Qa),e(F,Ua),e(F,Do),e(Do,Ha),e(Do,Wo),e(Wo,Ga),e(Do,Va),e(F,Za),e(F,x),e(x,Ja),e(x,Dn),e(Dn,Ka),e(x,Xa),e(x,Wn),e(Wn,Ya),e(x,ei),e(x,Qn),e(Qn,oi),e(x,ti),e(x,Un),e(Un,ni),e(x,si),e(x,Hn),e(Hn,ri),e(x,ai),e(x,Gn),e(Gn,ii),e(x,li),e(F,di),e(F,L),w(Qo,L,null),e(L,ci),e(L,fe),e(fe,pi),e(fe,Dt),e(Dt,hi),e(fe,ui),e(fe,Vn),e(Vn,mi),e(fe,fi),e(L,gi),w(De,L,null),e(L,_i),w(We,L,null),b(o,Gs,g),b(o,ge,g),e(ge,Qe),e(Qe,Zn),w(Uo,Zn,null),e(ge,bi),e(ge,Jn),e(Jn,ki),b(o,Vs,g),b(o,P,g),w(Ho,P,null),e(P,vi),e(P,Kn),e(Kn,Ti),e(P,wi),e(P,Go),e(Go,yi),e(Go,Vo),e(Vo,Ci),e(Go,$i),e(P,zi),e(P,S),w(Zo,S,null),e(S,Bi),e(S,_e),e(_e,Ri),e(_e,Wt),e(Wt,xi),e(_e,qi),e(_e,Xn),e(Xn,Mi),e(_e,Fi),e(S,Ei),w(Ue,S,null),e(S,ji),w(He,S,null),b(o,Zs,g),b(o,be,g),e(be,Ge),e(Ge,Yn),w(Jo,Yn,null),e(be,Ai),e(be,es),e(es,Pi),b(o,Js,g),b(o,H,g),w(Ko,H,null),e(H,Oi),e(H,ke),e(ke,Ii),e(ke,os),e(os,Li),e(ke,Si),e(ke,Xo),e(Xo,Ni),e(ke,Di),e(H,Wi),e(H,N),w(Yo,N,null),e(N,Qi),e(N,ve),e(ve,Ui),e(ve,Qt),e(Qt,Hi),e(ve,Gi),e(ve,ts),e(ts,Vi),e(ve,Zi),e(N,Ji),w(Ve,N,null),e(N,Ki),w(Ze,N,null),b(o,Ks,g),b(o,Te,g),e(Te,Je),e(Je,ns),w(et,ns,null),e(Te,Xi),e(Te,ss),e(ss,Yi),b(o,Xs,g),b(o,G,g),w(ot,G,null),e(G,el),e(G,we),e(we,ol),e(we,rs),e(rs,tl),e(we,nl),e(we,tt),e(tt,sl),e(we,rl),e(G,al),e(G,ee),w(nt,ee,null),e(ee,il),e(ee,ye),e(ye,ll),e(ye,Ut),e(Ut,dl),e(ye,cl),e(ye,as),e(as,pl),e(ye,hl),e(ee,ul),w(Ke,ee,null),b(o,Ys,g),b(o,Ce,g),e(Ce,Xe),e(Xe,is),w(st,is,null),e(Ce,ml),e(Ce,ls),e(ls,fl),b(o,er,g),b(o,V,g),w(rt,V,null),e(V,gl),e(V,at),e(at,_l),e(at,it),e(it,bl),e(at,kl),e(V,vl),e(V,E),w(lt,E,null),e(E,Tl),e(E,$e),e($e,wl),e($e,Ht),e(Ht,yl),e($e,Cl),e($e,ds),e(ds,$l),e($e,zl),e(E,Bl),w(Ye,E,null),e(E,Rl),w(eo,E,null),e(E,xl),w(oo,E,null),b(o,or,g),b(o,ze,g),e(ze,to),e(to,cs),w(dt,cs,null),e(ze,ql),e(ze,ps),e(ps,Ml),b(o,tr,g),b(o,Z,g),w(ct,Z,null),e(Z,Fl),e(Z,pt),e(pt,El),e(pt,ht),e(ht,jl),e(pt,Al),e(Z,Pl),e(Z,D),w(ut,D,null),e(D,Ol),e(D,Be),e(Be,Il),e(Be,Gt),e(Gt,Ll),e(Be,Sl),e(Be,hs),e(hs,Nl),e(Be,Dl),e(D,Wl),w(no,D,null),e(D,Ql),w(so,D,null),b(o,nr,g),b(o,Re,g),e(Re,ro),e(ro,us),w(mt,us,null),e(Re,Ul),e(Re,ms),e(ms,Hl),b(o,sr,g),b(o,J,g),w(ft,J,null),e(J,Gl),e(J,gt),e(gt,Vl),e(gt,_t),e(_t,Zl),e(gt,Jl),e(J,Kl),e(J,W),w(bt,W,null),e(W,Xl),e(W,xe),e(xe,Yl),e(xe,Vt),e(Vt,ed),e(xe,od),e(xe,fs),e(fs,td),e(xe,nd),e(W,sd),w(ao,W,null),e(W,rd),w(io,W,null),b(o,rr,g),b(o,qe,g),e(qe,lo),e(lo,gs),w(kt,gs,null),e(qe,ad),e(qe,_s),e(_s,id),b(o,ar,g),b(o,K,g),w(vt,K,null),e(K,ld),e(K,X),e(X,dd),e(X,bs),e(bs,cd),e(X,pd),e(X,ks),e(ks,hd),e(X,ud),e(X,Tt),e(Tt,md),e(X,fd),e(K,gd),e(K,Q),w(wt,Q,null),e(Q,_d),e(Q,Me),e(Me,bd),e(Me,Zt),e(Zt,kd),e(Me,vd),e(Me,vs),e(vs,Td),e(Me,wd),e(Q,yd),w(co,Q,null),e(Q,Cd),w(po,Q,null),ir=!0},p(o,[g]){const yt={};g&2&&(yt.$$scope={dirty:g,ctx:o}),Oe.$set(yt);const Ts={};g&2&&(Ts.$$scope={dirty:g,ctx:o}),Se.$set(Ts);const ws={};g&2&&(ws.$$scope={dirty:g,ctx:o}),De.$set(ws);const ys={};g&2&&(ys.$$scope={dirty:g,ctx:o}),We.$set(ys);const Ct={};g&2&&(Ct.$$scope={dirty:g,ctx:o}),Ue.$set(Ct);const Cs={};g&2&&(Cs.$$scope={dirty:g,ctx:o}),He.$set(Cs);const $s={};g&2&&($s.$$scope={dirty:g,ctx:o}),Ve.$set($s);const zs={};g&2&&(zs.$$scope={dirty:g,ctx:o}),Ze.$set(zs);const $t={};g&2&&($t.$$scope={dirty:g,ctx:o}),Ke.$set($t);const Bs={};g&2&&(Bs.$$scope={dirty:g,ctx:o}),Ye.$set(Bs);const Rs={};g&2&&(Rs.$$scope={dirty:g,ctx:o}),eo.$set(Rs);const xs={};g&2&&(xs.$$scope={dirty:g,ctx:o}),oo.$set(xs);const qs={};g&2&&(qs.$$scope={dirty:g,ctx:o}),no.$set(qs);const zt={};g&2&&(zt.$$scope={dirty:g,ctx:o}),so.$set(zt);const Ms={};g&2&&(Ms.$$scope={dirty:g,ctx:o}),ao.$set(Ms);const Bt={};g&2&&(Bt.$$scope={dirty:g,ctx:o}),io.$set(Bt);const Fs={};g&2&&(Fs.$$scope={dirty:g,ctx:o}),co.$set(Fs);const Es={};g&2&&(Es.$$scope={dirty:g,ctx:o}),po.$set(Es)},i(o){ir||(y(n.$$.fragment,o),y(yo.$$.fragment,o),y(zo.$$.fragment,o),y(Bo.$$.fragment,o),y(Ro.$$.fragment,o),y(Oe.$$.fragment,o),y(qo.$$.fragment,o),y(Mo.$$.fragment,o),y(Fo.$$.fragment,o),y(jo.$$.fragment,o),y(Po.$$.fragment,o),y(Se.$$.fragment,o),y(Oo.$$.fragment,o),y(Io.$$.fragment,o),y(Lo.$$.fragment,o),y(Qo.$$.fragment,o),y(De.$$.fragment,o),y(We.$$.fragment,o),y(Uo.$$.fragment,o),y(Ho.$$.fragment,o),y(Zo.$$.fragment,o),y(Ue.$$.fragment,o),y(He.$$.fragment,o),y(Jo.$$.fragment,o),y(Ko.$$.fragment,o),y(Yo.$$.fragment,o),y(Ve.$$.fragment,o),y(Ze.$$.fragment,o),y(et.$$.fragment,o),y(ot.$$.fragment,o),y(nt.$$.fragment,o),y(Ke.$$.fragment,o),y(st.$$.fragment,o),y(rt.$$.fragment,o),y(lt.$$.fragment,o),y(Ye.$$.fragment,o),y(eo.$$.fragment,o),y(oo.$$.fragment,o),y(dt.$$.fragment,o),y(ct.$$.fragment,o),y(ut.$$.fragment,o),y(no.$$.fragment,o),y(so.$$.fragment,o),y(mt.$$.fragment,o),y(ft.$$.fragment,o),y(bt.$$.fragment,o),y(ao.$$.fragment,o),y(io.$$.fragment,o),y(kt.$$.fragment,o),y(vt.$$.fragment,o),y(wt.$$.fragment,o),y(co.$$.fragment,o),y(po.$$.fragment,o),ir=!0)},o(o){C(n.$$.fragment,o),C(yo.$$.fragment,o),C(zo.$$.fragment,o),C(Bo.$$.fragment,o),C(Ro.$$.fragment,o),C(Oe.$$.fragment,o),C(qo.$$.fragment,o),C(Mo.$$.fragment,o),C(Fo.$$.fragment,o),C(jo.$$.fragment,o),C(Po.$$.fragment,o),C(Se.$$.fragment,o),C(Oo.$$.fragment,o),C(Io.$$.fragment,o),C(Lo.$$.fragment,o),C(Qo.$$.fragment,o),C(De.$$.fragment,o),C(We.$$.fragment,o),C(Uo.$$.fragment,o),C(Ho.$$.fragment,o),C(Zo.$$.fragment,o),C(Ue.$$.fragment,o),C(He.$$.fragment,o),C(Jo.$$.fragment,o),C(Ko.$$.fragment,o),C(Yo.$$.fragment,o),C(Ve.$$.fragment,o),C(Ze.$$.fragment,o),C(et.$$.fragment,o),C(ot.$$.fragment,o),C(nt.$$.fragment,o),C(Ke.$$.fragment,o),C(st.$$.fragment,o),C(rt.$$.fragment,o),C(lt.$$.fragment,o),C(Ye.$$.fragment,o),C(eo.$$.fragment,o),C(oo.$$.fragment,o),C(dt.$$.fragment,o),C(ct.$$.fragment,o),C(ut.$$.fragment,o),C(no.$$.fragment,o),C(so.$$.fragment,o),C(mt.$$.fragment,o),C(ft.$$.fragment,o),C(bt.$$.fragment,o),C(ao.$$.fragment,o),C(io.$$.fragment,o),C(kt.$$.fragment,o),C(vt.$$.fragment,o),C(wt.$$.fragment,o),C(co.$$.fragment,o),C(po.$$.fragment,o),ir=!1},d(o){t(d),o&&t(k),o&&t(u),$(n),o&&t(js),o&&t(ie),$(yo),o&&t(As),o&&t(Ee),o&&t(Ps),o&&t(Rt),o&&t(Os),o&&t(xt),o&&t(Is),o&&t(je),o&&t(Ls),o&&t(le),$(zo),o&&t(Ss),o&&t(q),o&&t(Ns),o&&t(de),$(Bo),o&&t(Ds),o&&t(A),$(Ro),$(Oe),o&&t(Ws),o&&t(he),$(qo),o&&t(Qs),o&&t(M),$(Mo),$(Fo),$(jo),$(Po),$(Se),$(Oo),o&&t(Us),o&&t(me),$(Io),o&&t(Hs),o&&t(F),$(Lo),$(Qo),$(De),$(We),o&&t(Gs),o&&t(ge),$(Uo),o&&t(Vs),o&&t(P),$(Ho),$(Zo),$(Ue),$(He),o&&t(Zs),o&&t(be),$(Jo),o&&t(Js),o&&t(H),$(Ko),$(Yo),$(Ve),$(Ze),o&&t(Ks),o&&t(Te),$(et),o&&t(Xs),o&&t(G),$(ot),$(nt),$(Ke),o&&t(Ys),o&&t(Ce),$(st),o&&t(er),o&&t(V),$(rt),$(lt),$(Ye),$(eo),$(oo),o&&t(or),o&&t(ze),$(dt),o&&t(tr),o&&t(Z),$(ct),$(ut),$(no),$(so),o&&t(nr),o&&t(Re),$(mt),o&&t(sr),o&&t(J),$(ft),$(bt),$(ao),$(io),o&&t(rr),o&&t(qe),$(kt),o&&t(ar),o&&t(K),$(vt),$(wt),$(co),$(po)}}}const jp={local:"rocbert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.RoCBertConfig",title:"RoCBertConfig"},{local:"transformers.RoCBertTokenizer",title:"RoCBertTokenizer"},{local:"transformers.RoCBertModel",title:"RoCBertModel"},{local:"transformers.RoCBertForPreTraining",title:"RoCBertForPreTraining"},{local:"transformers.RoCBertForCausalLM",title:"RoCBertForCausalLM"},{local:"transformers.RoCBertForMaskedLM",title:"RoCBertForMaskedLM"},{local:"transformers.RoCBertForSequenceClassification",title:"RoCBertForSequenceClassification"},{local:"transformers.RoCBertForMultipleChoice",title:"RoCBertForMultipleChoice"},{local:"transformers.RoCBertForTokenClassification",title:"RoCBertForTokenClassification"},{local:"transformers.RoCBertForQuestionAnswering",title:"RoCBertForQuestionAnswering"}],title:"RoCBert"};function Ap(z){return mp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Dp extends cp{constructor(d){super();pp(this,d,Ap,Ep,hp,{})}}export{Dp as default,jp as metadata};
