import{S as dp,i as pp,s as hp,e as s,k as u,w as T,t as i,M as mp,c as r,d as t,m as f,a,x as k,h as l,b as p,G as e,g as b,y as v,q as w,o as M,B as C,v as up,L as re}from"../../chunks/vendor-hf-doc-builder.js";import{T as vo}from"../../chunks/Tip-hf-doc-builder.js";import{D as $}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ae}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as se}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function fp(B){let c,y;return c=new ae({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFJvQ0JlcnRNb2RlbCUyQyUyMFJvQ0JlcnRDb25maWclMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwUm9DQmVydCUyMHdlaXdlaXNoaSUyRnJvYy1iZXJ0LWJhc2UtemglMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwUm9DQmVydENvbmZpZygpJTBBJTBBJTIzJTIwSW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMHdlaXdlaXNoaSUyRnJvYy1iZXJ0LWJhc2UtemglMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFtb2RlbCUyMCUzRCUyMFJvQ0JlcnRNb2RlbChjb25maWd1cmF0aW9uKSUwQSUwQSUyMyUyMEFjY2Vzc2luZyUyMHRoZSUyMG1vZGVsJTIwY29uZmlndXJhdGlvbiUwQWNvbmZpZ3VyYXRpb24lMjAlM0QlMjBtb2RlbC5jb25maWc=",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(){T(c.$$.fragment)},l(m){k(c.$$.fragment,m)},m(m,h){v(c,m,h),y=!0},p:re,i(m){y||(w(c.$$.fragment,m),y=!0)},o(m){M(c.$$.fragment,m),y=!1},d(m){C(c,m)}}}function gp(B){let c,y,m,h,_;return h=new ae({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",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(){c=s("p"),y=i("pair mask has the following format:"),m=u(),T(h.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"pair mask has the following format:"),d.forEach(t),m=f(n),k(h.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,m,d),v(h,n,d),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(c),n&&t(m),C(h,n)}}}function _p(B){let c,y,m,h,_;return{c(){c=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),m=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Although the recipe for forward pass needs to be defined within this function, one should call the "),m=r(d,"CODE",{});var R=a(m);h=l(R,"Module"),R.forEach(t),_=l(d,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),d.forEach(t)},m(n,d){b(n,c,d),e(c,y),e(c,m),e(m,h),e(c,_)},d(n){n&&t(c)}}}function bp(B){let c,y,m,h,_;return h=new ae({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBSb0NCZXJ0TW9kZWwlMEFpbXBvcnQlMjB0b3JjaCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMndlaXdlaXNoaSUyRnJvYy1iZXJ0LWJhc2UtemglMjIpJTBBbW9kZWwlMjAlM0QlMjBSb0NCZXJ0TW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMndlaXdlaXNoaSUyRnJvYy1iZXJ0LWJhc2UtemglMjIpJTBBJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKCUyMkhlbGxvJTJDJTIwbXklMjBkb2clMjBpcyUyMGN1dGUlMjIlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmlucHV0cyklMEElMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRl",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, RoCBertModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">round</span>(loss.item(), <span class="hljs-number">2</span>)
<span class="hljs-number">3.75</span>`}}),{c(){c=s("p"),y=i("Example:"),m=u(),T(h.$$.fragment)},l(n){c=r(n,"P",{});var d=a(c);y=l(d,"Example:"),d.forEach(t),m=f(n),k(h.$$.fragment,n)},m(n,d){b(n,c,d),e(c,y),b(n,m,d),v(h,n,d),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(c),n&&t(m),C(h,n)}}}function Up(B){let c,y,m,h,_,n,d,R,Rr,xs,ie,Fe,bn,wo,$r,yn,zr,Es,Ue,Jr,Mo,jr,Fr,Is,$t,Ur,qs,zt,Tn,xr,Ns,xe,Er,Co,Ir,qr,Ss,le,Ee,kn,Bo,Nr,vn,Sr,Ws,J,wn,Jt,Wr,Vr,Mn,jt,Ar,Zr,Cn,Ft,Xr,Pr,Bn,Ut,Lr,Gr,Rn,xt,Or,Qr,$n,Et,Dr,Vs,ce,Ie,zn,Ro,Hr,Jn,Yr,As,E,$o,Kr,de,ea,It,oa,ta,zo,na,sa,ra,pe,aa,qt,ia,la,Nt,ca,da,pa,qe,Zs,he,Ne,jn,Jo,ha,Fn,ma,Xs,j,jo,ua,K,Fo,fa,Un,ga,_a,Uo,St,ba,xn,ya,Ta,Wt,ka,En,va,wa,Se,xo,Ma,Eo,Ca,In,Ba,Ra,$a,N,Io,za,qn,Ja,ja,We,Fa,me,Ua,Nn,xa,Ea,Sn,Ia,qa,Na,Vt,qo,Ps,ue,Ve,Wn,No,Sa,Vn,Wa,Ls,F,So,Va,Wo,Aa,Vo,Za,Xa,Pa,Ao,La,Zo,Ga,Oa,Qa,z,Da,An,Ha,Ya,Zn,Ka,ei,Xn,oi,ti,Pn,ni,si,Ln,ri,ai,Gn,ii,li,ci,S,Xo,di,fe,pi,At,hi,mi,On,ui,fi,gi,Ae,_i,Ze,Gs,ge,Xe,Qn,Po,bi,Dn,yi,Os,I,Lo,Ti,Hn,ki,vi,Go,wi,Oo,Mi,Ci,Bi,W,Qo,Ri,_e,$i,Zt,zi,Ji,Yn,ji,Fi,Ui,Pe,xi,Le,Qs,be,Ge,Kn,Do,Ei,es,Ii,Ds,L,Ho,qi,ye,Ni,os,Si,Wi,Yo,Vi,Ai,Zi,V,Ko,Xi,Te,Pi,Xt,Li,Gi,ts,Oi,Qi,Di,Oe,Hi,Qe,Hs,ke,De,ns,et,Yi,ss,Ki,Ys,G,ot,el,ve,ol,rs,tl,nl,tt,sl,rl,al,ee,nt,il,we,ll,Pt,cl,dl,as,pl,hl,ml,He,Ks,Me,Ye,is,st,ul,ls,fl,er,O,rt,gl,at,_l,it,bl,yl,Tl,U,lt,kl,Ce,vl,Lt,wl,Ml,cs,Cl,Bl,Rl,Ke,$l,eo,zl,oo,or,Be,to,ds,ct,Jl,ps,jl,tr,Q,dt,Fl,pt,Ul,ht,xl,El,Il,A,mt,ql,Re,Nl,Gt,Sl,Wl,hs,Vl,Al,Zl,no,Xl,so,nr,$e,ro,ms,ut,Pl,us,Ll,sr,D,ft,Gl,gt,Ol,_t,Ql,Dl,Hl,Z,bt,Yl,ze,Kl,Ot,ec,oc,fs,tc,nc,sc,ao,rc,io,rr,Je,lo,gs,yt,ac,_s,ic,ar,H,Tt,lc,Y,cc,bs,dc,pc,ys,hc,mc,kt,uc,fc,gc,X,vt,_c,je,bc,Qt,yc,Tc,Ts,kc,vc,wc,co,Mc,po,ir;return n=new q({}),wo=new q({}),Bo=new q({}),Ro=new q({}),$o=new $({props:{name:"class transformers.RoCBertConfig",anchor:"transformers.RoCBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"classifier_dropout",val:" = None"},{name:"enable_pronunciation",val:" = True"},{name:"enable_shape",val:" = True"},{name:"pronunciation_embed_dim",val:" = 768"},{name:"pronunciation_vocab_size",val:" = 910"},{name:"shape_embed_dim",val:" = 512"},{name:"shape_vocab_size",val:" = 24858"},{name:"concat_input",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RoCBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the RoCBert model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.30.0/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.30.0/en/model_doc/roc_bert#transformers.RoCBertModel">RoCBertModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.RoCBertConfig.initializer_range",description:`<strong>initializer_range</strong> (<code>float</code>, <em>optional</em>, defaults to 0.02) &#x2014;
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.`,name:"initializer_range"},{anchor:"transformers.RoCBertConfig.layer_norm_eps",description:`<strong>layer_norm_eps</strong> (<code>float</code>, <em>optional</em>, defaults to 1e-12) &#x2014;
The epsilon used by the layer normalization layers.`,name:"layer_norm_eps"},{anchor:"transformers.RoCBertConfig.is_decoder",description:`<strong>is_decoder</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the model is used as a decoder or not. If <code>False</code>, the model is used as an encoder.`,name:"is_decoder"},{anchor:"transformers.RoCBertConfig.use_cache",description:`<strong>use_cache</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should return the last key/values attentions (not used by all models). Only
relevant if <code>config.is_decoder=True</code>.`,name:"use_cache"},{anchor:"transformers.RoCBertConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.RoCBertConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.RoCBertConfig.enable_pronunciation",description:`<strong>enable_pronunciation</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model use pronunciation embed when training.`,name:"enable_pronunciation"},{anchor:"transformers.RoCBertConfig.enable_shape",description:`<strong>enable_shape</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model use shape embed when training.`,name:"enable_shape"},{anchor:"transformers.RoCBertConfig.pronunciation_embed_dim",description:`<strong>pronunciation_embed_dim</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimension of the pronunciation_embed.`,name:"pronunciation_embed_dim"},{anchor:"transformers.RoCBertConfig.pronunciation_vocab_size",description:`<strong>pronunciation_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 910) &#x2014;
Pronunciation Vocabulary size of the RoCBert model. Defines the number of different tokens that can be
represented by the <code>input_pronunciation_ids</code> passed when calling <a href="/docs/transformers/v4.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/configuration_roc_bert.py#L28"}}),qe=new se({props:{anchor:"transformers.RoCBertConfig.example",$$slots:{default:[fp]},$$scope:{ctx:B}}}),Jo=new q({}),jo=new $({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.30.0/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.30.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L95"}}),Fo=new $({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.30.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L782",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),xo=new $({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.30.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L812",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Io=new $({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.30.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L841",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),We=new se({props:{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[gp]},$$scope:{ctx:B}}}),qo=new $({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.30.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L870"}}),No=new q({}),So=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L882"}}),Xo=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L937",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ae=new vo({props:{$$slots:{default:[_p]},$$scope:{ctx:B}}}),Ze=new se({props:{anchor:"transformers.RoCBertModel.forward.example",$$slots:{default:[bp]},$$scope:{ctx:B}}}),Po=new q({}),Lo=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1083"}}),Qo=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1103",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Pe=new vo({props:{$$slots:{default:[yp]},$$scope:{ctx:B}}}),Le=new se({props:{anchor:"transformers.RoCBertForPreTraining.forward.example",$$slots:{default:[Tp]},$$scope:{ctx:B}}}),Do=new q({}),Ho=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1409"}}),Ko=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1434",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.CausalLMOutputWithCrossAttentions"
>transformers.modeling_outputs.CausalLMOutputWithCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Oe=new vo({props:{$$slots:{default:[kp]},$$scope:{ctx:B}}}),Qe=new se({props:{anchor:"transformers.RoCBertForCausalLM.forward.example",$$slots:{default:[vp]},$$scope:{ctx:B}}}),et=new q({}),ot=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1268"}}),nt=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1296"}}),He=new vo({props:{$$slots:{default:[wp]},$$scope:{ctx:B}}}),st=new q({}),rt=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1592"}}),lt=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1609",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ke=new vo({props:{$$slots:{default:[Mp]},$$scope:{ctx:B}}}),eo=new se({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example",$$slots:{default:[Cp]},$$scope:{ctx:B}}}),oo=new se({props:{anchor:"transformers.RoCBertForSequenceClassification.forward.example-2",$$slots:{default:[Bp]},$$scope:{ctx:B}}}),ct=new q({}),dt=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1698"}}),mt=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1713",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.MultipleChoiceModelOutput"
>transformers.modeling_outputs.MultipleChoiceModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),no=new vo({props:{$$slots:{default:[Rp]},$$scope:{ctx:B}}}),so=new se({props:{anchor:"transformers.RoCBertForMultipleChoice.forward.example",$$slots:{default:[$p]},$$scope:{ctx:B}}}),ut=new q({}),ft=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1803"}}),bt=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1821",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ao=new vo({props:{$$slots:{default:[zp]},$$scope:{ctx:B}}}),io=new se({props:{anchor:"transformers.RoCBertForTokenClassification.forward.example",$$slots:{default:[Jp]},$$scope:{ctx:B}}}),yt=new q({}),Tt=new $({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.30.0/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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1891"}}),vt=new $({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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.30.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.30.0/en/model_doc/speecht5#transformers.SpeechT5Tokenizer.__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.30.0/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.30.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1905",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.30.0/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.30.0/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.30.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),co=new vo({props:{$$slots:{default:[jp]},$$scope:{ctx:B}}}),po=new se({props:{anchor:"transformers.RoCBertForQuestionAnswering.forward.example",$$slots:{default:[Fp]},$$scope:{ctx:B}}}),{c(){c=s("meta"),y=u(),m=s("h1"),h=s("a"),_=s("span"),T(n.$$.fragment),d=u(),R=s("span"),Rr=i("RoCBert"),xs=u(),ie=s("h2"),Fe=s("a"),bn=s("span"),T(wo.$$.fragment),$r=u(),yn=s("span"),zr=i("Overview"),Es=u(),Ue=s("p"),Jr=i("The RoCBert model was proposed in "),Mo=s("a"),jr=i("RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining"),Fr=i(`  by HuiSu, WeiweiShi, XiaoyuShen, XiaoZhou, TuoJi, JiaruiFang, JieZhou.
It\u2019s a pretrained Chinese language model that is robust under various forms of adversarial attacks.`),Is=u(),$t=s("p"),Ur=i("The abstract from the paper is the following:"),qs=u(),zt=s("p"),Tn=s("em"),xr=i(`Large-scale pretrained language models have achieved SOTA results on NLP tasks. However, they have been shown
vulnerable to adversarial attacks especially for logographic languages like Chinese. In this work, we propose
ROCBERT: a pretrained Chinese Bert that is robust to various forms of adversarial attacks like word perturbation,
synonyms, typos, etc. It is pretrained with the contrastive learning objective which maximizes the label consistency
under different synthesized adversarial examples. The model takes as input multimodal information including the
semantic, phonetic and visual features. We show all these features are important to the model robustness since the
attack can be performed in all the three forms. Across 5 Chinese NLU tasks, ROCBERT outperforms strong baselines under
three blackbox adversarial algorithms without sacrificing the performance on clean testset. It also performs the best
in the toxic content detection task under human-made attacks.`),Ns=u(),xe=s("p"),Er=i("This model was contributed by "),Co=s("a"),Ir=i("weiweishi"),qr=i("."),Ss=u(),le=s("h2"),Ee=s("a"),kn=s("span"),T(Bo.$$.fragment),Nr=u(),vn=s("span"),Sr=i("Documentation resources"),Ws=u(),J=s("ul"),wn=s("li"),Jt=s("a"),Wr=i("Text classification task guide"),Vr=u(),Mn=s("li"),jt=s("a"),Ar=i("Token classification task guide"),Zr=u(),Cn=s("li"),Ft=s("a"),Xr=i("Question answering task guide"),Pr=u(),Bn=s("li"),Ut=s("a"),Lr=i("Causal language modeling task guide"),Gr=u(),Rn=s("li"),xt=s("a"),Or=i("Masked language modeling task guide"),Qr=u(),$n=s("li"),Et=s("a"),Dr=i("Multiple choice task guide"),Vs=u(),ce=s("h2"),Ie=s("a"),zn=s("span"),T(Ro.$$.fragment),Hr=u(),Jn=s("span"),Yr=i("RoCBertConfig"),As=u(),E=s("div"),T($o.$$.fragment),Kr=u(),de=s("p"),ea=i("This is the configuration class to store the configuration of a "),It=s("a"),oa=i("RoCBertModel"),ta=i(`. It is used to instantiate a
RoCBert model according to the specified arguments, defining the model architecture. Instantiating a configuration
with the defaults will yield a similar configuration to that of the RoCBert
`),zo=s("a"),na=i("weiweishi/roc-bert-base-zh"),sa=i(" architecture."),ra=u(),pe=s("p"),aa=i("Configuration objects inherit from "),qt=s("a"),ia=i("PretrainedConfig"),la=i(` and can be used to control the model outputs. Read the
documentation from `),Nt=s("a"),ca=i("PretrainedConfig"),da=i(" for more information."),pa=u(),T(qe.$$.fragment),Zs=u(),he=s("h2"),Ne=s("a"),jn=s("span"),T(Jo.$$.fragment),ha=u(),Fn=s("span"),ma=i("RoCBertTokenizer"),Xs=u(),j=s("div"),T(jo.$$.fragment),ua=u(),K=s("div"),T(Fo.$$.fragment),fa=u(),Un=s("p"),ga=i(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A BERT sequence has the following format:`),_a=u(),Uo=s("ul"),St=s("li"),ba=i("single sequence: "),xn=s("code"),ya=i("[CLS] X [SEP]"),Ta=u(),Wt=s("li"),ka=i("pair of sequences: "),En=s("code"),va=i("[CLS] A [SEP] B [SEP]"),wa=u(),Se=s("div"),T(xo.$$.fragment),Ma=u(),Eo=s("p"),Ca=i(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),In=s("code"),Ba=i("prepare_for_model"),Ra=i(" method."),$a=u(),N=s("div"),T(Io.$$.fragment),za=u(),qn=s("p"),Ja=i("Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),ja=u(),T(We.$$.fragment),Fa=u(),me=s("p"),Ua=i("If "),Nn=s("code"),xa=i("token_ids_1"),Ea=i(" is "),Sn=s("code"),Ia=i("None"),qa=i(", this method only returns the first portion of the mask (0s)."),Na=u(),Vt=s("div"),T(qo.$$.fragment),Ps=u(),ue=s("h2"),Ve=s("a"),Wn=s("span"),T(No.$$.fragment),Sa=u(),Vn=s("span"),Wa=i("RoCBertModel"),Ls=u(),F=s("div"),T(So.$$.fragment),Va=u(),Wo=s("p"),Aa=i(`The bare RoCBert Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Vo=s("a"),Za=i("torch.nn.Module"),Xa=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Pa=u(),Ao=s("p"),La=i(`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Zo=s("a"),Ga=i(`Attention is
all you need`),Oa=i(` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),Qa=u(),z=s("p"),Da=i("To behave as an decoder the model needs to be initialized with the "),An=s("code"),Ha=i("is_decoder"),Ya=i(` argument of the configuration set
to `),Zn=s("code"),Ka=i("True"),ei=i(". To be used in a Seq2Seq model, the model needs to be initialized with both "),Xn=s("code"),oi=i("is_decoder"),ti=i(` argument and
`),Pn=s("code"),ni=i("add_cross_attention"),si=i(" set to "),Ln=s("code"),ri=i("True"),ai=i("; an "),Gn=s("code"),ii=i("encoder_hidden_states"),li=i(" is then expected as an input to the forward pass."),ci=u(),S=s("div"),T(Xo.$$.fragment),di=u(),fe=s("p"),pi=i("The "),At=s("a"),hi=i("RoCBertModel"),mi=i(" forward method, overrides the "),On=s("code"),ui=i("__call__"),fi=i(" special method."),gi=u(),T(Ae.$$.fragment),_i=u(),T(Ze.$$.fragment),Gs=u(),ge=s("h2"),Xe=s("a"),Qn=s("span"),T(Po.$$.fragment),bi=u(),Dn=s("span"),yi=i("RoCBertForPreTraining"),Os=u(),I=s("div"),T(Lo.$$.fragment),Ti=u(),Hn=s("p"),ki=i("RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),vi=u(),Go=s("p"),wi=i("This model is a PyTorch "),Oo=s("a"),Mi=i("torch.nn.Module"),Ci=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Bi=u(),W=s("div"),T(Qo.$$.fragment),Ri=u(),_e=s("p"),$i=i("The "),Zt=s("a"),zi=i("RoCBertForPreTraining"),Ji=i(" forward method, overrides the "),Yn=s("code"),ji=i("__call__"),Fi=i(" special method."),Ui=u(),T(Pe.$$.fragment),xi=u(),T(Le.$$.fragment),Qs=u(),be=s("h2"),Ge=s("a"),Kn=s("span"),T(Do.$$.fragment),Ei=u(),es=s("span"),Ii=i("RoCBertForCausalLM"),Ds=u(),L=s("div"),T(Ho.$$.fragment),qi=u(),ye=s("p"),Ni=i("RoCBert Model with a "),os=s("code"),Si=i("language modeling"),Wi=i(` head on top for CLM fine-tuning.
This model is a PyTorch `),Yo=s("a"),Vi=i("torch.nn.Module"),Ai=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Zi=u(),V=s("div"),T(Ko.$$.fragment),Xi=u(),Te=s("p"),Pi=i("The "),Xt=s("a"),Li=i("RoCBertForCausalLM"),Gi=i(" forward method, overrides the "),ts=s("code"),Oi=i("__call__"),Qi=i(" special method."),Di=u(),T(Oe.$$.fragment),Hi=u(),T(Qe.$$.fragment),Hs=u(),ke=s("h2"),De=s("a"),ns=s("span"),T(et.$$.fragment),Yi=u(),ss=s("span"),Ki=i("RoCBertForMaskedLM"),Ys=u(),G=s("div"),T(ot.$$.fragment),el=u(),ve=s("p"),ol=i("RoCBert Model with a "),rs=s("code"),tl=i("language modeling"),nl=i(` head on top.
This model is a PyTorch `),tt=s("a"),sl=i("torch.nn.Module"),rl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),al=u(),ee=s("div"),T(nt.$$.fragment),il=u(),we=s("p"),ll=i("The "),Pt=s("a"),cl=i("RoCBertForMaskedLM"),dl=i(" forward method, overrides the "),as=s("code"),pl=i("__call__"),hl=i(" special method."),ml=u(),T(He.$$.fragment),Ks=u(),Me=s("h2"),Ye=s("a"),is=s("span"),T(st.$$.fragment),ul=u(),ls=s("span"),fl=i("RoCBertForSequenceClassification"),er=u(),O=s("div"),T(rt.$$.fragment),gl=u(),at=s("p"),_l=i(`RoCBert Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),it=s("a"),bl=i("torch.nn.Module"),yl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tl=u(),U=s("div"),T(lt.$$.fragment),kl=u(),Ce=s("p"),vl=i("The "),Lt=s("a"),wl=i("RoCBertForSequenceClassification"),Ml=i(" forward method, overrides the "),cs=s("code"),Cl=i("__call__"),Bl=i(" special method."),Rl=u(),T(Ke.$$.fragment),$l=u(),T(eo.$$.fragment),zl=u(),T(oo.$$.fragment),or=u(),Be=s("h2"),to=s("a"),ds=s("span"),T(ct.$$.fragment),Jl=u(),ps=s("span"),jl=i("RoCBertForMultipleChoice"),tr=u(),Q=s("div"),T(dt.$$.fragment),Fl=u(),pt=s("p"),Ul=i(`RoCBert Model with a multiple choice classification head on top (a linear layer on top of
the pooled output and a softmax) e.g. for RocStories/SWAG tasks.
This model is a PyTorch `),ht=s("a"),xl=i("torch.nn.Module"),El=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Il=u(),A=s("div"),T(mt.$$.fragment),ql=u(),Re=s("p"),Nl=i("The "),Gt=s("a"),Sl=i("RoCBertForMultipleChoice"),Wl=i(" forward method, overrides the "),hs=s("code"),Vl=i("__call__"),Al=i(" special method."),Zl=u(),T(no.$$.fragment),Xl=u(),T(so.$$.fragment),nr=u(),$e=s("h2"),ro=s("a"),ms=s("span"),T(ut.$$.fragment),Pl=u(),us=s("span"),Ll=i("RoCBertForTokenClassification"),sr=u(),D=s("div"),T(ft.$$.fragment),Gl=u(),gt=s("p"),Ol=i(`RoCBert Model with a token classification head on top (a linear layer on top of
the hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks.
This model is a PyTorch `),_t=s("a"),Ql=i("torch.nn.Module"),Dl=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Hl=u(),Z=s("div"),T(bt.$$.fragment),Yl=u(),ze=s("p"),Kl=i("The "),Ot=s("a"),ec=i("RoCBertForTokenClassification"),oc=i(" forward method, overrides the "),fs=s("code"),tc=i("__call__"),nc=i(" special method."),sc=u(),T(ao.$$.fragment),rc=u(),T(io.$$.fragment),rr=u(),Je=s("h2"),lo=s("a"),gs=s("span"),T(yt.$$.fragment),ac=u(),_s=s("span"),ic=i("RoCBertForQuestionAnswering"),ar=u(),H=s("div"),T(Tt.$$.fragment),lc=u(),Y=s("p"),cc=i(`RoCBert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),bs=s("code"),dc=i("span start logits"),pc=i(" and "),ys=s("code"),hc=i("span end logits"),mc=i(`).
This model is a PyTorch `),kt=s("a"),uc=i("torch.nn.Module"),fc=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gc=u(),X=s("div"),T(vt.$$.fragment),_c=u(),je=s("p"),bc=i("The "),Qt=s("a"),yc=i("RoCBertForQuestionAnswering"),Tc=i(" forward method, overrides the "),Ts=s("code"),kc=i("__call__"),vc=i(" special method."),wc=u(),T(co.$$.fragment),Mc=u(),T(po.$$.fragment),this.h()},l(o){const g=mp('[data-svelte="svelte-1phssyn"]',document.head);c=r(g,"META",{name:!0,content:!0}),g.forEach(t),y=f(o),m=r(o,"H1",{class:!0});var wt=a(m);h=r(wt,"A",{id:!0,class:!0,href:!0});var ks=a(h);_=r(ks,"SPAN",{});var vs=a(_);k(n.$$.fragment,vs),vs.forEach(t),ks.forEach(t),d=f(wt),R=r(wt,"SPAN",{});var ws=a(R);Rr=l(ws,"RoCBert"),ws.forEach(t),wt.forEach(t),xs=f(o),ie=r(o,"H2",{class:!0});var Mt=a(ie);Fe=r(Mt,"A",{id:!0,class:!0,href:!0});var Ms=a(Fe);bn=r(Ms,"SPAN",{});var Cs=a(bn);k(wo.$$.fragment,Cs),Cs.forEach(t),Ms.forEach(t),$r=f(Mt),yn=r(Mt,"SPAN",{});var Bs=a(yn);zr=l(Bs,"Overview"),Bs.forEach(t),Mt.forEach(t),Es=f(o),Ue=r(o,"P",{});var Ct=a(Ue);Jr=l(Ct,"The RoCBert model was proposed in "),Mo=r(Ct,"A",{href:!0,rel:!0});var Rs=a(Mo);jr=l(Rs,"RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining"),Rs.forEach(t),Fr=l(Ct,`  by HuiSu, WeiweiShi, XiaoyuShen, XiaoZhou, TuoJi, JiaruiFang, JieZhou.
It\u2019s a pretrained Chinese language model that is robust under various forms of adversarial attacks.`),Ct.forEach(t),Is=f(o),$t=r(o,"P",{});var $s=a($t);Ur=l($s,"The abstract from the paper is the following:"),$s.forEach(t),qs=f(o),zt=r(o,"P",{});var zs=a(zt);Tn=r(zs,"EM",{});var Js=a(Tn);xr=l(Js,`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.`),Js.forEach(t),zs.forEach(t),Ns=f(o),xe=r(o,"P",{});var Bt=a(xe);Er=l(Bt,"This model was contributed by "),Co=r(Bt,"A",{href:!0,rel:!0});var js=a(Co);Ir=l(js,"weiweishi"),js.forEach(t),qr=l(Bt,"."),Bt.forEach(t),Ss=f(o),le=r(o,"H2",{class:!0});var Rt=a(le);Ee=r(Rt,"A",{id:!0,class:!0,href:!0});var Fs=a(Ee);kn=r(Fs,"SPAN",{});var Us=a(kn);k(Bo.$$.fragment,Us),Us.forEach(t),Fs.forEach(t),Nr=f(Rt),vn=r(Rt,"SPAN",{});var Rc=a(vn);Sr=l(Rc,"Documentation resources"),Rc.forEach(t),Rt.forEach(t),Ws=f(o),J=r(o,"UL",{});var P=a(J);wn=r(P,"LI",{});var $c=a(wn);Jt=r($c,"A",{href:!0});var zc=a(Jt);Wr=l(zc,"Text classification task guide"),zc.forEach(t),$c.forEach(t),Vr=f(P),Mn=r(P,"LI",{});var Jc=a(Mn);jt=r(Jc,"A",{href:!0});var jc=a(jt);Ar=l(jc,"Token classification task guide"),jc.forEach(t),Jc.forEach(t),Zr=f(P),Cn=r(P,"LI",{});var Fc=a(Cn);Ft=r(Fc,"A",{href:!0});var Uc=a(Ft);Xr=l(Uc,"Question answering task guide"),Uc.forEach(t),Fc.forEach(t),Pr=f(P),Bn=r(P,"LI",{});var xc=a(Bn);Ut=r(xc,"A",{href:!0});var Ec=a(Ut);Lr=l(Ec,"Causal language modeling task guide"),Ec.forEach(t),xc.forEach(t),Gr=f(P),Rn=r(P,"LI",{});var Ic=a(Rn);xt=r(Ic,"A",{href:!0});var qc=a(xt);Or=l(qc,"Masked language modeling task guide"),qc.forEach(t),Ic.forEach(t),Qr=f(P),$n=r(P,"LI",{});var Nc=a($n);Et=r(Nc,"A",{href:!0});var Sc=a(Et);Dr=l(Sc,"Multiple choice task guide"),Sc.forEach(t),Nc.forEach(t),P.forEach(t),Vs=f(o),ce=r(o,"H2",{class:!0});var lr=a(ce);Ie=r(lr,"A",{id:!0,class:!0,href:!0});var Wc=a(Ie);zn=r(Wc,"SPAN",{});var Vc=a(zn);k(Ro.$$.fragment,Vc),Vc.forEach(t),Wc.forEach(t),Hr=f(lr),Jn=r(lr,"SPAN",{});var Ac=a(Jn);Yr=l(Ac,"RoCBertConfig"),Ac.forEach(t),lr.forEach(t),As=f(o),E=r(o,"DIV",{class:!0});var ho=a(E);k($o.$$.fragment,ho),Kr=f(ho),de=r(ho,"P",{});var Dt=a(de);ea=l(Dt,"This is the configuration class to store the configuration of a "),It=r(Dt,"A",{href:!0});var Zc=a(It);oa=l(Zc,"RoCBertModel"),Zc.forEach(t),ta=l(Dt,`. 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
`),zo=r(Dt,"A",{href:!0,rel:!0});var Xc=a(zo);na=l(Xc,"weiweishi/roc-bert-base-zh"),Xc.forEach(t),sa=l(Dt," architecture."),Dt.forEach(t),ra=f(ho),pe=r(ho,"P",{});var Ht=a(pe);aa=l(Ht,"Configuration objects inherit from "),qt=r(Ht,"A",{href:!0});var Pc=a(qt);ia=l(Pc,"PretrainedConfig"),Pc.forEach(t),la=l(Ht,` and can be used to control the model outputs. Read the
documentation from `),Nt=r(Ht,"A",{href:!0});var Lc=a(Nt);ca=l(Lc,"PretrainedConfig"),Lc.forEach(t),da=l(Ht," for more information."),Ht.forEach(t),pa=f(ho),k(qe.$$.fragment,ho),ho.forEach(t),Zs=f(o),he=r(o,"H2",{class:!0});var cr=a(he);Ne=r(cr,"A",{id:!0,class:!0,href:!0});var Gc=a(Ne);jn=r(Gc,"SPAN",{});var Oc=a(jn);k(Jo.$$.fragment,Oc),Oc.forEach(t),Gc.forEach(t),ha=f(cr),Fn=r(cr,"SPAN",{});var Qc=a(Fn);ma=l(Qc,"RoCBertTokenizer"),Qc.forEach(t),cr.forEach(t),Xs=f(o),j=r(o,"DIV",{class:!0});var oe=a(j);k(jo.$$.fragment,oe),ua=f(oe),K=r(oe,"DIV",{class:!0});var Yt=a(K);k(Fo.$$.fragment,Yt),fa=f(Yt),Un=r(Yt,"P",{});var Dc=a(Un);ga=l(Dc,`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:`),Dc.forEach(t),_a=f(Yt),Uo=r(Yt,"UL",{});var dr=a(Uo);St=r(dr,"LI",{});var Cc=a(St);ba=l(Cc,"single sequence: "),xn=r(Cc,"CODE",{});var Hc=a(xn);ya=l(Hc,"[CLS] X [SEP]"),Hc.forEach(t),Cc.forEach(t),Ta=f(dr),Wt=r(dr,"LI",{});var Bc=a(Wt);ka=l(Bc,"pair of sequences: "),En=r(Bc,"CODE",{});var Yc=a(En);va=l(Yc,"[CLS] A [SEP] B [SEP]"),Yc.forEach(t),Bc.forEach(t),dr.forEach(t),Yt.forEach(t),wa=f(oe),Se=r(oe,"DIV",{class:!0});var pr=a(Se);k(xo.$$.fragment,pr),Ma=f(pr),Eo=r(pr,"P",{});var hr=a(Eo);Ca=l(hr,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),In=r(hr,"CODE",{});var Kc=a(In);Ba=l(Kc,"prepare_for_model"),Kc.forEach(t),Ra=l(hr," method."),hr.forEach(t),pr.forEach(t),$a=f(oe),N=r(oe,"DIV",{class:!0});var mo=a(N);k(Io.$$.fragment,mo),za=f(mo),qn=r(mo,"P",{});var ed=a(qn);Ja=l(ed,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),ed.forEach(t),ja=f(mo),k(We.$$.fragment,mo),Fa=f(mo),me=r(mo,"P",{});var Kt=a(me);Ua=l(Kt,"If "),Nn=r(Kt,"CODE",{});var od=a(Nn);xa=l(od,"token_ids_1"),od.forEach(t),Ea=l(Kt," is "),Sn=r(Kt,"CODE",{});var td=a(Sn);Ia=l(td,"None"),td.forEach(t),qa=l(Kt,", this method only returns the first portion of the mask (0s)."),Kt.forEach(t),mo.forEach(t),Na=f(oe),Vt=r(oe,"DIV",{class:!0});var nd=a(Vt);k(qo.$$.fragment,nd),nd.forEach(t),oe.forEach(t),Ps=f(o),ue=r(o,"H2",{class:!0});var mr=a(ue);Ve=r(mr,"A",{id:!0,class:!0,href:!0});var sd=a(Ve);Wn=r(sd,"SPAN",{});var rd=a(Wn);k(No.$$.fragment,rd),rd.forEach(t),sd.forEach(t),Sa=f(mr),Vn=r(mr,"SPAN",{});var ad=a(Vn);Wa=l(ad,"RoCBertModel"),ad.forEach(t),mr.forEach(t),Ls=f(o),F=r(o,"DIV",{class:!0});var te=a(F);k(So.$$.fragment,te),Va=f(te),Wo=r(te,"P",{});var ur=a(Wo);Aa=l(ur,`The bare RoCBert Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Vo=r(ur,"A",{href:!0,rel:!0});var id=a(Vo);Za=l(id,"torch.nn.Module"),id.forEach(t),Xa=l(ur,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ur.forEach(t),Pa=f(te),Ao=r(te,"P",{});var fr=a(Ao);La=l(fr,`The model can behave as an encoder (with only self-attention) as well as a decoder, in which case a layer of
cross-attention is added between the self-attention layers, following the architecture described in `),Zo=r(fr,"A",{href:!0,rel:!0});var ld=a(Zo);Ga=l(ld,`Attention is
all you need`),ld.forEach(t),Oa=l(fr,` by Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit,
Llion Jones, Aidan N. Gomez, Lukasz Kaiser and Illia Polosukhin.`),fr.forEach(t),Qa=f(te),z=r(te,"P",{});var x=a(z);Da=l(x,"To behave as an decoder the model needs to be initialized with the "),An=r(x,"CODE",{});var cd=a(An);Ha=l(cd,"is_decoder"),cd.forEach(t),Ya=l(x,` argument of the configuration set
to `),Zn=r(x,"CODE",{});var dd=a(Zn);Ka=l(dd,"True"),dd.forEach(t),ei=l(x,". To be used in a Seq2Seq model, the model needs to be initialized with both "),Xn=r(x,"CODE",{});var pd=a(Xn);oi=l(pd,"is_decoder"),pd.forEach(t),ti=l(x,` argument and
`),Pn=r(x,"CODE",{});var hd=a(Pn);ni=l(hd,"add_cross_attention"),hd.forEach(t),si=l(x," set to "),Ln=r(x,"CODE",{});var md=a(Ln);ri=l(md,"True"),md.forEach(t),ai=l(x,"; an "),Gn=r(x,"CODE",{});var ud=a(Gn);ii=l(ud,"encoder_hidden_states"),ud.forEach(t),li=l(x," is then expected as an input to the forward pass."),x.forEach(t),ci=f(te),S=r(te,"DIV",{class:!0});var uo=a(S);k(Xo.$$.fragment,uo),di=f(uo),fe=r(uo,"P",{});var en=a(fe);pi=l(en,"The "),At=r(en,"A",{href:!0});var fd=a(At);hi=l(fd,"RoCBertModel"),fd.forEach(t),mi=l(en," forward method, overrides the "),On=r(en,"CODE",{});var gd=a(On);ui=l(gd,"__call__"),gd.forEach(t),fi=l(en," special method."),en.forEach(t),gi=f(uo),k(Ae.$$.fragment,uo),_i=f(uo),k(Ze.$$.fragment,uo),uo.forEach(t),te.forEach(t),Gs=f(o),ge=r(o,"H2",{class:!0});var gr=a(ge);Xe=r(gr,"A",{id:!0,class:!0,href:!0});var _d=a(Xe);Qn=r(_d,"SPAN",{});var bd=a(Qn);k(Po.$$.fragment,bd),bd.forEach(t),_d.forEach(t),bi=f(gr),Dn=r(gr,"SPAN",{});var yd=a(Dn);yi=l(yd,"RoCBertForPreTraining"),yd.forEach(t),gr.forEach(t),Os=f(o),I=r(o,"DIV",{class:!0});var fo=a(I);k(Lo.$$.fragment,fo),Ti=f(fo),Hn=r(fo,"P",{});var Td=a(Hn);ki=l(Td,"RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),Td.forEach(t),vi=f(fo),Go=r(fo,"P",{});var _r=a(Go);wi=l(_r,"This model is a PyTorch "),Oo=r(_r,"A",{href:!0,rel:!0});var kd=a(Oo);Mi=l(kd,"torch.nn.Module"),kd.forEach(t),Ci=l(_r,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),_r.forEach(t),Bi=f(fo),W=r(fo,"DIV",{class:!0});var go=a(W);k(Qo.$$.fragment,go),Ri=f(go),_e=r(go,"P",{});var on=a(_e);$i=l(on,"The "),Zt=r(on,"A",{href:!0});var vd=a(Zt);zi=l(vd,"RoCBertForPreTraining"),vd.forEach(t),Ji=l(on," forward method, overrides the "),Yn=r(on,"CODE",{});var wd=a(Yn);ji=l(wd,"__call__"),wd.forEach(t),Fi=l(on," special method."),on.forEach(t),Ui=f(go),k(Pe.$$.fragment,go),xi=f(go),k(Le.$$.fragment,go),go.forEach(t),fo.forEach(t),Qs=f(o),be=r(o,"H2",{class:!0});var br=a(be);Ge=r(br,"A",{id:!0,class:!0,href:!0});var Md=a(Ge);Kn=r(Md,"SPAN",{});var Cd=a(Kn);k(Do.$$.fragment,Cd),Cd.forEach(t),Md.forEach(t),Ei=f(br),es=r(br,"SPAN",{});var Bd=a(es);Ii=l(Bd,"RoCBertForCausalLM"),Bd.forEach(t),br.forEach(t),Ds=f(o),L=r(o,"DIV",{class:!0});var tn=a(L);k(Ho.$$.fragment,tn),qi=f(tn),ye=r(tn,"P",{});var nn=a(ye);Ni=l(nn,"RoCBert Model with a "),os=r(nn,"CODE",{});var Rd=a(os);Si=l(Rd,"language modeling"),Rd.forEach(t),Wi=l(nn,` head on top for CLM fine-tuning.
This model is a PyTorch `),Yo=r(nn,"A",{href:!0,rel:!0});var $d=a(Yo);Vi=l($d,"torch.nn.Module"),$d.forEach(t),Ai=l(nn,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),nn.forEach(t),Zi=f(tn),V=r(tn,"DIV",{class:!0});var _o=a(V);k(Ko.$$.fragment,_o),Xi=f(_o),Te=r(_o,"P",{});var sn=a(Te);Pi=l(sn,"The "),Xt=r(sn,"A",{href:!0});var zd=a(Xt);Li=l(zd,"RoCBertForCausalLM"),zd.forEach(t),Gi=l(sn," forward method, overrides the "),ts=r(sn,"CODE",{});var Jd=a(ts);Oi=l(Jd,"__call__"),Jd.forEach(t),Qi=l(sn," special method."),sn.forEach(t),Di=f(_o),k(Oe.$$.fragment,_o),Hi=f(_o),k(Qe.$$.fragment,_o),_o.forEach(t),tn.forEach(t),Hs=f(o),ke=r(o,"H2",{class:!0});var yr=a(ke);De=r(yr,"A",{id:!0,class:!0,href:!0});var jd=a(De);ns=r(jd,"SPAN",{});var Fd=a(ns);k(et.$$.fragment,Fd),Fd.forEach(t),jd.forEach(t),Yi=f(yr),ss=r(yr,"SPAN",{});var Ud=a(ss);Ki=l(Ud,"RoCBertForMaskedLM"),Ud.forEach(t),yr.forEach(t),Ys=f(o),G=r(o,"DIV",{class:!0});var rn=a(G);k(ot.$$.fragment,rn),el=f(rn),ve=r(rn,"P",{});var an=a(ve);ol=l(an,"RoCBert Model with a "),rs=r(an,"CODE",{});var xd=a(rs);tl=l(xd,"language modeling"),xd.forEach(t),nl=l(an,` head on top.
This model is a PyTorch `),tt=r(an,"A",{href:!0,rel:!0});var Ed=a(tt);sl=l(Ed,"torch.nn.Module"),Ed.forEach(t),rl=l(an,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),an.forEach(t),al=f(rn),ee=r(rn,"DIV",{class:!0});var ln=a(ee);k(nt.$$.fragment,ln),il=f(ln),we=r(ln,"P",{});var cn=a(we);ll=l(cn,"The "),Pt=r(cn,"A",{href:!0});var Id=a(Pt);cl=l(Id,"RoCBertForMaskedLM"),Id.forEach(t),dl=l(cn," forward method, overrides the "),as=r(cn,"CODE",{});var qd=a(as);pl=l(qd,"__call__"),qd.forEach(t),hl=l(cn," special method."),cn.forEach(t),ml=f(ln),k(He.$$.fragment,ln),ln.forEach(t),rn.forEach(t),Ks=f(o),Me=r(o,"H2",{class:!0});var Tr=a(Me);Ye=r(Tr,"A",{id:!0,class:!0,href:!0});var Nd=a(Ye);is=r(Nd,"SPAN",{});var Sd=a(is);k(st.$$.fragment,Sd),Sd.forEach(t),Nd.forEach(t),ul=f(Tr),ls=r(Tr,"SPAN",{});var Wd=a(ls);fl=l(Wd,"RoCBertForSequenceClassification"),Wd.forEach(t),Tr.forEach(t),er=f(o),O=r(o,"DIV",{class:!0});var dn=a(O);k(rt.$$.fragment,dn),gl=f(dn),at=r(dn,"P",{});var kr=a(at);_l=l(kr,`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(kr,"A",{href:!0,rel:!0});var Vd=a(it);bl=l(Vd,"torch.nn.Module"),Vd.forEach(t),yl=l(kr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),kr.forEach(t),Tl=f(dn),U=r(dn,"DIV",{class:!0});var ne=a(U);k(lt.$$.fragment,ne),kl=f(ne),Ce=r(ne,"P",{});var pn=a(Ce);vl=l(pn,"The "),Lt=r(pn,"A",{href:!0});var Ad=a(Lt);wl=l(Ad,"RoCBertForSequenceClassification"),Ad.forEach(t),Ml=l(pn," forward method, overrides the "),cs=r(pn,"CODE",{});var Zd=a(cs);Cl=l(Zd,"__call__"),Zd.forEach(t),Bl=l(pn," special method."),pn.forEach(t),Rl=f(ne),k(Ke.$$.fragment,ne),$l=f(ne),k(eo.$$.fragment,ne),zl=f(ne),k(oo.$$.fragment,ne),ne.forEach(t),dn.forEach(t),or=f(o),Be=r(o,"H2",{class:!0});var vr=a(Be);to=r(vr,"A",{id:!0,class:!0,href:!0});var Xd=a(to);ds=r(Xd,"SPAN",{});var Pd=a(ds);k(ct.$$.fragment,Pd),Pd.forEach(t),Xd.forEach(t),Jl=f(vr),ps=r(vr,"SPAN",{});var Ld=a(ps);jl=l(Ld,"RoCBertForMultipleChoice"),Ld.forEach(t),vr.forEach(t),tr=f(o),Q=r(o,"DIV",{class:!0});var hn=a(Q);k(dt.$$.fragment,hn),Fl=f(hn),pt=r(hn,"P",{});var wr=a(pt);Ul=l(wr,`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(wr,"A",{href:!0,rel:!0});var Gd=a(ht);xl=l(Gd,"torch.nn.Module"),Gd.forEach(t),El=l(wr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),wr.forEach(t),Il=f(hn),A=r(hn,"DIV",{class:!0});var bo=a(A);k(mt.$$.fragment,bo),ql=f(bo),Re=r(bo,"P",{});var mn=a(Re);Nl=l(mn,"The "),Gt=r(mn,"A",{href:!0});var Od=a(Gt);Sl=l(Od,"RoCBertForMultipleChoice"),Od.forEach(t),Wl=l(mn," forward method, overrides the "),hs=r(mn,"CODE",{});var Qd=a(hs);Vl=l(Qd,"__call__"),Qd.forEach(t),Al=l(mn," special method."),mn.forEach(t),Zl=f(bo),k(no.$$.fragment,bo),Xl=f(bo),k(so.$$.fragment,bo),bo.forEach(t),hn.forEach(t),nr=f(o),$e=r(o,"H2",{class:!0});var Mr=a($e);ro=r(Mr,"A",{id:!0,class:!0,href:!0});var Dd=a(ro);ms=r(Dd,"SPAN",{});var Hd=a(ms);k(ut.$$.fragment,Hd),Hd.forEach(t),Dd.forEach(t),Pl=f(Mr),us=r(Mr,"SPAN",{});var Yd=a(us);Ll=l(Yd,"RoCBertForTokenClassification"),Yd.forEach(t),Mr.forEach(t),sr=f(o),D=r(o,"DIV",{class:!0});var un=a(D);k(ft.$$.fragment,un),Gl=f(un),gt=r(un,"P",{});var Cr=a(gt);Ol=l(Cr,`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(Cr,"A",{href:!0,rel:!0});var Kd=a(_t);Ql=l(Kd,"torch.nn.Module"),Kd.forEach(t),Dl=l(Cr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Cr.forEach(t),Hl=f(un),Z=r(un,"DIV",{class:!0});var yo=a(Z);k(bt.$$.fragment,yo),Yl=f(yo),ze=r(yo,"P",{});var fn=a(ze);Kl=l(fn,"The "),Ot=r(fn,"A",{href:!0});var ep=a(Ot);ec=l(ep,"RoCBertForTokenClassification"),ep.forEach(t),oc=l(fn," forward method, overrides the "),fs=r(fn,"CODE",{});var op=a(fs);tc=l(op,"__call__"),op.forEach(t),nc=l(fn," special method."),fn.forEach(t),sc=f(yo),k(ao.$$.fragment,yo),rc=f(yo),k(io.$$.fragment,yo),yo.forEach(t),un.forEach(t),rr=f(o),Je=r(o,"H2",{class:!0});var Br=a(Je);lo=r(Br,"A",{id:!0,class:!0,href:!0});var tp=a(lo);gs=r(tp,"SPAN",{});var np=a(gs);k(yt.$$.fragment,np),np.forEach(t),tp.forEach(t),ac=f(Br),_s=r(Br,"SPAN",{});var sp=a(_s);ic=l(sp,"RoCBertForQuestionAnswering"),sp.forEach(t),Br.forEach(t),ar=f(o),H=r(o,"DIV",{class:!0});var gn=a(H);k(Tt.$$.fragment,gn),lc=f(gn),Y=r(gn,"P",{});var To=a(Y);cc=l(To,`RoCBert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),bs=r(To,"CODE",{});var rp=a(bs);dc=l(rp,"span start logits"),rp.forEach(t),pc=l(To," and "),ys=r(To,"CODE",{});var ap=a(ys);hc=l(ap,"span end logits"),ap.forEach(t),mc=l(To,`).
This model is a PyTorch `),kt=r(To,"A",{href:!0,rel:!0});var ip=a(kt);uc=l(ip,"torch.nn.Module"),ip.forEach(t),fc=l(To,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),To.forEach(t),gc=f(gn),X=r(gn,"DIV",{class:!0});var ko=a(X);k(vt.$$.fragment,ko),_c=f(ko),je=r(ko,"P",{});var _n=a(je);bc=l(_n,"The "),Qt=r(_n,"A",{href:!0});var lp=a(Qt);yc=l(lp,"RoCBertForQuestionAnswering"),lp.forEach(t),Tc=l(_n," forward method, overrides the "),Ts=r(_n,"CODE",{});var cp=a(Ts);kc=l(cp,"__call__"),cp.forEach(t),vc=l(_n," special method."),_n.forEach(t),wc=f(ko),k(co.$$.fragment,ko),Mc=f(ko),k(po.$$.fragment,ko),ko.forEach(t),gn.forEach(t),this.h()},h(){p(c,"name","hf:doc:metadata"),p(c,"content",JSON.stringify(xp)),p(h,"id","rocbert"),p(h,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(h,"href","#rocbert"),p(m,"class","relative group"),p(Fe,"id","overview"),p(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Fe,"href","#overview"),p(ie,"class","relative group"),p(Mo,"href","https://aclanthology.org/2022.acl-long.65.pdf"),p(Mo,"rel","nofollow"),p(Co,"href","https://huggingface.co/weiweishi"),p(Co,"rel","nofollow"),p(Ee,"id","documentation-resources"),p(Ee,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ee,"href","#documentation-resources"),p(le,"class","relative group"),p(Jt,"href","../tasks/sequence_classification"),p(jt,"href","../tasks/token_classification"),p(Ft,"href","../tasks/question_answering"),p(Ut,"href","../tasks/language_modeling"),p(xt,"href","../tasks/masked_language_modeling"),p(Et,"href","../tasks/multiple_choice"),p(Ie,"id","transformers.RoCBertConfig"),p(Ie,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ie,"href","#transformers.RoCBertConfig"),p(ce,"class","relative group"),p(It,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertModel"),p(zo,"href","https://huggingface.co/weiweishi/roc-bert-base-zh"),p(zo,"rel","nofollow"),p(qt,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(Nt,"href","/docs/transformers/v4.30.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(E,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ne,"id","transformers.RoCBertTokenizer"),p(Ne,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ne,"href","#transformers.RoCBertTokenizer"),p(he,"class","relative group"),p(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ve,"id","transformers.RoCBertModel"),p(Ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ve,"href","#transformers.RoCBertModel"),p(ue,"class","relative group"),p(Vo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Vo,"rel","nofollow"),p(Zo,"href","https://arxiv.org/abs/1706.03762"),p(Zo,"rel","nofollow"),p(At,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertModel"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Xe,"id","transformers.RoCBertForPreTraining"),p(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Xe,"href","#transformers.RoCBertForPreTraining"),p(ge,"class","relative group"),p(Oo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Oo,"rel","nofollow"),p(Zt,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertForPreTraining"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ge,"id","transformers.RoCBertForCausalLM"),p(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ge,"href","#transformers.RoCBertForCausalLM"),p(be,"class","relative group"),p(Yo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Yo,"rel","nofollow"),p(Xt,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertForCausalLM"),p(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(De,"id","transformers.RoCBertForMaskedLM"),p(De,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(De,"href","#transformers.RoCBertForMaskedLM"),p(ke,"class","relative group"),p(tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(tt,"rel","nofollow"),p(Pt,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertForMaskedLM"),p(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Ye,"id","transformers.RoCBertForSequenceClassification"),p(Ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ye,"href","#transformers.RoCBertForSequenceClassification"),p(Me,"class","relative group"),p(it,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(it,"rel","nofollow"),p(Lt,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertForSequenceClassification"),p(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(to,"id","transformers.RoCBertForMultipleChoice"),p(to,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(to,"href","#transformers.RoCBertForMultipleChoice"),p(Be,"class","relative group"),p(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(ht,"rel","nofollow"),p(Gt,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertForMultipleChoice"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(ro,"id","transformers.RoCBertForTokenClassification"),p(ro,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(ro,"href","#transformers.RoCBertForTokenClassification"),p($e,"class","relative group"),p(_t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(_t,"rel","nofollow"),p(Ot,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertForTokenClassification"),p(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(lo,"id","transformers.RoCBertForQuestionAnswering"),p(lo,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(lo,"href","#transformers.RoCBertForQuestionAnswering"),p(Je,"class","relative group"),p(kt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(kt,"rel","nofollow"),p(Qt,"href","/docs/transformers/v4.30.0/en/model_doc/roc_bert#transformers.RoCBertForQuestionAnswering"),p(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(o,g){e(document.head,c),b(o,y,g),b(o,m,g),e(m,h),e(h,_),v(n,_,null),e(m,d),e(m,R),e(R,Rr),b(o,xs,g),b(o,ie,g),e(ie,Fe),e(Fe,bn),v(wo,bn,null),e(ie,$r),e(ie,yn),e(yn,zr),b(o,Es,g),b(o,Ue,g),e(Ue,Jr),e(Ue,Mo),e(Mo,jr),e(Ue,Fr),b(o,Is,g),b(o,$t,g),e($t,Ur),b(o,qs,g),b(o,zt,g),e(zt,Tn),e(Tn,xr),b(o,Ns,g),b(o,xe,g),e(xe,Er),e(xe,Co),e(Co,Ir),e(xe,qr),b(o,Ss,g),b(o,le,g),e(le,Ee),e(Ee,kn),v(Bo,kn,null),e(le,Nr),e(le,vn),e(vn,Sr),b(o,Ws,g),b(o,J,g),e(J,wn),e(wn,Jt),e(Jt,Wr),e(J,Vr),e(J,Mn),e(Mn,jt),e(jt,Ar),e(J,Zr),e(J,Cn),e(Cn,Ft),e(Ft,Xr),e(J,Pr),e(J,Bn),e(Bn,Ut),e(Ut,Lr),e(J,Gr),e(J,Rn),e(Rn,xt),e(xt,Or),e(J,Qr),e(J,$n),e($n,Et),e(Et,Dr),b(o,Vs,g),b(o,ce,g),e(ce,Ie),e(Ie,zn),v(Ro,zn,null),e(ce,Hr),e(ce,Jn),e(Jn,Yr),b(o,As,g),b(o,E,g),v($o,E,null),e(E,Kr),e(E,de),e(de,ea),e(de,It),e(It,oa),e(de,ta),e(de,zo),e(zo,na),e(de,sa),e(E,ra),e(E,pe),e(pe,aa),e(pe,qt),e(qt,ia),e(pe,la),e(pe,Nt),e(Nt,ca),e(pe,da),e(E,pa),v(qe,E,null),b(o,Zs,g),b(o,he,g),e(he,Ne),e(Ne,jn),v(Jo,jn,null),e(he,ha),e(he,Fn),e(Fn,ma),b(o,Xs,g),b(o,j,g),v(jo,j,null),e(j,ua),e(j,K),v(Fo,K,null),e(K,fa),e(K,Un),e(Un,ga),e(K,_a),e(K,Uo),e(Uo,St),e(St,ba),e(St,xn),e(xn,ya),e(Uo,Ta),e(Uo,Wt),e(Wt,ka),e(Wt,En),e(En,va),e(j,wa),e(j,Se),v(xo,Se,null),e(Se,Ma),e(Se,Eo),e(Eo,Ca),e(Eo,In),e(In,Ba),e(Eo,Ra),e(j,$a),e(j,N),v(Io,N,null),e(N,za),e(N,qn),e(qn,Ja),e(N,ja),v(We,N,null),e(N,Fa),e(N,me),e(me,Ua),e(me,Nn),e(Nn,xa),e(me,Ea),e(me,Sn),e(Sn,Ia),e(me,qa),e(j,Na),e(j,Vt),v(qo,Vt,null),b(o,Ps,g),b(o,ue,g),e(ue,Ve),e(Ve,Wn),v(No,Wn,null),e(ue,Sa),e(ue,Vn),e(Vn,Wa),b(o,Ls,g),b(o,F,g),v(So,F,null),e(F,Va),e(F,Wo),e(Wo,Aa),e(Wo,Vo),e(Vo,Za),e(Wo,Xa),e(F,Pa),e(F,Ao),e(Ao,La),e(Ao,Zo),e(Zo,Ga),e(Ao,Oa),e(F,Qa),e(F,z),e(z,Da),e(z,An),e(An,Ha),e(z,Ya),e(z,Zn),e(Zn,Ka),e(z,ei),e(z,Xn),e(Xn,oi),e(z,ti),e(z,Pn),e(Pn,ni),e(z,si),e(z,Ln),e(Ln,ri),e(z,ai),e(z,Gn),e(Gn,ii),e(z,li),e(F,ci),e(F,S),v(Xo,S,null),e(S,di),e(S,fe),e(fe,pi),e(fe,At),e(At,hi),e(fe,mi),e(fe,On),e(On,ui),e(fe,fi),e(S,gi),v(Ae,S,null),e(S,_i),v(Ze,S,null),b(o,Gs,g),b(o,ge,g),e(ge,Xe),e(Xe,Qn),v(Po,Qn,null),e(ge,bi),e(ge,Dn),e(Dn,yi),b(o,Os,g),b(o,I,g),v(Lo,I,null),e(I,Ti),e(I,Hn),e(Hn,ki),e(I,vi),e(I,Go),e(Go,wi),e(Go,Oo),e(Oo,Mi),e(Go,Ci),e(I,Bi),e(I,W),v(Qo,W,null),e(W,Ri),e(W,_e),e(_e,$i),e(_e,Zt),e(Zt,zi),e(_e,Ji),e(_e,Yn),e(Yn,ji),e(_e,Fi),e(W,Ui),v(Pe,W,null),e(W,xi),v(Le,W,null),b(o,Qs,g),b(o,be,g),e(be,Ge),e(Ge,Kn),v(Do,Kn,null),e(be,Ei),e(be,es),e(es,Ii),b(o,Ds,g),b(o,L,g),v(Ho,L,null),e(L,qi),e(L,ye),e(ye,Ni),e(ye,os),e(os,Si),e(ye,Wi),e(ye,Yo),e(Yo,Vi),e(ye,Ai),e(L,Zi),e(L,V),v(Ko,V,null),e(V,Xi),e(V,Te),e(Te,Pi),e(Te,Xt),e(Xt,Li),e(Te,Gi),e(Te,ts),e(ts,Oi),e(Te,Qi),e(V,Di),v(Oe,V,null),e(V,Hi),v(Qe,V,null),b(o,Hs,g),b(o,ke,g),e(ke,De),e(De,ns),v(et,ns,null),e(ke,Yi),e(ke,ss),e(ss,Ki),b(o,Ys,g),b(o,G,g),v(ot,G,null),e(G,el),e(G,ve),e(ve,ol),e(ve,rs),e(rs,tl),e(ve,nl),e(ve,tt),e(tt,sl),e(ve,rl),e(G,al),e(G,ee),v(nt,ee,null),e(ee,il),e(ee,we),e(we,ll),e(we,Pt),e(Pt,cl),e(we,dl),e(we,as),e(as,pl),e(we,hl),e(ee,ml),v(He,ee,null),b(o,Ks,g),b(o,Me,g),e(Me,Ye),e(Ye,is),v(st,is,null),e(Me,ul),e(Me,ls),e(ls,fl),b(o,er,g),b(o,O,g),v(rt,O,null),e(O,gl),e(O,at),e(at,_l),e(at,it),e(it,bl),e(at,yl),e(O,Tl),e(O,U),v(lt,U,null),e(U,kl),e(U,Ce),e(Ce,vl),e(Ce,Lt),e(Lt,wl),e(Ce,Ml),e(Ce,cs),e(cs,Cl),e(Ce,Bl),e(U,Rl),v(Ke,U,null),e(U,$l),v(eo,U,null),e(U,zl),v(oo,U,null),b(o,or,g),b(o,Be,g),e(Be,to),e(to,ds),v(ct,ds,null),e(Be,Jl),e(Be,ps),e(ps,jl),b(o,tr,g),b(o,Q,g),v(dt,Q,null),e(Q,Fl),e(Q,pt),e(pt,Ul),e(pt,ht),e(ht,xl),e(pt,El),e(Q,Il),e(Q,A),v(mt,A,null),e(A,ql),e(A,Re),e(Re,Nl),e(Re,Gt),e(Gt,Sl),e(Re,Wl),e(Re,hs),e(hs,Vl),e(Re,Al),e(A,Zl),v(no,A,null),e(A,Xl),v(so,A,null),b(o,nr,g),b(o,$e,g),e($e,ro),e(ro,ms),v(ut,ms,null),e($e,Pl),e($e,us),e(us,Ll),b(o,sr,g),b(o,D,g),v(ft,D,null),e(D,Gl),e(D,gt),e(gt,Ol),e(gt,_t),e(_t,Ql),e(gt,Dl),e(D,Hl),e(D,Z),v(bt,Z,null),e(Z,Yl),e(Z,ze),e(ze,Kl),e(ze,Ot),e(Ot,ec),e(ze,oc),e(ze,fs),e(fs,tc),e(ze,nc),e(Z,sc),v(ao,Z,null),e(Z,rc),v(io,Z,null),b(o,rr,g),b(o,Je,g),e(Je,lo),e(lo,gs),v(yt,gs,null),e(Je,ac),e(Je,_s),e(_s,ic),b(o,ar,g),b(o,H,g),v(Tt,H,null),e(H,lc),e(H,Y),e(Y,cc),e(Y,bs),e(bs,dc),e(Y,pc),e(Y,ys),e(ys,hc),e(Y,mc),e(Y,kt),e(kt,uc),e(Y,fc),e(H,gc),e(H,X),v(vt,X,null),e(X,_c),e(X,je),e(je,bc),e(je,Qt),e(Qt,yc),e(je,Tc),e(je,Ts),e(Ts,kc),e(je,vc),e(X,wc),v(co,X,null),e(X,Mc),v(po,X,null),ir=!0},p(o,[g]){const wt={};g&2&&(wt.$$scope={dirty:g,ctx:o}),qe.$set(wt);const ks={};g&2&&(ks.$$scope={dirty:g,ctx:o}),We.$set(ks);const vs={};g&2&&(vs.$$scope={dirty:g,ctx:o}),Ae.$set(vs);const ws={};g&2&&(ws.$$scope={dirty:g,ctx:o}),Ze.$set(ws);const Mt={};g&2&&(Mt.$$scope={dirty:g,ctx:o}),Pe.$set(Mt);const Ms={};g&2&&(Ms.$$scope={dirty:g,ctx:o}),Le.$set(Ms);const Cs={};g&2&&(Cs.$$scope={dirty:g,ctx:o}),Oe.$set(Cs);const Bs={};g&2&&(Bs.$$scope={dirty:g,ctx:o}),Qe.$set(Bs);const Ct={};g&2&&(Ct.$$scope={dirty:g,ctx:o}),He.$set(Ct);const Rs={};g&2&&(Rs.$$scope={dirty:g,ctx:o}),Ke.$set(Rs);const $s={};g&2&&($s.$$scope={dirty:g,ctx:o}),eo.$set($s);const zs={};g&2&&(zs.$$scope={dirty:g,ctx:o}),oo.$set(zs);const Js={};g&2&&(Js.$$scope={dirty:g,ctx:o}),no.$set(Js);const Bt={};g&2&&(Bt.$$scope={dirty:g,ctx:o}),so.$set(Bt);const js={};g&2&&(js.$$scope={dirty:g,ctx:o}),ao.$set(js);const Rt={};g&2&&(Rt.$$scope={dirty:g,ctx:o}),io.$set(Rt);const Fs={};g&2&&(Fs.$$scope={dirty:g,ctx:o}),co.$set(Fs);const Us={};g&2&&(Us.$$scope={dirty:g,ctx:o}),po.$set(Us)},i(o){ir||(w(n.$$.fragment,o),w(wo.$$.fragment,o),w(Bo.$$.fragment,o),w(Ro.$$.fragment,o),w($o.$$.fragment,o),w(qe.$$.fragment,o),w(Jo.$$.fragment,o),w(jo.$$.fragment,o),w(Fo.$$.fragment,o),w(xo.$$.fragment,o),w(Io.$$.fragment,o),w(We.$$.fragment,o),w(qo.$$.fragment,o),w(No.$$.fragment,o),w(So.$$.fragment,o),w(Xo.$$.fragment,o),w(Ae.$$.fragment,o),w(Ze.$$.fragment,o),w(Po.$$.fragment,o),w(Lo.$$.fragment,o),w(Qo.$$.fragment,o),w(Pe.$$.fragment,o),w(Le.$$.fragment,o),w(Do.$$.fragment,o),w(Ho.$$.fragment,o),w(Ko.$$.fragment,o),w(Oe.$$.fragment,o),w(Qe.$$.fragment,o),w(et.$$.fragment,o),w(ot.$$.fragment,o),w(nt.$$.fragment,o),w(He.$$.fragment,o),w(st.$$.fragment,o),w(rt.$$.fragment,o),w(lt.$$.fragment,o),w(Ke.$$.fragment,o),w(eo.$$.fragment,o),w(oo.$$.fragment,o),w(ct.$$.fragment,o),w(dt.$$.fragment,o),w(mt.$$.fragment,o),w(no.$$.fragment,o),w(so.$$.fragment,o),w(ut.$$.fragment,o),w(ft.$$.fragment,o),w(bt.$$.fragment,o),w(ao.$$.fragment,o),w(io.$$.fragment,o),w(yt.$$.fragment,o),w(Tt.$$.fragment,o),w(vt.$$.fragment,o),w(co.$$.fragment,o),w(po.$$.fragment,o),ir=!0)},o(o){M(n.$$.fragment,o),M(wo.$$.fragment,o),M(Bo.$$.fragment,o),M(Ro.$$.fragment,o),M($o.$$.fragment,o),M(qe.$$.fragment,o),M(Jo.$$.fragment,o),M(jo.$$.fragment,o),M(Fo.$$.fragment,o),M(xo.$$.fragment,o),M(Io.$$.fragment,o),M(We.$$.fragment,o),M(qo.$$.fragment,o),M(No.$$.fragment,o),M(So.$$.fragment,o),M(Xo.$$.fragment,o),M(Ae.$$.fragment,o),M(Ze.$$.fragment,o),M(Po.$$.fragment,o),M(Lo.$$.fragment,o),M(Qo.$$.fragment,o),M(Pe.$$.fragment,o),M(Le.$$.fragment,o),M(Do.$$.fragment,o),M(Ho.$$.fragment,o),M(Ko.$$.fragment,o),M(Oe.$$.fragment,o),M(Qe.$$.fragment,o),M(et.$$.fragment,o),M(ot.$$.fragment,o),M(nt.$$.fragment,o),M(He.$$.fragment,o),M(st.$$.fragment,o),M(rt.$$.fragment,o),M(lt.$$.fragment,o),M(Ke.$$.fragment,o),M(eo.$$.fragment,o),M(oo.$$.fragment,o),M(ct.$$.fragment,o),M(dt.$$.fragment,o),M(mt.$$.fragment,o),M(no.$$.fragment,o),M(so.$$.fragment,o),M(ut.$$.fragment,o),M(ft.$$.fragment,o),M(bt.$$.fragment,o),M(ao.$$.fragment,o),M(io.$$.fragment,o),M(yt.$$.fragment,o),M(Tt.$$.fragment,o),M(vt.$$.fragment,o),M(co.$$.fragment,o),M(po.$$.fragment,o),ir=!1},d(o){t(c),o&&t(y),o&&t(m),C(n),o&&t(xs),o&&t(ie),C(wo),o&&t(Es),o&&t(Ue),o&&t(Is),o&&t($t),o&&t(qs),o&&t(zt),o&&t(Ns),o&&t(xe),o&&t(Ss),o&&t(le),C(Bo),o&&t(Ws),o&&t(J),o&&t(Vs),o&&t(ce),C(Ro),o&&t(As),o&&t(E),C($o),C(qe),o&&t(Zs),o&&t(he),C(Jo),o&&t(Xs),o&&t(j),C(jo),C(Fo),C(xo),C(Io),C(We),C(qo),o&&t(Ps),o&&t(ue),C(No),o&&t(Ls),o&&t(F),C(So),C(Xo),C(Ae),C(Ze),o&&t(Gs),o&&t(ge),C(Po),o&&t(Os),o&&t(I),C(Lo),C(Qo),C(Pe),C(Le),o&&t(Qs),o&&t(be),C(Do),o&&t(Ds),o&&t(L),C(Ho),C(Ko),C(Oe),C(Qe),o&&t(Hs),o&&t(ke),C(et),o&&t(Ys),o&&t(G),C(ot),C(nt),C(He),o&&t(Ks),o&&t(Me),C(st),o&&t(er),o&&t(O),C(rt),C(lt),C(Ke),C(eo),C(oo),o&&t(or),o&&t(Be),C(ct),o&&t(tr),o&&t(Q),C(dt),C(mt),C(no),C(so),o&&t(nr),o&&t($e),C(ut),o&&t(sr),o&&t(D),C(ft),C(bt),C(ao),C(io),o&&t(rr),o&&t(Je),C(yt),o&&t(ar),o&&t(H),C(Tt),C(vt),C(co),C(po)}}}const xp={local:"rocbert",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.RoCBertConfig",title:"RoCBertConfig"},{local:"transformers.RoCBertTokenizer",title:"RoCBertTokenizer"},{local:"transformers.RoCBertModel",title:"RoCBertModel"},{local:"transformers.RoCBertForPreTraining",title:"RoCBertForPreTraining"},{local:"transformers.RoCBertForCausalLM",title:"RoCBertForCausalLM"},{local:"transformers.RoCBertForMaskedLM",title:"RoCBertForMaskedLM"},{local:"transformers.RoCBertForSequenceClassification",title:"RoCBertForSequenceClassification"},{local:"transformers.RoCBertForMultipleChoice",title:"RoCBertForMultipleChoice"},{local:"transformers.RoCBertForTokenClassification",title:"RoCBertForTokenClassification"},{local:"transformers.RoCBertForQuestionAnswering",title:"RoCBertForQuestionAnswering"}],title:"RoCBert"};function Ep(B){return up(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ap extends dp{constructor(c){super();pp(this,c,Ep,Up,hp,{})}}export{Ap as default,xp as metadata};
