import{S as bf,i as Tf,s as wf,e as a,k as h,w as b,t as o,M as vf,c as r,d as t,m as u,a as i,x as T,h as s,b as p,G as e,g as k,y as w,q as v,o as L,B as $,v as Lf,L as de}from"../../chunks/vendor-hf-doc-builder.js";import{T as we}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as ae}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as le}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function $f(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import LukeConfig, LukeModel

# Initializing a LUKE configuration
configuration = LukeConfig()

# Initializing a model from the configuration
model = LukeModel(configuration)

# Accessing the model configuration
configuration = model.config`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LukeConfig, LukeModel

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a LUKE configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>configuration = LukeConfig()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeModel(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(){d=a("p"),y=o("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Examples:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function zf(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import LukeTokenizer
tokenizer = LukeTokenizer.from_pretrained("studio-ousia/luke-base")
tokenizer("Hello world")['input_ids']
tokenizer(" Hello world")['input_ids']`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python"><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LukeTokenizer</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer = LukeTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)</span>
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot;Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[0, 31414, 232, 2]
<span class="hljs-meta">&gt;&gt;&gt;</span> <span class="language-python">tokenizer(<span class="hljs-string">&quot; Hello world&quot;</span>)[<span class="hljs-string">&#x27;input_ids&#x27;</span>]</span>
[0, 20920, 232, 2]`}}),{c(){d=a("p"),y=o("be encoded differently whether it is at the beginning of the sentence (without space) or not:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Ef(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("When used with "),f=a("code"),m=o("is_split_into_words=True"),_=o(", this tokenizer will add a space before each word (even the first one).")},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"When used with "),f=r(c,"CODE",{});var E=i(f);m=s(E,"is_split_into_words=True"),E.forEach(t),_=s(c,", this tokenizer will add a space before each word (even the first one)."),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function xf(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Ff(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import AutoTokenizer, LukeModel

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-base")
model = LukeModel.from_pretrained("studio-ousia/luke-base")

text = "Beyonc\xE9 lives in Los Angeles."
entity_spans = [(0, 7)]  # character-based entity span corresponding to "Beyonc\xE9"

encoding = tokenizer(text, entity_spans=entity_spans, add_prefix_space=True, return_tensors="pt")
outputs = model(**encoding)
word_last_hidden_state = outputs.last_hidden_state
entity_last_hidden_state = outputs.entity_last_hidden_state

text = "Beyonc\xE9 lives in Los Angeles."
entities = [
    "Beyonc\xE9",
    "Los Angeles",
]  # Wikipedia entity titles corresponding to the entity mentions "Beyonc\xE9" and "Los Angeles"
entity_spans = [
    (0, 7),
    (17, 28),
]  # character-based entity spans corresponding to "Beyonc\xE9" and "Los Angeles"

encoding = tokenizer(
    text, entities=entities, entity_spans=entity_spans, add_prefix_space=True, return_tensors="pt"
)
outputs = model(**encoding)
word_last_hidden_state = outputs.last_hidden_state
entity_last_hidden_state = outputs.entity_last_hidden_state`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeModel.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-comment"># Compute the contextualized entity representation corresponding to the entity mention &quot;Beyonc\xE9&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Beyonc\xE9 lives in Los Angeles.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = [(<span class="hljs-number">0</span>, <span class="hljs-number">7</span>)]  <span class="hljs-comment"># character-based entity span corresponding to &quot;Beyonc\xE9&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(text, entity_spans=entity_spans, add_prefix_space=<span class="hljs-literal">True</span>, 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>word_last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_last_hidden_state = outputs.entity_last_hidden_state
<span class="hljs-comment"># Input Wikipedia entities to obtain enriched contextualized representations of word tokens</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Beyonc\xE9 lives in Los Angeles.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entities = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Beyonc\xE9&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Los Angeles&quot;</span>,
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># Wikipedia entity titles corresponding to the entity mentions &quot;Beyonc\xE9&quot; and &quot;Los Angeles&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = [
<span class="hljs-meta">... </span>    (<span class="hljs-number">0</span>, <span class="hljs-number">7</span>),
<span class="hljs-meta">... </span>    (<span class="hljs-number">17</span>, <span class="hljs-number">28</span>),
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># character-based entity spans corresponding to &quot;Beyonc\xE9&quot; and &quot;Los Angeles&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer(
<span class="hljs-meta">... </span>    text, entities=entities, entity_spans=entity_spans, add_prefix_space=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**encoding)
<span class="hljs-meta">&gt;&gt;&gt; </span>word_last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_last_hidden_state = outputs.entity_last_hidden_state`}}),{c(){d=a("p"),y=o("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Examples:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function qf(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Cf(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function jf(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import AutoTokenizer, LukeForEntityClassification

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-large-finetuned-open-entity")
model = LukeForEntityClassification.from_pretrained("studio-ousia/luke-large-finetuned-open-entity")

text = "Beyonc\xE9 lives in Los Angeles."
entity_spans = [(0, 7)]  # character-based entity span corresponding to "Beyonc\xE9"
inputs = tokenizer(text, entity_spans=entity_spans, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForEntityClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-open-entity&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForEntityClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-open-entity&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Beyonc\xE9 lives in Los Angeles.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = [(<span class="hljs-number">0</span>, <span class="hljs-number">7</span>)]  <span class="hljs-comment"># character-based entity span corresponding to &quot;Beyonc\xE9&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, entity_spans=entity_spans, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])
Predicted <span class="hljs-keyword">class</span>: person`}}),{c(){d=a("p"),y=o("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Examples:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Mf(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Pf(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import AutoTokenizer, LukeForEntityPairClassification

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-large-finetuned-tacred")
model = LukeForEntityPairClassification.from_pretrained("studio-ousia/luke-large-finetuned-tacred")

text = "Beyonc\xE9 lives in Los Angeles."
entity_spans = [
    (0, 7),
    (17, 28),
]  # character-based entity spans corresponding to "Beyonc\xE9" and "Los Angeles"
inputs = tokenizer(text, entity_spans=entity_spans, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
print("Predicted class:", model.config.id2label[predicted_class_idx])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForEntityPairClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-tacred&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForEntityPairClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-tacred&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Beyonc\xE9 lives in Los Angeles.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = [
<span class="hljs-meta">... </span>    (<span class="hljs-number">0</span>, <span class="hljs-number">7</span>),
<span class="hljs-meta">... </span>    (<span class="hljs-number">17</span>, <span class="hljs-number">28</span>),
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># character-based entity spans corresponding to &quot;Beyonc\xE9&quot; and &quot;Los Angeles&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, entity_spans=entity_spans, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = logits.argmax(-<span class="hljs-number">1</span>).item()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])
Predicted <span class="hljs-keyword">class</span>: per:cities_of_residence`}}),{c(){d=a("p"),y=o("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Examples:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Af(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Sf(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import AutoTokenizer, LukeForEntitySpanClassification

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-large-finetuned-conll-2003")
model = LukeForEntitySpanClassification.from_pretrained("studio-ousia/luke-large-finetuned-conll-2003")

text = "Beyonc\xE9 lives in Los Angeles"

word_start_positions = [0, 8, 14, 17, 21]  # character-based start positions of word tokens
word_end_positions = [7, 13, 16, 20, 28]  # character-based end positions of word tokens
entity_spans = []
for i, start_pos in enumerate(word_start_positions):
    for end_pos in word_end_positions[i:]:
        entity_spans.append((start_pos, end_pos))

inputs = tokenizer(text, entity_spans=entity_spans, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class_indices = logits.argmax(-1).squeeze().tolist()
for span, predicted_class_idx in zip(entity_spans, predicted_class_indices):
    if predicted_class_idx != 0:
        print(text[span[0] : span[1]], model.config.id2label[predicted_class_idx])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForEntitySpanClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-conll-2003&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForEntitySpanClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-conll-2003&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Beyonc\xE9 lives in Los Angeles&quot;</span>
<span class="hljs-comment"># List all possible entity spans in the text</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>word_start_positions = [<span class="hljs-number">0</span>, <span class="hljs-number">8</span>, <span class="hljs-number">14</span>, <span class="hljs-number">17</span>, <span class="hljs-number">21</span>]  <span class="hljs-comment"># character-based start positions of word tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>word_end_positions = [<span class="hljs-number">7</span>, <span class="hljs-number">13</span>, <span class="hljs-number">16</span>, <span class="hljs-number">20</span>, <span class="hljs-number">28</span>]  <span class="hljs-comment"># character-based end positions of word tokens</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = []
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> i, start_pos <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(word_start_positions):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> end_pos <span class="hljs-keyword">in</span> word_end_positions[i:]:
<span class="hljs-meta">... </span>        entity_spans.append((start_pos, end_pos))

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, entity_spans=entity_spans, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_indices = logits.argmax(-<span class="hljs-number">1</span>).squeeze().tolist()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> span, predicted_class_idx <span class="hljs-keyword">in</span> <span class="hljs-built_in">zip</span>(entity_spans, predicted_class_indices):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">if</span> predicted_class_idx != <span class="hljs-number">0</span>:
<span class="hljs-meta">... </span>        <span class="hljs-built_in">print</span>(text[span[<span class="hljs-number">0</span>] : span[<span class="hljs-number">1</span>]], model.config.id2label[predicted_class_idx])
Beyonc\xE9 PER
Los Angeles LOC`}}),{c(){d=a("p"),y=o("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Examples:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Of(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function If(z){let d,y,f,m,_;return m=new ae({props:{code:`import torch
from transformers import AutoTokenizer, LukeForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-base")
model = LukeForSequenceClassification.from_pretrained("studio-ousia/luke-base")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_id = logits.argmax().item()

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = LukeForSequenceClassification.from_pretrained("studio-ousia/luke-base", num_labels=num_labels)

labels = torch.tensor([1])
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>, num_labels=num_labels)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),y=o("Example of single-label classification:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Example of single-label classification:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Nf(z){let d,y,f,m,_;return m=new ae({props:{code:`import torch
from transformers import AutoTokenizer, LukeForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-base")
model = LukeForSequenceClassification.from_pretrained("studio-ousia/luke-base", problem_type="multi_label_classification")

inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")

with torch.no_grad():
    logits = model(**inputs).logits

predicted_class_ids = torch.arange(0, logits.shape[-1])[torch.sigmoid(logits).squeeze(dim=0) > 0.5]

# To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`
num_labels = len(model.config.id2label)
model = LukeForSequenceClassification.from_pretrained(
    "studio-ousia/luke-base", num_labels=num_labels, problem_type="multi_label_classification"
)

labels = torch.sum(
    torch.nn.functional.one_hot(predicted_class_ids[None, :].clone(), num_classes=num_labels), dim=1
).to(torch.float)
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.arange(<span class="hljs-number">0</span>, logits.shape[-<span class="hljs-number">1</span>])[torch.sigmoid(logits).squeeze(dim=<span class="hljs-number">0</span>) &gt; <span class="hljs-number">0.5</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># To train a model on \`num_labels\` classes, you can pass \`num_labels=num_labels\` to \`.from_pretrained(...)\`</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>, num_labels=num_labels, problem_type=<span class="hljs-string">&quot;multi_label_classification&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.<span class="hljs-built_in">sum</span>(
<span class="hljs-meta">... </span>    torch.nn.functional.one_hot(predicted_class_ids[<span class="hljs-literal">None</span>, :].clone(), num_classes=num_labels), dim=<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>).to(torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),y=o("Example of multi-label classification:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Example of multi-label classification:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Df(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Wf(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import AutoTokenizer, LukeForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-base")
model = LukeForMultipleChoice.from_pretrained("studio-ousia/luke-base")

prompt = "In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced."
choice0 = "It is eaten with a fork and a knife."
choice1 = "It is eaten while held in the hand."
labels = torch.tensor(0).unsqueeze(0)  # choice0 is correct (according to Wikipedia ;)), batch size 1

encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors="pt", padding=True)
outputs = model(**{k: v.unsqueeze(0) for k, v in encoding.items()}, labels=labels)  # batch size is 1

# the linear classifier still needs to be trained
loss = outputs.loss
logits = outputs.logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>prompt = <span class="hljs-string">&quot;In Italy, pizza served in formal settings, such as at a restaurant, is presented unsliced.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice0 = <span class="hljs-string">&quot;It is eaten with a fork and a knife.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>choice1 = <span class="hljs-string">&quot;It is eaten while held in the hand.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(<span class="hljs-number">0</span>).unsqueeze(<span class="hljs-number">0</span>)  <span class="hljs-comment"># choice0 is correct (according to Wikipedia ;)), batch size 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;pt&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**{k: v.unsqueeze(<span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}, labels=labels)  <span class="hljs-comment"># batch size is 1</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># the linear classifier still needs to be trained</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits`}}),{c(){d=a("p"),y=o("Example:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Example:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Bf(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Uf(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import AutoTokenizer, LukeForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-base")
model = LukeForTokenClassification.from_pretrained("studio-ousia/luke-base")

inputs = tokenizer(
    "HuggingFace is a company based in Paris and New York", add_special_tokens=False, return_tensors="pt"
)

with torch.no_grad():
    logits = model(**inputs).logits

predicted_token_class_ids = logits.argmax(-1)

# Note that tokens are classified rather then input words which means that
# there might be more predicted token classes than words.
# Multiple token classes might account for the same word
predicted_tokens_classes = [model.config.id2label[t.item()] for t in predicted_token_class_ids[0]]

labels = predicted_token_class_ids
loss = model(**inputs, labels=labels).loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForTokenClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;HuggingFace is a company based in Paris and New York&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>
<span class="hljs-meta">... </span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = logits.argmax(-<span class="hljs-number">1</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Note that tokens are classified rather then input words which means that</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># there might be more predicted token classes than words.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Multiple token classes might account for the same word</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_tokens_classes = [model.config.id2label[t.item()] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>]]

<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss`}}),{c(){d=a("p"),y=o("Example:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Example:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Kf(z){let d,y,f,m,_;return{c(){d=a("p"),y=o("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=o("Module"),_=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(l){d=r(l,"P",{});var c=i(d);y=s(c,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(c,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(c,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),c.forEach(t)},m(l,c){k(l,d,c),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Hf(z){let d,y,f,m,_;return m=new ae({props:{code:`from transformers import AutoTokenizer, LukeForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("studio-ousia/luke-base")
model = LukeForQuestionAnswering.from_pretrained("studio-ousia/luke-base")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

answer_start_index = outputs.start_logits.argmax()
answer_end_index = outputs.end_logits.argmax()

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]

# target is "nice puppet"
target_start_index = torch.tensor([14])
target_end_index = torch.tensor([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = outputs.loss`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, LukeForQuestionAnswering
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>question, text = <span class="hljs-string">&quot;Who was Jim Henson?&quot;</span>, <span class="hljs-string">&quot;Jim Henson was a nice puppet&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(question, text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    outputs = model(**inputs)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predict_answer_tokens = inputs.input_ids[<span class="hljs-number">0</span>, answer_start_index : answer_end_index + <span class="hljs-number">1</span>]

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># target is &quot;nice puppet&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_start_index = torch.tensor([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = torch.tensor([<span class="hljs-number">15</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){d=a("p"),y=o("Example:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var c=i(d);y=s(c,"Example:"),c.forEach(t),f=u(l),T(m.$$.fragment,l)},m(l,c){k(l,d,c),e(d,y),k(l,f,c),w(m,l,c),_=!0},p:de,i(l){_||(v(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Rf(z){let d,y,f,m,_,l,c,E,ri,Qa,ve,Ge,gs,Bt,ii,_s,li,Va,Je,di,Ut,ci,pi,Ya,_o,hi,Ga,ko,ks,ui,Ja,yo,mi,Xa,V,ys,Kt,fi,bo,gi,_i,ki,bs,C,yi,Ts,bi,Ti,ws,wi,vi,vs,Li,$i,Ls,zi,Ei,To,xi,Fi,qi,Ht,Y,wo,Ci,ji,$s,Mi,Pi,zs,Ai,Si,Es,Oi,Ii,Ni,Rt,vo,xs,Di,Wi,Bi,Lo,Fs,Ui,Ki,Hi,H,qs,Ri,Qi,Le,Xe,$o,Vi,Yi,Qt,Gi,Ji,Xi,Ze,zo,Zi,el,Vt,tl,nl,ol,Eo,xo,sl,al,rl,U,Fo,il,ll,Cs,dl,cl,js,pl,hl,Ms,ul,ml,Ps,fl,gl,_l,$e,kl,qo,yl,bl,Yt,Tl,wl,vl,Gt,Ll,Jt,$l,zl,Za,Co,El,er,Xt,tr,G,xl,Zt,Fl,ql,en,Cl,jl,tn,Ml,Pl,nr,ze,et,As,nn,Al,Ss,Sl,or,R,on,Ol,Ee,Il,jo,Nl,Dl,sn,Wl,Bl,Ul,xe,Kl,Mo,Hl,Rl,Po,Ql,Vl,Yl,tt,sr,Fe,nt,Os,an,Gl,Is,Jl,ar,x,rn,Xl,Ns,Zl,ed,Ds,td,nd,ot,od,ln,sd,Ws,ad,rd,id,st,ld,j,dd,Ao,cd,pd,Bs,hd,ud,Us,md,fd,Ks,gd,_d,Hs,kd,yd,bd,at,dn,Td,Rs,wd,vd,So,cn,rr,qe,rt,Qs,pn,Ld,Vs,$d,ir,M,hn,zd,Ys,Ed,xd,un,Fd,Oo,qd,Cd,jd,mn,Md,fn,Pd,Ad,Sd,J,gn,Od,Ce,Id,Io,Nd,Dd,Gs,Wd,Bd,Ud,it,Kd,lt,lr,je,dt,Js,_n,Hd,Xs,Rd,dr,P,kn,Qd,Zs,Vd,Yd,yn,Gd,No,Jd,Xd,Zd,bn,ec,Tn,tc,nc,oc,ce,wn,sc,Me,ac,Do,rc,ic,ea,lc,dc,cc,ct,cr,Pe,pt,ta,vn,pc,na,hc,pr,A,Ln,uc,oa,mc,fc,$n,gc,Wo,_c,kc,yc,zn,bc,En,Tc,wc,vc,X,xn,Lc,Ae,$c,Bo,zc,Ec,sa,xc,Fc,qc,ht,Cc,ut,hr,Se,mt,aa,Fn,jc,ra,Mc,ur,S,qn,Pc,ia,Ac,Sc,Cn,Oc,Uo,Ic,Nc,Dc,jn,Wc,Mn,Bc,Uc,Kc,Z,Pn,Hc,Oe,Rc,Ko,Qc,Vc,la,Yc,Gc,Jc,ft,Xc,gt,mr,Ie,_t,da,An,Zc,ca,ep,fr,O,Sn,tp,pa,np,op,On,sp,Ho,ap,rp,ip,In,lp,Nn,dp,cp,pp,ee,Dn,hp,Ne,up,Ro,mp,fp,ha,gp,_p,kp,kt,yp,yt,gr,De,bt,ua,Wn,bp,ma,Tp,_r,I,Bn,wp,fa,vp,Lp,Un,$p,Qo,zp,Ep,xp,Kn,Fp,Hn,qp,Cp,jp,K,Rn,Mp,We,Pp,Vo,Ap,Sp,ga,Op,Ip,Np,Tt,Dp,wt,Wp,vt,kr,Be,Lt,_a,Qn,Bp,ka,Up,yr,N,Vn,Kp,ya,Hp,Rp,Yn,Qp,Yo,Vp,Yp,Gp,Gn,Jp,Jn,Xp,Zp,eh,te,Xn,th,Ue,nh,Go,oh,sh,ba,ah,rh,ih,$t,lh,zt,br,Ke,Et,Ta,Zn,dh,wa,ch,Tr,D,eo,ph,to,hh,va,uh,mh,fh,no,gh,Jo,_h,kh,yh,oo,bh,so,Th,wh,vh,ne,ao,Lh,He,$h,Xo,zh,Eh,La,xh,Fh,qh,xt,Ch,Ft,wr,Re,qt,$a,ro,jh,za,Mh,vr,W,io,Ph,Qe,Ah,Ea,Sh,Oh,xa,Ih,Nh,Dh,lo,Wh,Zo,Bh,Uh,Kh,co,Hh,po,Rh,Qh,Vh,oe,ho,Yh,Ve,Gh,es,Jh,Xh,Fa,Zh,eu,tu,Ct,nu,jt,Lr;return l=new Q({}),Bt=new Q({}),Xt=new ae({props:{code:`from transformers import LukeTokenizer, LukeModel, LukeForEntityPairClassification

model = LukeModel.from_pretrained("studio-ousia/luke-base")
tokenizer = LukeTokenizer.from_pretrained("studio-ousia/luke-base")

text = "Beyonc\xE9 lives in Los Angeles."
entity_spans = [(0, 7)]  # character-based entity span corresponding to "Beyonc\xE9"
inputs = tokenizer(text, entity_spans=entity_spans, add_prefix_space=True, return_tensors="pt")
outputs = model(**inputs)
word_last_hidden_state = outputs.last_hidden_state
entity_last_hidden_state = outputs.entity_last_hidden_state

entities = [
    "Beyonc\xE9",
    "Los Angeles",
]  # Wikipedia entity titles corresponding to the entity mentions "Beyonc\xE9" and "Los Angeles"
entity_spans = [(0, 7), (17, 28)]  # character-based entity spans corresponding to "Beyonc\xE9" and "Los Angeles"
inputs = tokenizer(text, entities=entities, entity_spans=entity_spans, add_prefix_space=True, return_tensors="pt")
outputs = model(**inputs)
word_last_hidden_state = outputs.last_hidden_state
entity_last_hidden_state = outputs.entity_last_hidden_state

model = LukeForEntityPairClassification.from_pretrained("studio-ousia/luke-large-finetuned-tacred")
tokenizer = LukeTokenizer.from_pretrained("studio-ousia/luke-large-finetuned-tacred")
entity_spans = [(0, 7), (17, 28)]  # character-based entity spans corresponding to "Beyonc\xE9" and "Los Angeles"
inputs = tokenizer(text, entity_spans=entity_spans, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = int(logits[0].argmax())
print("Predicted class:", model.config.id2label[predicted_class_idx])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LukeTokenizer, LukeModel, LukeForEntityPairClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeModel.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = LukeTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-base&quot;</span>)
<span class="hljs-comment"># Example 1: Computing the contextualized entity representation corresponding to the entity mention &quot;Beyonc\xE9&quot;</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;Beyonc\xE9 lives in Los Angeles.&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = [(<span class="hljs-number">0</span>, <span class="hljs-number">7</span>)]  <span class="hljs-comment"># character-based entity span corresponding to &quot;Beyonc\xE9&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, entity_spans=entity_spans, add_prefix_space=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>word_last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_last_hidden_state = outputs.entity_last_hidden_state
<span class="hljs-comment"># Example 2: Inputting Wikipedia entities to obtain enriched contextualized representations</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>entities = [
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Beyonc\xE9&quot;</span>,
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;Los Angeles&quot;</span>,
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># Wikipedia entity titles corresponding to the entity mentions &quot;Beyonc\xE9&quot; and &quot;Los Angeles&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = [(<span class="hljs-number">0</span>, <span class="hljs-number">7</span>), (<span class="hljs-number">17</span>, <span class="hljs-number">28</span>)]  <span class="hljs-comment"># character-based entity spans corresponding to &quot;Beyonc\xE9&quot; and &quot;Los Angeles&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, entities=entities, entity_spans=entity_spans, add_prefix_space=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>word_last_hidden_state = outputs.last_hidden_state
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_last_hidden_state = outputs.entity_last_hidden_state
<span class="hljs-comment"># Example 3: Classifying the relationship between two entities using LukeForEntityPairClassification head model</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>model = LukeForEntityPairClassification.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-tacred&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = LukeTokenizer.from_pretrained(<span class="hljs-string">&quot;studio-ousia/luke-large-finetuned-tacred&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>entity_spans = [(<span class="hljs-number">0</span>, <span class="hljs-number">7</span>), (<span class="hljs-number">17</span>, <span class="hljs-number">28</span>)]  <span class="hljs-comment"># character-based entity spans corresponding to &quot;Beyonc\xE9&quot; and &quot;Los Angeles&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, entity_spans=entity_spans, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = outputs.logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_idx = <span class="hljs-built_in">int</span>(logits[<span class="hljs-number">0</span>].argmax())
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;Predicted class:&quot;</span>, model.config.id2label[predicted_class_idx])`}}),nn=new Q({}),on=new F({props:{name:"class transformers.LukeConfig",anchor:"transformers.LukeConfig",parameters:[{name:"vocab_size",val:" = 50267"},{name:"entity_vocab_size",val:" = 500000"},{name:"hidden_size",val:" = 768"},{name:"entity_emb_size",val:" = 256"},{name:"num_hidden_layers",val:" = 12"},{name:"num_attention_heads",val:" = 12"},{name:"intermediate_size",val:" = 3072"},{name:"hidden_act",val:" = 'gelu'"},{name:"hidden_dropout_prob",val:" = 0.1"},{name:"attention_probs_dropout_prob",val:" = 0.1"},{name:"max_position_embeddings",val:" = 512"},{name:"type_vocab_size",val:" = 2"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"use_entity_aware_attention",val:" = True"},{name:"classifier_dropout",val:" = None"},{name:"pad_token_id",val:" = 1"},{name:"bos_token_id",val:" = 0"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LukeConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 30522) &#x2014;
Vocabulary size of the LUKE model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeModel">LukeModel</a>.`,name:"vocab_size"},{anchor:"transformers.LukeConfig.entity_vocab_size",description:`<strong>entity_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 500000) &#x2014;
Entity vocabulary size of the LUKE model. Defines the number of different entities that can be represented
by the <code>entity_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeModel">LukeModel</a>.`,name:"entity_vocab_size"},{anchor:"transformers.LukeConfig.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.LukeConfig.entity_emb_size",description:`<strong>entity_emb_size</strong> (<code>int</code>, <em>optional</em>, defaults to 256) &#x2014;
The number of dimensions of the entity embedding.`,name:"entity_emb_size"},{anchor:"transformers.LukeConfig.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.LukeConfig.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.LukeConfig.intermediate_size",description:`<strong>intermediate_size</strong> (<code>int</code>, <em>optional</em>, defaults to 3072) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"intermediate_size"},{anchor:"transformers.LukeConfig.hidden_act",description:`<strong>hidden_act</strong> (<code>str</code> or <code>Callable</code>, <em>optional</em>, defaults to <code>&quot;gelu&quot;</code>) &#x2014;
The non-linear activation function (function or string) in the encoder and pooler. If string, <code>&quot;gelu&quot;</code>,
<code>&quot;relu&quot;</code>, <code>&quot;silu&quot;</code> and <code>&quot;gelu_new&quot;</code> are supported.`,name:"hidden_act"},{anchor:"transformers.LukeConfig.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.LukeConfig.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.LukeConfig.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.LukeConfig.type_vocab_size",description:`<strong>type_vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 2) &#x2014;
The vocabulary size of the <code>token_type_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeModel">LukeModel</a>.`,name:"type_vocab_size"},{anchor:"transformers.LukeConfig.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.LukeConfig.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.LukeConfig.use_entity_aware_attention",description:`<strong>use_entity_aware_attention</strong> (<code>bool</code>, defaults to <code>True</code>) &#x2014;
Whether or not the model should use the entity-aware self-attention mechanism proposed in <a href="https://arxiv.org/abs/2010.01057" rel="nofollow">LUKE: Deep
Contextualized Entity Representations with Entity-aware Self-attention (Yamada et
al.)</a>.`,name:"use_entity_aware_attention"},{anchor:"transformers.LukeConfig.classifier_dropout",description:`<strong>classifier_dropout</strong> (<code>float</code>, <em>optional</em>) &#x2014;
The dropout ratio for the classification head.`,name:"classifier_dropout"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/configuration_luke.py#L29"}}),tt=new le({props:{anchor:"transformers.LukeConfig.example",$$slots:{default:[$f]},$$scope:{ctx:z}}}),an=new Q({}),rn=new F({props:{name:"class transformers.LukeTokenizer",anchor:"transformers.LukeTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"entity_vocab_file",val:""},{name:"task",val:" = None"},{name:"max_entity_length",val:" = 32"},{name:"max_mention_length",val:" = 30"},{name:"entity_token_1",val:" = '<ent>'"},{name:"entity_token_2",val:" = '<ent2>'"},{name:"entity_unk_token",val:" = '[UNK]'"},{name:"entity_pad_token",val:" = '[PAD]'"},{name:"entity_mask_token",val:" = '[MASK]'"},{name:"entity_mask2_token",val:" = '[MASK2]'"},{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:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LukeTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LukeTokenizer.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"},{anchor:"transformers.LukeTokenizer.entity_vocab_file",description:`<strong>entity_vocab_file</strong> (<code>str</code>) &#x2014;
Path to the entity vocabulary file.`,name:"entity_vocab_file"},{anchor:"transformers.LukeTokenizer.task",description:`<strong>task</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Task for which you want to prepare sequences. One of <code>&quot;entity_classification&quot;</code>,
<code>&quot;entity_pair_classification&quot;</code>, or <code>&quot;entity_span_classification&quot;</code>. If you specify this argument, the entity
sequence is automatically created based on the given entity span(s).`,name:"task"},{anchor:"transformers.LukeTokenizer.max_entity_length",description:`<strong>max_entity_length</strong> (<code>int</code>, <em>optional</em>, defaults to 32) &#x2014;
The maximum length of <code>entity_ids</code>.`,name:"max_entity_length"},{anchor:"transformers.LukeTokenizer.max_mention_length",description:`<strong>max_mention_length</strong> (<code>int</code>, <em>optional</em>, defaults to 30) &#x2014;
The maximum number of tokens inside an entity span.`,name:"max_mention_length"},{anchor:"transformers.LukeTokenizer.entity_token_1",description:`<strong>entity_token_1</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;ent&gt;</code>) &#x2014;
The special token used to represent an entity span in a word token sequence. This token is only used when
<code>task</code> is set to <code>&quot;entity_classification&quot;</code> or <code>&quot;entity_pair_classification&quot;</code>.`,name:"entity_token_1"},{anchor:"transformers.LukeTokenizer.entity_token_2",description:`<strong>entity_token_2</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&lt;ent2&gt;</code>) &#x2014;
The special token used to represent an entity span in a word token sequence. This token is only used when
<code>task</code> is set to <code>&quot;entity_pair_classification&quot;</code>.`,name:"entity_token_2"},{anchor:"transformers.LukeTokenizer.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.LukeTokenizer.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.LukeTokenizer.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.LukeTokenizer.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.LukeTokenizer.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.LukeTokenizer.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.LukeTokenizer.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.LukeTokenizer.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.LukeTokenizer.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. (LUKE tokenizer detect beginning of words by the preceding space).`,name:"add_prefix_space"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/tokenization_luke.py#L194"}}),ot=new le({props:{anchor:"transformers.LukeTokenizer.example",$$slots:{default:[zf]},$$scope:{ctx:z}}}),st=new we({props:{$$slots:{default:[Ef]},$$scope:{ctx:z}}}),dn=new F({props:{name:"__call__",anchor:"transformers.LukeTokenizer.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str]]"},{name:"text_pair",val:": typing.Union[str, typing.List[str], NoneType] = None"},{name:"entity_spans",val:": typing.Union[typing.List[typing.Tuple[int, int]], typing.List[typing.List[typing.Tuple[int, int]]], NoneType] = None"},{name:"entity_spans_pair",val:": typing.Union[typing.List[typing.Tuple[int, int]], typing.List[typing.List[typing.Tuple[int, int]]], NoneType] = None"},{name:"entities",val:": typing.Union[typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"entities_pair",val:": typing.Union[typing.List[str], typing.List[typing.List[str]], 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:"max_entity_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": typing.Optional[bool] = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[transformers.utils.generic.TensorType, str, 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.LukeTokenizer.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence must be a string. Note that this
tokenizer does not support tokenization based on pretokenized strings.`,name:"text"},{anchor:"transformers.LukeTokenizer.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence must be a string. Note that this
tokenizer does not support tokenization based on pretokenized strings.`,name:"text_pair"},{anchor:"transformers.LukeTokenizer.__call__.entity_spans",description:`<strong>entity_spans</strong> (<code>List[Tuple[int, int]]</code>, <code>List[List[Tuple[int, int]]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences of entity spans to be encoded. Each sequence consists of tuples each
with two integers denoting character-based start and end positions of entities. If you specify
<code>&quot;entity_classification&quot;</code> or <code>&quot;entity_pair_classification&quot;</code> as the <code>task</code> argument in the constructor,
the length of each sequence must be 1 or 2, respectively. If you specify <code>entities</code>, the length of each
sequence must be equal to the length of each sequence of <code>entities</code>.`,name:"entity_spans"},{anchor:"transformers.LukeTokenizer.__call__.entity_spans_pair",description:`<strong>entity_spans_pair</strong> (<code>List[Tuple[int, int]]</code>, <code>List[List[Tuple[int, int]]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences of entity spans to be encoded. Each sequence consists of tuples each
with two integers denoting character-based start and end positions of entities. If you specify the
<code>task</code> argument in the constructor, this argument is ignored. If you specify <code>entities_pair</code>, the
length of each sequence must be equal to the length of each sequence of <code>entities_pair</code>.`,name:"entity_spans_pair"},{anchor:"transformers.LukeTokenizer.__call__.entities",description:`<strong>entities</strong> (<code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences of entities to be encoded. Each sequence consists of strings
representing entities, i.e., special entities (e.g., [MASK]) or entity titles of Wikipedia (e.g., Los
Angeles). This argument is ignored if you specify the <code>task</code> argument in the constructor. The length of
each sequence must be equal to the length of each sequence of <code>entity_spans</code>. If you specify
<code>entity_spans</code> without specifying this argument, the entity sequence or the batch of entity sequences
is automatically constructed by filling it with the [MASK] entity.`,name:"entities"},{anchor:"transformers.LukeTokenizer.__call__.entities_pair",description:`<strong>entities_pair</strong> (<code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences of entities to be encoded. Each sequence consists of strings
representing entities, i.e., special entities (e.g., [MASK]) or entity titles of Wikipedia (e.g., Los
Angeles). This argument is ignored if you specify the <code>task</code> argument in the constructor. The length of
each sequence must be equal to the length of each sequence of <code>entity_spans_pair</code>. If you specify
<code>entity_spans_pair</code> without specifying this argument, the entity sequence or the batch of entity
sequences is automatically constructed by filling it with the [MASK] entity.`,name:"entities_pair"},{anchor:"transformers.LukeTokenizer.__call__.max_entity_length",description:`<strong>max_entity_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length of <code>entity_ids</code>.`,name:"max_entity_length"},{anchor:"transformers.LukeTokenizer.__call__.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.LukeTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/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.LukeTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/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.LukeTokenizer.__call__.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.LukeTokenizer.__call__.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.LukeTokenizer.__call__.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.LukeTokenizer.__call__.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.LukeTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/main/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.LukeTokenizer.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.LukeTokenizer.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.LukeTokenizer.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.LukeTokenizer.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.LukeTokenizer.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.LukeTokenizer.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.LukeTokenizer.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/tokenization_luke.py#L575",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> \u2014 List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> \u2014 List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>\u201Ctoken_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>entity_ids</strong> \u2014 List of entity ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>entity_position_ids</strong> \u2014 List of entity positions in the input sequence to be fed to a model.</p>
</li>
<li>
<p><strong>entity_token_type_ids</strong> \u2014 List of entity token type ids to be fed to a model (when
<code>return_token_type_ids=True</code> or if <em>\u201Centity_token_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>entity_attention_mask</strong> \u2014 List of indices specifying which entities should be attended to by the model
(when <code>return_attention_mask=True</code> or if <em>\u201Centity_attention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>entity_start_positions</strong> \u2014 List of the start positions of entities in the word token sequence (when
<code>task="entity_span_classification"</code>).</p>
</li>
<li>
<p><strong>entity_end_positions</strong> \u2014 List of the end positions of entities in the word token sequence (when
<code>task="entity_span_classification"</code>).</p>
</li>
<li>
<p><strong>overflowing_tokens</strong> \u2014 List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> \u2014 Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> \u2014 List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> \u2014 The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),cn=new F({props:{name:"save_vocabulary",anchor:"transformers.LukeTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/tokenization_luke.py#L1694"}}),pn=new Q({}),hn=new F({props:{name:"class transformers.LukeModel",anchor:"transformers.LukeModel",parameters:[{name:"config",val:": LukeConfig"},{name:"add_pooling_layer",val:": bool = True"}],parametersDescription:[{anchor:"transformers.LukeModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1024"}}),gn=new F({props:{name:"forward",anchor:"transformers.LukeModel.forward",parameters:[{name:"input_ids",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:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_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.LukeModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeModel.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeModel.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeModel.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.LukeModel.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeModel.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeModel.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeModel.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeModel.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeModel.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeModel.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeModel.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1056",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.BaseLukeModelOutputWithPooling</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</a>) and inputs.</p>
<ul>
<li><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.</li>
<li><strong>entity_last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length, hidden_size)</code>) \u2014 Sequence of entity hidden-states at the output of the last layer of the model.</li>
<li><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) further processed by a
Linear layer and a Tanh activation function.</li>
<li><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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity embedding outputs.</li>
<li><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 + entity_length, sequence_length + entity_length)</code>. Attentions weights after the attention softmax, used to
compute the weighted average in the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.luke.modeling_luke.BaseLukeModelOutputWithPooling</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),it=new we({props:{$$slots:{default:[xf]},$$scope:{ctx:z}}}),lt=new le({props:{anchor:"transformers.LukeModel.forward.example",$$slots:{default:[Ff]},$$scope:{ctx:z}}}),_n=new Q({}),kn=new F({props:{name:"class transformers.LukeForMaskedLM",anchor:"transformers.LukeForMaskedLM",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForMaskedLM.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1281"}}),wn=new F({props:{name:"forward",anchor:"transformers.LukeForMaskedLM.forward",parameters:[{name:"input_ids",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:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_labels",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.LukeForMaskedLM.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForMaskedLM.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForMaskedLM.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForMaskedLM.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.LukeForMaskedLM.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForMaskedLM.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForMaskedLM.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForMaskedLM.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForMaskedLM.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForMaskedLM.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForMaskedLM.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForMaskedLM.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForMaskedLM.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForMaskedLM.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"},{anchor:"transformers.LukeForMaskedLM.forward.entity_labels",description:`<strong>entity_labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the masked language modeling loss. Indices should be in <code>[-100, 0, ..., config.vocab_size]</code> (see <code>input_ids</code> docstring) Tokens with indices set to <code>-100</code> are ignored (masked), the
loss is only computed for the tokens with labels in <code>[0, ..., config.vocab_size]</code>`,name:"entity_labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1317",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.LukeMaskedLMOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</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 The sum of masked language modeling (MLM) loss and entity prediction loss.</p>
</li>
<li>
<p><strong>mlm_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>mep_loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Masked entity prediction (MEP) 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>entity_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.vocab_size)</code>) \u2014 Prediction scores of the entity prediction head (scores for each entity 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 + 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 initial embedding outputs.</p>
</li>
<li>
<p><strong>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity 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><code>transformers.models.luke.modeling_luke.LukeMaskedLMOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ct=new we({props:{$$slots:{default:[qf]},$$scope:{ctx:z}}}),vn=new Q({}),Ln=new F({props:{name:"class transformers.LukeForEntityClassification",anchor:"transformers.LukeForEntityClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForEntityClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1424"}}),xn=new F({props:{name:"forward",anchor:"transformers.LukeForEntityClassification.forward",parameters:[{name:"input_ids",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:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.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.LukeForEntityClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForEntityClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForEntityClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForEntityClassification.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.LukeForEntityClassification.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForEntityClassification.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForEntityClassification.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForEntityClassification.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForEntityClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForEntityClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForEntityClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForEntityClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForEntityClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForEntityClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code> or <code>(batch_size, num_labels)</code>, <em>optional</em>) &#x2014;
Labels for computing the classification loss. If the shape is <code>(batch_size,)</code>, the cross entropy loss is
used for the single-label classification. In this case, labels should contain the indices that should be in
<code>[0, ..., config.num_labels - 1]</code>. If the shape is <code>(batch_size, num_labels)</code>, the binary cross entropy
loss is used for the multi-label classification. In this case, labels should only contain <code>[0, 1]</code>, where 0
and 1 indicate false and true, respectively.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1437",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.EntityClassificationOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</li>
<li><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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.luke.modeling_luke.EntityClassificationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ht=new we({props:{$$slots:{default:[Cf]},$$scope:{ctx:z}}}),ut=new le({props:{anchor:"transformers.LukeForEntityClassification.forward.example",$$slots:{default:[jf]},$$scope:{ctx:z}}}),Fn=new Q({}),qn=new F({props:{name:"class transformers.LukeForEntityPairClassification",anchor:"transformers.LukeForEntityPairClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForEntityPairClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1537"}}),Pn=new F({props:{name:"forward",anchor:"transformers.LukeForEntityPairClassification.forward",parameters:[{name:"input_ids",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:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LukeForEntityPairClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForEntityPairClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForEntityPairClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForEntityPairClassification.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.LukeForEntityPairClassification.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForEntityPairClassification.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForEntityPairClassification.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForEntityPairClassification.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForEntityPairClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForEntityPairClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForEntityPairClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForEntityPairClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForEntityPairClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForEntityPairClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code> or <code>(batch_size, num_labels)</code>, <em>optional</em>) &#x2014;
Labels for computing the classification loss. If the shape is <code>(batch_size,)</code>, the cross entropy loss is
used for the single-label classification. In this case, labels should contain the indices that should be in
<code>[0, ..., config.num_labels - 1]</code>. If the shape is <code>(batch_size, num_labels)</code>, the binary cross entropy
loss is used for the multi-label classification. In this case, labels should only contain <code>[0, 1]</code>, where 0
and 1 indicate false and true, respectively.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1550",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.EntityPairClassificationOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</li>
<li><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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.luke.modeling_luke.EntityPairClassificationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ft=new we({props:{$$slots:{default:[Mf]},$$scope:{ctx:z}}}),gt=new le({props:{anchor:"transformers.LukeForEntityPairClassification.forward.example",$$slots:{default:[Pf]},$$scope:{ctx:z}}}),An=new Q({}),Sn=new F({props:{name:"class transformers.LukeForEntitySpanClassification",anchor:"transformers.LukeForEntitySpanClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForEntitySpanClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1655"}}),Dn=new F({props:{name:"forward",anchor:"transformers.LukeForEntitySpanClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"attention_mask",val:" = None"},{name:"token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LukeForEntitySpanClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForEntitySpanClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForEntitySpanClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForEntitySpanClassification.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.LukeForEntitySpanClassification.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForEntitySpanClassification.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForEntitySpanClassification.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForEntitySpanClassification.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForEntitySpanClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForEntitySpanClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForEntitySpanClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForEntitySpanClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForEntitySpanClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForEntitySpanClassification.forward.entity_start_positions",description:`<strong>entity_start_positions</strong> (<code>torch.LongTensor</code>) &#x2014;
The start positions of entities in the word token sequence.`,name:"entity_start_positions"},{anchor:"transformers.LukeForEntitySpanClassification.forward.entity_end_positions",description:`<strong>entity_end_positions</strong> (<code>torch.LongTensor</code>) &#x2014;
The end positions of entities in the word token sequence.`,name:"entity_end_positions"},{anchor:"transformers.LukeForEntitySpanClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code> or <code>(batch_size, entity_length, num_labels)</code>, <em>optional</em>) &#x2014;
Labels for computing the classification loss. If the shape is <code>(batch_size, entity_length)</code>, the cross
entropy loss is used for the single-label classification. In this case, labels should contain the indices
that should be in <code>[0, ..., config.num_labels - 1]</code>. If the shape is <code>(batch_size, entity_length, num_labels)</code>, the binary cross entropy loss is used for the multi-label classification. In this case,
labels should only contain <code>[0, 1]</code>, where 0 and 1 indicate false and true, respectively.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1668",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.EntitySpanClassificationOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</a>) and inputs.</p>
<ul>
<li><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</li>
<li><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</li>
<li><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 + one for the output of each layer) of
shape <code>(batch_size, sequence_length, hidden_size)</code>. Hidden-states of the model at the output of each layer
plus the initial embedding outputs.</li>
<li><strong>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity embedding outputs.</li>
<li><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>. Attentions weights after the attention softmax, used to compute the weighted average in
the self-attention heads.</li>
</ul>
`,returnType:`
<p><code>transformers.models.luke.modeling_luke.EntitySpanClassificationOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),kt=new we({props:{$$slots:{default:[Af]},$$scope:{ctx:z}}}),yt=new le({props:{anchor:"transformers.LukeForEntitySpanClassification.forward.example",$$slots:{default:[Sf]},$$scope:{ctx:z}}}),Wn=new Q({}),Bn=new F({props:{name:"class transformers.LukeForSequenceClassification",anchor:"transformers.LukeForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1799"}}),Rn=new F({props:{name:"forward",anchor:"transformers.LukeForSequenceClassification.forward",parameters:[{name:"input_ids",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:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.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.LukeForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForSequenceClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForSequenceClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForSequenceClassification.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.LukeForSequenceClassification.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForSequenceClassification.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForSequenceClassification.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForSequenceClassification.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForSequenceClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForSequenceClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForSequenceClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForSequenceClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1812",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.LukeSequenceClassifierOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</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>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity 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><code>transformers.models.luke.modeling_luke.LukeSequenceClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tt=new we({props:{$$slots:{default:[Of]},$$scope:{ctx:z}}}),wt=new le({props:{anchor:"transformers.LukeForSequenceClassification.forward.example",$$slots:{default:[If]},$$scope:{ctx:z}}}),vt=new le({props:{anchor:"transformers.LukeForSequenceClassification.forward.example-2",$$slots:{default:[Nf]},$$scope:{ctx:z}}}),Qn=new Q({}),Vn=new F({props:{name:"class transformers.LukeForMultipleChoice",anchor:"transformers.LukeForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L2124"}}),Xn=new F({props:{name:"forward",anchor:"transformers.LukeForMultipleChoice.forward",parameters:[{name:"input_ids",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:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.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.LukeForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForMultipleChoice.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForMultipleChoice.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForMultipleChoice.forward.position_ids",description:`<strong>position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input sequence tokens in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.</p>
<p><a href="../glossary#position-ids">What are position IDs?</a>`,name:"position_ids"},{anchor:"transformers.LukeForMultipleChoice.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForMultipleChoice.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForMultipleChoice.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForMultipleChoice.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForMultipleChoice.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForMultipleChoice.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForMultipleChoice.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForMultipleChoice.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L2137",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.LukeMultipleChoiceModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) \u2014 <em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity 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><code>transformers.models.luke.modeling_luke.LukeMultipleChoiceModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),$t=new we({props:{$$slots:{default:[Df]},$$scope:{ctx:z}}}),zt=new le({props:{anchor:"transformers.LukeForMultipleChoice.forward.example",$$slots:{default:[Wf]},$$scope:{ctx:z}}}),Zn=new Q({}),eo=new F({props:{name:"class transformers.LukeForTokenClassification",anchor:"transformers.LukeForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1911"}}),ao=new F({props:{name:"forward",anchor:"transformers.LukeForTokenClassification.forward",parameters:[{name:"input_ids",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:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"labels",val:": typing.Optional[torch.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.LukeForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForTokenClassification.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForTokenClassification.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForTokenClassification.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.LukeForTokenClassification.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForTokenClassification.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForTokenClassification.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForTokenClassification.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForTokenClassification.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForTokenClassification.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForTokenClassification.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForTokenClassification.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForTokenClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L1925",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.LukeTokenClassifierOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  \u2014 Classification loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for the output of the embeddings, if the model has an embedding layer, +
one for the output of each layer) of shape <code>(batch_size, sequence_length, hidden_size)</code>.</p>
<p>Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.</p>
</li>
<li>
<p><strong>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity 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><code>transformers.models.luke.modeling_luke.LukeTokenClassifierOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),xt=new we({props:{$$slots:{default:[Bf]},$$scope:{ctx:z}}}),Ft=new le({props:{anchor:"transformers.LukeForTokenClassification.forward.example",$$slots:{default:[Uf]},$$scope:{ctx:z}}}),ro=new Q({}),io=new F({props:{name:"class transformers.LukeForQuestionAnswering",anchor:"transformers.LukeForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.LukeForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig">LukeConfig</a>) &#x2014; Model configuration class with all the parameters of the
model. Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L2005"}}),ho=new F({props:{name:"forward",anchor:"transformers.LukeForQuestionAnswering.forward",parameters:[{name:"input_ids",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.FloatTensor] = None"},{name:"entity_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_attention_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"entity_token_type_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"entity_position_ids",val:": typing.Optional[torch.LongTensor] = None"},{name:"head_mask",val:": typing.Optional[torch.FloatTensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_positions",val:": typing.Optional[torch.LongTensor] = None"},{name:"output_attentions",val:": typing.Optional[bool] = None"},{name:"output_hidden_states",val:": typing.Optional[bool] = None"},{name:"return_dict",val:": typing.Optional[bool] = None"}],parametersDescription:[{anchor:"transformers.LukeForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.LukeForQuestionAnswering.forward.attention_mask",description:`<strong>attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>not masked</strong>,</li>
<li>0 for tokens that are <strong>masked</strong>.</li>
</ul>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"attention_mask"},{anchor:"transformers.LukeForQuestionAnswering.forward.token_type_ids",description:`<strong>token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the inputs. Indices are selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>sentence A</em> token,</li>
<li>1 corresponds to a <em>sentence B</em> token.</li>
</ul>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"token_type_ids"},{anchor:"transformers.LukeForQuestionAnswering.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.LukeForQuestionAnswering.forward.entity_ids",description:`<strong>entity_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>) &#x2014;
Indices of entity tokens in the entity vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.`,name:"entity_ids"},{anchor:"transformers.LukeForQuestionAnswering.forward.entity_attention_mask",description:`<strong>entity_attention_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Mask to avoid performing attention on padding entity token indices. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for entity tokens that are <strong>not masked</strong>,</li>
<li>0 for entity tokens that are <strong>masked</strong>.</li>
</ul>`,name:"entity_attention_mask"},{anchor:"transformers.LukeForQuestionAnswering.forward.entity_token_type_ids",description:`<strong>entity_token_type_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length)</code>, <em>optional</em>) &#x2014;
Segment token indices to indicate first and second portions of the entity token inputs. Indices are
selected in <code>[0, 1]</code>:</p>
<ul>
<li>0 corresponds to a <em>portion A</em> entity token,</li>
<li>1 corresponds to a <em>portion B</em> entity token.</li>
</ul>`,name:"entity_token_type_ids"},{anchor:"transformers.LukeForQuestionAnswering.forward.entity_position_ids",description:`<strong>entity_position_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, entity_length, max_mention_length)</code>, <em>optional</em>) &#x2014;
Indices of positions of each input entity in the position embeddings. Selected in the range <code>[0, config.max_position_embeddings - 1]</code>.`,name:"entity_position_ids"},{anchor:"transformers.LukeForQuestionAnswering.forward.inputs_embeds",description:`<strong>inputs_embeds</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, hidden_size)</code>, <em>optional</em>) &#x2014;
Optionally, instead of passing <code>input_ids</code> you can choose to directly pass an embedded representation. This
is useful if you want more control over how to convert <code>input_ids</code> indices into associated vectors than the
model&#x2019;s internal embedding lookup matrix.`,name:"inputs_embeds"},{anchor:"transformers.LukeForQuestionAnswering.forward.head_mask",description:`<strong>head_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(num_heads,)</code> or <code>(num_layers, num_heads)</code>, <em>optional</em>) &#x2014;
Mask to nullify selected heads of the self-attention modules. Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 indicates the head is <strong>not masked</strong>,</li>
<li>0 indicates the head is <strong>masked</strong>.</li>
</ul>`,name:"head_mask"},{anchor:"transformers.LukeForQuestionAnswering.forward.output_attentions",description:`<strong>output_attentions</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the attentions tensors of all attention layers. See <code>attentions</code> under returned
tensors for more detail.`,name:"output_attentions"},{anchor:"transformers.LukeForQuestionAnswering.forward.output_hidden_states",description:`<strong>output_hidden_states</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return the hidden states of all layers. See <code>hidden_states</code> under returned tensors for
more detail.`,name:"output_hidden_states"},{anchor:"transformers.LukeForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.LukeForQuestionAnswering.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.LukeForQuestionAnswering.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/luke/modeling_luke.py#L2017",returnDescription:`
<p>A <code>transformers.models.luke.modeling_luke.LukeQuestionAnsweringModelOutput</code> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/luke#transformers.LukeConfig"
>LukeConfig</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>entity_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 + one for the output of each layer) of
shape <code>(batch_size, entity_length, hidden_size)</code>. Entity hidden-states of the model at the output of each
layer plus the initial entity 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><code>transformers.models.luke.modeling_luke.LukeQuestionAnsweringModelOutput</code> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ct=new we({props:{$$slots:{default:[Kf]},$$scope:{ctx:z}}}),jt=new le({props:{anchor:"transformers.LukeForQuestionAnswering.forward.example",$$slots:{default:[Hf]},$$scope:{ctx:z}}}),{c(){d=a("meta"),y=h(),f=a("h1"),m=a("a"),_=a("span"),b(l.$$.fragment),c=h(),E=a("span"),ri=o("LUKE"),Qa=h(),ve=a("h2"),Ge=a("a"),gs=a("span"),b(Bt.$$.fragment),ii=h(),_s=a("span"),li=o("Overview"),Va=h(),Je=a("p"),di=o("The LUKE model was proposed in "),Ut=a("a"),ci=o("LUKE: Deep Contextualized Entity Representations with Entity-aware Self-attention"),pi=o(` by Ikuya Yamada, Akari Asai, Hiroyuki Shindo, Hideaki Takeda and Yuji Matsumoto.
It is based on RoBERTa and adds entity embeddings as well as an entity-aware self-attention mechanism, which helps
improve performance on various downstream tasks involving reasoning about entities such as named entity recognition,
extractive and cloze-style question answering, entity typing, and relation classification.`),Ya=h(),_o=a("p"),hi=o("The abstract from the paper is the following:"),Ga=h(),ko=a("p"),ks=a("em"),ui=o(`Entity representations are useful in natural language tasks involving entities. In this paper, we propose new
pretrained contextualized representations of words and entities based on the bidirectional transformer. The proposed
model treats words and entities in a given text as independent tokens, and outputs contextualized representations of
them. Our model is trained using a new pretraining task based on the masked language model of BERT. The task involves
predicting randomly masked words and entities in a large entity-annotated corpus retrieved from Wikipedia. We also
propose an entity-aware self-attention mechanism that is an extension of the self-attention mechanism of the
transformer, and considers the types of tokens (words or entities) when computing attention scores. The proposed model
achieves impressive empirical performance on a wide range of entity-related tasks. In particular, it obtains
state-of-the-art results on five well-known datasets: Open Entity (entity typing), TACRED (relation classification),
CoNLL-2003 (named entity recognition), ReCoRD (cloze-style question answering), and SQuAD 1.1 (extractive question
answering).`),Ja=h(),yo=a("p"),mi=o("Tips:"),Xa=h(),V=a("ul"),ys=a("li"),Kt=a("p"),fi=o("This implementation is the same as "),bo=a("a"),gi=o("RobertaModel"),_i=o(` with the addition of entity embeddings as well
as an entity-aware self-attention mechanism, which improves performance on tasks involving reasoning about entities.`),ki=h(),bs=a("li"),C=a("p"),yi=o("LUKE treats entities as input tokens; therefore, it takes "),Ts=a("code"),bi=o("entity_ids"),Ti=o(", "),ws=a("code"),wi=o("entity_attention_mask"),vi=o(`,
`),vs=a("code"),Li=o("entity_token_type_ids"),$i=o(" and "),Ls=a("code"),zi=o("entity_position_ids"),Ei=o(` as extra input. You can obtain those using
`),To=a("a"),xi=o("LukeTokenizer"),Fi=o("."),qi=h(),Ht=a("li"),Y=a("p"),wo=a("a"),Ci=o("LukeTokenizer"),ji=o(" takes "),$s=a("code"),Mi=o("entities"),Pi=o(" and "),zs=a("code"),Ai=o("entity_spans"),Si=o(` (character-based start and end
positions of the entities in the input text) as extra input. `),Es=a("code"),Oi=o("entities"),Ii=o(` typically consist of [MASK] entities or
Wikipedia entities. The brief description when inputting these entities are as follows:`),Ni=h(),Rt=a("ul"),vo=a("li"),xs=a("em"),Di=o("Inputting [MASK] entities to compute entity representations"),Wi=o(`: The [MASK] entity is used to mask entities to be
predicted during pretraining. When LUKE receives the [MASK] entity, it tries to predict the original entity by
gathering the information about the entity from the input text. Therefore, the [MASK] entity can be used to address
downstream tasks requiring the information of entities in text such as entity typing, relation classification, and
named entity recognition.`),Bi=h(),Lo=a("li"),Fs=a("em"),Ui=o("Inputting Wikipedia entities to compute knowledge-enhanced token representations"),Ki=o(`: LUKE learns rich information
(or knowledge) about Wikipedia entities during pretraining and stores the information in its entity embedding. By
using Wikipedia entities as input tokens, LUKE outputs token representations enriched by the information stored in
the embeddings of these entities. This is particularly effective for tasks requiring real-world knowledge, such as
question answering.`),Hi=h(),H=a("li"),qs=a("p"),Ri=o("There are three head models for the former use case:"),Qi=h(),Le=a("ul"),Xe=a("li"),$o=a("a"),Vi=o("LukeForEntityClassification"),Yi=o(`, for tasks to classify a single entity in an input text such as
entity typing, e.g. the `),Qt=a("a"),Gi=o("Open Entity dataset"),Ji=o(`.
This model places a linear head on top of the output entity representation.`),Xi=h(),Ze=a("li"),zo=a("a"),Zi=o("LukeForEntityPairClassification"),el=o(`, for tasks to classify the relationship between two entities
such as relation classification, e.g. the `),Vt=a("a"),tl=o("TACRED dataset"),nl=o(`. This
model places a linear head on top of the concatenated output representation of the pair of given entities.`),ol=h(),Eo=a("li"),xo=a("a"),sl=o("LukeForEntitySpanClassification"),al=o(`, for tasks to classify the sequence of entity spans, such as
named entity recognition (NER). This model places a linear head on top of the output entity representations. You
can address NER using this model by inputting all possible entity spans in the text to the model.`),rl=h(),U=a("p"),Fo=a("a"),il=o("LukeTokenizer"),ll=o(" has a "),Cs=a("code"),dl=o("task"),cl=o(` argument, which enables you to easily create an input to these
head models by specifying `),js=a("code"),pl=o('task="entity_classification"'),hl=o(", "),Ms=a("code"),ul=o('task="entity_pair_classification"'),ml=o(`, or
`),Ps=a("code"),fl=o('task="entity_span_classification"'),gl=o(". Please refer to the example code of each head models."),_l=h(),$e=a("p"),kl=o("A demo notebook on how to fine-tune "),qo=a("a"),yl=o("LukeForEntityPairClassification"),bl=o(` for relation
classification can be found `),Yt=a("a"),Tl=o("here"),wl=o("."),vl=h(),Gt=a("p"),Ll=o(`There are also 3 notebooks available, which showcase how you can reproduce the results as reported in the paper with
the HuggingFace implementation of LUKE. They can be found `),Jt=a("a"),$l=o("here"),zl=o("."),Za=h(),Co=a("p"),El=o("Example:"),er=h(),b(Xt.$$.fragment),tr=h(),G=a("p"),xl=o("This model was contributed by "),Zt=a("a"),Fl=o("ikuyamada"),ql=o(" and "),en=a("a"),Cl=o("nielsr"),jl=o(". The original code can be found "),tn=a("a"),Ml=o("here"),Pl=o("."),nr=h(),ze=a("h2"),et=a("a"),As=a("span"),b(nn.$$.fragment),Al=h(),Ss=a("span"),Sl=o("LukeConfig"),or=h(),R=a("div"),b(on.$$.fragment),Ol=h(),Ee=a("p"),Il=o("This is the configuration class to store the configuration of a "),jo=a("a"),Nl=o("LukeModel"),Dl=o(`. It is used to instantiate a LUKE
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 LUKE
`),sn=a("a"),Wl=o("studio-ousia/luke-base"),Bl=o(" architecture."),Ul=h(),xe=a("p"),Kl=o("Configuration objects inherit from "),Mo=a("a"),Hl=o("PretrainedConfig"),Rl=o(` and can be used to control the model outputs. Read the
documentation from `),Po=a("a"),Ql=o("PretrainedConfig"),Vl=o(" for more information."),Yl=h(),b(tt.$$.fragment),sr=h(),Fe=a("h2"),nt=a("a"),Os=a("span"),b(an.$$.fragment),Gl=h(),Is=a("span"),Jl=o("LukeTokenizer"),ar=h(),x=a("div"),b(rn.$$.fragment),Xl=h(),Ns=a("p"),Zl=o("Constructs a LUKE tokenizer, derived from the GPT-2 tokenizer, using byte-level Byte-Pair-Encoding."),ed=h(),Ds=a("p"),td=o("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),nd=h(),b(ot.$$.fragment),od=h(),ln=a("p"),sd=o("You can get around that behavior by passing "),Ws=a("code"),ad=o("add_prefix_space=True"),rd=o(` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),id=h(),b(st.$$.fragment),ld=h(),j=a("p"),dd=o("This tokenizer inherits from "),Ao=a("a"),cd=o("PreTrainedTokenizer"),pd=o(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods. It also creates entity sequences, namely
`),Bs=a("code"),hd=o("entity_ids"),ud=o(", "),Us=a("code"),md=o("entity_attention_mask"),fd=o(", "),Ks=a("code"),gd=o("entity_token_type_ids"),_d=o(", and "),Hs=a("code"),kd=o("entity_position_ids"),yd=o(` to be used by the LUKE
model.`),bd=h(),at=a("div"),b(dn.$$.fragment),Td=h(),Rs=a("p"),wd=o(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences, depending on the task you want to prepare them for.`),vd=h(),So=a("div"),b(cn.$$.fragment),rr=h(),qe=a("h2"),rt=a("a"),Qs=a("span"),b(pn.$$.fragment),Ld=h(),Vs=a("span"),$d=o("LukeModel"),ir=h(),M=a("div"),b(hn.$$.fragment),zd=h(),Ys=a("p"),Ed=o("The bare LUKE model transformer outputting raw hidden-states for both word tokens and entities without any specific head on top."),xd=h(),un=a("p"),Fd=o("This model inherits from "),Oo=a("a"),qd=o("PreTrainedModel"),Cd=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),jd=h(),mn=a("p"),Md=o("This model is also a PyTorch "),fn=a("a"),Pd=o("torch.nn.Module"),Ad=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sd=h(),J=a("div"),b(gn.$$.fragment),Od=h(),Ce=a("p"),Id=o("The "),Io=a("a"),Nd=o("LukeModel"),Dd=o(" forward method, overrides the "),Gs=a("code"),Wd=o("__call__"),Bd=o(" special method."),Ud=h(),b(it.$$.fragment),Kd=h(),b(lt.$$.fragment),lr=h(),je=a("h2"),dt=a("a"),Js=a("span"),b(_n.$$.fragment),Hd=h(),Xs=a("span"),Rd=o("LukeForMaskedLM"),dr=h(),P=a("div"),b(kn.$$.fragment),Qd=h(),Zs=a("p"),Vd=o(`The LUKE model with a language modeling head and entity prediction head on top for masked language modeling and
masked entity prediction.`),Yd=h(),yn=a("p"),Gd=o("This model inherits from "),No=a("a"),Jd=o("PreTrainedModel"),Xd=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Zd=h(),bn=a("p"),ec=o("This model is also a PyTorch "),Tn=a("a"),tc=o("torch.nn.Module"),nc=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),oc=h(),ce=a("div"),b(wn.$$.fragment),sc=h(),Me=a("p"),ac=o("The "),Do=a("a"),rc=o("LukeForMaskedLM"),ic=o(" forward method, overrides the "),ea=a("code"),lc=o("__call__"),dc=o(" special method."),cc=h(),b(ct.$$.fragment),cr=h(),Pe=a("h2"),pt=a("a"),ta=a("span"),b(vn.$$.fragment),pc=h(),na=a("span"),hc=o("LukeForEntityClassification"),pr=h(),A=a("div"),b(Ln.$$.fragment),uc=h(),oa=a("p"),mc=o(`The LUKE model with a classification head on top (a linear layer on top of the hidden state of the first entity
token) for entity classification tasks, such as Open Entity.`),fc=h(),$n=a("p"),gc=o("This model inherits from "),Wo=a("a"),_c=o("PreTrainedModel"),kc=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),yc=h(),zn=a("p"),bc=o("This model is also a PyTorch "),En=a("a"),Tc=o("torch.nn.Module"),wc=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vc=h(),X=a("div"),b(xn.$$.fragment),Lc=h(),Ae=a("p"),$c=o("The "),Bo=a("a"),zc=o("LukeForEntityClassification"),Ec=o(" forward method, overrides the "),sa=a("code"),xc=o("__call__"),Fc=o(" special method."),qc=h(),b(ht.$$.fragment),Cc=h(),b(ut.$$.fragment),hr=h(),Se=a("h2"),mt=a("a"),aa=a("span"),b(Fn.$$.fragment),jc=h(),ra=a("span"),Mc=o("LukeForEntityPairClassification"),ur=h(),S=a("div"),b(qn.$$.fragment),Pc=h(),ia=a("p"),Ac=o(`The LUKE model with a classification head on top (a linear layer on top of the hidden states of the two entity
tokens) for entity pair classification tasks, such as TACRED.`),Sc=h(),Cn=a("p"),Oc=o("This model inherits from "),Uo=a("a"),Ic=o("PreTrainedModel"),Nc=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Dc=h(),jn=a("p"),Wc=o("This model is also a PyTorch "),Mn=a("a"),Bc=o("torch.nn.Module"),Uc=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Kc=h(),Z=a("div"),b(Pn.$$.fragment),Hc=h(),Oe=a("p"),Rc=o("The "),Ko=a("a"),Qc=o("LukeForEntityPairClassification"),Vc=o(" forward method, overrides the "),la=a("code"),Yc=o("__call__"),Gc=o(" special method."),Jc=h(),b(ft.$$.fragment),Xc=h(),b(gt.$$.fragment),mr=h(),Ie=a("h2"),_t=a("a"),da=a("span"),b(An.$$.fragment),Zc=h(),ca=a("span"),ep=o("LukeForEntitySpanClassification"),fr=h(),O=a("div"),b(Sn.$$.fragment),tp=h(),pa=a("p"),np=o(`The LUKE model with a span classification head on top (a linear layer on top of the hidden states output) for tasks
such as named entity recognition.`),op=h(),On=a("p"),sp=o("This model inherits from "),Ho=a("a"),ap=o("PreTrainedModel"),rp=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ip=h(),In=a("p"),lp=o("This model is also a PyTorch "),Nn=a("a"),dp=o("torch.nn.Module"),cp=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pp=h(),ee=a("div"),b(Dn.$$.fragment),hp=h(),Ne=a("p"),up=o("The "),Ro=a("a"),mp=o("LukeForEntitySpanClassification"),fp=o(" forward method, overrides the "),ha=a("code"),gp=o("__call__"),_p=o(" special method."),kp=h(),b(kt.$$.fragment),yp=h(),b(yt.$$.fragment),gr=h(),De=a("h2"),bt=a("a"),ua=a("span"),b(Wn.$$.fragment),bp=h(),ma=a("span"),Tp=o("LukeForSequenceClassification"),_r=h(),I=a("div"),b(Bn.$$.fragment),wp=h(),fa=a("p"),vp=o(`The LUKE Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Lp=h(),Un=a("p"),$p=o("This model inherits from "),Qo=a("a"),zp=o("PreTrainedModel"),Ep=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xp=h(),Kn=a("p"),Fp=o("This model is also a PyTorch "),Hn=a("a"),qp=o("torch.nn.Module"),Cp=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),jp=h(),K=a("div"),b(Rn.$$.fragment),Mp=h(),We=a("p"),Pp=o("The "),Vo=a("a"),Ap=o("LukeForSequenceClassification"),Sp=o(" forward method, overrides the "),ga=a("code"),Op=o("__call__"),Ip=o(" special method."),Np=h(),b(Tt.$$.fragment),Dp=h(),b(wt.$$.fragment),Wp=h(),b(vt.$$.fragment),kr=h(),Be=a("h2"),Lt=a("a"),_a=a("span"),b(Qn.$$.fragment),Bp=h(),ka=a("span"),Up=o("LukeForMultipleChoice"),yr=h(),N=a("div"),b(Vn.$$.fragment),Kp=h(),ya=a("p"),Hp=o(`The LUKE Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),Rp=h(),Yn=a("p"),Qp=o("This model inherits from "),Yo=a("a"),Vp=o("PreTrainedModel"),Yp=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gp=h(),Gn=a("p"),Jp=o("This model is also a PyTorch "),Jn=a("a"),Xp=o("torch.nn.Module"),Zp=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),eh=h(),te=a("div"),b(Xn.$$.fragment),th=h(),Ue=a("p"),nh=o("The "),Go=a("a"),oh=o("LukeForMultipleChoice"),sh=o(" forward method, overrides the "),ba=a("code"),ah=o("__call__"),rh=o(" special method."),ih=h(),b($t.$$.fragment),lh=h(),b(zt.$$.fragment),br=h(),Ke=a("h2"),Et=a("a"),Ta=a("span"),b(Zn.$$.fragment),dh=h(),wa=a("span"),ch=o("LukeForTokenClassification"),Tr=h(),D=a("div"),b(eo.$$.fragment),ph=h(),to=a("p"),hh=o(`The LUKE Model with a token classification head on top (a linear layer on top of the hidden-states output). To
solve Named-Entity Recognition (NER) task using LUKE, `),va=a("code"),uh=o("LukeForEntitySpanClassification"),mh=o(` is more suitable than this
class.`),fh=h(),no=a("p"),gh=o("This model inherits from "),Jo=a("a"),_h=o("PreTrainedModel"),kh=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),yh=h(),oo=a("p"),bh=o("This model is also a PyTorch "),so=a("a"),Th=o("torch.nn.Module"),wh=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vh=h(),ne=a("div"),b(ao.$$.fragment),Lh=h(),He=a("p"),$h=o("The "),Xo=a("a"),zh=o("LukeForTokenClassification"),Eh=o(" forward method, overrides the "),La=a("code"),xh=o("__call__"),Fh=o(" special method."),qh=h(),b(xt.$$.fragment),Ch=h(),b(Ft.$$.fragment),wr=h(),Re=a("h2"),qt=a("a"),$a=a("span"),b(ro.$$.fragment),jh=h(),za=a("span"),Mh=o("LukeForQuestionAnswering"),vr=h(),W=a("div"),b(io.$$.fragment),Ph=h(),Qe=a("p"),Ah=o(`The LUKE 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 `),Ea=a("code"),Sh=o("span start logits"),Oh=o(" and "),xa=a("code"),Ih=o("span end logits"),Nh=o(")."),Dh=h(),lo=a("p"),Wh=o("This model inherits from "),Zo=a("a"),Bh=o("PreTrainedModel"),Uh=o(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Kh=h(),co=a("p"),Hh=o("This model is also a PyTorch "),po=a("a"),Rh=o("torch.nn.Module"),Qh=o(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Vh=h(),oe=a("div"),b(ho.$$.fragment),Yh=h(),Ve=a("p"),Gh=o("The "),es=a("a"),Jh=o("LukeForQuestionAnswering"),Xh=o(" forward method, overrides the "),Fa=a("code"),Zh=o("__call__"),eu=o(" special method."),tu=h(),b(Ct.$$.fragment),nu=h(),b(jt.$$.fragment),this.h()},l(n){const g=vf('[data-svelte="svelte-1phssyn"]',document.head);d=r(g,"META",{name:!0,content:!0}),g.forEach(t),y=u(n),f=r(n,"H1",{class:!0});var uo=i(f);m=r(uo,"A",{id:!0,class:!0,href:!0});var qa=i(m);_=r(qa,"SPAN",{});var Ca=i(_);T(l.$$.fragment,Ca),Ca.forEach(t),qa.forEach(t),c=u(uo),E=r(uo,"SPAN",{});var ja=i(E);ri=s(ja,"LUKE"),ja.forEach(t),uo.forEach(t),Qa=u(n),ve=r(n,"H2",{class:!0});var mo=i(ve);Ge=r(mo,"A",{id:!0,class:!0,href:!0});var Ma=i(Ge);gs=r(Ma,"SPAN",{});var Pa=i(gs);T(Bt.$$.fragment,Pa),Pa.forEach(t),Ma.forEach(t),ii=u(mo),_s=r(mo,"SPAN",{});var Aa=i(_s);li=s(Aa,"Overview"),Aa.forEach(t),mo.forEach(t),Va=u(n),Je=r(n,"P",{});var fo=i(Je);di=s(fo,"The LUKE model was proposed in "),Ut=r(fo,"A",{href:!0,rel:!0});var Sa=i(Ut);ci=s(Sa,"LUKE: Deep Contextualized Entity Representations with Entity-aware Self-attention"),Sa.forEach(t),pi=s(fo,` by Ikuya Yamada, Akari Asai, Hiroyuki Shindo, Hideaki Takeda and Yuji Matsumoto.
It is based on RoBERTa and adds entity embeddings as well as an entity-aware self-attention mechanism, which helps
improve performance on various downstream tasks involving reasoning about entities such as named entity recognition,
extractive and cloze-style question answering, entity typing, and relation classification.`),fo.forEach(t),Ya=u(n),_o=r(n,"P",{});var Oa=i(_o);hi=s(Oa,"The abstract from the paper is the following:"),Oa.forEach(t),Ga=u(n),ko=r(n,"P",{});var Ia=i(ko);ks=r(Ia,"EM",{});var Na=i(ks);ui=s(Na,`Entity representations are useful in natural language tasks involving entities. In this paper, we propose new
pretrained contextualized representations of words and entities based on the bidirectional transformer. The proposed
model treats words and entities in a given text as independent tokens, and outputs contextualized representations of
them. Our model is trained using a new pretraining task based on the masked language model of BERT. The task involves
predicting randomly masked words and entities in a large entity-annotated corpus retrieved from Wikipedia. We also
propose an entity-aware self-attention mechanism that is an extension of the self-attention mechanism of the
transformer, and considers the types of tokens (words or entities) when computing attention scores. The proposed model
achieves impressive empirical performance on a wide range of entity-related tasks. In particular, it obtains
state-of-the-art results on five well-known datasets: Open Entity (entity typing), TACRED (relation classification),
CoNLL-2003 (named entity recognition), ReCoRD (cloze-style question answering), and SQuAD 1.1 (extractive question
answering).`),Na.forEach(t),Ia.forEach(t),Ja=u(n),yo=r(n,"P",{});var Da=i(yo);mi=s(Da,"Tips:"),Da.forEach(t),Xa=u(n),V=r(n,"UL",{});var re=i(V);ys=r(re,"LI",{});var Wa=i(ys);Kt=r(Wa,"P",{});var go=i(Kt);fi=s(go,"This implementation is the same as "),bo=r(go,"A",{href:!0});var Ba=i(bo);gi=s(Ba,"RobertaModel"),Ba.forEach(t),_i=s(go,` with the addition of entity embeddings as well
as an entity-aware self-attention mechanism, which improves performance on tasks involving reasoning about entities.`),go.forEach(t),Wa.forEach(t),ki=u(re),bs=r(re,"LI",{});var Ua=i(bs);C=r(Ua,"P",{});var B=i(C);yi=s(B,"LUKE treats entities as input tokens; therefore, it takes "),Ts=r(B,"CODE",{});var Ka=i(Ts);bi=s(Ka,"entity_ids"),Ka.forEach(t),Ti=s(B,", "),ws=r(B,"CODE",{});var ru=i(ws);wi=s(ru,"entity_attention_mask"),ru.forEach(t),vi=s(B,`,
`),vs=r(B,"CODE",{});var iu=i(vs);Li=s(iu,"entity_token_type_ids"),iu.forEach(t),$i=s(B," and "),Ls=r(B,"CODE",{});var lu=i(Ls);zi=s(lu,"entity_position_ids"),lu.forEach(t),Ei=s(B,` as extra input. You can obtain those using
`),To=r(B,"A",{href:!0});var du=i(To);xi=s(du,"LukeTokenizer"),du.forEach(t),Fi=s(B,"."),B.forEach(t),Ua.forEach(t),qi=u(re),Ht=r(re,"LI",{});var $r=i(Ht);Y=r($r,"P",{});var Ye=i(Y);wo=r(Ye,"A",{href:!0});var cu=i(wo);Ci=s(cu,"LukeTokenizer"),cu.forEach(t),ji=s(Ye," takes "),$s=r(Ye,"CODE",{});var pu=i($s);Mi=s(pu,"entities"),pu.forEach(t),Pi=s(Ye," and "),zs=r(Ye,"CODE",{});var hu=i(zs);Ai=s(hu,"entity_spans"),hu.forEach(t),Si=s(Ye,` (character-based start and end
positions of the entities in the input text) as extra input. `),Es=r(Ye,"CODE",{});var uu=i(Es);Oi=s(uu,"entities"),uu.forEach(t),Ii=s(Ye,` typically consist of [MASK] entities or
Wikipedia entities. The brief description when inputting these entities are as follows:`),Ye.forEach(t),Ni=u($r),Rt=r($r,"UL",{});var zr=i(Rt);vo=r(zr,"LI",{});var ou=i(vo);xs=r(ou,"EM",{});var mu=i(xs);Di=s(mu,"Inputting [MASK] entities to compute entity representations"),mu.forEach(t),Wi=s(ou,`: The [MASK] entity is used to mask entities to be
predicted during pretraining. When LUKE receives the [MASK] entity, it tries to predict the original entity by
gathering the information about the entity from the input text. Therefore, the [MASK] entity can be used to address
downstream tasks requiring the information of entities in text such as entity typing, relation classification, and
named entity recognition.`),ou.forEach(t),Bi=u(zr),Lo=r(zr,"LI",{});var su=i(Lo);Fs=r(su,"EM",{});var fu=i(Fs);Ui=s(fu,"Inputting Wikipedia entities to compute knowledge-enhanced token representations"),fu.forEach(t),Ki=s(su,`: LUKE learns rich information
(or knowledge) about Wikipedia entities during pretraining and stores the information in its entity embedding. By
using Wikipedia entities as input tokens, LUKE outputs token representations enriched by the information stored in
the embeddings of these entities. This is particularly effective for tasks requiring real-world knowledge, such as
question answering.`),su.forEach(t),zr.forEach(t),$r.forEach(t),Hi=u(re),H=r(re,"LI",{});var pe=i(H);qs=r(pe,"P",{});var gu=i(qs);Ri=s(gu,"There are three head models for the former use case:"),gu.forEach(t),Qi=u(pe),Le=r(pe,"UL",{});var ts=i(Le);Xe=r(ts,"LI",{});var Ha=i(Xe);$o=r(Ha,"A",{href:!0});var _u=i($o);Vi=s(_u,"LukeForEntityClassification"),_u.forEach(t),Yi=s(Ha,`, for tasks to classify a single entity in an input text such as
entity typing, e.g. the `),Qt=r(Ha,"A",{href:!0,rel:!0});var ku=i(Qt);Gi=s(ku,"Open Entity dataset"),ku.forEach(t),Ji=s(Ha,`.
This model places a linear head on top of the output entity representation.`),Ha.forEach(t),Xi=u(ts),Ze=r(ts,"LI",{});var Ra=i(Ze);zo=r(Ra,"A",{href:!0});var yu=i(zo);Zi=s(yu,"LukeForEntityPairClassification"),yu.forEach(t),el=s(Ra,`, for tasks to classify the relationship between two entities
such as relation classification, e.g. the `),Vt=r(Ra,"A",{href:!0,rel:!0});var bu=i(Vt);tl=s(bu,"TACRED dataset"),bu.forEach(t),nl=s(Ra,`. This
model places a linear head on top of the concatenated output representation of the pair of given entities.`),Ra.forEach(t),ol=u(ts),Eo=r(ts,"LI",{});var au=i(Eo);xo=r(au,"A",{href:!0});var Tu=i(xo);sl=s(Tu,"LukeForEntitySpanClassification"),Tu.forEach(t),al=s(au,`, for tasks to classify the sequence of entity spans, such as
named entity recognition (NER). This model places a linear head on top of the output entity representations. You
can address NER using this model by inputting all possible entity spans in the text to the model.`),au.forEach(t),ts.forEach(t),rl=u(pe),U=r(pe,"P",{});var ie=i(U);Fo=r(ie,"A",{href:!0});var wu=i(Fo);il=s(wu,"LukeTokenizer"),wu.forEach(t),ll=s(ie," has a "),Cs=r(ie,"CODE",{});var vu=i(Cs);dl=s(vu,"task"),vu.forEach(t),cl=s(ie,` argument, which enables you to easily create an input to these
head models by specifying `),js=r(ie,"CODE",{});var Lu=i(js);pl=s(Lu,'task="entity_classification"'),Lu.forEach(t),hl=s(ie,", "),Ms=r(ie,"CODE",{});var $u=i(Ms);ul=s($u,'task="entity_pair_classification"'),$u.forEach(t),ml=s(ie,`, or
`),Ps=r(ie,"CODE",{});var zu=i(Ps);fl=s(zu,'task="entity_span_classification"'),zu.forEach(t),gl=s(ie,". Please refer to the example code of each head models."),ie.forEach(t),_l=u(pe),$e=r(pe,"P",{});var ns=i($e);kl=s(ns,"A demo notebook on how to fine-tune "),qo=r(ns,"A",{href:!0});var Eu=i(qo);yl=s(Eu,"LukeForEntityPairClassification"),Eu.forEach(t),bl=s(ns,` for relation
classification can be found `),Yt=r(ns,"A",{href:!0,rel:!0});var xu=i(Yt);Tl=s(xu,"here"),xu.forEach(t),wl=s(ns,"."),ns.forEach(t),vl=u(pe),Gt=r(pe,"P",{});var Er=i(Gt);Ll=s(Er,`There are also 3 notebooks available, which showcase how you can reproduce the results as reported in the paper with
the HuggingFace implementation of LUKE. They can be found `),Jt=r(Er,"A",{href:!0,rel:!0});var Fu=i(Jt);$l=s(Fu,"here"),Fu.forEach(t),zl=s(Er,"."),Er.forEach(t),pe.forEach(t),re.forEach(t),Za=u(n),Co=r(n,"P",{});var qu=i(Co);El=s(qu,"Example:"),qu.forEach(t),er=u(n),T(Xt.$$.fragment,n),tr=u(n),G=r(n,"P",{});var Mt=i(G);xl=s(Mt,"This model was contributed by "),Zt=r(Mt,"A",{href:!0,rel:!0});var Cu=i(Zt);Fl=s(Cu,"ikuyamada"),Cu.forEach(t),ql=s(Mt," and "),en=r(Mt,"A",{href:!0,rel:!0});var ju=i(en);Cl=s(ju,"nielsr"),ju.forEach(t),jl=s(Mt,". The original code can be found "),tn=r(Mt,"A",{href:!0,rel:!0});var Mu=i(tn);Ml=s(Mu,"here"),Mu.forEach(t),Pl=s(Mt,"."),Mt.forEach(t),nr=u(n),ze=r(n,"H2",{class:!0});var xr=i(ze);et=r(xr,"A",{id:!0,class:!0,href:!0});var Pu=i(et);As=r(Pu,"SPAN",{});var Au=i(As);T(nn.$$.fragment,Au),Au.forEach(t),Pu.forEach(t),Al=u(xr),Ss=r(xr,"SPAN",{});var Su=i(Ss);Sl=s(Su,"LukeConfig"),Su.forEach(t),xr.forEach(t),or=u(n),R=r(n,"DIV",{class:!0});var Pt=i(R);T(on.$$.fragment,Pt),Ol=u(Pt),Ee=r(Pt,"P",{});var os=i(Ee);Il=s(os,"This is the configuration class to store the configuration of a "),jo=r(os,"A",{href:!0});var Ou=i(jo);Nl=s(Ou,"LukeModel"),Ou.forEach(t),Dl=s(os,`. It is used to instantiate a LUKE
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 LUKE
`),sn=r(os,"A",{href:!0,rel:!0});var Iu=i(sn);Wl=s(Iu,"studio-ousia/luke-base"),Iu.forEach(t),Bl=s(os," architecture."),os.forEach(t),Ul=u(Pt),xe=r(Pt,"P",{});var ss=i(xe);Kl=s(ss,"Configuration objects inherit from "),Mo=r(ss,"A",{href:!0});var Nu=i(Mo);Hl=s(Nu,"PretrainedConfig"),Nu.forEach(t),Rl=s(ss,` and can be used to control the model outputs. Read the
documentation from `),Po=r(ss,"A",{href:!0});var Du=i(Po);Ql=s(Du,"PretrainedConfig"),Du.forEach(t),Vl=s(ss," for more information."),ss.forEach(t),Yl=u(Pt),T(tt.$$.fragment,Pt),Pt.forEach(t),sr=u(n),Fe=r(n,"H2",{class:!0});var Fr=i(Fe);nt=r(Fr,"A",{id:!0,class:!0,href:!0});var Wu=i(nt);Os=r(Wu,"SPAN",{});var Bu=i(Os);T(an.$$.fragment,Bu),Bu.forEach(t),Wu.forEach(t),Gl=u(Fr),Is=r(Fr,"SPAN",{});var Uu=i(Is);Jl=s(Uu,"LukeTokenizer"),Uu.forEach(t),Fr.forEach(t),ar=u(n),x=r(n,"DIV",{class:!0});var q=i(x);T(rn.$$.fragment,q),Xl=u(q),Ns=r(q,"P",{});var Ku=i(Ns);Zl=s(Ku,"Constructs a LUKE tokenizer, derived from the GPT-2 tokenizer, using byte-level Byte-Pair-Encoding."),Ku.forEach(t),ed=u(q),Ds=r(q,"P",{});var Hu=i(Ds);td=s(Hu,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Hu.forEach(t),nd=u(q),T(ot.$$.fragment,q),od=u(q),ln=r(q,"P",{});var qr=i(ln);sd=s(qr,"You can get around that behavior by passing "),Ws=r(qr,"CODE",{});var Ru=i(Ws);ad=s(Ru,"add_prefix_space=True"),Ru.forEach(t),rd=s(qr,` when instantiating this tokenizer or when you
call it on some text, but since the model was not pretrained this way, it might yield a decrease in performance.`),qr.forEach(t),id=u(q),T(st.$$.fragment,q),ld=u(q),j=r(q,"P",{});var se=i(j);dd=s(se,"This tokenizer inherits from "),Ao=r(se,"A",{href:!0});var Qu=i(Ao);cd=s(Qu,"PreTrainedTokenizer"),Qu.forEach(t),pd=s(se,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods. It also creates entity sequences, namely
`),Bs=r(se,"CODE",{});var Vu=i(Bs);hd=s(Vu,"entity_ids"),Vu.forEach(t),ud=s(se,", "),Us=r(se,"CODE",{});var Yu=i(Us);md=s(Yu,"entity_attention_mask"),Yu.forEach(t),fd=s(se,", "),Ks=r(se,"CODE",{});var Gu=i(Ks);gd=s(Gu,"entity_token_type_ids"),Gu.forEach(t),_d=s(se,", and "),Hs=r(se,"CODE",{});var Ju=i(Hs);kd=s(Ju,"entity_position_ids"),Ju.forEach(t),yd=s(se,` to be used by the LUKE
model.`),se.forEach(t),bd=u(q),at=r(q,"DIV",{class:!0});var Cr=i(at);T(dn.$$.fragment,Cr),Td=u(Cr),Rs=r(Cr,"P",{});var Xu=i(Rs);wd=s(Xu,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences, depending on the task you want to prepare them for.`),Xu.forEach(t),Cr.forEach(t),vd=u(q),So=r(q,"DIV",{class:!0});var Zu=i(So);T(cn.$$.fragment,Zu),Zu.forEach(t),q.forEach(t),rr=u(n),qe=r(n,"H2",{class:!0});var jr=i(qe);rt=r(jr,"A",{id:!0,class:!0,href:!0});var em=i(rt);Qs=r(em,"SPAN",{});var tm=i(Qs);T(pn.$$.fragment,tm),tm.forEach(t),em.forEach(t),Ld=u(jr),Vs=r(jr,"SPAN",{});var nm=i(Vs);$d=s(nm,"LukeModel"),nm.forEach(t),jr.forEach(t),ir=u(n),M=r(n,"DIV",{class:!0});var he=i(M);T(hn.$$.fragment,he),zd=u(he),Ys=r(he,"P",{});var om=i(Ys);Ed=s(om,"The bare LUKE model transformer outputting raw hidden-states for both word tokens and entities without any specific head on top."),om.forEach(t),xd=u(he),un=r(he,"P",{});var Mr=i(un);Fd=s(Mr,"This model inherits from "),Oo=r(Mr,"A",{href:!0});var sm=i(Oo);qd=s(sm,"PreTrainedModel"),sm.forEach(t),Cd=s(Mr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Mr.forEach(t),jd=u(he),mn=r(he,"P",{});var Pr=i(mn);Md=s(Pr,"This model is also a PyTorch "),fn=r(Pr,"A",{href:!0,rel:!0});var am=i(fn);Pd=s(am,"torch.nn.Module"),am.forEach(t),Ad=s(Pr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pr.forEach(t),Sd=u(he),J=r(he,"DIV",{class:!0});var At=i(J);T(gn.$$.fragment,At),Od=u(At),Ce=r(At,"P",{});var as=i(Ce);Id=s(as,"The "),Io=r(as,"A",{href:!0});var rm=i(Io);Nd=s(rm,"LukeModel"),rm.forEach(t),Dd=s(as," forward method, overrides the "),Gs=r(as,"CODE",{});var im=i(Gs);Wd=s(im,"__call__"),im.forEach(t),Bd=s(as," special method."),as.forEach(t),Ud=u(At),T(it.$$.fragment,At),Kd=u(At),T(lt.$$.fragment,At),At.forEach(t),he.forEach(t),lr=u(n),je=r(n,"H2",{class:!0});var Ar=i(je);dt=r(Ar,"A",{id:!0,class:!0,href:!0});var lm=i(dt);Js=r(lm,"SPAN",{});var dm=i(Js);T(_n.$$.fragment,dm),dm.forEach(t),lm.forEach(t),Hd=u(Ar),Xs=r(Ar,"SPAN",{});var cm=i(Xs);Rd=s(cm,"LukeForMaskedLM"),cm.forEach(t),Ar.forEach(t),dr=u(n),P=r(n,"DIV",{class:!0});var ue=i(P);T(kn.$$.fragment,ue),Qd=u(ue),Zs=r(ue,"P",{});var pm=i(Zs);Vd=s(pm,`The LUKE model with a language modeling head and entity prediction head on top for masked language modeling and
masked entity prediction.`),pm.forEach(t),Yd=u(ue),yn=r(ue,"P",{});var Sr=i(yn);Gd=s(Sr,"This model inherits from "),No=r(Sr,"A",{href:!0});var hm=i(No);Jd=s(hm,"PreTrainedModel"),hm.forEach(t),Xd=s(Sr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Sr.forEach(t),Zd=u(ue),bn=r(ue,"P",{});var Or=i(bn);ec=s(Or,"This model is also a PyTorch "),Tn=r(Or,"A",{href:!0,rel:!0});var um=i(Tn);tc=s(um,"torch.nn.Module"),um.forEach(t),nc=s(Or,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Or.forEach(t),oc=u(ue),ce=r(ue,"DIV",{class:!0});var rs=i(ce);T(wn.$$.fragment,rs),sc=u(rs),Me=r(rs,"P",{});var is=i(Me);ac=s(is,"The "),Do=r(is,"A",{href:!0});var mm=i(Do);rc=s(mm,"LukeForMaskedLM"),mm.forEach(t),ic=s(is," forward method, overrides the "),ea=r(is,"CODE",{});var fm=i(ea);lc=s(fm,"__call__"),fm.forEach(t),dc=s(is," special method."),is.forEach(t),cc=u(rs),T(ct.$$.fragment,rs),rs.forEach(t),ue.forEach(t),cr=u(n),Pe=r(n,"H2",{class:!0});var Ir=i(Pe);pt=r(Ir,"A",{id:!0,class:!0,href:!0});var gm=i(pt);ta=r(gm,"SPAN",{});var _m=i(ta);T(vn.$$.fragment,_m),_m.forEach(t),gm.forEach(t),pc=u(Ir),na=r(Ir,"SPAN",{});var km=i(na);hc=s(km,"LukeForEntityClassification"),km.forEach(t),Ir.forEach(t),pr=u(n),A=r(n,"DIV",{class:!0});var me=i(A);T(Ln.$$.fragment,me),uc=u(me),oa=r(me,"P",{});var ym=i(oa);mc=s(ym,`The LUKE model with a classification head on top (a linear layer on top of the hidden state of the first entity
token) for entity classification tasks, such as Open Entity.`),ym.forEach(t),fc=u(me),$n=r(me,"P",{});var Nr=i($n);gc=s(Nr,"This model inherits from "),Wo=r(Nr,"A",{href:!0});var bm=i(Wo);_c=s(bm,"PreTrainedModel"),bm.forEach(t),kc=s(Nr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Nr.forEach(t),yc=u(me),zn=r(me,"P",{});var Dr=i(zn);bc=s(Dr,"This model is also a PyTorch "),En=r(Dr,"A",{href:!0,rel:!0});var Tm=i(En);Tc=s(Tm,"torch.nn.Module"),Tm.forEach(t),wc=s(Dr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Dr.forEach(t),vc=u(me),X=r(me,"DIV",{class:!0});var St=i(X);T(xn.$$.fragment,St),Lc=u(St),Ae=r(St,"P",{});var ls=i(Ae);$c=s(ls,"The "),Bo=r(ls,"A",{href:!0});var wm=i(Bo);zc=s(wm,"LukeForEntityClassification"),wm.forEach(t),Ec=s(ls," forward method, overrides the "),sa=r(ls,"CODE",{});var vm=i(sa);xc=s(vm,"__call__"),vm.forEach(t),Fc=s(ls," special method."),ls.forEach(t),qc=u(St),T(ht.$$.fragment,St),Cc=u(St),T(ut.$$.fragment,St),St.forEach(t),me.forEach(t),hr=u(n),Se=r(n,"H2",{class:!0});var Wr=i(Se);mt=r(Wr,"A",{id:!0,class:!0,href:!0});var Lm=i(mt);aa=r(Lm,"SPAN",{});var $m=i(aa);T(Fn.$$.fragment,$m),$m.forEach(t),Lm.forEach(t),jc=u(Wr),ra=r(Wr,"SPAN",{});var zm=i(ra);Mc=s(zm,"LukeForEntityPairClassification"),zm.forEach(t),Wr.forEach(t),ur=u(n),S=r(n,"DIV",{class:!0});var fe=i(S);T(qn.$$.fragment,fe),Pc=u(fe),ia=r(fe,"P",{});var Em=i(ia);Ac=s(Em,`The LUKE model with a classification head on top (a linear layer on top of the hidden states of the two entity
tokens) for entity pair classification tasks, such as TACRED.`),Em.forEach(t),Sc=u(fe),Cn=r(fe,"P",{});var Br=i(Cn);Oc=s(Br,"This model inherits from "),Uo=r(Br,"A",{href:!0});var xm=i(Uo);Ic=s(xm,"PreTrainedModel"),xm.forEach(t),Nc=s(Br,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Br.forEach(t),Dc=u(fe),jn=r(fe,"P",{});var Ur=i(jn);Wc=s(Ur,"This model is also a PyTorch "),Mn=r(Ur,"A",{href:!0,rel:!0});var Fm=i(Mn);Bc=s(Fm,"torch.nn.Module"),Fm.forEach(t),Uc=s(Ur,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ur.forEach(t),Kc=u(fe),Z=r(fe,"DIV",{class:!0});var Ot=i(Z);T(Pn.$$.fragment,Ot),Hc=u(Ot),Oe=r(Ot,"P",{});var ds=i(Oe);Rc=s(ds,"The "),Ko=r(ds,"A",{href:!0});var qm=i(Ko);Qc=s(qm,"LukeForEntityPairClassification"),qm.forEach(t),Vc=s(ds," forward method, overrides the "),la=r(ds,"CODE",{});var Cm=i(la);Yc=s(Cm,"__call__"),Cm.forEach(t),Gc=s(ds," special method."),ds.forEach(t),Jc=u(Ot),T(ft.$$.fragment,Ot),Xc=u(Ot),T(gt.$$.fragment,Ot),Ot.forEach(t),fe.forEach(t),mr=u(n),Ie=r(n,"H2",{class:!0});var Kr=i(Ie);_t=r(Kr,"A",{id:!0,class:!0,href:!0});var jm=i(_t);da=r(jm,"SPAN",{});var Mm=i(da);T(An.$$.fragment,Mm),Mm.forEach(t),jm.forEach(t),Zc=u(Kr),ca=r(Kr,"SPAN",{});var Pm=i(ca);ep=s(Pm,"LukeForEntitySpanClassification"),Pm.forEach(t),Kr.forEach(t),fr=u(n),O=r(n,"DIV",{class:!0});var ge=i(O);T(Sn.$$.fragment,ge),tp=u(ge),pa=r(ge,"P",{});var Am=i(pa);np=s(Am,`The LUKE model with a span classification head on top (a linear layer on top of the hidden states output) for tasks
such as named entity recognition.`),Am.forEach(t),op=u(ge),On=r(ge,"P",{});var Hr=i(On);sp=s(Hr,"This model inherits from "),Ho=r(Hr,"A",{href:!0});var Sm=i(Ho);ap=s(Sm,"PreTrainedModel"),Sm.forEach(t),rp=s(Hr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Hr.forEach(t),ip=u(ge),In=r(ge,"P",{});var Rr=i(In);lp=s(Rr,"This model is also a PyTorch "),Nn=r(Rr,"A",{href:!0,rel:!0});var Om=i(Nn);dp=s(Om,"torch.nn.Module"),Om.forEach(t),cp=s(Rr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Rr.forEach(t),pp=u(ge),ee=r(ge,"DIV",{class:!0});var It=i(ee);T(Dn.$$.fragment,It),hp=u(It),Ne=r(It,"P",{});var cs=i(Ne);up=s(cs,"The "),Ro=r(cs,"A",{href:!0});var Im=i(Ro);mp=s(Im,"LukeForEntitySpanClassification"),Im.forEach(t),fp=s(cs," forward method, overrides the "),ha=r(cs,"CODE",{});var Nm=i(ha);gp=s(Nm,"__call__"),Nm.forEach(t),_p=s(cs," special method."),cs.forEach(t),kp=u(It),T(kt.$$.fragment,It),yp=u(It),T(yt.$$.fragment,It),It.forEach(t),ge.forEach(t),gr=u(n),De=r(n,"H2",{class:!0});var Qr=i(De);bt=r(Qr,"A",{id:!0,class:!0,href:!0});var Dm=i(bt);ua=r(Dm,"SPAN",{});var Wm=i(ua);T(Wn.$$.fragment,Wm),Wm.forEach(t),Dm.forEach(t),bp=u(Qr),ma=r(Qr,"SPAN",{});var Bm=i(ma);Tp=s(Bm,"LukeForSequenceClassification"),Bm.forEach(t),Qr.forEach(t),_r=u(n),I=r(n,"DIV",{class:!0});var _e=i(I);T(Bn.$$.fragment,_e),wp=u(_e),fa=r(_e,"P",{});var Um=i(fa);vp=s(Um,`The LUKE Model transformer with a sequence classification/regression head on top (a linear layer on top of the
pooled output) e.g. for GLUE tasks.`),Um.forEach(t),Lp=u(_e),Un=r(_e,"P",{});var Vr=i(Un);$p=s(Vr,"This model inherits from "),Qo=r(Vr,"A",{href:!0});var Km=i(Qo);zp=s(Km,"PreTrainedModel"),Km.forEach(t),Ep=s(Vr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Vr.forEach(t),xp=u(_e),Kn=r(_e,"P",{});var Yr=i(Kn);Fp=s(Yr,"This model is also a PyTorch "),Hn=r(Yr,"A",{href:!0,rel:!0});var Hm=i(Hn);qp=s(Hm,"torch.nn.Module"),Hm.forEach(t),Cp=s(Yr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Yr.forEach(t),jp=u(_e),K=r(_e,"DIV",{class:!0});var ke=i(K);T(Rn.$$.fragment,ke),Mp=u(ke),We=r(ke,"P",{});var ps=i(We);Pp=s(ps,"The "),Vo=r(ps,"A",{href:!0});var Rm=i(Vo);Ap=s(Rm,"LukeForSequenceClassification"),Rm.forEach(t),Sp=s(ps," forward method, overrides the "),ga=r(ps,"CODE",{});var Qm=i(ga);Op=s(Qm,"__call__"),Qm.forEach(t),Ip=s(ps," special method."),ps.forEach(t),Np=u(ke),T(Tt.$$.fragment,ke),Dp=u(ke),T(wt.$$.fragment,ke),Wp=u(ke),T(vt.$$.fragment,ke),ke.forEach(t),_e.forEach(t),kr=u(n),Be=r(n,"H2",{class:!0});var Gr=i(Be);Lt=r(Gr,"A",{id:!0,class:!0,href:!0});var Vm=i(Lt);_a=r(Vm,"SPAN",{});var Ym=i(_a);T(Qn.$$.fragment,Ym),Ym.forEach(t),Vm.forEach(t),Bp=u(Gr),ka=r(Gr,"SPAN",{});var Gm=i(ka);Up=s(Gm,"LukeForMultipleChoice"),Gm.forEach(t),Gr.forEach(t),yr=u(n),N=r(n,"DIV",{class:!0});var ye=i(N);T(Vn.$$.fragment,ye),Kp=u(ye),ya=r(ye,"P",{});var Jm=i(ya);Hp=s(Jm,`The LUKE Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RocStories/SWAG tasks.`),Jm.forEach(t),Rp=u(ye),Yn=r(ye,"P",{});var Jr=i(Yn);Qp=s(Jr,"This model inherits from "),Yo=r(Jr,"A",{href:!0});var Xm=i(Yo);Vp=s(Xm,"PreTrainedModel"),Xm.forEach(t),Yp=s(Jr,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Jr.forEach(t),Gp=u(ye),Gn=r(ye,"P",{});var Xr=i(Gn);Jp=s(Xr,"This model is also a PyTorch "),Jn=r(Xr,"A",{href:!0,rel:!0});var Zm=i(Jn);Xp=s(Zm,"torch.nn.Module"),Zm.forEach(t),Zp=s(Xr,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Xr.forEach(t),eh=u(ye),te=r(ye,"DIV",{class:!0});var Nt=i(te);T(Xn.$$.fragment,Nt),th=u(Nt),Ue=r(Nt,"P",{});var hs=i(Ue);nh=s(hs,"The "),Go=r(hs,"A",{href:!0});var ef=i(Go);oh=s(ef,"LukeForMultipleChoice"),ef.forEach(t),sh=s(hs," forward method, overrides the "),ba=r(hs,"CODE",{});var tf=i(ba);ah=s(tf,"__call__"),tf.forEach(t),rh=s(hs," special method."),hs.forEach(t),ih=u(Nt),T($t.$$.fragment,Nt),lh=u(Nt),T(zt.$$.fragment,Nt),Nt.forEach(t),ye.forEach(t),br=u(n),Ke=r(n,"H2",{class:!0});var Zr=i(Ke);Et=r(Zr,"A",{id:!0,class:!0,href:!0});var nf=i(Et);Ta=r(nf,"SPAN",{});var of=i(Ta);T(Zn.$$.fragment,of),of.forEach(t),nf.forEach(t),dh=u(Zr),wa=r(Zr,"SPAN",{});var sf=i(wa);ch=s(sf,"LukeForTokenClassification"),sf.forEach(t),Zr.forEach(t),Tr=u(n),D=r(n,"DIV",{class:!0});var be=i(D);T(eo.$$.fragment,be),ph=u(be),to=r(be,"P",{});var ei=i(to);hh=s(ei,`The LUKE Model with a token classification head on top (a linear layer on top of the hidden-states output). To
solve Named-Entity Recognition (NER) task using LUKE, `),va=r(ei,"CODE",{});var af=i(va);uh=s(af,"LukeForEntitySpanClassification"),af.forEach(t),mh=s(ei,` is more suitable than this
class.`),ei.forEach(t),fh=u(be),no=r(be,"P",{});var ti=i(no);gh=s(ti,"This model inherits from "),Jo=r(ti,"A",{href:!0});var rf=i(Jo);_h=s(rf,"PreTrainedModel"),rf.forEach(t),kh=s(ti,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ti.forEach(t),yh=u(be),oo=r(be,"P",{});var ni=i(oo);bh=s(ni,"This model is also a PyTorch "),so=r(ni,"A",{href:!0,rel:!0});var lf=i(so);Th=s(lf,"torch.nn.Module"),lf.forEach(t),wh=s(ni,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ni.forEach(t),vh=u(be),ne=r(be,"DIV",{class:!0});var Dt=i(ne);T(ao.$$.fragment,Dt),Lh=u(Dt),He=r(Dt,"P",{});var us=i(He);$h=s(us,"The "),Xo=r(us,"A",{href:!0});var df=i(Xo);zh=s(df,"LukeForTokenClassification"),df.forEach(t),Eh=s(us," forward method, overrides the "),La=r(us,"CODE",{});var cf=i(La);xh=s(cf,"__call__"),cf.forEach(t),Fh=s(us," special method."),us.forEach(t),qh=u(Dt),T(xt.$$.fragment,Dt),Ch=u(Dt),T(Ft.$$.fragment,Dt),Dt.forEach(t),be.forEach(t),wr=u(n),Re=r(n,"H2",{class:!0});var oi=i(Re);qt=r(oi,"A",{id:!0,class:!0,href:!0});var pf=i(qt);$a=r(pf,"SPAN",{});var hf=i($a);T(ro.$$.fragment,hf),hf.forEach(t),pf.forEach(t),jh=u(oi),za=r(oi,"SPAN",{});var uf=i(za);Mh=s(uf,"LukeForQuestionAnswering"),uf.forEach(t),oi.forEach(t),vr=u(n),W=r(n,"DIV",{class:!0});var Te=i(W);T(io.$$.fragment,Te),Ph=u(Te),Qe=r(Te,"P",{});var ms=i(Qe);Ah=s(ms,`The LUKE 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 `),Ea=r(ms,"CODE",{});var mf=i(Ea);Sh=s(mf,"span start logits"),mf.forEach(t),Oh=s(ms," and "),xa=r(ms,"CODE",{});var ff=i(xa);Ih=s(ff,"span end logits"),ff.forEach(t),Nh=s(ms,")."),ms.forEach(t),Dh=u(Te),lo=r(Te,"P",{});var si=i(lo);Wh=s(si,"This model inherits from "),Zo=r(si,"A",{href:!0});var gf=i(Zo);Bh=s(gf,"PreTrainedModel"),gf.forEach(t),Uh=s(si,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),si.forEach(t),Kh=u(Te),co=r(Te,"P",{});var ai=i(co);Hh=s(ai,"This model is also a PyTorch "),po=r(ai,"A",{href:!0,rel:!0});var _f=i(po);Rh=s(_f,"torch.nn.Module"),_f.forEach(t),Qh=s(ai,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ai.forEach(t),Vh=u(Te),oe=r(Te,"DIV",{class:!0});var Wt=i(oe);T(ho.$$.fragment,Wt),Yh=u(Wt),Ve=r(Wt,"P",{});var fs=i(Ve);Gh=s(fs,"The "),es=r(fs,"A",{href:!0});var kf=i(es);Jh=s(kf,"LukeForQuestionAnswering"),kf.forEach(t),Xh=s(fs," forward method, overrides the "),Fa=r(fs,"CODE",{});var yf=i(Fa);Zh=s(yf,"__call__"),yf.forEach(t),eu=s(fs," special method."),fs.forEach(t),tu=u(Wt),T(Ct.$$.fragment,Wt),nu=u(Wt),T(jt.$$.fragment,Wt),Wt.forEach(t),Te.forEach(t),this.h()},h(){p(d,"name","hf:doc:metadata"),p(d,"content",JSON.stringify(Qf)),p(m,"id","luke"),p(m,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(m,"href","#luke"),p(f,"class","relative group"),p(Ge,"id","overview"),p(Ge,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Ge,"href","#overview"),p(ve,"class","relative group"),p(Ut,"href","https://arxiv.org/abs/2010.01057"),p(Ut,"rel","nofollow"),p(bo,"href","/docs/transformers/main/en/model_doc/roberta#transformers.RobertaModel"),p(To,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeTokenizer"),p(wo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeTokenizer"),p($o,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForEntityClassification"),p(Qt,"href","https://www.cs.utexas.edu/~eunsol/html_pages/open_entity.html"),p(Qt,"rel","nofollow"),p(zo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForEntityPairClassification"),p(Vt,"href","https://nlp.stanford.edu/projects/tacred/"),p(Vt,"rel","nofollow"),p(xo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForEntitySpanClassification"),p(Fo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeTokenizer"),p(qo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForEntityPairClassification"),p(Yt,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/LUKE"),p(Yt,"rel","nofollow"),p(Jt,"href","https://github.com/studio-ousia/luke/tree/master/notebooks"),p(Jt,"rel","nofollow"),p(Zt,"href","https://huggingface.co/ikuyamada"),p(Zt,"rel","nofollow"),p(en,"href","https://huggingface.co/nielsr"),p(en,"rel","nofollow"),p(tn,"href","https://github.com/studio-ousia/luke"),p(tn,"rel","nofollow"),p(et,"id","transformers.LukeConfig"),p(et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(et,"href","#transformers.LukeConfig"),p(ze,"class","relative group"),p(jo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeModel"),p(sn,"href","https://huggingface.co/studio-ousia/luke-base"),p(sn,"rel","nofollow"),p(Mo,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(Po,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),p(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(nt,"id","transformers.LukeTokenizer"),p(nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(nt,"href","#transformers.LukeTokenizer"),p(Fe,"class","relative group"),p(Ao,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),p(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(So,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(rt,"id","transformers.LukeModel"),p(rt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(rt,"href","#transformers.LukeModel"),p(qe,"class","relative group"),p(Oo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(fn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(fn,"rel","nofollow"),p(Io,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeModel"),p(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(dt,"id","transformers.LukeForMaskedLM"),p(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"),p(dt,"href","#transformers.LukeForMaskedLM"),p(je,"class","relative group"),p(No,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Tn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Tn,"rel","nofollow"),p(Do,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForMaskedLM"),p(ce,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(pt,"id","transformers.LukeForEntityClassification"),p(pt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(pt,"href","#transformers.LukeForEntityClassification"),p(Pe,"class","relative group"),p(Wo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(En,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(En,"rel","nofollow"),p(Bo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForEntityClassification"),p(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(mt,"id","transformers.LukeForEntityPairClassification"),p(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"),p(mt,"href","#transformers.LukeForEntityPairClassification"),p(Se,"class","relative group"),p(Uo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Mn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Mn,"rel","nofollow"),p(Ko,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForEntityPairClassification"),p(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(_t,"id","transformers.LukeForEntitySpanClassification"),p(_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"),p(_t,"href","#transformers.LukeForEntitySpanClassification"),p(Ie,"class","relative group"),p(Ho,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Nn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Nn,"rel","nofollow"),p(Ro,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForEntitySpanClassification"),p(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(bt,"id","transformers.LukeForSequenceClassification"),p(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"),p(bt,"href","#transformers.LukeForSequenceClassification"),p(De,"class","relative group"),p(Qo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Hn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Hn,"rel","nofollow"),p(Vo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForSequenceClassification"),p(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Lt,"id","transformers.LukeForMultipleChoice"),p(Lt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Lt,"href","#transformers.LukeForMultipleChoice"),p(Be,"class","relative group"),p(Yo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(Jn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(Jn,"rel","nofollow"),p(Go,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForMultipleChoice"),p(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(Et,"id","transformers.LukeForTokenClassification"),p(Et,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(Et,"href","#transformers.LukeForTokenClassification"),p(Ke,"class","relative group"),p(Jo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(so,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(so,"rel","nofollow"),p(Xo,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForTokenClassification"),p(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(qt,"id","transformers.LukeForQuestionAnswering"),p(qt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),p(qt,"href","#transformers.LukeForQuestionAnswering"),p(Re,"class","relative group"),p(Zo,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),p(po,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),p(po,"rel","nofollow"),p(es,"href","/docs/transformers/main/en/model_doc/luke#transformers.LukeForQuestionAnswering"),p(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),p(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(n,g){e(document.head,d),k(n,y,g),k(n,f,g),e(f,m),e(m,_),w(l,_,null),e(f,c),e(f,E),e(E,ri),k(n,Qa,g),k(n,ve,g),e(ve,Ge),e(Ge,gs),w(Bt,gs,null),e(ve,ii),e(ve,_s),e(_s,li),k(n,Va,g),k(n,Je,g),e(Je,di),e(Je,Ut),e(Ut,ci),e(Je,pi),k(n,Ya,g),k(n,_o,g),e(_o,hi),k(n,Ga,g),k(n,ko,g),e(ko,ks),e(ks,ui),k(n,Ja,g),k(n,yo,g),e(yo,mi),k(n,Xa,g),k(n,V,g),e(V,ys),e(ys,Kt),e(Kt,fi),e(Kt,bo),e(bo,gi),e(Kt,_i),e(V,ki),e(V,bs),e(bs,C),e(C,yi),e(C,Ts),e(Ts,bi),e(C,Ti),e(C,ws),e(ws,wi),e(C,vi),e(C,vs),e(vs,Li),e(C,$i),e(C,Ls),e(Ls,zi),e(C,Ei),e(C,To),e(To,xi),e(C,Fi),e(V,qi),e(V,Ht),e(Ht,Y),e(Y,wo),e(wo,Ci),e(Y,ji),e(Y,$s),e($s,Mi),e(Y,Pi),e(Y,zs),e(zs,Ai),e(Y,Si),e(Y,Es),e(Es,Oi),e(Y,Ii),e(Ht,Ni),e(Ht,Rt),e(Rt,vo),e(vo,xs),e(xs,Di),e(vo,Wi),e(Rt,Bi),e(Rt,Lo),e(Lo,Fs),e(Fs,Ui),e(Lo,Ki),e(V,Hi),e(V,H),e(H,qs),e(qs,Ri),e(H,Qi),e(H,Le),e(Le,Xe),e(Xe,$o),e($o,Vi),e(Xe,Yi),e(Xe,Qt),e(Qt,Gi),e(Xe,Ji),e(Le,Xi),e(Le,Ze),e(Ze,zo),e(zo,Zi),e(Ze,el),e(Ze,Vt),e(Vt,tl),e(Ze,nl),e(Le,ol),e(Le,Eo),e(Eo,xo),e(xo,sl),e(Eo,al),e(H,rl),e(H,U),e(U,Fo),e(Fo,il),e(U,ll),e(U,Cs),e(Cs,dl),e(U,cl),e(U,js),e(js,pl),e(U,hl),e(U,Ms),e(Ms,ul),e(U,ml),e(U,Ps),e(Ps,fl),e(U,gl),e(H,_l),e(H,$e),e($e,kl),e($e,qo),e(qo,yl),e($e,bl),e($e,Yt),e(Yt,Tl),e($e,wl),e(H,vl),e(H,Gt),e(Gt,Ll),e(Gt,Jt),e(Jt,$l),e(Gt,zl),k(n,Za,g),k(n,Co,g),e(Co,El),k(n,er,g),w(Xt,n,g),k(n,tr,g),k(n,G,g),e(G,xl),e(G,Zt),e(Zt,Fl),e(G,ql),e(G,en),e(en,Cl),e(G,jl),e(G,tn),e(tn,Ml),e(G,Pl),k(n,nr,g),k(n,ze,g),e(ze,et),e(et,As),w(nn,As,null),e(ze,Al),e(ze,Ss),e(Ss,Sl),k(n,or,g),k(n,R,g),w(on,R,null),e(R,Ol),e(R,Ee),e(Ee,Il),e(Ee,jo),e(jo,Nl),e(Ee,Dl),e(Ee,sn),e(sn,Wl),e(Ee,Bl),e(R,Ul),e(R,xe),e(xe,Kl),e(xe,Mo),e(Mo,Hl),e(xe,Rl),e(xe,Po),e(Po,Ql),e(xe,Vl),e(R,Yl),w(tt,R,null),k(n,sr,g),k(n,Fe,g),e(Fe,nt),e(nt,Os),w(an,Os,null),e(Fe,Gl),e(Fe,Is),e(Is,Jl),k(n,ar,g),k(n,x,g),w(rn,x,null),e(x,Xl),e(x,Ns),e(Ns,Zl),e(x,ed),e(x,Ds),e(Ds,td),e(x,nd),w(ot,x,null),e(x,od),e(x,ln),e(ln,sd),e(ln,Ws),e(Ws,ad),e(ln,rd),e(x,id),w(st,x,null),e(x,ld),e(x,j),e(j,dd),e(j,Ao),e(Ao,cd),e(j,pd),e(j,Bs),e(Bs,hd),e(j,ud),e(j,Us),e(Us,md),e(j,fd),e(j,Ks),e(Ks,gd),e(j,_d),e(j,Hs),e(Hs,kd),e(j,yd),e(x,bd),e(x,at),w(dn,at,null),e(at,Td),e(at,Rs),e(Rs,wd),e(x,vd),e(x,So),w(cn,So,null),k(n,rr,g),k(n,qe,g),e(qe,rt),e(rt,Qs),w(pn,Qs,null),e(qe,Ld),e(qe,Vs),e(Vs,$d),k(n,ir,g),k(n,M,g),w(hn,M,null),e(M,zd),e(M,Ys),e(Ys,Ed),e(M,xd),e(M,un),e(un,Fd),e(un,Oo),e(Oo,qd),e(un,Cd),e(M,jd),e(M,mn),e(mn,Md),e(mn,fn),e(fn,Pd),e(mn,Ad),e(M,Sd),e(M,J),w(gn,J,null),e(J,Od),e(J,Ce),e(Ce,Id),e(Ce,Io),e(Io,Nd),e(Ce,Dd),e(Ce,Gs),e(Gs,Wd),e(Ce,Bd),e(J,Ud),w(it,J,null),e(J,Kd),w(lt,J,null),k(n,lr,g),k(n,je,g),e(je,dt),e(dt,Js),w(_n,Js,null),e(je,Hd),e(je,Xs),e(Xs,Rd),k(n,dr,g),k(n,P,g),w(kn,P,null),e(P,Qd),e(P,Zs),e(Zs,Vd),e(P,Yd),e(P,yn),e(yn,Gd),e(yn,No),e(No,Jd),e(yn,Xd),e(P,Zd),e(P,bn),e(bn,ec),e(bn,Tn),e(Tn,tc),e(bn,nc),e(P,oc),e(P,ce),w(wn,ce,null),e(ce,sc),e(ce,Me),e(Me,ac),e(Me,Do),e(Do,rc),e(Me,ic),e(Me,ea),e(ea,lc),e(Me,dc),e(ce,cc),w(ct,ce,null),k(n,cr,g),k(n,Pe,g),e(Pe,pt),e(pt,ta),w(vn,ta,null),e(Pe,pc),e(Pe,na),e(na,hc),k(n,pr,g),k(n,A,g),w(Ln,A,null),e(A,uc),e(A,oa),e(oa,mc),e(A,fc),e(A,$n),e($n,gc),e($n,Wo),e(Wo,_c),e($n,kc),e(A,yc),e(A,zn),e(zn,bc),e(zn,En),e(En,Tc),e(zn,wc),e(A,vc),e(A,X),w(xn,X,null),e(X,Lc),e(X,Ae),e(Ae,$c),e(Ae,Bo),e(Bo,zc),e(Ae,Ec),e(Ae,sa),e(sa,xc),e(Ae,Fc),e(X,qc),w(ht,X,null),e(X,Cc),w(ut,X,null),k(n,hr,g),k(n,Se,g),e(Se,mt),e(mt,aa),w(Fn,aa,null),e(Se,jc),e(Se,ra),e(ra,Mc),k(n,ur,g),k(n,S,g),w(qn,S,null),e(S,Pc),e(S,ia),e(ia,Ac),e(S,Sc),e(S,Cn),e(Cn,Oc),e(Cn,Uo),e(Uo,Ic),e(Cn,Nc),e(S,Dc),e(S,jn),e(jn,Wc),e(jn,Mn),e(Mn,Bc),e(jn,Uc),e(S,Kc),e(S,Z),w(Pn,Z,null),e(Z,Hc),e(Z,Oe),e(Oe,Rc),e(Oe,Ko),e(Ko,Qc),e(Oe,Vc),e(Oe,la),e(la,Yc),e(Oe,Gc),e(Z,Jc),w(ft,Z,null),e(Z,Xc),w(gt,Z,null),k(n,mr,g),k(n,Ie,g),e(Ie,_t),e(_t,da),w(An,da,null),e(Ie,Zc),e(Ie,ca),e(ca,ep),k(n,fr,g),k(n,O,g),w(Sn,O,null),e(O,tp),e(O,pa),e(pa,np),e(O,op),e(O,On),e(On,sp),e(On,Ho),e(Ho,ap),e(On,rp),e(O,ip),e(O,In),e(In,lp),e(In,Nn),e(Nn,dp),e(In,cp),e(O,pp),e(O,ee),w(Dn,ee,null),e(ee,hp),e(ee,Ne),e(Ne,up),e(Ne,Ro),e(Ro,mp),e(Ne,fp),e(Ne,ha),e(ha,gp),e(Ne,_p),e(ee,kp),w(kt,ee,null),e(ee,yp),w(yt,ee,null),k(n,gr,g),k(n,De,g),e(De,bt),e(bt,ua),w(Wn,ua,null),e(De,bp),e(De,ma),e(ma,Tp),k(n,_r,g),k(n,I,g),w(Bn,I,null),e(I,wp),e(I,fa),e(fa,vp),e(I,Lp),e(I,Un),e(Un,$p),e(Un,Qo),e(Qo,zp),e(Un,Ep),e(I,xp),e(I,Kn),e(Kn,Fp),e(Kn,Hn),e(Hn,qp),e(Kn,Cp),e(I,jp),e(I,K),w(Rn,K,null),e(K,Mp),e(K,We),e(We,Pp),e(We,Vo),e(Vo,Ap),e(We,Sp),e(We,ga),e(ga,Op),e(We,Ip),e(K,Np),w(Tt,K,null),e(K,Dp),w(wt,K,null),e(K,Wp),w(vt,K,null),k(n,kr,g),k(n,Be,g),e(Be,Lt),e(Lt,_a),w(Qn,_a,null),e(Be,Bp),e(Be,ka),e(ka,Up),k(n,yr,g),k(n,N,g),w(Vn,N,null),e(N,Kp),e(N,ya),e(ya,Hp),e(N,Rp),e(N,Yn),e(Yn,Qp),e(Yn,Yo),e(Yo,Vp),e(Yn,Yp),e(N,Gp),e(N,Gn),e(Gn,Jp),e(Gn,Jn),e(Jn,Xp),e(Gn,Zp),e(N,eh),e(N,te),w(Xn,te,null),e(te,th),e(te,Ue),e(Ue,nh),e(Ue,Go),e(Go,oh),e(Ue,sh),e(Ue,ba),e(ba,ah),e(Ue,rh),e(te,ih),w($t,te,null),e(te,lh),w(zt,te,null),k(n,br,g),k(n,Ke,g),e(Ke,Et),e(Et,Ta),w(Zn,Ta,null),e(Ke,dh),e(Ke,wa),e(wa,ch),k(n,Tr,g),k(n,D,g),w(eo,D,null),e(D,ph),e(D,to),e(to,hh),e(to,va),e(va,uh),e(to,mh),e(D,fh),e(D,no),e(no,gh),e(no,Jo),e(Jo,_h),e(no,kh),e(D,yh),e(D,oo),e(oo,bh),e(oo,so),e(so,Th),e(oo,wh),e(D,vh),e(D,ne),w(ao,ne,null),e(ne,Lh),e(ne,He),e(He,$h),e(He,Xo),e(Xo,zh),e(He,Eh),e(He,La),e(La,xh),e(He,Fh),e(ne,qh),w(xt,ne,null),e(ne,Ch),w(Ft,ne,null),k(n,wr,g),k(n,Re,g),e(Re,qt),e(qt,$a),w(ro,$a,null),e(Re,jh),e(Re,za),e(za,Mh),k(n,vr,g),k(n,W,g),w(io,W,null),e(W,Ph),e(W,Qe),e(Qe,Ah),e(Qe,Ea),e(Ea,Sh),e(Qe,Oh),e(Qe,xa),e(xa,Ih),e(Qe,Nh),e(W,Dh),e(W,lo),e(lo,Wh),e(lo,Zo),e(Zo,Bh),e(lo,Uh),e(W,Kh),e(W,co),e(co,Hh),e(co,po),e(po,Rh),e(co,Qh),e(W,Vh),e(W,oe),w(ho,oe,null),e(oe,Yh),e(oe,Ve),e(Ve,Gh),e(Ve,es),e(es,Jh),e(Ve,Xh),e(Ve,Fa),e(Fa,Zh),e(Ve,eu),e(oe,tu),w(Ct,oe,null),e(oe,nu),w(jt,oe,null),Lr=!0},p(n,[g]){const uo={};g&2&&(uo.$$scope={dirty:g,ctx:n}),tt.$set(uo);const qa={};g&2&&(qa.$$scope={dirty:g,ctx:n}),ot.$set(qa);const Ca={};g&2&&(Ca.$$scope={dirty:g,ctx:n}),st.$set(Ca);const ja={};g&2&&(ja.$$scope={dirty:g,ctx:n}),it.$set(ja);const mo={};g&2&&(mo.$$scope={dirty:g,ctx:n}),lt.$set(mo);const Ma={};g&2&&(Ma.$$scope={dirty:g,ctx:n}),ct.$set(Ma);const Pa={};g&2&&(Pa.$$scope={dirty:g,ctx:n}),ht.$set(Pa);const Aa={};g&2&&(Aa.$$scope={dirty:g,ctx:n}),ut.$set(Aa);const fo={};g&2&&(fo.$$scope={dirty:g,ctx:n}),ft.$set(fo);const Sa={};g&2&&(Sa.$$scope={dirty:g,ctx:n}),gt.$set(Sa);const Oa={};g&2&&(Oa.$$scope={dirty:g,ctx:n}),kt.$set(Oa);const Ia={};g&2&&(Ia.$$scope={dirty:g,ctx:n}),yt.$set(Ia);const Na={};g&2&&(Na.$$scope={dirty:g,ctx:n}),Tt.$set(Na);const Da={};g&2&&(Da.$$scope={dirty:g,ctx:n}),wt.$set(Da);const re={};g&2&&(re.$$scope={dirty:g,ctx:n}),vt.$set(re);const Wa={};g&2&&(Wa.$$scope={dirty:g,ctx:n}),$t.$set(Wa);const go={};g&2&&(go.$$scope={dirty:g,ctx:n}),zt.$set(go);const Ba={};g&2&&(Ba.$$scope={dirty:g,ctx:n}),xt.$set(Ba);const Ua={};g&2&&(Ua.$$scope={dirty:g,ctx:n}),Ft.$set(Ua);const B={};g&2&&(B.$$scope={dirty:g,ctx:n}),Ct.$set(B);const Ka={};g&2&&(Ka.$$scope={dirty:g,ctx:n}),jt.$set(Ka)},i(n){Lr||(v(l.$$.fragment,n),v(Bt.$$.fragment,n),v(Xt.$$.fragment,n),v(nn.$$.fragment,n),v(on.$$.fragment,n),v(tt.$$.fragment,n),v(an.$$.fragment,n),v(rn.$$.fragment,n),v(ot.$$.fragment,n),v(st.$$.fragment,n),v(dn.$$.fragment,n),v(cn.$$.fragment,n),v(pn.$$.fragment,n),v(hn.$$.fragment,n),v(gn.$$.fragment,n),v(it.$$.fragment,n),v(lt.$$.fragment,n),v(_n.$$.fragment,n),v(kn.$$.fragment,n),v(wn.$$.fragment,n),v(ct.$$.fragment,n),v(vn.$$.fragment,n),v(Ln.$$.fragment,n),v(xn.$$.fragment,n),v(ht.$$.fragment,n),v(ut.$$.fragment,n),v(Fn.$$.fragment,n),v(qn.$$.fragment,n),v(Pn.$$.fragment,n),v(ft.$$.fragment,n),v(gt.$$.fragment,n),v(An.$$.fragment,n),v(Sn.$$.fragment,n),v(Dn.$$.fragment,n),v(kt.$$.fragment,n),v(yt.$$.fragment,n),v(Wn.$$.fragment,n),v(Bn.$$.fragment,n),v(Rn.$$.fragment,n),v(Tt.$$.fragment,n),v(wt.$$.fragment,n),v(vt.$$.fragment,n),v(Qn.$$.fragment,n),v(Vn.$$.fragment,n),v(Xn.$$.fragment,n),v($t.$$.fragment,n),v(zt.$$.fragment,n),v(Zn.$$.fragment,n),v(eo.$$.fragment,n),v(ao.$$.fragment,n),v(xt.$$.fragment,n),v(Ft.$$.fragment,n),v(ro.$$.fragment,n),v(io.$$.fragment,n),v(ho.$$.fragment,n),v(Ct.$$.fragment,n),v(jt.$$.fragment,n),Lr=!0)},o(n){L(l.$$.fragment,n),L(Bt.$$.fragment,n),L(Xt.$$.fragment,n),L(nn.$$.fragment,n),L(on.$$.fragment,n),L(tt.$$.fragment,n),L(an.$$.fragment,n),L(rn.$$.fragment,n),L(ot.$$.fragment,n),L(st.$$.fragment,n),L(dn.$$.fragment,n),L(cn.$$.fragment,n),L(pn.$$.fragment,n),L(hn.$$.fragment,n),L(gn.$$.fragment,n),L(it.$$.fragment,n),L(lt.$$.fragment,n),L(_n.$$.fragment,n),L(kn.$$.fragment,n),L(wn.$$.fragment,n),L(ct.$$.fragment,n),L(vn.$$.fragment,n),L(Ln.$$.fragment,n),L(xn.$$.fragment,n),L(ht.$$.fragment,n),L(ut.$$.fragment,n),L(Fn.$$.fragment,n),L(qn.$$.fragment,n),L(Pn.$$.fragment,n),L(ft.$$.fragment,n),L(gt.$$.fragment,n),L(An.$$.fragment,n),L(Sn.$$.fragment,n),L(Dn.$$.fragment,n),L(kt.$$.fragment,n),L(yt.$$.fragment,n),L(Wn.$$.fragment,n),L(Bn.$$.fragment,n),L(Rn.$$.fragment,n),L(Tt.$$.fragment,n),L(wt.$$.fragment,n),L(vt.$$.fragment,n),L(Qn.$$.fragment,n),L(Vn.$$.fragment,n),L(Xn.$$.fragment,n),L($t.$$.fragment,n),L(zt.$$.fragment,n),L(Zn.$$.fragment,n),L(eo.$$.fragment,n),L(ao.$$.fragment,n),L(xt.$$.fragment,n),L(Ft.$$.fragment,n),L(ro.$$.fragment,n),L(io.$$.fragment,n),L(ho.$$.fragment,n),L(Ct.$$.fragment,n),L(jt.$$.fragment,n),Lr=!1},d(n){t(d),n&&t(y),n&&t(f),$(l),n&&t(Qa),n&&t(ve),$(Bt),n&&t(Va),n&&t(Je),n&&t(Ya),n&&t(_o),n&&t(Ga),n&&t(ko),n&&t(Ja),n&&t(yo),n&&t(Xa),n&&t(V),n&&t(Za),n&&t(Co),n&&t(er),$(Xt,n),n&&t(tr),n&&t(G),n&&t(nr),n&&t(ze),$(nn),n&&t(or),n&&t(R),$(on),$(tt),n&&t(sr),n&&t(Fe),$(an),n&&t(ar),n&&t(x),$(rn),$(ot),$(st),$(dn),$(cn),n&&t(rr),n&&t(qe),$(pn),n&&t(ir),n&&t(M),$(hn),$(gn),$(it),$(lt),n&&t(lr),n&&t(je),$(_n),n&&t(dr),n&&t(P),$(kn),$(wn),$(ct),n&&t(cr),n&&t(Pe),$(vn),n&&t(pr),n&&t(A),$(Ln),$(xn),$(ht),$(ut),n&&t(hr),n&&t(Se),$(Fn),n&&t(ur),n&&t(S),$(qn),$(Pn),$(ft),$(gt),n&&t(mr),n&&t(Ie),$(An),n&&t(fr),n&&t(O),$(Sn),$(Dn),$(kt),$(yt),n&&t(gr),n&&t(De),$(Wn),n&&t(_r),n&&t(I),$(Bn),$(Rn),$(Tt),$(wt),$(vt),n&&t(kr),n&&t(Be),$(Qn),n&&t(yr),n&&t(N),$(Vn),$(Xn),$($t),$(zt),n&&t(br),n&&t(Ke),$(Zn),n&&t(Tr),n&&t(D),$(eo),$(ao),$(xt),$(Ft),n&&t(wr),n&&t(Re),$(ro),n&&t(vr),n&&t(W),$(io),$(ho),$(Ct),$(jt)}}}const Qf={local:"luke",sections:[{local:"overview",title:"Overview"},{local:"transformers.LukeConfig",title:"LukeConfig"},{local:"transformers.LukeTokenizer",title:"LukeTokenizer"},{local:"transformers.LukeModel",title:"LukeModel"},{local:"transformers.LukeForMaskedLM",title:"LukeForMaskedLM"},{local:"transformers.LukeForEntityClassification",title:"LukeForEntityClassification"},{local:"transformers.LukeForEntityPairClassification",title:"LukeForEntityPairClassification"},{local:"transformers.LukeForEntitySpanClassification",title:"LukeForEntitySpanClassification"},{local:"transformers.LukeForSequenceClassification",title:"LukeForSequenceClassification"},{local:"transformers.LukeForMultipleChoice",title:"LukeForMultipleChoice"},{local:"transformers.LukeForTokenClassification",title:"LukeForTokenClassification"},{local:"transformers.LukeForQuestionAnswering",title:"LukeForQuestionAnswering"}],title:"LUKE"};function Vf(z){return Lf(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class tg extends bf{constructor(d){super();Tf(this,d,Vf,Rf,wf,{})}}export{tg as default,Qf as metadata};
