import{S as Pi,i as Qi,s as Oi,e as n,k as p,w as T,t as r,M as Yi,c as s,d as o,m,a,x as w,h as i,b as d,N as Di,G as e,g as u,y as v,q as k,o as M,B as L,v as Hi,L as No}from"../../chunks/vendor-hf-doc-builder.js";import{T as Un}from"../../chunks/Tip-hf-doc-builder.js";import{D as le}from"../../chunks/Docstring-hf-doc-builder.js";import{C as oo}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as je}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Ao}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Ki($){let c,y,_,g,b;return g=new oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExpbHRDb25maWclMkMlMjBMaWx0TW9kZWwlMEElMEElMjMlMjBJbml0aWFsaXppbmclMjBhJTIwTGlMVCUyMFNDVVQtRExWQ0xhYiUyRmxpbHQtcm9iZXJ0YS1lbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMExpbHRDb25maWcoKSUwQSUyMyUyMFJhbmRvbWx5JTIwaW5pdGlhbGl6aW5nJTIwYSUyMG1vZGVsJTIwZnJvbSUyMHRoZSUyMFNDVVQtRExWQ0xhYiUyRmxpbHQtcm9iZXJ0YS1lbi1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBMaWx0TW9kZWwoY29uZmlndXJhdGlvbiklMEElMjMlMjBBY2Nlc3NpbmclMjB0aGUlMjBtb2RlbCUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwbW9kZWwuY29uZmln",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LiltConfig, LiltModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a LiLT SCUT-DLVCLab/lilt-roberta-en-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = LiltConfig()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Randomly initializing a model from the SCUT-DLVCLab/lilt-roberta-en-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LiltModel(configuration)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Accessing the model configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = model.config`}}),{c(){c=n("p"),y=r("Examples:"),_=p(),T(g.$$.fragment)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),v(g,l,f),b=!0},p:No,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),L(g,l)}}}function el($){let c,y,_,g,b;return{c(){c=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var x=a(_);g=i(x,"Module"),x.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,c,f),e(c,y),e(c,_),e(_,g),e(c,b)},d(l){l&&o(c)}}}function tl($){let c,y,_,g,b;return g=new oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWwlMEFmcm9tJTIwZGF0YXNldHMlMjBpbXBvcnQlMjBsb2FkX2RhdGFzZXQlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJTQ1VULURMVkNMYWIlMkZsaWx0LXJvYmVydGEtZW4tYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyU0NVVC1ETFZDTGFiJTJGbGlsdC1yb2JlcnRhLWVuLWJhc2UlMjIpJTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJuaWVsc3IlMkZmdW5zZC1sYXlvdXRsbXYzJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiUyMiklMEFleGFtcGxlJTIwJTNEJTIwZGF0YXNldCU1QjAlNUQlMEF3b3JkcyUyMCUzRCUyMGV4YW1wbGUlNUIlMjJ0b2tlbnMlMjIlNUQlMEFib3hlcyUyMCUzRCUyMGV4YW1wbGUlNUIlMjJiYm94ZXMlMjIlNUQlMEElMEFlbmNvZGluZyUyMCUzRCUyMHRva2VuaXplcih3b3JkcyUyQyUyMGJveGVzJTNEYm94ZXMlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmVuY29kaW5nKSUwQWxhc3RfaGlkZGVuX3N0YXRlcyUyMCUzRCUyMG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGU=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;nielsr/funsd-layoutlmv3&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example = dataset[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>words = example[<span class="hljs-string">&quot;tokens&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = example[<span class="hljs-string">&quot;bboxes&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(words, boxes=boxes, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<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`}}),{c(){c=n("p"),y=r("Examples:"),_=p(),T(g.$$.fragment)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),v(g,l,f),b=!0},p:No,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),L(g,l)}}}function ol($){let c,y,_,g,b;return{c(){c=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var x=a(_);g=i(x,"Module"),x.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,c,f),e(c,y),e(c,_),e(_,g),e(c,b)},d(l){l&&o(c)}}}function nl($){let c,y,_,g,b;return g=new oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyU0NVVC1ETFZDTGFiJTJGbGlsdC1yb2JlcnRhLWVuLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJTQ1VULURMVkNMYWIlMkZsaWx0LXJvYmVydGEtZW4tYmFzZSUyMiklMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMm5pZWxzciUyRmZ1bnNkLWxheW91dGxtdjMlMjIlMkMlMjBzcGxpdCUzRCUyMnRyYWluJTIyKSUwQWV4YW1wbGUlMjAlM0QlMjBkYXRhc2V0JTVCMCU1RCUwQXdvcmRzJTIwJTNEJTIwZXhhbXBsZSU1QiUyMnRva2VucyUyMiU1RCUwQWJveGVzJTIwJTNEJTIwZXhhbXBsZSU1QiUyMmJib3hlcyUyMiU1RCUwQSUwQWVuY29kaW5nJTIwJTNEJTIwdG9rZW5pemVyKHdvcmRzJTJDJTIwYm94ZXMlM0Rib3hlcyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmcpJTBBcHJlZGljdGVkX2NsYXNzX2lkeCUyMCUzRCUyMG91dHB1dHMubG9naXRzLmFyZ21heCgtMSkuaXRlbSgpJTBBcHJlZGljdGVkX2NsYXNzJTIwJTNEJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2NsYXNzX2lkeCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;nielsr/funsd-layoutlmv3&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example = dataset[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>words = example[<span class="hljs-string">&quot;tokens&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = example[<span class="hljs-string">&quot;bboxes&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(words, boxes=boxes, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = outputs.logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class = model.config.id2label[predicted_class_idx]`}}),{c(){c=n("p"),y=r("Examples:"),_=p(),T(g.$$.fragment)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),v(g,l,f),b=!0},p:No,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),L(g,l)}}}function sl($){let c,y,_,g,b;return{c(){c=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var x=a(_);g=i(x,"Module"),x.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,c,f),e(c,y),e(c,_),e(_,g),e(c,b)},d(l){l&&o(c)}}}function al($){let c,y,_,g,b;return g=new oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBdG9rZW5pemVyJTIwJTNEJTIwQXV0b1Rva2VuaXplci5mcm9tX3ByZXRyYWluZWQoJTIyU0NVVC1ETFZDTGFiJTJGbGlsdC1yb2JlcnRhLWVuLWJhc2UlMjIpJTBBbW9kZWwlMjAlM0QlMjBBdXRvTW9kZWxGb3JUb2tlbkNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJTQ1VULURMVkNMYWIlMkZsaWx0LXJvYmVydGEtZW4tYmFzZSUyMiklMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMm5pZWxzciUyRmZ1bnNkLWxheW91dGxtdjMlMjIlMkMlMjBzcGxpdCUzRCUyMnRyYWluJTIyKSUwQWV4YW1wbGUlMjAlM0QlMjBkYXRhc2V0JTVCMCU1RCUwQXdvcmRzJTIwJTNEJTIwZXhhbXBsZSU1QiUyMnRva2VucyUyMiU1RCUwQWJveGVzJTIwJTNEJTIwZXhhbXBsZSU1QiUyMmJib3hlcyUyMiU1RCUwQSUwQWVuY29kaW5nJTIwJTNEJTIwdG9rZW5pemVyKHdvcmRzJTJDJTIwYm94ZXMlM0Rib3hlcyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmcpJTBBcHJlZGljdGVkX2NsYXNzX2luZGljZXMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cy5hcmdtYXgoLTEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForTokenClassification.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;nielsr/funsd-layoutlmv3&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example = dataset[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>words = example[<span class="hljs-string">&quot;tokens&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = example[<span class="hljs-string">&quot;bboxes&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(words, boxes=boxes, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_indices = outputs.logits.argmax(-<span class="hljs-number">1</span>)`}}),{c(){c=n("p"),y=r("Examples:"),_=p(),T(g.$$.fragment)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),v(g,l,f),b=!0},p:No,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),L(g,l)}}}function rl($){let c,y,_,g,b;return{c(){c=n("p"),y=r("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=r("Module"),b=r(`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=s(f,"CODE",{});var x=a(_);g=i(x,"Module"),x.forEach(o),b=i(f,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),f.forEach(o)},m(l,f){u(l,c,f),e(c,y),e(c,_),e(_,g),e(c,b)},d(l){l&&o(c)}}}function il($){let c,y,_,g,b;return g=new oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMkMlMjBBdXRvTW9kZWxGb3JRdWVzdGlvbkFuc3dlcmluZyUwQWZyb20lMjBkYXRhc2V0cyUyMGltcG9ydCUyMGxvYWRfZGF0YXNldCUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMlNDVVQtRExWQ0xhYiUyRmxpbHQtcm9iZXJ0YS1lbi1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yUXVlc3Rpb25BbnN3ZXJpbmcuZnJvbV9wcmV0cmFpbmVkKCUyMlNDVVQtRExWQ0xhYiUyRmxpbHQtcm9iZXJ0YS1lbi1iYXNlJTIyKSUwQSUwQWRhdGFzZXQlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTIybmllbHNyJTJGZnVuc2QtbGF5b3V0bG12MyUyMiUyQyUyMHNwbGl0JTNEJTIydHJhaW4lMjIpJTBBZXhhbXBsZSUyMCUzRCUyMGRhdGFzZXQlNUIwJTVEJTBBd29yZHMlMjAlM0QlMjBleGFtcGxlJTVCJTIydG9rZW5zJTIyJTVEJTBBYm94ZXMlMjAlM0QlMjBleGFtcGxlJTVCJTIyYmJveGVzJTIyJTVEJTBBJTBBZW5jb2RpbmclMjAlM0QlMjB0b2tlbml6ZXIod29yZHMlMkMlMjBib3hlcyUzRGJveGVzJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiplbmNvZGluZyklMEElMEFhbnN3ZXJfc3RhcnRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLnN0YXJ0X2xvZ2l0cy5hcmdtYXgoKSUwQWFuc3dlcl9lbmRfaW5kZXglMjAlM0QlMjBvdXRwdXRzLmVuZF9sb2dpdHMuYXJnbWF4KCklMEElMEFwcmVkaWN0X2Fuc3dlcl90b2tlbnMlMjAlM0QlMjBlbmNvZGluZy5pbnB1dF9pZHMlNUIwJTJDJTIwYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNBJTIwYW5zd2VyX2VuZF9pbmRleCUyMCUyQiUyMDElNUQlMEFwcmVkaWN0ZWRfYW5zd2VyJTIwJTNEJTIwdG9rZW5pemVyLmRlY29kZShwcmVkaWN0X2Fuc3dlcl90b2tlbnMp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, AutoModelForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;SCUT-DLVCLab/lilt-roberta-en-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;nielsr/funsd-layoutlmv3&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>example = dataset[<span class="hljs-number">0</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>words = example[<span class="hljs-string">&quot;tokens&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>boxes = example[<span class="hljs-string">&quot;bboxes&quot;</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(words, boxes=boxes, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = encoding.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_answer = tokenizer.decode(predict_answer_tokens)`}}),{c(){c=n("p"),y=r("Examples:"),_=p(),T(g.$$.fragment)},l(l){c=s(l,"P",{});var f=a(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),w(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),v(g,l,f),b=!0},p:No,i(l){b||(k(g.$$.fragment,l),b=!0)},o(l){M(g.$$.fragment,l),b=!1},d(l){l&&o(c),l&&o(_),L(g,l)}}}function ll($){let c,y,_,g,b,l,f,x,qn,So,O,de,no,Ue,Wn,so,Zn,Vo,N,In,qe,Rn,An,wt,Nn,Sn,Xo,vt,Vn,Bo,kt,ao,Xn,Go,Mt,Bn,Po,Lt,J,Gn,We,Pn,Qn,Ze,On,Yn,ro,Dn,Hn,io,Kn,es,Qo,Ie,Oo,ce,lo,ts,os,E,ns,Re,ss,as,$t,rs,is,xt,ls,ds,Ae,cs,hs,Et,ps,ms,Yo,he,$r,Do,pe,us,Ct,fs,gs,Ho,S,_s,Ne,bs,ys,Se,Ts,ws,Ko,Y,me,co,Ve,vs,ho,ks,en,Ft,Ms,tn,zt,Xe,Ls,Be,$s,xs,on,Jt,po,Es,nn,V,mo,jt,Cs,Fs,uo,Ut,zs,Js,fo,qt,js,sn,Wt,Us,an,D,ue,go,Ge,qs,_o,Ws,rn,A,Pe,Zs,j,Is,Zt,Rs,As,Qe,Ns,Ss,It,Vs,Xs,Rt,Bs,Gs,Ps,fe,ln,H,ge,bo,Oe,Qs,yo,Os,dn,U,Ye,Ys,De,Ds,At,Hs,Ks,ea,He,ta,Ke,oa,na,sa,q,et,aa,K,ra,Nt,ia,la,To,da,ca,ha,_e,pa,be,cn,ee,ye,wo,tt,ma,vo,ua,hn,C,ot,fa,ko,ga,_a,nt,ba,St,ya,Ta,wa,st,va,at,ka,Ma,La,W,rt,$a,te,xa,Vt,Ea,Ca,Mo,Fa,za,Ja,Te,ja,we,pn,oe,ve,Lo,it,Ua,$o,qa,mn,F,lt,Wa,xo,Za,Ia,dt,Ra,Xt,Aa,Na,Sa,ct,Va,ht,Xa,Ba,Ga,Z,pt,Pa,ne,Qa,Bt,Oa,Ya,Eo,Da,Ha,Ka,ke,er,Me,un,se,Le,Co,mt,tr,Fo,or,fn,z,ut,nr,ae,sr,zo,ar,rr,Jo,ir,lr,dr,ft,cr,Gt,hr,pr,mr,gt,ur,_t,fr,gr,_r,I,bt,br,re,yr,Pt,Tr,wr,jo,vr,kr,Mr,$e,Lr,xe,gn;return l=new je({}),Ue=new je({}),Ie=new oo({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMExpbHRNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwTGlsdE1vZGVsLmZyb21fcHJldHJhaW5lZCglMjJwYXRoX3RvX3lvdXJfZmlsZXMlMjIpJTBBbW9kZWwucHVzaF90b19odWIoJTIybmFtZV9vZl9yZXBvX29uX3RoZV9odWIlMjIp",highlighted:`from transformers import LiltModel

model = <span class="hljs-module-access"><span class="hljs-module"><span class="hljs-identifier">LiltModel</span>.</span></span>from<span class="hljs-constructor">_pretrained(<span class="hljs-string">&quot;path_to_your_files&quot;</span>)</span>
model.push<span class="hljs-constructor">_to_hub(<span class="hljs-string">&quot;name_of_repo_on_the_hub&quot;</span>)</span>`}}),Ve=new je({}),Ge=new je({}),Pe=new le({props:{name:"class transformers.LiltConfig",anchor:"transformers.LiltConfig",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:"position_embedding_type",val:" = 'absolute'"},{name:"classifier_dropout",val:" = None"},{name:"channel_shrink_ratio",val:" = 4"},{name:"max_2d_position_embeddings",val:" = 1024"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LiltConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the LiLT 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/lilt#transformers.LiltModel">LiltModel</a>.`,name:"vocab_size"},{anchor:"transformers.LiltConfig.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. Should be a multiple of 24.`,name:"hidden_size"},{anchor:"transformers.LiltConfig.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.LiltConfig.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.LiltConfig.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.LiltConfig.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.LiltConfig.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.LiltConfig.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.LiltConfig.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.LiltConfig.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/lilt#transformers.LiltModel">LiltModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.LiltConfig.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.LiltConfig.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.LiltConfig.position_embedding_type",description:`<strong>position_embedding_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;absolute&quot;</code>) &#x2014;
Type of position embedding. Choose one of <code>&quot;absolute&quot;</code>, <code>&quot;relative_key&quot;</code>, <code>&quot;relative_key_query&quot;</code>. For
positional embeddings use <code>&quot;absolute&quot;</code>. For more information on <code>&quot;relative_key&quot;</code>, please refer to
<a href="https://arxiv.org/abs/1803.02155" rel="nofollow">Self-Attention with Relative Position Representations (Shaw et al.)</a>.
For more information on <code>&quot;relative_key_query&quot;</code>, please refer to <em>Method 4</em> in <a href="https://arxiv.org/abs/2009.13658" rel="nofollow">Improve Transformer Models
with Better Relative Position Embeddings (Huang et al.)</a>.`,name:"position_embedding_type"},{anchor:"transformers.LiltConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"},{anchor:"transformers.LiltConfig.channel_shrink_ratio",description:`<strong>channel_shrink_ratio</strong> (<code>int</code>, <em>optional</em>, defaults to 4) &#x2014;
The shrink ratio compared to the <code>hidden_size</code> for the channel dimension of the layout embeddings.`,name:"channel_shrink_ratio"},{anchor:"transformers.LiltConfig.max_2d_position_embeddings",description:`<strong>max_2d_position_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum value that the 2D position embedding might ever be used with. Typically set this to something
large just in case (e.g., 1024).`,name:"max_2d_position_embeddings"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lilt/configuration_lilt.py#L30"}}),fe=new Ao({props:{anchor:"transformers.LiltConfig.example",$$slots:{default:[Ki]},$$scope:{ctx:$}}}),Oe=new je({}),Ye=new le({props:{name:"class transformers.LiltModel",anchor:"transformers.LiltModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.LiltModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/lilt#transformers.LiltConfig">LiltConfig</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/lilt/modeling_lilt.py#L691"}}),et=new le({props:{name:"forward",anchor:"transformers.LiltModel.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:"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.LiltModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/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.LiltModel.forward.bbox",description:`<strong>bbox</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, 4)</code>, <em>optional</em>) &#x2014;
Bounding boxes of each input sequence tokens. Selected in the range <code>[0, config.max_2d_position_embeddings-1]</code>. Each bounding box should be a normalized version in (x0, y0, x1, y1)
format, where (x0, y0) corresponds to the position of the upper left corner in the bounding box, and (x1,
y1) represents the position of the lower right corner. See <a href="#Overview">Overview</a> for normalization.`,name:"bbox"},{anchor:"transformers.LiltModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LiltModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LiltModel.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LiltModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LiltModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LiltModel.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.LiltModel.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.LiltModel.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/lilt/modeling_lilt.py#L719",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</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/lilt#transformers.LiltConfig"
>LiltConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPooling"
>transformers.modeling_outputs.BaseModelOutputWithPooling</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),_e=new Un({props:{$$slots:{default:[el]},$$scope:{ctx:$}}}),be=new Ao({props:{anchor:"transformers.LiltModel.forward.example",$$slots:{default:[tl]},$$scope:{ctx:$}}}),tt=new je({}),ot=new le({props:{name:"class transformers.LiltForSequenceClassification",anchor:"transformers.LiltForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LiltForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/lilt#transformers.LiltConfig">LiltConfig</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/lilt/modeling_lilt.py#L840"}}),rt=new le({props:{name:"forward",anchor:"transformers.LiltForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"bbox",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.LiltForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/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.LiltForSequenceClassification.forward.bbox",description:`<strong>bbox</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, 4)</code>, <em>optional</em>) &#x2014;
Bounding boxes of each input sequence tokens. Selected in the range <code>[0, config.max_2d_position_embeddings-1]</code>. Each bounding box should be a normalized version in (x0, y0, x1, y1)
format, where (x0, y0) corresponds to the position of the upper left corner in the bounding box, and (x1,
y1) represents the position of the lower right corner. See <a href="#Overview">Overview</a> for normalization.`,name:"bbox"},{anchor:"transformers.LiltForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LiltForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LiltForSequenceClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LiltForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LiltForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LiltForSequenceClassification.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.LiltForSequenceClassification.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.LiltForSequenceClassification.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"},{anchor:"transformers.LiltForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lilt/modeling_lilt.py#L853",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/lilt#transformers.LiltConfig"
>LiltConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification (or regression if config.num_labels==1) scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Te=new Un({props:{$$slots:{default:[ol]},$$scope:{ctx:$}}}),we=new Ao({props:{anchor:"transformers.LiltForSequenceClassification.forward.example",$$slots:{default:[nl]},$$scope:{ctx:$}}}),it=new je({}),lt=new le({props:{name:"class transformers.LiltForTokenClassification",anchor:"transformers.LiltForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LiltForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/lilt#transformers.LiltConfig">LiltConfig</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/lilt/modeling_lilt.py#L958"}}),pt=new le({props:{name:"forward",anchor:"transformers.LiltForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"bbox",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = 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.LiltForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/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.LiltForTokenClassification.forward.bbox",description:`<strong>bbox</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, 4)</code>, <em>optional</em>) &#x2014;
Bounding boxes of each input sequence tokens. Selected in the range <code>[0, config.max_2d_position_embeddings-1]</code>. Each bounding box should be a normalized version in (x0, y0, x1, y1)
format, where (x0, y0) corresponds to the position of the upper left corner in the bounding box, and (x1,
y1) represents the position of the lower right corner. See <a href="#Overview">Overview</a> for normalization.`,name:"bbox"},{anchor:"transformers.LiltForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LiltForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LiltForTokenClassification.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LiltForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LiltForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LiltForTokenClassification.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.LiltForTokenClassification.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.LiltForTokenClassification.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"},{anchor:"transformers.LiltForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lilt/modeling_lilt.py#L974",returnDescription:`
<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/lilt#transformers.LiltConfig"
>LiltConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ke=new Un({props:{$$slots:{default:[sl]},$$scope:{ctx:$}}}),Me=new Ao({props:{anchor:"transformers.LiltForTokenClassification.forward.example",$$slots:{default:[al]},$$scope:{ctx:$}}}),mt=new je({}),ut=new le({props:{name:"class transformers.LiltForQuestionAnswering",anchor:"transformers.LiltForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LiltForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/lilt#transformers.LiltConfig">LiltConfig</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/lilt/modeling_lilt.py#L1084"}}),bt=new le({props:{name:"forward",anchor:"transformers.LiltForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"bbox",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = 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.LiltForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/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.LiltForQuestionAnswering.forward.bbox",description:`<strong>bbox</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, 4)</code>, <em>optional</em>) &#x2014;
Bounding boxes of each input sequence tokens. Selected in the range <code>[0, config.max_2d_position_embeddings-1]</code>. Each bounding box should be a normalized version in (x0, y0, x1, y1)
format, where (x0, y0) corresponds to the position of the upper left corner in the bounding box, and (x1,
y1) represents the position of the lower right corner. See <a href="#Overview">Overview</a> for normalization.`,name:"bbox"},{anchor:"transformers.LiltForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LiltForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LiltForQuestionAnswering.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LiltForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LiltForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LiltForQuestionAnswering.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.LiltForQuestionAnswering.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.LiltForQuestionAnswering.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"},{anchor:"transformers.LiltForQuestionAnswering.forward.start_positions",description:`<strong>start_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the start of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"start_positions"},{anchor:"transformers.LiltForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/lilt/modeling_lilt.py#L1096",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/lilt#transformers.LiltConfig"
>LiltConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.</p>
</li>
<li>
<p><strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$e=new Un({props:{$$slots:{default:[rl]},$$scope:{ctx:$}}}),xe=new Ao({props:{anchor:"transformers.LiltForQuestionAnswering.forward.example",$$slots:{default:[il]},$$scope:{ctx:$}}}),{c(){c=n("meta"),y=p(),_=n("h1"),g=n("a"),b=n("span"),T(l.$$.fragment),f=p(),x=n("span"),qn=r("LiLT"),So=p(),O=n("h2"),de=n("a"),no=n("span"),T(Ue.$$.fragment),Wn=p(),so=n("span"),Zn=r("Overview"),Vo=p(),N=n("p"),In=r("The LiLT model was proposed in "),qe=n("a"),Rn=r("LiLT: A Simple yet Effective Language-Independent Layout Transformer for Structured Document Understanding"),An=r(` by Jiapeng Wang, Lianwen Jin, Kai Ding.
LiLT allows to combine any pre-trained RoBERTa text encoder with a lightweight Layout Transformer, to enable `),wt=n("a"),Nn=r("LayoutLM"),Sn=r(`-like document understanding for many
languages.`),Xo=p(),vt=n("p"),Vn=r("The abstract from the paper is the following:"),Bo=p(),kt=n("p"),ao=n("em"),Xn=r("Structured document understanding has attracted considerable attention and made significant progress recently, owing to its crucial role in intelligent document processing. However, most existing related models can only deal with the document data of specific language(s) (typically English) included in the pre-training collection, which is extremely limited. To address this issue, we propose a simple yet effective Language-independent Layout Transformer (LiLT) for structured document understanding. LiLT can be pre-trained on the structured documents of a single language and then directly fine-tuned on other languages with the corresponding off-the-shelf monolingual/multilingual pre-trained textual models. Experimental results on eight languages have shown that LiLT can achieve competitive or even superior performance on diverse widely-used downstream benchmarks, which enables language-independent benefit from the pre-training of document layout structure."),Go=p(),Mt=n("p"),Bn=r("Tips:"),Po=p(),Lt=n("ul"),J=n("li"),Gn=r("To combine the Language-Independent Layout Transformer with a new RoBERTa checkpoint from the "),We=n("a"),Pn=r("hub"),Qn=r(", refer to "),Ze=n("a"),On=r("this guide"),Yn=r(`.
The script will result in `),ro=n("code"),Dn=r("config.json"),Hn=r(" and "),io=n("code"),Kn=r("pytorch_model.bin"),es=r(" files being stored locally. After doing this, one can do the following (assuming you\u2019re logged in with your HuggingFace account):"),Qo=p(),T(Ie.$$.fragment),Oo=p(),ce=n("ul"),lo=n("li"),ts=r("When preparing data for the model, make sure to use the token vocabulary that corresponds to the RoBERTa checkpoint you combined with the Layout Transformer."),os=p(),E=n("li"),ns=r("As "),Re=n("a"),ss=r("lilt-roberta-en-base"),as=r(" uses the same vocabulary as "),$t=n("a"),rs=r("LayoutLMv3"),is=r(", one can use "),xt=n("a"),ls=r("LayoutLMv3TokenizerFast"),ds=r(` to prepare data for the model.
The same is true for `),Ae=n("a"),cs=r("lilt-roberta-en-base"),hs=r(": one can use "),Et=n("a"),ps=r("LayoutXLMTokenizerFast"),ms=r(" for that model."),Yo=p(),he=n("img"),Do=p(),pe=n("small"),us=r("LiLT architecture. Taken from the "),Ct=n("a"),fs=r("original paper"),gs=r("."),Ho=p(),S=n("p"),_s=r("This model was contributed by "),Ne=n("a"),bs=r("nielsr"),ys=r(`.
The original code can be found `),Se=n("a"),Ts=r("here"),ws=r("."),Ko=p(),Y=n("h2"),me=n("a"),co=n("span"),T(Ve.$$.fragment),vs=p(),ho=n("span"),ks=r("Resources"),en=p(),Ft=n("p"),Ms=r("A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with LiLT."),tn=p(),zt=n("ul"),Xe=n("li"),Ls=r("Demo notebooks for LiLT can be found "),Be=n("a"),$s=r("here"),xs=r("."),on=p(),Jt=n("p"),po=n("strong"),Es=r("Documentation resources"),nn=p(),V=n("ul"),mo=n("li"),jt=n("a"),Cs=r("Text classification task guide"),Fs=p(),uo=n("li"),Ut=n("a"),zs=r("Token classification task guide"),Js=p(),fo=n("li"),qt=n("a"),js=r("Question answering task guide"),sn=p(),Wt=n("p"),Us=r("If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),an=p(),D=n("h2"),ue=n("a"),go=n("span"),T(Ge.$$.fragment),qs=p(),_o=n("span"),Ws=r("LiltConfig"),rn=p(),A=n("div"),T(Pe.$$.fragment),Zs=p(),j=n("p"),Is=r("This is the configuration class to store the configuration of a "),Zt=n("a"),Rs=r("LiltModel"),As=r(`. It is used to instantiate a LiLT
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 LiLT
`),Qe=n("a"),Ns=r("SCUT-DLVCLab/lilt-roberta-en-base"),Ss=r(` architecture.
Configuration objects inherit from `),It=n("a"),Vs=r("PretrainedConfig"),Xs=r(` and can be used to control the model outputs. Read the
documentation from `),Rt=n("a"),Bs=r("PretrainedConfig"),Gs=r(" for more information."),Ps=p(),T(fe.$$.fragment),ln=p(),H=n("h2"),ge=n("a"),bo=n("span"),T(Oe.$$.fragment),Qs=p(),yo=n("span"),Os=r("LiltModel"),dn=p(),U=n("div"),T(Ye.$$.fragment),Ys=p(),De=n("p"),Ds=r(`The bare LiLT Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),At=n("a"),Hs=r("PreTrainedModel"),Ks=r(`. 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.)`),ea=p(),He=n("p"),ta=r("This model is also a PyTorch "),Ke=n("a"),oa=r("torch.nn.Module"),na=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sa=p(),q=n("div"),T(et.$$.fragment),aa=p(),K=n("p"),ra=r("The "),Nt=n("a"),ia=r("LiltModel"),la=r(" forward method, overrides the "),To=n("code"),da=r("__call__"),ca=r(" special method."),ha=p(),T(_e.$$.fragment),pa=p(),T(be.$$.fragment),cn=p(),ee=n("h2"),ye=n("a"),wo=n("span"),T(tt.$$.fragment),ma=p(),vo=n("span"),ua=r("LiltForSequenceClassification"),hn=p(),C=n("div"),T(ot.$$.fragment),fa=p(),ko=n("p"),ga=r(`LiLT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),_a=p(),nt=n("p"),ba=r("This model inherits from "),St=n("a"),ya=r("PreTrainedModel"),Ta=r(`. 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.)`),wa=p(),st=n("p"),va=r("This model is also a PyTorch "),at=n("a"),ka=r("torch.nn.Module"),Ma=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),La=p(),W=n("div"),T(rt.$$.fragment),$a=p(),te=n("p"),xa=r("The "),Vt=n("a"),Ea=r("LiltForSequenceClassification"),Ca=r(" forward method, overrides the "),Mo=n("code"),Fa=r("__call__"),za=r(" special method."),Ja=p(),T(Te.$$.fragment),ja=p(),T(we.$$.fragment),pn=p(),oe=n("h2"),ve=n("a"),Lo=n("span"),T(it.$$.fragment),Ua=p(),$o=n("span"),qa=r("LiltForTokenClassification"),mn=p(),F=n("div"),T(lt.$$.fragment),Wa=p(),xo=n("p"),Za=r(`Lilt Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Ia=p(),dt=n("p"),Ra=r("This model inherits from "),Xt=n("a"),Aa=r("PreTrainedModel"),Na=r(`. 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.)`),Sa=p(),ct=n("p"),Va=r("This model is also a PyTorch "),ht=n("a"),Xa=r("torch.nn.Module"),Ba=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ga=p(),Z=n("div"),T(pt.$$.fragment),Pa=p(),ne=n("p"),Qa=r("The "),Bt=n("a"),Oa=r("LiltForTokenClassification"),Ya=r(" forward method, overrides the "),Eo=n("code"),Da=r("__call__"),Ha=r(" special method."),Ka=p(),T(ke.$$.fragment),er=p(),T(Me.$$.fragment),un=p(),se=n("h2"),Le=n("a"),Co=n("span"),T(mt.$$.fragment),tr=p(),Fo=n("span"),or=r("LiltForQuestionAnswering"),fn=p(),z=n("div"),T(ut.$$.fragment),nr=p(),ae=n("p"),sr=r(`Lilt Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),zo=n("code"),ar=r("span start logits"),rr=r(" and "),Jo=n("code"),ir=r("span end logits"),lr=r(")."),dr=p(),ft=n("p"),cr=r("This model inherits from "),Gt=n("a"),hr=r("PreTrainedModel"),pr=r(`. 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.)`),mr=p(),gt=n("p"),ur=r("This model is also a PyTorch "),_t=n("a"),fr=r("torch.nn.Module"),gr=r(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_r=p(),I=n("div"),T(bt.$$.fragment),br=p(),re=n("p"),yr=r("The "),Pt=n("a"),Tr=r("LiltForQuestionAnswering"),wr=r(" forward method, overrides the "),jo=n("code"),vr=r("__call__"),kr=r(" special method."),Mr=p(),T($e.$$.fragment),Lr=p(),T(xe.$$.fragment),this.h()},l(t){const h=Yi('[data-svelte="svelte-1phssyn"]',document.head);c=s(h,"META",{name:!0,content:!0}),h.forEach(o),y=m(t),_=s(t,"H1",{class:!0});var yt=a(_);g=s(yt,"A",{id:!0,class:!0,href:!0});var Uo=a(g);b=s(Uo,"SPAN",{});var qo=a(b);w(l.$$.fragment,qo),qo.forEach(o),Uo.forEach(o),f=m(yt),x=s(yt,"SPAN",{});var Wo=a(x);qn=i(Wo,"LiLT"),Wo.forEach(o),yt.forEach(o),So=m(t),O=s(t,"H2",{class:!0});var Tt=a(O);de=s(Tt,"A",{id:!0,class:!0,href:!0});var Zo=a(de);no=s(Zo,"SPAN",{});var Io=a(no);w(Ue.$$.fragment,Io),Io.forEach(o),Zo.forEach(o),Wn=m(Tt),so=s(Tt,"SPAN",{});var Ro=a(so);Zn=i(Ro,"Overview"),Ro.forEach(o),Tt.forEach(o),Vo=m(t),N=s(t,"P",{});var ie=a(N);In=i(ie,"The LiLT model was proposed in "),qe=s(ie,"A",{href:!0,rel:!0});var xr=a(qe);Rn=i(xr,"LiLT: A Simple yet Effective Language-Independent Layout Transformer for Structured Document Understanding"),xr.forEach(o),An=i(ie,` by Jiapeng Wang, Lianwen Jin, Kai Ding.
LiLT allows to combine any pre-trained RoBERTa text encoder with a lightweight Layout Transformer, to enable `),wt=s(ie,"A",{href:!0});var Er=a(wt);Nn=i(Er,"LayoutLM"),Er.forEach(o),Sn=i(ie,`-like document understanding for many
languages.`),ie.forEach(o),Xo=m(t),vt=s(t,"P",{});var Cr=a(vt);Vn=i(Cr,"The abstract from the paper is the following:"),Cr.forEach(o),Bo=m(t),kt=s(t,"P",{});var Fr=a(kt);ao=s(Fr,"EM",{});var zr=a(ao);Xn=i(zr,"Structured document understanding has attracted considerable attention and made significant progress recently, owing to its crucial role in intelligent document processing. However, most existing related models can only deal with the document data of specific language(s) (typically English) included in the pre-training collection, which is extremely limited. To address this issue, we propose a simple yet effective Language-independent Layout Transformer (LiLT) for structured document understanding. LiLT can be pre-trained on the structured documents of a single language and then directly fine-tuned on other languages with the corresponding off-the-shelf monolingual/multilingual pre-trained textual models. Experimental results on eight languages have shown that LiLT can achieve competitive or even superior performance on diverse widely-used downstream benchmarks, which enables language-independent benefit from the pre-training of document layout structure."),zr.forEach(o),Fr.forEach(o),Go=m(t),Mt=s(t,"P",{});var Jr=a(Mt);Bn=i(Jr,"Tips:"),Jr.forEach(o),Po=m(t),Lt=s(t,"UL",{});var jr=a(Lt);J=s(jr,"LI",{});var X=a(J);Gn=i(X,"To combine the Language-Independent Layout Transformer with a new RoBERTa checkpoint from the "),We=s(X,"A",{href:!0,rel:!0});var Ur=a(We);Pn=i(Ur,"hub"),Ur.forEach(o),Qn=i(X,", refer to "),Ze=s(X,"A",{href:!0,rel:!0});var qr=a(Ze);On=i(qr,"this guide"),qr.forEach(o),Yn=i(X,`.
The script will result in `),ro=s(X,"CODE",{});var Wr=a(ro);Dn=i(Wr,"config.json"),Wr.forEach(o),Hn=i(X," and "),io=s(X,"CODE",{});var Zr=a(io);Kn=i(Zr,"pytorch_model.bin"),Zr.forEach(o),es=i(X," files being stored locally. After doing this, one can do the following (assuming you\u2019re logged in with your HuggingFace account):"),X.forEach(o),jr.forEach(o),Qo=m(t),w(Ie.$$.fragment,t),Oo=m(t),ce=s(t,"UL",{});var _n=a(ce);lo=s(_n,"LI",{});var Ir=a(lo);ts=i(Ir,"When preparing data for the model, make sure to use the token vocabulary that corresponds to the RoBERTa checkpoint you combined with the Layout Transformer."),Ir.forEach(o),os=m(_n),E=s(_n,"LI",{});var R=a(E);ns=i(R,"As "),Re=s(R,"A",{href:!0,rel:!0});var Rr=a(Re);ss=i(Rr,"lilt-roberta-en-base"),Rr.forEach(o),as=i(R," uses the same vocabulary as "),$t=s(R,"A",{href:!0});var Ar=a($t);rs=i(Ar,"LayoutLMv3"),Ar.forEach(o),is=i(R,", one can use "),xt=s(R,"A",{href:!0});var Nr=a(xt);ls=i(Nr,"LayoutLMv3TokenizerFast"),Nr.forEach(o),ds=i(R,` to prepare data for the model.
The same is true for `),Ae=s(R,"A",{href:!0,rel:!0});var Sr=a(Ae);cs=i(Sr,"lilt-roberta-en-base"),Sr.forEach(o),hs=i(R,": one can use "),Et=s(R,"A",{href:!0});var Vr=a(Et);ps=i(Vr,"LayoutXLMTokenizerFast"),Vr.forEach(o),ms=i(R," for that model."),R.forEach(o),_n.forEach(o),Yo=m(t),he=s(t,"IMG",{src:!0,alt:!0,width:!0}),Do=m(t),pe=s(t,"SMALL",{});var bn=a(pe);us=i(bn,"LiLT architecture. Taken from the "),Ct=s(bn,"A",{href:!0});var Xr=a(Ct);fs=i(Xr,"original paper"),Xr.forEach(o),gs=i(bn,"."),bn.forEach(o),Ho=m(t),S=s(t,"P",{});var Qt=a(S);_s=i(Qt,"This model was contributed by "),Ne=s(Qt,"A",{href:!0,rel:!0});var Br=a(Ne);bs=i(Br,"nielsr"),Br.forEach(o),ys=i(Qt,`.
The original code can be found `),Se=s(Qt,"A",{href:!0,rel:!0});var Gr=a(Se);Ts=i(Gr,"here"),Gr.forEach(o),ws=i(Qt,"."),Qt.forEach(o),Ko=m(t),Y=s(t,"H2",{class:!0});var yn=a(Y);me=s(yn,"A",{id:!0,class:!0,href:!0});var Pr=a(me);co=s(Pr,"SPAN",{});var Qr=a(co);w(Ve.$$.fragment,Qr),Qr.forEach(o),Pr.forEach(o),vs=m(yn),ho=s(yn,"SPAN",{});var Or=a(ho);ks=i(Or,"Resources"),Or.forEach(o),yn.forEach(o),en=m(t),Ft=s(t,"P",{});var Yr=a(Ft);Ms=i(Yr,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with LiLT."),Yr.forEach(o),tn=m(t),zt=s(t,"UL",{});var Dr=a(zt);Xe=s(Dr,"LI",{});var Tn=a(Xe);Ls=i(Tn,"Demo notebooks for LiLT can be found "),Be=s(Tn,"A",{href:!0,rel:!0});var Hr=a(Be);$s=i(Hr,"here"),Hr.forEach(o),xs=i(Tn,"."),Tn.forEach(o),Dr.forEach(o),on=m(t),Jt=s(t,"P",{});var Kr=a(Jt);po=s(Kr,"STRONG",{});var ei=a(po);Es=i(ei,"Documentation resources"),ei.forEach(o),Kr.forEach(o),nn=m(t),V=s(t,"UL",{});var Ot=a(V);mo=s(Ot,"LI",{});var ti=a(mo);jt=s(ti,"A",{href:!0});var oi=a(jt);Cs=i(oi,"Text classification task guide"),oi.forEach(o),ti.forEach(o),Fs=m(Ot),uo=s(Ot,"LI",{});var ni=a(uo);Ut=s(ni,"A",{href:!0});var si=a(Ut);zs=i(si,"Token classification task guide"),si.forEach(o),ni.forEach(o),Js=m(Ot),fo=s(Ot,"LI",{});var ai=a(fo);qt=s(ai,"A",{href:!0});var ri=a(qt);js=i(ri,"Question answering task guide"),ri.forEach(o),ai.forEach(o),Ot.forEach(o),sn=m(t),Wt=s(t,"P",{});var ii=a(Wt);Us=i(ii,"If you\u2019re interested in submitting a resource to be included here, please feel free to open a Pull Request and we\u2019ll review it! The resource should ideally demonstrate something new instead of duplicating an existing resource."),ii.forEach(o),an=m(t),D=s(t,"H2",{class:!0});var wn=a(D);ue=s(wn,"A",{id:!0,class:!0,href:!0});var li=a(ue);go=s(li,"SPAN",{});var di=a(go);w(Ge.$$.fragment,di),di.forEach(o),li.forEach(o),qs=m(wn),_o=s(wn,"SPAN",{});var ci=a(_o);Ws=i(ci,"LiltConfig"),ci.forEach(o),wn.forEach(o),rn=m(t),A=s(t,"DIV",{class:!0});var Yt=a(A);w(Pe.$$.fragment,Yt),Zs=m(Yt),j=s(Yt,"P",{});var B=a(j);Is=i(B,"This is the configuration class to store the configuration of a "),Zt=s(B,"A",{href:!0});var hi=a(Zt);Rs=i(hi,"LiltModel"),hi.forEach(o),As=i(B,`. It is used to instantiate a LiLT
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 LiLT
`),Qe=s(B,"A",{href:!0,rel:!0});var pi=a(Qe);Ns=i(pi,"SCUT-DLVCLab/lilt-roberta-en-base"),pi.forEach(o),Ss=i(B,` architecture.
Configuration objects inherit from `),It=s(B,"A",{href:!0});var mi=a(It);Vs=i(mi,"PretrainedConfig"),mi.forEach(o),Xs=i(B,` and can be used to control the model outputs. Read the
documentation from `),Rt=s(B,"A",{href:!0});var ui=a(Rt);Bs=i(ui,"PretrainedConfig"),ui.forEach(o),Gs=i(B," for more information."),B.forEach(o),Ps=m(Yt),w(fe.$$.fragment,Yt),Yt.forEach(o),ln=m(t),H=s(t,"H2",{class:!0});var vn=a(H);ge=s(vn,"A",{id:!0,class:!0,href:!0});var fi=a(ge);bo=s(fi,"SPAN",{});var gi=a(bo);w(Oe.$$.fragment,gi),gi.forEach(o),fi.forEach(o),Qs=m(vn),yo=s(vn,"SPAN",{});var _i=a(yo);Os=i(_i,"LiltModel"),_i.forEach(o),vn.forEach(o),dn=m(t),U=s(t,"DIV",{class:!0});var Ee=a(U);w(Ye.$$.fragment,Ee),Ys=m(Ee),De=s(Ee,"P",{});var kn=a(De);Ds=i(kn,`The bare LiLT Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),At=s(kn,"A",{href:!0});var bi=a(At);Hs=i(bi,"PreTrainedModel"),bi.forEach(o),Ks=i(kn,`. 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.)`),kn.forEach(o),ea=m(Ee),He=s(Ee,"P",{});var Mn=a(He);ta=i(Mn,"This model is also a PyTorch "),Ke=s(Mn,"A",{href:!0,rel:!0});var yi=a(Ke);oa=i(yi,"torch.nn.Module"),yi.forEach(o),na=i(Mn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mn.forEach(o),sa=m(Ee),q=s(Ee,"DIV",{class:!0});var Ce=a(q);w(et.$$.fragment,Ce),aa=m(Ce),K=s(Ce,"P",{});var Dt=a(K);ra=i(Dt,"The "),Nt=s(Dt,"A",{href:!0});var Ti=a(Nt);ia=i(Ti,"LiltModel"),Ti.forEach(o),la=i(Dt," forward method, overrides the "),To=s(Dt,"CODE",{});var wi=a(To);da=i(wi,"__call__"),wi.forEach(o),ca=i(Dt," special method."),Dt.forEach(o),ha=m(Ce),w(_e.$$.fragment,Ce),pa=m(Ce),w(be.$$.fragment,Ce),Ce.forEach(o),Ee.forEach(o),cn=m(t),ee=s(t,"H2",{class:!0});var Ln=a(ee);ye=s(Ln,"A",{id:!0,class:!0,href:!0});var vi=a(ye);wo=s(vi,"SPAN",{});var ki=a(wo);w(tt.$$.fragment,ki),ki.forEach(o),vi.forEach(o),ma=m(Ln),vo=s(Ln,"SPAN",{});var Mi=a(vo);ua=i(Mi,"LiltForSequenceClassification"),Mi.forEach(o),Ln.forEach(o),hn=m(t),C=s(t,"DIV",{class:!0});var G=a(C);w(ot.$$.fragment,G),fa=m(G),ko=s(G,"P",{});var Li=a(ko);ga=i(Li,`LiLT Model transformer with a sequence classification/regression head on top (a linear layer on top of the pooled
output) e.g. for GLUE tasks.`),Li.forEach(o),_a=m(G),nt=s(G,"P",{});var $n=a(nt);ba=i($n,"This model inherits from "),St=s($n,"A",{href:!0});var $i=a(St);ya=i($i,"PreTrainedModel"),$i.forEach(o),Ta=i($n,`. 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.)`),$n.forEach(o),wa=m(G),st=s(G,"P",{});var xn=a(st);va=i(xn,"This model is also a PyTorch "),at=s(xn,"A",{href:!0,rel:!0});var xi=a(at);ka=i(xi,"torch.nn.Module"),xi.forEach(o),Ma=i(xn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),xn.forEach(o),La=m(G),W=s(G,"DIV",{class:!0});var Fe=a(W);w(rt.$$.fragment,Fe),$a=m(Fe),te=s(Fe,"P",{});var Ht=a(te);xa=i(Ht,"The "),Vt=s(Ht,"A",{href:!0});var Ei=a(Vt);Ea=i(Ei,"LiltForSequenceClassification"),Ei.forEach(o),Ca=i(Ht," forward method, overrides the "),Mo=s(Ht,"CODE",{});var Ci=a(Mo);Fa=i(Ci,"__call__"),Ci.forEach(o),za=i(Ht," special method."),Ht.forEach(o),Ja=m(Fe),w(Te.$$.fragment,Fe),ja=m(Fe),w(we.$$.fragment,Fe),Fe.forEach(o),G.forEach(o),pn=m(t),oe=s(t,"H2",{class:!0});var En=a(oe);ve=s(En,"A",{id:!0,class:!0,href:!0});var Fi=a(ve);Lo=s(Fi,"SPAN",{});var zi=a(Lo);w(it.$$.fragment,zi),zi.forEach(o),Fi.forEach(o),Ua=m(En),$o=s(En,"SPAN",{});var Ji=a($o);qa=i(Ji,"LiltForTokenClassification"),Ji.forEach(o),En.forEach(o),mn=m(t),F=s(t,"DIV",{class:!0});var P=a(F);w(lt.$$.fragment,P),Wa=m(P),xo=s(P,"P",{});var ji=a(xo);Za=i(ji,`Lilt Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),ji.forEach(o),Ia=m(P),dt=s(P,"P",{});var Cn=a(dt);Ra=i(Cn,"This model inherits from "),Xt=s(Cn,"A",{href:!0});var Ui=a(Xt);Aa=i(Ui,"PreTrainedModel"),Ui.forEach(o),Na=i(Cn,`. 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.)`),Cn.forEach(o),Sa=m(P),ct=s(P,"P",{});var Fn=a(ct);Va=i(Fn,"This model is also a PyTorch "),ht=s(Fn,"A",{href:!0,rel:!0});var qi=a(ht);Xa=i(qi,"torch.nn.Module"),qi.forEach(o),Ba=i(Fn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Fn.forEach(o),Ga=m(P),Z=s(P,"DIV",{class:!0});var ze=a(Z);w(pt.$$.fragment,ze),Pa=m(ze),ne=s(ze,"P",{});var Kt=a(ne);Qa=i(Kt,"The "),Bt=s(Kt,"A",{href:!0});var Wi=a(Bt);Oa=i(Wi,"LiltForTokenClassification"),Wi.forEach(o),Ya=i(Kt," forward method, overrides the "),Eo=s(Kt,"CODE",{});var Zi=a(Eo);Da=i(Zi,"__call__"),Zi.forEach(o),Ha=i(Kt," special method."),Kt.forEach(o),Ka=m(ze),w(ke.$$.fragment,ze),er=m(ze),w(Me.$$.fragment,ze),ze.forEach(o),P.forEach(o),un=m(t),se=s(t,"H2",{class:!0});var zn=a(se);Le=s(zn,"A",{id:!0,class:!0,href:!0});var Ii=a(Le);Co=s(Ii,"SPAN",{});var Ri=a(Co);w(mt.$$.fragment,Ri),Ri.forEach(o),Ii.forEach(o),tr=m(zn),Fo=s(zn,"SPAN",{});var Ai=a(Fo);or=i(Ai,"LiltForQuestionAnswering"),Ai.forEach(o),zn.forEach(o),fn=m(t),z=s(t,"DIV",{class:!0});var Q=a(z);w(ut.$$.fragment,Q),nr=m(Q),ae=s(Q,"P",{});var eo=a(ae);sr=i(eo,`Lilt Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
layers on top of the hidden-states output to compute `),zo=s(eo,"CODE",{});var Ni=a(zo);ar=i(Ni,"span start logits"),Ni.forEach(o),rr=i(eo," and "),Jo=s(eo,"CODE",{});var Si=a(Jo);ir=i(Si,"span end logits"),Si.forEach(o),lr=i(eo,")."),eo.forEach(o),dr=m(Q),ft=s(Q,"P",{});var Jn=a(ft);cr=i(Jn,"This model inherits from "),Gt=s(Jn,"A",{href:!0});var Vi=a(Gt);hr=i(Vi,"PreTrainedModel"),Vi.forEach(o),pr=i(Jn,`. 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.)`),Jn.forEach(o),mr=m(Q),gt=s(Q,"P",{});var jn=a(gt);ur=i(jn,"This model is also a PyTorch "),_t=s(jn,"A",{href:!0,rel:!0});var Xi=a(_t);fr=i(Xi,"torch.nn.Module"),Xi.forEach(o),gr=i(jn,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),jn.forEach(o),_r=m(Q),I=s(Q,"DIV",{class:!0});var Je=a(I);w(bt.$$.fragment,Je),br=m(Je),re=s(Je,"P",{});var to=a(re);yr=i(to,"The "),Pt=s(to,"A",{href:!0});var Bi=a(Pt);Tr=i(Bi,"LiltForQuestionAnswering"),Bi.forEach(o),wr=i(to," forward method, overrides the "),jo=s(to,"CODE",{});var Gi=a(jo);vr=i(Gi,"__call__"),Gi.forEach(o),kr=i(to," special method."),to.forEach(o),Mr=m(Je),w($e.$$.fragment,Je),Lr=m(Je),w(xe.$$.fragment,Je),Je.forEach(o),Q.forEach(o),this.h()},h(){d(c,"name","hf:doc:metadata"),d(c,"content",JSON.stringify(dl)),d(g,"id","lilt"),d(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(g,"href","#lilt"),d(_,"class","relative group"),d(de,"id","overview"),d(de,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(de,"href","#overview"),d(O,"class","relative group"),d(qe,"href","https://arxiv.org/abs/2202.13669"),d(qe,"rel","nofollow"),d(wt,"href","layoutlm"),d(We,"href","https://huggingface.co/models?search=roberta"),d(We,"rel","nofollow"),d(Ze,"href","https://github.com/jpWang/LiLT#or-generate-your-own-checkpoint-optional"),d(Ze,"rel","nofollow"),d(Re,"href","https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base"),d(Re,"rel","nofollow"),d($t,"href","layoutlmv3"),d(xt,"href","/docs/transformers/main/en/model_doc/layoutlmv3#transformers.LayoutLMv3TokenizerFast"),d(Ae,"href","https://huggingface.co/SCUT-DLVCLab/lilt-infoxlm-base"),d(Ae,"rel","nofollow"),d(Et,"href","/docs/transformers/main/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizerFast"),Di(he.src,$r="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/lilt_architecture.jpg")||d(he,"src",$r),d(he,"alt","drawing"),d(he,"width","600"),d(Ct,"href","https://arxiv.org/abs/2202.13669"),d(Ne,"href","https://huggingface.co/nielsr"),d(Ne,"rel","nofollow"),d(Se,"href","https://github.com/jpwang/lilt"),d(Se,"rel","nofollow"),d(me,"id","resources"),d(me,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(me,"href","#resources"),d(Y,"class","relative group"),d(Be,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/LiLT"),d(Be,"rel","nofollow"),d(jt,"href","../tasks/sequence_classification"),d(Ut,"href","../tasks/token_classification"),d(qt,"href","../tasks/question_answering"),d(ue,"id","transformers.LiltConfig"),d(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ue,"href","#transformers.LiltConfig"),d(D,"class","relative group"),d(Zt,"href","/docs/transformers/main/en/model_doc/lilt#transformers.LiltModel"),d(Qe,"href","https://huggingface.co/SCUT-DLVCLab/lilt-roberta-en-base"),d(Qe,"rel","nofollow"),d(It,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(Rt,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),d(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ge,"id","transformers.LiltModel"),d(ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ge,"href","#transformers.LiltModel"),d(H,"class","relative group"),d(At,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(Ke,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(Ke,"rel","nofollow"),d(Nt,"href","/docs/transformers/main/en/model_doc/lilt#transformers.LiltModel"),d(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ye,"id","transformers.LiltForSequenceClassification"),d(ye,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ye,"href","#transformers.LiltForSequenceClassification"),d(ee,"class","relative group"),d(St,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(at,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(at,"rel","nofollow"),d(Vt,"href","/docs/transformers/main/en/model_doc/lilt#transformers.LiltForSequenceClassification"),d(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(ve,"id","transformers.LiltForTokenClassification"),d(ve,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(ve,"href","#transformers.LiltForTokenClassification"),d(oe,"class","relative group"),d(Xt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(ht,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(ht,"rel","nofollow"),d(Bt,"href","/docs/transformers/main/en/model_doc/lilt#transformers.LiltForTokenClassification"),d(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(Le,"id","transformers.LiltForQuestionAnswering"),d(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(Le,"href","#transformers.LiltForQuestionAnswering"),d(se,"class","relative group"),d(Gt,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),d(_t,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(_t,"rel","nofollow"),d(Pt,"href","/docs/transformers/main/en/model_doc/lilt#transformers.LiltForQuestionAnswering"),d(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),d(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,h){e(document.head,c),u(t,y,h),u(t,_,h),e(_,g),e(g,b),v(l,b,null),e(_,f),e(_,x),e(x,qn),u(t,So,h),u(t,O,h),e(O,de),e(de,no),v(Ue,no,null),e(O,Wn),e(O,so),e(so,Zn),u(t,Vo,h),u(t,N,h),e(N,In),e(N,qe),e(qe,Rn),e(N,An),e(N,wt),e(wt,Nn),e(N,Sn),u(t,Xo,h),u(t,vt,h),e(vt,Vn),u(t,Bo,h),u(t,kt,h),e(kt,ao),e(ao,Xn),u(t,Go,h),u(t,Mt,h),e(Mt,Bn),u(t,Po,h),u(t,Lt,h),e(Lt,J),e(J,Gn),e(J,We),e(We,Pn),e(J,Qn),e(J,Ze),e(Ze,On),e(J,Yn),e(J,ro),e(ro,Dn),e(J,Hn),e(J,io),e(io,Kn),e(J,es),u(t,Qo,h),v(Ie,t,h),u(t,Oo,h),u(t,ce,h),e(ce,lo),e(lo,ts),e(ce,os),e(ce,E),e(E,ns),e(E,Re),e(Re,ss),e(E,as),e(E,$t),e($t,rs),e(E,is),e(E,xt),e(xt,ls),e(E,ds),e(E,Ae),e(Ae,cs),e(E,hs),e(E,Et),e(Et,ps),e(E,ms),u(t,Yo,h),u(t,he,h),u(t,Do,h),u(t,pe,h),e(pe,us),e(pe,Ct),e(Ct,fs),e(pe,gs),u(t,Ho,h),u(t,S,h),e(S,_s),e(S,Ne),e(Ne,bs),e(S,ys),e(S,Se),e(Se,Ts),e(S,ws),u(t,Ko,h),u(t,Y,h),e(Y,me),e(me,co),v(Ve,co,null),e(Y,vs),e(Y,ho),e(ho,ks),u(t,en,h),u(t,Ft,h),e(Ft,Ms),u(t,tn,h),u(t,zt,h),e(zt,Xe),e(Xe,Ls),e(Xe,Be),e(Be,$s),e(Xe,xs),u(t,on,h),u(t,Jt,h),e(Jt,po),e(po,Es),u(t,nn,h),u(t,V,h),e(V,mo),e(mo,jt),e(jt,Cs),e(V,Fs),e(V,uo),e(uo,Ut),e(Ut,zs),e(V,Js),e(V,fo),e(fo,qt),e(qt,js),u(t,sn,h),u(t,Wt,h),e(Wt,Us),u(t,an,h),u(t,D,h),e(D,ue),e(ue,go),v(Ge,go,null),e(D,qs),e(D,_o),e(_o,Ws),u(t,rn,h),u(t,A,h),v(Pe,A,null),e(A,Zs),e(A,j),e(j,Is),e(j,Zt),e(Zt,Rs),e(j,As),e(j,Qe),e(Qe,Ns),e(j,Ss),e(j,It),e(It,Vs),e(j,Xs),e(j,Rt),e(Rt,Bs),e(j,Gs),e(A,Ps),v(fe,A,null),u(t,ln,h),u(t,H,h),e(H,ge),e(ge,bo),v(Oe,bo,null),e(H,Qs),e(H,yo),e(yo,Os),u(t,dn,h),u(t,U,h),v(Ye,U,null),e(U,Ys),e(U,De),e(De,Ds),e(De,At),e(At,Hs),e(De,Ks),e(U,ea),e(U,He),e(He,ta),e(He,Ke),e(Ke,oa),e(He,na),e(U,sa),e(U,q),v(et,q,null),e(q,aa),e(q,K),e(K,ra),e(K,Nt),e(Nt,ia),e(K,la),e(K,To),e(To,da),e(K,ca),e(q,ha),v(_e,q,null),e(q,pa),v(be,q,null),u(t,cn,h),u(t,ee,h),e(ee,ye),e(ye,wo),v(tt,wo,null),e(ee,ma),e(ee,vo),e(vo,ua),u(t,hn,h),u(t,C,h),v(ot,C,null),e(C,fa),e(C,ko),e(ko,ga),e(C,_a),e(C,nt),e(nt,ba),e(nt,St),e(St,ya),e(nt,Ta),e(C,wa),e(C,st),e(st,va),e(st,at),e(at,ka),e(st,Ma),e(C,La),e(C,W),v(rt,W,null),e(W,$a),e(W,te),e(te,xa),e(te,Vt),e(Vt,Ea),e(te,Ca),e(te,Mo),e(Mo,Fa),e(te,za),e(W,Ja),v(Te,W,null),e(W,ja),v(we,W,null),u(t,pn,h),u(t,oe,h),e(oe,ve),e(ve,Lo),v(it,Lo,null),e(oe,Ua),e(oe,$o),e($o,qa),u(t,mn,h),u(t,F,h),v(lt,F,null),e(F,Wa),e(F,xo),e(xo,Za),e(F,Ia),e(F,dt),e(dt,Ra),e(dt,Xt),e(Xt,Aa),e(dt,Na),e(F,Sa),e(F,ct),e(ct,Va),e(ct,ht),e(ht,Xa),e(ct,Ba),e(F,Ga),e(F,Z),v(pt,Z,null),e(Z,Pa),e(Z,ne),e(ne,Qa),e(ne,Bt),e(Bt,Oa),e(ne,Ya),e(ne,Eo),e(Eo,Da),e(ne,Ha),e(Z,Ka),v(ke,Z,null),e(Z,er),v(Me,Z,null),u(t,un,h),u(t,se,h),e(se,Le),e(Le,Co),v(mt,Co,null),e(se,tr),e(se,Fo),e(Fo,or),u(t,fn,h),u(t,z,h),v(ut,z,null),e(z,nr),e(z,ae),e(ae,sr),e(ae,zo),e(zo,ar),e(ae,rr),e(ae,Jo),e(Jo,ir),e(ae,lr),e(z,dr),e(z,ft),e(ft,cr),e(ft,Gt),e(Gt,hr),e(ft,pr),e(z,mr),e(z,gt),e(gt,ur),e(gt,_t),e(_t,fr),e(gt,gr),e(z,_r),e(z,I),v(bt,I,null),e(I,br),e(I,re),e(re,yr),e(re,Pt),e(Pt,Tr),e(re,wr),e(re,jo),e(jo,vr),e(re,kr),e(I,Mr),v($e,I,null),e(I,Lr),v(xe,I,null),gn=!0},p(t,[h]){const yt={};h&2&&(yt.$$scope={dirty:h,ctx:t}),fe.$set(yt);const Uo={};h&2&&(Uo.$$scope={dirty:h,ctx:t}),_e.$set(Uo);const qo={};h&2&&(qo.$$scope={dirty:h,ctx:t}),be.$set(qo);const Wo={};h&2&&(Wo.$$scope={dirty:h,ctx:t}),Te.$set(Wo);const Tt={};h&2&&(Tt.$$scope={dirty:h,ctx:t}),we.$set(Tt);const Zo={};h&2&&(Zo.$$scope={dirty:h,ctx:t}),ke.$set(Zo);const Io={};h&2&&(Io.$$scope={dirty:h,ctx:t}),Me.$set(Io);const Ro={};h&2&&(Ro.$$scope={dirty:h,ctx:t}),$e.$set(Ro);const ie={};h&2&&(ie.$$scope={dirty:h,ctx:t}),xe.$set(ie)},i(t){gn||(k(l.$$.fragment,t),k(Ue.$$.fragment,t),k(Ie.$$.fragment,t),k(Ve.$$.fragment,t),k(Ge.$$.fragment,t),k(Pe.$$.fragment,t),k(fe.$$.fragment,t),k(Oe.$$.fragment,t),k(Ye.$$.fragment,t),k(et.$$.fragment,t),k(_e.$$.fragment,t),k(be.$$.fragment,t),k(tt.$$.fragment,t),k(ot.$$.fragment,t),k(rt.$$.fragment,t),k(Te.$$.fragment,t),k(we.$$.fragment,t),k(it.$$.fragment,t),k(lt.$$.fragment,t),k(pt.$$.fragment,t),k(ke.$$.fragment,t),k(Me.$$.fragment,t),k(mt.$$.fragment,t),k(ut.$$.fragment,t),k(bt.$$.fragment,t),k($e.$$.fragment,t),k(xe.$$.fragment,t),gn=!0)},o(t){M(l.$$.fragment,t),M(Ue.$$.fragment,t),M(Ie.$$.fragment,t),M(Ve.$$.fragment,t),M(Ge.$$.fragment,t),M(Pe.$$.fragment,t),M(fe.$$.fragment,t),M(Oe.$$.fragment,t),M(Ye.$$.fragment,t),M(et.$$.fragment,t),M(_e.$$.fragment,t),M(be.$$.fragment,t),M(tt.$$.fragment,t),M(ot.$$.fragment,t),M(rt.$$.fragment,t),M(Te.$$.fragment,t),M(we.$$.fragment,t),M(it.$$.fragment,t),M(lt.$$.fragment,t),M(pt.$$.fragment,t),M(ke.$$.fragment,t),M(Me.$$.fragment,t),M(mt.$$.fragment,t),M(ut.$$.fragment,t),M(bt.$$.fragment,t),M($e.$$.fragment,t),M(xe.$$.fragment,t),gn=!1},d(t){o(c),t&&o(y),t&&o(_),L(l),t&&o(So),t&&o(O),L(Ue),t&&o(Vo),t&&o(N),t&&o(Xo),t&&o(vt),t&&o(Bo),t&&o(kt),t&&o(Go),t&&o(Mt),t&&o(Po),t&&o(Lt),t&&o(Qo),L(Ie,t),t&&o(Oo),t&&o(ce),t&&o(Yo),t&&o(he),t&&o(Do),t&&o(pe),t&&o(Ho),t&&o(S),t&&o(Ko),t&&o(Y),L(Ve),t&&o(en),t&&o(Ft),t&&o(tn),t&&o(zt),t&&o(on),t&&o(Jt),t&&o(nn),t&&o(V),t&&o(sn),t&&o(Wt),t&&o(an),t&&o(D),L(Ge),t&&o(rn),t&&o(A),L(Pe),L(fe),t&&o(ln),t&&o(H),L(Oe),t&&o(dn),t&&o(U),L(Ye),L(et),L(_e),L(be),t&&o(cn),t&&o(ee),L(tt),t&&o(hn),t&&o(C),L(ot),L(rt),L(Te),L(we),t&&o(pn),t&&o(oe),L(it),t&&o(mn),t&&o(F),L(lt),L(pt),L(ke),L(Me),t&&o(un),t&&o(se),L(mt),t&&o(fn),t&&o(z),L(ut),L(bt),L($e),L(xe)}}}const dl={local:"lilt",sections:[{local:"overview",title:"Overview"},{local:"resources",title:"Resources"},{local:"transformers.LiltConfig",title:"LiltConfig"},{local:"transformers.LiltModel",title:"LiltModel"},{local:"transformers.LiltForSequenceClassification",title:"LiltForSequenceClassification"},{local:"transformers.LiltForTokenClassification",title:"LiltForTokenClassification"},{local:"transformers.LiltForQuestionAnswering",title:"LiltForQuestionAnswering"}],title:"LiLT"};function cl($){return Hi(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _l extends Pi{constructor(c){super();Qi(this,c,cl,ll,Oi,{})}}export{_l as default,dl as metadata};
