import{s as hn,o as fn,n as X}from"../chunks/scheduler.18a86fab.js";import{S as un,i as gn,g as d,s as a,r as f,A as _n,h as c,f as t,c as r,j as E,u,x as h,k as B,y as l,a as i,v as g,d as _,t as b,w as y}from"../chunks/index.98837b22.js";import{T as Ho}from"../chunks/Tip.77304350.js";import{D as Q}from"../chunks/Docstring.6758ea23.js";import{C as Ge}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as ho}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H}from"../chunks/Heading.7e7e0c5b.js";import{E as bn}from"../chunks/index.92f616ba.js";function yn(w){let n,k="Examples:",p,m,T;return m=new Ge({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEJyb3NDb25maWclMkMlMjBCcm9zTW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwQlJPUyUyMGppbmhvODM0NSUyRmJyb3MtYmFzZS11bmNhc2VkJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMEJyb3NDb25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBqaW5obzgzNDUlMkZicm9zLWJhc2UtdW5jYXNlZCUyMHN0eWxlJTIwY29uZmlndXJhdGlvbiUwQW1vZGVsJTIwJTNEJTIwQnJvc01vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> BrosConfig, BrosModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a BROS jinho8345/bros-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = BrosConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the jinho8345/bros-base-uncased style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = BrosModel(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`,wrap:!1}}),{c(){n=d("p"),n.textContent=k,p=a(),f(m.$$.fragment)},l(s){n=c(s,"P",{"data-svelte-h":!0}),h(n)!=="svelte-kvfsh7"&&(n.textContent=k),p=r(s),u(m.$$.fragment,s)},m(s,M){i(s,n,M),i(s,p,M),g(m,s,M),T=!0},p:X,i(s){T||(_(m.$$.fragment,s),T=!0)},o(s){b(m.$$.fragment,s),T=!1},d(s){s&&(t(n),t(p)),y(m,s)}}}function Tn(w){let n,k=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=d("p"),n.innerHTML=k},l(p){n=c(p,"P",{"data-svelte-h":!0}),h(n)!=="svelte-fincs2"&&(n.innerHTML=k)},m(p,m){i(p,n,m)},p:X,d(p){p&&t(n)}}}function kn(w){let n,k="Examples:",p,m,T;return m=new Ge({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQnJvc1Byb2Nlc3NvciUyQyUyMEJyb3NNb2RlbCUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEJyb3NQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmppbmhvODM0NSUyRmJyb3MtYmFzZS11bmNhc2VkJTIyKSUwQSUwQW1vZGVsJTIwJTNEJTIwQnJvc01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJqaW5obzgzNDUlMkZicm9zLWJhc2UtdW5jYXNlZCUyMiklMEElMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQWJib3glMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCJTVCJTVCMCUyQyUyMDAlMkMlMjAxJTJDJTIwMSU1RCU1RCU1RCkucmVwZWF0KDElMkMlMjBlbmNvZGluZyU1QiUyMmlucHV0X2lkcyUyMiU1RC5zaGFwZSU1Qi0xJTVEJTJDJTIwMSklMEFlbmNvZGluZyU1QiUyMmJib3glMjIlNUQlMjAlM0QlMjBiYm94JTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmcpJTBBbGFzdF9oaWRkZW5fc3RhdGVzJTIwJTNEJTIwb3V0cHV0cy5sYXN0X2hpZGRlbl9zdGF0ZQ==",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> BrosProcessor, BrosModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BrosProcessor.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BrosModel.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(<span class="hljs-string">&quot;Hello, my dog is cute&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">&gt;&gt;&gt; </span>bbox = torch.tensor([[[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]]]).repeat(<span class="hljs-number">1</span>, encoding[<span class="hljs-string">&quot;input_ids&quot;</span>].shape[-<span class="hljs-number">1</span>], <span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding[<span class="hljs-string">&quot;bbox&quot;</span>] = bbox

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`,wrap:!1}}),{c(){n=d("p"),n.textContent=k,p=a(),f(m.$$.fragment)},l(s){n=c(s,"P",{"data-svelte-h":!0}),h(n)!=="svelte-kvfsh7"&&(n.textContent=k),p=r(s),u(m.$$.fragment,s)},m(s,M){i(s,n,M),i(s,p,M),g(m,s,M),T=!0},p:X,i(s){T||(_(m.$$.fragment,s),T=!0)},o(s){b(m.$$.fragment,s),T=!1},d(s){s&&(t(n),t(p)),y(m,s)}}}function Mn(w){let n,k=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=d("p"),n.innerHTML=k},l(p){n=c(p,"P",{"data-svelte-h":!0}),h(n)!=="svelte-fincs2"&&(n.innerHTML=k)},m(p,m){i(p,n,m)},p:X,d(p){p&&t(n)}}}function wn(w){let n,k="Examples:",p,m,T;return m=new Ge({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQnJvc1Byb2Nlc3NvciUyQyUyMEJyb3NGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQnJvc1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIyamluaG84MzQ1JTJGYnJvcy1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBbW9kZWwlMjAlM0QlMjBCcm9zRm9yVG9rZW5DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIyamluaG84MzQ1JTJGYnJvcy1iYXNlLXVuY2FzZWQlMjIpJTBBJTBBZW5jb2RpbmclMjAlM0QlMjBwcm9jZXNzb3IoJTIySGVsbG8lMkMlMjBteSUyMGRvZyUyMGlzJTIwY3V0ZSUyMiUyQyUyMGFkZF9zcGVjaWFsX3Rva2VucyUzREZhbHNlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFiYm94JTIwJTNEJTIwdG9yY2gudGVuc29yKCU1QiU1QiU1QjAlMkMlMjAwJTJDJTIwMSUyQyUyMDElNUQlNUQlNUQpLnJlcGVhdCgxJTJDJTIwZW5jb2RpbmclNUIlMjJpbnB1dF9pZHMlMjIlNUQuc2hhcGUlNUItMSU1RCUyQyUyMDEpJTBBZW5jb2RpbmclNUIlMjJiYm94JTIyJTVEJTIwJTNEJTIwYmJveCUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmVuY29kaW5nKQ==",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> BrosProcessor, BrosForTokenClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BrosProcessor.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BrosForTokenClassification.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(<span class="hljs-string">&quot;Hello, my dog is cute&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">&gt;&gt;&gt; </span>bbox = torch.tensor([[[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]]]).repeat(<span class="hljs-number">1</span>, encoding[<span class="hljs-string">&quot;input_ids&quot;</span>].shape[-<span class="hljs-number">1</span>], <span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding[<span class="hljs-string">&quot;bbox&quot;</span>] = bbox

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)`,wrap:!1}}),{c(){n=d("p"),n.textContent=k,p=a(),f(m.$$.fragment)},l(s){n=c(s,"P",{"data-svelte-h":!0}),h(n)!=="svelte-kvfsh7"&&(n.textContent=k),p=r(s),u(m.$$.fragment,s)},m(s,M){i(s,n,M),i(s,p,M),g(m,s,M),T=!0},p:X,i(s){T||(_(m.$$.fragment,s),T=!0)},o(s){b(m.$$.fragment,s),T=!1},d(s){s&&(t(n),t(p)),y(m,s)}}}function vn(w){let n,k=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=d("p"),n.innerHTML=k},l(p){n=c(p,"P",{"data-svelte-h":!0}),h(n)!=="svelte-fincs2"&&(n.innerHTML=k)},m(p,m){i(p,n,m)},p:X,d(p){p&&t(n)}}}function xn(w){let n,k="Examples:",p,m,T;return m=new Ge({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQnJvc1Byb2Nlc3NvciUyQyUyMEJyb3NTcGFkZUVFRm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEJyb3NQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmppbmhvODM0NSUyRmJyb3MtYmFzZS11bmNhc2VkJTIyKSUwQSUwQW1vZGVsJTIwJTNEJTIwQnJvc1NwYWRlRUVGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJqaW5obzgzNDUlMkZicm9zLWJhc2UtdW5jYXNlZCUyMiklMEElMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQWJib3glMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCJTVCJTVCMCUyQyUyMDAlMkMlMjAxJTJDJTIwMSU1RCU1RCU1RCkucmVwZWF0KDElMkMlMjBlbmNvZGluZyU1QiUyMmlucHV0X2lkcyUyMiU1RC5zaGFwZSU1Qi0xJTVEJTJDJTIwMSklMEFlbmNvZGluZyU1QiUyMmJib3glMjIlNUQlMjAlM0QlMjBiYm94JTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2Rpbmcp",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> BrosProcessor, BrosSpadeEEForTokenClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BrosProcessor.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BrosSpadeEEForTokenClassification.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(<span class="hljs-string">&quot;Hello, my dog is cute&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">&gt;&gt;&gt; </span>bbox = torch.tensor([[[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]]]).repeat(<span class="hljs-number">1</span>, encoding[<span class="hljs-string">&quot;input_ids&quot;</span>].shape[-<span class="hljs-number">1</span>], <span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding[<span class="hljs-string">&quot;bbox&quot;</span>] = bbox

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)`,wrap:!1}}),{c(){n=d("p"),n.textContent=k,p=a(),f(m.$$.fragment)},l(s){n=c(s,"P",{"data-svelte-h":!0}),h(n)!=="svelte-kvfsh7"&&(n.textContent=k),p=r(s),u(m.$$.fragment,s)},m(s,M){i(s,n,M),i(s,p,M),g(m,s,M),T=!0},p:X,i(s){T||(_(m.$$.fragment,s),T=!0)},o(s){b(m.$$.fragment,s),T=!1},d(s){s&&(t(n),t(p)),y(m,s)}}}function Cn(w){let n,k=`Although the recipe for forward pass needs to be defined within this function, one should call the <code>Module</code>
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`;return{c(){n=d("p"),n.innerHTML=k},l(p){n=c(p,"P",{"data-svelte-h":!0}),h(n)!=="svelte-fincs2"&&(n.innerHTML=k)},m(p,m){i(p,n,m)},p:X,d(p){p&&t(n)}}}function $n(w){let n,k="Examples:",p,m,T;return m=new Ge({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQnJvc1Byb2Nlc3NvciUyQyUyMEJyb3NTcGFkZUVMRm9yVG9rZW5DbGFzc2lmaWNhdGlvbiUwQSUwQXByb2Nlc3NvciUyMCUzRCUyMEJyb3NQcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMmppbmhvODM0NSUyRmJyb3MtYmFzZS11bmNhc2VkJTIyKSUwQSUwQW1vZGVsJTIwJTNEJTIwQnJvc1NwYWRlRUxGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJqaW5obzgzNDUlMkZicm9zLWJhc2UtdW5jYXNlZCUyMiklMEElMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvciglMjJIZWxsbyUyQyUyMG15JTIwZG9nJTIwaXMlMjBjdXRlJTIyJTJDJTIwYWRkX3NwZWNpYWxfdG9rZW5zJTNERmFsc2UlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQWJib3glMjAlM0QlMjB0b3JjaC50ZW5zb3IoJTVCJTVCJTVCMCUyQyUyMDAlMkMlMjAxJTJDJTIwMSU1RCU1RCU1RCkucmVwZWF0KDElMkMlMjBlbmNvZGluZyU1QiUyMmlucHV0X2lkcyUyMiU1RC5zaGFwZSU1Qi0xJTVEJTJDJTIwMSklMEFlbmNvZGluZyU1QiUyMmJib3glMjIlNUQlMjAlM0QlMjBiYm94JTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2Rpbmcp",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> BrosProcessor, BrosSpadeELForTokenClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = BrosProcessor.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>model = BrosSpadeELForTokenClassification.from_pretrained(<span class="hljs-string">&quot;jinho8345/bros-base-uncased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(<span class="hljs-string">&quot;Hello, my dog is cute&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">&gt;&gt;&gt; </span>bbox = torch.tensor([[[<span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>]]]).repeat(<span class="hljs-number">1</span>, encoding[<span class="hljs-string">&quot;input_ids&quot;</span>].shape[-<span class="hljs-number">1</span>], <span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding[<span class="hljs-string">&quot;bbox&quot;</span>] = bbox

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)`,wrap:!1}}),{c(){n=d("p"),n.textContent=k,p=a(),f(m.$$.fragment)},l(s){n=c(s,"P",{"data-svelte-h":!0}),h(n)!=="svelte-kvfsh7"&&(n.textContent=k),p=r(s),u(m.$$.fragment,s)},m(s,M){i(s,n,M),i(s,p,M),g(m,s,M),T=!0},p:X,i(s){T||(_(m.$$.fragment,s),T=!0)},o(s){b(m.$$.fragment,s),T=!1},d(s){s&&(t(n),t(p)),y(m,s)}}}function Bn(w){let n,k,p,m,T,s,M,jt='<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/>',fo,re,uo,ie,Jt='The BROS model was proposed in <a href="https://arxiv.org/abs/2108.04539" rel="nofollow">BROS: A Pre-trained Language Model Focusing on Text and Layout for Better Key Information Extraction from Documents</a> by Teakgyu Hong, Donghyun Kim, Mingi Ji, Wonseok Hwang, Daehyun Nam, Sungrae Park.',go,le,zt="BROS stands for <em>BERT Relying On Spatiality</em>. It is an encoder-only Transformer model that takes a sequence of tokens and their bounding boxes as inputs and outputs a sequence of hidden states. BROS encode relative spatial information instead of using absolute spatial information.",_o,de,Ft=`It is pre-trained with two objectives: a token-masked language modeling objective (TMLM) used in BERT, and a novel area-masked language modeling objective (AMLM)
In TMLM, tokens are randomly masked, and the model predicts the masked tokens using spatial information and other unmasked tokens.
AMLM is a 2D version of TMLM. It randomly masks text tokens and predicts with the same information as TMLM, but it masks text blocks (areas).`,bo,ce,Et=`<code>BrosForTokenClassification</code> has a simple linear layer on top of BrosModel. It predicts the label of each token.
<code>BrosSpadeEEForTokenClassification</code> has an <code>initial_token_classifier</code> and <code>subsequent_token_classifier</code> on top of BrosModel. <code>initial_token_classifier</code> is used to predict the first token of each entity, and <code>subsequent_token_classifier</code> is used to predict the next token of within entity. <code>BrosSpadeELForTokenClassification</code> has an <code>entity_linker</code> on top of BrosModel. <code>entity_linker</code> is used to predict the relation between two entities.`,yo,pe,Nt="<code>BrosForTokenClassification</code> and <code>BrosSpadeEEForTokenClassification</code> essentially perform the same job. However, <code>BrosForTokenClassification</code> assumes input tokens are perfectly serialized (which is very challenging task since they exist in a 2D space), while <code>BrosSpadeEEForTokenClassification</code> allows for more flexibility in handling serialization errors as it predicts next connection tokens from one token.",To,me,It="<code>BrosSpadeELForTokenClassification</code> perform the intra-entity linking task. It predicts relation from one token (of one entity) to another token (of another entity) if these two entities share some relation.",ko,he,St="BROS achieves comparable or better result on Key Information Extraction (KIE) benchmarks such as FUNSD, SROIE, CORD and SciTSR, without relying on explicit visual features.",Mo,fe,Zt="The abstract from the paper is the following:",wo,ue,Wt="<em>Key information extraction (KIE) from document images requires understanding the contextual and spatial semantics of texts in two-dimensional (2D) space. Many recent studies try to solve the task by developing pre-trained language models focusing on combining visual features from document images with texts and their layout. On the other hand, this paper tackles the problem by going back to the basic: effective combination of text and layout. Specifically, we propose a pre-trained language model, named BROS (BERT Relying On Spatiality), that encodes relative positions of texts in 2D space and learns from unlabeled documents with area-masking strategy. With this optimized training scheme for understanding texts in 2D space, BROS shows comparable or better performance compared to previous methods on four KIE benchmarks (FUNSD, SROIE</em>, CORD, and SciTSR) without relying on visual features. This paper also reveals two real-world challenges in KIE tasks-(1) minimizing the error from incorrect text ordering and (2) efficient learning from fewer downstream examples-and demonstrates the superiority of BROS over previous methods.*",vo,ge,qt='This model was contributed by <a href="https://huggingface.co/jinho8345" rel="nofollow">jinho8345</a>. The original code can be found <a href="https://github.com/clovaai/bros" rel="nofollow">here</a>.',xo,_e,Co,be,Rt='<li><a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosModel.forward">forward()</a> requires <code>input_ids</code> and <code>bbox</code> (bounding box). Each bounding box should be in (x0, y0, x1, y1) format (top-left corner, bottom-right corner). Obtaining of Bounding boxes depends on external OCR system. The <code>x</code> coordinate should be normalized by document image width, and the <code>y</code> coordinate should be normalized by document image height.</li>',$o,ye,Bo,Te,Gt="<li>[<code>~transformers.BrosForTokenClassification.forward</code>, <code>~transformers.BrosSpadeEEForTokenClassification.forward</code>, <code>~transformers.BrosSpadeEEForTokenClassification.forward</code>] require not only <code>input_ids</code> and <code>bbox</code> but also <code>box_first_token_mask</code> for loss calculation. It is a mask to filter out non-first tokens of each box. You can obtain this mask by saving start token indices of bounding boxes when creating <code>input_ids</code> from words. You can make <code>box_first_token_mask</code> with following code,</li>",Uo,ke,jo,Me,Jo,we,Lt='<li>Demo scripts can be found <a href="https://github.com/clovaai/bros" rel="nofollow">here</a>.</li>',zo,ve,Fo,U,xe,Oo,Le,Qt=`This is the configuration class to store the configuration of a <a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosModel">BrosModel</a> or a <code>TFBrosModel</code>. It is used to
instantiate a Bros 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 Bros
<a href="https://huggingface.co/jinho8345/bros-base-uncased" rel="nofollow">jinho8345/bros-base-uncased</a> architecture.`,Xo,Qe,Pt=`Configuration objects inherit from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> and can be used to control the model outputs. Read the
documentation from <a href="/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig">PretrainedConfig</a> for more information.`,Do,D,Eo,Ce,No,j,$e,Ao,Pe,Vt="Constructs a Bros processor which wraps a BERT tokenizer.",Yo,Ve,Ht=`<a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosProcessor">BrosProcessor</a> offers all the functionalities of <a href="/docs/transformers/main/en/model_doc/bert#transformers.BertTokenizerFast">BertTokenizerFast</a>. See the docstring of
<a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosProcessor.__call__"><strong>call</strong>()</a> and <code>decode()</code> for more information.`,Ko,P,Be,et,He,Ot='This method uses <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">BertTokenizerFast.<strong>call</strong>()</a> to prepare text for the model.',ot,Oe,Xt="Please refer to the docstring of the above two methods for more information.",Io,Ue,So,v,je,tt,Xe,Dt="The bare Bros Model outputting raw hidden-states without any specific head on top.",nt,De,At=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,st,Ae,Yt=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,at,N,Je,rt,Ye,Kt='The <a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosModel">BrosModel</a> forward method, overrides the <code>__call__</code> special method.',it,A,lt,Y,Zo,ze,Wo,x,Fe,dt,Ke,en=`The Bros transformer 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.`,ct,eo,on=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,pt,oo,tn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,mt,I,Ee,ht,to,nn='The <a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosForTokenClassification">BrosForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',ft,K,ut,ee,qo,Ne,Ro,C,Ie,gt,no,sn=`Bros Model with a token classification head on top (initial_token_layers and subsequent_token_layer on top of the
hidden-states output) e.g. for Named-Entity-Recognition (NER) tasks. The initial_token_classifier is used to
predict the first token of each entity, and the subsequent_token_classifier is used to predict the subsequent
tokens within an entity. Compared to BrosForTokenClassification, this model is more robust to serialization errors
since it predicts next token from one token.`,_t,so,an=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,bt,ao,rn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,yt,S,Se,Tt,ro,ln='The <a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosSpadeEEForTokenClassification">BrosSpadeEEForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',kt,oe,Mt,te,Go,Ze,Lo,$,We,wt,io,dn=`Bros Model with a token classification head on top (a entity_linker layer on top of the hidden-states output) e.g.
for Entity-Linking. The entity_linker is used to predict intra-entity links (one entity to another entity).`,vt,lo,cn=`This model inherits from <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`,xt,co,pn=`This model is also a PyTorch <a href="https://pytorch.org/docs/stable/nn.html#torch.nn.Module" rel="nofollow">torch.nn.Module</a> subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`,Ct,Z,qe,$t,po,mn='The <a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosSpadeELForTokenClassification">BrosSpadeELForTokenClassification</a> forward method, overrides the <code>__call__</code> special method.',Bt,ne,Ut,se,Qo,Re,Po,mo,Vo;return T=new H({props:{title:"BROS",local:"bros",headingTag:"h1"}}),re=new H({props:{title:"Overview",local:"overview",headingTag:"h2"}}),_e=new H({props:{title:"Usage tips and examples",local:"usage-tips-and-examples",headingTag:"h2"}}),ye=new Ge({props:{code:"ZGVmJTIwZXhwYW5kX2FuZF9ub3JtYWxpemVfYmJveChiYm94ZXMlMkMlMjBkb2Nfd2lkdGglMkMlMjBkb2NfaGVpZ2h0KSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMGhlcmUlMkMlMjBiYm94ZXMlMjBhcmUlMjBudW1weSUyMGFycmF5JTBBJTBBJTIwJTIwJTIwJTIwJTIzJTIwTm9ybWFsaXplJTIwYmJveCUyMC0lM0UlMjAwJTIwfiUyMDElMEElMjAlMjAlMjAlMjBiYm94ZXMlNUIlM0ElMkMlMjAlNUIwJTJDJTIwMiU1RCU1RCUyMCUzRCUyMGJib3hlcyU1QiUzQSUyQyUyMCU1QjAlMkMlMjAyJTVEJTVEJTIwJTJGJTIwd2lkdGglMEElMjAlMjAlMjAlMjBiYm94ZXMlNUIlM0ElMkMlMjAlNUIxJTJDJTIwMyU1RCU1RCUyMCUzRCUyMGJib3hlcyU1QiUzQSUyQyUyMCU1QjElMkMlMjAzJTVEJTVEJTIwJTJGJTIwaGVpZ2h0",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">expand_and_normalize_bbox</span>(<span class="hljs-params">bboxes, doc_width, doc_height</span>):
    <span class="hljs-comment"># here, bboxes are numpy array</span>

    <span class="hljs-comment"># Normalize bbox -&gt; 0 ~ 1</span>
    bboxes[:, [<span class="hljs-number">0</span>, <span class="hljs-number">2</span>]] = bboxes[:, [<span class="hljs-number">0</span>, <span class="hljs-number">2</span>]] / width
    bboxes[:, [<span class="hljs-number">1</span>, <span class="hljs-number">3</span>]] = bboxes[:, [<span class="hljs-number">1</span>, <span class="hljs-number">3</span>]] / height`,wrap:!1}}),ke=new Ge({props:{code:"ZGVmJTIwbWFrZV9ib3hfZmlyc3RfdG9rZW5fbWFzayhiYm94ZXMlMkMlMjB3b3JkcyUyQyUyMHRva2VuaXplciUyQyUyMG1heF9zZXFfbGVuZ3RoJTNENTEyKSUzQSUwQSUwQSUyMCUyMCUyMCUyMGJveF9maXJzdF90b2tlbl9tYXNrJTIwJTNEJTIwbnAuemVyb3MobWF4X3NlcV9sZW5ndGglMkMlMjBkdHlwZSUzRG5wLmJvb2xfKSUwQSUwQSUyMCUyMCUyMCUyMCUyMyUyMGVuY29kZSh0b2tlbml6ZSklMjBlYWNoJTIwd29yZCUyMGZyb20lMjB3b3JkcyUyMChMaXN0JTVCc3RyJTVEKSUwQSUyMCUyMCUyMCUyMGlucHV0X2lkc19saXN0JTNBJTIwTGlzdCU1Qkxpc3QlNUJpbnQlNUQlNUQlMjAlM0QlMjAlNUJ0b2tlbml6ZXIuZW5jb2RlKGUlMkMlMjBhZGRfc3BlY2lhbF90b2tlbnMlM0RGYWxzZSklMjBmb3IlMjBlJTIwaW4lMjB3b3JkcyU1RCUwQSUwQSUyMCUyMCUyMCUyMCUyMyUyMGdldCUyMHRoZSUyMGxlbmd0aCUyMG9mJTIwZWFjaCUyMGJveCUwQSUyMCUyMCUyMCUyMHRva2Vuc19sZW5ndGhfbGlzdCUzQSUyMExpc3QlNUJpbnQlNUQlMjAlM0QlMjAlNUJsZW4obCklMjBmb3IlMjBsJTIwaW4lMjBpbnB1dF9pZHNfbGlzdCU1RCUwQSUwQSUyMCUyMCUyMCUyMGJveF9lbmRfdG9rZW5faW5kaWNlcyUyMCUzRCUyMG5wLmFycmF5KGxpc3QoaXRlcnRvb2xzLmFjY3VtdWxhdGUodG9rZW5zX2xlbmd0aF9saXN0KSkpJTBBJTIwJTIwJTIwJTIwYm94X3N0YXJ0X3Rva2VuX2luZGljZXMlMjAlM0QlMjBib3hfZW5kX3Rva2VuX2luZGljZXMlMjAtJTIwbnAuYXJyYXkodG9rZW5zX2xlbmd0aF9saXN0KSUwQSUwQSUyMCUyMCUyMCUyMCUyMyUyMGZpbHRlciUyMG91dCUyMHRoZSUyMGluZGljZXMlMjB0aGF0JTIwYXJlJTIwb3V0JTIwb2YlMjBtYXhfc2VxX2xlbmd0aCUwQSUyMCUyMCUyMCUyMGJveF9lbmRfdG9rZW5faW5kaWNlcyUyMCUzRCUyMGJveF9lbmRfdG9rZW5faW5kaWNlcyU1QmJveF9lbmRfdG9rZW5faW5kaWNlcyUyMCUzQyUyMG1heF9zZXFfbGVuZ3RoJTIwLSUyMDElNUQlMEElMjAlMjAlMjAlMjBpZiUyMGxlbihib3hfc3RhcnRfdG9rZW5faW5kaWNlcyklMjAlM0UlMjBsZW4oYm94X2VuZF90b2tlbl9pbmRpY2VzKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJveF9zdGFydF90b2tlbl9pbmRpY2VzJTIwJTNEJTIwYm94X3N0YXJ0X3Rva2VuX2luZGljZXMlNUIlM0ElMjBsZW4oYm94X2VuZF90b2tlbl9pbmRpY2VzKSU1RCUwQSUwQSUyMCUyMCUyMCUyMCUyMyUyMHNldCUyMGJveF9zdGFydF90b2tlbl9pbmRpY2VzJTIwdG8lMjBUcnVlJTBBJTIwJTIwJTIwJTIwYm94X2ZpcnN0X3Rva2VuX21hc2slNUJib3hfc3RhcnRfdG9rZW5faW5kaWNlcyU1RCUyMCUzRCUyMFRydWUlMEElMEElMjAlMjAlMjAlMjByZXR1cm4lMjBib3hfZmlyc3RfdG9rZW5fbWFzayUwQQ==",highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">make_box_first_token_mask</span>(<span class="hljs-params">bboxes, words, tokenizer, max_seq_length=<span class="hljs-number">512</span></span>):

    box_first_token_mask = np.zeros(max_seq_length, dtype=np.bool_)

    <span class="hljs-comment"># encode(tokenize) each word from words (List[str])</span>
    input_ids_list: <span class="hljs-type">List</span>[<span class="hljs-type">List</span>[<span class="hljs-built_in">int</span>]] = [tokenizer.encode(e, add_special_tokens=<span class="hljs-literal">False</span>) <span class="hljs-keyword">for</span> e <span class="hljs-keyword">in</span> words]

    <span class="hljs-comment"># get the length of each box</span>
    tokens_length_list: <span class="hljs-type">List</span>[<span class="hljs-built_in">int</span>] = [<span class="hljs-built_in">len</span>(l) <span class="hljs-keyword">for</span> l <span class="hljs-keyword">in</span> input_ids_list]

    box_end_token_indices = np.array(<span class="hljs-built_in">list</span>(itertools.accumulate(tokens_length_list)))
    box_start_token_indices = box_end_token_indices - np.array(tokens_length_list)

    <span class="hljs-comment"># filter out the indices that are out of max_seq_length</span>
    box_end_token_indices = box_end_token_indices[box_end_token_indices &lt; max_seq_length - <span class="hljs-number">1</span>]
    <span class="hljs-keyword">if</span> <span class="hljs-built_in">len</span>(box_start_token_indices) &gt; <span class="hljs-built_in">len</span>(box_end_token_indices):
        box_start_token_indices = box_start_token_indices[: <span class="hljs-built_in">len</span>(box_end_token_indices)]

    <span class="hljs-comment"># set box_start_token_indices to True</span>
    box_first_token_mask[box_start_token_indices] = <span class="hljs-literal">True</span>

    <span class="hljs-keyword">return</span> box_first_token_mask
`,wrap:!1}}),Me=new H({props:{title:"Resources",local:"resources",headingTag:"h2"}}),ve=new H({props:{title:"BrosConfig",local:"transformers.BrosConfig",headingTag:"h2"}}),xe=new Q({props:{name:"class transformers.BrosConfig",anchor:"transformers.BrosConfig",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:"pad_token_id",val:" = 0"},{name:"dim_bbox",val:" = 8"},{name:"bbox_scale",val:" = 100.0"},{name:"n_relations",val:" = 1"},{name:"classifier_dropout_prob",val:" = 0.1"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BrosConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the Bros model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosModel">BrosModel</a> or <code>TFBrosModel</code>.`,name:"vocab_size"},{anchor:"transformers.BrosConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.BrosConfig.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.BrosConfig.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.BrosConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.BrosConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</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;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.BrosConfig.hidden_dropout_prob",description:`<strong>hidden_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.`,name:"hidden_dropout_prob"},{anchor:"transformers.BrosConfig.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.BrosConfig.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.BrosConfig.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/main/en/model_doc/bros#transformers.BrosModel">BrosModel</a> or <code>TFBrosModel</code>.`,name:"type_vocab_size"},{anchor:"transformers.BrosConfig.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.BrosConfig.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.BrosConfig.pad_token_id",description:`<strong>pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
The index of the padding token in the token vocabulary.`,name:"pad_token_id"},{anchor:"transformers.BrosConfig.dim_bbox",description:`<strong>dim_bbox</strong> (<code>int</code>, <em>optional</em>, defaults to 8) &#x2014;
The dimension of the bounding box coordinates. (x0, y1, x1, y0, x1, y1, x0, y1)`,name:"dim_bbox"},{anchor:"transformers.BrosConfig.bbox_scale",description:`<strong>bbox_scale</strong> (<code>float</code>, <em>optional</em>, defaults to 100.0) &#x2014;
The scale factor of the bounding box coordinates.`,name:"bbox_scale"},{anchor:"transformers.BrosConfig.n_relations",description:`<strong>n_relations</strong> (<code>int</code>, <em>optional</em>, defaults to 1) &#x2014;
The number of relations for SpadeEE(entity extraction), SpadeEL(entity linking) head.`,name:"n_relations"},{anchor:"transformers.BrosConfig.classifier_dropout_prob",description:`<strong>classifier_dropout_prob</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
The dropout ratio for the classifier head.`,name:"classifier_dropout_prob"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/configuration_bros.py#L24"}}),D=new ho({props:{anchor:"transformers.BrosConfig.example",$$slots:{default:[yn]},$$scope:{ctx:w}}}),Ce=new H({props:{title:"BrosProcessor",local:"transformers.BrosProcessor",headingTag:"h2"}}),$e=new Q({props:{name:"class transformers.BrosProcessor",anchor:"transformers.BrosProcessor",parameters:[{name:"tokenizer",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.BrosProcessor.tokenizer",description:"<strong>tokenizer</strong> (<code>BertTokenizerFast</code>, <em>optional</em>) &#x2014;\nAn instance of [&#x2018;BertTokenizerFast`]. The tokenizer is a required input.",name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/processing_bros.py#L26"}}),Be=new Q({props:{name:"__call__",anchor:"transformers.BrosProcessor.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/processing_bros.py#L47"}}),Ue=new H({props:{title:"BrosModel",local:"transformers.BrosModel",headingTag:"h2"}}),je=new Q({props:{name:"class transformers.BrosModel",anchor:"transformers.BrosModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.BrosModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosModel">BrosModel</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/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"},{anchor:"transformers.BrosModel.add_pooling_layer",description:`<strong>add_pooling_layer</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to add a pooling layer`,name:"add_pooling_layer"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/modeling_bros.py#L686"}}),Je=new Q({props:{name:"forward",anchor:"transformers.BrosModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bbox",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.BrosModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.BrosModel.forward.bbox",description:`<strong>bbox</strong> (<code>torch.Tensor</code> of shape &#x2018;(batch_size, num_boxes, 4)&#x2019;) &#x2014;
Bounding box coordinates for each token in the input sequence. Each bounding box is a list of four values
(x1, y1, x2, y2), where (x1, y1) is the top left corner, and (x2, y2) is the bottom right corner of the
bounding box.`,name:"bbox"},{anchor:"transformers.BrosModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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.BrosModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</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.BrosModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BrosModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.BrosModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BrosModel.forward.encoder_hidden_states",description:`<strong>encoder_hidden_states</strong> (<code>torch.Tensor</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.BrosModel.forward.encoder_attention_mask",description:`<strong>encoder_attention_mask</strong> (<code>torch.Tensor</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.BrosModel.forward.past_key_values",description:`<strong>past_key_values</strong> (<code>List[torch.FloatTensor]</code>, <em>optional</em>) &#x2014;
Pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
blocks) that can be used to speed up sequential decoding. This typically consists in the <code>past_key_values</code>
returned by the model at a previous stage of decoding, when <code>use_cache=True</code> or <code>config.use_cache=True</code>.</p>
<p>Two formats are allowed:</p>
<ul>
<li>a <a href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache">Cache</a> instance, see our <a href="https://huggingface.co/docs/transformers/en/kv_cache" rel="nofollow">kv cache guide</a>;</li>
<li>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>). This is also known as the legacy
cache format.</li>
</ul>
<p>The model will output the same cache format that is fed as input. If no <code>past_key_values</code> are passed, the
legacy cache format will be returned.</p>
<p>If <code>past_key_values</code> are used, the user can optionally input only the last <code>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>input_ids</code>
of shape <code>(batch_size, sequence_length)</code>.`,name:"past_key_values"},{anchor:"transformers.BrosModel.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"},{anchor:"transformers.BrosModel.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.BrosModel.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.BrosModel.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/modeling_bros.py#L718",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/bros#transformers.BrosConfig"
>BrosConfig</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>) — 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>) — 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>) — 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>) — 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>) — 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’s 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>Cache</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) — It is a <a
  href="/docs/transformers/main/en/internal/generation_utils#transformers.Cache"
>Cache</a> instance. For more details, see our <a
  href="https://huggingface.co/docs/transformers/en/kv_cache"
  rel="nofollow"
>kv cache guide</a>.</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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),A=new Ho({props:{$$slots:{default:[Tn]},$$scope:{ctx:w}}}),Y=new ho({props:{anchor:"transformers.BrosModel.forward.example",$$slots:{default:[kn]},$$scope:{ctx:w}}}),ze=new H({props:{title:"BrosForTokenClassification",local:"transformers.BrosForTokenClassification",headingTag:"h2"}}),Fe=new Q({props:{name:"class transformers.BrosForTokenClassification",anchor:"transformers.BrosForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BrosForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosForTokenClassification">BrosForTokenClassification</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/main/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/main/src/transformers/models/bros/modeling_bros.py#L864"}}),Ee=new Q({props:{name:"forward",anchor:"transformers.BrosForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bbox",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"bbox_first_token_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.BrosForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.BrosForTokenClassification.forward.bbox",description:`<strong>bbox</strong> (<code>torch.Tensor</code> of shape &#x2018;(batch_size, num_boxes, 4)&#x2019;) &#x2014;
Bounding box coordinates for each token in the input sequence. Each bounding box is a list of four values
(x1, y1, x2, y2), where (x1, y1) is the top left corner, and (x2, y2) is the bottom right corner of the
bounding box.`,name:"bbox"},{anchor:"transformers.BrosForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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.BrosForTokenClassification.forward.bbox_first_token_mask",description:`<strong>bbox_first_token_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the first token of each bounding box. 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:"bbox_first_token_mask"},{anchor:"transformers.BrosForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</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.BrosForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BrosForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.BrosForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BrosForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (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>.`,name:"labels"},{anchor:"transformers.BrosForTokenClassification.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.BrosForTokenClassification.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.BrosForTokenClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/modeling_bros.py#L881",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/bros#transformers.BrosConfig"
>BrosConfig</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)  — Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),K=new Ho({props:{$$slots:{default:[Mn]},$$scope:{ctx:w}}}),ee=new ho({props:{anchor:"transformers.BrosForTokenClassification.forward.example",$$slots:{default:[wn]},$$scope:{ctx:w}}}),Ne=new H({props:{title:"BrosSpadeEEForTokenClassification",local:"transformers.BrosSpadeEEForTokenClassification",headingTag:"h2"}}),Ie=new Q({props:{name:"class transformers.BrosSpadeEEForTokenClassification",anchor:"transformers.BrosSpadeEEForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BrosSpadeEEForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosSpadeEEForTokenClassification">BrosSpadeEEForTokenClassification</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/main/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/main/src/transformers/models/bros/modeling_bros.py#L968"}}),Se=new Q({props:{name:"forward",anchor:"transformers.BrosSpadeEEForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bbox",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"bbox_first_token_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:"initial_token_labels",val:": typing.Optional[torch.Tensor] = None"},{name:"subsequent_token_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.BrosSpadeEEForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.BrosSpadeEEForTokenClassification.forward.bbox",description:`<strong>bbox</strong> (<code>torch.Tensor</code> of shape &#x2018;(batch_size, num_boxes, 4)&#x2019;) &#x2014;
Bounding box coordinates for each token in the input sequence. Each bounding box is a list of four values
(x1, y1, x2, y2), where (x1, y1) is the top left corner, and (x2, y2) is the bottom right corner of the
bounding box.`,name:"bbox"},{anchor:"transformers.BrosSpadeEEForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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.BrosSpadeEEForTokenClassification.forward.bbox_first_token_mask",description:`<strong>bbox_first_token_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the first token of each bounding box. 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:"bbox_first_token_mask"},{anchor:"transformers.BrosSpadeEEForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</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.BrosSpadeEEForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BrosSpadeEEForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.BrosSpadeEEForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BrosSpadeEEForTokenClassification.forward.initial_token_labels",description:`<strong>initial_token_labels</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for the initial token classification.`,name:"initial_token_labels"},{anchor:"transformers.BrosSpadeEEForTokenClassification.forward.subsequent_token_labels",description:`<strong>subsequent_token_labels</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for the subsequent token classification.`,name:"subsequent_token_labels"},{anchor:"transformers.BrosSpadeEEForTokenClassification.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.BrosSpadeEEForTokenClassification.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.BrosSpadeEEForTokenClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/modeling_bros.py#L1005",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <code>transformers.models.bros.modeling_bros.BrosSpadeOutput</code> 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/main/en/model_doc/bros#transformers.BrosConfig"
>BrosConfig</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)  — Classification loss.</p>
</li>
<li>
<p><strong>initial_token_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) — Classification scores for entity initial tokens (before SoftMax).</p>
</li>
<li>
<p><strong>subsequent_token_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length+1)</code>) — Classification scores for entity sequence tokens (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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>transformers.models.bros.modeling_bros.BrosSpadeOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),oe=new Ho({props:{$$slots:{default:[vn]},$$scope:{ctx:w}}}),te=new ho({props:{anchor:"transformers.BrosSpadeEEForTokenClassification.forward.example",$$slots:{default:[xn]},$$scope:{ctx:w}}}),Ze=new H({props:{title:"BrosSpadeELForTokenClassification",local:"transformers.BrosSpadeELForTokenClassification",headingTag:"h2"}}),We=new Q({props:{name:"class transformers.BrosSpadeELForTokenClassification",anchor:"transformers.BrosSpadeELForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.BrosSpadeELForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/bros#transformers.BrosSpadeELForTokenClassification">BrosSpadeELForTokenClassification</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/main/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/main/src/transformers/models/bros/modeling_bros.py#L1124"}}),qe=new Q({props:{name:"forward",anchor:"transformers.BrosSpadeELForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"bbox",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"bbox_first_token_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.BrosSpadeELForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of input sequence tokens in the vocabulary. Padding will be ignored by default.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/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.BrosSpadeELForTokenClassification.forward.bbox",description:`<strong>bbox</strong> (<code>torch.Tensor</code> of shape &#x2018;(batch_size, num_boxes, 4)&#x2019;) &#x2014;
Bounding box coordinates for each token in the input sequence. Each bounding box is a list of four values
(x1, y1, x2, y2), where (x1, y1) is the top left corner, and (x2, y2) is the bottom right corner of the
bounding box.`,name:"bbox"},{anchor:"transformers.BrosSpadeELForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.Tensor</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.BrosSpadeELForTokenClassification.forward.bbox_first_token_mask",description:`<strong>bbox_first_token_mask</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the first token of each bounding box. 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:"bbox_first_token_mask"},{anchor:"transformers.BrosSpadeELForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.Tensor</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.BrosSpadeELForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.Tensor</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.n_positions - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.BrosSpadeELForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.Tensor</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.BrosSpadeELForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.Tensor</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 <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.BrosSpadeELForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should either be in <code>[0, ..., config.vocab_size]</code> or -100 (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>.`,name:"labels"},{anchor:"transformers.BrosSpadeELForTokenClassification.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.BrosSpadeELForTokenClassification.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.BrosSpadeELForTokenClassification.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/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/bros/modeling_bros.py#L1147",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A <a
  href="/docs/transformers/main/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/main/en/model_doc/bros#transformers.BrosConfig"
>BrosConfig</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)  — Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) — 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>) — 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>) — 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:`<script context="module">export const metadata = 'undefined';<\/script>


<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ne=new Ho({props:{$$slots:{default:[Cn]},$$scope:{ctx:w}}}),se=new ho({props:{anchor:"transformers.BrosSpadeELForTokenClassification.forward.example",$$slots:{default:[$n]},$$scope:{ctx:w}}}),Re=new bn({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/bros.md"}}),{c(){n=d("meta"),k=a(),p=d("p"),m=a(),f(T.$$.fragment),s=a(),M=d("div"),M.innerHTML=jt,fo=a(),f(re.$$.fragment),uo=a(),ie=d("p"),ie.innerHTML=Jt,go=a(),le=d("p"),le.innerHTML=zt,_o=a(),de=d("p"),de.textContent=Ft,bo=a(),ce=d("p"),ce.innerHTML=Et,yo=a(),pe=d("p"),pe.innerHTML=Nt,To=a(),me=d("p"),me.innerHTML=It,ko=a(),he=d("p"),he.textContent=St,Mo=a(),fe=d("p"),fe.textContent=Zt,wo=a(),ue=d("p"),ue.innerHTML=Wt,vo=a(),ge=d("p"),ge.innerHTML=qt,xo=a(),f(_e.$$.fragment),Co=a(),be=d("ul"),be.innerHTML=Rt,$o=a(),f(ye.$$.fragment),Bo=a(),Te=d("ul"),Te.innerHTML=Gt,Uo=a(),f(ke.$$.fragment),jo=a(),f(Me.$$.fragment),Jo=a(),we=d("ul"),we.innerHTML=Lt,zo=a(),f(ve.$$.fragment),Fo=a(),U=d("div"),f(xe.$$.fragment),Oo=a(),Le=d("p"),Le.innerHTML=Qt,Xo=a(),Qe=d("p"),Qe.innerHTML=Pt,Do=a(),f(D.$$.fragment),Eo=a(),f(Ce.$$.fragment),No=a(),j=d("div"),f($e.$$.fragment),Ao=a(),Pe=d("p"),Pe.textContent=Vt,Yo=a(),Ve=d("p"),Ve.innerHTML=Ht,Ko=a(),P=d("div"),f(Be.$$.fragment),et=a(),He=d("p"),He.innerHTML=Ot,ot=a(),Oe=d("p"),Oe.textContent=Xt,Io=a(),f(Ue.$$.fragment),So=a(),v=d("div"),f(je.$$.fragment),tt=a(),Xe=d("p"),Xe.textContent=Dt,nt=a(),De=d("p"),De.innerHTML=At,st=a(),Ae=d("p"),Ae.innerHTML=Yt,at=a(),N=d("div"),f(Je.$$.fragment),rt=a(),Ye=d("p"),Ye.innerHTML=Kt,it=a(),f(A.$$.fragment),lt=a(),f(Y.$$.fragment),Zo=a(),f(ze.$$.fragment),Wo=a(),x=d("div"),f(Fe.$$.fragment),dt=a(),Ke=d("p"),Ke.textContent=en,ct=a(),eo=d("p"),eo.innerHTML=on,pt=a(),oo=d("p"),oo.innerHTML=tn,mt=a(),I=d("div"),f(Ee.$$.fragment),ht=a(),to=d("p"),to.innerHTML=nn,ft=a(),f(K.$$.fragment),ut=a(),f(ee.$$.fragment),qo=a(),f(Ne.$$.fragment),Ro=a(),C=d("div"),f(Ie.$$.fragment),gt=a(),no=d("p"),no.textContent=sn,_t=a(),so=d("p"),so.innerHTML=an,bt=a(),ao=d("p"),ao.innerHTML=rn,yt=a(),S=d("div"),f(Se.$$.fragment),Tt=a(),ro=d("p"),ro.innerHTML=ln,kt=a(),f(oe.$$.fragment),Mt=a(),f(te.$$.fragment),Go=a(),f(Ze.$$.fragment),Lo=a(),$=d("div"),f(We.$$.fragment),wt=a(),io=d("p"),io.textContent=dn,vt=a(),lo=d("p"),lo.innerHTML=cn,xt=a(),co=d("p"),co.innerHTML=pn,Ct=a(),Z=d("div"),f(qe.$$.fragment),$t=a(),po=d("p"),po.innerHTML=mn,Bt=a(),f(ne.$$.fragment),Ut=a(),f(se.$$.fragment),Qo=a(),f(Re.$$.fragment),Po=a(),mo=d("p"),this.h()},l(e){const o=_n("svelte-u9bgzb",document.head);n=c(o,"META",{name:!0,content:!0}),o.forEach(t),k=r(e),p=c(e,"P",{}),E(p).forEach(t),m=r(e),u(T.$$.fragment,e),s=r(e),M=c(e,"DIV",{class:!0,"data-svelte-h":!0}),h(M)!=="svelte-13t8s2t"&&(M.innerHTML=jt),fo=r(e),u(re.$$.fragment,e),uo=r(e),ie=c(e,"P",{"data-svelte-h":!0}),h(ie)!=="svelte-wn68vq"&&(ie.innerHTML=Jt),go=r(e),le=c(e,"P",{"data-svelte-h":!0}),h(le)!=="svelte-x3aljh"&&(le.innerHTML=zt),_o=r(e),de=c(e,"P",{"data-svelte-h":!0}),h(de)!=="svelte-a4zidq"&&(de.textContent=Ft),bo=r(e),ce=c(e,"P",{"data-svelte-h":!0}),h(ce)!=="svelte-gnae6o"&&(ce.innerHTML=Et),yo=r(e),pe=c(e,"P",{"data-svelte-h":!0}),h(pe)!=="svelte-1cpns1a"&&(pe.innerHTML=Nt),To=r(e),me=c(e,"P",{"data-svelte-h":!0}),h(me)!=="svelte-1mj28ly"&&(me.innerHTML=It),ko=r(e),he=c(e,"P",{"data-svelte-h":!0}),h(he)!=="svelte-fp1b99"&&(he.textContent=St),Mo=r(e),fe=c(e,"P",{"data-svelte-h":!0}),h(fe)!=="svelte-vfdo9a"&&(fe.textContent=Zt),wo=r(e),ue=c(e,"P",{"data-svelte-h":!0}),h(ue)!=="svelte-1citvm0"&&(ue.innerHTML=Wt),vo=r(e),ge=c(e,"P",{"data-svelte-h":!0}),h(ge)!=="svelte-1ys7xl0"&&(ge.innerHTML=qt),xo=r(e),u(_e.$$.fragment,e),Co=r(e),be=c(e,"UL",{"data-svelte-h":!0}),h(be)!=="svelte-12kxld6"&&(be.innerHTML=Rt),$o=r(e),u(ye.$$.fragment,e),Bo=r(e),Te=c(e,"UL",{"data-svelte-h":!0}),h(Te)!=="svelte-88mplb"&&(Te.innerHTML=Gt),Uo=r(e),u(ke.$$.fragment,e),jo=r(e),u(Me.$$.fragment,e),Jo=r(e),we=c(e,"UL",{"data-svelte-h":!0}),h(we)!=="svelte-17diifa"&&(we.innerHTML=Lt),zo=r(e),u(ve.$$.fragment,e),Fo=r(e),U=c(e,"DIV",{class:!0});var W=E(U);u(xe.$$.fragment,W),Oo=r(W),Le=c(W,"P",{"data-svelte-h":!0}),h(Le)!=="svelte-1mvrlkn"&&(Le.innerHTML=Qt),Xo=r(W),Qe=c(W,"P",{"data-svelte-h":!0}),h(Qe)!=="svelte-o55m63"&&(Qe.innerHTML=Pt),Do=r(W),u(D.$$.fragment,W),W.forEach(t),Eo=r(e),u(Ce.$$.fragment,e),No=r(e),j=c(e,"DIV",{class:!0});var q=E(j);u($e.$$.fragment,q),Ao=r(q),Pe=c(q,"P",{"data-svelte-h":!0}),h(Pe)!=="svelte-14kb9li"&&(Pe.textContent=Vt),Yo=r(q),Ve=c(q,"P",{"data-svelte-h":!0}),h(Ve)!=="svelte-1xkn9o8"&&(Ve.innerHTML=Ht),Ko=r(q),P=c(q,"DIV",{class:!0});var O=E(P);u(Be.$$.fragment,O),et=r(O),He=c(O,"P",{"data-svelte-h":!0}),h(He)!=="svelte-1tf8vuw"&&(He.innerHTML=Ot),ot=r(O),Oe=c(O,"P",{"data-svelte-h":!0}),h(Oe)!=="svelte-ws0hzs"&&(Oe.textContent=Xt),O.forEach(t),q.forEach(t),Io=r(e),u(Ue.$$.fragment,e),So=r(e),v=c(e,"DIV",{class:!0});var J=E(v);u(je.$$.fragment,J),tt=r(J),Xe=c(J,"P",{"data-svelte-h":!0}),h(Xe)!=="svelte-10e2j5q"&&(Xe.textContent=Dt),nt=r(J),De=c(J,"P",{"data-svelte-h":!0}),h(De)!=="svelte-6pahdo"&&(De.innerHTML=At),st=r(J),Ae=c(J,"P",{"data-svelte-h":!0}),h(Ae)!=="svelte-hswkmf"&&(Ae.innerHTML=Yt),at=r(J),N=c(J,"DIV",{class:!0});var R=E(N);u(Je.$$.fragment,R),rt=r(R),Ye=c(R,"P",{"data-svelte-h":!0}),h(Ye)!=="svelte-1akbnb5"&&(Ye.innerHTML=Kt),it=r(R),u(A.$$.fragment,R),lt=r(R),u(Y.$$.fragment,R),R.forEach(t),J.forEach(t),Zo=r(e),u(ze.$$.fragment,e),Wo=r(e),x=c(e,"DIV",{class:!0});var z=E(x);u(Fe.$$.fragment,z),dt=r(z),Ke=c(z,"P",{"data-svelte-h":!0}),h(Ke)!=="svelte-1j5bite"&&(Ke.textContent=en),ct=r(z),eo=c(z,"P",{"data-svelte-h":!0}),h(eo)!=="svelte-6pahdo"&&(eo.innerHTML=on),pt=r(z),oo=c(z,"P",{"data-svelte-h":!0}),h(oo)!=="svelte-hswkmf"&&(oo.innerHTML=tn),mt=r(z),I=c(z,"DIV",{class:!0});var G=E(I);u(Ee.$$.fragment,G),ht=r(G),to=c(G,"P",{"data-svelte-h":!0}),h(to)!=="svelte-1pnq0r9"&&(to.innerHTML=nn),ft=r(G),u(K.$$.fragment,G),ut=r(G),u(ee.$$.fragment,G),G.forEach(t),z.forEach(t),qo=r(e),u(Ne.$$.fragment,e),Ro=r(e),C=c(e,"DIV",{class:!0});var F=E(C);u(Ie.$$.fragment,F),gt=r(F),no=c(F,"P",{"data-svelte-h":!0}),h(no)!=="svelte-5z2g1e"&&(no.textContent=sn),_t=r(F),so=c(F,"P",{"data-svelte-h":!0}),h(so)!=="svelte-6pahdo"&&(so.innerHTML=an),bt=r(F),ao=c(F,"P",{"data-svelte-h":!0}),h(ao)!=="svelte-hswkmf"&&(ao.innerHTML=rn),yt=r(F),S=c(F,"DIV",{class:!0});var L=E(S);u(Se.$$.fragment,L),Tt=r(L),ro=c(L,"P",{"data-svelte-h":!0}),h(ro)!=="svelte-bohfex"&&(ro.innerHTML=ln),kt=r(L),u(oe.$$.fragment,L),Mt=r(L),u(te.$$.fragment,L),L.forEach(t),F.forEach(t),Go=r(e),u(Ze.$$.fragment,e),Lo=r(e),$=c(e,"DIV",{class:!0});var V=E($);u(We.$$.fragment,V),wt=r(V),io=c(V,"P",{"data-svelte-h":!0}),h(io)!=="svelte-oir21p"&&(io.textContent=dn),vt=r(V),lo=c(V,"P",{"data-svelte-h":!0}),h(lo)!=="svelte-6pahdo"&&(lo.innerHTML=cn),xt=r(V),co=c(V,"P",{"data-svelte-h":!0}),h(co)!=="svelte-hswkmf"&&(co.innerHTML=pn),Ct=r(V),Z=c(V,"DIV",{class:!0});var ae=E(Z);u(qe.$$.fragment,ae),$t=r(ae),po=c(ae,"P",{"data-svelte-h":!0}),h(po)!=="svelte-8hqkid"&&(po.innerHTML=mn),Bt=r(ae),u(ne.$$.fragment,ae),Ut=r(ae),u(se.$$.fragment,ae),ae.forEach(t),V.forEach(t),Qo=r(e),u(Re.$$.fragment,e),Po=r(e),mo=c(e,"P",{}),E(mo).forEach(t),this.h()},h(){B(n,"name","hf:doc:metadata"),B(n,"content",Un),B(M,"class","flex flex-wrap space-x-1"),B(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),B($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,o){l(document.head,n),i(e,k,o),i(e,p,o),i(e,m,o),g(T,e,o),i(e,s,o),i(e,M,o),i(e,fo,o),g(re,e,o),i(e,uo,o),i(e,ie,o),i(e,go,o),i(e,le,o),i(e,_o,o),i(e,de,o),i(e,bo,o),i(e,ce,o),i(e,yo,o),i(e,pe,o),i(e,To,o),i(e,me,o),i(e,ko,o),i(e,he,o),i(e,Mo,o),i(e,fe,o),i(e,wo,o),i(e,ue,o),i(e,vo,o),i(e,ge,o),i(e,xo,o),g(_e,e,o),i(e,Co,o),i(e,be,o),i(e,$o,o),g(ye,e,o),i(e,Bo,o),i(e,Te,o),i(e,Uo,o),g(ke,e,o),i(e,jo,o),g(Me,e,o),i(e,Jo,o),i(e,we,o),i(e,zo,o),g(ve,e,o),i(e,Fo,o),i(e,U,o),g(xe,U,null),l(U,Oo),l(U,Le),l(U,Xo),l(U,Qe),l(U,Do),g(D,U,null),i(e,Eo,o),g(Ce,e,o),i(e,No,o),i(e,j,o),g($e,j,null),l(j,Ao),l(j,Pe),l(j,Yo),l(j,Ve),l(j,Ko),l(j,P),g(Be,P,null),l(P,et),l(P,He),l(P,ot),l(P,Oe),i(e,Io,o),g(Ue,e,o),i(e,So,o),i(e,v,o),g(je,v,null),l(v,tt),l(v,Xe),l(v,nt),l(v,De),l(v,st),l(v,Ae),l(v,at),l(v,N),g(Je,N,null),l(N,rt),l(N,Ye),l(N,it),g(A,N,null),l(N,lt),g(Y,N,null),i(e,Zo,o),g(ze,e,o),i(e,Wo,o),i(e,x,o),g(Fe,x,null),l(x,dt),l(x,Ke),l(x,ct),l(x,eo),l(x,pt),l(x,oo),l(x,mt),l(x,I),g(Ee,I,null),l(I,ht),l(I,to),l(I,ft),g(K,I,null),l(I,ut),g(ee,I,null),i(e,qo,o),g(Ne,e,o),i(e,Ro,o),i(e,C,o),g(Ie,C,null),l(C,gt),l(C,no),l(C,_t),l(C,so),l(C,bt),l(C,ao),l(C,yt),l(C,S),g(Se,S,null),l(S,Tt),l(S,ro),l(S,kt),g(oe,S,null),l(S,Mt),g(te,S,null),i(e,Go,o),g(Ze,e,o),i(e,Lo,o),i(e,$,o),g(We,$,null),l($,wt),l($,io),l($,vt),l($,lo),l($,xt),l($,co),l($,Ct),l($,Z),g(qe,Z,null),l(Z,$t),l(Z,po),l(Z,Bt),g(ne,Z,null),l(Z,Ut),g(se,Z,null),i(e,Qo,o),g(Re,e,o),i(e,Po,o),i(e,mo,o),Vo=!0},p(e,[o]){const W={};o&2&&(W.$$scope={dirty:o,ctx:e}),D.$set(W);const q={};o&2&&(q.$$scope={dirty:o,ctx:e}),A.$set(q);const O={};o&2&&(O.$$scope={dirty:o,ctx:e}),Y.$set(O);const J={};o&2&&(J.$$scope={dirty:o,ctx:e}),K.$set(J);const R={};o&2&&(R.$$scope={dirty:o,ctx:e}),ee.$set(R);const z={};o&2&&(z.$$scope={dirty:o,ctx:e}),oe.$set(z);const G={};o&2&&(G.$$scope={dirty:o,ctx:e}),te.$set(G);const F={};o&2&&(F.$$scope={dirty:o,ctx:e}),ne.$set(F);const L={};o&2&&(L.$$scope={dirty:o,ctx:e}),se.$set(L)},i(e){Vo||(_(T.$$.fragment,e),_(re.$$.fragment,e),_(_e.$$.fragment,e),_(ye.$$.fragment,e),_(ke.$$.fragment,e),_(Me.$$.fragment,e),_(ve.$$.fragment,e),_(xe.$$.fragment,e),_(D.$$.fragment,e),_(Ce.$$.fragment,e),_($e.$$.fragment,e),_(Be.$$.fragment,e),_(Ue.$$.fragment,e),_(je.$$.fragment,e),_(Je.$$.fragment,e),_(A.$$.fragment,e),_(Y.$$.fragment,e),_(ze.$$.fragment,e),_(Fe.$$.fragment,e),_(Ee.$$.fragment,e),_(K.$$.fragment,e),_(ee.$$.fragment,e),_(Ne.$$.fragment,e),_(Ie.$$.fragment,e),_(Se.$$.fragment,e),_(oe.$$.fragment,e),_(te.$$.fragment,e),_(Ze.$$.fragment,e),_(We.$$.fragment,e),_(qe.$$.fragment,e),_(ne.$$.fragment,e),_(se.$$.fragment,e),_(Re.$$.fragment,e),Vo=!0)},o(e){b(T.$$.fragment,e),b(re.$$.fragment,e),b(_e.$$.fragment,e),b(ye.$$.fragment,e),b(ke.$$.fragment,e),b(Me.$$.fragment,e),b(ve.$$.fragment,e),b(xe.$$.fragment,e),b(D.$$.fragment,e),b(Ce.$$.fragment,e),b($e.$$.fragment,e),b(Be.$$.fragment,e),b(Ue.$$.fragment,e),b(je.$$.fragment,e),b(Je.$$.fragment,e),b(A.$$.fragment,e),b(Y.$$.fragment,e),b(ze.$$.fragment,e),b(Fe.$$.fragment,e),b(Ee.$$.fragment,e),b(K.$$.fragment,e),b(ee.$$.fragment,e),b(Ne.$$.fragment,e),b(Ie.$$.fragment,e),b(Se.$$.fragment,e),b(oe.$$.fragment,e),b(te.$$.fragment,e),b(Ze.$$.fragment,e),b(We.$$.fragment,e),b(qe.$$.fragment,e),b(ne.$$.fragment,e),b(se.$$.fragment,e),b(Re.$$.fragment,e),Vo=!1},d(e){e&&(t(k),t(p),t(m),t(s),t(M),t(fo),t(uo),t(ie),t(go),t(le),t(_o),t(de),t(bo),t(ce),t(yo),t(pe),t(To),t(me),t(ko),t(he),t(Mo),t(fe),t(wo),t(ue),t(vo),t(ge),t(xo),t(Co),t(be),t($o),t(Bo),t(Te),t(Uo),t(jo),t(Jo),t(we),t(zo),t(Fo),t(U),t(Eo),t(No),t(j),t(Io),t(So),t(v),t(Zo),t(Wo),t(x),t(qo),t(Ro),t(C),t(Go),t(Lo),t($),t(Qo),t(Po),t(mo)),t(n),y(T,e),y(re,e),y(_e,e),y(ye,e),y(ke,e),y(Me,e),y(ve,e),y(xe),y(D),y(Ce,e),y($e),y(Be),y(Ue,e),y(je),y(Je),y(A),y(Y),y(ze,e),y(Fe),y(Ee),y(K),y(ee),y(Ne,e),y(Ie),y(Se),y(oe),y(te),y(Ze,e),y(We),y(qe),y(ne),y(se),y(Re,e)}}}const Un='{"title":"BROS","local":"bros","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage tips and examples","local":"usage-tips-and-examples","sections":[],"depth":2},{"title":"Resources","local":"resources","sections":[],"depth":2},{"title":"BrosConfig","local":"transformers.BrosConfig","sections":[],"depth":2},{"title":"BrosProcessor","local":"transformers.BrosProcessor","sections":[],"depth":2},{"title":"BrosModel","local":"transformers.BrosModel","sections":[],"depth":2},{"title":"BrosForTokenClassification","local":"transformers.BrosForTokenClassification","sections":[],"depth":2},{"title":"BrosSpadeEEForTokenClassification","local":"transformers.BrosSpadeEEForTokenClassification","sections":[],"depth":2},{"title":"BrosSpadeELForTokenClassification","local":"transformers.BrosSpadeELForTokenClassification","sections":[],"depth":2}],"depth":1}';function jn(w){return fn(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Wn extends un{constructor(n){super(),gn(this,n,jn,Bn,hn,{})}}export{Wn as component};
