import{S as wc,i as Cc,s as yc,e as r,k as u,w as v,t as l,M as $c,c as a,d as t,m,a as i,x as T,h as d,b as f,G as e,g as k,y as w,q as C,o as y,B as $,v as Bc,L as I}from"../../chunks/vendor-hf-doc-builder.js";import{T as Co}from"../../chunks/Tip-hf-doc-builder.js";import{D as R}from"../../chunks/Docstring-hf-doc-builder.js";import{C as L}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as G}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as A}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function zc(B){let s,_;return s=new L({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(s.$$.fragment)},l(c){T(s.$$.fragment,c)},m(c,p){w(s,c,p),_=!0},p:I,i(c){_||(C(s.$$.fragment,c),_=!0)},o(c){y(s.$$.fragment,c),_=!1},d(c){$(s,c)}}}function Rc(B){let s,_,c,p,b;return p=new L({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(){s=r("p"),_=l("pair mask has the following format:"),c=u(),v(p.$$.fragment)},l(n){s=a(n,"P",{});var h=i(s);_=d(h,"pair mask has the following format:"),h.forEach(t),c=m(n),T(p.$$.fragment,n)},m(n,h){k(n,s,h),e(s,_),k(n,c,h),w(p,n,h),b=!0},p:I,i(n){b||(C(p.$$.fragment,n),b=!0)},o(n){y(p.$$.fragment,n),b=!1},d(n){n&&t(s),n&&t(c),$(p,n)}}}function xc(B){let s,_,c,p,b;return{c(){s=r("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),p=l("Module"),b=l(`
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){s=a(n,"P",{});var h=i(s);_=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a(h,"CODE",{});var z=i(c);p=d(z,"Module"),z.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(n,h){k(n,s,h),e(s,_),e(s,c),e(c,p),e(s,b)},d(n){n&&t(s)}}}function qc(B){let s,_,c,p,b;return p=new L({props:{code:`from transformers import RoCBertTokenizer, RoCBertModel
import torch

tokenizer = RoCBertTokenizer.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> RoCBertTokenizer, 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 = RoCBertTokenizer.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(){s=r("p"),_=l("Example:"),c=u(),v(p.$$.fragment)},l(n){s=a(n,"P",{});var h=i(s);_=d(h,"Example:"),h.forEach(t),c=m(n),T(p.$$.fragment,n)},m(n,h){k(n,s,h),e(s,_),k(n,c,h),w(p,n,h),b=!0},p:I,i(n){b||(C(p.$$.fragment,n),b=!0)},o(n){y(p.$$.fragment,n),b=!1},d(n){n&&t(s),n&&t(c),$(p,n)}}}function Mc(B){let s,_,c,p,b;return{c(){s=r("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),p=l("Module"),b=l(`
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){s=a(n,"P",{});var h=i(s);_=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a(h,"CODE",{});var z=i(c);p=d(z,"Module"),z.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(n,h){k(n,s,h),e(s,_),e(s,c),e(c,p),e(s,b)},d(n){n&&t(s)}}}function Fc(B){let s,_,c,p,b;return p=new L({props:{code:`from transformers import RoCBertTokenizer, RoCBertForPreTraining
import torch

tokenizer = RoCBertTokenizer.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> RoCBertTokenizer, 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 = RoCBertTokenizer.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(){s=r("p"),_=l("Example:"),c=u(),v(p.$$.fragment)},l(n){s=a(n,"P",{});var h=i(s);_=d(h,"Example:"),h.forEach(t),c=m(n),T(p.$$.fragment,n)},m(n,h){k(n,s,h),e(s,_),k(n,c,h),w(p,n,h),b=!0},p:I,i(n){b||(C(p.$$.fragment,n),b=!0)},o(n){y(p.$$.fragment,n),b=!1},d(n){n&&t(s),n&&t(c),$(p,n)}}}function jc(B){let s,_,c,p,b;return{c(){s=r("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),p=l("Module"),b=l(`
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){s=a(n,"P",{});var h=i(s);_=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a(h,"CODE",{});var z=i(c);p=d(z,"Module"),z.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(n,h){k(n,s,h),e(s,_),e(s,c),e(c,p),e(s,b)},d(n){n&&t(s)}}}function Pc(B){let s,_,c,p,b;return p=new L({props:{code:`from transformers import RoCBertTokenizer, RoCBertForCausalLM, RoCBertConfig
import torch

tokenizer = RoCBertTokenizer.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> RoCBertTokenizer, 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 = RoCBertTokenizer.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(){s=r("p"),_=l("Example:"),c=u(),v(p.$$.fragment)},l(n){s=a(n,"P",{});var h=i(s);_=d(h,"Example:"),h.forEach(t),c=m(n),T(p.$$.fragment,n)},m(n,h){k(n,s,h),e(s,_),k(n,c,h),w(p,n,h),b=!0},p:I,i(n){b||(C(p.$$.fragment,n),b=!0)},o(n){y(p.$$.fragment,n),b=!1},d(n){n&&t(s),n&&t(c),$(p,n)}}}function Ec(B){let s,_,c,p,b;return{c(){s=r("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),p=l("Module"),b=l(`
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){s=a(n,"P",{});var h=i(s);_=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a(h,"CODE",{});var z=i(c);p=d(z,"Module"),z.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(n,h){k(n,s,h),e(s,_),e(s,c),e(c,p),e(s,b)},d(n){n&&t(s)}}}function Oc(B){let s,_,c,p,b;return{c(){s=r("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),p=l("Module"),b=l(`
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){s=a(n,"P",{});var h=i(s);_=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a(h,"CODE",{});var z=i(c);p=d(z,"Module"),z.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(n,h){k(n,s,h),e(s,_),e(s,c),e(c,p),e(s,b)},d(n){n&&t(s)}}}function Ac(B){let s,_,c,p,b;return p=new L({props:{code:`import torch
from transformers import RoCBertTokenizer, RoCBertForSequenceClassification

tokenizer = RoCBertTokenizer.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]`,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> RoCBertTokenizer, RoCBertForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = RoCBertTokenizer.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>`}}),{c(){s=r("p"),_=l("Example of single-label classification:"),c=u(),v(p.$$.fragment)},l(n){s=a(n,"P",{});var h=i(s);_=d(h,"Example of single-label classification:"),h.forEach(t),c=m(n),T(p.$$.fragment,n)},m(n,h){k(n,s,h),e(s,_),k(n,c,h),w(p,n,h),b=!0},p:I,i(n){b||(C(p.$$.fragment,n),b=!0)},o(n){y(p.$$.fragment,n),b=!1},d(n){n&&t(s),n&&t(c),$(p,n)}}}function Ic(B){let s,_;return s=new L({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = RoCBertForSequenceClassification.from_pretrained("ArthurZ/dummy-rocbert-seq", num_labels=num_labels)\n\nlabels = torch.tensor([1])\nloss = model(**inputs, labels=labels).loss\nround(loss.item(), 2)',highlighted:`<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(){v(s.$$.fragment)},l(c){T(s.$$.fragment,c)},m(c,p){w(s,c,p),_=!0},p:I,i(c){_||(C(s.$$.fragment,c),_=!0)},o(c){y(s.$$.fragment,c),_=!1},d(c){$(s,c)}}}function Lc(B){let s,_,c,p,b;return p=new L({props:{code:`import torch
from transformers import RoCBertTokenizer, RoCBertForSequenceClassification

tokenizer = RoCBertTokenizer.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_id = logits.argmax().item()
model.config.id2label[predicted_class_id]`,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> RoCBertTokenizer, RoCBertForSequenceClassification

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

tokenizer = RoCBertTokenizer.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> RoCBertTokenizer, 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 = RoCBertTokenizer.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(){s=r("p"),_=l("Example:"),c=u(),v(p.$$.fragment)},l(n){s=a(n,"P",{});var h=i(s);_=d(h,"Example:"),h.forEach(t),c=m(n),T(p.$$.fragment,n)},m(n,h){k(n,s,h),e(s,_),k(n,c,h),w(p,n,h),b=!0},p:I,i(n){b||(C(p.$$.fragment,n),b=!0)},o(n){y(p.$$.fragment,n),b=!1},d(n){n&&t(s),n&&t(c),$(p,n)}}}function Wc(B){let s,_,c,p,b;return{c(){s=r("p"),_=l("Although the recipe for forward pass needs to be defined within this function, one should call the "),c=r("code"),p=l("Module"),b=l(`
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){s=a(n,"P",{});var h=i(s);_=d(h,"Although the recipe for forward pass needs to be defined within this function, one should call the "),c=a(h,"CODE",{});var z=i(c);p=d(z,"Module"),z.forEach(t),b=d(h,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),h.forEach(t)},m(n,h){k(n,s,h),e(s,_),e(s,c),e(c,p),e(s,b)},d(n){n&&t(s)}}}function Qc(B){let s,_,c,p,b;return p=new L({props:{code:`from transformers import RoCBertTokenizer, RoCBertForTokenClassification
import torch

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

tokenizer = RoCBertTokenizer.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)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> RoCBertTokenizer, 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 = RoCBertTokenizer.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>`}}),{c(){s=r("p"),_=l("Example:"),c=u(),v(p.$$.fragment)},l(n){s=a(n,"P",{});var h=i(s);_=d(h,"Example:"),h.forEach(t),c=m(n),T(p.$$.fragment,n)},m(n,h){k(n,s,h),e(s,_),k(n,c,h),w(p,n,h),b=!0},p:I,i(n){b||(C(p.$$.fragment,n),b=!0)},o(n){y(p.$$.fragment,n),b=!1},d(n){n&&t(s),n&&t(c),$(p,n)}}}function Vc(B){let s,_;return s=new L({props:{code:`# 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-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(){v(s.$$.fragment)},l(c){T(s.$$.fragment,c)},m(c,p){w(s,c,p),_=!0},p:I,i(c){_||(C(s.$$.fragment,c),_=!0)},o(c){y(s.$$.fragment,c),_=!1},d(c){$(s,c)}}}function Zc(B){let s,_,c,p,b,n,h,z,pr,Ts,le,je,pn,yo,hr,hn,ur,ws,Pe,mr,$o,fr,gr,Cs,Rt,_r,ys,xt,un,br,$s,Ee,kr,Bo,vr,Tr,Bs,de,Oe,mn,zo,wr,fn,Cr,zs,S,Ro,yr,ce,$r,qt,Br,zr,xo,Rr,xr,qr,pe,Mr,Mt,Fr,jr,Ft,Pr,Er,Or,Ae,Rs,he,Ie,gn,qo,Ar,_n,Ir,xs,M,Mo,Lr,te,Fo,Sr,bn,Nr,Dr,jo,jt,Wr,kn,Qr,Ur,Pt,Hr,vn,Gr,Vr,Le,Po,Zr,Eo,Jr,Tn,Kr,Xr,Yr,D,Oo,ea,wn,oa,ta,Se,na,ue,sa,Cn,ra,aa,yn,ia,la,da,Et,Ao,qs,me,Ne,$n,Io,ca,Bn,pa,Ms,F,Lo,ha,So,ua,No,ma,fa,ga,Do,_a,Wo,ba,ka,va,q,Ta,zn,wa,Ca,Rn,ya,$a,xn,Ba,za,qn,Ra,xa,Mn,qa,Ma,Fn,Fa,ja,Pa,W,Qo,Ea,fe,Oa,Ot,Aa,Ia,jn,La,Sa,Na,De,Da,We,Fs,ge,Qe,Pn,Uo,Wa,En,Qa,js,N,Ho,Ua,On,Ha,Ga,Go,Va,Vo,Za,Ja,Ka,Q,Zo,Xa,_e,Ya,At,ei,oi,An,ti,ni,si,Ue,ri,He,Ps,be,Ge,In,Jo,ai,Ln,ii,Es,V,Ko,li,ke,di,Sn,ci,pi,Xo,hi,ui,mi,U,Yo,fi,ve,gi,It,_i,bi,Nn,ki,vi,Ti,Ve,wi,Ze,Os,Te,Je,Dn,et,Ci,Wn,yi,As,Z,ot,$i,we,Bi,Qn,zi,Ri,tt,xi,qi,Mi,ne,nt,Fi,Ce,ji,Lt,Pi,Ei,Un,Oi,Ai,Ii,Ke,Is,ye,Xe,Hn,st,Li,Gn,Si,Ls,J,rt,Ni,at,Di,it,Wi,Qi,Ui,x,lt,Hi,$e,Gi,St,Vi,Zi,Vn,Ji,Ki,Xi,Ye,Yi,eo,el,oo,ol,to,tl,no,Ss,Be,so,Zn,dt,nl,Jn,sl,Ns,K,ct,rl,pt,al,ht,il,ll,dl,H,ut,cl,ze,pl,Nt,hl,ul,Kn,ml,fl,gl,ro,_l,ao,Ds,Re,io,Xn,mt,bl,Yn,kl,Ws,X,ft,vl,gt,Tl,_t,wl,Cl,yl,j,bt,$l,xe,Bl,Dt,zl,Rl,es,xl,ql,Ml,lo,Fl,co,jl,po,Qs,qe,ho,os,kt,Pl,ts,El,Us,Y,vt,Ol,ee,Al,ns,Il,Ll,ss,Sl,Nl,Tt,Dl,Wl,Ql,P,wt,Ul,Me,Hl,Wt,Gl,Vl,rs,Zl,Jl,Kl,uo,Xl,mo,Yl,fo,Hs;return n=new G({}),yo=new G({}),zo=new G({}),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_cls",val:" = True"},{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.25.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.25.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.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_cls",description:`<strong>enable_cls</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model use cls loss when pretrained.`,name:"enable_cls"},{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.25.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.25.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.25.1/src/transformers/models/roc_bert/configuration_roc_bert.py#L28"}}),Ae=new A({props:{anchor:"transformers.RoCBertConfig.example",$$slots:{default:[zc]},$$scope:{ctx:B}}}),qo=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L783",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>
`}}),Po=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.25.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L813",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>
`}}),Oo=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.25.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L842",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 A({props:{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Rc]},$$scope:{ctx:B}}}),Ao=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.25.1/src/transformers/models/roc_bert/tokenization_roc_bert.py#L871"}}),Io=new G({}),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.25.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.25.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.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L937",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.1/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),De=new Co({props:{$$slots:{default:[xc]},$$scope:{ctx:B}}}),We=new A({props:{anchor:"transformers.RoCBertModel.forward.example",$$slots:{default:[qc]},$$scope:{ctx:B}}}),Uo=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1084"}}),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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1104",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.1/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ue=new Co({props:{$$slots:{default:[Mc]},$$scope:{ctx:B}}}),He=new A({props:{anchor:"transformers.RoCBertForPreTraining.forward.example",$$slots:{default:[Fc]},$$scope:{ctx:B}}}),Jo=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1410"}}),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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1435",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.1/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ve=new Co({props:{$$slots:{default:[jc]},$$scope:{ctx:B}}}),Ze=new A({props:{anchor:"transformers.RoCBertForCausalLM.forward.example",$$slots:{default:[Pc]},$$scope:{ctx:B}}}),et=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1269"}}),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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1297"}}),Ke=new Co({props:{$$slots:{default:[Ec]},$$scope:{ctx:B}}}),st=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1593"}}),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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1610",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.1/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ye=new Co({props:{$$slots:{default:[Oc]},$$scope:{ctx:B}}}),eo=new A({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example",$$slots:{default:[Ac]},$$scope:{ctx:B}}}),oo=new A({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example-2",$$slots:{default:[Ic]},$$scope:{ctx:B}}}),to=new A({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example-3",$$slots:{default:[Lc]},$$scope:{ctx:B}}}),no=new A({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example-4",$$slots:{default:[Sc]},$$scope:{ctx:B}}}),dt=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1700"}}),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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1715",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.1/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ro=new Co({props:{$$slots:{default:[Nc]},$$scope:{ctx:B}}}),ao=new A({props:{anchor:"transformers.RoCBertForMultipleChoice.forward.example",$$slots:{default:[Dc]},$$scope:{ctx:B}}}),mt=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1806"}}),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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1824",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.1/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),lo=new Co({props:{$$slots:{default:[Wc]},$$scope:{ctx:B}}}),co=new A({props:{anchor:"transformers.RoCBertForTokenClassification.forward.example",$$slots:{default:[Qc]},$$scope:{ctx:B}}}),po=new A({props:{anchor:"transformers.RoCBertForTokenClassification.forward.example-2",$$slots:{default:[Uc]},$$scope:{ctx:B}}}),kt=new G({}),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.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1895"}}),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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.1/en/model_doc/roc_bert#transformers.RoCBertTokenizer">RoCBertTokenizer</a>. See <a href="/docs/transformers/v4.25.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.25.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.25.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.25.1/src/transformers/models/roc_bert/modeling_roc_bert.py#L1909",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.25.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.25.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.25.1/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),uo=new Co({props:{$$slots:{default:[Hc]},$$scope:{ctx:B}}}),mo=new A({props:{anchor:"transformers.RoCBertForQuestionAnswering.forward.example",$$slots:{default:[Gc]},$$scope:{ctx:B}}}),fo=new A({props:{anchor:"transformers.RoCBertForQuestionAnswering.forward.example-2",$$slots:{default:[Vc]},$$scope:{ctx:B}}}),{c(){s=r("meta"),_=u(),c=r("h1"),p=r("a"),b=r("span"),v(n.$$.fragment),h=u(),z=r("span"),pr=l("RoCBert"),Ts=u(),le=r("h2"),je=r("a"),pn=r("span"),v(yo.$$.fragment),hr=u(),hn=r("span"),ur=l("Overview"),ws=u(),Pe=r("p"),mr=l("The RoCBert model was proposed in "),$o=r("a"),fr=l("RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining"),gr=l(`  by HuiSu, WeiweiShi, XiaoyuShen, XiaoZhou, TuoJi, JiaruiFang, JieZhou.
It\u2019s a pretrained Chinese language model that is robust under various forms of adversarial attacks.`),Cs=u(),Rt=r("p"),_r=l("The abstract from the paper is the following:"),ys=u(),xt=r("p"),un=r("em"),br=l(`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.`),$s=u(),Ee=r("p"),kr=l("This model was contributed by "),Bo=r("a"),vr=l("weiweishi"),Tr=l("."),Bs=u(),de=r("h2"),Oe=r("a"),mn=r("span"),v(zo.$$.fragment),wr=u(),fn=r("span"),Cr=l("RoCBertConfig"),zs=u(),S=r("div"),v(Ro.$$.fragment),yr=u(),ce=r("p"),$r=l("This is the configuration class to store the configuration of a "),qt=r("a"),Br=l("RoCBertModel"),zr=l(`. 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("a"),Rr=l("weiweishi/roc-bert-base-zh"),xr=l(" architecture."),qr=u(),pe=r("p"),Mr=l("Configuration objects inherit from "),Mt=r("a"),Fr=l("PretrainedConfig"),jr=l(` and can be used to control the model outputs. Read the
documentation from `),Ft=r("a"),Pr=l("PretrainedConfig"),Er=l(" for more information."),Or=u(),v(Ae.$$.fragment),Rs=u(),he=r("h2"),Ie=r("a"),gn=r("span"),v(qo.$$.fragment),Ar=u(),_n=r("span"),Ir=l("RoCBertTokenizer"),xs=u(),M=r("div"),v(Mo.$$.fragment),Lr=u(),te=r("div"),v(Fo.$$.fragment),Sr=u(),bn=r("p"),Nr=l(`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:`),Dr=u(),jo=r("ul"),jt=r("li"),Wr=l("single sequence: "),kn=r("code"),Qr=l("[CLS] X [SEP]"),Ur=u(),Pt=r("li"),Hr=l("pair of sequences: "),vn=r("code"),Gr=l("[CLS] A [SEP] B [SEP]"),Vr=u(),Le=r("div"),v(Po.$$.fragment),Zr=u(),Eo=r("p"),Jr=l(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Tn=r("code"),Kr=l("prepare_for_model"),Xr=l(" method."),Yr=u(),D=r("div"),v(Oo.$$.fragment),ea=u(),wn=r("p"),oa=l("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),ta=u(),v(Se.$$.fragment),na=u(),ue=r("p"),sa=l("If "),Cn=r("code"),ra=l("token_ids_1"),aa=l(" is "),yn=r("code"),ia=l("None"),la=l(", this method only returns the first portion of the mask (0s)."),da=u(),Et=r("div"),v(Ao.$$.fragment),qs=u(),me=r("h2"),Ne=r("a"),$n=r("span"),v(Io.$$.fragment),ca=u(),Bn=r("span"),pa=l("RoCBertModel"),Ms=u(),F=r("div"),v(Lo.$$.fragment),ha=u(),So=r("p"),ua=l(`The bare RoCBert Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),No=r("a"),ma=l("torch.nn.Module"),fa=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ga=u(),Do=r("p"),_a=l(`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("a"),ba=l(`Attention is
all you need`),ka=l(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),va=u(),q=r("p"),Ta=l("To behave as an decoder the model needs to be initialized with the "),zn=r("code"),wa=l("is_decoder"),Ca=l(` argument of the configuration set
to `),Rn=r("code"),ya=l("True"),$a=l(". To be used in a Seq2Seq model, the model needs to be initialized with both "),xn=r("code"),Ba=l("is_decoder"),za=l(` argument and
`),qn=r("code"),Ra=l("add_cross_attention"),xa=l(" set to "),Mn=r("code"),qa=l("True"),Ma=l("; an "),Fn=r("code"),Fa=l("encoder_hidden_states"),ja=l(" is then expected as an input to the forward pass."),Pa=u(),W=r("div"),v(Qo.$$.fragment),Ea=u(),fe=r("p"),Oa=l("The "),Ot=r("a"),Aa=l("RoCBertModel"),Ia=l(" forward method, overrides the "),jn=r("code"),La=l("__call__"),Sa=l(" special method."),Na=u(),v(De.$$.fragment),Da=u(),v(We.$$.fragment),Fs=u(),ge=r("h2"),Qe=r("a"),Pn=r("span"),v(Uo.$$.fragment),Wa=u(),En=r("span"),Qa=l("RoCBertForPreTraining"),js=u(),N=r("div"),v(Ho.$$.fragment),Ua=u(),On=r("p"),Ha=l("RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),Ga=u(),Go=r("p"),Va=l("This model is a PyTorch "),Vo=r("a"),Za=l("torch.nn.Module"),Ja=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ka=u(),Q=r("div"),v(Zo.$$.fragment),Xa=u(),_e=r("p"),Ya=l("The "),At=r("a"),ei=l("RoCBertForPreTraining"),oi=l(" forward method, overrides the "),An=r("code"),ti=l("__call__"),ni=l(" special method."),si=u(),v(Ue.$$.fragment),ri=u(),v(He.$$.fragment),Ps=u(),be=r("h2"),Ge=r("a"),In=r("span"),v(Jo.$$.fragment),ai=u(),Ln=r("span"),ii=l("RoCBertForCausalLM"),Es=u(),V=r("div"),v(Ko.$$.fragment),li=u(),ke=r("p"),di=l("RoCBert Model with a "),Sn=r("code"),ci=l("language modeling"),pi=l(` head on top for CLM fine-tuning.
This model is a PyTorch `),Xo=r("a"),hi=l("torch.nn.Module"),ui=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),mi=u(),U=r("div"),v(Yo.$$.fragment),fi=u(),ve=r("p"),gi=l("The "),It=r("a"),_i=l("RoCBertForCausalLM"),bi=l(" forward method, overrides the "),Nn=r("code"),ki=l("__call__"),vi=l(" special method."),Ti=u(),v(Ve.$$.fragment),wi=u(),v(Ze.$$.fragment),Os=u(),Te=r("h2"),Je=r("a"),Dn=r("span"),v(et.$$.fragment),Ci=u(),Wn=r("span"),yi=l("RoCBertForMaskedLM"),As=u(),Z=r("div"),v(ot.$$.fragment),$i=u(),we=r("p"),Bi=l("RoCBert Model with a "),Qn=r("code"),zi=l("language modeling"),Ri=l(` head on top.
This model is a PyTorch `),tt=r("a"),xi=l("torch.nn.Module"),qi=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Mi=u(),ne=r("div"),v(nt.$$.fragment),Fi=u(),Ce=r("p"),ji=l("The "),Lt=r("a"),Pi=l("RoCBertForMaskedLM"),Ei=l(" forward method, overrides the "),Un=r("code"),Oi=l("__call__"),Ai=l(" special method."),Ii=u(),v(Ke.$$.fragment),Is=u(),ye=r("h2"),Xe=r("a"),Hn=r("span"),v(st.$$.fragment),Li=u(),Gn=r("span"),Si=l("RoCBertForSequenceClassification"),Ls=u(),J=r("div"),v(rt.$$.fragment),Ni=u(),at=r("p"),Di=l(`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("a"),Wi=l("torch.nn.Module"),Qi=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ui=u(),x=r("div"),v(lt.$$.fragment),Hi=u(),$e=r("p"),Gi=l("The "),St=r("a"),Vi=l("RoCBertForSequenceClassification"),Zi=l(" forward method, overrides the "),Vn=r("code"),Ji=l("__call__"),Ki=l(" special method."),Xi=u(),v(Ye.$$.fragment),Yi=u(),v(eo.$$.fragment),el=u(),v(oo.$$.fragment),ol=u(),v(to.$$.fragment),tl=u(),v(no.$$.fragment),Ss=u(),Be=r("h2"),so=r("a"),Zn=r("span"),v(dt.$$.fragment),nl=u(),Jn=r("span"),sl=l("RoCBertForMultipleChoice"),Ns=u(),K=r("div"),v(ct.$$.fragment),rl=u(),pt=r("p"),al=l(`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("a"),il=l("torch.nn.Module"),ll=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),dl=u(),H=r("div"),v(ut.$$.fragment),cl=u(),ze=r("p"),pl=l("The "),Nt=r("a"),hl=l("RoCBertForMultipleChoice"),ul=l(" forward method, overrides the "),Kn=r("code"),ml=l("__call__"),fl=l(" special method."),gl=u(),v(ro.$$.fragment),_l=u(),v(ao.$$.fragment),Ds=u(),Re=r("h2"),io=r("a"),Xn=r("span"),v(mt.$$.fragment),bl=u(),Yn=r("span"),kl=l("RoCBertForTokenClassification"),Ws=u(),X=r("div"),v(ft.$$.fragment),vl=u(),gt=r("p"),Tl=l(`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("a"),wl=l("torch.nn.Module"),Cl=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),yl=u(),j=r("div"),v(bt.$$.fragment),$l=u(),xe=r("p"),Bl=l("The "),Dt=r("a"),zl=l("RoCBertForTokenClassification"),Rl=l(" forward method, overrides the "),es=r("code"),xl=l("__call__"),ql=l(" special method."),Ml=u(),v(lo.$$.fragment),Fl=u(),v(co.$$.fragment),jl=u(),v(po.$$.fragment),Qs=u(),qe=r("h2"),ho=r("a"),os=r("span"),v(kt.$$.fragment),Pl=u(),ts=r("span"),El=l("RoCBertForQuestionAnswering"),Us=u(),Y=r("div"),v(vt.$$.fragment),Ol=u(),ee=r("p"),Al=l(`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 `),ns=r("code"),Il=l("span start logits"),Ll=l(" and "),ss=r("code"),Sl=l("span end logits"),Nl=l(`).
This model is a PyTorch `),Tt=r("a"),Dl=l("torch.nn.Module"),Wl=l(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Ql=u(),P=r("div"),v(wt.$$.fragment),Ul=u(),Me=r("p"),Hl=l("The "),Wt=r("a"),Gl=l("RoCBertForQuestionAnswering"),Vl=l(" forward method, overrides the "),rs=r("code"),Zl=l("__call__"),Jl=l(" special method."),Kl=u(),v(uo.$$.fragment),Xl=u(),v(mo.$$.fragment),Yl=u(),v(fo.$$.fragment),this.h()},l(o){const g=$c('[data-svelte="svelte-1phssyn"]',document.head);s=a(g,"META",{name:!0,content:!0}),g.forEach(t),_=m(o),c=a(o,"H1",{class:!0});var Ct=i(c);p=a(Ct,"A",{id:!0,class:!0,href:!0});var as=i(p);b=a(as,"SPAN",{});var is=i(b);T(n.$$.fragment,is),is.forEach(t),as.forEach(t),h=m(Ct),z=a(Ct,"SPAN",{});var ls=i(z);pr=d(ls,"RoCBert"),ls.forEach(t),Ct.forEach(t),Ts=m(o),le=a(o,"H2",{class:!0});var yt=i(le);je=a(yt,"A",{id:!0,class:!0,href:!0});var ds=i(je);pn=a(ds,"SPAN",{});var cs=i(pn);T(yo.$$.fragment,cs),cs.forEach(t),ds.forEach(t),hr=m(yt),hn=a(yt,"SPAN",{});var ps=i(hn);ur=d(ps,"Overview"),ps.forEach(t),yt.forEach(t),ws=m(o),Pe=a(o,"P",{});var $t=i(Pe);mr=d($t,"The RoCBert model was proposed in "),$o=a($t,"A",{href:!0,rel:!0});var hs=i($o);fr=d(hs,"RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining"),hs.forEach(t),gr=d($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),Cs=m(o),Rt=a(o,"P",{});var us=i(Rt);_r=d(us,"The abstract from the paper is the following:"),us.forEach(t),ys=m(o),xt=a(o,"P",{});var ms=i(xt);un=a(ms,"EM",{});var fs=i(un);br=d(fs,`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.`),fs.forEach(t),ms.forEach(t),$s=m(o),Ee=a(o,"P",{});var Bt=i(Ee);kr=d(Bt,"This model was contributed by "),Bo=a(Bt,"A",{href:!0,rel:!0});var gs=i(Bo);vr=d(gs,"weiweishi"),gs.forEach(t),Tr=d(Bt,"."),Bt.forEach(t),Bs=m(o),de=a(o,"H2",{class:!0});var zt=i(de);Oe=a(zt,"A",{id:!0,class:!0,href:!0});var _s=i(Oe);mn=a(_s,"SPAN",{});var bs=i(mn);T(zo.$$.fragment,bs),bs.forEach(t),_s.forEach(t),wr=m(zt),fn=a(zt,"SPAN",{});var ks=i(fn);Cr=d(ks,"RoCBertConfig"),ks.forEach(t),zt.forEach(t),zs=m(o),S=a(o,"DIV",{class:!0});var oe=i(S);T(Ro.$$.fragment,oe),yr=m(oe),ce=a(oe,"P",{});var Fe=i(ce);$r=d(Fe,"This is the configuration class to store the configuration of a "),qt=a(Fe,"A",{href:!0});var vs=i(qt);Br=d(vs,"RoCBertModel"),vs.forEach(t),zr=d(Fe,`. 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=a(Fe,"A",{href:!0,rel:!0});var td=i(xo);Rr=d(td,"weiweishi/roc-bert-base-zh"),td.forEach(t),xr=d(Fe," architecture."),Fe.forEach(t),qr=m(oe),pe=a(oe,"P",{});var Qt=i(pe);Mr=d(Qt,"Configuration objects inherit from "),Mt=a(Qt,"A",{href:!0});var nd=i(Mt);Fr=d(nd,"PretrainedConfig"),nd.forEach(t),jr=d(Qt,` and can be used to control the model outputs. Read the
documentation from `),Ft=a(Qt,"A",{href:!0});var sd=i(Ft);Pr=d(sd,"PretrainedConfig"),sd.forEach(t),Er=d(Qt," for more information."),Qt.forEach(t),Or=m(oe),T(Ae.$$.fragment,oe),oe.forEach(t),Rs=m(o),he=a(o,"H2",{class:!0});var Gs=i(he);Ie=a(Gs,"A",{id:!0,class:!0,href:!0});var rd=i(Ie);gn=a(rd,"SPAN",{});var ad=i(gn);T(qo.$$.fragment,ad),ad.forEach(t),rd.forEach(t),Ar=m(Gs),_n=a(Gs,"SPAN",{});var id=i(_n);Ir=d(id,"RoCBertTokenizer"),id.forEach(t),Gs.forEach(t),xs=m(o),M=a(o,"DIV",{class:!0});var se=i(M);T(Mo.$$.fragment,se),Lr=m(se),te=a(se,"DIV",{class:!0});var Ut=i(te);T(Fo.$$.fragment,Ut),Sr=m(Ut),bn=a(Ut,"P",{});var ld=i(bn);Nr=d(ld,`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:`),ld.forEach(t),Dr=m(Ut),jo=a(Ut,"UL",{});var Vs=i(jo);jt=a(Vs,"LI",{});var ed=i(jt);Wr=d(ed,"single sequence: "),kn=a(ed,"CODE",{});var dd=i(kn);Qr=d(dd,"[CLS] X [SEP]"),dd.forEach(t),ed.forEach(t),Ur=m(Vs),Pt=a(Vs,"LI",{});var od=i(Pt);Hr=d(od,"pair of sequences: "),vn=a(od,"CODE",{});var cd=i(vn);Gr=d(cd,"[CLS] A [SEP] B [SEP]"),cd.forEach(t),od.forEach(t),Vs.forEach(t),Ut.forEach(t),Vr=m(se),Le=a(se,"DIV",{class:!0});var Zs=i(Le);T(Po.$$.fragment,Zs),Zr=m(Zs),Eo=a(Zs,"P",{});var Js=i(Eo);Jr=d(Js,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),Tn=a(Js,"CODE",{});var pd=i(Tn);Kr=d(pd,"prepare_for_model"),pd.forEach(t),Xr=d(Js," method."),Js.forEach(t),Zs.forEach(t),Yr=m(se),D=a(se,"DIV",{class:!0});var go=i(D);T(Oo.$$.fragment,go),ea=m(go),wn=a(go,"P",{});var hd=i(wn);oa=d(hd,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),hd.forEach(t),ta=m(go),T(Se.$$.fragment,go),na=m(go),ue=a(go,"P",{});var Ht=i(ue);sa=d(Ht,"If "),Cn=a(Ht,"CODE",{});var ud=i(Cn);ra=d(ud,"token_ids_1"),ud.forEach(t),aa=d(Ht," is "),yn=a(Ht,"CODE",{});var md=i(yn);ia=d(md,"None"),md.forEach(t),la=d(Ht,", this method only returns the first portion of the mask (0s)."),Ht.forEach(t),go.forEach(t),da=m(se),Et=a(se,"DIV",{class:!0});var fd=i(Et);T(Ao.$$.fragment,fd),fd.forEach(t),se.forEach(t),qs=m(o),me=a(o,"H2",{class:!0});var Ks=i(me);Ne=a(Ks,"A",{id:!0,class:!0,href:!0});var gd=i(Ne);$n=a(gd,"SPAN",{});var _d=i($n);T(Io.$$.fragment,_d),_d.forEach(t),gd.forEach(t),ca=m(Ks),Bn=a(Ks,"SPAN",{});var bd=i(Bn);pa=d(bd,"RoCBertModel"),bd.forEach(t),Ks.forEach(t),Ms=m(o),F=a(o,"DIV",{class:!0});var re=i(F);T(Lo.$$.fragment,re),ha=m(re),So=a(re,"P",{});var Xs=i(So);ua=d(Xs,`The bare RoCBert Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),No=a(Xs,"A",{href:!0,rel:!0});var kd=i(No);ma=d(kd,"torch.nn.Module"),kd.forEach(t),fa=d(Xs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xs.forEach(t),ga=m(re),Do=a(re,"P",{});var Ys=i(Do);_a=d(Ys,`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=a(Ys,"A",{href:!0,rel:!0});var vd=i(Wo);ba=d(vd,`Attention is
all you need`),vd.forEach(t),ka=d(Ys,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Ys.forEach(t),va=m(re),q=a(re,"P",{});var E=i(q);Ta=d(E,"To behave as an decoder the model needs to be initialized with the "),zn=a(E,"CODE",{});var Td=i(zn);wa=d(Td,"is_decoder"),Td.forEach(t),Ca=d(E,` argument of the configuration set
to `),Rn=a(E,"CODE",{});var wd=i(Rn);ya=d(wd,"True"),wd.forEach(t),$a=d(E,". To be used in a Seq2Seq model, the model needs to be initialized with both "),xn=a(E,"CODE",{});var Cd=i(xn);Ba=d(Cd,"is_decoder"),Cd.forEach(t),za=d(E,` argument and
`),qn=a(E,"CODE",{});var yd=i(qn);Ra=d(yd,"add_cross_attention"),yd.forEach(t),xa=d(E," set to "),Mn=a(E,"CODE",{});var $d=i(Mn);qa=d($d,"True"),$d.forEach(t),Ma=d(E,"; an "),Fn=a(E,"CODE",{});var Bd=i(Fn);Fa=d(Bd,"encoder_hidden_states"),Bd.forEach(t),ja=d(E," is then expected as an input to the forward pass."),E.forEach(t),Pa=m(re),W=a(re,"DIV",{class:!0});var _o=i(W);T(Qo.$$.fragment,_o),Ea=m(_o),fe=a(_o,"P",{});var Gt=i(fe);Oa=d(Gt,"The "),Ot=a(Gt,"A",{href:!0});var zd=i(Ot);Aa=d(zd,"RoCBertModel"),zd.forEach(t),Ia=d(Gt," forward method, overrides the "),jn=a(Gt,"CODE",{});var Rd=i(jn);La=d(Rd,"__call__"),Rd.forEach(t),Sa=d(Gt," special method."),Gt.forEach(t),Na=m(_o),T(De.$$.fragment,_o),Da=m(_o),T(We.$$.fragment,_o),_o.forEach(t),re.forEach(t),Fs=m(o),ge=a(o,"H2",{class:!0});var er=i(ge);Qe=a(er,"A",{id:!0,class:!0,href:!0});var xd=i(Qe);Pn=a(xd,"SPAN",{});var qd=i(Pn);T(Uo.$$.fragment,qd),qd.forEach(t),xd.forEach(t),Wa=m(er),En=a(er,"SPAN",{});var Md=i(En);Qa=d(Md,"RoCBertForPreTraining"),Md.forEach(t),er.forEach(t),js=m(o),N=a(o,"DIV",{class:!0});var bo=i(N);T(Ho.$$.fragment,bo),Ua=m(bo),On=a(bo,"P",{});var Fd=i(On);Ha=d(Fd,"RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),Fd.forEach(t),Ga=m(bo),Go=a(bo,"P",{});var or=i(Go);Va=d(or,"This model is a PyTorch "),Vo=a(or,"A",{href:!0,rel:!0});var jd=i(Vo);Za=d(jd,"torch.nn.Module"),jd.forEach(t),Ja=d(or,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),or.forEach(t),Ka=m(bo),Q=a(bo,"DIV",{class:!0});var ko=i(Q);T(Zo.$$.fragment,ko),Xa=m(ko),_e=a(ko,"P",{});var Vt=i(_e);Ya=d(Vt,"The "),At=a(Vt,"A",{href:!0});var Pd=i(At);ei=d(Pd,"RoCBertForPreTraining"),Pd.forEach(t),oi=d(Vt," forward method, overrides the "),An=a(Vt,"CODE",{});var Ed=i(An);ti=d(Ed,"__call__"),Ed.forEach(t),ni=d(Vt," special method."),Vt.forEach(t),si=m(ko),T(Ue.$$.fragment,ko),ri=m(ko),T(He.$$.fragment,ko),ko.forEach(t),bo.forEach(t),Ps=m(o),be=a(o,"H2",{class:!0});var tr=i(be);Ge=a(tr,"A",{id:!0,class:!0,href:!0});var Od=i(Ge);In=a(Od,"SPAN",{});var Ad=i(In);T(Jo.$$.fragment,Ad),Ad.forEach(t),Od.forEach(t),ai=m(tr),Ln=a(tr,"SPAN",{});var Id=i(Ln);ii=d(Id,"RoCBertForCausalLM"),Id.forEach(t),tr.forEach(t),Es=m(o),V=a(o,"DIV",{class:!0});var Zt=i(V);T(Ko.$$.fragment,Zt),li=m(Zt),ke=a(Zt,"P",{});var Jt=i(ke);di=d(Jt,"RoCBert Model with a "),Sn=a(Jt,"CODE",{});var Ld=i(Sn);ci=d(Ld,"language modeling"),Ld.forEach(t),pi=d(Jt,` head on top for CLM fine-tuning.
This model is a PyTorch `),Xo=a(Jt,"A",{href:!0,rel:!0});var Sd=i(Xo);hi=d(Sd,"torch.nn.Module"),Sd.forEach(t),ui=d(Jt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jt.forEach(t),mi=m(Zt),U=a(Zt,"DIV",{class:!0});var vo=i(U);T(Yo.$$.fragment,vo),fi=m(vo),ve=a(vo,"P",{});var Kt=i(ve);gi=d(Kt,"The "),It=a(Kt,"A",{href:!0});var Nd=i(It);_i=d(Nd,"RoCBertForCausalLM"),Nd.forEach(t),bi=d(Kt," forward method, overrides the "),Nn=a(Kt,"CODE",{});var Dd=i(Nn);ki=d(Dd,"__call__"),Dd.forEach(t),vi=d(Kt," special method."),Kt.forEach(t),Ti=m(vo),T(Ve.$$.fragment,vo),wi=m(vo),T(Ze.$$.fragment,vo),vo.forEach(t),Zt.forEach(t),Os=m(o),Te=a(o,"H2",{class:!0});var nr=i(Te);Je=a(nr,"A",{id:!0,class:!0,href:!0});var Wd=i(Je);Dn=a(Wd,"SPAN",{});var Qd=i(Dn);T(et.$$.fragment,Qd),Qd.forEach(t),Wd.forEach(t),Ci=m(nr),Wn=a(nr,"SPAN",{});var Ud=i(Wn);yi=d(Ud,"RoCBertForMaskedLM"),Ud.forEach(t),nr.forEach(t),As=m(o),Z=a(o,"DIV",{class:!0});var Xt=i(Z);T(ot.$$.fragment,Xt),$i=m(Xt),we=a(Xt,"P",{});var Yt=i(we);Bi=d(Yt,"RoCBert Model with a "),Qn=a(Yt,"CODE",{});var Hd=i(Qn);zi=d(Hd,"language modeling"),Hd.forEach(t),Ri=d(Yt,` head on top.
This model is a PyTorch `),tt=a(Yt,"A",{href:!0,rel:!0});var Gd=i(tt);xi=d(Gd,"torch.nn.Module"),Gd.forEach(t),qi=d(Yt,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yt.forEach(t),Mi=m(Xt),ne=a(Xt,"DIV",{class:!0});var en=i(ne);T(nt.$$.fragment,en),Fi=m(en),Ce=a(en,"P",{});var on=i(Ce);ji=d(on,"The "),Lt=a(on,"A",{href:!0});var Vd=i(Lt);Pi=d(Vd,"RoCBertForMaskedLM"),Vd.forEach(t),Ei=d(on," forward method, overrides the "),Un=a(on,"CODE",{});var Zd=i(Un);Oi=d(Zd,"__call__"),Zd.forEach(t),Ai=d(on," special method."),on.forEach(t),Ii=m(en),T(Ke.$$.fragment,en),en.forEach(t),Xt.forEach(t),Is=m(o),ye=a(o,"H2",{class:!0});var sr=i(ye);Xe=a(sr,"A",{id:!0,class:!0,href:!0});var Jd=i(Xe);Hn=a(Jd,"SPAN",{});var Kd=i(Hn);T(st.$$.fragment,Kd),Kd.forEach(t),Jd.forEach(t),Li=m(sr),Gn=a(sr,"SPAN",{});var Xd=i(Gn);Si=d(Xd,"RoCBertForSequenceClassification"),Xd.forEach(t),sr.forEach(t),Ls=m(o),J=a(o,"DIV",{class:!0});var tn=i(J);T(rt.$$.fragment,tn),Ni=m(tn),at=a(tn,"P",{});var rr=i(at);Di=d(rr,`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=a(rr,"A",{href:!0,rel:!0});var Yd=i(it);Wi=d(Yd,"torch.nn.Module"),Yd.forEach(t),Qi=d(rr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),rr.forEach(t),Ui=m(tn),x=a(tn,"DIV",{class:!0});var O=i(x);T(lt.$$.fragment,O),Hi=m(O),$e=a(O,"P",{});var nn=i($e);Gi=d(nn,"The "),St=a(nn,"A",{href:!0});var ec=i(St);Vi=d(ec,"RoCBertForSequenceClassification"),ec.forEach(t),Zi=d(nn," forward method, overrides the "),Vn=a(nn,"CODE",{});var oc=i(Vn);Ji=d(oc,"__call__"),oc.forEach(t),Ki=d(nn," special method."),nn.forEach(t),Xi=m(O),T(Ye.$$.fragment,O),Yi=m(O),T(eo.$$.fragment,O),el=m(O),T(oo.$$.fragment,O),ol=m(O),T(to.$$.fragment,O),tl=m(O),T(no.$$.fragment,O),O.forEach(t),tn.forEach(t),Ss=m(o),Be=a(o,"H2",{class:!0});var ar=i(Be);so=a(ar,"A",{id:!0,class:!0,href:!0});var tc=i(so);Zn=a(tc,"SPAN",{});var nc=i(Zn);T(dt.$$.fragment,nc),nc.forEach(t),tc.forEach(t),nl=m(ar),Jn=a(ar,"SPAN",{});var sc=i(Jn);sl=d(sc,"RoCBertForMultipleChoice"),sc.forEach(t),ar.forEach(t),Ns=m(o),K=a(o,"DIV",{class:!0});var sn=i(K);T(ct.$$.fragment,sn),rl=m(sn),pt=a(sn,"P",{});var ir=i(pt);al=d(ir,`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=a(ir,"A",{href:!0,rel:!0});var rc=i(ht);il=d(rc,"torch.nn.Module"),rc.forEach(t),ll=d(ir,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ir.forEach(t),dl=m(sn),H=a(sn,"DIV",{class:!0});var To=i(H);T(ut.$$.fragment,To),cl=m(To),ze=a(To,"P",{});var rn=i(ze);pl=d(rn,"The "),Nt=a(rn,"A",{href:!0});var ac=i(Nt);hl=d(ac,"RoCBertForMultipleChoice"),ac.forEach(t),ul=d(rn," forward method, overrides the "),Kn=a(rn,"CODE",{});var ic=i(Kn);ml=d(ic,"__call__"),ic.forEach(t),fl=d(rn," special method."),rn.forEach(t),gl=m(To),T(ro.$$.fragment,To),_l=m(To),T(ao.$$.fragment,To),To.forEach(t),sn.forEach(t),Ds=m(o),Re=a(o,"H2",{class:!0});var lr=i(Re);io=a(lr,"A",{id:!0,class:!0,href:!0});var lc=i(io);Xn=a(lc,"SPAN",{});var dc=i(Xn);T(mt.$$.fragment,dc),dc.forEach(t),lc.forEach(t),bl=m(lr),Yn=a(lr,"SPAN",{});var cc=i(Yn);kl=d(cc,"RoCBertForTokenClassification"),cc.forEach(t),lr.forEach(t),Ws=m(o),X=a(o,"DIV",{class:!0});var an=i(X);T(ft.$$.fragment,an),vl=m(an),gt=a(an,"P",{});var dr=i(gt);Tl=d(dr,`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=a(dr,"A",{href:!0,rel:!0});var pc=i(_t);wl=d(pc,"torch.nn.Module"),pc.forEach(t),Cl=d(dr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),dr.forEach(t),yl=m(an),j=a(an,"DIV",{class:!0});var ae=i(j);T(bt.$$.fragment,ae),$l=m(ae),xe=a(ae,"P",{});var ln=i(xe);Bl=d(ln,"The "),Dt=a(ln,"A",{href:!0});var hc=i(Dt);zl=d(hc,"RoCBertForTokenClassification"),hc.forEach(t),Rl=d(ln," forward method, overrides the "),es=a(ln,"CODE",{});var uc=i(es);xl=d(uc,"__call__"),uc.forEach(t),ql=d(ln," special method."),ln.forEach(t),Ml=m(ae),T(lo.$$.fragment,ae),Fl=m(ae),T(co.$$.fragment,ae),jl=m(ae),T(po.$$.fragment,ae),ae.forEach(t),an.forEach(t),Qs=m(o),qe=a(o,"H2",{class:!0});var cr=i(qe);ho=a(cr,"A",{id:!0,class:!0,href:!0});var mc=i(ho);os=a(mc,"SPAN",{});var fc=i(os);T(kt.$$.fragment,fc),fc.forEach(t),mc.forEach(t),Pl=m(cr),ts=a(cr,"SPAN",{});var gc=i(ts);El=d(gc,"RoCBertForQuestionAnswering"),gc.forEach(t),cr.forEach(t),Us=m(o),Y=a(o,"DIV",{class:!0});var dn=i(Y);T(vt.$$.fragment,dn),Ol=m(dn),ee=a(dn,"P",{});var wo=i(ee);Al=d(wo,`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 `),ns=a(wo,"CODE",{});var _c=i(ns);Il=d(_c,"span start logits"),_c.forEach(t),Ll=d(wo," and "),ss=a(wo,"CODE",{});var bc=i(ss);Sl=d(bc,"span end logits"),bc.forEach(t),Nl=d(wo,`).
This model is a PyTorch `),Tt=a(wo,"A",{href:!0,rel:!0});var kc=i(Tt);Dl=d(kc,"torch.nn.Module"),kc.forEach(t),Wl=d(wo,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wo.forEach(t),Ql=m(dn),P=a(dn,"DIV",{class:!0});var ie=i(P);T(wt.$$.fragment,ie),Ul=m(ie),Me=a(ie,"P",{});var cn=i(Me);Hl=d(cn,"The "),Wt=a(cn,"A",{href:!0});var vc=i(Wt);Gl=d(vc,"RoCBertForQuestionAnswering"),vc.forEach(t),Vl=d(cn," forward method, overrides the "),rs=a(cn,"CODE",{});var Tc=i(rs);Zl=d(Tc,"__call__"),Tc.forEach(t),Jl=d(cn," special method."),cn.forEach(t),Kl=m(ie),T(uo.$$.fragment,ie),Xl=m(ie),T(mo.$$.fragment,ie),Yl=m(ie),T(fo.$$.fragment,ie),ie.forEach(t),dn.forEach(t),this.h()},h(){f(s,"name","hf:doc:metadata"),f(s,"content",JSON.stringify(Jc)),f(p,"id","rocbert"),f(p,"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"),f(p,"href","#rocbert"),f(c,"class","relative group"),f(je,"id","overview"),f(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"),f(je,"href","#overview"),f(le,"class","relative group"),f($o,"href","https://aclanthology.org/2022.acl-long.65.pdf"),f($o,"rel","nofollow"),f(Bo,"href","https://huggingface.co/weiweishi"),f(Bo,"rel","nofollow"),f(Oe,"id","transformers.RoCBertConfig"),f(Oe,"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"),f(Oe,"href","#transformers.RoCBertConfig"),f(de,"class","relative group"),f(qt,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertModel"),f(xo,"href","https://huggingface.co/weiweishi/roc-bert-base-zh"),f(xo,"rel","nofollow"),f(Mt,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(Ft,"href","/docs/transformers/v4.25.1/en/main_classes/configuration#transformers.PretrainedConfig"),f(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ie,"id","transformers.RoCBertTokenizer"),f(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"),f(Ie,"href","#transformers.RoCBertTokenizer"),f(he,"class","relative group"),f(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ne,"id","transformers.RoCBertModel"),f(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"),f(Ne,"href","#transformers.RoCBertModel"),f(me,"class","relative group"),f(No,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(No,"rel","nofollow"),f(Wo,"href","https://arxiv.org/abs/1706.03762"),f(Wo,"rel","nofollow"),f(Ot,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertModel"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Qe,"id","transformers.RoCBertForPreTraining"),f(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"),f(Qe,"href","#transformers.RoCBertForPreTraining"),f(ge,"class","relative group"),f(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Vo,"rel","nofollow"),f(At,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertForPreTraining"),f(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ge,"id","transformers.RoCBertForCausalLM"),f(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"),f(Ge,"href","#transformers.RoCBertForCausalLM"),f(be,"class","relative group"),f(Xo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Xo,"rel","nofollow"),f(It,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertForCausalLM"),f(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Je,"id","transformers.RoCBertForMaskedLM"),f(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"),f(Je,"href","#transformers.RoCBertForMaskedLM"),f(Te,"class","relative group"),f(tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(tt,"rel","nofollow"),f(Lt,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertForMaskedLM"),f(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Xe,"id","transformers.RoCBertForSequenceClassification"),f(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"),f(Xe,"href","#transformers.RoCBertForSequenceClassification"),f(ye,"class","relative group"),f(it,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(it,"rel","nofollow"),f(St,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertForSequenceClassification"),f(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(so,"id","transformers.RoCBertForMultipleChoice"),f(so,"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"),f(so,"href","#transformers.RoCBertForMultipleChoice"),f(Be,"class","relative group"),f(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(ht,"rel","nofollow"),f(Nt,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertForMultipleChoice"),f(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(io,"id","transformers.RoCBertForTokenClassification"),f(io,"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"),f(io,"href","#transformers.RoCBertForTokenClassification"),f(Re,"class","relative group"),f(_t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(_t,"rel","nofollow"),f(Dt,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertForTokenClassification"),f(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ho,"id","transformers.RoCBertForQuestionAnswering"),f(ho,"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"),f(ho,"href","#transformers.RoCBertForQuestionAnswering"),f(qe,"class","relative group"),f(Tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Tt,"rel","nofollow"),f(Wt,"href","/docs/transformers/v4.25.1/en/model_doc/roc_bert#transformers.RoCBertForQuestionAnswering"),f(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Y,"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,s),k(o,_,g),k(o,c,g),e(c,p),e(p,b),w(n,b,null),e(c,h),e(c,z),e(z,pr),k(o,Ts,g),k(o,le,g),e(le,je),e(je,pn),w(yo,pn,null),e(le,hr),e(le,hn),e(hn,ur),k(o,ws,g),k(o,Pe,g),e(Pe,mr),e(Pe,$o),e($o,fr),e(Pe,gr),k(o,Cs,g),k(o,Rt,g),e(Rt,_r),k(o,ys,g),k(o,xt,g),e(xt,un),e(un,br),k(o,$s,g),k(o,Ee,g),e(Ee,kr),e(Ee,Bo),e(Bo,vr),e(Ee,Tr),k(o,Bs,g),k(o,de,g),e(de,Oe),e(Oe,mn),w(zo,mn,null),e(de,wr),e(de,fn),e(fn,Cr),k(o,zs,g),k(o,S,g),w(Ro,S,null),e(S,yr),e(S,ce),e(ce,$r),e(ce,qt),e(qt,Br),e(ce,zr),e(ce,xo),e(xo,Rr),e(ce,xr),e(S,qr),e(S,pe),e(pe,Mr),e(pe,Mt),e(Mt,Fr),e(pe,jr),e(pe,Ft),e(Ft,Pr),e(pe,Er),e(S,Or),w(Ae,S,null),k(o,Rs,g),k(o,he,g),e(he,Ie),e(Ie,gn),w(qo,gn,null),e(he,Ar),e(he,_n),e(_n,Ir),k(o,xs,g),k(o,M,g),w(Mo,M,null),e(M,Lr),e(M,te),w(Fo,te,null),e(te,Sr),e(te,bn),e(bn,Nr),e(te,Dr),e(te,jo),e(jo,jt),e(jt,Wr),e(jt,kn),e(kn,Qr),e(jo,Ur),e(jo,Pt),e(Pt,Hr),e(Pt,vn),e(vn,Gr),e(M,Vr),e(M,Le),w(Po,Le,null),e(Le,Zr),e(Le,Eo),e(Eo,Jr),e(Eo,Tn),e(Tn,Kr),e(Eo,Xr),e(M,Yr),e(M,D),w(Oo,D,null),e(D,ea),e(D,wn),e(wn,oa),e(D,ta),w(Se,D,null),e(D,na),e(D,ue),e(ue,sa),e(ue,Cn),e(Cn,ra),e(ue,aa),e(ue,yn),e(yn,ia),e(ue,la),e(M,da),e(M,Et),w(Ao,Et,null),k(o,qs,g),k(o,me,g),e(me,Ne),e(Ne,$n),w(Io,$n,null),e(me,ca),e(me,Bn),e(Bn,pa),k(o,Ms,g),k(o,F,g),w(Lo,F,null),e(F,ha),e(F,So),e(So,ua),e(So,No),e(No,ma),e(So,fa),e(F,ga),e(F,Do),e(Do,_a),e(Do,Wo),e(Wo,ba),e(Do,ka),e(F,va),e(F,q),e(q,Ta),e(q,zn),e(zn,wa),e(q,Ca),e(q,Rn),e(Rn,ya),e(q,$a),e(q,xn),e(xn,Ba),e(q,za),e(q,qn),e(qn,Ra),e(q,xa),e(q,Mn),e(Mn,qa),e(q,Ma),e(q,Fn),e(Fn,Fa),e(q,ja),e(F,Pa),e(F,W),w(Qo,W,null),e(W,Ea),e(W,fe),e(fe,Oa),e(fe,Ot),e(Ot,Aa),e(fe,Ia),e(fe,jn),e(jn,La),e(fe,Sa),e(W,Na),w(De,W,null),e(W,Da),w(We,W,null),k(o,Fs,g),k(o,ge,g),e(ge,Qe),e(Qe,Pn),w(Uo,Pn,null),e(ge,Wa),e(ge,En),e(En,Qa),k(o,js,g),k(o,N,g),w(Ho,N,null),e(N,Ua),e(N,On),e(On,Ha),e(N,Ga),e(N,Go),e(Go,Va),e(Go,Vo),e(Vo,Za),e(Go,Ja),e(N,Ka),e(N,Q),w(Zo,Q,null),e(Q,Xa),e(Q,_e),e(_e,Ya),e(_e,At),e(At,ei),e(_e,oi),e(_e,An),e(An,ti),e(_e,ni),e(Q,si),w(Ue,Q,null),e(Q,ri),w(He,Q,null),k(o,Ps,g),k(o,be,g),e(be,Ge),e(Ge,In),w(Jo,In,null),e(be,ai),e(be,Ln),e(Ln,ii),k(o,Es,g),k(o,V,g),w(Ko,V,null),e(V,li),e(V,ke),e(ke,di),e(ke,Sn),e(Sn,ci),e(ke,pi),e(ke,Xo),e(Xo,hi),e(ke,ui),e(V,mi),e(V,U),w(Yo,U,null),e(U,fi),e(U,ve),e(ve,gi),e(ve,It),e(It,_i),e(ve,bi),e(ve,Nn),e(Nn,ki),e(ve,vi),e(U,Ti),w(Ve,U,null),e(U,wi),w(Ze,U,null),k(o,Os,g),k(o,Te,g),e(Te,Je),e(Je,Dn),w(et,Dn,null),e(Te,Ci),e(Te,Wn),e(Wn,yi),k(o,As,g),k(o,Z,g),w(ot,Z,null),e(Z,$i),e(Z,we),e(we,Bi),e(we,Qn),e(Qn,zi),e(we,Ri),e(we,tt),e(tt,xi),e(we,qi),e(Z,Mi),e(Z,ne),w(nt,ne,null),e(ne,Fi),e(ne,Ce),e(Ce,ji),e(Ce,Lt),e(Lt,Pi),e(Ce,Ei),e(Ce,Un),e(Un,Oi),e(Ce,Ai),e(ne,Ii),w(Ke,ne,null),k(o,Is,g),k(o,ye,g),e(ye,Xe),e(Xe,Hn),w(st,Hn,null),e(ye,Li),e(ye,Gn),e(Gn,Si),k(o,Ls,g),k(o,J,g),w(rt,J,null),e(J,Ni),e(J,at),e(at,Di),e(at,it),e(it,Wi),e(at,Qi),e(J,Ui),e(J,x),w(lt,x,null),e(x,Hi),e(x,$e),e($e,Gi),e($e,St),e(St,Vi),e($e,Zi),e($e,Vn),e(Vn,Ji),e($e,Ki),e(x,Xi),w(Ye,x,null),e(x,Yi),w(eo,x,null),e(x,el),w(oo,x,null),e(x,ol),w(to,x,null),e(x,tl),w(no,x,null),k(o,Ss,g),k(o,Be,g),e(Be,so),e(so,Zn),w(dt,Zn,null),e(Be,nl),e(Be,Jn),e(Jn,sl),k(o,Ns,g),k(o,K,g),w(ct,K,null),e(K,rl),e(K,pt),e(pt,al),e(pt,ht),e(ht,il),e(pt,ll),e(K,dl),e(K,H),w(ut,H,null),e(H,cl),e(H,ze),e(ze,pl),e(ze,Nt),e(Nt,hl),e(ze,ul),e(ze,Kn),e(Kn,ml),e(ze,fl),e(H,gl),w(ro,H,null),e(H,_l),w(ao,H,null),k(o,Ds,g),k(o,Re,g),e(Re,io),e(io,Xn),w(mt,Xn,null),e(Re,bl),e(Re,Yn),e(Yn,kl),k(o,Ws,g),k(o,X,g),w(ft,X,null),e(X,vl),e(X,gt),e(gt,Tl),e(gt,_t),e(_t,wl),e(gt,Cl),e(X,yl),e(X,j),w(bt,j,null),e(j,$l),e(j,xe),e(xe,Bl),e(xe,Dt),e(Dt,zl),e(xe,Rl),e(xe,es),e(es,xl),e(xe,ql),e(j,Ml),w(lo,j,null),e(j,Fl),w(co,j,null),e(j,jl),w(po,j,null),k(o,Qs,g),k(o,qe,g),e(qe,ho),e(ho,os),w(kt,os,null),e(qe,Pl),e(qe,ts),e(ts,El),k(o,Us,g),k(o,Y,g),w(vt,Y,null),e(Y,Ol),e(Y,ee),e(ee,Al),e(ee,ns),e(ns,Il),e(ee,Ll),e(ee,ss),e(ss,Sl),e(ee,Nl),e(ee,Tt),e(Tt,Dl),e(ee,Wl),e(Y,Ql),e(Y,P),w(wt,P,null),e(P,Ul),e(P,Me),e(Me,Hl),e(Me,Wt),e(Wt,Gl),e(Me,Vl),e(Me,rs),e(rs,Zl),e(Me,Jl),e(P,Kl),w(uo,P,null),e(P,Xl),w(mo,P,null),e(P,Yl),w(fo,P,null),Hs=!0},p(o,[g]){const Ct={};g&2&&(Ct.$$scope={dirty:g,ctx:o}),Ae.$set(Ct);const as={};g&2&&(as.$$scope={dirty:g,ctx:o}),Se.$set(as);const is={};g&2&&(is.$$scope={dirty:g,ctx:o}),De.$set(is);const ls={};g&2&&(ls.$$scope={dirty:g,ctx:o}),We.$set(ls);const yt={};g&2&&(yt.$$scope={dirty:g,ctx:o}),Ue.$set(yt);const ds={};g&2&&(ds.$$scope={dirty:g,ctx:o}),He.$set(ds);const cs={};g&2&&(cs.$$scope={dirty:g,ctx:o}),Ve.$set(cs);const ps={};g&2&&(ps.$$scope={dirty:g,ctx:o}),Ze.$set(ps);const $t={};g&2&&($t.$$scope={dirty:g,ctx:o}),Ke.$set($t);const hs={};g&2&&(hs.$$scope={dirty:g,ctx:o}),Ye.$set(hs);const us={};g&2&&(us.$$scope={dirty:g,ctx:o}),eo.$set(us);const ms={};g&2&&(ms.$$scope={dirty:g,ctx:o}),oo.$set(ms);const fs={};g&2&&(fs.$$scope={dirty:g,ctx:o}),to.$set(fs);const Bt={};g&2&&(Bt.$$scope={dirty:g,ctx:o}),no.$set(Bt);const gs={};g&2&&(gs.$$scope={dirty:g,ctx:o}),ro.$set(gs);const zt={};g&2&&(zt.$$scope={dirty:g,ctx:o}),ao.$set(zt);const _s={};g&2&&(_s.$$scope={dirty:g,ctx:o}),lo.$set(_s);const bs={};g&2&&(bs.$$scope={dirty:g,ctx:o}),co.$set(bs);const ks={};g&2&&(ks.$$scope={dirty:g,ctx:o}),po.$set(ks);const oe={};g&2&&(oe.$$scope={dirty:g,ctx:o}),uo.$set(oe);const Fe={};g&2&&(Fe.$$scope={dirty:g,ctx:o}),mo.$set(Fe);const vs={};g&2&&(vs.$$scope={dirty:g,ctx:o}),fo.$set(vs)},i(o){Hs||(C(n.$$.fragment,o),C(yo.$$.fragment,o),C(zo.$$.fragment,o),C(Ro.$$.fragment,o),C(Ae.$$.fragment,o),C(qo.$$.fragment,o),C(Mo.$$.fragment,o),C(Fo.$$.fragment,o),C(Po.$$.fragment,o),C(Oo.$$.fragment,o),C(Se.$$.fragment,o),C(Ao.$$.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(to.$$.fragment,o),C(no.$$.fragment,o),C(dt.$$.fragment,o),C(ct.$$.fragment,o),C(ut.$$.fragment,o),C(ro.$$.fragment,o),C(ao.$$.fragment,o),C(mt.$$.fragment,o),C(ft.$$.fragment,o),C(bt.$$.fragment,o),C(lo.$$.fragment,o),C(co.$$.fragment,o),C(po.$$.fragment,o),C(kt.$$.fragment,o),C(vt.$$.fragment,o),C(wt.$$.fragment,o),C(uo.$$.fragment,o),C(mo.$$.fragment,o),C(fo.$$.fragment,o),Hs=!0)},o(o){y(n.$$.fragment,o),y(yo.$$.fragment,o),y(zo.$$.fragment,o),y(Ro.$$.fragment,o),y(Ae.$$.fragment,o),y(qo.$$.fragment,o),y(Mo.$$.fragment,o),y(Fo.$$.fragment,o),y(Po.$$.fragment,o),y(Oo.$$.fragment,o),y(Se.$$.fragment,o),y(Ao.$$.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(to.$$.fragment,o),y(no.$$.fragment,o),y(dt.$$.fragment,o),y(ct.$$.fragment,o),y(ut.$$.fragment,o),y(ro.$$.fragment,o),y(ao.$$.fragment,o),y(mt.$$.fragment,o),y(ft.$$.fragment,o),y(bt.$$.fragment,o),y(lo.$$.fragment,o),y(co.$$.fragment,o),y(po.$$.fragment,o),y(kt.$$.fragment,o),y(vt.$$.fragment,o),y(wt.$$.fragment,o),y(uo.$$.fragment,o),y(mo.$$.fragment,o),y(fo.$$.fragment,o),Hs=!1},d(o){t(s),o&&t(_),o&&t(c),$(n),o&&t(Ts),o&&t(le),$(yo),o&&t(ws),o&&t(Pe),o&&t(Cs),o&&t(Rt),o&&t(ys),o&&t(xt),o&&t($s),o&&t(Ee),o&&t(Bs),o&&t(de),$(zo),o&&t(zs),o&&t(S),$(Ro),$(Ae),o&&t(Rs),o&&t(he),$(qo),o&&t(xs),o&&t(M),$(Mo),$(Fo),$(Po),$(Oo),$(Se),$(Ao),o&&t(qs),o&&t(me),$(Io),o&&t(Ms),o&&t(F),$(Lo),$(Qo),$(De),$(We),o&&t(Fs),o&&t(ge),$(Uo),o&&t(js),o&&t(N),$(Ho),$(Zo),$(Ue),$(He),o&&t(Ps),o&&t(be),$(Jo),o&&t(Es),o&&t(V),$(Ko),$(Yo),$(Ve),$(Ze),o&&t(Os),o&&t(Te),$(et),o&&t(As),o&&t(Z),$(ot),$(nt),$(Ke),o&&t(Is),o&&t(ye),$(st),o&&t(Ls),o&&t(J),$(rt),$(lt),$(Ye),$(eo),$(oo),$(to),$(no),o&&t(Ss),o&&t(Be),$(dt),o&&t(Ns),o&&t(K),$(ct),$(ut),$(ro),$(ao),o&&t(Ds),o&&t(Re),$(mt),o&&t(Ws),o&&t(X),$(ft),$(bt),$(lo),$(co),$(po),o&&t(Qs),o&&t(qe),$(kt),o&&t(Us),o&&t(Y),$(vt),$(wt),$(uo),$(mo),$(fo)}}}const Jc={local:"rocbert",sections:[{local:"overview",title:"Overview"},{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 Kc(B){return Bc(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sp extends wc{constructor(s){super();Cc(this,s,Kc,Zc,yc,{})}}export{sp as default,Jc as metadata};
