import{S as cp,i as pp,s as hp,e as s,k as m,w as k,t as i,M as up,c as r,d as t,m as f,a,x as T,h as l,b as p,G as e,g as b,y as v,q as w,o as M,B as C,v as mp,L as re}from"../../chunks/vendor-hf-doc-builder.js";import{T as vo}from"../../chunks/Tip-hf-doc-builder.js";import{D as R}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ae}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as se}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function fp(B){let d,y;return d=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(){k(d.$$.fragment)},l(u){T(d.$$.fragment,u)},m(u,h){v(d,u,h),y=!0},p:re,i(u){y||(w(d.$$.fragment,u),y=!0)},o(u){M(d.$$.fragment,u),y=!1},d(u){C(d,u)}}}function gp(B){let d,y,u,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(){d=s("p"),y=i("pair mask has the following format:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"pair mask has the following format:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function _p(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function bp(B){let d,y,u,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(){d=s("p"),y=i("Example:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function yp(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function kp(B){let d,y,u,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(){d=s("p"),y=i("Example:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function Tp(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function vp(B){let d,y,u,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(){d=s("p"),y=i("Example:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function wp(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Mp(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Cp(B){let d,y,u,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(){d=s("p"),y=i("Example of single-label classification:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example of single-label classification:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function Bp(B){let d,y,u,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(){d=s("p"),y=i("Example of multi-label classification:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example of multi-label classification:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function zp(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Rp(B){let d,y,u,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(){d=s("p"),y=i("Example:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function $p(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Jp(B){let d,y,u,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(){d=s("p"),y=i("Example:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function jp(B){let d,y,u,h,_;return{c(){d=s("p"),y=i("Although the recipe for forward pass needs to be defined within this function, one should call the "),u=s("code"),h=i("Module"),_=i(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),u=r(c,"CODE",{});var z=a(u);h=l(z,"Module"),z.forEach(t),_=l(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(n,c){b(n,d,c),e(d,y),e(d,u),e(u,h),e(d,_)},d(n){n&&t(d)}}}function Fp(B){let d,y,u,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(){d=s("p"),y=i("Example:"),u=m(),k(h.$$.fragment)},l(n){d=r(n,"P",{});var c=a(d);y=l(c,"Example:"),c.forEach(t),u=f(n),T(h.$$.fragment,n)},m(n,c){b(n,d,c),e(d,y),b(n,u,c),v(h,n,c),_=!0},p:re,i(n){_||(w(h.$$.fragment,n),_=!0)},o(n){M(h.$$.fragment,n),_=!1},d(n){n&&t(d),n&&t(u),C(h,n)}}}function Up(B){let d,y,u,h,_,n,c,z,zr,xs,ie,Fe,bn,wo,Rr,yn,$r,Es,Ue,Jr,Mo,jr,Fr,Is,Rt,Ur,qs,$t,kn,xr,Ns,xe,Er,Co,Ir,qr,Ws,le,Ee,Tn,Bo,Nr,vn,Wr,Ss,J,wn,Jt,Sr,Vr,Mn,jt,Ar,Zr,Cn,Ft,Pr,Xr,Bn,Ut,Lr,Gr,zn,xt,Or,Qr,Rn,Et,Dr,Vs,de,Ie,$n,zo,Hr,Jn,Yr,As,E,Ro,Kr,ce,ea,It,oa,ta,$o,na,sa,ra,pe,aa,qt,ia,la,Nt,da,ca,pa,qe,Zs,he,Ne,jn,Jo,ha,Fn,ua,Ps,j,jo,ma,K,Fo,fa,Un,ga,_a,Uo,Wt,ba,xn,ya,ka,St,Ta,En,va,wa,We,xo,Ma,Eo,Ca,In,Ba,za,Ra,N,Io,$a,qn,Ja,ja,Se,Fa,ue,Ua,Nn,xa,Ea,Wn,Ia,qa,Na,Vt,qo,Xs,me,Ve,Sn,No,Wa,Vn,Sa,Ls,F,Wo,Va,So,Aa,Vo,Za,Pa,Xa,Ao,La,Zo,Ga,Oa,Qa,$,Da,An,Ha,Ya,Zn,Ka,ei,Pn,oi,ti,Xn,ni,si,Ln,ri,ai,Gn,ii,li,di,W,Po,ci,fe,pi,At,hi,ui,On,mi,fi,gi,Ae,_i,Ze,Gs,ge,Pe,Qn,Xo,bi,Dn,yi,Os,I,Lo,ki,Hn,Ti,vi,Go,wi,Oo,Mi,Ci,Bi,S,Qo,zi,_e,Ri,Zt,$i,Ji,Yn,ji,Fi,Ui,Xe,xi,Le,Qs,be,Ge,Kn,Do,Ei,es,Ii,Ds,L,Ho,qi,ye,Ni,os,Wi,Si,Yo,Vi,Ai,Zi,V,Ko,Pi,ke,Xi,Pt,Li,Gi,ts,Oi,Qi,Di,Oe,Hi,Qe,Hs,Te,De,ns,et,Yi,ss,Ki,Ys,G,ot,el,ve,ol,rs,tl,nl,tt,sl,rl,al,ee,nt,il,we,ll,Xt,dl,cl,as,pl,hl,ul,He,Ks,Me,Ye,is,st,ml,ls,fl,er,O,rt,gl,at,_l,it,bl,yl,kl,U,lt,Tl,Ce,vl,Lt,wl,Ml,ds,Cl,Bl,zl,Ke,Rl,eo,$l,oo,or,Be,to,cs,dt,Jl,ps,jl,tr,Q,ct,Fl,pt,Ul,ht,xl,El,Il,A,ut,ql,ze,Nl,Gt,Wl,Sl,hs,Vl,Al,Zl,no,Pl,so,nr,Re,ro,us,mt,Xl,ms,Ll,sr,D,ft,Gl,gt,Ol,_t,Ql,Dl,Hl,Z,bt,Yl,$e,Kl,Ot,ed,od,fs,td,nd,sd,ao,rd,io,rr,Je,lo,gs,yt,ad,_s,id,ar,H,kt,ld,Y,dd,bs,cd,pd,ys,hd,ud,Tt,md,fd,gd,P,vt,_d,je,bd,Qt,yd,kd,ks,Td,vd,wd,co,Md,po,ir;return n=new q({}),wo=new q({}),Bo=new q({}),zo=new q({}),Ro=new R({props:{name:"class transformers.RoCBertConfig",anchor:"transformers.RoCBertConfig",parameters:[{name:"vocab_size",val:" = 30522"},{name:"hidden_size",val:" = 768"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_cache",val:" = True"},{name:"pad_token_id",val:" = 0"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"classifier_dropout",val:" = None"},{name:"enable_pronunciation",val:" = True"},{name:"enable_shape",val:" = True"},{name:"pronunciation_embed_dim",val:" = 768"},{name:"pronunciation_vocab_size",val:" = 910"},{name:"shape_embed_dim",val:" = 512"},{name:"shape_vocab_size",val:" = 24858"},{name:"concat_input",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RoCBertConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the RoCBert model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/v4.33.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.33.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.33.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.33.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.33.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 R({props:{name:"class transformers.RoCBertTokenizer",anchor:"transformers.RoCBertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"word_shape_file",val:""},{name:"word_pronunciation_file",val:""},{name:"do_lower_case",val:" = True"},{name:"do_basic_tokenize",val:" = True"},{name:"never_split",val:" = None"},{name:"unk_token",val:" = '[UNK]'"},{name:"sep_token",val:" = '[SEP]'"},{name:"pad_token",val:" = '[PAD]'"},{name:"cls_token",val:" = '[CLS]'"},{name:"mask_token",val:" = '[MASK]'"},{name:"tokenize_chinese_chars",val:" = True"},{name:"strip_accents",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.Construct",description:'<strong>Construct</strong> a RoCBert tokenizer. Based on WordPiece. This tokenizer inherits from <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L95"}}),Fo=new R({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.RoCBertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"cls_token_id",val:": int = None"},{name:"sep_token_id",val:": int = None"}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.RoCBertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L784",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 R({props:{name:"get_special_tokens_mask",anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.RoCBertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L814",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 R({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L843",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Se=new se({props:{anchor:"transformers.RoCBertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[gp]},$$scope:{ctx:B}}}),qo=new R({props:{name:"save_vocabulary",anchor:"transformers.RoCBertTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/roc_bert/tokenization_roc_bert.py#L872"}}),No=new q({}),Wo=new R({props:{name:"class transformers.RoCBertModel",anchor:"transformers.RoCBertModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.RoCBertModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L883"}}),Po=new R({props:{name:"forward",anchor:"transformers.RoCBertModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertModel.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertModel.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L938",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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}}}),Xo=new q({}),Lo=new R({props:{name:"class transformers.RoCBertForPreTraining",anchor:"transformers.RoCBertForPreTraining",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForPreTraining.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1085"}}),Qo=new R({props:{name:"forward",anchor:"transformers.RoCBertForPreTraining.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"attack_token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels_token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForPreTraining.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForPreTraining.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForPreTraining.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForPreTraining.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForPreTraining.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForPreTraining.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForPreTraining.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1105",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Xe=new vo({props:{$$slots:{default:[yp]},$$scope:{ctx:B}}}),Le=new se({props:{anchor:"transformers.RoCBertForPreTraining.forward.example",$$slots:{default:[kp]},$$scope:{ctx:B}}}),Do=new q({}),Ho=new R({props:{name:"class transformers.RoCBertForCausalLM",anchor:"transformers.RoCBertForCausalLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForCausalLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1410"}}),Ko=new R({props:{name:"forward",anchor:"transformers.RoCBertForCausalLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"past_key_values",val:": typing.Optional[typing.List[torch.Tensor]] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_cache",val:": typing.Optional[bool] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForCausalLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForCausalLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForCausalLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForCausalLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForCausalLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForCausalLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForCausalLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1434",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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:[Tp]},$$scope:{ctx:B}}}),Qe=new se({props:{anchor:"transformers.RoCBertForCausalLM.forward.example",$$slots:{default:[vp]},$$scope:{ctx:B}}}),et=new q({}),ot=new R({props:{name:"class transformers.RoCBertForMaskedLM",anchor:"transformers.RoCBertForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1270"}}),nt=new R({props:{name:"forward",anchor:"transformers.RoCBertForMaskedLM.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_hidden_states",val:": typing.Optional[torch.Tensor] = None"},{name:"encoder_attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1297"}}),He=new vo({props:{$$slots:{default:[wp]},$$scope:{ctx:B}}}),st=new q({}),rt=new R({props:{name:"class transformers.RoCBertForSequenceClassification",anchor:"transformers.RoCBertForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1592"}}),lt=new R({props:{name:"forward",anchor:"transformers.RoCBertForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1609",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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}}}),dt=new q({}),ct=new R({props:{name:"class transformers.RoCBertForMultipleChoice",anchor:"transformers.RoCBertForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1698"}}),ut=new R({props:{name:"forward",anchor:"transformers.RoCBertForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1713",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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:[zp]},$$scope:{ctx:B}}}),so=new se({props:{anchor:"transformers.RoCBertForMultipleChoice.forward.example",$$slots:{default:[Rp]},$$scope:{ctx:B}}}),mt=new q({}),ft=new R({props:{name:"class transformers.RoCBertForTokenClassification",anchor:"transformers.RoCBertForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1803"}}),bt=new R({props:{name:"forward",anchor:"transformers.RoCBertForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1819",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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:[$p]},$$scope:{ctx:B}}}),io=new se({props:{anchor:"transformers.RoCBertForTokenClassification.forward.example",$$slots:{default:[Jp]},$$scope:{ctx:B}}}),yt=new q({}),kt=new R({props:{name:"class transformers.RoCBertForQuestionAnswering",anchor:"transformers.RoCBertForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.RoCBertForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.33.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.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1889"}}),vt=new R({props:{name:"forward",anchor:"transformers.RoCBertForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_shape_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_pronunciation_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.RoCBertForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.input_shape_ids",description:`<strong>input_shape_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the shape vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_shape_ids">What are input IDs?</a>`,name:"input_shape_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.input_pronunciation_ids",description:`<strong>input_pronunciation_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the pronunciation vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input_pronunciation_ids">What are input IDs?</a>`,name:"input_pronunciation_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.RoCBertForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/v4.33.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.33.0/src/transformers/models/roc_bert/modeling_roc_bert.py#L1901",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.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.33.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.33.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(){d=s("meta"),y=m(),u=s("h1"),h=s("a"),_=s("span"),k(n.$$.fragment),c=m(),z=s("span"),zr=i("RoCBert"),xs=m(),ie=s("h2"),Fe=s("a"),bn=s("span"),k(wo.$$.fragment),Rr=m(),yn=s("span"),$r=i("Overview"),Es=m(),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=m(),Rt=s("p"),Ur=i("The abstract from the paper is the following:"),qs=m(),$t=s("p"),kn=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=m(),xe=s("p"),Er=i("This model was contributed by "),Co=s("a"),Ir=i("weiweishi"),qr=i("."),Ws=m(),le=s("h2"),Ee=s("a"),Tn=s("span"),k(Bo.$$.fragment),Nr=m(),vn=s("span"),Wr=i("Documentation resources"),Ss=m(),J=s("ul"),wn=s("li"),Jt=s("a"),Sr=i("Text classification task guide"),Vr=m(),Mn=s("li"),jt=s("a"),Ar=i("Token classification task guide"),Zr=m(),Cn=s("li"),Ft=s("a"),Pr=i("Question answering task guide"),Xr=m(),Bn=s("li"),Ut=s("a"),Lr=i("Causal language modeling task guide"),Gr=m(),zn=s("li"),xt=s("a"),Or=i("Masked language modeling task guide"),Qr=m(),Rn=s("li"),Et=s("a"),Dr=i("Multiple choice task guide"),Vs=m(),de=s("h2"),Ie=s("a"),$n=s("span"),k(zo.$$.fragment),Hr=m(),Jn=s("span"),Yr=i("RoCBertConfig"),As=m(),E=s("div"),k(Ro.$$.fragment),Kr=m(),ce=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
`),$o=s("a"),na=i("weiweishi/roc-bert-base-zh"),sa=i(" architecture."),ra=m(),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"),da=i("PretrainedConfig"),ca=i(" for more information."),pa=m(),k(qe.$$.fragment),Zs=m(),he=s("h2"),Ne=s("a"),jn=s("span"),k(Jo.$$.fragment),ha=m(),Fn=s("span"),ua=i("RoCBertTokenizer"),Ps=m(),j=s("div"),k(jo.$$.fragment),ma=m(),K=s("div"),k(Fo.$$.fragment),fa=m(),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=m(),Uo=s("ul"),Wt=s("li"),ba=i("single sequence: "),xn=s("code"),ya=i("[CLS] X [SEP]"),ka=m(),St=s("li"),Ta=i("pair of sequences: "),En=s("code"),va=i("[CLS] A [SEP] B [SEP]"),wa=m(),We=s("div"),k(xo.$$.fragment),Ma=m(),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"),za=i(" method."),Ra=m(),N=s("div"),k(Io.$$.fragment),$a=m(),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=m(),k(Se.$$.fragment),Fa=m(),ue=s("p"),Ua=i("If "),Nn=s("code"),xa=i("token_ids_1"),Ea=i(" is "),Wn=s("code"),Ia=i("None"),qa=i(", this method only returns the first portion of the mask (0s)."),Na=m(),Vt=s("div"),k(qo.$$.fragment),Xs=m(),me=s("h2"),Ve=s("a"),Sn=s("span"),k(No.$$.fragment),Wa=m(),Vn=s("span"),Sa=i("RoCBertModel"),Ls=m(),F=s("div"),k(Wo.$$.fragment),Va=m(),So=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"),Pa=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.`),Xa=m(),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=m(),$=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 "),Pn=s("code"),oi=i("is_decoder"),ti=i(` argument and
`),Xn=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."),di=m(),W=s("div"),k(Po.$$.fragment),ci=m(),fe=s("p"),pi=i("The "),At=s("a"),hi=i("RoCBertModel"),ui=i(" forward method, overrides the "),On=s("code"),mi=i("__call__"),fi=i(" special method."),gi=m(),k(Ae.$$.fragment),_i=m(),k(Ze.$$.fragment),Gs=m(),ge=s("h2"),Pe=s("a"),Qn=s("span"),k(Xo.$$.fragment),bi=m(),Dn=s("span"),yi=i("RoCBertForPreTraining"),Os=m(),I=s("div"),k(Lo.$$.fragment),ki=m(),Hn=s("p"),Ti=i("RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),vi=m(),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=m(),S=s("div"),k(Qo.$$.fragment),zi=m(),_e=s("p"),Ri=i("The "),Zt=s("a"),$i=i("RoCBertForPreTraining"),Ji=i(" forward method, overrides the "),Yn=s("code"),ji=i("__call__"),Fi=i(" special method."),Ui=m(),k(Xe.$$.fragment),xi=m(),k(Le.$$.fragment),Qs=m(),be=s("h2"),Ge=s("a"),Kn=s("span"),k(Do.$$.fragment),Ei=m(),es=s("span"),Ii=i("RoCBertForCausalLM"),Ds=m(),L=s("div"),k(Ho.$$.fragment),qi=m(),ye=s("p"),Ni=i("RoCBert Model with a "),os=s("code"),Wi=i("language modeling"),Si=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=m(),V=s("div"),k(Ko.$$.fragment),Pi=m(),ke=s("p"),Xi=i("The "),Pt=s("a"),Li=i("RoCBertForCausalLM"),Gi=i(" forward method, overrides the "),ts=s("code"),Oi=i("__call__"),Qi=i(" special method."),Di=m(),k(Oe.$$.fragment),Hi=m(),k(Qe.$$.fragment),Hs=m(),Te=s("h2"),De=s("a"),ns=s("span"),k(et.$$.fragment),Yi=m(),ss=s("span"),Ki=i("RoCBertForMaskedLM"),Ys=m(),G=s("div"),k(ot.$$.fragment),el=m(),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=m(),ee=s("div"),k(nt.$$.fragment),il=m(),we=s("p"),ll=i("The "),Xt=s("a"),dl=i("RoCBertForMaskedLM"),cl=i(" forward method, overrides the "),as=s("code"),pl=i("__call__"),hl=i(" special method."),ul=m(),k(He.$$.fragment),Ks=m(),Me=s("h2"),Ye=s("a"),is=s("span"),k(st.$$.fragment),ml=m(),ls=s("span"),fl=i("RoCBertForSequenceClassification"),er=m(),O=s("div"),k(rt.$$.fragment),gl=m(),at=s("p"),_l=i(`RoCBert Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),it=s("a"),bl=i("torch.nn.Module"),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.`),kl=m(),U=s("div"),k(lt.$$.fragment),Tl=m(),Ce=s("p"),vl=i("The "),Lt=s("a"),wl=i("RoCBertForSequenceClassification"),Ml=i(" forward method, overrides the "),ds=s("code"),Cl=i("__call__"),Bl=i(" special method."),zl=m(),k(Ke.$$.fragment),Rl=m(),k(eo.$$.fragment),$l=m(),k(oo.$$.fragment),or=m(),Be=s("h2"),to=s("a"),cs=s("span"),k(dt.$$.fragment),Jl=m(),ps=s("span"),jl=i("RoCBertForMultipleChoice"),tr=m(),Q=s("div"),k(ct.$$.fragment),Fl=m(),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=m(),A=s("div"),k(ut.$$.fragment),ql=m(),ze=s("p"),Nl=i("The "),Gt=s("a"),Wl=i("RoCBertForMultipleChoice"),Sl=i(" forward method, overrides the "),hs=s("code"),Vl=i("__call__"),Al=i(" special method."),Zl=m(),k(no.$$.fragment),Pl=m(),k(so.$$.fragment),nr=m(),Re=s("h2"),ro=s("a"),us=s("span"),k(mt.$$.fragment),Xl=m(),ms=s("span"),Ll=i("RoCBertForTokenClassification"),sr=m(),D=s("div"),k(ft.$$.fragment),Gl=m(),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=m(),Z=s("div"),k(bt.$$.fragment),Yl=m(),$e=s("p"),Kl=i("The "),Ot=s("a"),ed=i("RoCBertForTokenClassification"),od=i(" forward method, overrides the "),fs=s("code"),td=i("__call__"),nd=i(" special method."),sd=m(),k(ao.$$.fragment),rd=m(),k(io.$$.fragment),rr=m(),Je=s("h2"),lo=s("a"),gs=s("span"),k(yt.$$.fragment),ad=m(),_s=s("span"),id=i("RoCBertForQuestionAnswering"),ar=m(),H=s("div"),k(kt.$$.fragment),ld=m(),Y=s("p"),dd=i(`RoCBert Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),bs=s("code"),cd=i("span start logits"),pd=i(" and "),ys=s("code"),hd=i("span end logits"),ud=i(`).
This model is a PyTorch `),Tt=s("a"),md=i("torch.nn.Module"),fd=i(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),gd=m(),P=s("div"),k(vt.$$.fragment),_d=m(),je=s("p"),bd=i("The "),Qt=s("a"),yd=i("RoCBertForQuestionAnswering"),kd=i(" forward method, overrides the "),ks=s("code"),Td=i("__call__"),vd=i(" special method."),wd=m(),k(co.$$.fragment),Md=m(),k(po.$$.fragment),this.h()},l(o){const g=up('[data-svelte="svelte-1phssyn"]',document.head);d=r(g,"META",{name:!0,content:!0}),g.forEach(t),y=f(o),u=r(o,"H1",{class:!0});var wt=a(u);h=r(wt,"A",{id:!0,class:!0,href:!0});var Ts=a(h);_=r(Ts,"SPAN",{});var vs=a(_);T(n.$$.fragment,vs),vs.forEach(t),Ts.forEach(t),c=f(wt),z=r(wt,"SPAN",{});var ws=a(z);zr=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);T(wo.$$.fragment,Cs),Cs.forEach(t),Ms.forEach(t),Rr=f(Mt),yn=r(Mt,"SPAN",{});var Bs=a(yn);$r=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 zs=a(Mo);jr=l(zs,"RoCBert: Robust Chinese Bert with Multimodal Contrastive Pretraining"),zs.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),Rt=r(o,"P",{});var Rs=a(Rt);Ur=l(Rs,"The abstract from the paper is the following:"),Rs.forEach(t),qs=f(o),$t=r(o,"P",{});var $s=a($t);kn=r($s,"EM",{});var Js=a(kn);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),$s.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),Ws=f(o),le=r(o,"H2",{class:!0});var zt=a(le);Ee=r(zt,"A",{id:!0,class:!0,href:!0});var Fs=a(Ee);Tn=r(Fs,"SPAN",{});var Us=a(Tn);T(Bo.$$.fragment,Us),Us.forEach(t),Fs.forEach(t),Nr=f(zt),vn=r(zt,"SPAN",{});var zd=a(vn);Wr=l(zd,"Documentation resources"),zd.forEach(t),zt.forEach(t),Ss=f(o),J=r(o,"UL",{});var X=a(J);wn=r(X,"LI",{});var Rd=a(wn);Jt=r(Rd,"A",{href:!0});var $d=a(Jt);Sr=l($d,"Text classification task guide"),$d.forEach(t),Rd.forEach(t),Vr=f(X),Mn=r(X,"LI",{});var Jd=a(Mn);jt=r(Jd,"A",{href:!0});var jd=a(jt);Ar=l(jd,"Token classification task guide"),jd.forEach(t),Jd.forEach(t),Zr=f(X),Cn=r(X,"LI",{});var Fd=a(Cn);Ft=r(Fd,"A",{href:!0});var Ud=a(Ft);Pr=l(Ud,"Question answering task guide"),Ud.forEach(t),Fd.forEach(t),Xr=f(X),Bn=r(X,"LI",{});var xd=a(Bn);Ut=r(xd,"A",{href:!0});var Ed=a(Ut);Lr=l(Ed,"Causal language modeling task guide"),Ed.forEach(t),xd.forEach(t),Gr=f(X),zn=r(X,"LI",{});var Id=a(zn);xt=r(Id,"A",{href:!0});var qd=a(xt);Or=l(qd,"Masked language modeling task guide"),qd.forEach(t),Id.forEach(t),Qr=f(X),Rn=r(X,"LI",{});var Nd=a(Rn);Et=r(Nd,"A",{href:!0});var Wd=a(Et);Dr=l(Wd,"Multiple choice task guide"),Wd.forEach(t),Nd.forEach(t),X.forEach(t),Vs=f(o),de=r(o,"H2",{class:!0});var lr=a(de);Ie=r(lr,"A",{id:!0,class:!0,href:!0});var Sd=a(Ie);$n=r(Sd,"SPAN",{});var Vd=a($n);T(zo.$$.fragment,Vd),Vd.forEach(t),Sd.forEach(t),Hr=f(lr),Jn=r(lr,"SPAN",{});var Ad=a(Jn);Yr=l(Ad,"RoCBertConfig"),Ad.forEach(t),lr.forEach(t),As=f(o),E=r(o,"DIV",{class:!0});var ho=a(E);T(Ro.$$.fragment,ho),Kr=f(ho),ce=r(ho,"P",{});var Dt=a(ce);ea=l(Dt,"This is the configuration class to store the configuration of a "),It=r(Dt,"A",{href:!0});var Zd=a(It);oa=l(Zd,"RoCBertModel"),Zd.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
`),$o=r(Dt,"A",{href:!0,rel:!0});var Pd=a($o);na=l(Pd,"weiweishi/roc-bert-base-zh"),Pd.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 Xd=a(qt);ia=l(Xd,"PretrainedConfig"),Xd.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 Ld=a(Nt);da=l(Ld,"PretrainedConfig"),Ld.forEach(t),ca=l(Ht," for more information."),Ht.forEach(t),pa=f(ho),T(qe.$$.fragment,ho),ho.forEach(t),Zs=f(o),he=r(o,"H2",{class:!0});var dr=a(he);Ne=r(dr,"A",{id:!0,class:!0,href:!0});var Gd=a(Ne);jn=r(Gd,"SPAN",{});var Od=a(jn);T(Jo.$$.fragment,Od),Od.forEach(t),Gd.forEach(t),ha=f(dr),Fn=r(dr,"SPAN",{});var Qd=a(Fn);ua=l(Qd,"RoCBertTokenizer"),Qd.forEach(t),dr.forEach(t),Ps=f(o),j=r(o,"DIV",{class:!0});var oe=a(j);T(jo.$$.fragment,oe),ma=f(oe),K=r(oe,"DIV",{class:!0});var Yt=a(K);T(Fo.$$.fragment,Yt),fa=f(Yt),Un=r(Yt,"P",{});var Dd=a(Un);ga=l(Dd,`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:`),Dd.forEach(t),_a=f(Yt),Uo=r(Yt,"UL",{});var cr=a(Uo);Wt=r(cr,"LI",{});var Cd=a(Wt);ba=l(Cd,"single sequence: "),xn=r(Cd,"CODE",{});var Hd=a(xn);ya=l(Hd,"[CLS] X [SEP]"),Hd.forEach(t),Cd.forEach(t),ka=f(cr),St=r(cr,"LI",{});var Bd=a(St);Ta=l(Bd,"pair of sequences: "),En=r(Bd,"CODE",{});var Yd=a(En);va=l(Yd,"[CLS] A [SEP] B [SEP]"),Yd.forEach(t),Bd.forEach(t),cr.forEach(t),Yt.forEach(t),wa=f(oe),We=r(oe,"DIV",{class:!0});var pr=a(We);T(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 Kd=a(In);Ba=l(Kd,"prepare_for_model"),Kd.forEach(t),za=l(hr," method."),hr.forEach(t),pr.forEach(t),Ra=f(oe),N=r(oe,"DIV",{class:!0});var uo=a(N);T(Io.$$.fragment,uo),$a=f(uo),qn=r(uo,"P",{});var ec=a(qn);Ja=l(ec,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. A BERT sequence"),ec.forEach(t),ja=f(uo),T(Se.$$.fragment,uo),Fa=f(uo),ue=r(uo,"P",{});var Kt=a(ue);Ua=l(Kt,"If "),Nn=r(Kt,"CODE",{});var oc=a(Nn);xa=l(oc,"token_ids_1"),oc.forEach(t),Ea=l(Kt," is "),Wn=r(Kt,"CODE",{});var tc=a(Wn);Ia=l(tc,"None"),tc.forEach(t),qa=l(Kt,", this method only returns the first portion of the mask (0s)."),Kt.forEach(t),uo.forEach(t),Na=f(oe),Vt=r(oe,"DIV",{class:!0});var nc=a(Vt);T(qo.$$.fragment,nc),nc.forEach(t),oe.forEach(t),Xs=f(o),me=r(o,"H2",{class:!0});var ur=a(me);Ve=r(ur,"A",{id:!0,class:!0,href:!0});var sc=a(Ve);Sn=r(sc,"SPAN",{});var rc=a(Sn);T(No.$$.fragment,rc),rc.forEach(t),sc.forEach(t),Wa=f(ur),Vn=r(ur,"SPAN",{});var ac=a(Vn);Sa=l(ac,"RoCBertModel"),ac.forEach(t),ur.forEach(t),Ls=f(o),F=r(o,"DIV",{class:!0});var te=a(F);T(Wo.$$.fragment,te),Va=f(te),So=r(te,"P",{});var mr=a(So);Aa=l(mr,`The bare RoCBert Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),Vo=r(mr,"A",{href:!0,rel:!0});var ic=a(Vo);Za=l(ic,"torch.nn.Module"),ic.forEach(t),Pa=l(mr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),mr.forEach(t),Xa=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 lc=a(Zo);Ga=l(lc,`Attention is
all you need`),lc.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),$=r(te,"P",{});var x=a($);Da=l(x,"To behave as an decoder the model needs to be initialized with the "),An=r(x,"CODE",{});var dc=a(An);Ha=l(dc,"is_decoder"),dc.forEach(t),Ya=l(x,` argument of the configuration set
to `),Zn=r(x,"CODE",{});var cc=a(Zn);Ka=l(cc,"True"),cc.forEach(t),ei=l(x,". To be used in a Seq2Seq model, the model needs to be initialized with both "),Pn=r(x,"CODE",{});var pc=a(Pn);oi=l(pc,"is_decoder"),pc.forEach(t),ti=l(x,` argument and
`),Xn=r(x,"CODE",{});var hc=a(Xn);ni=l(hc,"add_cross_attention"),hc.forEach(t),si=l(x," set to "),Ln=r(x,"CODE",{});var uc=a(Ln);ri=l(uc,"True"),uc.forEach(t),ai=l(x,"; an "),Gn=r(x,"CODE",{});var mc=a(Gn);ii=l(mc,"encoder_hidden_states"),mc.forEach(t),li=l(x," is then expected as an input to the forward pass."),x.forEach(t),di=f(te),W=r(te,"DIV",{class:!0});var mo=a(W);T(Po.$$.fragment,mo),ci=f(mo),fe=r(mo,"P",{});var en=a(fe);pi=l(en,"The "),At=r(en,"A",{href:!0});var fc=a(At);hi=l(fc,"RoCBertModel"),fc.forEach(t),ui=l(en," forward method, overrides the "),On=r(en,"CODE",{});var gc=a(On);mi=l(gc,"__call__"),gc.forEach(t),fi=l(en," special method."),en.forEach(t),gi=f(mo),T(Ae.$$.fragment,mo),_i=f(mo),T(Ze.$$.fragment,mo),mo.forEach(t),te.forEach(t),Gs=f(o),ge=r(o,"H2",{class:!0});var gr=a(ge);Pe=r(gr,"A",{id:!0,class:!0,href:!0});var _c=a(Pe);Qn=r(_c,"SPAN",{});var bc=a(Qn);T(Xo.$$.fragment,bc),bc.forEach(t),_c.forEach(t),bi=f(gr),Dn=r(gr,"SPAN",{});var yc=a(Dn);yi=l(yc,"RoCBertForPreTraining"),yc.forEach(t),gr.forEach(t),Os=f(o),I=r(o,"DIV",{class:!0});var fo=a(I);T(Lo.$$.fragment,fo),ki=f(fo),Hn=r(fo,"P",{});var kc=a(Hn);Ti=l(kc,"RoCBert Model with contrastive loss and masked_lm_loss during the pretraining."),kc.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 Tc=a(Oo);Mi=l(Tc,"torch.nn.Module"),Tc.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),S=r(fo,"DIV",{class:!0});var go=a(S);T(Qo.$$.fragment,go),zi=f(go),_e=r(go,"P",{});var on=a(_e);Ri=l(on,"The "),Zt=r(on,"A",{href:!0});var vc=a(Zt);$i=l(vc,"RoCBertForPreTraining"),vc.forEach(t),Ji=l(on," forward method, overrides the "),Yn=r(on,"CODE",{});var wc=a(Yn);ji=l(wc,"__call__"),wc.forEach(t),Fi=l(on," special method."),on.forEach(t),Ui=f(go),T(Xe.$$.fragment,go),xi=f(go),T(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 Mc=a(Ge);Kn=r(Mc,"SPAN",{});var Cc=a(Kn);T(Do.$$.fragment,Cc),Cc.forEach(t),Mc.forEach(t),Ei=f(br),es=r(br,"SPAN",{});var Bc=a(es);Ii=l(Bc,"RoCBertForCausalLM"),Bc.forEach(t),br.forEach(t),Ds=f(o),L=r(o,"DIV",{class:!0});var tn=a(L);T(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 zc=a(os);Wi=l(zc,"language modeling"),zc.forEach(t),Si=l(nn,` head on top for CLM fine-tuning.
This model is a PyTorch `),Yo=r(nn,"A",{href:!0,rel:!0});var Rc=a(Yo);Vi=l(Rc,"torch.nn.Module"),Rc.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);T(Ko.$$.fragment,_o),Pi=f(_o),ke=r(_o,"P",{});var sn=a(ke);Xi=l(sn,"The "),Pt=r(sn,"A",{href:!0});var $c=a(Pt);Li=l($c,"RoCBertForCausalLM"),$c.forEach(t),Gi=l(sn," forward method, overrides the "),ts=r(sn,"CODE",{});var Jc=a(ts);Oi=l(Jc,"__call__"),Jc.forEach(t),Qi=l(sn," special method."),sn.forEach(t),Di=f(_o),T(Oe.$$.fragment,_o),Hi=f(_o),T(Qe.$$.fragment,_o),_o.forEach(t),tn.forEach(t),Hs=f(o),Te=r(o,"H2",{class:!0});var yr=a(Te);De=r(yr,"A",{id:!0,class:!0,href:!0});var jc=a(De);ns=r(jc,"SPAN",{});var Fc=a(ns);T(et.$$.fragment,Fc),Fc.forEach(t),jc.forEach(t),Yi=f(yr),ss=r(yr,"SPAN",{});var Uc=a(ss);Ki=l(Uc,"RoCBertForMaskedLM"),Uc.forEach(t),yr.forEach(t),Ys=f(o),G=r(o,"DIV",{class:!0});var rn=a(G);T(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 xc=a(rs);tl=l(xc,"language modeling"),xc.forEach(t),nl=l(an,` head on top.
This model is a PyTorch `),tt=r(an,"A",{href:!0,rel:!0});var Ec=a(tt);sl=l(Ec,"torch.nn.Module"),Ec.forEach(t),rl=l(an,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),an.forEach(t),al=f(rn),ee=r(rn,"DIV",{class:!0});var ln=a(ee);T(nt.$$.fragment,ln),il=f(ln),we=r(ln,"P",{});var dn=a(we);ll=l(dn,"The "),Xt=r(dn,"A",{href:!0});var Ic=a(Xt);dl=l(Ic,"RoCBertForMaskedLM"),Ic.forEach(t),cl=l(dn," forward method, overrides the "),as=r(dn,"CODE",{});var qc=a(as);pl=l(qc,"__call__"),qc.forEach(t),hl=l(dn," special method."),dn.forEach(t),ul=f(ln),T(He.$$.fragment,ln),ln.forEach(t),rn.forEach(t),Ks=f(o),Me=r(o,"H2",{class:!0});var kr=a(Me);Ye=r(kr,"A",{id:!0,class:!0,href:!0});var Nc=a(Ye);is=r(Nc,"SPAN",{});var Wc=a(is);T(st.$$.fragment,Wc),Wc.forEach(t),Nc.forEach(t),ml=f(kr),ls=r(kr,"SPAN",{});var Sc=a(ls);fl=l(Sc,"RoCBertForSequenceClassification"),Sc.forEach(t),kr.forEach(t),er=f(o),O=r(o,"DIV",{class:!0});var cn=a(O);T(rt.$$.fragment,cn),gl=f(cn),at=r(cn,"P",{});var Tr=a(at);_l=l(Tr,`RoCBert Model transformer with a sequence classification/regression head on top (a linear layer on top of
the pooled output) e.g. for GLUE tasks.
This model is a PyTorch `),it=r(Tr,"A",{href:!0,rel:!0});var Vc=a(it);bl=l(Vc,"torch.nn.Module"),Vc.forEach(t),yl=l(Tr,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Tr.forEach(t),kl=f(cn),U=r(cn,"DIV",{class:!0});var ne=a(U);T(lt.$$.fragment,ne),Tl=f(ne),Ce=r(ne,"P",{});var pn=a(Ce);vl=l(pn,"The "),Lt=r(pn,"A",{href:!0});var Ac=a(Lt);wl=l(Ac,"RoCBertForSequenceClassification"),Ac.forEach(t),Ml=l(pn," forward method, overrides the "),ds=r(pn,"CODE",{});var Zc=a(ds);Cl=l(Zc,"__call__"),Zc.forEach(t),Bl=l(pn," special method."),pn.forEach(t),zl=f(ne),T(Ke.$$.fragment,ne),Rl=f(ne),T(eo.$$.fragment,ne),$l=f(ne),T(oo.$$.fragment,ne),ne.forEach(t),cn.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 Pc=a(to);cs=r(Pc,"SPAN",{});var Xc=a(cs);T(dt.$$.fragment,Xc),Xc.forEach(t),Pc.forEach(t),Jl=f(vr),ps=r(vr,"SPAN",{});var Lc=a(ps);jl=l(Lc,"RoCBertForMultipleChoice"),Lc.forEach(t),vr.forEach(t),tr=f(o),Q=r(o,"DIV",{class:!0});var hn=a(Q);T(ct.$$.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 Gc=a(ht);xl=l(Gc,"torch.nn.Module"),Gc.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);T(ut.$$.fragment,bo),ql=f(bo),ze=r(bo,"P",{});var un=a(ze);Nl=l(un,"The "),Gt=r(un,"A",{href:!0});var Oc=a(Gt);Wl=l(Oc,"RoCBertForMultipleChoice"),Oc.forEach(t),Sl=l(un," forward method, overrides the "),hs=r(un,"CODE",{});var Qc=a(hs);Vl=l(Qc,"__call__"),Qc.forEach(t),Al=l(un," special method."),un.forEach(t),Zl=f(bo),T(no.$$.fragment,bo),Pl=f(bo),T(so.$$.fragment,bo),bo.forEach(t),hn.forEach(t),nr=f(o),Re=r(o,"H2",{class:!0});var Mr=a(Re);ro=r(Mr,"A",{id:!0,class:!0,href:!0});var Dc=a(ro);us=r(Dc,"SPAN",{});var Hc=a(us);T(mt.$$.fragment,Hc),Hc.forEach(t),Dc.forEach(t),Xl=f(Mr),ms=r(Mr,"SPAN",{});var Yc=a(ms);Ll=l(Yc,"RoCBertForTokenClassification"),Yc.forEach(t),Mr.forEach(t),sr=f(o),D=r(o,"DIV",{class:!0});var mn=a(D);T(ft.$$.fragment,mn),Gl=f(mn),gt=r(mn,"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 Kc=a(_t);Ql=l(Kc,"torch.nn.Module"),Kc.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(mn),Z=r(mn,"DIV",{class:!0});var yo=a(Z);T(bt.$$.fragment,yo),Yl=f(yo),$e=r(yo,"P",{});var fn=a($e);Kl=l(fn,"The "),Ot=r(fn,"A",{href:!0});var ep=a(Ot);ed=l(ep,"RoCBertForTokenClassification"),ep.forEach(t),od=l(fn," forward method, overrides the "),fs=r(fn,"CODE",{});var op=a(fs);td=l(op,"__call__"),op.forEach(t),nd=l(fn," special method."),fn.forEach(t),sd=f(yo),T(ao.$$.fragment,yo),rd=f(yo),T(io.$$.fragment,yo),yo.forEach(t),mn.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);T(yt.$$.fragment,np),np.forEach(t),tp.forEach(t),ad=f(Br),_s=r(Br,"SPAN",{});var sp=a(_s);id=l(sp,"RoCBertForQuestionAnswering"),sp.forEach(t),Br.forEach(t),ar=f(o),H=r(o,"DIV",{class:!0});var gn=a(H);T(kt.$$.fragment,gn),ld=f(gn),Y=r(gn,"P",{});var ko=a(Y);dd=l(ko,`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(ko,"CODE",{});var rp=a(bs);cd=l(rp,"span start logits"),rp.forEach(t),pd=l(ko," and "),ys=r(ko,"CODE",{});var ap=a(ys);hd=l(ap,"span end logits"),ap.forEach(t),ud=l(ko,`).
This model is a PyTorch `),Tt=r(ko,"A",{href:!0,rel:!0});var ip=a(Tt);md=l(ip,"torch.nn.Module"),ip.forEach(t),fd=l(ko,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),ko.forEach(t),gd=f(gn),P=r(gn,"DIV",{class:!0});var To=a(P);T(vt.$$.fragment,To),_d=f(To),je=r(To,"P",{});var _n=a(je);bd=l(_n,"The "),Qt=r(_n,"A",{href:!0});var lp=a(Qt);yd=l(lp,"RoCBertForQuestionAnswering"),lp.forEach(t),kd=l(_n," forward method, overrides the "),ks=r(_n,"CODE",{});var dp=a(ks);Td=l(dp,"__call__"),dp.forEach(t),vd=l(_n," special method."),_n.forEach(t),wd=f(To),T(co.$$.fragment,To),Md=f(To),T(po.$$.fragment,To),To.forEach(t),gn.forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(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(u,"class","relative group"),p(Fe,"id","overview"),p(Fe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Fe,"href","#overview"),p(ie,"class","relative group"),p(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(de,"class","relative group"),p(It,"href","/docs/transformers/v4.33.0/en/model_doc/roc_bert#transformers.RoCBertModel"),p($o,"href","https://huggingface.co/weiweishi/roc-bert-base-zh"),p($o,"rel","nofollow"),p(qt,"href","/docs/transformers/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),p(Nt,"href","/docs/transformers/v4.33.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(We,"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(me,"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.33.0/en/model_doc/roc_bert#transformers.RoCBertModel"),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(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(Pe,"id","transformers.RoCBertForPreTraining"),p(Pe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Pe,"href","#transformers.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.33.0/en/model_doc/roc_bert#transformers.RoCBertForPreTraining"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(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(Pt,"href","/docs/transformers/v4.33.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(Te,"class","relative group"),p(tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(tt,"rel","nofollow"),p(Xt,"href","/docs/transformers/v4.33.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.33.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.33.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(Re,"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.33.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(Tt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Tt,"rel","nofollow"),p(Qt,"href","/docs/transformers/v4.33.0/en/model_doc/roc_bert#transformers.RoCBertForQuestionAnswering"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(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,d),b(o,y,g),b(o,u,g),e(u,h),e(h,_),v(n,_,null),e(u,c),e(u,z),e(z,zr),b(o,xs,g),b(o,ie,g),e(ie,Fe),e(Fe,bn),v(wo,bn,null),e(ie,Rr),e(ie,yn),e(yn,$r),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,Rt,g),e(Rt,Ur),b(o,qs,g),b(o,$t,g),e($t,kn),e(kn,xr),b(o,Ns,g),b(o,xe,g),e(xe,Er),e(xe,Co),e(Co,Ir),e(xe,qr),b(o,Ws,g),b(o,le,g),e(le,Ee),e(Ee,Tn),v(Bo,Tn,null),e(le,Nr),e(le,vn),e(vn,Wr),b(o,Ss,g),b(o,J,g),e(J,wn),e(wn,Jt),e(Jt,Sr),e(J,Vr),e(J,Mn),e(Mn,jt),e(jt,Ar),e(J,Zr),e(J,Cn),e(Cn,Ft),e(Ft,Pr),e(J,Xr),e(J,Bn),e(Bn,Ut),e(Ut,Lr),e(J,Gr),e(J,zn),e(zn,xt),e(xt,Or),e(J,Qr),e(J,Rn),e(Rn,Et),e(Et,Dr),b(o,Vs,g),b(o,de,g),e(de,Ie),e(Ie,$n),v(zo,$n,null),e(de,Hr),e(de,Jn),e(Jn,Yr),b(o,As,g),b(o,E,g),v(Ro,E,null),e(E,Kr),e(E,ce),e(ce,ea),e(ce,It),e(It,oa),e(ce,ta),e(ce,$o),e($o,na),e(ce,sa),e(E,ra),e(E,pe),e(pe,aa),e(pe,qt),e(qt,ia),e(pe,la),e(pe,Nt),e(Nt,da),e(pe,ca),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,ua),b(o,Ps,g),b(o,j,g),v(jo,j,null),e(j,ma),e(j,K),v(Fo,K,null),e(K,fa),e(K,Un),e(Un,ga),e(K,_a),e(K,Uo),e(Uo,Wt),e(Wt,ba),e(Wt,xn),e(xn,ya),e(Uo,ka),e(Uo,St),e(St,Ta),e(St,En),e(En,va),e(j,wa),e(j,We),v(xo,We,null),e(We,Ma),e(We,Eo),e(Eo,Ca),e(Eo,In),e(In,Ba),e(Eo,za),e(j,Ra),e(j,N),v(Io,N,null),e(N,$a),e(N,qn),e(qn,Ja),e(N,ja),v(Se,N,null),e(N,Fa),e(N,ue),e(ue,Ua),e(ue,Nn),e(Nn,xa),e(ue,Ea),e(ue,Wn),e(Wn,Ia),e(ue,qa),e(j,Na),e(j,Vt),v(qo,Vt,null),b(o,Xs,g),b(o,me,g),e(me,Ve),e(Ve,Sn),v(No,Sn,null),e(me,Wa),e(me,Vn),e(Vn,Sa),b(o,Ls,g),b(o,F,g),v(Wo,F,null),e(F,Va),e(F,So),e(So,Aa),e(So,Vo),e(Vo,Za),e(So,Pa),e(F,Xa),e(F,Ao),e(Ao,La),e(Ao,Zo),e(Zo,Ga),e(Ao,Oa),e(F,Qa),e(F,$),e($,Da),e($,An),e(An,Ha),e($,Ya),e($,Zn),e(Zn,Ka),e($,ei),e($,Pn),e(Pn,oi),e($,ti),e($,Xn),e(Xn,ni),e($,si),e($,Ln),e(Ln,ri),e($,ai),e($,Gn),e(Gn,ii),e($,li),e(F,di),e(F,W),v(Po,W,null),e(W,ci),e(W,fe),e(fe,pi),e(fe,At),e(At,hi),e(fe,ui),e(fe,On),e(On,mi),e(fe,fi),e(W,gi),v(Ae,W,null),e(W,_i),v(Ze,W,null),b(o,Gs,g),b(o,ge,g),e(ge,Pe),e(Pe,Qn),v(Xo,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,ki),e(I,Hn),e(Hn,Ti),e(I,vi),e(I,Go),e(Go,wi),e(Go,Oo),e(Oo,Mi),e(Go,Ci),e(I,Bi),e(I,S),v(Qo,S,null),e(S,zi),e(S,_e),e(_e,Ri),e(_e,Zt),e(Zt,$i),e(_e,Ji),e(_e,Yn),e(Yn,ji),e(_e,Fi),e(S,Ui),v(Xe,S,null),e(S,xi),v(Le,S,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,Wi),e(ye,Si),e(ye,Yo),e(Yo,Vi),e(ye,Ai),e(L,Zi),e(L,V),v(Ko,V,null),e(V,Pi),e(V,ke),e(ke,Xi),e(ke,Pt),e(Pt,Li),e(ke,Gi),e(ke,ts),e(ts,Oi),e(ke,Qi),e(V,Di),v(Oe,V,null),e(V,Hi),v(Qe,V,null),b(o,Hs,g),b(o,Te,g),e(Te,De),e(De,ns),v(et,ns,null),e(Te,Yi),e(Te,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,Xt),e(Xt,dl),e(we,cl),e(we,as),e(as,pl),e(we,hl),e(ee,ul),v(He,ee,null),b(o,Ks,g),b(o,Me,g),e(Me,Ye),e(Ye,is),v(st,is,null),e(Me,ml),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,kl),e(O,U),v(lt,U,null),e(U,Tl),e(U,Ce),e(Ce,vl),e(Ce,Lt),e(Lt,wl),e(Ce,Ml),e(Ce,ds),e(ds,Cl),e(Ce,Bl),e(U,zl),v(Ke,U,null),e(U,Rl),v(eo,U,null),e(U,$l),v(oo,U,null),b(o,or,g),b(o,Be,g),e(Be,to),e(to,cs),v(dt,cs,null),e(Be,Jl),e(Be,ps),e(ps,jl),b(o,tr,g),b(o,Q,g),v(ct,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(ut,A,null),e(A,ql),e(A,ze),e(ze,Nl),e(ze,Gt),e(Gt,Wl),e(ze,Sl),e(ze,hs),e(hs,Vl),e(ze,Al),e(A,Zl),v(no,A,null),e(A,Pl),v(so,A,null),b(o,nr,g),b(o,Re,g),e(Re,ro),e(ro,us),v(mt,us,null),e(Re,Xl),e(Re,ms),e(ms,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,$e),e($e,Kl),e($e,Ot),e(Ot,ed),e($e,od),e($e,fs),e(fs,td),e($e,nd),e(Z,sd),v(ao,Z,null),e(Z,rd),v(io,Z,null),b(o,rr,g),b(o,Je,g),e(Je,lo),e(lo,gs),v(yt,gs,null),e(Je,ad),e(Je,_s),e(_s,id),b(o,ar,g),b(o,H,g),v(kt,H,null),e(H,ld),e(H,Y),e(Y,dd),e(Y,bs),e(bs,cd),e(Y,pd),e(Y,ys),e(ys,hd),e(Y,ud),e(Y,Tt),e(Tt,md),e(Y,fd),e(H,gd),e(H,P),v(vt,P,null),e(P,_d),e(P,je),e(je,bd),e(je,Qt),e(Qt,yd),e(je,kd),e(je,ks),e(ks,Td),e(je,vd),e(P,wd),v(co,P,null),e(P,Md),v(po,P,null),ir=!0},p(o,[g]){const wt={};g&2&&(wt.$$scope={dirty:g,ctx:o}),qe.$set(wt);const Ts={};g&2&&(Ts.$$scope={dirty:g,ctx:o}),Se.$set(Ts);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}),Xe.$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 zs={};g&2&&(zs.$$scope={dirty:g,ctx:o}),Ke.$set(zs);const Rs={};g&2&&(Rs.$$scope={dirty:g,ctx:o}),eo.$set(Rs);const $s={};g&2&&($s.$$scope={dirty:g,ctx:o}),oo.$set($s);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 zt={};g&2&&(zt.$$scope={dirty:g,ctx:o}),io.$set(zt);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(zo.$$.fragment,o),w(Ro.$$.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(Se.$$.fragment,o),w(qo.$$.fragment,o),w(No.$$.fragment,o),w(Wo.$$.fragment,o),w(Po.$$.fragment,o),w(Ae.$$.fragment,o),w(Ze.$$.fragment,o),w(Xo.$$.fragment,o),w(Lo.$$.fragment,o),w(Qo.$$.fragment,o),w(Xe.$$.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(dt.$$.fragment,o),w(ct.$$.fragment,o),w(ut.$$.fragment,o),w(no.$$.fragment,o),w(so.$$.fragment,o),w(mt.$$.fragment,o),w(ft.$$.fragment,o),w(bt.$$.fragment,o),w(ao.$$.fragment,o),w(io.$$.fragment,o),w(yt.$$.fragment,o),w(kt.$$.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(zo.$$.fragment,o),M(Ro.$$.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(Se.$$.fragment,o),M(qo.$$.fragment,o),M(No.$$.fragment,o),M(Wo.$$.fragment,o),M(Po.$$.fragment,o),M(Ae.$$.fragment,o),M(Ze.$$.fragment,o),M(Xo.$$.fragment,o),M(Lo.$$.fragment,o),M(Qo.$$.fragment,o),M(Xe.$$.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(dt.$$.fragment,o),M(ct.$$.fragment,o),M(ut.$$.fragment,o),M(no.$$.fragment,o),M(so.$$.fragment,o),M(mt.$$.fragment,o),M(ft.$$.fragment,o),M(bt.$$.fragment,o),M(ao.$$.fragment,o),M(io.$$.fragment,o),M(yt.$$.fragment,o),M(kt.$$.fragment,o),M(vt.$$.fragment,o),M(co.$$.fragment,o),M(po.$$.fragment,o),ir=!1},d(o){t(d),o&&t(y),o&&t(u),C(n),o&&t(xs),o&&t(ie),C(wo),o&&t(Es),o&&t(Ue),o&&t(Is),o&&t(Rt),o&&t(qs),o&&t($t),o&&t(Ns),o&&t(xe),o&&t(Ws),o&&t(le),C(Bo),o&&t(Ss),o&&t(J),o&&t(Vs),o&&t(de),C(zo),o&&t(As),o&&t(E),C(Ro),C(qe),o&&t(Zs),o&&t(he),C(Jo),o&&t(Ps),o&&t(j),C(jo),C(Fo),C(xo),C(Io),C(Se),C(qo),o&&t(Xs),o&&t(me),C(No),o&&t(Ls),o&&t(F),C(Wo),C(Po),C(Ae),C(Ze),o&&t(Gs),o&&t(ge),C(Xo),o&&t(Os),o&&t(I),C(Lo),C(Qo),C(Xe),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(Te),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(dt),o&&t(tr),o&&t(Q),C(ct),C(ut),C(no),C(so),o&&t(nr),o&&t(Re),C(mt),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(kt),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 mp(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ap extends cp{constructor(d){super();pp(this,d,Ep,Up,hp,{})}}export{Ap as default,xp as metadata};
