import{S as $2,i as U2,s as z2,e as a,k as l,w as k,t as o,M as J2,c as r,d as t,m as d,a as i,x as M,h as n,b as c,N as C2,G as e,g as u,y as v,q as b,o as y,B as T,v as j2,L as ta}from"../../chunks/vendor-hf-doc-builder.js";import{T as Rc}from"../../chunks/Tip-hf-doc-builder.js";import{D as z}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ee}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as me}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as ea}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function F2(j){let m,E,_,g,w;return g=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNTW9kZWwlMkMlMjBNYXJrdXBMTUNvbmZpZyUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBNYXJrdXBMTSUyMG1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjBzdHlsZSUyMGNvbmZpZ3VyYXRpb24lMEFjb25maWd1cmF0aW9uJTIwJTNEJTIwTWFya3VwTE1Db25maWcoKSUwQSUwQSUyMyUyMEluaXRpYWxpemluZyUyMGElMjBtb2RlbCUyMGZyb20lMjB0aGUlMjBtaWNyb3NvZnQlMkZtYXJrdXBsbS1iYXNlJTIwc3R5bGUlMjBjb25maWd1cmF0aW9uJTBBbW9kZWwlMjAlM0QlMjBNYXJrdXBMTU1vZGVsKGNvbmZpZ3VyYXRpb24pJTBBJTBBJTIzJTIwQWNjZXNzaW5nJTIwdGhlJTIwbW9kZWwlMjBjb25maWd1cmF0aW9uJTBBY29uZmlndXJhdGlvbiUyMCUzRCUyMG1vZGVsLmNvbmZpZw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMModel, MarkupLMConfig

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a MarkupLM microsoft/markuplm-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = MarkupLMConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the microsoft/markuplm-base style configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarkupLMModel(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(){m=a("p"),E=o("Examples:"),_=l(),k(g.$$.fragment)},l(h){m=r(h,"P",{});var f=i(m);E=n(f,"Examples:"),f.forEach(t),_=d(h),M(g.$$.fragment,h)},m(h,f){u(h,m,f),e(m,E),u(h,_,f),v(g,h,f),w=!0},p:ta,i(h){w||(b(g.$$.fragment,h),w=!0)},o(h){y(g.$$.fragment,h),w=!1},d(h){h&&t(m),h&&t(_),T(g,h)}}}function I2(j){let m,E,_,g,w;return g=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNRmVhdHVyZUV4dHJhY3RvciUwQSUwQXBhZ2VfbmFtZV8xJTIwJTNEJTIwJTIycGFnZTEuaHRtbCUyMiUwQXBhZ2VfbmFtZV8yJTIwJTNEJTIwJTIycGFnZTIuaHRtbCUyMiUwQXBhZ2VfbmFtZV8zJTIwJTNEJTIwJTIycGFnZTMuaHRtbCUyMiUwQSUwQXdpdGglMjBvcGVuKHBhZ2VfbmFtZV8xKSUyMGFzJTIwZiUzQSUwQSUyMCUyMCUyMCUyMHNpbmdsZV9odG1sX3N0cmluZyUyMCUzRCUyMGYucmVhZCgpJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBNYXJrdXBMTUZlYXR1cmVFeHRyYWN0b3IoKSUwQSUwQSUyMyUyMHNpbmdsZSUyMGV4YW1wbGUlMEFlbmNvZGluZyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKHNpbmdsZV9odG1sX3N0cmluZyklMEFwcmludChlbmNvZGluZy5rZXlzKCkpJTBBJTIzJTIwZGljdF9rZXlzKCU1Qidub2RlcyclMkMlMjAneHBhdGhzJyU1RCklMEElMEElMjMlMjBiYXRjaGVkJTIwZXhhbXBsZSUwQSUwQW11bHRpX2h0bWxfc3RyaW5ncyUyMCUzRCUyMCU1QiU1RCUwQSUwQXdpdGglMjBvcGVuKHBhZ2VfbmFtZV8yKSUyMGFzJTIwZiUzQSUwQSUyMCUyMCUyMCUyMG11bHRpX2h0bWxfc3RyaW5ncy5hcHBlbmQoZi5yZWFkKCkpJTBBd2l0aCUyMG9wZW4ocGFnZV9uYW1lXzMpJTIwYXMlMjBmJTNBJTBBJTIwJTIwJTIwJTIwbXVsdGlfaHRtbF9zdHJpbmdzLmFwcGVuZChmLnJlYWQoKSklMEElMEFlbmNvZGluZyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKG11bHRpX2h0bWxfc3RyaW5ncyklMEFwcmludChlbmNvZGluZy5rZXlzKCkpJTBBJTIzJTIwZGljdF9rZXlzKCU1Qidub2RlcyclMkMlMjAneHBhdGhzJyU1RCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>page_name_1 = <span class="hljs-string">&quot;page1.html&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>page_name_2 = <span class="hljs-string">&quot;page2.html&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>page_name_3 = <span class="hljs-string">&quot;page3.html&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> <span class="hljs-built_in">open</span>(page_name_1) <span class="hljs-keyword">as</span> f:
<span class="hljs-meta">... </span>    single_html_string = f.read()

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = MarkupLMFeatureExtractor()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># single example</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = feature_extractor(single_html_string)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding.keys())
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># dict_keys([&#x27;nodes&#x27;, &#x27;xpaths&#x27;])</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># batched example</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>multi_html_strings = []

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> <span class="hljs-built_in">open</span>(page_name_2) <span class="hljs-keyword">as</span> f:
<span class="hljs-meta">... </span>    multi_html_strings.append(f.read())
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> <span class="hljs-built_in">open</span>(page_name_3) <span class="hljs-keyword">as</span> f:
<span class="hljs-meta">... </span>    multi_html_strings.append(f.read())

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = feature_extractor(multi_html_strings)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding.keys())
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># dict_keys([&#x27;nodes&#x27;, &#x27;xpaths&#x27;])</span>`}}),{c(){m=a("p"),E=o("Examples:"),_=l(),k(g.$$.fragment)},l(h){m=r(h,"P",{});var f=i(m);E=n(f,"Examples:"),f.forEach(t),_=d(h),M(g.$$.fragment,h)},m(h,f){u(h,m,f),e(m,E),u(h,_,f),v(g,h,f),w=!0},p:ta,i(h){w||(b(g.$$.fragment,h),w=!0)},o(h){y(g.$$.fragment,h),w=!1},d(h){h&&t(m),h&&t(_),T(g,h)}}}function N2(j){let m,E,_,g,w;return{c(){m=a("p"),E=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=o("Module"),w=o(`
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(h){m=r(h,"P",{});var f=i(m);E=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var Q=i(_);g=n(Q,"Module"),Q.forEach(t),w=n(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(t)},m(h,f){u(h,m,f),e(m,E),e(m,_),e(_,g),e(m,w)},d(h){h&&t(m)}}}function R2(j){let m,E,_,g,w;return g=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBNYXJrdXBMTU1vZGVsJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwQXV0b1Byb2Nlc3Nvci5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbWFya3VwbG0tYmFzZSUyMiklMEFtb2RlbCUyMCUzRCUyME1hcmt1cExNTW9kZWwuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjIpJTBBJTBBaHRtbF9zdHJpbmclMjAlM0QlMjAlMjIlM0NodG1sJTNFJTIwJTNDaGVhZCUzRSUyMCUzQ3RpdGxlJTNFUGFnZSUyMFRpdGxlJTNDJTJGdGl0bGUlM0UlMjAlM0MlMkZoZWFkJTNFJTIwJTNDJTJGaHRtbCUzRSUyMiUwQSUwQWVuY29kaW5nJTIwJTNEJTIwcHJvY2Vzc29yKGh0bWxfc3RyaW5nJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiplbmNvZGluZyklMEFsYXN0X2hpZGRlbl9zdGF0ZXMlMjAlM0QlMjBvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlJTBBbGlzdChsYXN0X2hpZGRlbl9zdGF0ZXMuc2hhcGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, MarkupLMModel

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarkupLMModel.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>html_string = <span class="hljs-string">&quot;&lt;html&gt; &lt;head&gt; &lt;title&gt;Page Title&lt;/title&gt; &lt;/head&gt; &lt;/html&gt;&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(html_string, 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
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">list</span>(last_hidden_states.shape)
[<span class="hljs-number">1</span>, <span class="hljs-number">4</span>, <span class="hljs-number">768</span>]`}}),{c(){m=a("p"),E=o("Examples:"),_=l(),k(g.$$.fragment)},l(h){m=r(h,"P",{});var f=i(m);E=n(f,"Examples:"),f.forEach(t),_=d(h),M(g.$$.fragment,h)},m(h,f){u(h,m,f),e(m,E),u(h,_,f),v(g,h,f),w=!0},p:ta,i(h){w||(b(g.$$.fragment,h),w=!0)},o(h){y(g.$$.fragment,h),w=!1},d(h){h&&t(m),h&&t(_),T(g,h)}}}function Z2(j){let m,E,_,g,w;return{c(){m=a("p"),E=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=o("Module"),w=o(`
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(h){m=r(h,"P",{});var f=i(m);E=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var Q=i(_);g=n(Q,"Module"),Q.forEach(t),w=n(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(t)},m(h,f){u(h,m,f),e(m,E),e(m,_),e(_,g),e(m,w)},d(h){h&&t(m)}}}function B2(j){let m,E,_,g,w;return g=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtYXJrdXBsbS1iYXNlJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbWFya3VwbG0tYmFzZSUyMiUyQyUyMG51bV9sYWJlbHMlM0Q3KSUwQSUwQWh0bWxfc3RyaW5nJTIwJTNEJTIwJTIyJTNDaHRtbCUzRSUyMCUzQ2hlYWQlM0UlMjAlM0N0aXRsZSUzRVBhZ2UlMjBUaXRsZSUzQyUyRnRpdGxlJTNFJTIwJTNDJTJGaGVhZCUzRSUyMCUzQyUyRmh0bWwlM0UlMjIlMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvcihodG1sX3N0cmluZyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMG91dHB1dHMlMjAlM0QlMjBtb2RlbCgqKmVuY29kaW5nKSUwQSUwQWxvc3MlMjAlM0QlMjBvdXRwdXRzLmxvc3MlMEFsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>, num_labels=<span class="hljs-number">7</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>html_string = <span class="hljs-string">&quot;&lt;html&gt; &lt;head&gt; &lt;title&gt;Page Title&lt;/title&gt; &lt;/head&gt; &lt;/html&gt;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(html_string, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){m=a("p"),E=o("Examples:"),_=l(),k(g.$$.fragment)},l(h){m=r(h,"P",{});var f=i(m);E=n(f,"Examples:"),f.forEach(t),_=d(h),M(g.$$.fragment,h)},m(h,f){u(h,m,f),e(m,E),u(h,_,f),v(g,h,f),w=!0},p:ta,i(h){w||(b(g.$$.fragment,h),w=!0)},o(h){y(g.$$.fragment,h),w=!1},d(h){h&&t(m),h&&t(_),T(g,h)}}}function D2(j){let m,E,_,g,w;return{c(){m=a("p"),E=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=o("Module"),w=o(`
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(h){m=r(h,"P",{});var f=i(m);E=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var Q=i(_);g=n(Q,"Module"),Q.forEach(t),w=n(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(t)},m(h,f){u(h,m,f),e(m,E),e(m,_),e(_,g),e(m,w)},d(h){h&&t(m)}}}function A2(j){let m,E,_,g,w;return g=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBBdXRvTW9kZWxGb3JUb2tlbkNsYXNzaWZpY2F0aW9uJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtYXJrdXBsbS1iYXNlJTIyKSUwQXByb2Nlc3Nvci5wYXJzZV9odG1sJTIwJTNEJTIwRmFsc2UlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclRva2VuQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjIlMkMlMjBudW1fbGFiZWxzJTNENyklMEElMEFub2RlcyUyMCUzRCUyMCU1QiUyMmhlbGxvJTIyJTJDJTIwJTIyd29ybGQlMjIlNUQlMEF4cGF0aHMlMjAlM0QlMjAlNUIlMjIlMkZodG1sJTJGYm9keSUyRmRpdiUyRmxpJTVCMSU1RCUyRmRpdiUyRnNwYW4lMjIlMkMlMjAlMjIlMkZodG1sJTJGYm9keSUyRmRpdiUyRmxpJTVCMSU1RCUyRmRpdiUyRnNwYW4lMjIlNUQlMEFub2RlX2xhYmVscyUyMCUzRCUyMCU1QjElMkMlMjAyJTVEJTBBZW5jb2RpbmclMjAlM0QlMjBwcm9jZXNzb3Iobm9kZXMlM0Rub2RlcyUyQyUyMHhwYXRocyUzRHhwYXRocyUyQyUyMG5vZGVfbGFiZWxzJTNEbm9kZV9sYWJlbHMlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQXdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKiplbmNvZGluZyklMEElMEFsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBbG9naXRzJTIwJTNEJTIwb3V0cHV0cy5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, AutoModelForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.parse_html = <span class="hljs-literal">False</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForTokenClassification.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>, num_labels=<span class="hljs-number">7</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>nodes = [<span class="hljs-string">&quot;hello&quot;</span>, <span class="hljs-string">&quot;world&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>xpaths = [<span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>, <span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>node_labels = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(nodes=nodes, xpaths=xpaths, node_labels=node_labels, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){m=a("p"),E=o("Examples:"),_=l(),k(g.$$.fragment)},l(h){m=r(h,"P",{});var f=i(m);E=n(f,"Examples:"),f.forEach(t),_=d(h),M(g.$$.fragment,h)},m(h,f){u(h,m,f),e(m,E),u(h,_,f),v(g,h,f),w=!0},p:ta,i(h){w||(b(g.$$.fragment,h),w=!0)},o(h){y(g.$$.fragment,h),w=!1},d(h){h&&t(m),h&&t(_),T(g,h)}}}function G2(j){let m,E,_,g,w;return{c(){m=a("p"),E=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),_=a("code"),g=o("Module"),w=o(`
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(h){m=r(h,"P",{});var f=i(m);E=n(f,"Although the recipe for forward pass needs to be defined within this function, one should call the "),_=r(f,"CODE",{});var Q=i(_);g=n(Q,"Module"),Q.forEach(t),w=n(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(t)},m(h,f){u(h,m,f),e(m,E),e(m,_),e(_,g),e(m,w)},d(h){h&&t(m)}}}function P2(j){let m,E,_,g,w;return g=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMkMlMjBNYXJrdXBMTUZvclF1ZXN0aW9uQW5zd2VyaW5nJTBBaW1wb3J0JTIwdG9yY2glMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtYXJrdXBsbS1iYXNlLWZpbmV0dW5lZC13ZWJzcmMlMjIpJTBBbW9kZWwlMjAlM0QlMjBNYXJrdXBMTUZvclF1ZXN0aW9uQW5zd2VyaW5nLmZyb21fcHJldHJhaW5lZCglMjJtaWNyb3NvZnQlMkZtYXJrdXBsbS1iYXNlLWZpbmV0dW5lZC13ZWJzcmMlMjIpJTBBJTBBaHRtbF9zdHJpbmclMjAlM0QlMjAlMjIlM0NodG1sJTNFJTIwJTNDaGVhZCUzRSUyMCUzQ3RpdGxlJTNFTXklMjBuYW1lJTIwaXMlMjBOaWVscyUzQyUyRnRpdGxlJTNFJTIwJTNDJTJGaGVhZCUzRSUyMCUzQyUyRmh0bWwlM0UlMjIlMEFxdWVzdGlvbiUyMCUzRCUyMCUyMldoYXQncyUyMGhpcyUyMG5hbWUlM0YlMjIlMEElMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvcihodG1sX3N0cmluZyUyQyUyMHF1ZXN0aW9ucyUzRHF1ZXN0aW9uJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEElMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqZW5jb2RpbmcpJTBBJTBBYW5zd2VyX3N0YXJ0X2luZGV4JTIwJTNEJTIwb3V0cHV0cy5zdGFydF9sb2dpdHMuYXJnbWF4KCklMEFhbnN3ZXJfZW5kX2luZGV4JTIwJTNEJTIwb3V0cHV0cy5lbmRfbG9naXRzLmFyZ21heCgpJTBBJTBBcHJlZGljdF9hbnN3ZXJfdG9rZW5zJTIwJTNEJTIwZW5jb2RpbmcuaW5wdXRfaWRzJTVCMCUyQyUyMGFuc3dlcl9zdGFydF9pbmRleCUyMCUzQSUyMGFuc3dlcl9lbmRfaW5kZXglMjAlMkIlMjAxJTVEJTBBcHJvY2Vzc29yLmRlY29kZShwcmVkaWN0X2Fuc3dlcl90b2tlbnMpLnN0cmlwKCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor, MarkupLMForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base-finetuned-websrc&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = MarkupLMForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base-finetuned-websrc&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>html_string = <span class="hljs-string">&quot;&lt;html&gt; &lt;head&gt; &lt;title&gt;My name is Niels&lt;/title&gt; &lt;/head&gt; &lt;/html&gt;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>question = <span class="hljs-string">&quot;What&#x27;s his name?&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(html_string, questions=question, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**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>processor.decode(predict_answer_tokens).strip()
<span class="hljs-string">&#x27;Niels&#x27;</span>`}}),{c(){m=a("p"),E=o("Examples:"),_=l(),k(g.$$.fragment)},l(h){m=r(h,"P",{});var f=i(m);E=n(f,"Examples:"),f.forEach(t),_=d(h),M(g.$$.fragment,h)},m(h,f){u(h,m,f),e(m,E),u(h,_,f),v(g,h,f),w=!0},p:ta,i(h){w||(b(g.$$.fragment,h),w=!0)},o(h){y(g.$$.fragment,h),w=!1},d(h){h&&t(m),h&&t(_),T(g,h)}}}function S2(j){let m,E,_,g,w,h,f,Q,Zc,md,De,ht,oa,co,Bc,na,Dc,fd,qe,Ac,po,Gc,Pc,Ln,Sc,Wc,gd,qn,Oc,_d,ut,$n,ho,Vc,Qc,Xc,Un,uo,Hc,Yc,kd,zn,Kc,Md,Jn,sa,ep,vd,Cn,tp,bd,$e,le,op,aa,np,sp,jn,ap,rp,ra,ip,lp,ia,dp,cp,pp,Ae,hp,Fn,up,mp,In,fp,gp,_p,mo,kp,fo,Mp,vp,yd,mt,gb,Td,go,bp,Nn,yp,wd,Ue,Tp,_o,wp,Ep,ko,xp,Lp,Ed,Ge,ft,la,Mo,qp,da,$p,xd,Y,Up,Rn,zp,Jp,Zn,Cp,jp,Bn,Fp,Ip,Dn,Np,Rp,ca,Zp,Bp,Ld,vo,qd,U,Dp,An,Ap,Gp,Gn,Pp,Sp,Pn,Wp,Op,Sn,Vp,Qp,pa,Xp,Hp,ha,Yp,Kp,ua,eh,th,ma,oh,nh,fa,sh,ah,ga,rh,ih,$d,de,Wn,lh,dh,bo,ch,ph,On,hh,uh,Vn,mh,fh,Ud,Qn,gh,zd,Xn,_a,_h,Jd,Hn,kh,Cd,yo,jd,Yn,ka,Mh,Fd,ze,vh,Ma,bh,yh,va,Th,wh,Id,To,Nd,Kn,ba,Eh,Rd,K,xh,wo,Lh,qh,ya,$h,Uh,Ta,zh,Jh,wa,Ch,jh,Ea,Fh,Ih,Zd,Eo,Bd,es,xa,Nh,Dd,ts,Rh,Ad,xo,Gd,os,La,Zh,Pd,Je,Bh,qa,Dh,Ah,$a,Gh,Ph,Sd,Lo,Wd,Pe,gt,Ua,qo,Sh,za,Wh,Od,Ce,Ja,ns,Oh,Vh,Ca,ss,Qh,Xh,ja,as,Hh,Vd,Se,_t,Fa,$o,Yh,Ia,Kh,Qd,ce,Uo,eu,We,tu,rs,ou,nu,zo,su,au,ru,Oe,iu,is,lu,du,ls,cu,pu,hu,kt,Xd,Ve,Mt,Na,Jo,uu,Ra,mu,Hd,pe,Co,fu,Za,gu,_u,jo,ku,Ba,Mu,vu,bu,je,Fo,yu,Da,Tu,wu,vt,Yd,Qe,bt,Aa,Io,Eu,Ga,xu,Kd,X,No,Lu,B,qu,ds,$u,Uu,Pa,zu,Ju,Sa,Cu,ju,Wa,Fu,Iu,Oa,Nu,Ru,Va,Zu,Bu,cs,Du,Au,Gu,Fe,Ro,Pu,Qa,Su,Wu,Zo,ps,Ou,Xa,Vu,Qu,hs,Xu,Ha,Hu,Yu,us,Bo,Ku,yt,Do,em,Ya,tm,om,ms,Ao,ec,Xe,Tt,Ka,Go,nm,er,sm,tc,J,Po,am,tr,rm,im,D,fs,lm,dm,or,cm,pm,nr,hm,um,sr,mm,fm,ar,gm,_m,rr,km,Mm,gs,vm,bm,ym,ir,Tm,wm,A,So,Em,I,xm,lr,Lm,qm,dr,$m,Um,cr,zm,Jm,pr,Cm,jm,hr,Fm,Im,_s,Nm,Rm,ur,Zm,Bm,mr,Dm,Am,Gm,H,fr,wt,gr,Pm,Sm,_r,Wm,Om,Vm,kr,Et,Mr,Qm,Xm,vr,Hm,Ym,Km,br,G,yr,ef,tf,Tr,of,nf,wr,sf,af,Er,rf,lf,ks,df,cf,xr,pf,hf,Lr,uf,mf,ff,qr,Ie,$r,gf,_f,Ur,kf,Mf,zr,vf,bf,yf,Jr,xt,Cr,Tf,wf,jr,Ef,xf,Lf,Fr,Lt,Ir,qf,$f,Nr,Uf,zf,Jf,Rr,fe,Zr,Cf,jf,Br,Ff,If,Dr,Nf,Rf,Ar,Zf,Bf,Df,x,Af,Gr,Gf,Pf,Pr,Sf,Wf,Sr,Of,Vf,Wr,Qf,Xf,Or,Hf,Yf,Vr,Kf,eg,Qr,tg,og,Xr,ng,sg,Hr,ag,rg,Yr,ig,lg,Kr,dg,cg,ei,pg,hg,ti,ug,mg,oi,fg,gg,Ms,_g,kg,ni,Mg,vg,bg,He,qt,si,yg,Tg,ai,wg,Eg,xg,$t,ri,Lg,qg,ii,$g,Ug,zg,Ut,li,Jg,Cg,di,jg,Fg,Ig,N,Ng,ci,Rg,Zg,pi,Bg,Dg,hi,Ag,Gg,ui,Pg,Sg,mi,Wg,Og,vs,Vg,Qg,fi,Xg,Hg,gi,Yg,Kg,e_,C,_i,zt,ki,t_,o_,Mi,n_,s_,a_,vi,Jt,bi,r_,i_,yi,l_,d_,c_,Ti,P,wi,p_,h_,Ei,u_,m_,xi,f_,g_,Li,__,k_,bs,M_,v_,qi,b_,y_,$i,T_,w_,E_,Ui,Ne,zi,x_,L_,Ji,q_,$_,Ci,U_,z_,J_,ji,Ct,Fi,C_,j_,Ii,F_,I_,N_,Ni,jt,Ri,R_,Z_,Zi,B_,D_,A_,Bi,L,Di,G_,P_,Ai,S_,W_,Gi,O_,V_,Pi,Q_,X_,Si,H_,Y_,Wi,K_,ek,Oi,tk,ok,Vi,nk,sk,Qi,ak,rk,Xi,ik,lk,Hi,dk,ck,Yi,pk,hk,Ki,uk,mk,ys,fk,gk,el,_k,kk,Mk,tl,Ft,ol,vk,bk,nl,yk,Tk,wk,sl,It,al,Ek,xk,rl,Lk,qk,$k,il,Nt,ll,Uk,zk,dl,Jk,Ck,jk,Re,Wo,Fk,cl,Ik,Nk,Oo,Ts,Rk,pl,Zk,Bk,ws,Dk,hl,Ak,Gk,Rt,Vo,Pk,ul,Sk,Wk,Zt,Qo,Ok,Xo,Vk,ml,Qk,Xk,Hk,Bt,Ho,Yk,fl,Kk,oc,Ye,Dt,gl,Yo,eM,_l,tM,nc,te,Ko,oM,kl,nM,sM,Es,xs,aM,rM,iM,R,lM,Ls,dM,cM,qs,pM,hM,$s,uM,mM,Ml,fM,gM,vl,_M,kM,bl,MM,vM,yl,bM,yM,Tl,TM,wM,EM,ge,en,xM,oe,LM,wl,qM,$M,tn,El,UM,zM,JM,xl,CM,jM,Ll,FM,IM,ql,NM,RM,ZM,on,BM,$l,DM,AM,GM,Ul,PM,sc,Ke,At,zl,nn,SM,Jl,WM,ac,xe,sn,OM,an,VM,rn,QM,XM,HM,_e,ln,YM,et,KM,Us,ev,tv,Cl,ov,nv,sv,Gt,av,Pt,rc,tt,St,jl,dn,rv,Fl,iv,ic,he,cn,lv,Il,dv,cv,pn,pv,hn,hv,uv,mv,ke,un,fv,ot,gv,zs,_v,kv,Nl,Mv,vv,bv,Wt,yv,Ot,lc,nt,Vt,Rl,mn,Tv,Zl,wv,dc,Le,fn,Ev,st,xv,Bl,Lv,qv,gn,$v,Uv,zv,Me,_n,Jv,at,Cv,Js,jv,Fv,Dl,Iv,Nv,Rv,Qt,Zv,Xt,cc,rt,Ht,Al,kn,Bv,Gl,Dv,pc,ue,Mn,Av,it,Gv,Pl,Pv,Sv,Sl,Wv,Ov,Vv,vn,Qv,bn,Xv,Hv,Yv,ve,yn,Kv,lt,eb,Cs,tb,ob,Wl,nb,sb,ab,Yt,rb,Kt,hc;return h=new me({}),co=new me({}),Mo=new me({}),vo=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNRmVhdHVyZUV4dHJhY3RvciUyQyUyME1hcmt1cExNVG9rZW5pemVyRmFzdCUyQyUyME1hcmt1cExNUHJvY2Vzc29yJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBNYXJrdXBMTUZlYXR1cmVFeHRyYWN0b3IoKSUwQXRva2VuaXplciUyMCUzRCUyME1hcmt1cExNVG9rZW5pemVyRmFzdC5mcm9tX3ByZXRyYWluZWQoJTIybWljcm9zb2Z0JTJGbWFya3VwbG0tYmFzZSUyMiklMEFwcm9jZXNzb3IlMjAlM0QlMjBNYXJrdXBMTVByb2Nlc3NvcihmZWF0dXJlX2V4dHJhY3RvciUyQyUyMHRva2VuaXplcik=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMFeatureExtractor, MarkupLMTokenizerFast, MarkupLMProcessor

feature_extractor = MarkupLMFeatureExtractor()
tokenizer = MarkupLMTokenizerFast.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)
processor = MarkupLMProcessor(feature_extractor, tokenizer)`}}),yo=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNUHJvY2Vzc29yJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwTWFya3VwTE1Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjIpJTBBJTBBaHRtbF9zdHJpbmclMjAlM0QlMjAlMjIlMjIlMjIlMEElMjAlM0MhRE9DVFlQRSUyMGh0bWwlM0UlMEElMjAlM0NodG1sJTNFJTBBJTIwJTNDaGVhZCUzRSUwQSUyMCUzQ3RpdGxlJTNFSGVsbG8lMjB3b3JsZCUzQyUyRnRpdGxlJTNFJTBBJTIwJTNDJTJGaGVhZCUzRSUwQSUyMCUzQ2JvZHklM0UlMEElMjAlM0NoMSUzRVdlbGNvbWUlM0MlMkZoMSUzRSUwQSUyMCUzQ3AlM0VIZXJlJTIwaXMlMjBteSUyMHdlYnNpdGUuJTNDJTJGcCUzRSUwQSUyMCUzQyUyRmJvZHklM0UlMEElMjAlM0MlMkZodG1sJTNFJTIyJTIyJTIyJTBBJTBBJTIzJTIwbm90ZSUyMHRoYXQlMjB5b3UlMjBjYW4lMjBhbHNvJTIwYWRkJTIwcHJvdmlkZSUyMGFsbCUyMHRva2VuaXplciUyMHBhcmFtZXRlcnMlMjBoZXJlJTIwc3VjaCUyMGFzJTIwcGFkZGluZyUyQyUyMHRydW5jYXRpb24lMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3NvcihodG1sX3N0cmluZyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBcHJpbnQoZW5jb2Rpbmcua2V5cygpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MarkupLMProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>html_string = <span class="hljs-string">&quot;&quot;&quot;
<span class="hljs-meta">... </span> &lt;!DOCTYPE html&gt;
<span class="hljs-meta">... </span> &lt;html&gt;
<span class="hljs-meta">... </span> &lt;head&gt;
<span class="hljs-meta">... </span> &lt;title&gt;Hello world&lt;/title&gt;
<span class="hljs-meta">... </span> &lt;/head&gt;
<span class="hljs-meta">... </span> &lt;body&gt;
<span class="hljs-meta">... </span> &lt;h1&gt;Welcome&lt;/h1&gt;
<span class="hljs-meta">... </span> &lt;p&gt;Here is my website.&lt;/p&gt;
<span class="hljs-meta">... </span> &lt;/body&gt;
<span class="hljs-meta">... </span> &lt;/html&gt;&quot;&quot;&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># note that you can also add provide all tokenizer parameters here such as padding, truncation</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(html_string, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding.keys())
dict_keys([<span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;token_type_ids&#x27;</span>, <span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;xpath_tags_seq&#x27;</span>, <span class="hljs-string">&#x27;xpath_subs_seq&#x27;</span>])`}}),To=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNUHJvY2Vzc29yJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwTWFya3VwTE1Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjIpJTBBcHJvY2Vzc29yLnBhcnNlX2h0bWwlMjAlM0QlMjBGYWxzZSUwQSUwQW5vZGVzJTIwJTNEJTIwJTVCJTIyaGVsbG8lMjIlMkMlMjAlMjJ3b3JsZCUyMiUyQyUyMCUyMmhvdyUyMiUyQyUyMCUyMmFyZSUyMiU1RCUwQXhwYXRocyUyMCUzRCUyMCU1QiUyMiUyRmh0bWwlMkZib2R5JTJGZGl2JTJGbGklNUIxJTVEJTJGZGl2JTJGc3BhbiUyMiUyQyUyMCUyMiUyRmh0bWwlMkZib2R5JTJGZGl2JTJGbGklNUIxJTVEJTJGZGl2JTJGc3BhbiUyMiUyQyUyMCUyMmh0bWwlMkZib2R5JTIyJTJDJTIwJTIyaHRtbCUyRmJvZHklMkZkaXYlMjIlNUQlMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3Nvcihub2RlcyUzRG5vZGVzJTJDJTIweHBhdGhzJTNEeHBhdGhzJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFwcmludChlbmNvZGluZy5rZXlzKCkp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MarkupLMProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.parse_html = <span class="hljs-literal">False</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>nodes = [<span class="hljs-string">&quot;hello&quot;</span>, <span class="hljs-string">&quot;world&quot;</span>, <span class="hljs-string">&quot;how&quot;</span>, <span class="hljs-string">&quot;are&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>xpaths = [<span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>, <span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>, <span class="hljs-string">&quot;html/body&quot;</span>, <span class="hljs-string">&quot;html/body/div&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(nodes=nodes, xpaths=xpaths, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding.keys())
dict_keys([<span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;token_type_ids&#x27;</span>, <span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;xpath_tags_seq&#x27;</span>, <span class="hljs-string">&#x27;xpath_subs_seq&#x27;</span>])`}}),Eo=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNUHJvY2Vzc29yJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwTWFya3VwTE1Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjIpJTBBcHJvY2Vzc29yLnBhcnNlX2h0bWwlMjAlM0QlMjBGYWxzZSUwQSUwQW5vZGVzJTIwJTNEJTIwJTVCJTIyaGVsbG8lMjIlMkMlMjAlMjJ3b3JsZCUyMiUyQyUyMCUyMmhvdyUyMiUyQyUyMCUyMmFyZSUyMiU1RCUwQXhwYXRocyUyMCUzRCUyMCU1QiUyMiUyRmh0bWwlMkZib2R5JTJGZGl2JTJGbGklNUIxJTVEJTJGZGl2JTJGc3BhbiUyMiUyQyUyMCUyMiUyRmh0bWwlMkZib2R5JTJGZGl2JTJGbGklNUIxJTVEJTJGZGl2JTJGc3BhbiUyMiUyQyUyMCUyMmh0bWwlMkZib2R5JTIyJTJDJTIwJTIyaHRtbCUyRmJvZHklMkZkaXYlMjIlNUQlMEFub2RlX2xhYmVscyUyMCUzRCUyMCU1QjElMkMlMjAyJTJDJTIwMiUyQyUyMDElNUQlMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3Nvcihub2RlcyUzRG5vZGVzJTJDJTIweHBhdGhzJTNEeHBhdGhzJTJDJTIwbm9kZV9sYWJlbHMlM0Rub2RlX2xhYmVscyUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIycHQlMjIpJTBBcHJpbnQoZW5jb2Rpbmcua2V5cygpKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MarkupLMProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.parse_html = <span class="hljs-literal">False</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>nodes = [<span class="hljs-string">&quot;hello&quot;</span>, <span class="hljs-string">&quot;world&quot;</span>, <span class="hljs-string">&quot;how&quot;</span>, <span class="hljs-string">&quot;are&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>xpaths = [<span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>, <span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>, <span class="hljs-string">&quot;html/body&quot;</span>, <span class="hljs-string">&quot;html/body/div&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>node_labels = [<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">1</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(nodes=nodes, xpaths=xpaths, node_labels=node_labels, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding.keys())
dict_keys([<span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;token_type_ids&#x27;</span>, <span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;xpath_tags_seq&#x27;</span>, <span class="hljs-string">&#x27;xpath_subs_seq&#x27;</span>, <span class="hljs-string">&#x27;labels&#x27;</span>])`}}),xo=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNUHJvY2Vzc29yJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwTWFya3VwTE1Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjIpJTBBJTBBaHRtbF9zdHJpbmclMjAlM0QlMjAlMjIlMjIlMjIlMEElMjAlM0MhRE9DVFlQRSUyMGh0bWwlM0UlMEElMjAlM0NodG1sJTNFJTBBJTIwJTNDaGVhZCUzRSUwQSUyMCUzQ3RpdGxlJTNFSGVsbG8lMjB3b3JsZCUzQyUyRnRpdGxlJTNFJTBBJTIwJTNDJTJGaGVhZCUzRSUwQSUyMCUzQ2JvZHklM0UlMEElMjAlM0NoMSUzRVdlbGNvbWUlM0MlMkZoMSUzRSUwQSUyMCUzQ3AlM0VNeSUyMG5hbWUlMjBpcyUyME5pZWxzLiUzQyUyRnAlM0UlMEElMjAlM0MlMkZib2R5JTNFJTBBJTIwJTNDJTJGaHRtbCUzRSUyMiUyMiUyMiUwQSUwQXF1ZXN0aW9uJTIwJTNEJTIwJTIyV2hhdCdzJTIwaGlzJTIwbmFtZSUzRiUyMiUwQWVuY29kaW5nJTIwJTNEJTIwcHJvY2Vzc29yKGh0bWxfc3RyaW5nJTJDJTIwcXVlc3Rpb25zJTNEcXVlc3Rpb24lMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXByaW50KGVuY29kaW5nLmtleXMoKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MarkupLMProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>html_string = <span class="hljs-string">&quot;&quot;&quot;
<span class="hljs-meta">... </span> &lt;!DOCTYPE html&gt;
<span class="hljs-meta">... </span> &lt;html&gt;
<span class="hljs-meta">... </span> &lt;head&gt;
<span class="hljs-meta">... </span> &lt;title&gt;Hello world&lt;/title&gt;
<span class="hljs-meta">... </span> &lt;/head&gt;
<span class="hljs-meta">... </span> &lt;body&gt;
<span class="hljs-meta">... </span> &lt;h1&gt;Welcome&lt;/h1&gt;
<span class="hljs-meta">... </span> &lt;p&gt;My name is Niels.&lt;/p&gt;
<span class="hljs-meta">... </span> &lt;/body&gt;
<span class="hljs-meta">... </span> &lt;/html&gt;&quot;&quot;&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>question = <span class="hljs-string">&quot;What&#x27;s his name?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(html_string, questions=question, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding.keys())
dict_keys([<span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;token_type_ids&#x27;</span>, <span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;xpath_tags_seq&#x27;</span>, <span class="hljs-string">&#x27;xpath_subs_seq&#x27;</span>])`}}),Lo=new Ee({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyME1hcmt1cExNUHJvY2Vzc29yJTBBJTBBcHJvY2Vzc29yJTIwJTNEJTIwTWFya3VwTE1Qcm9jZXNzb3IuZnJvbV9wcmV0cmFpbmVkKCUyMm1pY3Jvc29mdCUyRm1hcmt1cGxtLWJhc2UlMjIpJTBBcHJvY2Vzc29yLnBhcnNlX2h0bWwlMjAlM0QlMjBGYWxzZSUwQSUwQW5vZGVzJTIwJTNEJTIwJTVCJTIyaGVsbG8lMjIlMkMlMjAlMjJ3b3JsZCUyMiUyQyUyMCUyMmhvdyUyMiUyQyUyMCUyMmFyZSUyMiU1RCUwQXhwYXRocyUyMCUzRCUyMCU1QiUyMiUyRmh0bWwlMkZib2R5JTJGZGl2JTJGbGklNUIxJTVEJTJGZGl2JTJGc3BhbiUyMiUyQyUyMCUyMiUyRmh0bWwlMkZib2R5JTJGZGl2JTJGbGklNUIxJTVEJTJGZGl2JTJGc3BhbiUyMiUyQyUyMCUyMmh0bWwlMkZib2R5JTIyJTJDJTIwJTIyaHRtbCUyRmJvZHklMkZkaXYlMjIlNUQlMEFxdWVzdGlvbiUyMCUzRCUyMCUyMldoYXQncyUyMGhpcyUyMG5hbWUlM0YlMjIlMEFlbmNvZGluZyUyMCUzRCUyMHByb2Nlc3Nvcihub2RlcyUzRG5vZGVzJTJDJTIweHBhdGhzJTNEeHBhdGhzJTJDJTIwcXVlc3Rpb25zJTNEcXVlc3Rpb24lMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXByaW50KGVuY29kaW5nLmtleXMoKSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> MarkupLMProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = MarkupLMProcessor.from_pretrained(<span class="hljs-string">&quot;microsoft/markuplm-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>processor.parse_html = <span class="hljs-literal">False</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>nodes = [<span class="hljs-string">&quot;hello&quot;</span>, <span class="hljs-string">&quot;world&quot;</span>, <span class="hljs-string">&quot;how&quot;</span>, <span class="hljs-string">&quot;are&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>xpaths = [<span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>, <span class="hljs-string">&quot;/html/body/div/li[1]/div/span&quot;</span>, <span class="hljs-string">&quot;html/body&quot;</span>, <span class="hljs-string">&quot;html/body/div&quot;</span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>question = <span class="hljs-string">&quot;What&#x27;s his name?&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = processor(nodes=nodes, xpaths=xpaths, questions=question, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(encoding.keys())
dict_keys([<span class="hljs-string">&#x27;input_ids&#x27;</span>, <span class="hljs-string">&#x27;token_type_ids&#x27;</span>, <span class="hljs-string">&#x27;attention_mask&#x27;</span>, <span class="hljs-string">&#x27;xpath_tags_seq&#x27;</span>, <span class="hljs-string">&#x27;xpath_subs_seq&#x27;</span>])`}}),qo=new me({}),$o=new me({}),Uo=new z({props:{name:"class transformers.MarkupLMConfig",anchor:"transformers.MarkupLMConfig",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:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"max_xpath_tag_unit_embeddings",val:" = 256"},{name:"max_xpath_subs_unit_embeddings",val:" = 1024"},{name:"tag_pad_id",val:" = 216"},{name:"subs_pad_id",val:" = 1001"},{name:"xpath_unit_hidden_size",val:" = 32"},{name:"max_depth",val:" = 50"},{name:"position_embedding_type",val:" = 'absolute'"},{name:"use_cache",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the MarkupLM model. Defines the different tokens that can be represented by the
<em>inputs_ids</em> passed to the forward method of <a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMModel">MarkupLMModel</a>.`,name:"vocab_size"},{anchor:"transformers.MarkupLMConfig.hidden_size",description:`<strong>hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 768) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"hidden_size"},{anchor:"transformers.MarkupLMConfig.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.MarkupLMConfig.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.MarkupLMConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (i.e., feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.MarkupLMConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>function</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.MarkupLMConfig.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.MarkupLMConfig.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.MarkupLMConfig.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.MarkupLMConfig.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 into <a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMModel">MarkupLMModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.MarkupLMConfig.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.MarkupLMConfig.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.MarkupLMConfig.max_tree_id_unit_embeddings",description:`<strong>max_tree_id_unit_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum value that the tree id unit embedding might ever use. Typically set this to something large
just in case (e.g., 1024).`,name:"max_tree_id_unit_embeddings"},{anchor:"transformers.MarkupLMConfig.max_xpath_tag_unit_embeddings",description:`<strong>max_xpath_tag_unit_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The maximum value that the xpath tag unit embedding might ever use. Typically set this to something large
just in case (e.g., 256).`,name:"max_xpath_tag_unit_embeddings"},{anchor:"transformers.MarkupLMConfig.max_xpath_subs_unit_embeddings",description:`<strong>max_xpath_subs_unit_embeddings</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
The maximum value that the xpath subscript unit embedding might ever use. Typically set this to something
large just in case (e.g., 1024).`,name:"max_xpath_subs_unit_embeddings"},{anchor:"transformers.MarkupLMConfig.tag_pad_id",description:`<strong>tag_pad_id</strong> (<code>int</code>, <em>optional</em>, defaults to 216) &#x2014;
The id of the padding token in the xpath tags.`,name:"tag_pad_id"},{anchor:"transformers.MarkupLMConfig.subs_pad_id",description:`<strong>subs_pad_id</strong> (<code>int</code>, <em>optional</em>, defaults to 1001) &#x2014;
The id of the padding token in the xpath subscripts.`,name:"subs_pad_id"},{anchor:"transformers.MarkupLMConfig.xpath_tag_unit_hidden_size",description:`<strong>xpath_tag_unit_hidden_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The hidden size of each tree id unit. One complete tree index will have
(50*xpath_tag_unit_hidden_size)-dim.`,name:"xpath_tag_unit_hidden_size"},{anchor:"transformers.MarkupLMConfig.max_depth",description:`<strong>max_depth</strong> (<code>int</code>, <em>optional</em>, defaults to 50) &#x2014;
The maximum depth in xpath.`,name:"max_depth"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/configuration_markuplm.py#L29"}}),kt=new ea({props:{anchor:"transformers.MarkupLMConfig.example",$$slots:{default:[F2]},$$scope:{ctx:j}}}),Jo=new me({}),Co=new z({props:{name:"class transformers.MarkupLMFeatureExtractor",anchor:"transformers.MarkupLMFeatureExtractor",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/feature_extraction_markuplm.py#L33"}}),Fo=new z({props:{name:"__call__",anchor:"transformers.MarkupLMFeatureExtractor.__call__",parameters:[{name:"html_strings",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMFeatureExtractor.__call__.html_strings",description:`<strong>html_strings</strong> (<code>str</code>, <code>List[str]</code>) &#x2014;
The HTML string or batch of HTML strings from which to extract nodes and corresponding xpaths.`,name:"html_strings"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/feature_extraction_markuplm.py#L99",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a> with the following fields:</p>
<ul>
<li><strong>nodes</strong> \u2014 Nodes.</li>
<li><strong>xpaths</strong> \u2014 Corresponding xpaths.</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/feature_extractor#transformers.BatchFeature"
>BatchFeature</a></p>
`}}),vt=new ea({props:{anchor:"transformers.MarkupLMFeatureExtractor.__call__.example",$$slots:{default:[I2]},$$scope:{ctx:j}}}),Io=new me({}),No=new z({props:{name:"class transformers.MarkupLMTokenizer",anchor:"transformers.MarkupLMTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"tags_dict",val:""},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"max_depth",val:" = 50"},{name:"max_width",val:" = 1000"},{name:"pad_width",val:" = 1001"},{name:"pad_token_label",val:" = -100"},{name:"only_label_first_subword",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.MarkupLMTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.MarkupLMTokenizer.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.MarkupLMTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.MarkupLMTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.MarkupLMTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.MarkupLMTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.MarkupLMTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.MarkupLMTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.MarkupLMTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.MarkupLMTokenizer.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (RoBERTa tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm.py#L145"}}),Ro=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MarkupLMTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.MarkupLMTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm.py#L423",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Bo=new z({props:{name:"get_special_tokens_mask",anchor:"transformers.MarkupLMTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizer.get_special_tokens_mask.Retrieve",description:"<strong>Retrieve</strong> sequence ids from a token list that has no special tokens added. This method is called when adding &#x2014;",name:"Retrieve"},{anchor:"transformers.MarkupLMTokenizer.get_special_tokens_mask.special",description:`<strong>special</strong> tokens using the tokenizer <code>prepare_for_model</code> method. &#x2014;
token_ids_0 (<code>List[int]</code>):
List of IDs.
token_ids_1 (<code>List[int]</code>, <em>optional</em>):
Optional second list of IDs for sequence pairs.
already_has_special_tokens (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>):
Whether or not the token list is already formatted with special tokens for the model.`,name:"special"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm.py#L462",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Do=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.MarkupLMTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.MarkupLMTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm.py#L487",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ao=new z({props:{name:"save_vocabulary",anchor:"transformers.MarkupLMTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm.py#L386"}}),Go=new me({}),Po=new z({props:{name:"class transformers.MarkupLMTokenizerFast",anchor:"transformers.MarkupLMTokenizerFast",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"tags_dict",val:""},{name:"tokenizer_file",val:" = None"},{name:"errors",val:" = 'replace'"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"add_prefix_space",val:" = False"},{name:"max_depth",val:" = 50"},{name:"max_width",val:" = 1000"},{name:"pad_width",val:" = 1001"},{name:"pad_token_label",val:" = -100"},{name:"only_label_first_subword",val:" = True"},{name:"trim_offsets",val:" = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.MarkupLMTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.MarkupLMTokenizerFast.errors",description:`<strong>errors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;replace&quot;</code>) &#x2014;
Paradigm to follow when decoding bytes to UTF-8. See
<a href="https://docs.python.org/3/library/stdtypes.html#bytes.decode" rel="nofollow">bytes.decode</a> for more information.`,name:"errors"},{anchor:"transformers.MarkupLMTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.MarkupLMTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.MarkupLMTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.MarkupLMTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.MarkupLMTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.MarkupLMTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.MarkupLMTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.MarkupLMTokenizerFast.add_prefix_space",description:`<strong>add_prefix_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add an initial space to the input. This allows to treat the leading word just as any
other word. (RoBERTa tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm_fast.py#L99"}}),So=new z({props:{name:"batch_encode_plus",anchor:"transformers.MarkupLMTokenizerFast.batch_encode_plus",parameters:[{name:"batch_text_or_text_pairs",val:": typing.Union[typing.List[str], typing.List[typing.Tuple[str, str]], typing.List[typing.List[str]]]"},{name:"is_pair",val:": bool = None"},{name:"xpaths",val:": typing.Optional[typing.List[typing.List[typing.List[int]]]] = None"},{name:"node_labels",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm_fast.py#L429"}}),Wo=new z({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.MarkupLMTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.MarkupLMTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm_fast.py#L879",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Vo=new z({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.MarkupLMTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.MarkupLMTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm_fast.py#L902",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Qo=new z({props:{name:"encode_plus",anchor:"transformers.MarkupLMTokenizerFast.encode_plus",parameters:[{name:"text",val:": typing.Union[str, typing.List[str]]"},{name:"text_pair",val:": typing.Optional[typing.List[str]] = None"},{name:"xpaths",val:": typing.Optional[typing.List[typing.List[int]]] = None"},{name:"node_labels",val:": typing.Optional[typing.List[int]] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The first sequence to be encoded. This can be a string, a list of strings or a list of list of strings.`,name:"text"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.text_pair",description:`<strong>text_pair</strong> (<code>List[str]</code> or <code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second sequence to be encoded. This can be a list of strings (words of a single example) or a
list of list of strings (words of a batch of examples).`,name:"text_pair"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters. If left unset or set to
<code>None</code>, this will use the predefined model maximum length if a maximum length is required by one of the
truncation/padding parameters. If the model has no specific maximum input length (like XLNet)
truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability <code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.MarkupLMTokenizerFast.encode_plus.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.31.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm_fast.py#L496"}}),Ho=new z({props:{name:"get_xpath_seq",anchor:"transformers.MarkupLMTokenizerFast.get_xpath_seq",parameters:[{name:"xpath",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/tokenization_markuplm_fast.py#L259"}}),Yo=new me({}),Ko=new z({props:{name:"class transformers.MarkupLMProcessor",anchor:"transformers.MarkupLMProcessor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMProcessor.feature_extractor",description:`<strong>feature_extractor</strong> (<code>MarkupLMFeatureExtractor</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMFeatureExtractor">MarkupLMFeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.MarkupLMProcessor.tokenizer",description:`<strong>tokenizer</strong> (<code>MarkupLMTokenizer</code> or <code>MarkupLMTokenizerFast</code>) &#x2014;
An instance of <a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizer">MarkupLMTokenizer</a> or <a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizerFast">MarkupLMTokenizerFast</a>. The tokenizer is a required input.`,name:"tokenizer"},{anchor:"transformers.MarkupLMProcessor.parse_html",description:`<strong>parse_html</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use <code>MarkupLMFeatureExtractor</code> to parse HTML strings into nodes and corresponding xpaths.`,name:"parse_html"}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/processing_markuplm.py#L25"}}),en=new z({props:{name:"__call__",anchor:"transformers.MarkupLMProcessor.__call__",parameters:[{name:"html_strings",val:" = None"},{name:"nodes",val:" = None"},{name:"xpaths",val:" = None"},{name:"node_labels",val:" = None"},{name:"questions",val:" = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/v4.31.0/src/transformers/models/markuplm/processing_markuplm.py#L48"}}),nn=new me({}),sn=new z({props:{name:"class transformers.MarkupLMModel",anchor:"transformers.MarkupLMModel",parameters:[{name:"config",val:""},{name:"add_pooling_layer",val:" = True"}],parametersDescription:[{anchor:"transformers.MarkupLMModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig">MarkupLMConfig</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.31.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L807"}}),ln=new z({props:{name:"forward",anchor:"transformers.MarkupLMModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"xpath_tags_seq",val:": typing.Optional[torch.LongTensor] = None"},{name:"xpath_subs_seq",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:"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.MarkupLMModel.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.MarkupLMModel.forward.xpath_tags_seq",description:`<strong>xpath_tags_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Tag IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_tags_seq"},{anchor:"transformers.MarkupLMModel.forward.xpath_subs_seq",description:`<strong>xpath_subs_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Subscript IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_subs_seq"},{anchor:"transformers.MarkupLMModel.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>: <code>1</code> for
tokens that are NOT MASKED, <code>0</code> for MASKED tokens.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MarkupLMModel.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>: <code>0</code> corresponds to a <em>sentence A</em> token, <code>1</code> corresponds to a <em>sentence B</em> token</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MarkupLMModel.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.MarkupLMModel.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>: <code>1</code>
indicates the head is <strong>not masked</strong>, <code>0</code> indicates the head is <strong>masked</strong>.`,name:"head_mask"},{anchor:"transformers.MarkupLMModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MarkupLMModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the attentions tensors of all attention layers are returned. See <code>attentions</code> under
returned tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MarkupLMModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the hidden states of all layers are returned. See <code>hidden_states</code> under returned tensors
for more detail.`,name:"output_hidden_states"},{anchor:"transformers.MarkupLMModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the model will return a <a href="/docs/transformers/v4.31.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L835",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig"
>MarkupLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>) \u2014 Sequence of hidden-states at the output of the last layer of the model.</p>
</li>
<li>
<p><strong>pooler_output</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, hidden_size)</code>) \u2014 Last layer hidden-state of the first token of the sequence (classification token) after further processing
through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
the classification token after processing through a linear layer and a tanh activation function. The linear
layer weights are trained from the next sentence prediction (classification) objective during pretraining.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
<li>
<p><strong>cross_attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> and <code>config.add_cross_attention=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights of the decoder\u2019s cross-attention layer, after the attention softmax, used to compute the
weighted average in the cross-attention heads.</p>
</li>
<li>
<p><strong>past_key_values</strong> (<code>tuple(tuple(torch.FloatTensor))</code>, <em>optional</em>, returned when <code>use_cache=True</code> is passed or when <code>config.use_cache=True</code>) \u2014 Tuple of <code>tuple(torch.FloatTensor)</code> of length <code>config.n_layers</code>, with each tuple having 2 tensors of shape
<code>(batch_size, num_heads, sequence_length, embed_size_per_head)</code>) and optionally if
<code>config.is_encoder_decoder=True</code> 2 additional tensors of shape <code>(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)</code>.</p>
<p>Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
<code>config.is_encoder_decoder=True</code> in the cross-attention blocks) that can be used (see <code>past_key_values</code>
input) to speed up sequential decoding.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions"
>transformers.modeling_outputs.BaseModelOutputWithPoolingAndCrossAttentions</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Gt=new Rc({props:{$$slots:{default:[N2]},$$scope:{ctx:j}}}),Pt=new ea({props:{anchor:"transformers.MarkupLMModel.forward.example",$$slots:{default:[R2]},$$scope:{ctx:j}}}),dn=new me({}),cn=new z({props:{name:"class transformers.MarkupLMForSequenceClassification",anchor:"transformers.MarkupLMForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig">MarkupLMConfig</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.31.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L1200"}}),un=new z({props:{name:"forward",anchor:"transformers.MarkupLMForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"xpath_tags_seq",val:": typing.Optional[torch.Tensor] = None"},{name:"xpath_subs_seq",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MarkupLMForSequenceClassification.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.MarkupLMForSequenceClassification.forward.xpath_tags_seq",description:`<strong>xpath_tags_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Tag IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_tags_seq"},{anchor:"transformers.MarkupLMForSequenceClassification.forward.xpath_subs_seq",description:`<strong>xpath_subs_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Subscript IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_subs_seq"},{anchor:"transformers.MarkupLMForSequenceClassification.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>: <code>1</code> for
tokens that are NOT MASKED, <code>0</code> for MASKED tokens.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MarkupLMForSequenceClassification.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>: <code>0</code> corresponds to a <em>sentence A</em> token, <code>1</code> corresponds to a <em>sentence B</em> token</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MarkupLMForSequenceClassification.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.MarkupLMForSequenceClassification.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>: <code>1</code>
indicates the head is <strong>not masked</strong>, <code>0</code> indicates the head is <strong>masked</strong>.`,name:"head_mask"},{anchor:"transformers.MarkupLMForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MarkupLMForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the attentions tensors of all attention layers are returned. See <code>attentions</code> under
returned tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MarkupLMForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the hidden states of all layers are returned. See <code>hidden_states</code> under returned tensors
for more detail.`,name:"output_hidden_states"},{anchor:"transformers.MarkupLMForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the model will return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MarkupLMForSequenceClassification.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L1217",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig"
>MarkupLMConfig</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.31.0/en/main_classes/output#transformers.modeling_outputs.SequenceClassifierOutput"
>transformers.modeling_outputs.SequenceClassifierOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Wt=new Rc({props:{$$slots:{default:[Z2]},$$scope:{ctx:j}}}),Ot=new ea({props:{anchor:"transformers.MarkupLMForSequenceClassification.forward.example",$$slots:{default:[B2]},$$scope:{ctx:j}}}),mn=new me({}),fn=new z({props:{name:"class transformers.MarkupLMForTokenClassification",anchor:"transformers.MarkupLMForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig">MarkupLMConfig</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.31.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L1094"}}),_n=new z({props:{name:"forward",anchor:"transformers.MarkupLMForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"xpath_tags_seq",val:": typing.Optional[torch.Tensor] = None"},{name:"xpath_subs_seq",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MarkupLMForTokenClassification.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.MarkupLMForTokenClassification.forward.xpath_tags_seq",description:`<strong>xpath_tags_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Tag IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_tags_seq"},{anchor:"transformers.MarkupLMForTokenClassification.forward.xpath_subs_seq",description:`<strong>xpath_subs_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Subscript IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_subs_seq"},{anchor:"transformers.MarkupLMForTokenClassification.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>: <code>1</code> for
tokens that are NOT MASKED, <code>0</code> for MASKED tokens.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MarkupLMForTokenClassification.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>: <code>0</code> corresponds to a <em>sentence A</em> token, <code>1</code> corresponds to a <em>sentence B</em> token</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MarkupLMForTokenClassification.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.MarkupLMForTokenClassification.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>: <code>1</code>
indicates the head is <strong>not masked</strong>, <code>0</code> indicates the head is <strong>masked</strong>.`,name:"head_mask"},{anchor:"transformers.MarkupLMForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MarkupLMForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the attentions tensors of all attention layers are returned. See <code>attentions</code> under
returned tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MarkupLMForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the hidden states of all layers are returned. See <code>hidden_states</code> under returned tensors
for more detail.`,name:"output_hidden_states"},{anchor:"transformers.MarkupLMForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the model will return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MarkupLMForTokenClassification.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L1110",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig"
>MarkupLMConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked language modeling (MLM) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.modeling_outputs.MaskedLMOutput"
>transformers.modeling_outputs.MaskedLMOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Qt=new Rc({props:{$$slots:{default:[D2]},$$scope:{ctx:j}}}),Xt=new ea({props:{anchor:"transformers.MarkupLMForTokenClassification.forward.example",$$slots:{default:[A2]},$$scope:{ctx:j}}}),kn=new me({}),Mn=new z({props:{name:"class transformers.MarkupLMForQuestionAnswering",anchor:"transformers.MarkupLMForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.MarkupLMForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig">MarkupLMConfig</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.31.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L974"}}),yn=new z({props:{name:"forward",anchor:"transformers.MarkupLMForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"xpath_tags_seq",val:": typing.Optional[torch.Tensor] = None"},{name:"xpath_subs_seq",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"position_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.MarkupLMForQuestionAnswering.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.31.0/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.31.0/en/model_doc/wav2vec2#transformers.Wav2Vec2CTCTokenizer.__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.MarkupLMForQuestionAnswering.forward.xpath_tags_seq",description:`<strong>xpath_tags_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Tag IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_tags_seq"},{anchor:"transformers.MarkupLMForQuestionAnswering.forward.xpath_subs_seq",description:`<strong>xpath_subs_seq</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length, config.max_depth)</code>, <em>optional</em>) &#x2014;
Subscript IDs for each token in the input sequence, padded up to config.max_depth.`,name:"xpath_subs_seq"},{anchor:"transformers.MarkupLMForQuestionAnswering.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>: <code>1</code> for
tokens that are NOT MASKED, <code>0</code> for MASKED tokens.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.MarkupLMForQuestionAnswering.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>: <code>0</code> corresponds to a <em>sentence A</em> token, <code>1</code> corresponds to a <em>sentence B</em> token</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.MarkupLMForQuestionAnswering.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.MarkupLMForQuestionAnswering.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>: <code>1</code>
indicates the head is <strong>not masked</strong>, <code>0</code> indicates the head is <strong>masked</strong>.`,name:"head_mask"},{anchor:"transformers.MarkupLMForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <em>input_ids</em> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.MarkupLMForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the attentions tensors of all attention layers are returned. See <code>attentions</code> under
returned tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.MarkupLMForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the hidden states of all layers are returned. See <code>hidden_states</code> under returned tensors
for more detail.`,name:"output_hidden_states"},{anchor:"transformers.MarkupLMForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
If set to <code>True</code>, the model will return a <a href="/docs/transformers/v4.31.0/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.MarkupLMForQuestionAnswering.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.MarkupLMForQuestionAnswering.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.31.0/src/transformers/models/markuplm/modeling_markuplm.py#L986",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.31.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.31.0/en/model_doc/markuplm#transformers.MarkupLMConfig"
>MarkupLMConfig</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.31.0/en/main_classes/output#transformers.modeling_outputs.QuestionAnsweringModelOutput"
>transformers.modeling_outputs.QuestionAnsweringModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Yt=new Rc({props:{$$slots:{default:[G2]},$$scope:{ctx:j}}}),Kt=new ea({props:{anchor:"transformers.MarkupLMForQuestionAnswering.forward.example",$$slots:{default:[P2]},$$scope:{ctx:j}}}),{c(){m=a("meta"),E=l(),_=a("h1"),g=a("a"),w=a("span"),k(h.$$.fragment),f=l(),Q=a("span"),Zc=o("MarkupLM"),md=l(),De=a("h2"),ht=a("a"),oa=a("span"),k(co.$$.fragment),Bc=l(),na=a("span"),Dc=o("Overview"),fd=l(),qe=a("p"),Ac=o("The MarkupLM model was proposed in "),po=a("a"),Gc=o(`MarkupLM: Pre-training of Text and Markup Language for Visually-rich Document
Understanding`),Pc=o(` by Junlong Li, Yiheng Xu, Lei Cui, Furu Wei. MarkupLM is BERT, but
applied to HTML pages instead of raw text documents. The model incorporates additional embedding layers to improve
performance, similar to `),Ln=a("a"),Sc=o("LayoutLM"),Wc=o("."),gd=l(),qn=a("p"),Oc=o(`The model can be used for tasks like question answering on web pages or information extraction from web pages. It obtains
state-of-the-art results on 2 important benchmarks:`),_d=l(),ut=a("ul"),$n=a("li"),ho=a("a"),Vc=o("WebSRC"),Qc=o(", a dataset for Web-Based Structural Reading Comprehension (a bit like SQuAD but for web pages)"),Xc=l(),Un=a("li"),uo=a("a"),Hc=o("SWDE"),Yc=o(`, a dataset
for information extraction from web pages (basically named-entity recogntion on web pages)`),kd=l(),zn=a("p"),Kc=o("The abstract from the paper is the following:"),Md=l(),Jn=a("p"),sa=a("em"),ep=o(`Multimodal pre-training with text, layout, and image has made significant progress for Visually-rich Document
Understanding (VrDU), especially the fixed-layout documents such as scanned document images. While, there are still a
large number of digital documents where the layout information is not fixed and needs to be interactively and
dynamically rendered for visualization, making existing layout-based pre-training approaches not easy to apply. In this
paper, we propose MarkupLM for document understanding tasks with markup languages as the backbone such as
HTML/XML-based documents, where text and markup information is jointly pre-trained. Experiment results show that the
pre-trained MarkupLM significantly outperforms the existing strong baseline models on several document understanding
tasks. The pre-trained model and code will be publicly available.`),vd=l(),Cn=a("p"),tp=o("Tips:"),bd=l(),$e=a("ul"),le=a("li"),op=o("In addition to "),aa=a("code"),np=o("input_ids"),sp=o(", "),jn=a("a"),ap=o("forward()"),rp=o(" expects 2 additional inputs, namely "),ra=a("code"),ip=o("xpath_tags_seq"),lp=o(" and "),ia=a("code"),dp=o("xpath_subs_seq"),cp=o(`.
These are the XPATH tags and subscripts respectively for each token in the input sequence.`),pp=l(),Ae=a("li"),hp=o("One can use "),Fn=a("a"),up=o("MarkupLMProcessor"),mp=o(" to prepare all data for the model. Refer to the "),In=a("a"),fp=o("usage guide"),gp=o(" for more info."),_p=l(),mo=a("li"),kp=o("Demo notebooks can be found "),fo=a("a"),Mp=o("here"),vp=o("."),yd=l(),mt=a("img"),Td=l(),go=a("small"),bp=o("MarkupLM architecture. Taken from the "),Nn=a("a"),yp=o("original paper."),wd=l(),Ue=a("p"),Tp=o("This model was contributed by "),_o=a("a"),wp=o("nielsr"),Ep=o(". The original code can be found "),ko=a("a"),xp=o("here"),Lp=o("."),Ed=l(),Ge=a("h2"),ft=a("a"),la=a("span"),k(Mo.$$.fragment),qp=l(),da=a("span"),$p=o("Usage: MarkupLMProcessor"),xd=l(),Y=a("p"),Up=o("The easiest way to prepare data for the model is to use "),Rn=a("a"),zp=o("MarkupLMProcessor"),Jp=o(`, which internally combines a feature extractor
(`),Zn=a("a"),Cp=o("MarkupLMFeatureExtractor"),jp=o(") and a tokenizer ("),Bn=a("a"),Fp=o("MarkupLMTokenizer"),Ip=o(" or "),Dn=a("a"),Np=o("MarkupLMTokenizerFast"),Rp=o(`). The feature extractor is
used to extract all nodes and xpaths from the HTML strings, which are then provided to the tokenizer, which turns them into the
token-level inputs of the model (`),ca=a("code"),Zp=o("input_ids"),Bp=o(` etc.). Note that you can still use the feature extractor and tokenizer separately,
if you only want to handle one of the two tasks.`),Ld=l(),k(vo.$$.fragment),qd=l(),U=a("p"),Dp=o("In short, one can provide HTML strings (and possibly additional data) to "),An=a("a"),Ap=o("MarkupLMProcessor"),Gp=o(`,
and it will create the inputs expected by the model. Internally, the processor first uses
`),Gn=a("a"),Pp=o("MarkupLMFeatureExtractor"),Sp=o(` to get a list of nodes and corresponding xpaths. The nodes and
xpaths are then provided to `),Pn=a("a"),Wp=o("MarkupLMTokenizer"),Op=o(" or "),Sn=a("a"),Vp=o("MarkupLMTokenizerFast"),Qp=o(`, which converts them
to token-level `),pa=a("code"),Xp=o("input_ids"),Hp=o(", "),ha=a("code"),Yp=o("attention_mask"),Kp=o(", "),ua=a("code"),eh=o("token_type_ids"),th=o(", "),ma=a("code"),oh=o("xpath_subs_seq"),nh=o(", "),fa=a("code"),sh=o("xpath_tags_seq"),ah=o(`.
Optionally, one can provide node labels to the processor, which are turned into token-level `),ga=a("code"),rh=o("labels"),ih=o("."),$d=l(),de=a("p"),Wn=a("a"),lh=o("MarkupLMFeatureExtractor"),dh=o(" uses "),bo=a("a"),ch=o("Beautiful Soup"),ph=o(`, a Python library for
pulling data out of HTML and XML files, under the hood. Note that you can still use your own parsing solution of
choice, and provide the nodes and xpaths yourself to `),On=a("a"),hh=o("MarkupLMTokenizer"),uh=o(" or "),Vn=a("a"),mh=o("MarkupLMTokenizerFast"),fh=o("."),Ud=l(),Qn=a("p"),gh=o(`In total, there are 5 use cases that are supported by the processor. Below, we list them all. Note that each of these
use cases work for both batched and non-batched inputs (we illustrate them for non-batched inputs).`),zd=l(),Xn=a("p"),_a=a("strong"),_h=o("Use case 1: web page classification (training, inference) + token classification (inference), parse_html = True"),Jd=l(),Hn=a("p"),kh=o("This is the simplest case, in which the processor will use the feature extractor to get all nodes and xpaths from the HTML."),Cd=l(),k(yo.$$.fragment),jd=l(),Yn=a("p"),ka=a("strong"),Mh=o("Use case 2: web page classification (training, inference) + token classification (inference), parse_html=False"),Fd=l(),ze=a("p"),vh=o(`In case one already has obtained all nodes and xpaths, one doesn\u2019t need the feature extractor. In that case, one should
provide the nodes and corresponding xpaths themselves to the processor, and make sure to set `),Ma=a("code"),bh=o("parse_html"),yh=o(" to "),va=a("code"),Th=o("False"),wh=o("."),Id=l(),k(To.$$.fragment),Nd=l(),Kn=a("p"),ba=a("strong"),Eh=o("Use case 3: token classification (training), parse_html=False"),Rd=l(),K=a("p"),xh=o("For token classification tasks (such as "),wo=a("a"),Lh=o("SWDE"),qh=o(`), one can also provide the
corresponding node labels in order to train a model. The processor will then convert these into token-level `),ya=a("code"),$h=o("labels"),Uh=o(`.
By default, it will only label the first wordpiece of a word, and label the remaining wordpieces with -100, which is the
`),Ta=a("code"),zh=o("ignore_index"),Jh=o(` of PyTorch\u2019s CrossEntropyLoss. In case you want all wordpieces of a word to be labeled, you can
initialize the tokenizer with `),wa=a("code"),Ch=o("only_label_first_subword"),jh=o(" set to "),Ea=a("code"),Fh=o("False"),Ih=o("."),Zd=l(),k(Eo.$$.fragment),Bd=l(),es=a("p"),xa=a("strong"),Nh=o("Use case 4: web page question answering (inference), parse_html=True"),Dd=l(),ts=a("p"),Rh=o(`For question answering tasks on web pages, you can provide a question to the processor. By default, the
processor will use the feature extractor to get all nodes and xpaths, and create [CLS] question tokens [SEP] word tokens [SEP].`),Ad=l(),k(xo.$$.fragment),Gd=l(),os=a("p"),La=a("strong"),Zh=o("Use case 5: web page question answering (inference), parse_html=False"),Pd=l(),Je=a("p"),Bh=o(`For question answering tasks (such as WebSRC), you can provide a question to the processor. If you have extracted
all nodes and xpaths yourself, you can provide them directly to the processor. Make sure to set `),qa=a("code"),Dh=o("parse_html"),Ah=o(" to "),$a=a("code"),Gh=o("False"),Ph=o("."),Sd=l(),k(Lo.$$.fragment),Wd=l(),Pe=a("h2"),gt=a("a"),Ua=a("span"),k(qo.$$.fragment),Sh=l(),za=a("span"),Wh=o("Documentation resources"),Od=l(),Ce=a("ul"),Ja=a("li"),ns=a("a"),Oh=o("Text classification task guide"),Vh=l(),Ca=a("li"),ss=a("a"),Qh=o("Token classification task guide"),Xh=l(),ja=a("li"),as=a("a"),Hh=o("Question answering task guide"),Vd=l(),Se=a("h2"),_t=a("a"),Fa=a("span"),k($o.$$.fragment),Yh=l(),Ia=a("span"),Kh=o("MarkupLMConfig"),Qd=l(),ce=a("div"),k(Uo.$$.fragment),eu=l(),We=a("p"),tu=o("This is the configuration class to store the configuration of a "),rs=a("a"),ou=o("MarkupLMModel"),nu=o(`. It is used to instantiate a
MarkupLM 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 MarkupLM
`),zo=a("a"),su=o("microsoft/markuplm-base"),au=o(" architecture."),ru=l(),Oe=a("p"),iu=o("Configuration objects inherit from "),is=a("a"),lu=o("BertConfig"),du=o(` and can be used to control the model outputs. Read the
documentation from `),ls=a("a"),cu=o("BertConfig"),pu=o(" for more information."),hu=l(),k(kt.$$.fragment),Xd=l(),Ve=a("h2"),Mt=a("a"),Na=a("span"),k(Jo.$$.fragment),uu=l(),Ra=a("span"),mu=o("MarkupLMFeatureExtractor"),Hd=l(),pe=a("div"),k(Co.$$.fragment),fu=l(),Za=a("p"),gu=o(`Constructs a MarkupLM feature extractor. This can be used to get a list of nodes and corresponding xpaths from HTML
strings.`),_u=l(),jo=a("p"),ku=o("This feature extractor inherits from "),Ba=a("code"),Mu=o("PreTrainedFeatureExtractor()"),vu=o(` which contains most
of the main methods. Users should refer to this superclass for more information regarding those methods.`),bu=l(),je=a("div"),k(Fo.$$.fragment),yu=l(),Da=a("p"),Tu=o("Main method to prepare for the model one or several HTML strings."),wu=l(),k(vt.$$.fragment),Yd=l(),Qe=a("h2"),bt=a("a"),Aa=a("span"),k(Io.$$.fragment),Eu=l(),Ga=a("span"),xu=o("MarkupLMTokenizer"),Kd=l(),X=a("div"),k(No.$$.fragment),Lu=l(),B=a("p"),qu=o("Construct a MarkupLM tokenizer. Based on byte-level Byte-Pair-Encoding (BPE). "),ds=a("a"),$u=o("MarkupLMTokenizer"),Uu=o(` can be used to
turn HTML strings into to token-level `),Pa=a("code"),zu=o("input_ids"),Ju=o(", "),Sa=a("code"),Cu=o("attention_mask"),ju=o(", "),Wa=a("code"),Fu=o("token_type_ids"),Iu=o(", "),Oa=a("code"),Nu=o("xpath_tags_seq"),Ru=o(` and
`),Va=a("code"),Zu=o("xpath_tags_seq"),Bu=o(". This tokenizer inherits from "),cs=a("a"),Du=o("PreTrainedTokenizer"),Au=o(` which contains most of the main methods.
Users should refer to this superclass for more information regarding those methods.`),Gu=l(),Fe=a("div"),k(Ro.$$.fragment),Pu=l(),Qa=a("p"),Su=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A RoBERTa sequence has the following format:`),Wu=l(),Zo=a("ul"),ps=a("li"),Ou=o("single sequence: "),Xa=a("code"),Vu=o("<s> X </s>"),Qu=l(),hs=a("li"),Xu=o("pair of sequences: "),Ha=a("code"),Hu=o("<s> A </s></s> B </s>"),Yu=l(),us=a("div"),k(Bo.$$.fragment),Ku=l(),yt=a("div"),k(Do.$$.fragment),em=l(),Ya=a("p"),tm=o(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. RoBERTa does not
make use of token type ids, therefore a list of zeros is returned.`),om=l(),ms=a("div"),k(Ao.$$.fragment),ec=l(),Xe=a("h2"),Tt=a("a"),Ka=a("span"),k(Go.$$.fragment),nm=l(),er=a("span"),sm=o("MarkupLMTokenizerFast"),tc=l(),J=a("div"),k(Po.$$.fragment),am=l(),tr=a("p"),rm=o("Construct a MarkupLM tokenizer. Based on byte-level Byte-Pair-Encoding (BPE)."),im=l(),D=a("p"),fs=a("a"),lm=o("MarkupLMTokenizerFast"),dm=o(" can be used to turn HTML strings into to token-level "),or=a("code"),cm=o("input_ids"),pm=o(", "),nr=a("code"),hm=o("attention_mask"),um=o(`,
`),sr=a("code"),mm=o("token_type_ids"),fm=o(", "),ar=a("code"),gm=o("xpath_tags_seq"),_m=o(" and "),rr=a("code"),km=o("xpath_tags_seq"),Mm=o(". This tokenizer inherits from "),gs=a("a"),vm=o("PreTrainedTokenizer"),bm=o(` which
contains most of the main methods.`),ym=l(),ir=a("p"),Tm=o("Users should refer to this superclass for more information regarding those methods."),wm=l(),A=a("div"),k(So.$$.fragment),Em=l(),I=a("p"),xm=o("add_special_tokens ("),lr=a("code"),Lm=o("bool"),qm=o(", "),dr=a("em"),$m=o("optional"),Um=o(", defaults to "),cr=a("code"),zm=o("True"),Jm=o(`):
Whether or not to encode the sequences with the special tokens relative to their model.
padding (`),pr=a("code"),Cm=o("bool"),jm=o(", "),hr=a("code"),Fm=o("str"),Im=o(" or "),_s=a("a"),Nm=o("PaddingStrategy"),Rm=o(", "),ur=a("em"),Zm=o("optional"),Bm=o(", defaults to "),mr=a("code"),Dm=o("False"),Am=o(`):
Activates and controls padding. Accepts the following values:`),Gm=l(),H=a("ul"),fr=a("li"),wt=a("p"),gr=a("code"),Pm=o("True"),Sm=o(" or "),_r=a("code"),Wm=o("'longest'"),Om=o(`: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).`),Vm=l(),kr=a("li"),Et=a("p"),Mr=a("code"),Qm=o("'max_length'"),Xm=o(": Pad to a maximum length specified with the argument "),vr=a("code"),Hm=o("max_length"),Ym=o(` or to the maximum
acceptable input length for the model if that argument is not provided.`),Km=l(),br=a("li"),G=a("p"),yr=a("code"),ef=o("False"),tf=o(" or "),Tr=a("code"),of=o("'do_not_pad'"),nf=o(` (default): No padding (i.e., can output a batch with sequences of different
lengths).
truncation (`),wr=a("code"),sf=o("bool"),af=o(", "),Er=a("code"),rf=o("str"),lf=o(" or "),ks=a("a"),df=o("TruncationStrategy"),cf=o(", "),xr=a("em"),pf=o("optional"),hf=o(", defaults to "),Lr=a("code"),uf=o("False"),mf=o(`):
Activates and controls truncation. Accepts the following values:`),ff=l(),qr=a("li"),Ie=a("p"),$r=a("code"),gf=o("True"),_f=o(" or "),Ur=a("code"),kf=o("'longest_first'"),Mf=o(": Truncate to a maximum length specified with the argument "),zr=a("code"),vf=o("max_length"),bf=o(` or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.`),yf=l(),Jr=a("li"),xt=a("p"),Cr=a("code"),Tf=o("'only_first'"),wf=o(": Truncate to a maximum length specified with the argument "),jr=a("code"),Ef=o("max_length"),xf=o(` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),Lf=l(),Fr=a("li"),Lt=a("p"),Ir=a("code"),qf=o("'only_second'"),$f=o(": Truncate to a maximum length specified with the argument "),Nr=a("code"),Uf=o("max_length"),zf=o(` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),Jf=l(),Rr=a("li"),fe=a("p"),Zr=a("code"),Cf=o("False"),jf=o(" or "),Br=a("code"),Ff=o("'do_not_truncate'"),If=o(` (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).
max_length (`),Dr=a("code"),Nf=o("int"),Rf=o(", "),Ar=a("em"),Zf=o("optional"),Bf=o(`):
Controls the maximum length to use by one of the truncation/padding parameters.`),Df=l(),x=a("p"),Af=o("If left unset or set to "),Gr=a("code"),Gf=o("None"),Pf=o(`, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.
stride (`),Pr=a("code"),Sf=o("int"),Wf=o(", "),Sr=a("em"),Of=o("optional"),Vf=o(`, defaults to 0):
If set to a number along with `),Wr=a("code"),Qf=o("max_length"),Xf=o(`, the overflowing tokens returned when
`),Or=a("code"),Hf=o("return_overflowing_tokens=True"),Yf=o(` will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.
is_split_into_words (`),Vr=a("code"),Kf=o("bool"),eg=o(", "),Qr=a("em"),tg=o("optional"),og=o(", defaults to "),Xr=a("code"),ng=o("False"),sg=o(`):
Whether or not the input is already pre-tokenized (e.g., split into words). If set to `),Hr=a("code"),ag=o("True"),rg=o(`, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.
pad_to_multiple_of (`),Yr=a("code"),ig=o("int"),lg=o(", "),Kr=a("em"),dg=o("optional"),cg=o(`):
If set will pad the sequence to a multiple of the provided value. Requires `),ei=a("code"),pg=o("padding"),hg=o(` to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
`),ti=a("code"),ug=o(">= 7.5"),mg=o(` (Volta).
return_tensors (`),oi=a("code"),fg=o("str"),gg=o(" or "),Ms=a("a"),_g=o("TensorType"),kg=o(", "),ni=a("em"),Mg=o("optional"),vg=o(`):
If set, will return tensors instead of list of python integers. Acceptable values are:`),bg=l(),He=a("ul"),qt=a("li"),si=a("code"),yg=o("'tf'"),Tg=o(": Return TensorFlow "),ai=a("code"),wg=o("tf.constant"),Eg=o(" objects."),xg=l(),$t=a("li"),ri=a("code"),Lg=o("'pt'"),qg=o(": Return PyTorch "),ii=a("code"),$g=o("torch.Tensor"),Ug=o(" objects."),zg=l(),Ut=a("li"),li=a("code"),Jg=o("'np'"),Cg=o(": Return Numpy "),di=a("code"),jg=o("np.ndarray"),Fg=o(" objects."),Ig=l(),N=a("p"),Ng=o("add_special_tokens ("),ci=a("code"),Rg=o("bool"),Zg=o(", "),pi=a("em"),Bg=o("optional"),Dg=o(", defaults to "),hi=a("code"),Ag=o("True"),Gg=o(`):
Whether or not to encode the sequences with the special tokens relative to their model.
padding (`),ui=a("code"),Pg=o("bool"),Sg=o(", "),mi=a("code"),Wg=o("str"),Og=o(" or "),vs=a("a"),Vg=o("PaddingStrategy"),Qg=o(", "),fi=a("em"),Xg=o("optional"),Hg=o(", defaults to "),gi=a("code"),Yg=o("False"),Kg=o(`):
Activates and controls padding. Accepts the following values:`),e_=l(),C=a("ul"),_i=a("li"),zt=a("p"),ki=a("code"),t_=o("True"),o_=o(" or "),Mi=a("code"),n_=o("'longest'"),s_=o(`: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).`),a_=l(),vi=a("li"),Jt=a("p"),bi=a("code"),r_=o("'max_length'"),i_=o(": Pad to a maximum length specified with the argument "),yi=a("code"),l_=o("max_length"),d_=o(` or to the maximum
acceptable input length for the model if that argument is not provided.`),c_=l(),Ti=a("li"),P=a("p"),wi=a("code"),p_=o("False"),h_=o(" or "),Ei=a("code"),u_=o("'do_not_pad'"),m_=o(` (default): No padding (i.e., can output a batch with sequences of different
lengths).
truncation (`),xi=a("code"),f_=o("bool"),g_=o(", "),Li=a("code"),__=o("str"),k_=o(" or "),bs=a("a"),M_=o("TruncationStrategy"),v_=o(", "),qi=a("em"),b_=o("optional"),y_=o(", defaults to "),$i=a("code"),T_=o("False"),w_=o(`):
Activates and controls truncation. Accepts the following values:`),E_=l(),Ui=a("li"),Ne=a("p"),zi=a("code"),x_=o("True"),L_=o(" or "),Ji=a("code"),q_=o("'longest_first'"),$_=o(": Truncate to a maximum length specified with the argument "),Ci=a("code"),U_=o("max_length"),z_=o(` or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.`),J_=l(),ji=a("li"),Ct=a("p"),Fi=a("code"),C_=o("'only_first'"),j_=o(": Truncate to a maximum length specified with the argument "),Ii=a("code"),F_=o("max_length"),I_=o(` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),N_=l(),Ni=a("li"),jt=a("p"),Ri=a("code"),R_=o("'only_second'"),Z_=o(": Truncate to a maximum length specified with the argument "),Zi=a("code"),B_=o("max_length"),D_=o(` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),A_=l(),Bi=a("li"),L=a("p"),Di=a("code"),G_=o("False"),P_=o(" or "),Ai=a("code"),S_=o("'do_not_truncate'"),W_=o(` (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).
max_length (`),Gi=a("code"),O_=o("int"),V_=o(", "),Pi=a("em"),Q_=o("optional"),X_=o(`):
Controls the maximum length to use by one of the truncation/padding parameters. If left unset or set to
`),Si=a("code"),H_=o("None"),Y_=o(`, this will use the predefined model maximum length if a maximum length is required by one of the
truncation/padding parameters. If the model has no specific maximum input length (like XLNet)
truncation/padding to a maximum length will be deactivated.
stride (`),Wi=a("code"),K_=o("int"),ek=o(", "),Oi=a("em"),tk=o("optional"),ok=o(`, defaults to 0):
If set to a number along with `),Vi=a("code"),nk=o("max_length"),sk=o(`, the overflowing tokens returned when
`),Qi=a("code"),ak=o("return_overflowing_tokens=True"),rk=o(` will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.
pad_to_multiple_of (`),Xi=a("code"),ik=o("int"),lk=o(", "),Hi=a("em"),dk=o("optional"),ck=o(`):
If set will pad the sequence to a multiple of the provided value. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability `),Yi=a("code"),pk=o(">= 7.5"),hk=o(` (Volta).
return_tensors (`),Ki=a("code"),uk=o("str"),mk=o(" or "),ys=a("a"),fk=o("TensorType"),gk=o(", "),el=a("em"),_k=o("optional"),kk=o(`):
If set, will return tensors instead of list of python integers. Acceptable values are:`),Mk=l(),tl=a("li"),Ft=a("p"),ol=a("code"),vk=o("'tf'"),bk=o(": Return TensorFlow "),nl=a("code"),yk=o("tf.constant"),Tk=o(" objects."),wk=l(),sl=a("li"),It=a("p"),al=a("code"),Ek=o("'pt'"),xk=o(": Return PyTorch "),rl=a("code"),Lk=o("torch.Tensor"),qk=o(" objects."),$k=l(),il=a("li"),Nt=a("p"),ll=a("code"),Uk=o("'np'"),zk=o(": Return Numpy "),dl=a("code"),Jk=o("np.ndarray"),Ck=o(" objects."),jk=l(),Re=a("div"),k(Wo.$$.fragment),Fk=l(),cl=a("p"),Ik=o(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A RoBERTa sequence has the following format:`),Nk=l(),Oo=a("ul"),Ts=a("li"),Rk=o("single sequence: "),pl=a("code"),Zk=o("<s> X </s>"),Bk=l(),ws=a("li"),Dk=o("pair of sequences: "),hl=a("code"),Ak=o("<s> A </s></s> B </s>"),Gk=l(),Rt=a("div"),k(Vo.$$.fragment),Pk=l(),ul=a("p"),Sk=o(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. RoBERTa does not
make use of token type ids, therefore a list of zeros is returned.`),Wk=l(),Zt=a("div"),k(Qo.$$.fragment),Ok=l(),Xo=a("p"),Vk=o(`Tokenize and prepare for the model a sequence or a pair of sequences. .. warning:: This method is deprecated,
`),ml=a("code"),Qk=o("__call__"),Xk=o(" should be used instead."),Hk=l(),Bt=a("div"),k(Ho.$$.fragment),Yk=l(),fl=a("p"),Kk=o(`Given the xpath expression of one particular node (like \u201C/html/body/div/li[1]/div/span[2]\u201D), return a list of
tag IDs and corresponding subscripts, taking into account max depth.`),oc=l(),Ye=a("h2"),Dt=a("a"),gl=a("span"),k(Yo.$$.fragment),eM=l(),_l=a("span"),tM=o("MarkupLMProcessor"),nc=l(),te=a("div"),k(Ko.$$.fragment),oM=l(),kl=a("p"),nM=o(`Constructs a MarkupLM processor which combines a MarkupLM feature extractor and a MarkupLM tokenizer into a single
processor.`),sM=l(),Es=a("p"),xs=a("a"),aM=o("MarkupLMProcessor"),rM=o(" offers all the functionalities you need to prepare data for the model."),iM=l(),R=a("p"),lM=o("It first uses "),Ls=a("a"),dM=o("MarkupLMFeatureExtractor"),cM=o(` to extract nodes and corresponding xpaths from one or more HTML strings.
Next, these are provided to `),qs=a("a"),pM=o("MarkupLMTokenizer"),hM=o(" or "),$s=a("a"),uM=o("MarkupLMTokenizerFast"),mM=o(`, which turns them into token-level
`),Ml=a("code"),fM=o("input_ids"),gM=o(", "),vl=a("code"),_M=o("attention_mask"),kM=o(", "),bl=a("code"),MM=o("token_type_ids"),vM=o(", "),yl=a("code"),bM=o("xpath_tags_seq"),yM=o(" and "),Tl=a("code"),TM=o("xpath_subs_seq"),wM=o("."),EM=l(),ge=a("div"),k(en.$$.fragment),xM=l(),oe=a("p"),LM=o("This method first forwards the "),wl=a("code"),qM=o("html_strings"),$M=o(" argument to "),tn=a("a"),El=a("strong"),UM=o("call"),zM=o("()"),JM=o(`. Next, it
passes the `),xl=a("code"),CM=o("nodes"),jM=o(" and "),Ll=a("code"),FM=o("xpaths"),IM=o(" along with the additional arguments to "),ql=a("code"),NM=o("__call__()"),RM=o(` and
returns the output.`),ZM=l(),on=a("p"),BM=o("Optionally, one can also provide a "),$l=a("code"),DM=o("text"),AM=o(" argument which is passed along as first sequence."),GM=l(),Ul=a("p"),PM=o("Please refer to the docstring of the above two methods for more information."),sc=l(),Ke=a("h2"),At=a("a"),zl=a("span"),k(nn.$$.fragment),SM=l(),Jl=a("span"),WM=o("MarkupLMModel"),ac=l(),xe=a("div"),k(sn.$$.fragment),OM=l(),an=a("p"),VM=o(`The bare MarkupLM Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),rn=a("a"),QM=o("torch.nn.Module"),XM=o(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),HM=l(),_e=a("div"),k(ln.$$.fragment),YM=l(),et=a("p"),KM=o("The "),Us=a("a"),ev=o("MarkupLMModel"),tv=o(" forward method, overrides the "),Cl=a("code"),ov=o("__call__"),nv=o(" special method."),sv=l(),k(Gt.$$.fragment),av=l(),k(Pt.$$.fragment),rc=l(),tt=a("h2"),St=a("a"),jl=a("span"),k(dn.$$.fragment),rv=l(),Fl=a("span"),iv=o("MarkupLMForSequenceClassification"),ic=l(),he=a("div"),k(cn.$$.fragment),lv=l(),Il=a("p"),dv=o(`MarkupLM Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),cv=l(),pn=a("p"),pv=o("This model is a PyTorch "),hn=a("a"),hv=o("torch.nn.Module"),uv=o(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),mv=l(),ke=a("div"),k(un.$$.fragment),fv=l(),ot=a("p"),gv=o("The "),zs=a("a"),_v=o("MarkupLMForSequenceClassification"),kv=o(" forward method, overrides the "),Nl=a("code"),Mv=o("__call__"),vv=o(" special method."),bv=l(),k(Wt.$$.fragment),yv=l(),k(Ot.$$.fragment),lc=l(),nt=a("h2"),Vt=a("a"),Rl=a("span"),k(mn.$$.fragment),Tv=l(),Zl=a("span"),wv=o("MarkupLMForTokenClassification"),dc=l(),Le=a("div"),k(fn.$$.fragment),Ev=l(),st=a("p"),xv=o("MarkupLM Model with a "),Bl=a("code"),Lv=o("token_classification"),qv=o(` head on top.
This model is a PyTorch `),gn=a("a"),$v=o("torch.nn.Module"),Uv=o(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),zv=l(),Me=a("div"),k(_n.$$.fragment),Jv=l(),at=a("p"),Cv=o("The "),Js=a("a"),jv=o("MarkupLMForTokenClassification"),Fv=o(" forward method, overrides the "),Dl=a("code"),Iv=o("__call__"),Nv=o(" special method."),Rv=l(),k(Qt.$$.fragment),Zv=l(),k(Xt.$$.fragment),cc=l(),rt=a("h2"),Ht=a("a"),Al=a("span"),k(kn.$$.fragment),Bv=l(),Gl=a("span"),Dv=o("MarkupLMForQuestionAnswering"),pc=l(),ue=a("div"),k(Mn.$$.fragment),Av=l(),it=a("p"),Gv=o(`MarkupLM 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 `),Pl=a("code"),Pv=o("span start logits"),Sv=o(" and "),Sl=a("code"),Wv=o("span end logits"),Ov=o(")."),Vv=l(),vn=a("p"),Qv=o("This model is a PyTorch "),bn=a("a"),Xv=o("torch.nn.Module"),Hv=o(` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Yv=l(),ve=a("div"),k(yn.$$.fragment),Kv=l(),lt=a("p"),eb=o("The "),Cs=a("a"),tb=o("MarkupLMForQuestionAnswering"),ob=o(" forward method, overrides the "),Wl=a("code"),nb=o("__call__"),sb=o(" special method."),ab=l(),k(Yt.$$.fragment),rb=l(),k(Kt.$$.fragment),this.h()},l(s){const p=J2('[data-svelte="svelte-1phssyn"]',document.head);m=r(p,"META",{name:!0,content:!0}),p.forEach(t),E=d(s),_=r(s,"H1",{class:!0});var Tn=i(_);g=r(Tn,"A",{id:!0,class:!0,href:!0});var Ol=i(g);w=r(Ol,"SPAN",{});var Vl=i(w);M(h.$$.fragment,Vl),Vl.forEach(t),Ol.forEach(t),f=d(Tn),Q=r(Tn,"SPAN",{});var Ql=i(Q);Zc=n(Ql,"MarkupLM"),Ql.forEach(t),Tn.forEach(t),md=d(s),De=r(s,"H2",{class:!0});var wn=i(De);ht=r(wn,"A",{id:!0,class:!0,href:!0});var Xl=i(ht);oa=r(Xl,"SPAN",{});var Hl=i(oa);M(co.$$.fragment,Hl),Hl.forEach(t),Xl.forEach(t),Bc=d(wn),na=r(wn,"SPAN",{});var Yl=i(na);Dc=n(Yl,"Overview"),Yl.forEach(t),wn.forEach(t),fd=d(s),qe=r(s,"P",{});var dt=i(qe);Ac=n(dt,"The MarkupLM model was proposed in "),po=r(dt,"A",{href:!0,rel:!0});var Kl=i(po);Gc=n(Kl,`MarkupLM: Pre-training of Text and Markup Language for Visually-rich Document
Understanding`),Kl.forEach(t),Pc=n(dt,` by Junlong Li, Yiheng Xu, Lei Cui, Furu Wei. MarkupLM is BERT, but
applied to HTML pages instead of raw text documents. The model incorporates additional embedding layers to improve
performance, similar to `),Ln=r(dt,"A",{href:!0});var _b=i(Ln);Sc=n(_b,"LayoutLM"),_b.forEach(t),Wc=n(dt,"."),dt.forEach(t),gd=d(s),qn=r(s,"P",{});var kb=i(qn);Oc=n(kb,`The model can be used for tasks like question answering on web pages or information extraction from web pages. It obtains
state-of-the-art results on 2 important benchmarks:`),kb.forEach(t),_d=d(s),ut=r(s,"UL",{});var uc=i(ut);$n=r(uc,"LI",{});var ib=i($n);ho=r(ib,"A",{href:!0,rel:!0});var Mb=i(ho);Vc=n(Mb,"WebSRC"),Mb.forEach(t),Qc=n(ib,", a dataset for Web-Based Structural Reading Comprehension (a bit like SQuAD but for web pages)"),ib.forEach(t),Xc=d(uc),Un=r(uc,"LI",{});var lb=i(Un);uo=r(lb,"A",{href:!0,rel:!0});var vb=i(uo);Hc=n(vb,"SWDE"),vb.forEach(t),Yc=n(lb,`, a dataset
for information extraction from web pages (basically named-entity recogntion on web pages)`),lb.forEach(t),uc.forEach(t),kd=d(s),zn=r(s,"P",{});var bb=i(zn);Kc=n(bb,"The abstract from the paper is the following:"),bb.forEach(t),Md=d(s),Jn=r(s,"P",{});var yb=i(Jn);sa=r(yb,"EM",{});var Tb=i(sa);ep=n(Tb,`Multimodal pre-training with text, layout, and image has made significant progress for Visually-rich Document
Understanding (VrDU), especially the fixed-layout documents such as scanned document images. While, there are still a
large number of digital documents where the layout information is not fixed and needs to be interactively and
dynamically rendered for visualization, making existing layout-based pre-training approaches not easy to apply. In this
paper, we propose MarkupLM for document understanding tasks with markup languages as the backbone such as
HTML/XML-based documents, where text and markup information is jointly pre-trained. Experiment results show that the
pre-trained MarkupLM significantly outperforms the existing strong baseline models on several document understanding
tasks. The pre-trained model and code will be publicly available.`),Tb.forEach(t),yb.forEach(t),vd=d(s),Cn=r(s,"P",{});var wb=i(Cn);tp=n(wb,"Tips:"),wb.forEach(t),bd=d(s),$e=r(s,"UL",{});var js=i($e);le=r(js,"LI",{});var Ze=i(le);op=n(Ze,"In addition to "),aa=r(Ze,"CODE",{});var Eb=i(aa);np=n(Eb,"input_ids"),Eb.forEach(t),sp=n(Ze,", "),jn=r(Ze,"A",{href:!0});var xb=i(jn);ap=n(xb,"forward()"),xb.forEach(t),rp=n(Ze," expects 2 additional inputs, namely "),ra=r(Ze,"CODE",{});var Lb=i(ra);ip=n(Lb,"xpath_tags_seq"),Lb.forEach(t),lp=n(Ze," and "),ia=r(Ze,"CODE",{});var qb=i(ia);dp=n(qb,"xpath_subs_seq"),qb.forEach(t),cp=n(Ze,`.
These are the XPATH tags and subscripts respectively for each token in the input sequence.`),Ze.forEach(t),pp=d(js),Ae=r(js,"LI",{});var Fs=i(Ae);hp=n(Fs,"One can use "),Fn=r(Fs,"A",{href:!0});var $b=i(Fn);up=n($b,"MarkupLMProcessor"),$b.forEach(t),mp=n(Fs," to prepare all data for the model. Refer to the "),In=r(Fs,"A",{href:!0});var Ub=i(In);fp=n(Ub,"usage guide"),Ub.forEach(t),gp=n(Fs," for more info."),Fs.forEach(t),_p=d(js),mo=r(js,"LI",{});var mc=i(mo);kp=n(mc,"Demo notebooks can be found "),fo=r(mc,"A",{href:!0,rel:!0});var zb=i(fo);Mp=n(zb,"here"),zb.forEach(t),vp=n(mc,"."),mc.forEach(t),js.forEach(t),yd=d(s),mt=r(s,"IMG",{src:!0,alt:!0,width:!0}),Td=d(s),go=r(s,"SMALL",{});var db=i(go);bp=n(db,"MarkupLM architecture. Taken from the "),Nn=r(db,"A",{href:!0});var Jb=i(Nn);yp=n(Jb,"original paper."),Jb.forEach(t),db.forEach(t),wd=d(s),Ue=r(s,"P",{});var Is=i(Ue);Tp=n(Is,"This model was contributed by "),_o=r(Is,"A",{href:!0,rel:!0});var Cb=i(_o);wp=n(Cb,"nielsr"),Cb.forEach(t),Ep=n(Is,". The original code can be found "),ko=r(Is,"A",{href:!0,rel:!0});var jb=i(ko);xp=n(jb,"here"),jb.forEach(t),Lp=n(Is,"."),Is.forEach(t),Ed=d(s),Ge=r(s,"H2",{class:!0});var fc=i(Ge);ft=r(fc,"A",{id:!0,class:!0,href:!0});var Fb=i(ft);la=r(Fb,"SPAN",{});var Ib=i(la);M(Mo.$$.fragment,Ib),Ib.forEach(t),Fb.forEach(t),qp=d(fc),da=r(fc,"SPAN",{});var Nb=i(da);$p=n(Nb,"Usage: MarkupLMProcessor"),Nb.forEach(t),fc.forEach(t),xd=d(s),Y=r(s,"P",{});var be=i(Y);Up=n(be,"The easiest way to prepare data for the model is to use "),Rn=r(be,"A",{href:!0});var Rb=i(Rn);zp=n(Rb,"MarkupLMProcessor"),Rb.forEach(t),Jp=n(be,`, which internally combines a feature extractor
(`),Zn=r(be,"A",{href:!0});var Zb=i(Zn);Cp=n(Zb,"MarkupLMFeatureExtractor"),Zb.forEach(t),jp=n(be,") and a tokenizer ("),Bn=r(be,"A",{href:!0});var Bb=i(Bn);Fp=n(Bb,"MarkupLMTokenizer"),Bb.forEach(t),Ip=n(be," or "),Dn=r(be,"A",{href:!0});var Db=i(Dn);Np=n(Db,"MarkupLMTokenizerFast"),Db.forEach(t),Rp=n(be,`). The feature extractor is
used to extract all nodes and xpaths from the HTML strings, which are then provided to the tokenizer, which turns them into the
token-level inputs of the model (`),ca=r(be,"CODE",{});var Ab=i(ca);Zp=n(Ab,"input_ids"),Ab.forEach(t),Bp=n(be,` etc.). Note that you can still use the feature extractor and tokenizer separately,
if you only want to handle one of the two tasks.`),be.forEach(t),Ld=d(s),M(vo.$$.fragment,s),qd=d(s),U=r(s,"P",{});var F=i(U);Dp=n(F,"In short, one can provide HTML strings (and possibly additional data) to "),An=r(F,"A",{href:!0});var Gb=i(An);Ap=n(Gb,"MarkupLMProcessor"),Gb.forEach(t),Gp=n(F,`,
and it will create the inputs expected by the model. Internally, the processor first uses
`),Gn=r(F,"A",{href:!0});var Pb=i(Gn);Pp=n(Pb,"MarkupLMFeatureExtractor"),Pb.forEach(t),Sp=n(F,` to get a list of nodes and corresponding xpaths. The nodes and
xpaths are then provided to `),Pn=r(F,"A",{href:!0});var Sb=i(Pn);Wp=n(Sb,"MarkupLMTokenizer"),Sb.forEach(t),Op=n(F," or "),Sn=r(F,"A",{href:!0});var Wb=i(Sn);Vp=n(Wb,"MarkupLMTokenizerFast"),Wb.forEach(t),Qp=n(F,`, which converts them
to token-level `),pa=r(F,"CODE",{});var Ob=i(pa);Xp=n(Ob,"input_ids"),Ob.forEach(t),Hp=n(F,", "),ha=r(F,"CODE",{});var Vb=i(ha);Yp=n(Vb,"attention_mask"),Vb.forEach(t),Kp=n(F,", "),ua=r(F,"CODE",{});var Qb=i(ua);eh=n(Qb,"token_type_ids"),Qb.forEach(t),th=n(F,", "),ma=r(F,"CODE",{});var Xb=i(ma);oh=n(Xb,"xpath_subs_seq"),Xb.forEach(t),nh=n(F,", "),fa=r(F,"CODE",{});var Hb=i(fa);sh=n(Hb,"xpath_tags_seq"),Hb.forEach(t),ah=n(F,`.
Optionally, one can provide node labels to the processor, which are turned into token-level `),ga=r(F,"CODE",{});var Yb=i(ga);rh=n(Yb,"labels"),Yb.forEach(t),ih=n(F,"."),F.forEach(t),$d=d(s),de=r(s,"P",{});var ct=i(de);Wn=r(ct,"A",{href:!0});var Kb=i(Wn);lh=n(Kb,"MarkupLMFeatureExtractor"),Kb.forEach(t),dh=n(ct," uses "),bo=r(ct,"A",{href:!0,rel:!0});var ey=i(bo);ch=n(ey,"Beautiful Soup"),ey.forEach(t),ph=n(ct,`, a Python library for
pulling data out of HTML and XML files, under the hood. Note that you can still use your own parsing solution of
choice, and provide the nodes and xpaths yourself to `),On=r(ct,"A",{href:!0});var ty=i(On);hh=n(ty,"MarkupLMTokenizer"),ty.forEach(t),uh=n(ct," or "),Vn=r(ct,"A",{href:!0});var oy=i(Vn);mh=n(oy,"MarkupLMTokenizerFast"),oy.forEach(t),fh=n(ct,"."),ct.forEach(t),Ud=d(s),Qn=r(s,"P",{});var ny=i(Qn);gh=n(ny,`In total, there are 5 use cases that are supported by the processor. Below, we list them all. Note that each of these
use cases work for both batched and non-batched inputs (we illustrate them for non-batched inputs).`),ny.forEach(t),zd=d(s),Xn=r(s,"P",{});var sy=i(Xn);_a=r(sy,"STRONG",{});var ay=i(_a);_h=n(ay,"Use case 1: web page classification (training, inference) + token classification (inference), parse_html = True"),ay.forEach(t),sy.forEach(t),Jd=d(s),Hn=r(s,"P",{});var ry=i(Hn);kh=n(ry,"This is the simplest case, in which the processor will use the feature extractor to get all nodes and xpaths from the HTML."),ry.forEach(t),Cd=d(s),M(yo.$$.fragment,s),jd=d(s),Yn=r(s,"P",{});var iy=i(Yn);ka=r(iy,"STRONG",{});var ly=i(ka);Mh=n(ly,"Use case 2: web page classification (training, inference) + token classification (inference), parse_html=False"),ly.forEach(t),iy.forEach(t),Fd=d(s),ze=r(s,"P",{});var Ns=i(ze);vh=n(Ns,`In case one already has obtained all nodes and xpaths, one doesn\u2019t need the feature extractor. In that case, one should
provide the nodes and corresponding xpaths themselves to the processor, and make sure to set `),Ma=r(Ns,"CODE",{});var dy=i(Ma);bh=n(dy,"parse_html"),dy.forEach(t),yh=n(Ns," to "),va=r(Ns,"CODE",{});var cy=i(va);Th=n(cy,"False"),cy.forEach(t),wh=n(Ns,"."),Ns.forEach(t),Id=d(s),M(To.$$.fragment,s),Nd=d(s),Kn=r(s,"P",{});var py=i(Kn);ba=r(py,"STRONG",{});var hy=i(ba);Eh=n(hy,"Use case 3: token classification (training), parse_html=False"),hy.forEach(t),py.forEach(t),Rd=d(s),K=r(s,"P",{});var ye=i(K);xh=n(ye,"For token classification tasks (such as "),wo=r(ye,"A",{href:!0,rel:!0});var uy=i(wo);Lh=n(uy,"SWDE"),uy.forEach(t),qh=n(ye,`), one can also provide the
corresponding node labels in order to train a model. The processor will then convert these into token-level `),ya=r(ye,"CODE",{});var my=i(ya);$h=n(my,"labels"),my.forEach(t),Uh=n(ye,`.
By default, it will only label the first wordpiece of a word, and label the remaining wordpieces with -100, which is the
`),Ta=r(ye,"CODE",{});var fy=i(Ta);zh=n(fy,"ignore_index"),fy.forEach(t),Jh=n(ye,` of PyTorch\u2019s CrossEntropyLoss. In case you want all wordpieces of a word to be labeled, you can
initialize the tokenizer with `),wa=r(ye,"CODE",{});var gy=i(wa);Ch=n(gy,"only_label_first_subword"),gy.forEach(t),jh=n(ye," set to "),Ea=r(ye,"CODE",{});var _y=i(Ea);Fh=n(_y,"False"),_y.forEach(t),Ih=n(ye,"."),ye.forEach(t),Zd=d(s),M(Eo.$$.fragment,s),Bd=d(s),es=r(s,"P",{});var ky=i(es);xa=r(ky,"STRONG",{});var My=i(xa);Nh=n(My,"Use case 4: web page question answering (inference), parse_html=True"),My.forEach(t),ky.forEach(t),Dd=d(s),ts=r(s,"P",{});var vy=i(ts);Rh=n(vy,`For question answering tasks on web pages, you can provide a question to the processor. By default, the
processor will use the feature extractor to get all nodes and xpaths, and create [CLS] question tokens [SEP] word tokens [SEP].`),vy.forEach(t),Ad=d(s),M(xo.$$.fragment,s),Gd=d(s),os=r(s,"P",{});var by=i(os);La=r(by,"STRONG",{});var yy=i(La);Zh=n(yy,"Use case 5: web page question answering (inference), parse_html=False"),yy.forEach(t),by.forEach(t),Pd=d(s),Je=r(s,"P",{});var Rs=i(Je);Bh=n(Rs,`For question answering tasks (such as WebSRC), you can provide a question to the processor. If you have extracted
all nodes and xpaths yourself, you can provide them directly to the processor. Make sure to set `),qa=r(Rs,"CODE",{});var Ty=i(qa);Dh=n(Ty,"parse_html"),Ty.forEach(t),Ah=n(Rs," to "),$a=r(Rs,"CODE",{});var wy=i($a);Gh=n(wy,"False"),wy.forEach(t),Ph=n(Rs,"."),Rs.forEach(t),Sd=d(s),M(Lo.$$.fragment,s),Wd=d(s),Pe=r(s,"H2",{class:!0});var gc=i(Pe);gt=r(gc,"A",{id:!0,class:!0,href:!0});var Ey=i(gt);Ua=r(Ey,"SPAN",{});var xy=i(Ua);M(qo.$$.fragment,xy),xy.forEach(t),Ey.forEach(t),Sh=d(gc),za=r(gc,"SPAN",{});var Ly=i(za);Wh=n(Ly,"Documentation resources"),Ly.forEach(t),gc.forEach(t),Od=d(s),Ce=r(s,"UL",{});var Zs=i(Ce);Ja=r(Zs,"LI",{});var qy=i(Ja);ns=r(qy,"A",{href:!0});var $y=i(ns);Oh=n($y,"Text classification task guide"),$y.forEach(t),qy.forEach(t),Vh=d(Zs),Ca=r(Zs,"LI",{});var Uy=i(Ca);ss=r(Uy,"A",{href:!0});var zy=i(ss);Qh=n(zy,"Token classification task guide"),zy.forEach(t),Uy.forEach(t),Xh=d(Zs),ja=r(Zs,"LI",{});var Jy=i(ja);as=r(Jy,"A",{href:!0});var Cy=i(as);Hh=n(Cy,"Question answering task guide"),Cy.forEach(t),Jy.forEach(t),Zs.forEach(t),Vd=d(s),Se=r(s,"H2",{class:!0});var _c=i(Se);_t=r(_c,"A",{id:!0,class:!0,href:!0});var jy=i(_t);Fa=r(jy,"SPAN",{});var Fy=i(Fa);M($o.$$.fragment,Fy),Fy.forEach(t),jy.forEach(t),Yh=d(_c),Ia=r(_c,"SPAN",{});var Iy=i(Ia);Kh=n(Iy,"MarkupLMConfig"),Iy.forEach(t),_c.forEach(t),Qd=d(s),ce=r(s,"DIV",{class:!0});var eo=i(ce);M(Uo.$$.fragment,eo),eu=d(eo),We=r(eo,"P",{});var Bs=i(We);tu=n(Bs,"This is the configuration class to store the configuration of a "),rs=r(Bs,"A",{href:!0});var Ny=i(rs);ou=n(Ny,"MarkupLMModel"),Ny.forEach(t),nu=n(Bs,`. It is used to instantiate a
MarkupLM 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 MarkupLM
`),zo=r(Bs,"A",{href:!0,rel:!0});var Ry=i(zo);su=n(Ry,"microsoft/markuplm-base"),Ry.forEach(t),au=n(Bs," architecture."),Bs.forEach(t),ru=d(eo),Oe=r(eo,"P",{});var Ds=i(Oe);iu=n(Ds,"Configuration objects inherit from "),is=r(Ds,"A",{href:!0});var Zy=i(is);lu=n(Zy,"BertConfig"),Zy.forEach(t),du=n(Ds,` and can be used to control the model outputs. Read the
documentation from `),ls=r(Ds,"A",{href:!0});var By=i(ls);cu=n(By,"BertConfig"),By.forEach(t),pu=n(Ds," for more information."),Ds.forEach(t),hu=d(eo),M(kt.$$.fragment,eo),eo.forEach(t),Xd=d(s),Ve=r(s,"H2",{class:!0});var kc=i(Ve);Mt=r(kc,"A",{id:!0,class:!0,href:!0});var Dy=i(Mt);Na=r(Dy,"SPAN",{});var Ay=i(Na);M(Jo.$$.fragment,Ay),Ay.forEach(t),Dy.forEach(t),uu=d(kc),Ra=r(kc,"SPAN",{});var Gy=i(Ra);mu=n(Gy,"MarkupLMFeatureExtractor"),Gy.forEach(t),kc.forEach(t),Hd=d(s),pe=r(s,"DIV",{class:!0});var to=i(pe);M(Co.$$.fragment,to),fu=d(to),Za=r(to,"P",{});var Py=i(Za);gu=n(Py,`Constructs a MarkupLM feature extractor. This can be used to get a list of nodes and corresponding xpaths from HTML
strings.`),Py.forEach(t),_u=d(to),jo=r(to,"P",{});var Mc=i(jo);ku=n(Mc,"This feature extractor inherits from "),Ba=r(Mc,"CODE",{});var Sy=i(Ba);Mu=n(Sy,"PreTrainedFeatureExtractor()"),Sy.forEach(t),vu=n(Mc,` which contains most
of the main methods. Users should refer to this superclass for more information regarding those methods.`),Mc.forEach(t),bu=d(to),je=r(to,"DIV",{class:!0});var As=i(je);M(Fo.$$.fragment,As),yu=d(As),Da=r(As,"P",{});var Wy=i(Da);Tu=n(Wy,"Main method to prepare for the model one or several HTML strings."),Wy.forEach(t),wu=d(As),M(vt.$$.fragment,As),As.forEach(t),to.forEach(t),Yd=d(s),Qe=r(s,"H2",{class:!0});var vc=i(Qe);bt=r(vc,"A",{id:!0,class:!0,href:!0});var Oy=i(bt);Aa=r(Oy,"SPAN",{});var Vy=i(Aa);M(Io.$$.fragment,Vy),Vy.forEach(t),Oy.forEach(t),Eu=d(vc),Ga=r(vc,"SPAN",{});var Qy=i(Ga);xu=n(Qy,"MarkupLMTokenizer"),Qy.forEach(t),vc.forEach(t),Kd=d(s),X=r(s,"DIV",{class:!0});var Te=i(X);M(No.$$.fragment,Te),Lu=d(Te),B=r(Te,"P",{});var ee=i(B);qu=n(ee,"Construct a MarkupLM tokenizer. Based on byte-level Byte-Pair-Encoding (BPE). "),ds=r(ee,"A",{href:!0});var Xy=i(ds);$u=n(Xy,"MarkupLMTokenizer"),Xy.forEach(t),Uu=n(ee,` can be used to
turn HTML strings into to token-level `),Pa=r(ee,"CODE",{});var Hy=i(Pa);zu=n(Hy,"input_ids"),Hy.forEach(t),Ju=n(ee,", "),Sa=r(ee,"CODE",{});var Yy=i(Sa);Cu=n(Yy,"attention_mask"),Yy.forEach(t),ju=n(ee,", "),Wa=r(ee,"CODE",{});var Ky=i(Wa);Fu=n(Ky,"token_type_ids"),Ky.forEach(t),Iu=n(ee,", "),Oa=r(ee,"CODE",{});var e1=i(Oa);Nu=n(e1,"xpath_tags_seq"),e1.forEach(t),Ru=n(ee,` and
`),Va=r(ee,"CODE",{});var t1=i(Va);Zu=n(t1,"xpath_tags_seq"),t1.forEach(t),Bu=n(ee,". This tokenizer inherits from "),cs=r(ee,"A",{href:!0});var o1=i(cs);Du=n(o1,"PreTrainedTokenizer"),o1.forEach(t),Au=n(ee,` which contains most of the main methods.
Users should refer to this superclass for more information regarding those methods.`),ee.forEach(t),Gu=d(Te),Fe=r(Te,"DIV",{class:!0});var Gs=i(Fe);M(Ro.$$.fragment,Gs),Pu=d(Gs),Qa=r(Gs,"P",{});var n1=i(Qa);Su=n(n1,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A RoBERTa sequence has the following format:`),n1.forEach(t),Wu=d(Gs),Zo=r(Gs,"UL",{});var bc=i(Zo);ps=r(bc,"LI",{});var cb=i(ps);Ou=n(cb,"single sequence: "),Xa=r(cb,"CODE",{});var s1=i(Xa);Vu=n(s1,"<s> X </s>"),s1.forEach(t),cb.forEach(t),Qu=d(bc),hs=r(bc,"LI",{});var pb=i(hs);Xu=n(pb,"pair of sequences: "),Ha=r(pb,"CODE",{});var a1=i(Ha);Hu=n(a1,"<s> A </s></s> B </s>"),a1.forEach(t),pb.forEach(t),bc.forEach(t),Gs.forEach(t),Yu=d(Te),us=r(Te,"DIV",{class:!0});var r1=i(us);M(Bo.$$.fragment,r1),r1.forEach(t),Ku=d(Te),yt=r(Te,"DIV",{class:!0});var yc=i(yt);M(Do.$$.fragment,yc),em=d(yc),Ya=r(yc,"P",{});var i1=i(Ya);tm=n(i1,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. RoBERTa does not
make use of token type ids, therefore a list of zeros is returned.`),i1.forEach(t),yc.forEach(t),om=d(Te),ms=r(Te,"DIV",{class:!0});var l1=i(ms);M(Ao.$$.fragment,l1),l1.forEach(t),Te.forEach(t),ec=d(s),Xe=r(s,"H2",{class:!0});var Tc=i(Xe);Tt=r(Tc,"A",{id:!0,class:!0,href:!0});var d1=i(Tt);Ka=r(d1,"SPAN",{});var c1=i(Ka);M(Go.$$.fragment,c1),c1.forEach(t),d1.forEach(t),nm=d(Tc),er=r(Tc,"SPAN",{});var p1=i(er);sm=n(p1,"MarkupLMTokenizerFast"),p1.forEach(t),Tc.forEach(t),tc=d(s),J=r(s,"DIV",{class:!0});var S=i(J);M(Po.$$.fragment,S),am=d(S),tr=r(S,"P",{});var h1=i(tr);rm=n(h1,"Construct a MarkupLM tokenizer. Based on byte-level Byte-Pair-Encoding (BPE)."),h1.forEach(t),im=d(S),D=r(S,"P",{});var ne=i(D);fs=r(ne,"A",{href:!0});var u1=i(fs);lm=n(u1,"MarkupLMTokenizerFast"),u1.forEach(t),dm=n(ne," can be used to turn HTML strings into to token-level "),or=r(ne,"CODE",{});var m1=i(or);cm=n(m1,"input_ids"),m1.forEach(t),pm=n(ne,", "),nr=r(ne,"CODE",{});var f1=i(nr);hm=n(f1,"attention_mask"),f1.forEach(t),um=n(ne,`,
`),sr=r(ne,"CODE",{});var g1=i(sr);mm=n(g1,"token_type_ids"),g1.forEach(t),fm=n(ne,", "),ar=r(ne,"CODE",{});var _1=i(ar);gm=n(_1,"xpath_tags_seq"),_1.forEach(t),_m=n(ne," and "),rr=r(ne,"CODE",{});var k1=i(rr);km=n(k1,"xpath_tags_seq"),k1.forEach(t),Mm=n(ne,". This tokenizer inherits from "),gs=r(ne,"A",{href:!0});var M1=i(gs);vm=n(M1,"PreTrainedTokenizer"),M1.forEach(t),bm=n(ne,` which
contains most of the main methods.`),ne.forEach(t),ym=d(S),ir=r(S,"P",{});var v1=i(ir);Tm=n(v1,"Users should refer to this superclass for more information regarding those methods."),v1.forEach(t),wm=d(S),A=r(S,"DIV",{class:!0});var re=i(A);M(So.$$.fragment,re),Em=d(re),I=r(re,"P",{});var W=i(I);xm=n(W,"add_special_tokens ("),lr=r(W,"CODE",{});var b1=i(lr);Lm=n(b1,"bool"),b1.forEach(t),qm=n(W,", "),dr=r(W,"EM",{});var y1=i(dr);$m=n(y1,"optional"),y1.forEach(t),Um=n(W,", defaults to "),cr=r(W,"CODE",{});var T1=i(cr);zm=n(T1,"True"),T1.forEach(t),Jm=n(W,`):
Whether or not to encode the sequences with the special tokens relative to their model.
padding (`),pr=r(W,"CODE",{});var w1=i(pr);Cm=n(w1,"bool"),w1.forEach(t),jm=n(W,", "),hr=r(W,"CODE",{});var E1=i(hr);Fm=n(E1,"str"),E1.forEach(t),Im=n(W," or "),_s=r(W,"A",{href:!0});var x1=i(_s);Nm=n(x1,"PaddingStrategy"),x1.forEach(t),Rm=n(W,", "),ur=r(W,"EM",{});var L1=i(ur);Zm=n(L1,"optional"),L1.forEach(t),Bm=n(W,", defaults to "),mr=r(W,"CODE",{});var q1=i(mr);Dm=n(q1,"False"),q1.forEach(t),Am=n(W,`):
Activates and controls padding. Accepts the following values:`),W.forEach(t),Gm=d(re),H=r(re,"UL",{});var ie=i(H);fr=r(ie,"LI",{});var $1=i(fr);wt=r($1,"P",{});var ed=i(wt);gr=r(ed,"CODE",{});var U1=i(gr);Pm=n(U1,"True"),U1.forEach(t),Sm=n(ed," or "),_r=r(ed,"CODE",{});var z1=i(_r);Wm=n(z1,"'longest'"),z1.forEach(t),Om=n(ed,`: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).`),ed.forEach(t),$1.forEach(t),Vm=d(ie),kr=r(ie,"LI",{});var J1=i(kr);Et=r(J1,"P",{});var td=i(Et);Mr=r(td,"CODE",{});var C1=i(Mr);Qm=n(C1,"'max_length'"),C1.forEach(t),Xm=n(td,": Pad to a maximum length specified with the argument "),vr=r(td,"CODE",{});var j1=i(vr);Hm=n(j1,"max_length"),j1.forEach(t),Ym=n(td,` or to the maximum
acceptable input length for the model if that argument is not provided.`),td.forEach(t),J1.forEach(t),Km=d(ie),br=r(ie,"LI",{});var F1=i(br);G=r(F1,"P",{});var se=i(G);yr=r(se,"CODE",{});var I1=i(yr);ef=n(I1,"False"),I1.forEach(t),tf=n(se," or "),Tr=r(se,"CODE",{});var N1=i(Tr);of=n(N1,"'do_not_pad'"),N1.forEach(t),nf=n(se,` (default): No padding (i.e., can output a batch with sequences of different
lengths).
truncation (`),wr=r(se,"CODE",{});var R1=i(wr);sf=n(R1,"bool"),R1.forEach(t),af=n(se,", "),Er=r(se,"CODE",{});var Z1=i(Er);rf=n(Z1,"str"),Z1.forEach(t),lf=n(se," or "),ks=r(se,"A",{href:!0});var B1=i(ks);df=n(B1,"TruncationStrategy"),B1.forEach(t),cf=n(se,", "),xr=r(se,"EM",{});var D1=i(xr);pf=n(D1,"optional"),D1.forEach(t),hf=n(se,", defaults to "),Lr=r(se,"CODE",{});var A1=i(Lr);uf=n(A1,"False"),A1.forEach(t),mf=n(se,`):
Activates and controls truncation. Accepts the following values:`),se.forEach(t),F1.forEach(t),ff=d(ie),qr=r(ie,"LI",{});var G1=i(qr);Ie=r(G1,"P",{});var En=i(Ie);$r=r(En,"CODE",{});var P1=i($r);gf=n(P1,"True"),P1.forEach(t),_f=n(En," or "),Ur=r(En,"CODE",{});var S1=i(Ur);kf=n(S1,"'longest_first'"),S1.forEach(t),Mf=n(En,": Truncate to a maximum length specified with the argument "),zr=r(En,"CODE",{});var W1=i(zr);vf=n(W1,"max_length"),W1.forEach(t),bf=n(En,` or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.`),En.forEach(t),G1.forEach(t),yf=d(ie),Jr=r(ie,"LI",{});var O1=i(Jr);xt=r(O1,"P",{});var od=i(xt);Cr=r(od,"CODE",{});var V1=i(Cr);Tf=n(V1,"'only_first'"),V1.forEach(t),wf=n(od,": Truncate to a maximum length specified with the argument "),jr=r(od,"CODE",{});var Q1=i(jr);Ef=n(Q1,"max_length"),Q1.forEach(t),xf=n(od,` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),od.forEach(t),O1.forEach(t),Lf=d(ie),Fr=r(ie,"LI",{});var X1=i(Fr);Lt=r(X1,"P",{});var nd=i(Lt);Ir=r(nd,"CODE",{});var H1=i(Ir);qf=n(H1,"'only_second'"),H1.forEach(t),$f=n(nd,": Truncate to a maximum length specified with the argument "),Nr=r(nd,"CODE",{});var Y1=i(Nr);Uf=n(Y1,"max_length"),Y1.forEach(t),zf=n(nd,` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),nd.forEach(t),X1.forEach(t),Jf=d(ie),Rr=r(ie,"LI",{});var K1=i(Rr);fe=r(K1,"P",{});var pt=i(fe);Zr=r(pt,"CODE",{});var eT=i(Zr);Cf=n(eT,"False"),eT.forEach(t),jf=n(pt," or "),Br=r(pt,"CODE",{});var tT=i(Br);Ff=n(tT,"'do_not_truncate'"),tT.forEach(t),If=n(pt,` (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).
max_length (`),Dr=r(pt,"CODE",{});var oT=i(Dr);Nf=n(oT,"int"),oT.forEach(t),Rf=n(pt,", "),Ar=r(pt,"EM",{});var nT=i(Ar);Zf=n(nT,"optional"),nT.forEach(t),Bf=n(pt,`):
Controls the maximum length to use by one of the truncation/padding parameters.`),pt.forEach(t),K1.forEach(t),ie.forEach(t),Df=d(re),x=r(re,"P",{});var q=i(x);Af=n(q,"If left unset or set to "),Gr=r(q,"CODE",{});var sT=i(Gr);Gf=n(sT,"None"),sT.forEach(t),Pf=n(q,`, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.
stride (`),Pr=r(q,"CODE",{});var aT=i(Pr);Sf=n(aT,"int"),aT.forEach(t),Wf=n(q,", "),Sr=r(q,"EM",{});var rT=i(Sr);Of=n(rT,"optional"),rT.forEach(t),Vf=n(q,`, defaults to 0):
If set to a number along with `),Wr=r(q,"CODE",{});var iT=i(Wr);Qf=n(iT,"max_length"),iT.forEach(t),Xf=n(q,`, the overflowing tokens returned when
`),Or=r(q,"CODE",{});var lT=i(Or);Hf=n(lT,"return_overflowing_tokens=True"),lT.forEach(t),Yf=n(q,` will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.
is_split_into_words (`),Vr=r(q,"CODE",{});var dT=i(Vr);Kf=n(dT,"bool"),dT.forEach(t),eg=n(q,", "),Qr=r(q,"EM",{});var cT=i(Qr);tg=n(cT,"optional"),cT.forEach(t),og=n(q,", defaults to "),Xr=r(q,"CODE",{});var pT=i(Xr);ng=n(pT,"False"),pT.forEach(t),sg=n(q,`):
Whether or not the input is already pre-tokenized (e.g., split into words). If set to `),Hr=r(q,"CODE",{});var hT=i(Hr);ag=n(hT,"True"),hT.forEach(t),rg=n(q,`, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.
pad_to_multiple_of (`),Yr=r(q,"CODE",{});var uT=i(Yr);ig=n(uT,"int"),uT.forEach(t),lg=n(q,", "),Kr=r(q,"EM",{});var mT=i(Kr);dg=n(mT,"optional"),mT.forEach(t),cg=n(q,`):
If set will pad the sequence to a multiple of the provided value. Requires `),ei=r(q,"CODE",{});var fT=i(ei);pg=n(fT,"padding"),fT.forEach(t),hg=n(q,` to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
`),ti=r(q,"CODE",{});var gT=i(ti);ug=n(gT,">= 7.5"),gT.forEach(t),mg=n(q,` (Volta).
return_tensors (`),oi=r(q,"CODE",{});var _T=i(oi);fg=n(_T,"str"),_T.forEach(t),gg=n(q," or "),Ms=r(q,"A",{href:!0});var kT=i(Ms);_g=n(kT,"TensorType"),kT.forEach(t),kg=n(q,", "),ni=r(q,"EM",{});var MT=i(ni);Mg=n(MT,"optional"),MT.forEach(t),vg=n(q,`):
If set, will return tensors instead of list of python integers. Acceptable values are:`),q.forEach(t),bg=d(re),He=r(re,"UL",{});var Ps=i(He);qt=r(Ps,"LI",{});var sd=i(qt);si=r(sd,"CODE",{});var vT=i(si);yg=n(vT,"'tf'"),vT.forEach(t),Tg=n(sd,": Return TensorFlow "),ai=r(sd,"CODE",{});var bT=i(ai);wg=n(bT,"tf.constant"),bT.forEach(t),Eg=n(sd," objects."),sd.forEach(t),xg=d(Ps),$t=r(Ps,"LI",{});var ad=i($t);ri=r(ad,"CODE",{});var yT=i(ri);Lg=n(yT,"'pt'"),yT.forEach(t),qg=n(ad,": Return PyTorch "),ii=r(ad,"CODE",{});var TT=i(ii);$g=n(TT,"torch.Tensor"),TT.forEach(t),Ug=n(ad," objects."),ad.forEach(t),zg=d(Ps),Ut=r(Ps,"LI",{});var rd=i(Ut);li=r(rd,"CODE",{});var wT=i(li);Jg=n(wT,"'np'"),wT.forEach(t),Cg=n(rd,": Return Numpy "),di=r(rd,"CODE",{});var ET=i(di);jg=n(ET,"np.ndarray"),ET.forEach(t),Fg=n(rd," objects."),rd.forEach(t),Ps.forEach(t),Ig=d(re),N=r(re,"P",{});var O=i(N);Ng=n(O,"add_special_tokens ("),ci=r(O,"CODE",{});var xT=i(ci);Rg=n(xT,"bool"),xT.forEach(t),Zg=n(O,", "),pi=r(O,"EM",{});var LT=i(pi);Bg=n(LT,"optional"),LT.forEach(t),Dg=n(O,", defaults to "),hi=r(O,"CODE",{});var qT=i(hi);Ag=n(qT,"True"),qT.forEach(t),Gg=n(O,`):
Whether or not to encode the sequences with the special tokens relative to their model.
padding (`),ui=r(O,"CODE",{});var $T=i(ui);Pg=n($T,"bool"),$T.forEach(t),Sg=n(O,", "),mi=r(O,"CODE",{});var UT=i(mi);Wg=n(UT,"str"),UT.forEach(t),Og=n(O," or "),vs=r(O,"A",{href:!0});var zT=i(vs);Vg=n(zT,"PaddingStrategy"),zT.forEach(t),Qg=n(O,", "),fi=r(O,"EM",{});var JT=i(fi);Xg=n(JT,"optional"),JT.forEach(t),Hg=n(O,", defaults to "),gi=r(O,"CODE",{});var CT=i(gi);Yg=n(CT,"False"),CT.forEach(t),Kg=n(O,`):
Activates and controls padding. Accepts the following values:`),O.forEach(t),e_=d(re),C=r(re,"UL",{});var Z=i(C);_i=r(Z,"LI",{});var jT=i(_i);zt=r(jT,"P",{});var id=i(zt);ki=r(id,"CODE",{});var FT=i(ki);t_=n(FT,"True"),FT.forEach(t),o_=n(id," or "),Mi=r(id,"CODE",{});var IT=i(Mi);n_=n(IT,"'longest'"),IT.forEach(t),s_=n(id,`: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).`),id.forEach(t),jT.forEach(t),a_=d(Z),vi=r(Z,"LI",{});var NT=i(vi);Jt=r(NT,"P",{});var ld=i(Jt);bi=r(ld,"CODE",{});var RT=i(bi);r_=n(RT,"'max_length'"),RT.forEach(t),i_=n(ld,": Pad to a maximum length specified with the argument "),yi=r(ld,"CODE",{});var ZT=i(yi);l_=n(ZT,"max_length"),ZT.forEach(t),d_=n(ld,` or to the maximum
acceptable input length for the model if that argument is not provided.`),ld.forEach(t),NT.forEach(t),c_=d(Z),Ti=r(Z,"LI",{});var BT=i(Ti);P=r(BT,"P",{});var ae=i(P);wi=r(ae,"CODE",{});var DT=i(wi);p_=n(DT,"False"),DT.forEach(t),h_=n(ae," or "),Ei=r(ae,"CODE",{});var AT=i(Ei);u_=n(AT,"'do_not_pad'"),AT.forEach(t),m_=n(ae,` (default): No padding (i.e., can output a batch with sequences of different
lengths).
truncation (`),xi=r(ae,"CODE",{});var GT=i(xi);f_=n(GT,"bool"),GT.forEach(t),g_=n(ae,", "),Li=r(ae,"CODE",{});var PT=i(Li);__=n(PT,"str"),PT.forEach(t),k_=n(ae," or "),bs=r(ae,"A",{href:!0});var ST=i(bs);M_=n(ST,"TruncationStrategy"),ST.forEach(t),v_=n(ae,", "),qi=r(ae,"EM",{});var WT=i(qi);b_=n(WT,"optional"),WT.forEach(t),y_=n(ae,", defaults to "),$i=r(ae,"CODE",{});var OT=i($i);T_=n(OT,"False"),OT.forEach(t),w_=n(ae,`):
Activates and controls truncation. Accepts the following values:`),ae.forEach(t),BT.forEach(t),E_=d(Z),Ui=r(Z,"LI",{});var VT=i(Ui);Ne=r(VT,"P",{});var xn=i(Ne);zi=r(xn,"CODE",{});var QT=i(zi);x_=n(QT,"True"),QT.forEach(t),L_=n(xn," or "),Ji=r(xn,"CODE",{});var XT=i(Ji);q_=n(XT,"'longest_first'"),XT.forEach(t),$_=n(xn,": Truncate to a maximum length specified with the argument "),Ci=r(xn,"CODE",{});var HT=i(Ci);U_=n(HT,"max_length"),HT.forEach(t),z_=n(xn,` or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.`),xn.forEach(t),VT.forEach(t),J_=d(Z),ji=r(Z,"LI",{});var YT=i(ji);Ct=r(YT,"P",{});var dd=i(Ct);Fi=r(dd,"CODE",{});var KT=i(Fi);C_=n(KT,"'only_first'"),KT.forEach(t),j_=n(dd,": Truncate to a maximum length specified with the argument "),Ii=r(dd,"CODE",{});var ew=i(Ii);F_=n(ew,"max_length"),ew.forEach(t),I_=n(dd,` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),dd.forEach(t),YT.forEach(t),N_=d(Z),Ni=r(Z,"LI",{});var tw=i(Ni);jt=r(tw,"P",{});var cd=i(jt);Ri=r(cd,"CODE",{});var ow=i(Ri);R_=n(ow,"'only_second'"),ow.forEach(t),Z_=n(cd,": Truncate to a maximum length specified with the argument "),Zi=r(cd,"CODE",{});var nw=i(Zi);B_=n(nw,"max_length"),nw.forEach(t),D_=n(cd,` or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.`),cd.forEach(t),tw.forEach(t),A_=d(Z),Bi=r(Z,"LI",{});var sw=i(Bi);L=r(sw,"P",{});var $=i(L);Di=r($,"CODE",{});var aw=i(Di);G_=n(aw,"False"),aw.forEach(t),P_=n($," or "),Ai=r($,"CODE",{});var rw=i(Ai);S_=n(rw,"'do_not_truncate'"),rw.forEach(t),W_=n($,` (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).
max_length (`),Gi=r($,"CODE",{});var iw=i(Gi);O_=n(iw,"int"),iw.forEach(t),V_=n($,", "),Pi=r($,"EM",{});var lw=i(Pi);Q_=n(lw,"optional"),lw.forEach(t),X_=n($,`):
Controls the maximum length to use by one of the truncation/padding parameters. If left unset or set to
`),Si=r($,"CODE",{});var dw=i(Si);H_=n(dw,"None"),dw.forEach(t),Y_=n($,`, this will use the predefined model maximum length if a maximum length is required by one of the
truncation/padding parameters. If the model has no specific maximum input length (like XLNet)
truncation/padding to a maximum length will be deactivated.
stride (`),Wi=r($,"CODE",{});var cw=i(Wi);K_=n(cw,"int"),cw.forEach(t),ek=n($,", "),Oi=r($,"EM",{});var pw=i(Oi);tk=n(pw,"optional"),pw.forEach(t),ok=n($,`, defaults to 0):
If set to a number along with `),Vi=r($,"CODE",{});var hw=i(Vi);nk=n(hw,"max_length"),hw.forEach(t),sk=n($,`, the overflowing tokens returned when
`),Qi=r($,"CODE",{});var uw=i(Qi);ak=n(uw,"return_overflowing_tokens=True"),uw.forEach(t),rk=n($,` will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.
pad_to_multiple_of (`),Xi=r($,"CODE",{});var mw=i(Xi);ik=n(mw,"int"),mw.forEach(t),lk=n($,", "),Hi=r($,"EM",{});var fw=i(Hi);dk=n(fw,"optional"),fw.forEach(t),ck=n($,`):
If set will pad the sequence to a multiple of the provided value. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability `),Yi=r($,"CODE",{});var gw=i(Yi);pk=n(gw,">= 7.5"),gw.forEach(t),hk=n($,` (Volta).
return_tensors (`),Ki=r($,"CODE",{});var _w=i(Ki);uk=n(_w,"str"),_w.forEach(t),mk=n($," or "),ys=r($,"A",{href:!0});var kw=i(ys);fk=n(kw,"TensorType"),kw.forEach(t),gk=n($,", "),el=r($,"EM",{});var Mw=i(el);_k=n(Mw,"optional"),Mw.forEach(t),kk=n($,`):
If set, will return tensors instead of list of python integers. Acceptable values are:`),$.forEach(t),sw.forEach(t),Mk=d(Z),tl=r(Z,"LI",{});var vw=i(tl);Ft=r(vw,"P",{});var pd=i(Ft);ol=r(pd,"CODE",{});var bw=i(ol);vk=n(bw,"'tf'"),bw.forEach(t),bk=n(pd,": Return TensorFlow "),nl=r(pd,"CODE",{});var yw=i(nl);yk=n(yw,"tf.constant"),yw.forEach(t),Tk=n(pd," objects."),pd.forEach(t),vw.forEach(t),wk=d(Z),sl=r(Z,"LI",{});var Tw=i(sl);It=r(Tw,"P",{});var hd=i(It);al=r(hd,"CODE",{});var ww=i(al);Ek=n(ww,"'pt'"),ww.forEach(t),xk=n(hd,": Return PyTorch "),rl=r(hd,"CODE",{});var Ew=i(rl);Lk=n(Ew,"torch.Tensor"),Ew.forEach(t),qk=n(hd," objects."),hd.forEach(t),Tw.forEach(t),$k=d(Z),il=r(Z,"LI",{});var xw=i(il);Nt=r(xw,"P",{});var ud=i(Nt);ll=r(ud,"CODE",{});var Lw=i(ll);Uk=n(Lw,"'np'"),Lw.forEach(t),zk=n(ud,": Return Numpy "),dl=r(ud,"CODE",{});var qw=i(dl);Jk=n(qw,"np.ndarray"),qw.forEach(t),Ck=n(ud," objects."),ud.forEach(t),xw.forEach(t),Z.forEach(t),re.forEach(t),jk=d(S),Re=r(S,"DIV",{class:!0});var Ss=i(Re);M(Wo.$$.fragment,Ss),Fk=d(Ss),cl=r(Ss,"P",{});var $w=i(cl);Ik=n($w,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A RoBERTa sequence has the following format:`),$w.forEach(t),Nk=d(Ss),Oo=r(Ss,"UL",{});var wc=i(Oo);Ts=r(wc,"LI",{});var hb=i(Ts);Rk=n(hb,"single sequence: "),pl=r(hb,"CODE",{});var Uw=i(pl);Zk=n(Uw,"<s> X </s>"),Uw.forEach(t),hb.forEach(t),Bk=d(wc),ws=r(wc,"LI",{});var ub=i(ws);Dk=n(ub,"pair of sequences: "),hl=r(ub,"CODE",{});var zw=i(hl);Ak=n(zw,"<s> A </s></s> B </s>"),zw.forEach(t),ub.forEach(t),wc.forEach(t),Ss.forEach(t),Gk=d(S),Rt=r(S,"DIV",{class:!0});var Ec=i(Rt);M(Vo.$$.fragment,Ec),Pk=d(Ec),ul=r(Ec,"P",{});var Jw=i(ul);Sk=n(Jw,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. RoBERTa does not
make use of token type ids, therefore a list of zeros is returned.`),Jw.forEach(t),Ec.forEach(t),Wk=d(S),Zt=r(S,"DIV",{class:!0});var xc=i(Zt);M(Qo.$$.fragment,xc),Ok=d(xc),Xo=r(xc,"P",{});var Lc=i(Xo);Vk=n(Lc,`Tokenize and prepare for the model a sequence or a pair of sequences. .. warning:: This method is deprecated,
`),ml=r(Lc,"CODE",{});var Cw=i(ml);Qk=n(Cw,"__call__"),Cw.forEach(t),Xk=n(Lc," should be used instead."),Lc.forEach(t),xc.forEach(t),Hk=d(S),Bt=r(S,"DIV",{class:!0});var qc=i(Bt);M(Ho.$$.fragment,qc),Yk=d(qc),fl=r(qc,"P",{});var jw=i(fl);Kk=n(jw,`Given the xpath expression of one particular node (like \u201C/html/body/div/li[1]/div/span[2]\u201D), return a list of
tag IDs and corresponding subscripts, taking into account max depth.`),jw.forEach(t),qc.forEach(t),S.forEach(t),oc=d(s),Ye=r(s,"H2",{class:!0});var $c=i(Ye);Dt=r($c,"A",{id:!0,class:!0,href:!0});var Fw=i(Dt);gl=r(Fw,"SPAN",{});var Iw=i(gl);M(Yo.$$.fragment,Iw),Iw.forEach(t),Fw.forEach(t),eM=d($c),_l=r($c,"SPAN",{});var Nw=i(_l);tM=n(Nw,"MarkupLMProcessor"),Nw.forEach(t),$c.forEach(t),nc=d(s),te=r(s,"DIV",{class:!0});var Be=i(te);M(Ko.$$.fragment,Be),oM=d(Be),kl=r(Be,"P",{});var Rw=i(kl);nM=n(Rw,`Constructs a MarkupLM processor which combines a MarkupLM feature extractor and a MarkupLM tokenizer into a single
processor.`),Rw.forEach(t),sM=d(Be),Es=r(Be,"P",{});var mb=i(Es);xs=r(mb,"A",{href:!0});var Zw=i(xs);aM=n(Zw,"MarkupLMProcessor"),Zw.forEach(t),rM=n(mb," offers all the functionalities you need to prepare data for the model."),mb.forEach(t),iM=d(Be),R=r(Be,"P",{});var V=i(R);lM=n(V,"It first uses "),Ls=r(V,"A",{href:!0});var Bw=i(Ls);dM=n(Bw,"MarkupLMFeatureExtractor"),Bw.forEach(t),cM=n(V,` to extract nodes and corresponding xpaths from one or more HTML strings.
Next, these are provided to `),qs=r(V,"A",{href:!0});var Dw=i(qs);pM=n(Dw,"MarkupLMTokenizer"),Dw.forEach(t),hM=n(V," or "),$s=r(V,"A",{href:!0});var Aw=i($s);uM=n(Aw,"MarkupLMTokenizerFast"),Aw.forEach(t),mM=n(V,`, which turns them into token-level
`),Ml=r(V,"CODE",{});var Gw=i(Ml);fM=n(Gw,"input_ids"),Gw.forEach(t),gM=n(V,", "),vl=r(V,"CODE",{});var Pw=i(vl);_M=n(Pw,"attention_mask"),Pw.forEach(t),kM=n(V,", "),bl=r(V,"CODE",{});var Sw=i(bl);MM=n(Sw,"token_type_ids"),Sw.forEach(t),vM=n(V,", "),yl=r(V,"CODE",{});var Ww=i(yl);bM=n(Ww,"xpath_tags_seq"),Ww.forEach(t),yM=n(V," and "),Tl=r(V,"CODE",{});var Ow=i(Tl);TM=n(Ow,"xpath_subs_seq"),Ow.forEach(t),wM=n(V,"."),V.forEach(t),EM=d(Be),ge=r(Be,"DIV",{class:!0});var oo=i(ge);M(en.$$.fragment,oo),xM=d(oo),oe=r(oo,"P",{});var we=i(oe);LM=n(we,"This method first forwards the "),wl=r(we,"CODE",{});var Vw=i(wl);qM=n(Vw,"html_strings"),Vw.forEach(t),$M=n(we," argument to "),tn=r(we,"A",{href:!0});var fb=i(tn);El=r(fb,"STRONG",{});var Qw=i(El);UM=n(Qw,"call"),Qw.forEach(t),zM=n(fb,"()"),fb.forEach(t),JM=n(we,`. Next, it
passes the `),xl=r(we,"CODE",{});var Xw=i(xl);CM=n(Xw,"nodes"),Xw.forEach(t),jM=n(we," and "),Ll=r(we,"CODE",{});var Hw=i(Ll);FM=n(Hw,"xpaths"),Hw.forEach(t),IM=n(we," along with the additional arguments to "),ql=r(we,"CODE",{});var Yw=i(ql);NM=n(Yw,"__call__()"),Yw.forEach(t),RM=n(we,` and
returns the output.`),we.forEach(t),ZM=d(oo),on=r(oo,"P",{});var Uc=i(on);BM=n(Uc,"Optionally, one can also provide a "),$l=r(Uc,"CODE",{});var Kw=i($l);DM=n(Kw,"text"),Kw.forEach(t),AM=n(Uc," argument which is passed along as first sequence."),Uc.forEach(t),GM=d(oo),Ul=r(oo,"P",{});var e2=i(Ul);PM=n(e2,"Please refer to the docstring of the above two methods for more information."),e2.forEach(t),oo.forEach(t),Be.forEach(t),sc=d(s),Ke=r(s,"H2",{class:!0});var zc=i(Ke);At=r(zc,"A",{id:!0,class:!0,href:!0});var t2=i(At);zl=r(t2,"SPAN",{});var o2=i(zl);M(nn.$$.fragment,o2),o2.forEach(t),t2.forEach(t),SM=d(zc),Jl=r(zc,"SPAN",{});var n2=i(Jl);WM=n(n2,"MarkupLMModel"),n2.forEach(t),zc.forEach(t),ac=d(s),xe=r(s,"DIV",{class:!0});var Ws=i(xe);M(sn.$$.fragment,Ws),OM=d(Ws),an=r(Ws,"P",{});var Jc=i(an);VM=n(Jc,`The bare MarkupLM Model transformer outputting raw hidden-states without any specific head on top.
This model is a PyTorch `),rn=r(Jc,"A",{href:!0,rel:!0});var s2=i(rn);QM=n(s2,"torch.nn.Module"),s2.forEach(t),XM=n(Jc,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Jc.forEach(t),HM=d(Ws),_e=r(Ws,"DIV",{class:!0});var no=i(_e);M(ln.$$.fragment,no),YM=d(no),et=r(no,"P",{});var Os=i(et);KM=n(Os,"The "),Us=r(Os,"A",{href:!0});var a2=i(Us);ev=n(a2,"MarkupLMModel"),a2.forEach(t),tv=n(Os," forward method, overrides the "),Cl=r(Os,"CODE",{});var r2=i(Cl);ov=n(r2,"__call__"),r2.forEach(t),nv=n(Os," special method."),Os.forEach(t),sv=d(no),M(Gt.$$.fragment,no),av=d(no),M(Pt.$$.fragment,no),no.forEach(t),Ws.forEach(t),rc=d(s),tt=r(s,"H2",{class:!0});var Cc=i(tt);St=r(Cc,"A",{id:!0,class:!0,href:!0});var i2=i(St);jl=r(i2,"SPAN",{});var l2=i(jl);M(dn.$$.fragment,l2),l2.forEach(t),i2.forEach(t),rv=d(Cc),Fl=r(Cc,"SPAN",{});var d2=i(Fl);iv=n(d2,"MarkupLMForSequenceClassification"),d2.forEach(t),Cc.forEach(t),ic=d(s),he=r(s,"DIV",{class:!0});var so=i(he);M(cn.$$.fragment,so),lv=d(so),Il=r(so,"P",{});var c2=i(Il);dv=n(c2,`MarkupLM Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),c2.forEach(t),cv=d(so),pn=r(so,"P",{});var jc=i(pn);pv=n(jc,"This model is a PyTorch "),hn=r(jc,"A",{href:!0,rel:!0});var p2=i(hn);hv=n(p2,"torch.nn.Module"),p2.forEach(t),uv=n(jc,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),jc.forEach(t),mv=d(so),ke=r(so,"DIV",{class:!0});var ao=i(ke);M(un.$$.fragment,ao),fv=d(ao),ot=r(ao,"P",{});var Vs=i(ot);gv=n(Vs,"The "),zs=r(Vs,"A",{href:!0});var h2=i(zs);_v=n(h2,"MarkupLMForSequenceClassification"),h2.forEach(t),kv=n(Vs," forward method, overrides the "),Nl=r(Vs,"CODE",{});var u2=i(Nl);Mv=n(u2,"__call__"),u2.forEach(t),vv=n(Vs," special method."),Vs.forEach(t),bv=d(ao),M(Wt.$$.fragment,ao),yv=d(ao),M(Ot.$$.fragment,ao),ao.forEach(t),so.forEach(t),lc=d(s),nt=r(s,"H2",{class:!0});var Fc=i(nt);Vt=r(Fc,"A",{id:!0,class:!0,href:!0});var m2=i(Vt);Rl=r(m2,"SPAN",{});var f2=i(Rl);M(mn.$$.fragment,f2),f2.forEach(t),m2.forEach(t),Tv=d(Fc),Zl=r(Fc,"SPAN",{});var g2=i(Zl);wv=n(g2,"MarkupLMForTokenClassification"),g2.forEach(t),Fc.forEach(t),dc=d(s),Le=r(s,"DIV",{class:!0});var Qs=i(Le);M(fn.$$.fragment,Qs),Ev=d(Qs),st=r(Qs,"P",{});var Xs=i(st);xv=n(Xs,"MarkupLM Model with a "),Bl=r(Xs,"CODE",{});var _2=i(Bl);Lv=n(_2,"token_classification"),_2.forEach(t),qv=n(Xs,` head on top.
This model is a PyTorch `),gn=r(Xs,"A",{href:!0,rel:!0});var k2=i(gn);$v=n(k2,"torch.nn.Module"),k2.forEach(t),Uv=n(Xs,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Xs.forEach(t),zv=d(Qs),Me=r(Qs,"DIV",{class:!0});var ro=i(Me);M(_n.$$.fragment,ro),Jv=d(ro),at=r(ro,"P",{});var Hs=i(at);Cv=n(Hs,"The "),Js=r(Hs,"A",{href:!0});var M2=i(Js);jv=n(M2,"MarkupLMForTokenClassification"),M2.forEach(t),Fv=n(Hs," forward method, overrides the "),Dl=r(Hs,"CODE",{});var v2=i(Dl);Iv=n(v2,"__call__"),v2.forEach(t),Nv=n(Hs," special method."),Hs.forEach(t),Rv=d(ro),M(Qt.$$.fragment,ro),Zv=d(ro),M(Xt.$$.fragment,ro),ro.forEach(t),Qs.forEach(t),cc=d(s),rt=r(s,"H2",{class:!0});var Ic=i(rt);Ht=r(Ic,"A",{id:!0,class:!0,href:!0});var b2=i(Ht);Al=r(b2,"SPAN",{});var y2=i(Al);M(kn.$$.fragment,y2),y2.forEach(t),b2.forEach(t),Bv=d(Ic),Gl=r(Ic,"SPAN",{});var T2=i(Gl);Dv=n(T2,"MarkupLMForQuestionAnswering"),T2.forEach(t),Ic.forEach(t),pc=d(s),ue=r(s,"DIV",{class:!0});var io=i(ue);M(Mn.$$.fragment,io),Av=d(io),it=r(io,"P",{});var Ys=i(it);Gv=n(Ys,`MarkupLM 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 `),Pl=r(Ys,"CODE",{});var w2=i(Pl);Pv=n(w2,"span start logits"),w2.forEach(t),Sv=n(Ys," and "),Sl=r(Ys,"CODE",{});var E2=i(Sl);Wv=n(E2,"span end logits"),E2.forEach(t),Ov=n(Ys,")."),Ys.forEach(t),Vv=d(io),vn=r(io,"P",{});var Nc=i(vn);Qv=n(Nc,"This model is a PyTorch "),bn=r(Nc,"A",{href:!0,rel:!0});var x2=i(bn);Xv=n(x2,"torch.nn.Module"),x2.forEach(t),Hv=n(Nc,` sub-class. Use
it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
behavior.`),Nc.forEach(t),Yv=d(io),ve=r(io,"DIV",{class:!0});var lo=i(ve);M(yn.$$.fragment,lo),Kv=d(lo),lt=r(lo,"P",{});var Ks=i(lt);eb=n(Ks,"The "),Cs=r(Ks,"A",{href:!0});var L2=i(Cs);tb=n(L2,"MarkupLMForQuestionAnswering"),L2.forEach(t),ob=n(Ks," forward method, overrides the "),Wl=r(Ks,"CODE",{});var q2=i(Wl);nb=n(q2,"__call__"),q2.forEach(t),sb=n(Ks," special method."),Ks.forEach(t),ab=d(lo),M(Yt.$$.fragment,lo),rb=d(lo),M(Kt.$$.fragment,lo),lo.forEach(t),io.forEach(t),this.h()},h(){c(m,"name","hf:doc:metadata"),c(m,"content",JSON.stringify(W2)),c(g,"id","markuplm"),c(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"),c(g,"href","#markuplm"),c(_,"class","relative group"),c(ht,"id","overview"),c(ht,"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"),c(ht,"href","#overview"),c(De,"class","relative group"),c(po,"href","https://arxiv.org/abs/2110.08518"),c(po,"rel","nofollow"),c(Ln,"href","layoutlm"),c(ho,"href","https://x-lance.github.io/WebSRC/"),c(ho,"rel","nofollow"),c(uo,"href","https://www.researchgate.net/publication/221299838_From_one_tree_to_a_forest_a_unified_solution_for_structured_web_data_extraction"),c(uo,"rel","nofollow"),c(jn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMModel.forward"),c(Fn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMProcessor"),c(In,"href","#usage-markuplmprocessor"),c(fo,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/MarkupLM"),c(fo,"rel","nofollow"),C2(mt.src,gb="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/markuplm_architecture.jpg")||c(mt,"src",gb),c(mt,"alt","drawing"),c(mt,"width","600"),c(Nn,"href","https://arxiv.org/abs/2110.08518"),c(_o,"href","https://huggingface.co/nielsr"),c(_o,"rel","nofollow"),c(ko,"href","https://github.com/microsoft/unilm/tree/master/markuplm"),c(ko,"rel","nofollow"),c(ft,"id","usage-markuplmprocessor"),c(ft,"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"),c(ft,"href","#usage-markuplmprocessor"),c(Ge,"class","relative group"),c(Rn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMProcessor"),c(Zn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMFeatureExtractor"),c(Bn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizer"),c(Dn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizerFast"),c(An,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMProcessor"),c(Gn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMFeatureExtractor"),c(Pn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizer"),c(Sn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizerFast"),c(Wn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMFeatureExtractor"),c(bo,"href","https://www.crummy.com/software/BeautifulSoup/bs4/doc/"),c(bo,"rel","nofollow"),c(On,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizer"),c(Vn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizerFast"),c(wo,"href","https://paperswithcode.com/dataset/swde"),c(wo,"rel","nofollow"),c(gt,"id","documentation-resources"),c(gt,"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"),c(gt,"href","#documentation-resources"),c(Pe,"class","relative group"),c(ns,"href","../tasks/sequence_classification"),c(ss,"href","../tasks/token_classification"),c(as,"href","../tasks/question_answering"),c(_t,"id","transformers.MarkupLMConfig"),c(_t,"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"),c(_t,"href","#transformers.MarkupLMConfig"),c(Se,"class","relative group"),c(rs,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMModel"),c(zo,"href","https://huggingface.co/microsoft/markuplm-base"),c(zo,"rel","nofollow"),c(is,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"),c(ls,"href","/docs/transformers/v4.31.0/en/model_doc/bert#transformers.BertConfig"),c(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Mt,"id","transformers.MarkupLMFeatureExtractor"),c(Mt,"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"),c(Mt,"href","#transformers.MarkupLMFeatureExtractor"),c(Ve,"class","relative group"),c(je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(bt,"id","transformers.MarkupLMTokenizer"),c(bt,"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"),c(bt,"href","#transformers.MarkupLMTokenizer"),c(Qe,"class","relative group"),c(ds,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizer"),c(cs,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(Fe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(us,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ms,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Tt,"id","transformers.MarkupLMTokenizerFast"),c(Tt,"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"),c(Tt,"href","#transformers.MarkupLMTokenizerFast"),c(Xe,"class","relative group"),c(fs,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizerFast"),c(gs,"href","/docs/transformers/v4.31.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(_s,"href","/docs/transformers/v4.31.0/en/internal/file_utils#transformers.utils.PaddingStrategy"),c(ks,"href","/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy"),c(Ms,"href","/docs/transformers/v4.31.0/en/internal/file_utils#transformers.TensorType"),c(vs,"href","/docs/transformers/v4.31.0/en/internal/file_utils#transformers.utils.PaddingStrategy"),c(bs,"href","/docs/transformers/v4.31.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy"),c(ys,"href","/docs/transformers/v4.31.0/en/internal/file_utils#transformers.TensorType"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Re,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Zt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Dt,"id","transformers.MarkupLMProcessor"),c(Dt,"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"),c(Dt,"href","#transformers.MarkupLMProcessor"),c(Ye,"class","relative group"),c(xs,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMProcessor"),c(Ls,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMFeatureExtractor"),c(qs,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizer"),c($s,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMTokenizerFast"),c(tn,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMFeatureExtractor.__call__"),c(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(At,"id","transformers.MarkupLMModel"),c(At,"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"),c(At,"href","#transformers.MarkupLMModel"),c(Ke,"class","relative group"),c(rn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(rn,"rel","nofollow"),c(Us,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMModel"),c(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(St,"id","transformers.MarkupLMForSequenceClassification"),c(St,"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"),c(St,"href","#transformers.MarkupLMForSequenceClassification"),c(tt,"class","relative group"),c(hn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(hn,"rel","nofollow"),c(zs,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMForSequenceClassification"),c(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Vt,"id","transformers.MarkupLMForTokenClassification"),c(Vt,"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"),c(Vt,"href","#transformers.MarkupLMForTokenClassification"),c(nt,"class","relative group"),c(gn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(gn,"rel","nofollow"),c(Js,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMForTokenClassification"),c(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ht,"id","transformers.MarkupLMForQuestionAnswering"),c(Ht,"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"),c(Ht,"href","#transformers.MarkupLMForQuestionAnswering"),c(rt,"class","relative group"),c(bn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(bn,"rel","nofollow"),c(Cs,"href","/docs/transformers/v4.31.0/en/model_doc/markuplm#transformers.MarkupLMForQuestionAnswering"),c(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(s,p){e(document.head,m),u(s,E,p),u(s,_,p),e(_,g),e(g,w),v(h,w,null),e(_,f),e(_,Q),e(Q,Zc),u(s,md,p),u(s,De,p),e(De,ht),e(ht,oa),v(co,oa,null),e(De,Bc),e(De,na),e(na,Dc),u(s,fd,p),u(s,qe,p),e(qe,Ac),e(qe,po),e(po,Gc),e(qe,Pc),e(qe,Ln),e(Ln,Sc),e(qe,Wc),u(s,gd,p),u(s,qn,p),e(qn,Oc),u(s,_d,p),u(s,ut,p),e(ut,$n),e($n,ho),e(ho,Vc),e($n,Qc),e(ut,Xc),e(ut,Un),e(Un,uo),e(uo,Hc),e(Un,Yc),u(s,kd,p),u(s,zn,p),e(zn,Kc),u(s,Md,p),u(s,Jn,p),e(Jn,sa),e(sa,ep),u(s,vd,p),u(s,Cn,p),e(Cn,tp),u(s,bd,p),u(s,$e,p),e($e,le),e(le,op),e(le,aa),e(aa,np),e(le,sp),e(le,jn),e(jn,ap),e(le,rp),e(le,ra),e(ra,ip),e(le,lp),e(le,ia),e(ia,dp),e(le,cp),e($e,pp),e($e,Ae),e(Ae,hp),e(Ae,Fn),e(Fn,up),e(Ae,mp),e(Ae,In),e(In,fp),e(Ae,gp),e($e,_p),e($e,mo),e(mo,kp),e(mo,fo),e(fo,Mp),e(mo,vp),u(s,yd,p),u(s,mt,p),u(s,Td,p),u(s,go,p),e(go,bp),e(go,Nn),e(Nn,yp),u(s,wd,p),u(s,Ue,p),e(Ue,Tp),e(Ue,_o),e(_o,wp),e(Ue,Ep),e(Ue,ko),e(ko,xp),e(Ue,Lp),u(s,Ed,p),u(s,Ge,p),e(Ge,ft),e(ft,la),v(Mo,la,null),e(Ge,qp),e(Ge,da),e(da,$p),u(s,xd,p),u(s,Y,p),e(Y,Up),e(Y,Rn),e(Rn,zp),e(Y,Jp),e(Y,Zn),e(Zn,Cp),e(Y,jp),e(Y,Bn),e(Bn,Fp),e(Y,Ip),e(Y,Dn),e(Dn,Np),e(Y,Rp),e(Y,ca),e(ca,Zp),e(Y,Bp),u(s,Ld,p),v(vo,s,p),u(s,qd,p),u(s,U,p),e(U,Dp),e(U,An),e(An,Ap),e(U,Gp),e(U,Gn),e(Gn,Pp),e(U,Sp),e(U,Pn),e(Pn,Wp),e(U,Op),e(U,Sn),e(Sn,Vp),e(U,Qp),e(U,pa),e(pa,Xp),e(U,Hp),e(U,ha),e(ha,Yp),e(U,Kp),e(U,ua),e(ua,eh),e(U,th),e(U,ma),e(ma,oh),e(U,nh),e(U,fa),e(fa,sh),e(U,ah),e(U,ga),e(ga,rh),e(U,ih),u(s,$d,p),u(s,de,p),e(de,Wn),e(Wn,lh),e(de,dh),e(de,bo),e(bo,ch),e(de,ph),e(de,On),e(On,hh),e(de,uh),e(de,Vn),e(Vn,mh),e(de,fh),u(s,Ud,p),u(s,Qn,p),e(Qn,gh),u(s,zd,p),u(s,Xn,p),e(Xn,_a),e(_a,_h),u(s,Jd,p),u(s,Hn,p),e(Hn,kh),u(s,Cd,p),v(yo,s,p),u(s,jd,p),u(s,Yn,p),e(Yn,ka),e(ka,Mh),u(s,Fd,p),u(s,ze,p),e(ze,vh),e(ze,Ma),e(Ma,bh),e(ze,yh),e(ze,va),e(va,Th),e(ze,wh),u(s,Id,p),v(To,s,p),u(s,Nd,p),u(s,Kn,p),e(Kn,ba),e(ba,Eh),u(s,Rd,p),u(s,K,p),e(K,xh),e(K,wo),e(wo,Lh),e(K,qh),e(K,ya),e(ya,$h),e(K,Uh),e(K,Ta),e(Ta,zh),e(K,Jh),e(K,wa),e(wa,Ch),e(K,jh),e(K,Ea),e(Ea,Fh),e(K,Ih),u(s,Zd,p),v(Eo,s,p),u(s,Bd,p),u(s,es,p),e(es,xa),e(xa,Nh),u(s,Dd,p),u(s,ts,p),e(ts,Rh),u(s,Ad,p),v(xo,s,p),u(s,Gd,p),u(s,os,p),e(os,La),e(La,Zh),u(s,Pd,p),u(s,Je,p),e(Je,Bh),e(Je,qa),e(qa,Dh),e(Je,Ah),e(Je,$a),e($a,Gh),e(Je,Ph),u(s,Sd,p),v(Lo,s,p),u(s,Wd,p),u(s,Pe,p),e(Pe,gt),e(gt,Ua),v(qo,Ua,null),e(Pe,Sh),e(Pe,za),e(za,Wh),u(s,Od,p),u(s,Ce,p),e(Ce,Ja),e(Ja,ns),e(ns,Oh),e(Ce,Vh),e(Ce,Ca),e(Ca,ss),e(ss,Qh),e(Ce,Xh),e(Ce,ja),e(ja,as),e(as,Hh),u(s,Vd,p),u(s,Se,p),e(Se,_t),e(_t,Fa),v($o,Fa,null),e(Se,Yh),e(Se,Ia),e(Ia,Kh),u(s,Qd,p),u(s,ce,p),v(Uo,ce,null),e(ce,eu),e(ce,We),e(We,tu),e(We,rs),e(rs,ou),e(We,nu),e(We,zo),e(zo,su),e(We,au),e(ce,ru),e(ce,Oe),e(Oe,iu),e(Oe,is),e(is,lu),e(Oe,du),e(Oe,ls),e(ls,cu),e(Oe,pu),e(ce,hu),v(kt,ce,null),u(s,Xd,p),u(s,Ve,p),e(Ve,Mt),e(Mt,Na),v(Jo,Na,null),e(Ve,uu),e(Ve,Ra),e(Ra,mu),u(s,Hd,p),u(s,pe,p),v(Co,pe,null),e(pe,fu),e(pe,Za),e(Za,gu),e(pe,_u),e(pe,jo),e(jo,ku),e(jo,Ba),e(Ba,Mu),e(jo,vu),e(pe,bu),e(pe,je),v(Fo,je,null),e(je,yu),e(je,Da),e(Da,Tu),e(je,wu),v(vt,je,null),u(s,Yd,p),u(s,Qe,p),e(Qe,bt),e(bt,Aa),v(Io,Aa,null),e(Qe,Eu),e(Qe,Ga),e(Ga,xu),u(s,Kd,p),u(s,X,p),v(No,X,null),e(X,Lu),e(X,B),e(B,qu),e(B,ds),e(ds,$u),e(B,Uu),e(B,Pa),e(Pa,zu),e(B,Ju),e(B,Sa),e(Sa,Cu),e(B,ju),e(B,Wa),e(Wa,Fu),e(B,Iu),e(B,Oa),e(Oa,Nu),e(B,Ru),e(B,Va),e(Va,Zu),e(B,Bu),e(B,cs),e(cs,Du),e(B,Au),e(X,Gu),e(X,Fe),v(Ro,Fe,null),e(Fe,Pu),e(Fe,Qa),e(Qa,Su),e(Fe,Wu),e(Fe,Zo),e(Zo,ps),e(ps,Ou),e(ps,Xa),e(Xa,Vu),e(Zo,Qu),e(Zo,hs),e(hs,Xu),e(hs,Ha),e(Ha,Hu),e(X,Yu),e(X,us),v(Bo,us,null),e(X,Ku),e(X,yt),v(Do,yt,null),e(yt,em),e(yt,Ya),e(Ya,tm),e(X,om),e(X,ms),v(Ao,ms,null),u(s,ec,p),u(s,Xe,p),e(Xe,Tt),e(Tt,Ka),v(Go,Ka,null),e(Xe,nm),e(Xe,er),e(er,sm),u(s,tc,p),u(s,J,p),v(Po,J,null),e(J,am),e(J,tr),e(tr,rm),e(J,im),e(J,D),e(D,fs),e(fs,lm),e(D,dm),e(D,or),e(or,cm),e(D,pm),e(D,nr),e(nr,hm),e(D,um),e(D,sr),e(sr,mm),e(D,fm),e(D,ar),e(ar,gm),e(D,_m),e(D,rr),e(rr,km),e(D,Mm),e(D,gs),e(gs,vm),e(D,bm),e(J,ym),e(J,ir),e(ir,Tm),e(J,wm),e(J,A),v(So,A,null),e(A,Em),e(A,I),e(I,xm),e(I,lr),e(lr,Lm),e(I,qm),e(I,dr),e(dr,$m),e(I,Um),e(I,cr),e(cr,zm),e(I,Jm),e(I,pr),e(pr,Cm),e(I,jm),e(I,hr),e(hr,Fm),e(I,Im),e(I,_s),e(_s,Nm),e(I,Rm),e(I,ur),e(ur,Zm),e(I,Bm),e(I,mr),e(mr,Dm),e(I,Am),e(A,Gm),e(A,H),e(H,fr),e(fr,wt),e(wt,gr),e(gr,Pm),e(wt,Sm),e(wt,_r),e(_r,Wm),e(wt,Om),e(H,Vm),e(H,kr),e(kr,Et),e(Et,Mr),e(Mr,Qm),e(Et,Xm),e(Et,vr),e(vr,Hm),e(Et,Ym),e(H,Km),e(H,br),e(br,G),e(G,yr),e(yr,ef),e(G,tf),e(G,Tr),e(Tr,of),e(G,nf),e(G,wr),e(wr,sf),e(G,af),e(G,Er),e(Er,rf),e(G,lf),e(G,ks),e(ks,df),e(G,cf),e(G,xr),e(xr,pf),e(G,hf),e(G,Lr),e(Lr,uf),e(G,mf),e(H,ff),e(H,qr),e(qr,Ie),e(Ie,$r),e($r,gf),e(Ie,_f),e(Ie,Ur),e(Ur,kf),e(Ie,Mf),e(Ie,zr),e(zr,vf),e(Ie,bf),e(H,yf),e(H,Jr),e(Jr,xt),e(xt,Cr),e(Cr,Tf),e(xt,wf),e(xt,jr),e(jr,Ef),e(xt,xf),e(H,Lf),e(H,Fr),e(Fr,Lt),e(Lt,Ir),e(Ir,qf),e(Lt,$f),e(Lt,Nr),e(Nr,Uf),e(Lt,zf),e(H,Jf),e(H,Rr),e(Rr,fe),e(fe,Zr),e(Zr,Cf),e(fe,jf),e(fe,Br),e(Br,Ff),e(fe,If),e(fe,Dr),e(Dr,Nf),e(fe,Rf),e(fe,Ar),e(Ar,Zf),e(fe,Bf),e(A,Df),e(A,x),e(x,Af),e(x,Gr),e(Gr,Gf),e(x,Pf),e(x,Pr),e(Pr,Sf),e(x,Wf),e(x,Sr),e(Sr,Of),e(x,Vf),e(x,Wr),e(Wr,Qf),e(x,Xf),e(x,Or),e(Or,Hf),e(x,Yf),e(x,Vr),e(Vr,Kf),e(x,eg),e(x,Qr),e(Qr,tg),e(x,og),e(x,Xr),e(Xr,ng),e(x,sg),e(x,Hr),e(Hr,ag),e(x,rg),e(x,Yr),e(Yr,ig),e(x,lg),e(x,Kr),e(Kr,dg),e(x,cg),e(x,ei),e(ei,pg),e(x,hg),e(x,ti),e(ti,ug),e(x,mg),e(x,oi),e(oi,fg),e(x,gg),e(x,Ms),e(Ms,_g),e(x,kg),e(x,ni),e(ni,Mg),e(x,vg),e(A,bg),e(A,He),e(He,qt),e(qt,si),e(si,yg),e(qt,Tg),e(qt,ai),e(ai,wg),e(qt,Eg),e(He,xg),e(He,$t),e($t,ri),e(ri,Lg),e($t,qg),e($t,ii),e(ii,$g),e($t,Ug),e(He,zg),e(He,Ut),e(Ut,li),e(li,Jg),e(Ut,Cg),e(Ut,di),e(di,jg),e(Ut,Fg),e(A,Ig),e(A,N),e(N,Ng),e(N,ci),e(ci,Rg),e(N,Zg),e(N,pi),e(pi,Bg),e(N,Dg),e(N,hi),e(hi,Ag),e(N,Gg),e(N,ui),e(ui,Pg),e(N,Sg),e(N,mi),e(mi,Wg),e(N,Og),e(N,vs),e(vs,Vg),e(N,Qg),e(N,fi),e(fi,Xg),e(N,Hg),e(N,gi),e(gi,Yg),e(N,Kg),e(A,e_),e(A,C),e(C,_i),e(_i,zt),e(zt,ki),e(ki,t_),e(zt,o_),e(zt,Mi),e(Mi,n_),e(zt,s_),e(C,a_),e(C,vi),e(vi,Jt),e(Jt,bi),e(bi,r_),e(Jt,i_),e(Jt,yi),e(yi,l_),e(Jt,d_),e(C,c_),e(C,Ti),e(Ti,P),e(P,wi),e(wi,p_),e(P,h_),e(P,Ei),e(Ei,u_),e(P,m_),e(P,xi),e(xi,f_),e(P,g_),e(P,Li),e(Li,__),e(P,k_),e(P,bs),e(bs,M_),e(P,v_),e(P,qi),e(qi,b_),e(P,y_),e(P,$i),e($i,T_),e(P,w_),e(C,E_),e(C,Ui),e(Ui,Ne),e(Ne,zi),e(zi,x_),e(Ne,L_),e(Ne,Ji),e(Ji,q_),e(Ne,$_),e(Ne,Ci),e(Ci,U_),e(Ne,z_),e(C,J_),e(C,ji),e(ji,Ct),e(Ct,Fi),e(Fi,C_),e(Ct,j_),e(Ct,Ii),e(Ii,F_),e(Ct,I_),e(C,N_),e(C,Ni),e(Ni,jt),e(jt,Ri),e(Ri,R_),e(jt,Z_),e(jt,Zi),e(Zi,B_),e(jt,D_),e(C,A_),e(C,Bi),e(Bi,L),e(L,Di),e(Di,G_),e(L,P_),e(L,Ai),e(Ai,S_),e(L,W_),e(L,Gi),e(Gi,O_),e(L,V_),e(L,Pi),e(Pi,Q_),e(L,X_),e(L,Si),e(Si,H_),e(L,Y_),e(L,Wi),e(Wi,K_),e(L,ek),e(L,Oi),e(Oi,tk),e(L,ok),e(L,Vi),e(Vi,nk),e(L,sk),e(L,Qi),e(Qi,ak),e(L,rk),e(L,Xi),e(Xi,ik),e(L,lk),e(L,Hi),e(Hi,dk),e(L,ck),e(L,Yi),e(Yi,pk),e(L,hk),e(L,Ki),e(Ki,uk),e(L,mk),e(L,ys),e(ys,fk),e(L,gk),e(L,el),e(el,_k),e(L,kk),e(C,Mk),e(C,tl),e(tl,Ft),e(Ft,ol),e(ol,vk),e(Ft,bk),e(Ft,nl),e(nl,yk),e(Ft,Tk),e(C,wk),e(C,sl),e(sl,It),e(It,al),e(al,Ek),e(It,xk),e(It,rl),e(rl,Lk),e(It,qk),e(C,$k),e(C,il),e(il,Nt),e(Nt,ll),e(ll,Uk),e(Nt,zk),e(Nt,dl),e(dl,Jk),e(Nt,Ck),e(J,jk),e(J,Re),v(Wo,Re,null),e(Re,Fk),e(Re,cl),e(cl,Ik),e(Re,Nk),e(Re,Oo),e(Oo,Ts),e(Ts,Rk),e(Ts,pl),e(pl,Zk),e(Oo,Bk),e(Oo,ws),e(ws,Dk),e(ws,hl),e(hl,Ak),e(J,Gk),e(J,Rt),v(Vo,Rt,null),e(Rt,Pk),e(Rt,ul),e(ul,Sk),e(J,Wk),e(J,Zt),v(Qo,Zt,null),e(Zt,Ok),e(Zt,Xo),e(Xo,Vk),e(Xo,ml),e(ml,Qk),e(Xo,Xk),e(J,Hk),e(J,Bt),v(Ho,Bt,null),e(Bt,Yk),e(Bt,fl),e(fl,Kk),u(s,oc,p),u(s,Ye,p),e(Ye,Dt),e(Dt,gl),v(Yo,gl,null),e(Ye,eM),e(Ye,_l),e(_l,tM),u(s,nc,p),u(s,te,p),v(Ko,te,null),e(te,oM),e(te,kl),e(kl,nM),e(te,sM),e(te,Es),e(Es,xs),e(xs,aM),e(Es,rM),e(te,iM),e(te,R),e(R,lM),e(R,Ls),e(Ls,dM),e(R,cM),e(R,qs),e(qs,pM),e(R,hM),e(R,$s),e($s,uM),e(R,mM),e(R,Ml),e(Ml,fM),e(R,gM),e(R,vl),e(vl,_M),e(R,kM),e(R,bl),e(bl,MM),e(R,vM),e(R,yl),e(yl,bM),e(R,yM),e(R,Tl),e(Tl,TM),e(R,wM),e(te,EM),e(te,ge),v(en,ge,null),e(ge,xM),e(ge,oe),e(oe,LM),e(oe,wl),e(wl,qM),e(oe,$M),e(oe,tn),e(tn,El),e(El,UM),e(tn,zM),e(oe,JM),e(oe,xl),e(xl,CM),e(oe,jM),e(oe,Ll),e(Ll,FM),e(oe,IM),e(oe,ql),e(ql,NM),e(oe,RM),e(ge,ZM),e(ge,on),e(on,BM),e(on,$l),e($l,DM),e(on,AM),e(ge,GM),e(ge,Ul),e(Ul,PM),u(s,sc,p),u(s,Ke,p),e(Ke,At),e(At,zl),v(nn,zl,null),e(Ke,SM),e(Ke,Jl),e(Jl,WM),u(s,ac,p),u(s,xe,p),v(sn,xe,null),e(xe,OM),e(xe,an),e(an,VM),e(an,rn),e(rn,QM),e(an,XM),e(xe,HM),e(xe,_e),v(ln,_e,null),e(_e,YM),e(_e,et),e(et,KM),e(et,Us),e(Us,ev),e(et,tv),e(et,Cl),e(Cl,ov),e(et,nv),e(_e,sv),v(Gt,_e,null),e(_e,av),v(Pt,_e,null),u(s,rc,p),u(s,tt,p),e(tt,St),e(St,jl),v(dn,jl,null),e(tt,rv),e(tt,Fl),e(Fl,iv),u(s,ic,p),u(s,he,p),v(cn,he,null),e(he,lv),e(he,Il),e(Il,dv),e(he,cv),e(he,pn),e(pn,pv),e(pn,hn),e(hn,hv),e(pn,uv),e(he,mv),e(he,ke),v(un,ke,null),e(ke,fv),e(ke,ot),e(ot,gv),e(ot,zs),e(zs,_v),e(ot,kv),e(ot,Nl),e(Nl,Mv),e(ot,vv),e(ke,bv),v(Wt,ke,null),e(ke,yv),v(Ot,ke,null),u(s,lc,p),u(s,nt,p),e(nt,Vt),e(Vt,Rl),v(mn,Rl,null),e(nt,Tv),e(nt,Zl),e(Zl,wv),u(s,dc,p),u(s,Le,p),v(fn,Le,null),e(Le,Ev),e(Le,st),e(st,xv),e(st,Bl),e(Bl,Lv),e(st,qv),e(st,gn),e(gn,$v),e(st,Uv),e(Le,zv),e(Le,Me),v(_n,Me,null),e(Me,Jv),e(Me,at),e(at,Cv),e(at,Js),e(Js,jv),e(at,Fv),e(at,Dl),e(Dl,Iv),e(at,Nv),e(Me,Rv),v(Qt,Me,null),e(Me,Zv),v(Xt,Me,null),u(s,cc,p),u(s,rt,p),e(rt,Ht),e(Ht,Al),v(kn,Al,null),e(rt,Bv),e(rt,Gl),e(Gl,Dv),u(s,pc,p),u(s,ue,p),v(Mn,ue,null),e(ue,Av),e(ue,it),e(it,Gv),e(it,Pl),e(Pl,Pv),e(it,Sv),e(it,Sl),e(Sl,Wv),e(it,Ov),e(ue,Vv),e(ue,vn),e(vn,Qv),e(vn,bn),e(bn,Xv),e(vn,Hv),e(ue,Yv),e(ue,ve),v(yn,ve,null),e(ve,Kv),e(ve,lt),e(lt,eb),e(lt,Cs),e(Cs,tb),e(lt,ob),e(lt,Wl),e(Wl,nb),e(lt,sb),e(ve,ab),v(Yt,ve,null),e(ve,rb),v(Kt,ve,null),hc=!0},p(s,[p]){const Tn={};p&2&&(Tn.$$scope={dirty:p,ctx:s}),kt.$set(Tn);const Ol={};p&2&&(Ol.$$scope={dirty:p,ctx:s}),vt.$set(Ol);const Vl={};p&2&&(Vl.$$scope={dirty:p,ctx:s}),Gt.$set(Vl);const Ql={};p&2&&(Ql.$$scope={dirty:p,ctx:s}),Pt.$set(Ql);const wn={};p&2&&(wn.$$scope={dirty:p,ctx:s}),Wt.$set(wn);const Xl={};p&2&&(Xl.$$scope={dirty:p,ctx:s}),Ot.$set(Xl);const Hl={};p&2&&(Hl.$$scope={dirty:p,ctx:s}),Qt.$set(Hl);const Yl={};p&2&&(Yl.$$scope={dirty:p,ctx:s}),Xt.$set(Yl);const dt={};p&2&&(dt.$$scope={dirty:p,ctx:s}),Yt.$set(dt);const Kl={};p&2&&(Kl.$$scope={dirty:p,ctx:s}),Kt.$set(Kl)},i(s){hc||(b(h.$$.fragment,s),b(co.$$.fragment,s),b(Mo.$$.fragment,s),b(vo.$$.fragment,s),b(yo.$$.fragment,s),b(To.$$.fragment,s),b(Eo.$$.fragment,s),b(xo.$$.fragment,s),b(Lo.$$.fragment,s),b(qo.$$.fragment,s),b($o.$$.fragment,s),b(Uo.$$.fragment,s),b(kt.$$.fragment,s),b(Jo.$$.fragment,s),b(Co.$$.fragment,s),b(Fo.$$.fragment,s),b(vt.$$.fragment,s),b(Io.$$.fragment,s),b(No.$$.fragment,s),b(Ro.$$.fragment,s),b(Bo.$$.fragment,s),b(Do.$$.fragment,s),b(Ao.$$.fragment,s),b(Go.$$.fragment,s),b(Po.$$.fragment,s),b(So.$$.fragment,s),b(Wo.$$.fragment,s),b(Vo.$$.fragment,s),b(Qo.$$.fragment,s),b(Ho.$$.fragment,s),b(Yo.$$.fragment,s),b(Ko.$$.fragment,s),b(en.$$.fragment,s),b(nn.$$.fragment,s),b(sn.$$.fragment,s),b(ln.$$.fragment,s),b(Gt.$$.fragment,s),b(Pt.$$.fragment,s),b(dn.$$.fragment,s),b(cn.$$.fragment,s),b(un.$$.fragment,s),b(Wt.$$.fragment,s),b(Ot.$$.fragment,s),b(mn.$$.fragment,s),b(fn.$$.fragment,s),b(_n.$$.fragment,s),b(Qt.$$.fragment,s),b(Xt.$$.fragment,s),b(kn.$$.fragment,s),b(Mn.$$.fragment,s),b(yn.$$.fragment,s),b(Yt.$$.fragment,s),b(Kt.$$.fragment,s),hc=!0)},o(s){y(h.$$.fragment,s),y(co.$$.fragment,s),y(Mo.$$.fragment,s),y(vo.$$.fragment,s),y(yo.$$.fragment,s),y(To.$$.fragment,s),y(Eo.$$.fragment,s),y(xo.$$.fragment,s),y(Lo.$$.fragment,s),y(qo.$$.fragment,s),y($o.$$.fragment,s),y(Uo.$$.fragment,s),y(kt.$$.fragment,s),y(Jo.$$.fragment,s),y(Co.$$.fragment,s),y(Fo.$$.fragment,s),y(vt.$$.fragment,s),y(Io.$$.fragment,s),y(No.$$.fragment,s),y(Ro.$$.fragment,s),y(Bo.$$.fragment,s),y(Do.$$.fragment,s),y(Ao.$$.fragment,s),y(Go.$$.fragment,s),y(Po.$$.fragment,s),y(So.$$.fragment,s),y(Wo.$$.fragment,s),y(Vo.$$.fragment,s),y(Qo.$$.fragment,s),y(Ho.$$.fragment,s),y(Yo.$$.fragment,s),y(Ko.$$.fragment,s),y(en.$$.fragment,s),y(nn.$$.fragment,s),y(sn.$$.fragment,s),y(ln.$$.fragment,s),y(Gt.$$.fragment,s),y(Pt.$$.fragment,s),y(dn.$$.fragment,s),y(cn.$$.fragment,s),y(un.$$.fragment,s),y(Wt.$$.fragment,s),y(Ot.$$.fragment,s),y(mn.$$.fragment,s),y(fn.$$.fragment,s),y(_n.$$.fragment,s),y(Qt.$$.fragment,s),y(Xt.$$.fragment,s),y(kn.$$.fragment,s),y(Mn.$$.fragment,s),y(yn.$$.fragment,s),y(Yt.$$.fragment,s),y(Kt.$$.fragment,s),hc=!1},d(s){t(m),s&&t(E),s&&t(_),T(h),s&&t(md),s&&t(De),T(co),s&&t(fd),s&&t(qe),s&&t(gd),s&&t(qn),s&&t(_d),s&&t(ut),s&&t(kd),s&&t(zn),s&&t(Md),s&&t(Jn),s&&t(vd),s&&t(Cn),s&&t(bd),s&&t($e),s&&t(yd),s&&t(mt),s&&t(Td),s&&t(go),s&&t(wd),s&&t(Ue),s&&t(Ed),s&&t(Ge),T(Mo),s&&t(xd),s&&t(Y),s&&t(Ld),T(vo,s),s&&t(qd),s&&t(U),s&&t($d),s&&t(de),s&&t(Ud),s&&t(Qn),s&&t(zd),s&&t(Xn),s&&t(Jd),s&&t(Hn),s&&t(Cd),T(yo,s),s&&t(jd),s&&t(Yn),s&&t(Fd),s&&t(ze),s&&t(Id),T(To,s),s&&t(Nd),s&&t(Kn),s&&t(Rd),s&&t(K),s&&t(Zd),T(Eo,s),s&&t(Bd),s&&t(es),s&&t(Dd),s&&t(ts),s&&t(Ad),T(xo,s),s&&t(Gd),s&&t(os),s&&t(Pd),s&&t(Je),s&&t(Sd),T(Lo,s),s&&t(Wd),s&&t(Pe),T(qo),s&&t(Od),s&&t(Ce),s&&t(Vd),s&&t(Se),T($o),s&&t(Qd),s&&t(ce),T(Uo),T(kt),s&&t(Xd),s&&t(Ve),T(Jo),s&&t(Hd),s&&t(pe),T(Co),T(Fo),T(vt),s&&t(Yd),s&&t(Qe),T(Io),s&&t(Kd),s&&t(X),T(No),T(Ro),T(Bo),T(Do),T(Ao),s&&t(ec),s&&t(Xe),T(Go),s&&t(tc),s&&t(J),T(Po),T(So),T(Wo),T(Vo),T(Qo),T(Ho),s&&t(oc),s&&t(Ye),T(Yo),s&&t(nc),s&&t(te),T(Ko),T(en),s&&t(sc),s&&t(Ke),T(nn),s&&t(ac),s&&t(xe),T(sn),T(ln),T(Gt),T(Pt),s&&t(rc),s&&t(tt),T(dn),s&&t(ic),s&&t(he),T(cn),T(un),T(Wt),T(Ot),s&&t(lc),s&&t(nt),T(mn),s&&t(dc),s&&t(Le),T(fn),T(_n),T(Qt),T(Xt),s&&t(cc),s&&t(rt),T(kn),s&&t(pc),s&&t(ue),T(Mn),T(yn),T(Yt),T(Kt)}}}const W2={local:"markuplm",sections:[{local:"overview",title:"Overview"},{local:"usage-markuplmprocessor",title:"Usage: MarkupLMProcessor"},{local:"documentation-resources",title:"Documentation resources"},{local:"transformers.MarkupLMConfig",title:"MarkupLMConfig"},{local:"transformers.MarkupLMFeatureExtractor",title:"MarkupLMFeatureExtractor"},{local:"transformers.MarkupLMTokenizer",title:"MarkupLMTokenizer"},{local:"transformers.MarkupLMTokenizerFast",title:"MarkupLMTokenizerFast"},{local:"transformers.MarkupLMProcessor",title:"MarkupLMProcessor"},{local:"transformers.MarkupLMModel",title:"MarkupLMModel"},{local:"transformers.MarkupLMForSequenceClassification",title:"MarkupLMForSequenceClassification"},{local:"transformers.MarkupLMForTokenClassification",title:"MarkupLMForTokenClassification"},{local:"transformers.MarkupLMForQuestionAnswering",title:"MarkupLMForQuestionAnswering"}],title:"MarkupLM"};function O2(j){return j2(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class e0 extends $2{constructor(m){super();U2(this,m,O2,S2,z2,{})}}export{e0 as default,W2 as metadata};
