import{S as Pi,i as Qi,s as Oi,e as n,k as p,w as v,t as a,M as Yi,c as s,d as o,m,a as r,x as T,h as i,b as d,N as Di,G as e,g as u,y as w,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=a("Examples:"),_=p(),v(g.$$.fragment)},l(l){c=s(l,"P",{});var f=r(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),T(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),w(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=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=a(`
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=r(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=r(_);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=a("Examples:"),_=p(),v(g.$$.fragment)},l(l){c=s(l,"P",{});var f=r(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),T(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),w(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=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=a(`
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=r(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=r(_);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=a("Examples:"),_=p(),v(g.$$.fragment)},l(l){c=s(l,"P",{});var f=r(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),T(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),w(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=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=a(`
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=r(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=r(_);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 rl($){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=a("Examples:"),_=p(),v(g.$$.fragment)},l(l){c=s(l,"P",{});var f=r(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),T(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),w(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 al($){let c,y,_,g,b;return{c(){c=n("p"),y=a("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=n("code"),g=a("Module"),b=a(`
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=r(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=r(_);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=a("Examples:"),_=p(),v(g.$$.fragment)},l(l){c=s(l,"P",{});var f=r(c);y=i(f,"Examples:"),f.forEach(o),_=m(l),T(g.$$.fragment,l)},m(l,f){u(l,c,f),e(c,y),u(l,_,f),w(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,Tt,Nn,Sn,Xo,wt,Vn,Bo,kt,ro,Xn,Go,Mt,Bn,Po,Lt,J,Gn,We,Pn,Qn,Ze,On,Yn,ao,Dn,Hn,io,Kn,es,Qo,Ie,Oo,ce,lo,ts,os,E,ns,Re,ss,rs,$t,as,is,xt,ls,ds,Ae,cs,hs,Et,ps,ms,Yo,he,$a,Do,pe,us,Ct,fs,gs,Ho,S,_s,Ne,bs,ys,Se,vs,Ts,Ko,Y,me,co,Ve,ws,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,rn,D,ue,go,Ge,qs,_o,Ws,an,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,er,He,tr,Ke,or,nr,sr,q,et,rr,K,ar,Nt,ir,lr,vo,dr,cr,hr,_e,pr,be,cn,ee,ye,To,tt,mr,wo,ur,hn,C,ot,fr,ko,gr,_r,nt,br,St,yr,vr,Tr,st,wr,rt,kr,Mr,Lr,W,at,$r,te,xr,Vt,Er,Cr,Mo,Fr,zr,Jr,ve,jr,Te,pn,oe,we,Lo,it,Ur,$o,qr,mn,F,lt,Wr,xo,Zr,Ir,dt,Rr,Xt,Ar,Nr,Sr,ct,Vr,ht,Xr,Br,Gr,Z,pt,Pr,ne,Qr,Bt,Or,Yr,Eo,Dr,Hr,Kr,ke,ea,Me,un,se,Le,Co,mt,ta,Fo,oa,fn,z,ut,na,re,sa,zo,ra,aa,Jo,ia,la,da,ft,ca,Gt,ha,pa,ma,gt,ua,_t,fa,ga,_a,I,bt,ba,ae,ya,Pt,va,Ta,jo,wa,ka,Ma,$e,La,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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/lilt/modeling_lilt.py#L719",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/lilt/modeling_lilt.py#L840"}}),at=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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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/v4.33.0/src/transformers/models/lilt/modeling_lilt.py#L853",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/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/v4.33.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ve=new Un({props:{$$slots:{default:[ol]},$$scope:{ctx:$}}}),Te=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/v4.33.0/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/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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/v4.33.0/src/transformers/models/lilt/modeling_lilt.py#L974",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.TokenClassifierOutput"
>transformers.modeling_outputs.TokenClassifierOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/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/v4.33.0/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:[rl]},$$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/v4.33.0/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/v4.33.0/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.33.0/src/transformers/models/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/v4.33.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.33.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.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/v4.33.0/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/v4.33.0/src/transformers/models/lilt/modeling_lilt.py#L1096",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.33.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.33.0/en/model_doc/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/v4.33.0/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:[al]},$$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"),v(l.$$.fragment),f=p(),x=n("span"),qn=a("LiLT"),So=p(),O=n("h2"),de=n("a"),no=n("span"),v(Ue.$$.fragment),Wn=p(),so=n("span"),Zn=a("Overview"),Vo=p(),N=n("p"),In=a("The LiLT model was proposed in "),qe=n("a"),Rn=a("LiLT: A Simple yet Effective Language-Independent Layout Transformer for Structured Document Understanding"),An=a(` by Jiapeng Wang, Lianwen Jin, Kai Ding.
LiLT allows to combine any pre-trained RoBERTa text encoder with a lightweight Layout Transformer, to enable `),Tt=n("a"),Nn=a("LayoutLM"),Sn=a(`-like document understanding for many
languages.`),Xo=p(),wt=n("p"),Vn=a("The abstract from the paper is the following:"),Bo=p(),kt=n("p"),ro=n("em"),Xn=a("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=a("Tips:"),Po=p(),Lt=n("ul"),J=n("li"),Gn=a("To combine the Language-Independent Layout Transformer with a new RoBERTa checkpoint from the "),We=n("a"),Pn=a("hub"),Qn=a(", refer to "),Ze=n("a"),On=a("this guide"),Yn=a(`.
The script will result in `),ao=n("code"),Dn=a("config.json"),Hn=a(" and "),io=n("code"),Kn=a("pytorch_model.bin"),es=a(" files being stored locally. After doing this, one can do the following (assuming you\u2019re logged in with your HuggingFace account):"),Qo=p(),v(Ie.$$.fragment),Oo=p(),ce=n("ul"),lo=n("li"),ts=a("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=a("As "),Re=n("a"),ss=a("lilt-roberta-en-base"),rs=a(" uses the same vocabulary as "),$t=n("a"),as=a("LayoutLMv3"),is=a(", one can use "),xt=n("a"),ls=a("LayoutLMv3TokenizerFast"),ds=a(` to prepare data for the model.
The same is true for `),Ae=n("a"),cs=a("lilt-roberta-en-base"),hs=a(": one can use "),Et=n("a"),ps=a("LayoutXLMTokenizerFast"),ms=a(" for that model."),Yo=p(),he=n("img"),Do=p(),pe=n("small"),us=a("LiLT architecture. Taken from the "),Ct=n("a"),fs=a("original paper"),gs=a("."),Ho=p(),S=n("p"),_s=a("This model was contributed by "),Ne=n("a"),bs=a("nielsr"),ys=a(`.
The original code can be found `),Se=n("a"),vs=a("here"),Ts=a("."),Ko=p(),Y=n("h2"),me=n("a"),co=n("span"),v(Ve.$$.fragment),ws=p(),ho=n("span"),ks=a("Resources"),en=p(),Ft=n("p"),Ms=a("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=a("Demo notebooks for LiLT can be found "),Be=n("a"),$s=a("here"),xs=a("."),on=p(),Jt=n("p"),po=n("strong"),Es=a("Documentation resources"),nn=p(),V=n("ul"),mo=n("li"),jt=n("a"),Cs=a("Text classification task guide"),Fs=p(),uo=n("li"),Ut=n("a"),zs=a("Token classification task guide"),Js=p(),fo=n("li"),qt=n("a"),js=a("Question answering task guide"),sn=p(),Wt=n("p"),Us=a("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."),rn=p(),D=n("h2"),ue=n("a"),go=n("span"),v(Ge.$$.fragment),qs=p(),_o=n("span"),Ws=a("LiltConfig"),an=p(),A=n("div"),v(Pe.$$.fragment),Zs=p(),j=n("p"),Is=a("This is the configuration class to store the configuration of a "),Zt=n("a"),Rs=a("LiltModel"),As=a(`. 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=a("SCUT-DLVCLab/lilt-roberta-en-base"),Ss=a(` architecture.
Configuration objects inherit from `),It=n("a"),Vs=a("PretrainedConfig"),Xs=a(` and can be used to control the model outputs. Read the
documentation from `),Rt=n("a"),Bs=a("PretrainedConfig"),Gs=a(" for more information."),Ps=p(),v(fe.$$.fragment),ln=p(),H=n("h2"),ge=n("a"),bo=n("span"),v(Oe.$$.fragment),Qs=p(),yo=n("span"),Os=a("LiltModel"),dn=p(),U=n("div"),v(Ye.$$.fragment),Ys=p(),De=n("p"),Ds=a(`The bare LiLT Model transformer outputting raw hidden-states without any specific head on top.
This model inherits from `),At=n("a"),Hs=a("PreTrainedModel"),Ks=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),er=p(),He=n("p"),tr=a("This model is also a PyTorch "),Ke=n("a"),or=a("torch.nn.Module"),nr=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),sr=p(),q=n("div"),v(et.$$.fragment),rr=p(),K=n("p"),ar=a("The "),Nt=n("a"),ir=a("LiltModel"),lr=a(" forward method, overrides the "),vo=n("code"),dr=a("__call__"),cr=a(" special method."),hr=p(),v(_e.$$.fragment),pr=p(),v(be.$$.fragment),cn=p(),ee=n("h2"),ye=n("a"),To=n("span"),v(tt.$$.fragment),mr=p(),wo=n("span"),ur=a("LiltForSequenceClassification"),hn=p(),C=n("div"),v(ot.$$.fragment),fr=p(),ko=n("p"),gr=a(`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.`),_r=p(),nt=n("p"),br=a("This model inherits from "),St=n("a"),yr=a("PreTrainedModel"),vr=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Tr=p(),st=n("p"),wr=a("This model is also a PyTorch "),rt=n("a"),kr=a("torch.nn.Module"),Mr=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lr=p(),W=n("div"),v(at.$$.fragment),$r=p(),te=n("p"),xr=a("The "),Vt=n("a"),Er=a("LiltForSequenceClassification"),Cr=a(" forward method, overrides the "),Mo=n("code"),Fr=a("__call__"),zr=a(" special method."),Jr=p(),v(ve.$$.fragment),jr=p(),v(Te.$$.fragment),pn=p(),oe=n("h2"),we=n("a"),Lo=n("span"),v(it.$$.fragment),Ur=p(),$o=n("span"),qr=a("LiltForTokenClassification"),mn=p(),F=n("div"),v(lt.$$.fragment),Wr=p(),xo=n("p"),Zr=a(`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.`),Ir=p(),dt=n("p"),Rr=a("This model inherits from "),Xt=n("a"),Ar=a("PreTrainedModel"),Nr=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Sr=p(),ct=n("p"),Vr=a("This model is also a PyTorch "),ht=n("a"),Xr=a("torch.nn.Module"),Br=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Gr=p(),Z=n("div"),v(pt.$$.fragment),Pr=p(),ne=n("p"),Qr=a("The "),Bt=n("a"),Or=a("LiltForTokenClassification"),Yr=a(" forward method, overrides the "),Eo=n("code"),Dr=a("__call__"),Hr=a(" special method."),Kr=p(),v(ke.$$.fragment),ea=p(),v(Me.$$.fragment),un=p(),se=n("h2"),Le=n("a"),Co=n("span"),v(mt.$$.fragment),ta=p(),Fo=n("span"),oa=a("LiltForQuestionAnswering"),fn=p(),z=n("div"),v(ut.$$.fragment),na=p(),re=n("p"),sa=a(`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"),ra=a("span start logits"),aa=a(" and "),Jo=n("code"),ia=a("span end logits"),la=a(")."),da=p(),ft=n("p"),ca=a("This model inherits from "),Gt=n("a"),ha=a("PreTrainedModel"),pa=a(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ma=p(),gt=n("p"),ua=a("This model is also a PyTorch "),_t=n("a"),fa=a("torch.nn.Module"),ga=a(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),_a=p(),I=n("div"),v(bt.$$.fragment),ba=p(),ae=n("p"),ya=a("The "),Pt=n("a"),va=a("LiltForQuestionAnswering"),Ta=a(" forward method, overrides the "),jo=n("code"),wa=a("__call__"),ka=a(" special method."),Ma=p(),v($e.$$.fragment),La=p(),v(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=r(_);g=s(yt,"A",{id:!0,class:!0,href:!0});var Uo=r(g);b=s(Uo,"SPAN",{});var qo=r(b);T(l.$$.fragment,qo),qo.forEach(o),Uo.forEach(o),f=m(yt),x=s(yt,"SPAN",{});var Wo=r(x);qn=i(Wo,"LiLT"),Wo.forEach(o),yt.forEach(o),So=m(t),O=s(t,"H2",{class:!0});var vt=r(O);de=s(vt,"A",{id:!0,class:!0,href:!0});var Zo=r(de);no=s(Zo,"SPAN",{});var Io=r(no);T(Ue.$$.fragment,Io),Io.forEach(o),Zo.forEach(o),Wn=m(vt),so=s(vt,"SPAN",{});var Ro=r(so);Zn=i(Ro,"Overview"),Ro.forEach(o),vt.forEach(o),Vo=m(t),N=s(t,"P",{});var ie=r(N);In=i(ie,"The LiLT model was proposed in "),qe=s(ie,"A",{href:!0,rel:!0});var xa=r(qe);Rn=i(xa,"LiLT: A Simple yet Effective Language-Independent Layout Transformer for Structured Document Understanding"),xa.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 `),Tt=s(ie,"A",{href:!0});var Ea=r(Tt);Nn=i(Ea,"LayoutLM"),Ea.forEach(o),Sn=i(ie,`-like document understanding for many
languages.`),ie.forEach(o),Xo=m(t),wt=s(t,"P",{});var Ca=r(wt);Vn=i(Ca,"The abstract from the paper is the following:"),Ca.forEach(o),Bo=m(t),kt=s(t,"P",{});var Fa=r(kt);ro=s(Fa,"EM",{});var za=r(ro);Xn=i(za,"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."),za.forEach(o),Fa.forEach(o),Go=m(t),Mt=s(t,"P",{});var Ja=r(Mt);Bn=i(Ja,"Tips:"),Ja.forEach(o),Po=m(t),Lt=s(t,"UL",{});var ja=r(Lt);J=s(ja,"LI",{});var X=r(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 Ua=r(We);Pn=i(Ua,"hub"),Ua.forEach(o),Qn=i(X,", refer to "),Ze=s(X,"A",{href:!0,rel:!0});var qa=r(Ze);On=i(qa,"this guide"),qa.forEach(o),Yn=i(X,`.
The script will result in `),ao=s(X,"CODE",{});var Wa=r(ao);Dn=i(Wa,"config.json"),Wa.forEach(o),Hn=i(X," and "),io=s(X,"CODE",{});var Za=r(io);Kn=i(Za,"pytorch_model.bin"),Za.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),ja.forEach(o),Qo=m(t),T(Ie.$$.fragment,t),Oo=m(t),ce=s(t,"UL",{});var _n=r(ce);lo=s(_n,"LI",{});var Ia=r(lo);ts=i(Ia,"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."),Ia.forEach(o),os=m(_n),E=s(_n,"LI",{});var R=r(E);ns=i(R,"As "),Re=s(R,"A",{href:!0,rel:!0});var Ra=r(Re);ss=i(Ra,"lilt-roberta-en-base"),Ra.forEach(o),rs=i(R," uses the same vocabulary as "),$t=s(R,"A",{href:!0});var Aa=r($t);as=i(Aa,"LayoutLMv3"),Aa.forEach(o),is=i(R,", one can use "),xt=s(R,"A",{href:!0});var Na=r(xt);ls=i(Na,"LayoutLMv3TokenizerFast"),Na.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 Sa=r(Ae);cs=i(Sa,"lilt-roberta-en-base"),Sa.forEach(o),hs=i(R,": one can use "),Et=s(R,"A",{href:!0});var Va=r(Et);ps=i(Va,"LayoutXLMTokenizerFast"),Va.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=r(pe);us=i(bn,"LiLT architecture. Taken from the "),Ct=s(bn,"A",{href:!0});var Xa=r(Ct);fs=i(Xa,"original paper"),Xa.forEach(o),gs=i(bn,"."),bn.forEach(o),Ho=m(t),S=s(t,"P",{});var Qt=r(S);_s=i(Qt,"This model was contributed by "),Ne=s(Qt,"A",{href:!0,rel:!0});var Ba=r(Ne);bs=i(Ba,"nielsr"),Ba.forEach(o),ys=i(Qt,`.
The original code can be found `),Se=s(Qt,"A",{href:!0,rel:!0});var Ga=r(Se);vs=i(Ga,"here"),Ga.forEach(o),Ts=i(Qt,"."),Qt.forEach(o),Ko=m(t),Y=s(t,"H2",{class:!0});var yn=r(Y);me=s(yn,"A",{id:!0,class:!0,href:!0});var Pa=r(me);co=s(Pa,"SPAN",{});var Qa=r(co);T(Ve.$$.fragment,Qa),Qa.forEach(o),Pa.forEach(o),ws=m(yn),ho=s(yn,"SPAN",{});var Oa=r(ho);ks=i(Oa,"Resources"),Oa.forEach(o),yn.forEach(o),en=m(t),Ft=s(t,"P",{});var Ya=r(Ft);Ms=i(Ya,"A list of official Hugging Face and community (indicated by \u{1F30E}) resources to help you get started with LiLT."),Ya.forEach(o),tn=m(t),zt=s(t,"UL",{});var Da=r(zt);Xe=s(Da,"LI",{});var vn=r(Xe);Ls=i(vn,"Demo notebooks for LiLT can be found "),Be=s(vn,"A",{href:!0,rel:!0});var Ha=r(Be);$s=i(Ha,"here"),Ha.forEach(o),xs=i(vn,"."),vn.forEach(o),Da.forEach(o),on=m(t),Jt=s(t,"P",{});var Ka=r(Jt);po=s(Ka,"STRONG",{});var ei=r(po);Es=i(ei,"Documentation resources"),ei.forEach(o),Ka.forEach(o),nn=m(t),V=s(t,"UL",{});var Ot=r(V);mo=s(Ot,"LI",{});var ti=r(mo);jt=s(ti,"A",{href:!0});var oi=r(jt);Cs=i(oi,"Text classification task guide"),oi.forEach(o),ti.forEach(o),Fs=m(Ot),uo=s(Ot,"LI",{});var ni=r(uo);Ut=s(ni,"A",{href:!0});var si=r(Ut);zs=i(si,"Token classification task guide"),si.forEach(o),ni.forEach(o),Js=m(Ot),fo=s(Ot,"LI",{});var ri=r(fo);qt=s(ri,"A",{href:!0});var ai=r(qt);js=i(ai,"Question answering task guide"),ai.forEach(o),ri.forEach(o),Ot.forEach(o),sn=m(t),Wt=s(t,"P",{});var ii=r(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),rn=m(t),D=s(t,"H2",{class:!0});var Tn=r(D);ue=s(Tn,"A",{id:!0,class:!0,href:!0});var li=r(ue);go=s(li,"SPAN",{});var di=r(go);T(Ge.$$.fragment,di),di.forEach(o),li.forEach(o),qs=m(Tn),_o=s(Tn,"SPAN",{});var ci=r(_o);Ws=i(ci,"LiltConfig"),ci.forEach(o),Tn.forEach(o),an=m(t),A=s(t,"DIV",{class:!0});var Yt=r(A);T(Pe.$$.fragment,Yt),Zs=m(Yt),j=s(Yt,"P",{});var B=r(j);Is=i(B,"This is the configuration class to store the configuration of a "),Zt=s(B,"A",{href:!0});var hi=r(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=r(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=r(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=r(Rt);Bs=i(ui,"PretrainedConfig"),ui.forEach(o),Gs=i(B," for more information."),B.forEach(o),Ps=m(Yt),T(fe.$$.fragment,Yt),Yt.forEach(o),ln=m(t),H=s(t,"H2",{class:!0});var wn=r(H);ge=s(wn,"A",{id:!0,class:!0,href:!0});var fi=r(ge);bo=s(fi,"SPAN",{});var gi=r(bo);T(Oe.$$.fragment,gi),gi.forEach(o),fi.forEach(o),Qs=m(wn),yo=s(wn,"SPAN",{});var _i=r(yo);Os=i(_i,"LiltModel"),_i.forEach(o),wn.forEach(o),dn=m(t),U=s(t,"DIV",{class:!0});var Ee=r(U);T(Ye.$$.fragment,Ee),Ys=m(Ee),De=s(Ee,"P",{});var kn=r(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=r(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),er=m(Ee),He=s(Ee,"P",{});var Mn=r(He);tr=i(Mn,"This model is also a PyTorch "),Ke=s(Mn,"A",{href:!0,rel:!0});var yi=r(Ke);or=i(yi,"torch.nn.Module"),yi.forEach(o),nr=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),sr=m(Ee),q=s(Ee,"DIV",{class:!0});var Ce=r(q);T(et.$$.fragment,Ce),rr=m(Ce),K=s(Ce,"P",{});var Dt=r(K);ar=i(Dt,"The "),Nt=s(Dt,"A",{href:!0});var vi=r(Nt);ir=i(vi,"LiltModel"),vi.forEach(o),lr=i(Dt," forward method, overrides the "),vo=s(Dt,"CODE",{});var Ti=r(vo);dr=i(Ti,"__call__"),Ti.forEach(o),cr=i(Dt," special method."),Dt.forEach(o),hr=m(Ce),T(_e.$$.fragment,Ce),pr=m(Ce),T(be.$$.fragment,Ce),Ce.forEach(o),Ee.forEach(o),cn=m(t),ee=s(t,"H2",{class:!0});var Ln=r(ee);ye=s(Ln,"A",{id:!0,class:!0,href:!0});var wi=r(ye);To=s(wi,"SPAN",{});var ki=r(To);T(tt.$$.fragment,ki),ki.forEach(o),wi.forEach(o),mr=m(Ln),wo=s(Ln,"SPAN",{});var Mi=r(wo);ur=i(Mi,"LiltForSequenceClassification"),Mi.forEach(o),Ln.forEach(o),hn=m(t),C=s(t,"DIV",{class:!0});var G=r(C);T(ot.$$.fragment,G),fr=m(G),ko=s(G,"P",{});var Li=r(ko);gr=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),_r=m(G),nt=s(G,"P",{});var $n=r(nt);br=i($n,"This model inherits from "),St=s($n,"A",{href:!0});var $i=r(St);yr=i($i,"PreTrainedModel"),$i.forEach(o),vr=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),Tr=m(G),st=s(G,"P",{});var xn=r(st);wr=i(xn,"This model is also a PyTorch "),rt=s(xn,"A",{href:!0,rel:!0});var xi=r(rt);kr=i(xi,"torch.nn.Module"),xi.forEach(o),Mr=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),Lr=m(G),W=s(G,"DIV",{class:!0});var Fe=r(W);T(at.$$.fragment,Fe),$r=m(Fe),te=s(Fe,"P",{});var Ht=r(te);xr=i(Ht,"The "),Vt=s(Ht,"A",{href:!0});var Ei=r(Vt);Er=i(Ei,"LiltForSequenceClassification"),Ei.forEach(o),Cr=i(Ht," forward method, overrides the "),Mo=s(Ht,"CODE",{});var Ci=r(Mo);Fr=i(Ci,"__call__"),Ci.forEach(o),zr=i(Ht," special method."),Ht.forEach(o),Jr=m(Fe),T(ve.$$.fragment,Fe),jr=m(Fe),T(Te.$$.fragment,Fe),Fe.forEach(o),G.forEach(o),pn=m(t),oe=s(t,"H2",{class:!0});var En=r(oe);we=s(En,"A",{id:!0,class:!0,href:!0});var Fi=r(we);Lo=s(Fi,"SPAN",{});var zi=r(Lo);T(it.$$.fragment,zi),zi.forEach(o),Fi.forEach(o),Ur=m(En),$o=s(En,"SPAN",{});var Ji=r($o);qr=i(Ji,"LiltForTokenClassification"),Ji.forEach(o),En.forEach(o),mn=m(t),F=s(t,"DIV",{class:!0});var P=r(F);T(lt.$$.fragment,P),Wr=m(P),xo=s(P,"P",{});var ji=r(xo);Zr=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),Ir=m(P),dt=s(P,"P",{});var Cn=r(dt);Rr=i(Cn,"This model inherits from "),Xt=s(Cn,"A",{href:!0});var Ui=r(Xt);Ar=i(Ui,"PreTrainedModel"),Ui.forEach(o),Nr=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),Sr=m(P),ct=s(P,"P",{});var Fn=r(ct);Vr=i(Fn,"This model is also a PyTorch "),ht=s(Fn,"A",{href:!0,rel:!0});var qi=r(ht);Xr=i(qi,"torch.nn.Module"),qi.forEach(o),Br=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),Gr=m(P),Z=s(P,"DIV",{class:!0});var ze=r(Z);T(pt.$$.fragment,ze),Pr=m(ze),ne=s(ze,"P",{});var Kt=r(ne);Qr=i(Kt,"The "),Bt=s(Kt,"A",{href:!0});var Wi=r(Bt);Or=i(Wi,"LiltForTokenClassification"),Wi.forEach(o),Yr=i(Kt," forward method, overrides the "),Eo=s(Kt,"CODE",{});var Zi=r(Eo);Dr=i(Zi,"__call__"),Zi.forEach(o),Hr=i(Kt," special method."),Kt.forEach(o),Kr=m(ze),T(ke.$$.fragment,ze),ea=m(ze),T(Me.$$.fragment,ze),ze.forEach(o),P.forEach(o),un=m(t),se=s(t,"H2",{class:!0});var zn=r(se);Le=s(zn,"A",{id:!0,class:!0,href:!0});var Ii=r(Le);Co=s(Ii,"SPAN",{});var Ri=r(Co);T(mt.$$.fragment,Ri),Ri.forEach(o),Ii.forEach(o),ta=m(zn),Fo=s(zn,"SPAN",{});var Ai=r(Fo);oa=i(Ai,"LiltForQuestionAnswering"),Ai.forEach(o),zn.forEach(o),fn=m(t),z=s(t,"DIV",{class:!0});var Q=r(z);T(ut.$$.fragment,Q),na=m(Q),re=s(Q,"P",{});var eo=r(re);sa=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=r(zo);ra=i(Ni,"span start logits"),Ni.forEach(o),aa=i(eo," and "),Jo=s(eo,"CODE",{});var Si=r(Jo);ia=i(Si,"span end logits"),Si.forEach(o),la=i(eo,")."),eo.forEach(o),da=m(Q),ft=s(Q,"P",{});var Jn=r(ft);ca=i(Jn,"This model inherits from "),Gt=s(Jn,"A",{href:!0});var Vi=r(Gt);ha=i(Vi,"PreTrainedModel"),Vi.forEach(o),pa=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),ma=m(Q),gt=s(Q,"P",{});var jn=r(gt);ua=i(jn,"This model is also a PyTorch "),_t=s(jn,"A",{href:!0,rel:!0});var Xi=r(_t);fa=i(Xi,"torch.nn.Module"),Xi.forEach(o),ga=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),_a=m(Q),I=s(Q,"DIV",{class:!0});var Je=r(I);T(bt.$$.fragment,Je),ba=m(Je),ae=s(Je,"P",{});var to=r(ae);ya=i(to,"The "),Pt=s(to,"A",{href:!0});var Bi=r(Pt);va=i(Bi,"LiltForQuestionAnswering"),Bi.forEach(o),Ta=i(to," forward method, overrides the "),jo=s(to,"CODE",{});var Gi=r(jo);wa=i(Gi,"__call__"),Gi.forEach(o),ka=i(to," special method."),to.forEach(o),Ma=m(Je),T($e.$$.fragment,Je),La=m(Je),T(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(Tt,"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/v4.33.0/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/v4.33.0/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizerFast"),Di(he.src,$a="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/lilt_architecture.jpg")||d(he,"src",$a),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/v4.33.0/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/v4.33.0/en/main_classes/configuration#transformers.PretrainedConfig"),d(Rt,"href","/docs/transformers/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/en/main_classes/model#transformers.PreTrainedModel"),d(rt,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),d(rt,"rel","nofollow"),d(Vt,"href","/docs/transformers/v4.33.0/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(we,"id","transformers.LiltForTokenClassification"),d(we,"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(we,"href","#transformers.LiltForTokenClassification"),d(oe,"class","relative group"),d(Xt,"href","/docs/transformers/v4.33.0/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/v4.33.0/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/v4.33.0/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/v4.33.0/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),w(l,b,null),e(_,f),e(_,x),e(x,qn),u(t,So,h),u(t,O,h),e(O,de),e(de,no),w(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,Tt),e(Tt,Nn),e(N,Sn),u(t,Xo,h),u(t,wt,h),e(wt,Vn),u(t,Bo,h),u(t,kt,h),e(kt,ro),e(ro,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,ao),e(ao,Dn),e(J,Hn),e(J,io),e(io,Kn),e(J,es),u(t,Qo,h),w(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,rs),e(E,$t),e($t,as),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,vs),e(S,Ts),u(t,Ko,h),u(t,Y,h),e(Y,me),e(me,co),w(Ve,co,null),e(Y,ws),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,rn,h),u(t,D,h),e(D,ue),e(ue,go),w(Ge,go,null),e(D,qs),e(D,_o),e(_o,Ws),u(t,an,h),u(t,A,h),w(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),w(fe,A,null),u(t,ln,h),u(t,H,h),e(H,ge),e(ge,bo),w(Oe,bo,null),e(H,Qs),e(H,yo),e(yo,Os),u(t,dn,h),u(t,U,h),w(Ye,U,null),e(U,Ys),e(U,De),e(De,Ds),e(De,At),e(At,Hs),e(De,Ks),e(U,er),e(U,He),e(He,tr),e(He,Ke),e(Ke,or),e(He,nr),e(U,sr),e(U,q),w(et,q,null),e(q,rr),e(q,K),e(K,ar),e(K,Nt),e(Nt,ir),e(K,lr),e(K,vo),e(vo,dr),e(K,cr),e(q,hr),w(_e,q,null),e(q,pr),w(be,q,null),u(t,cn,h),u(t,ee,h),e(ee,ye),e(ye,To),w(tt,To,null),e(ee,mr),e(ee,wo),e(wo,ur),u(t,hn,h),u(t,C,h),w(ot,C,null),e(C,fr),e(C,ko),e(ko,gr),e(C,_r),e(C,nt),e(nt,br),e(nt,St),e(St,yr),e(nt,vr),e(C,Tr),e(C,st),e(st,wr),e(st,rt),e(rt,kr),e(st,Mr),e(C,Lr),e(C,W),w(at,W,null),e(W,$r),e(W,te),e(te,xr),e(te,Vt),e(Vt,Er),e(te,Cr),e(te,Mo),e(Mo,Fr),e(te,zr),e(W,Jr),w(ve,W,null),e(W,jr),w(Te,W,null),u(t,pn,h),u(t,oe,h),e(oe,we),e(we,Lo),w(it,Lo,null),e(oe,Ur),e(oe,$o),e($o,qr),u(t,mn,h),u(t,F,h),w(lt,F,null),e(F,Wr),e(F,xo),e(xo,Zr),e(F,Ir),e(F,dt),e(dt,Rr),e(dt,Xt),e(Xt,Ar),e(dt,Nr),e(F,Sr),e(F,ct),e(ct,Vr),e(ct,ht),e(ht,Xr),e(ct,Br),e(F,Gr),e(F,Z),w(pt,Z,null),e(Z,Pr),e(Z,ne),e(ne,Qr),e(ne,Bt),e(Bt,Or),e(ne,Yr),e(ne,Eo),e(Eo,Dr),e(ne,Hr),e(Z,Kr),w(ke,Z,null),e(Z,ea),w(Me,Z,null),u(t,un,h),u(t,se,h),e(se,Le),e(Le,Co),w(mt,Co,null),e(se,ta),e(se,Fo),e(Fo,oa),u(t,fn,h),u(t,z,h),w(ut,z,null),e(z,na),e(z,re),e(re,sa),e(re,zo),e(zo,ra),e(re,aa),e(re,Jo),e(Jo,ia),e(re,la),e(z,da),e(z,ft),e(ft,ca),e(ft,Gt),e(Gt,ha),e(ft,pa),e(z,ma),e(z,gt),e(gt,ua),e(gt,_t),e(_t,fa),e(gt,ga),e(z,_a),e(z,I),w(bt,I,null),e(I,ba),e(I,ae),e(ae,ya),e(ae,Pt),e(Pt,va),e(ae,Ta),e(ae,jo),e(jo,wa),e(ae,ka),e(I,Ma),w($e,I,null),e(I,La),w(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}),ve.$set(Wo);const vt={};h&2&&(vt.$$scope={dirty:h,ctx:t}),Te.$set(vt);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(at.$$.fragment,t),k(ve.$$.fragment,t),k(Te.$$.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(at.$$.fragment,t),M(ve.$$.fragment,t),M(Te.$$.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(wt),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(rn),t&&o(D),L(Ge),t&&o(an),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(at),L(ve),L(Te),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};
