import{S as cg,i as pg,s as hg,e as a,k as h,w as b,t as n,M as ug,c as r,d as t,m as u,a as i,x as v,h as s,b as c,G as e,g as k,y as T,q as w,o as L,B as $,v as mg,L as ce}from"../../chunks/vendor-hf-doc-builder.js";import{T as Le}from"../../chunks/Tip-hf-doc-builder.js";import{D as F}from"../../chunks/Docstring-hf-doc-builder.js";import{C as re}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Q}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as de}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function fg(z){let d,y,f,m,_;return m=new re({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=n("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Examples:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function gg(z){let d,y,f,m,_;return m=new re({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=n("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 p=i(d);y=s(p,"be encoded differently whether it is at the beginning of the sentence (without space) or not:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function _g(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("When used with "),f=a("code"),m=n("is_split_into_words=True"),_=n(", this tokenizer will add a space before each word (even the first one).")},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"When used with "),f=r(p,"CODE",{});var E=i(f);m=s(E,"is_split_into_words=True"),E.forEach(t),_=s(p,", this tokenizer will add a space before each word (even the first one)."),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function kg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function yg(z){let d,y,f,m,_;return m=new re({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=n("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Examples:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function bg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function vg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Tg(z){let d,y,f,m,_;return m=new re({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=n("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Examples:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function wg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Lg(z){let d,y,f,m,_;return m=new re({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=n("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Examples:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function $g(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function zg(z){let d,y,f,m,_;return m=new re({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=n("Examples:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Examples:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Eg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function xg(z){let d,y,f,m,_;return m=new re({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=n("Example of single-label classification:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Example of single-label classification:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Fg(z){let d,y,f,m,_;return m=new re({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=n("Example of multi-label classification:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Example of multi-label classification:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function qg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Cg(z){let d,y,f,m,_;return m=new re({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=n("Example:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Example:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function jg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Mg(z){let d,y,f,m,_;return m=new re({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=n("Example:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Example:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Pg(z){let d,y,f,m,_;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),f=a("code"),m=n("Module"),_=n(`
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 p=i(d);y=s(p,"Although the recipe for forward pass needs to be defined within this function, one should call the "),f=r(p,"CODE",{});var E=i(f);m=s(E,"Module"),E.forEach(t),_=s(p,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),p.forEach(t)},m(l,p){k(l,d,p),e(d,y),e(d,f),e(f,m),e(d,_)},d(l){l&&t(d)}}}function Ag(z){let d,y,f,m,_;return m=new re({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=n("Example:"),f=h(),b(m.$$.fragment)},l(l){d=r(l,"P",{});var p=i(d);y=s(p,"Example:"),p.forEach(t),f=u(l),v(m.$$.fragment,l)},m(l,p){k(l,d,p),e(d,y),k(l,f,p),T(m,l,p),_=!0},p:ce,i(l){_||(w(m.$$.fragment,l),_=!0)},o(l){L(m.$$.fragment,l),_=!1},d(l){l&&t(d),l&&t(f),$(m,l)}}}function Sg(z){let d,y,f,m,_,l,p,E,zi,cr,$e,Ze,zs,Qt,Ei,Es,xi,pr,et,Fi,Rt,qi,Ci,hr,Tn,ji,ur,wn,xs,Mi,mr,Ln,Pi,fr,Y,Fs,Vt,Ai,$n,Si,Oi,Ii,qs,C,Ni,Cs,Di,Wi,js,Bi,Ui,Ms,Ki,Hi,Ps,Qi,Ri,zn,Vi,Yi,Gi,Yt,G,En,Ji,Xi,As,Zi,el,Ss,tl,ol,Os,nl,sl,al,Gt,xn,Is,rl,il,ll,Fn,Ns,dl,cl,pl,R,Ds,hl,ul,ze,tt,qn,ml,fl,Jt,gl,_l,kl,ot,Cn,yl,bl,Xt,vl,Tl,wl,jn,Mn,Ll,$l,zl,U,Pn,El,xl,Ws,Fl,ql,Bs,Cl,jl,Us,Ml,Pl,Ks,Al,Sl,Ol,Ee,Il,An,Nl,Dl,Zt,Wl,Bl,Ul,eo,Kl,to,Hl,Ql,gr,Sn,Rl,_r,oo,kr,J,Vl,no,Yl,Gl,so,Jl,Xl,ao,Zl,ed,yr,xe,nt,Hs,ro,td,Qs,od,br,K,Rs,On,nd,sd,Vs,In,ad,rd,Ys,Nn,id,ld,Gs,Dn,dd,cd,Js,Wn,pd,vr,Fe,st,Xs,io,hd,Zs,ud,Tr,V,lo,md,qe,fd,Bn,gd,_d,co,kd,yd,bd,Ce,vd,Un,Td,wd,Kn,Ld,$d,zd,at,wr,je,rt,ea,po,Ed,ta,xd,Lr,x,ho,Fd,oa,qd,Cd,na,jd,Md,it,Pd,uo,Ad,sa,Sd,Od,Id,lt,Nd,j,Dd,Hn,Wd,Bd,aa,Ud,Kd,ra,Hd,Qd,ia,Rd,Vd,la,Yd,Gd,Jd,dt,mo,Xd,da,Zd,ec,Qn,fo,$r,Me,ct,ca,go,tc,pa,oc,zr,M,_o,nc,ha,sc,ac,ko,rc,Rn,ic,lc,dc,yo,cc,bo,pc,hc,uc,X,vo,mc,Pe,fc,Vn,gc,_c,ua,kc,yc,bc,pt,vc,ht,Er,Ae,ut,ma,To,Tc,fa,wc,xr,P,wo,Lc,ga,$c,zc,Lo,Ec,Yn,xc,Fc,qc,$o,Cc,zo,jc,Mc,Pc,pe,Eo,Ac,Se,Sc,Gn,Oc,Ic,_a,Nc,Dc,Wc,mt,Fr,Oe,ft,ka,xo,Bc,ya,Uc,qr,A,Fo,Kc,ba,Hc,Qc,qo,Rc,Jn,Vc,Yc,Gc,Co,Jc,jo,Xc,Zc,ep,Z,Mo,tp,Ie,op,Xn,np,sp,va,ap,rp,ip,gt,lp,_t,Cr,Ne,kt,Ta,Po,dp,wa,cp,jr,S,Ao,pp,La,hp,up,So,mp,Zn,fp,gp,_p,Oo,kp,Io,yp,bp,vp,ee,No,Tp,De,wp,es,Lp,$p,$a,zp,Ep,xp,yt,Fp,bt,Mr,We,vt,za,Do,qp,Ea,Cp,Pr,O,Wo,jp,xa,Mp,Pp,Bo,Ap,ts,Sp,Op,Ip,Uo,Np,Ko,Dp,Wp,Bp,te,Ho,Up,Be,Kp,os,Hp,Qp,Fa,Rp,Vp,Yp,Tt,Gp,wt,Ar,Ue,Lt,qa,Qo,Jp,Ca,Xp,Sr,I,Ro,Zp,ja,eh,th,Vo,oh,ns,nh,sh,ah,Yo,rh,Go,ih,lh,dh,H,Jo,ch,Ke,ph,ss,hh,uh,Ma,mh,fh,gh,$t,_h,zt,kh,Et,Or,He,xt,Pa,Xo,yh,Aa,bh,Ir,N,Zo,vh,Sa,Th,wh,en,Lh,as,$h,zh,Eh,tn,xh,on,Fh,qh,Ch,oe,nn,jh,Qe,Mh,rs,Ph,Ah,Oa,Sh,Oh,Ih,Ft,Nh,qt,Nr,Re,Ct,Ia,sn,Dh,Na,Wh,Dr,D,an,Bh,rn,Uh,Da,Kh,Hh,Qh,ln,Rh,is,Vh,Yh,Gh,dn,Jh,cn,Xh,Zh,eu,ne,pn,tu,Ve,ou,ls,nu,su,Wa,au,ru,iu,jt,lu,Mt,Wr,Ye,Pt,Ba,hn,du,Ua,cu,Br,W,un,pu,Ge,hu,Ka,uu,mu,Ha,fu,gu,_u,mn,ku,ds,yu,bu,vu,fn,Tu,gn,wu,Lu,$u,se,_n,zu,Je,Eu,cs,xu,Fu,Qa,qu,Cu,ju,At,Mu,St,Ur;return l=new Q({}),Qt=new Q({}),oo=new re({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])`}}),ro=new Q({}),io=new Q({}),lo=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/v4.27.1/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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/configuration_luke.py#L29"}}),at=new de({props:{anchor:"transformers.LukeConfig.example",$$slots:{default:[fg]},$$scope:{ctx:z}}}),po=new Q({}),ho=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/v4.27.1/src/transformers/models/luke/tokenization_luke.py#L193"}}),it=new de({props:{anchor:"transformers.LukeTokenizer.example",$$slots:{default:[gg]},$$scope:{ctx:z}}}),lt=new Le({props:{$$slots:{default:[_g]},$$scope:{ctx:z}}}),mo=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[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.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/v4.27.1/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/v4.27.1/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/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/tokenization_luke.py#L573",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),fo=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/v4.27.1/src/transformers/models/luke/tokenization_luke.py#L1688"}}),go=new Q({}),_o=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1024"}}),vo=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1055",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/v4.27.1/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>
`}}),pt=new Le({props:{$$slots:{default:[kg]},$$scope:{ctx:z}}}),ht=new de({props:{anchor:"transformers.LukeModel.forward.example",$$slots:{default:[yg]},$$scope:{ctx:z}}}),To=new Q({}),wo=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1280"}}),Eo=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1316",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/v4.27.1/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>
`}}),mt=new Le({props:{$$slots:{default:[bg]},$$scope:{ctx:z}}}),xo=new Q({}),Fo=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1423"}}),Mo=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1436",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/v4.27.1/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>
`}}),gt=new Le({props:{$$slots:{default:[vg]},$$scope:{ctx:z}}}),_t=new de({props:{anchor:"transformers.LukeForEntityClassification.forward.example",$$slots:{default:[Tg]},$$scope:{ctx:z}}}),Po=new Q({}),Ao=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1536"}}),No=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1549",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/v4.27.1/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>
`}}),yt=new Le({props:{$$slots:{default:[wg]},$$scope:{ctx:z}}}),bt=new de({props:{anchor:"transformers.LukeForEntityPairClassification.forward.example",$$slots:{default:[Lg]},$$scope:{ctx:z}}}),Do=new Q({}),Wo=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1654"}}),Ho=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1667",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/v4.27.1/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>
`}}),Tt=new Le({props:{$$slots:{default:[$g]},$$scope:{ctx:z}}}),wt=new de({props:{anchor:"transformers.LukeForEntitySpanClassification.forward.example",$$slots:{default:[zg]},$$scope:{ctx:z}}}),Qo=new Q({}),Ro=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1798"}}),Jo=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1811",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/v4.27.1/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>
`}}),$t=new Le({props:{$$slots:{default:[Eg]},$$scope:{ctx:z}}}),zt=new de({props:{anchor:"transformers.LukeForSequenceClassification.forward.example",$$slots:{default:[xg]},$$scope:{ctx:z}}}),Et=new de({props:{anchor:"transformers.LukeForSequenceClassification.forward.example-2",$$slots:{default:[Fg]},$$scope:{ctx:z}}}),Xo=new Q({}),Zo=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L2123"}}),nn=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L2136",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/v4.27.1/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>
`}}),Ft=new Le({props:{$$slots:{default:[qg]},$$scope:{ctx:z}}}),qt=new de({props:{anchor:"transformers.LukeForMultipleChoice.forward.example",$$slots:{default:[Cg]},$$scope:{ctx:z}}}),sn=new Q({}),an=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1910"}}),pn=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L1924",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/v4.27.1/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>
`}}),jt=new Le({props:{$$slots:{default:[jg]},$$scope:{ctx:z}}}),Mt=new de({props:{anchor:"transformers.LukeForTokenClassification.forward.example",$$slots:{default:[Mg]},$$scope:{ctx:z}}}),hn=new Q({}),un=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/v4.27.1/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/v4.27.1/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/v4.27.1/src/transformers/models/luke/modeling_luke.py#L2004"}}),_n=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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/v4.27.1/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/v4.27.1/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/v4.27.1/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/v4.27.1/src/transformers/models/luke/modeling_luke.py#L2016",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/v4.27.1/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>
`}}),At=new Le({props:{$$slots:{default:[Pg]},$$scope:{ctx:z}}}),St=new de({props:{anchor:"transformers.LukeForQuestionAnswering.forward.example",$$slots:{default:[Ag]},$$scope:{ctx:z}}}),{c(){d=a("meta"),y=h(),f=a("h1"),m=a("a"),_=a("span"),b(l.$$.fragment),p=h(),E=a("span"),zi=n("LUKE"),cr=h(),$e=a("h2"),Ze=a("a"),zs=a("span"),b(Qt.$$.fragment),Ei=h(),Es=a("span"),xi=n("Overview"),pr=h(),et=a("p"),Fi=n("The LUKE model was proposed in "),Rt=a("a"),qi=n("LUKE: Deep Contextualized Entity Representations with Entity-aware Self-attention"),Ci=n(` 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.`),hr=h(),Tn=a("p"),ji=n("The abstract from the paper is the following:"),ur=h(),wn=a("p"),xs=a("em"),Mi=n(`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).`),mr=h(),Ln=a("p"),Pi=n("Tips:"),fr=h(),Y=a("ul"),Fs=a("li"),Vt=a("p"),Ai=n("This implementation is the same as "),$n=a("a"),Si=n("RobertaModel"),Oi=n(` with the addition of entity embeddings as well
as an entity-aware self-attention mechanism, which improves performance on tasks involving reasoning about entities.`),Ii=h(),qs=a("li"),C=a("p"),Ni=n("LUKE treats entities as input tokens; therefore, it takes "),Cs=a("code"),Di=n("entity_ids"),Wi=n(", "),js=a("code"),Bi=n("entity_attention_mask"),Ui=n(`,
`),Ms=a("code"),Ki=n("entity_token_type_ids"),Hi=n(" and "),Ps=a("code"),Qi=n("entity_position_ids"),Ri=n(` as extra input. You can obtain those using
`),zn=a("a"),Vi=n("LukeTokenizer"),Yi=n("."),Gi=h(),Yt=a("li"),G=a("p"),En=a("a"),Ji=n("LukeTokenizer"),Xi=n(" takes "),As=a("code"),Zi=n("entities"),el=n(" and "),Ss=a("code"),tl=n("entity_spans"),ol=n(` (character-based start and end
positions of the entities in the input text) as extra input. `),Os=a("code"),nl=n("entities"),sl=n(` typically consist of [MASK] entities or
Wikipedia entities. The brief description when inputting these entities are as follows:`),al=h(),Gt=a("ul"),xn=a("li"),Is=a("em"),rl=n("Inputting [MASK] entities to compute entity representations"),il=n(`: 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.`),ll=h(),Fn=a("li"),Ns=a("em"),dl=n("Inputting Wikipedia entities to compute knowledge-enhanced token representations"),cl=n(`: 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.`),pl=h(),R=a("li"),Ds=a("p"),hl=n("There are three head models for the former use case:"),ul=h(),ze=a("ul"),tt=a("li"),qn=a("a"),ml=n("LukeForEntityClassification"),fl=n(`, for tasks to classify a single entity in an input text such as
entity typing, e.g. the `),Jt=a("a"),gl=n("Open Entity dataset"),_l=n(`.
This model places a linear head on top of the output entity representation.`),kl=h(),ot=a("li"),Cn=a("a"),yl=n("LukeForEntityPairClassification"),bl=n(`, for tasks to classify the relationship between two entities
such as relation classification, e.g. the `),Xt=a("a"),vl=n("TACRED dataset"),Tl=n(`. This
model places a linear head on top of the concatenated output representation of the pair of given entities.`),wl=h(),jn=a("li"),Mn=a("a"),Ll=n("LukeForEntitySpanClassification"),$l=n(`, 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.`),zl=h(),U=a("p"),Pn=a("a"),El=n("LukeTokenizer"),xl=n(" has a "),Ws=a("code"),Fl=n("task"),ql=n(` argument, which enables you to easily create an input to these
head models by specifying `),Bs=a("code"),Cl=n('task="entity_classification"'),jl=n(", "),Us=a("code"),Ml=n('task="entity_pair_classification"'),Pl=n(`, or
`),Ks=a("code"),Al=n('task="entity_span_classification"'),Sl=n(". Please refer to the example code of each head models."),Ol=h(),Ee=a("p"),Il=n("A demo notebook on how to fine-tune "),An=a("a"),Nl=n("LukeForEntityPairClassification"),Dl=n(` for relation
classification can be found `),Zt=a("a"),Wl=n("here"),Bl=n("."),Ul=h(),eo=a("p"),Kl=n(`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 `),to=a("a"),Hl=n("here"),Ql=n("."),gr=h(),Sn=a("p"),Rl=n("Example:"),_r=h(),b(oo.$$.fragment),kr=h(),J=a("p"),Vl=n("This model was contributed by "),no=a("a"),Yl=n("ikuyamada"),Gl=n(" and "),so=a("a"),Jl=n("nielsr"),Xl=n(". The original code can be found "),ao=a("a"),Zl=n("here"),ed=n("."),yr=h(),xe=a("h2"),nt=a("a"),Hs=a("span"),b(ro.$$.fragment),td=h(),Qs=a("span"),od=n("Documentation resources"),br=h(),K=a("ul"),Rs=a("li"),On=a("a"),nd=n("Text classification task guide"),sd=h(),Vs=a("li"),In=a("a"),ad=n("Token classification task guide"),rd=h(),Ys=a("li"),Nn=a("a"),id=n("Question answering task guide"),ld=h(),Gs=a("li"),Dn=a("a"),dd=n("Masked language modeling task guide"),cd=h(),Js=a("li"),Wn=a("a"),pd=n("Multiple choice task guide"),vr=h(),Fe=a("h2"),st=a("a"),Xs=a("span"),b(io.$$.fragment),hd=h(),Zs=a("span"),ud=n("LukeConfig"),Tr=h(),V=a("div"),b(lo.$$.fragment),md=h(),qe=a("p"),fd=n("This is the configuration class to store the configuration of a "),Bn=a("a"),gd=n("LukeModel"),_d=n(`. 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
`),co=a("a"),kd=n("studio-ousia/luke-base"),yd=n(" architecture."),bd=h(),Ce=a("p"),vd=n("Configuration objects inherit from "),Un=a("a"),Td=n("PretrainedConfig"),wd=n(` and can be used to control the model outputs. Read the
documentation from `),Kn=a("a"),Ld=n("PretrainedConfig"),$d=n(" for more information."),zd=h(),b(at.$$.fragment),wr=h(),je=a("h2"),rt=a("a"),ea=a("span"),b(po.$$.fragment),Ed=h(),ta=a("span"),xd=n("LukeTokenizer"),Lr=h(),x=a("div"),b(ho.$$.fragment),Fd=h(),oa=a("p"),qd=n("Constructs a LUKE tokenizer, derived from the GPT-2 tokenizer, using byte-level Byte-Pair-Encoding."),Cd=h(),na=a("p"),jd=n("This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Md=h(),b(it.$$.fragment),Pd=h(),uo=a("p"),Ad=n("You can get around that behavior by passing "),sa=a("code"),Sd=n("add_prefix_space=True"),Od=n(` 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(lt.$$.fragment),Nd=h(),j=a("p"),Dd=n("This tokenizer inherits from "),Hn=a("a"),Wd=n("PreTrainedTokenizer"),Bd=n(` 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
`),aa=a("code"),Ud=n("entity_ids"),Kd=n(", "),ra=a("code"),Hd=n("entity_attention_mask"),Qd=n(", "),ia=a("code"),Rd=n("entity_token_type_ids"),Vd=n(", and "),la=a("code"),Yd=n("entity_position_ids"),Gd=n(` to be used by the LUKE
model.`),Jd=h(),dt=a("div"),b(mo.$$.fragment),Xd=h(),da=a("p"),Zd=n(`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.`),ec=h(),Qn=a("div"),b(fo.$$.fragment),$r=h(),Me=a("h2"),ct=a("a"),ca=a("span"),b(go.$$.fragment),tc=h(),pa=a("span"),oc=n("LukeModel"),zr=h(),M=a("div"),b(_o.$$.fragment),nc=h(),ha=a("p"),sc=n("The bare LUKE model transformer outputting raw hidden-states for both word tokens and entities without any specific head on top."),ac=h(),ko=a("p"),rc=n("This model inherits from "),Rn=a("a"),ic=n("PreTrainedModel"),lc=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),dc=h(),yo=a("p"),cc=n("This model is also a PyTorch "),bo=a("a"),pc=n("torch.nn.Module"),hc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),uc=h(),X=a("div"),b(vo.$$.fragment),mc=h(),Pe=a("p"),fc=n("The "),Vn=a("a"),gc=n("LukeModel"),_c=n(" forward method, overrides the "),ua=a("code"),kc=n("__call__"),yc=n(" special method."),bc=h(),b(pt.$$.fragment),vc=h(),b(ht.$$.fragment),Er=h(),Ae=a("h2"),ut=a("a"),ma=a("span"),b(To.$$.fragment),Tc=h(),fa=a("span"),wc=n("LukeForMaskedLM"),xr=h(),P=a("div"),b(wo.$$.fragment),Lc=h(),ga=a("p"),$c=n(`The LUKE model with a language modeling head and entity prediction head on top for masked language modeling and
masked entity prediction.`),zc=h(),Lo=a("p"),Ec=n("This model inherits from "),Yn=a("a"),xc=n("PreTrainedModel"),Fc=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),qc=h(),$o=a("p"),Cc=n("This model is also a PyTorch "),zo=a("a"),jc=n("torch.nn.Module"),Mc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Pc=h(),pe=a("div"),b(Eo.$$.fragment),Ac=h(),Se=a("p"),Sc=n("The "),Gn=a("a"),Oc=n("LukeForMaskedLM"),Ic=n(" forward method, overrides the "),_a=a("code"),Nc=n("__call__"),Dc=n(" special method."),Wc=h(),b(mt.$$.fragment),Fr=h(),Oe=a("h2"),ft=a("a"),ka=a("span"),b(xo.$$.fragment),Bc=h(),ya=a("span"),Uc=n("LukeForEntityClassification"),qr=h(),A=a("div"),b(Fo.$$.fragment),Kc=h(),ba=a("p"),Hc=n(`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.`),Qc=h(),qo=a("p"),Rc=n("This model inherits from "),Jn=a("a"),Vc=n("PreTrainedModel"),Yc=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gc=h(),Co=a("p"),Jc=n("This model is also a PyTorch "),jo=a("a"),Xc=n("torch.nn.Module"),Zc=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ep=h(),Z=a("div"),b(Mo.$$.fragment),tp=h(),Ie=a("p"),op=n("The "),Xn=a("a"),np=n("LukeForEntityClassification"),sp=n(" forward method, overrides the "),va=a("code"),ap=n("__call__"),rp=n(" special method."),ip=h(),b(gt.$$.fragment),lp=h(),b(_t.$$.fragment),Cr=h(),Ne=a("h2"),kt=a("a"),Ta=a("span"),b(Po.$$.fragment),dp=h(),wa=a("span"),cp=n("LukeForEntityPairClassification"),jr=h(),S=a("div"),b(Ao.$$.fragment),pp=h(),La=a("p"),hp=n(`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.`),up=h(),So=a("p"),mp=n("This model inherits from "),Zn=a("a"),fp=n("PreTrainedModel"),gp=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),_p=h(),Oo=a("p"),kp=n("This model is also a PyTorch "),Io=a("a"),yp=n("torch.nn.Module"),bp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),vp=h(),ee=a("div"),b(No.$$.fragment),Tp=h(),De=a("p"),wp=n("The "),es=a("a"),Lp=n("LukeForEntityPairClassification"),$p=n(" forward method, overrides the "),$a=a("code"),zp=n("__call__"),Ep=n(" special method."),xp=h(),b(yt.$$.fragment),Fp=h(),b(bt.$$.fragment),Mr=h(),We=a("h2"),vt=a("a"),za=a("span"),b(Do.$$.fragment),qp=h(),Ea=a("span"),Cp=n("LukeForEntitySpanClassification"),Pr=h(),O=a("div"),b(Wo.$$.fragment),jp=h(),xa=a("p"),Mp=n(`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.`),Pp=h(),Bo=a("p"),Ap=n("This model inherits from "),ts=a("a"),Sp=n("PreTrainedModel"),Op=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Ip=h(),Uo=a("p"),Np=n("This model is also a PyTorch "),Ko=a("a"),Dp=n("torch.nn.Module"),Wp=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bp=h(),te=a("div"),b(Ho.$$.fragment),Up=h(),Be=a("p"),Kp=n("The "),os=a("a"),Hp=n("LukeForEntitySpanClassification"),Qp=n(" forward method, overrides the "),Fa=a("code"),Rp=n("__call__"),Vp=n(" special method."),Yp=h(),b(Tt.$$.fragment),Gp=h(),b(wt.$$.fragment),Ar=h(),Ue=a("h2"),Lt=a("a"),qa=a("span"),b(Qo.$$.fragment),Jp=h(),Ca=a("span"),Xp=n("LukeForSequenceClassification"),Sr=h(),I=a("div"),b(Ro.$$.fragment),Zp=h(),ja=a("p"),eh=n(`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.`),th=h(),Vo=a("p"),oh=n("This model inherits from "),ns=a("a"),nh=n("PreTrainedModel"),sh=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),ah=h(),Yo=a("p"),rh=n("This model is also a PyTorch "),Go=a("a"),ih=n("torch.nn.Module"),lh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),dh=h(),H=a("div"),b(Jo.$$.fragment),ch=h(),Ke=a("p"),ph=n("The "),ss=a("a"),hh=n("LukeForSequenceClassification"),uh=n(" forward method, overrides the "),Ma=a("code"),mh=n("__call__"),fh=n(" special method."),gh=h(),b($t.$$.fragment),_h=h(),b(zt.$$.fragment),kh=h(),b(Et.$$.fragment),Or=h(),He=a("h2"),xt=a("a"),Pa=a("span"),b(Xo.$$.fragment),yh=h(),Aa=a("span"),bh=n("LukeForMultipleChoice"),Ir=h(),N=a("div"),b(Zo.$$.fragment),vh=h(),Sa=a("p"),Th=n(`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.`),wh=h(),en=a("p"),Lh=n("This model inherits from "),as=a("a"),$h=n("PreTrainedModel"),zh=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Eh=h(),tn=a("p"),xh=n("This model is also a PyTorch "),on=a("a"),Fh=n("torch.nn.Module"),qh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ch=h(),oe=a("div"),b(nn.$$.fragment),jh=h(),Qe=a("p"),Mh=n("The "),rs=a("a"),Ph=n("LukeForMultipleChoice"),Ah=n(" forward method, overrides the "),Oa=a("code"),Sh=n("__call__"),Oh=n(" special method."),Ih=h(),b(Ft.$$.fragment),Nh=h(),b(qt.$$.fragment),Nr=h(),Re=a("h2"),Ct=a("a"),Ia=a("span"),b(sn.$$.fragment),Dh=h(),Na=a("span"),Wh=n("LukeForTokenClassification"),Dr=h(),D=a("div"),b(an.$$.fragment),Bh=h(),rn=a("p"),Uh=n(`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, `),Da=a("code"),Kh=n("LukeForEntitySpanClassification"),Hh=n(` is more suitable than this
class.`),Qh=h(),ln=a("p"),Rh=n("This model inherits from "),is=a("a"),Vh=n("PreTrainedModel"),Yh=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Gh=h(),dn=a("p"),Jh=n("This model is also a PyTorch "),cn=a("a"),Xh=n("torch.nn.Module"),Zh=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),eu=h(),ne=a("div"),b(pn.$$.fragment),tu=h(),Ve=a("p"),ou=n("The "),ls=a("a"),nu=n("LukeForTokenClassification"),su=n(" forward method, overrides the "),Wa=a("code"),au=n("__call__"),ru=n(" special method."),iu=h(),b(jt.$$.fragment),lu=h(),b(Mt.$$.fragment),Wr=h(),Ye=a("h2"),Pt=a("a"),Ba=a("span"),b(hn.$$.fragment),du=h(),Ua=a("span"),cu=n("LukeForQuestionAnswering"),Br=h(),W=a("div"),b(un.$$.fragment),pu=h(),Ge=a("p"),hu=n(`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 `),Ka=a("code"),uu=n("span start logits"),mu=n(" and "),Ha=a("code"),fu=n("span end logits"),gu=n(")."),_u=h(),mn=a("p"),ku=n("This model inherits from "),ds=a("a"),yu=n("PreTrainedModel"),bu=n(`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),vu=h(),fn=a("p"),Tu=n("This model is also a PyTorch "),gn=a("a"),wu=n("torch.nn.Module"),Lu=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$u=h(),se=a("div"),b(_n.$$.fragment),zu=h(),Je=a("p"),Eu=n("The "),cs=a("a"),xu=n("LukeForQuestionAnswering"),Fu=n(" forward method, overrides the "),Qa=a("code"),qu=n("__call__"),Cu=n(" special method."),ju=h(),b(At.$$.fragment),Mu=h(),b(St.$$.fragment),this.h()},l(o){const g=ug('[data-svelte="svelte-1phssyn"]',document.head);d=r(g,"META",{name:!0,content:!0}),g.forEach(t),y=u(o),f=r(o,"H1",{class:!0});var kn=i(f);m=r(kn,"A",{id:!0,class:!0,href:!0});var Ra=i(m);_=r(Ra,"SPAN",{});var Va=i(_);v(l.$$.fragment,Va),Va.forEach(t),Ra.forEach(t),p=u(kn),E=r(kn,"SPAN",{});var Ya=i(E);zi=s(Ya,"LUKE"),Ya.forEach(t),kn.forEach(t),cr=u(o),$e=r(o,"H2",{class:!0});var yn=i($e);Ze=r(yn,"A",{id:!0,class:!0,href:!0});var Ga=i(Ze);zs=r(Ga,"SPAN",{});var Ja=i(zs);v(Qt.$$.fragment,Ja),Ja.forEach(t),Ga.forEach(t),Ei=u(yn),Es=r(yn,"SPAN",{});var Xa=i(Es);xi=s(Xa,"Overview"),Xa.forEach(t),yn.forEach(t),pr=u(o),et=r(o,"P",{});var bn=i(et);Fi=s(bn,"The LUKE model was proposed in "),Rt=r(bn,"A",{href:!0,rel:!0});var Za=i(Rt);qi=s(Za,"LUKE: Deep Contextualized Entity Representations with Entity-aware Self-attention"),Za.forEach(t),Ci=s(bn,` 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.`),bn.forEach(t),hr=u(o),Tn=r(o,"P",{});var er=i(Tn);ji=s(er,"The abstract from the paper is the following:"),er.forEach(t),ur=u(o),wn=r(o,"P",{});var tr=i(wn);xs=r(tr,"EM",{});var or=i(xs);Mi=s(or,`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).`),or.forEach(t),tr.forEach(t),mr=u(o),Ln=r(o,"P",{});var nr=i(Ln);Pi=s(nr,"Tips:"),nr.forEach(t),fr=u(o),Y=r(o,"UL",{});var ie=i(Y);Fs=r(ie,"LI",{});var sr=i(Fs);Vt=r(sr,"P",{});var vn=i(Vt);Ai=s(vn,"This implementation is the same as "),$n=r(vn,"A",{href:!0});var ar=i($n);Si=s(ar,"RobertaModel"),ar.forEach(t),Oi=s(vn,` with the addition of entity embeddings as well
as an entity-aware self-attention mechanism, which improves performance on tasks involving reasoning about entities.`),vn.forEach(t),sr.forEach(t),Ii=u(ie),qs=r(ie,"LI",{});var rr=i(qs);C=r(rr,"P",{});var B=i(C);Ni=s(B,"LUKE treats entities as input tokens; therefore, it takes "),Cs=r(B,"CODE",{});var ir=i(Cs);Di=s(ir,"entity_ids"),ir.forEach(t),Wi=s(B,", "),js=r(B,"CODE",{});var Ou=i(js);Bi=s(Ou,"entity_attention_mask"),Ou.forEach(t),Ui=s(B,`,
`),Ms=r(B,"CODE",{});var Iu=i(Ms);Ki=s(Iu,"entity_token_type_ids"),Iu.forEach(t),Hi=s(B," and "),Ps=r(B,"CODE",{});var Nu=i(Ps);Qi=s(Nu,"entity_position_ids"),Nu.forEach(t),Ri=s(B,` as extra input. You can obtain those using
`),zn=r(B,"A",{href:!0});var Du=i(zn);Vi=s(Du,"LukeTokenizer"),Du.forEach(t),Yi=s(B,"."),B.forEach(t),rr.forEach(t),Gi=u(ie),Yt=r(ie,"LI",{});var Kr=i(Yt);G=r(Kr,"P",{});var Xe=i(G);En=r(Xe,"A",{href:!0});var Wu=i(En);Ji=s(Wu,"LukeTokenizer"),Wu.forEach(t),Xi=s(Xe," takes "),As=r(Xe,"CODE",{});var Bu=i(As);Zi=s(Bu,"entities"),Bu.forEach(t),el=s(Xe," and "),Ss=r(Xe,"CODE",{});var Uu=i(Ss);tl=s(Uu,"entity_spans"),Uu.forEach(t),ol=s(Xe,` (character-based start and end
positions of the entities in the input text) as extra input. `),Os=r(Xe,"CODE",{});var Ku=i(Os);nl=s(Ku,"entities"),Ku.forEach(t),sl=s(Xe,` typically consist of [MASK] entities or
Wikipedia entities. The brief description when inputting these entities are as follows:`),Xe.forEach(t),al=u(Kr),Gt=r(Kr,"UL",{});var Hr=i(Gt);xn=r(Hr,"LI",{});var Pu=i(xn);Is=r(Pu,"EM",{});var Hu=i(Is);rl=s(Hu,"Inputting [MASK] entities to compute entity representations"),Hu.forEach(t),il=s(Pu,`: 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.`),Pu.forEach(t),ll=u(Hr),Fn=r(Hr,"LI",{});var Au=i(Fn);Ns=r(Au,"EM",{});var Qu=i(Ns);dl=s(Qu,"Inputting Wikipedia entities to compute knowledge-enhanced token representations"),Qu.forEach(t),cl=s(Au,`: 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.`),Au.forEach(t),Hr.forEach(t),Kr.forEach(t),pl=u(ie),R=r(ie,"LI",{});var he=i(R);Ds=r(he,"P",{});var Ru=i(Ds);hl=s(Ru,"There are three head models for the former use case:"),Ru.forEach(t),ul=u(he),ze=r(he,"UL",{});var ps=i(ze);tt=r(ps,"LI",{});var lr=i(tt);qn=r(lr,"A",{href:!0});var Vu=i(qn);ml=s(Vu,"LukeForEntityClassification"),Vu.forEach(t),fl=s(lr,`, for tasks to classify a single entity in an input text such as
entity typing, e.g. the `),Jt=r(lr,"A",{href:!0,rel:!0});var Yu=i(Jt);gl=s(Yu,"Open Entity dataset"),Yu.forEach(t),_l=s(lr,`.
This model places a linear head on top of the output entity representation.`),lr.forEach(t),kl=u(ps),ot=r(ps,"LI",{});var dr=i(ot);Cn=r(dr,"A",{href:!0});var Gu=i(Cn);yl=s(Gu,"LukeForEntityPairClassification"),Gu.forEach(t),bl=s(dr,`, for tasks to classify the relationship between two entities
such as relation classification, e.g. the `),Xt=r(dr,"A",{href:!0,rel:!0});var Ju=i(Xt);vl=s(Ju,"TACRED dataset"),Ju.forEach(t),Tl=s(dr,`. This
model places a linear head on top of the concatenated output representation of the pair of given entities.`),dr.forEach(t),wl=u(ps),jn=r(ps,"LI",{});var Su=i(jn);Mn=r(Su,"A",{href:!0});var Xu=i(Mn);Ll=s(Xu,"LukeForEntitySpanClassification"),Xu.forEach(t),$l=s(Su,`, 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.`),Su.forEach(t),ps.forEach(t),zl=u(he),U=r(he,"P",{});var le=i(U);Pn=r(le,"A",{href:!0});var Zu=i(Pn);El=s(Zu,"LukeTokenizer"),Zu.forEach(t),xl=s(le," has a "),Ws=r(le,"CODE",{});var em=i(Ws);Fl=s(em,"task"),em.forEach(t),ql=s(le,` argument, which enables you to easily create an input to these
head models by specifying `),Bs=r(le,"CODE",{});var tm=i(Bs);Cl=s(tm,'task="entity_classification"'),tm.forEach(t),jl=s(le,", "),Us=r(le,"CODE",{});var om=i(Us);Ml=s(om,'task="entity_pair_classification"'),om.forEach(t),Pl=s(le,`, or
`),Ks=r(le,"CODE",{});var nm=i(Ks);Al=s(nm,'task="entity_span_classification"'),nm.forEach(t),Sl=s(le,". Please refer to the example code of each head models."),le.forEach(t),Ol=u(he),Ee=r(he,"P",{});var hs=i(Ee);Il=s(hs,"A demo notebook on how to fine-tune "),An=r(hs,"A",{href:!0});var sm=i(An);Nl=s(sm,"LukeForEntityPairClassification"),sm.forEach(t),Dl=s(hs,` for relation
classification can be found `),Zt=r(hs,"A",{href:!0,rel:!0});var am=i(Zt);Wl=s(am,"here"),am.forEach(t),Bl=s(hs,"."),hs.forEach(t),Ul=u(he),eo=r(he,"P",{});var Qr=i(eo);Kl=s(Qr,`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 `),to=r(Qr,"A",{href:!0,rel:!0});var rm=i(to);Hl=s(rm,"here"),rm.forEach(t),Ql=s(Qr,"."),Qr.forEach(t),he.forEach(t),ie.forEach(t),gr=u(o),Sn=r(o,"P",{});var im=i(Sn);Rl=s(im,"Example:"),im.forEach(t),_r=u(o),v(oo.$$.fragment,o),kr=u(o),J=r(o,"P",{});var Ot=i(J);Vl=s(Ot,"This model was contributed by "),no=r(Ot,"A",{href:!0,rel:!0});var lm=i(no);Yl=s(lm,"ikuyamada"),lm.forEach(t),Gl=s(Ot," and "),so=r(Ot,"A",{href:!0,rel:!0});var dm=i(so);Jl=s(dm,"nielsr"),dm.forEach(t),Xl=s(Ot,". The original code can be found "),ao=r(Ot,"A",{href:!0,rel:!0});var cm=i(ao);Zl=s(cm,"here"),cm.forEach(t),ed=s(Ot,"."),Ot.forEach(t),yr=u(o),xe=r(o,"H2",{class:!0});var Rr=i(xe);nt=r(Rr,"A",{id:!0,class:!0,href:!0});var pm=i(nt);Hs=r(pm,"SPAN",{});var hm=i(Hs);v(ro.$$.fragment,hm),hm.forEach(t),pm.forEach(t),td=u(Rr),Qs=r(Rr,"SPAN",{});var um=i(Qs);od=s(um,"Documentation resources"),um.forEach(t),Rr.forEach(t),br=u(o),K=r(o,"UL",{});var ue=i(K);Rs=r(ue,"LI",{});var mm=i(Rs);On=r(mm,"A",{href:!0});var fm=i(On);nd=s(fm,"Text classification task guide"),fm.forEach(t),mm.forEach(t),sd=u(ue),Vs=r(ue,"LI",{});var gm=i(Vs);In=r(gm,"A",{href:!0});var _m=i(In);ad=s(_m,"Token classification task guide"),_m.forEach(t),gm.forEach(t),rd=u(ue),Ys=r(ue,"LI",{});var km=i(Ys);Nn=r(km,"A",{href:!0});var ym=i(Nn);id=s(ym,"Question answering task guide"),ym.forEach(t),km.forEach(t),ld=u(ue),Gs=r(ue,"LI",{});var bm=i(Gs);Dn=r(bm,"A",{href:!0});var vm=i(Dn);dd=s(vm,"Masked language modeling task guide"),vm.forEach(t),bm.forEach(t),cd=u(ue),Js=r(ue,"LI",{});var Tm=i(Js);Wn=r(Tm,"A",{href:!0});var wm=i(Wn);pd=s(wm,"Multiple choice task guide"),wm.forEach(t),Tm.forEach(t),ue.forEach(t),vr=u(o),Fe=r(o,"H2",{class:!0});var Vr=i(Fe);st=r(Vr,"A",{id:!0,class:!0,href:!0});var Lm=i(st);Xs=r(Lm,"SPAN",{});var $m=i(Xs);v(io.$$.fragment,$m),$m.forEach(t),Lm.forEach(t),hd=u(Vr),Zs=r(Vr,"SPAN",{});var zm=i(Zs);ud=s(zm,"LukeConfig"),zm.forEach(t),Vr.forEach(t),Tr=u(o),V=r(o,"DIV",{class:!0});var It=i(V);v(lo.$$.fragment,It),md=u(It),qe=r(It,"P",{});var us=i(qe);fd=s(us,"This is the configuration class to store the configuration of a "),Bn=r(us,"A",{href:!0});var Em=i(Bn);gd=s(Em,"LukeModel"),Em.forEach(t),_d=s(us,`. 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
`),co=r(us,"A",{href:!0,rel:!0});var xm=i(co);kd=s(xm,"studio-ousia/luke-base"),xm.forEach(t),yd=s(us," architecture."),us.forEach(t),bd=u(It),Ce=r(It,"P",{});var ms=i(Ce);vd=s(ms,"Configuration objects inherit from "),Un=r(ms,"A",{href:!0});var Fm=i(Un);Td=s(Fm,"PretrainedConfig"),Fm.forEach(t),wd=s(ms,` and can be used to control the model outputs. Read the
documentation from `),Kn=r(ms,"A",{href:!0});var qm=i(Kn);Ld=s(qm,"PretrainedConfig"),qm.forEach(t),$d=s(ms," for more information."),ms.forEach(t),zd=u(It),v(at.$$.fragment,It),It.forEach(t),wr=u(o),je=r(o,"H2",{class:!0});var Yr=i(je);rt=r(Yr,"A",{id:!0,class:!0,href:!0});var Cm=i(rt);ea=r(Cm,"SPAN",{});var jm=i(ea);v(po.$$.fragment,jm),jm.forEach(t),Cm.forEach(t),Ed=u(Yr),ta=r(Yr,"SPAN",{});var Mm=i(ta);xd=s(Mm,"LukeTokenizer"),Mm.forEach(t),Yr.forEach(t),Lr=u(o),x=r(o,"DIV",{class:!0});var q=i(x);v(ho.$$.fragment,q),Fd=u(q),oa=r(q,"P",{});var Pm=i(oa);qd=s(Pm,"Constructs a LUKE tokenizer, derived from the GPT-2 tokenizer, using byte-level Byte-Pair-Encoding."),Pm.forEach(t),Cd=u(q),na=r(q,"P",{});var Am=i(na);jd=s(Am,"This tokenizer has been trained to treat spaces like parts of the tokens (a bit like sentencepiece) so a word will"),Am.forEach(t),Md=u(q),v(it.$$.fragment,q),Pd=u(q),uo=r(q,"P",{});var Gr=i(uo);Ad=s(Gr,"You can get around that behavior by passing "),sa=r(Gr,"CODE",{});var Sm=i(sa);Sd=s(Sm,"add_prefix_space=True"),Sm.forEach(t),Od=s(Gr,` 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.`),Gr.forEach(t),Id=u(q),v(lt.$$.fragment,q),Nd=u(q),j=r(q,"P",{});var ae=i(j);Dd=s(ae,"This tokenizer inherits from "),Hn=r(ae,"A",{href:!0});var Om=i(Hn);Wd=s(Om,"PreTrainedTokenizer"),Om.forEach(t),Bd=s(ae,` 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
`),aa=r(ae,"CODE",{});var Im=i(aa);Ud=s(Im,"entity_ids"),Im.forEach(t),Kd=s(ae,", "),ra=r(ae,"CODE",{});var Nm=i(ra);Hd=s(Nm,"entity_attention_mask"),Nm.forEach(t),Qd=s(ae,", "),ia=r(ae,"CODE",{});var Dm=i(ia);Rd=s(Dm,"entity_token_type_ids"),Dm.forEach(t),Vd=s(ae,", and "),la=r(ae,"CODE",{});var Wm=i(la);Yd=s(Wm,"entity_position_ids"),Wm.forEach(t),Gd=s(ae,` to be used by the LUKE
model.`),ae.forEach(t),Jd=u(q),dt=r(q,"DIV",{class:!0});var Jr=i(dt);v(mo.$$.fragment,Jr),Xd=u(Jr),da=r(Jr,"P",{});var Bm=i(da);Zd=s(Bm,`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.`),Bm.forEach(t),Jr.forEach(t),ec=u(q),Qn=r(q,"DIV",{class:!0});var Um=i(Qn);v(fo.$$.fragment,Um),Um.forEach(t),q.forEach(t),$r=u(o),Me=r(o,"H2",{class:!0});var Xr=i(Me);ct=r(Xr,"A",{id:!0,class:!0,href:!0});var Km=i(ct);ca=r(Km,"SPAN",{});var Hm=i(ca);v(go.$$.fragment,Hm),Hm.forEach(t),Km.forEach(t),tc=u(Xr),pa=r(Xr,"SPAN",{});var Qm=i(pa);oc=s(Qm,"LukeModel"),Qm.forEach(t),Xr.forEach(t),zr=u(o),M=r(o,"DIV",{class:!0});var me=i(M);v(_o.$$.fragment,me),nc=u(me),ha=r(me,"P",{});var Rm=i(ha);sc=s(Rm,"The bare LUKE model transformer outputting raw hidden-states for both word tokens and entities without any specific head on top."),Rm.forEach(t),ac=u(me),ko=r(me,"P",{});var Zr=i(ko);rc=s(Zr,"This model inherits from "),Rn=r(Zr,"A",{href:!0});var Vm=i(Rn);ic=s(Vm,"PreTrainedModel"),Vm.forEach(t),lc=s(Zr,`. 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.)`),Zr.forEach(t),dc=u(me),yo=r(me,"P",{});var ei=i(yo);cc=s(ei,"This model is also a PyTorch "),bo=r(ei,"A",{href:!0,rel:!0});var Ym=i(bo);pc=s(Ym,"torch.nn.Module"),Ym.forEach(t),hc=s(ei,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ei.forEach(t),uc=u(me),X=r(me,"DIV",{class:!0});var Nt=i(X);v(vo.$$.fragment,Nt),mc=u(Nt),Pe=r(Nt,"P",{});var fs=i(Pe);fc=s(fs,"The "),Vn=r(fs,"A",{href:!0});var Gm=i(Vn);gc=s(Gm,"LukeModel"),Gm.forEach(t),_c=s(fs," forward method, overrides the "),ua=r(fs,"CODE",{});var Jm=i(ua);kc=s(Jm,"__call__"),Jm.forEach(t),yc=s(fs," special method."),fs.forEach(t),bc=u(Nt),v(pt.$$.fragment,Nt),vc=u(Nt),v(ht.$$.fragment,Nt),Nt.forEach(t),me.forEach(t),Er=u(o),Ae=r(o,"H2",{class:!0});var ti=i(Ae);ut=r(ti,"A",{id:!0,class:!0,href:!0});var Xm=i(ut);ma=r(Xm,"SPAN",{});var Zm=i(ma);v(To.$$.fragment,Zm),Zm.forEach(t),Xm.forEach(t),Tc=u(ti),fa=r(ti,"SPAN",{});var ef=i(fa);wc=s(ef,"LukeForMaskedLM"),ef.forEach(t),ti.forEach(t),xr=u(o),P=r(o,"DIV",{class:!0});var fe=i(P);v(wo.$$.fragment,fe),Lc=u(fe),ga=r(fe,"P",{});var tf=i(ga);$c=s(tf,`The LUKE model with a language modeling head and entity prediction head on top for masked language modeling and
masked entity prediction.`),tf.forEach(t),zc=u(fe),Lo=r(fe,"P",{});var oi=i(Lo);Ec=s(oi,"This model inherits from "),Yn=r(oi,"A",{href:!0});var of=i(Yn);xc=s(of,"PreTrainedModel"),of.forEach(t),Fc=s(oi,`. 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.)`),oi.forEach(t),qc=u(fe),$o=r(fe,"P",{});var ni=i($o);Cc=s(ni,"This model is also a PyTorch "),zo=r(ni,"A",{href:!0,rel:!0});var nf=i(zo);jc=s(nf,"torch.nn.Module"),nf.forEach(t),Mc=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),Pc=u(fe),pe=r(fe,"DIV",{class:!0});var gs=i(pe);v(Eo.$$.fragment,gs),Ac=u(gs),Se=r(gs,"P",{});var _s=i(Se);Sc=s(_s,"The "),Gn=r(_s,"A",{href:!0});var sf=i(Gn);Oc=s(sf,"LukeForMaskedLM"),sf.forEach(t),Ic=s(_s," forward method, overrides the "),_a=r(_s,"CODE",{});var af=i(_a);Nc=s(af,"__call__"),af.forEach(t),Dc=s(_s," special method."),_s.forEach(t),Wc=u(gs),v(mt.$$.fragment,gs),gs.forEach(t),fe.forEach(t),Fr=u(o),Oe=r(o,"H2",{class:!0});var si=i(Oe);ft=r(si,"A",{id:!0,class:!0,href:!0});var rf=i(ft);ka=r(rf,"SPAN",{});var lf=i(ka);v(xo.$$.fragment,lf),lf.forEach(t),rf.forEach(t),Bc=u(si),ya=r(si,"SPAN",{});var df=i(ya);Uc=s(df,"LukeForEntityClassification"),df.forEach(t),si.forEach(t),qr=u(o),A=r(o,"DIV",{class:!0});var ge=i(A);v(Fo.$$.fragment,ge),Kc=u(ge),ba=r(ge,"P",{});var cf=i(ba);Hc=s(cf,`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.`),cf.forEach(t),Qc=u(ge),qo=r(ge,"P",{});var ai=i(qo);Rc=s(ai,"This model inherits from "),Jn=r(ai,"A",{href:!0});var pf=i(Jn);Vc=s(pf,"PreTrainedModel"),pf.forEach(t),Yc=s(ai,`. 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.)`),ai.forEach(t),Gc=u(ge),Co=r(ge,"P",{});var ri=i(Co);Jc=s(ri,"This model is also a PyTorch "),jo=r(ri,"A",{href:!0,rel:!0});var hf=i(jo);Xc=s(hf,"torch.nn.Module"),hf.forEach(t),Zc=s(ri,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ri.forEach(t),ep=u(ge),Z=r(ge,"DIV",{class:!0});var Dt=i(Z);v(Mo.$$.fragment,Dt),tp=u(Dt),Ie=r(Dt,"P",{});var ks=i(Ie);op=s(ks,"The "),Xn=r(ks,"A",{href:!0});var uf=i(Xn);np=s(uf,"LukeForEntityClassification"),uf.forEach(t),sp=s(ks," forward method, overrides the "),va=r(ks,"CODE",{});var mf=i(va);ap=s(mf,"__call__"),mf.forEach(t),rp=s(ks," special method."),ks.forEach(t),ip=u(Dt),v(gt.$$.fragment,Dt),lp=u(Dt),v(_t.$$.fragment,Dt),Dt.forEach(t),ge.forEach(t),Cr=u(o),Ne=r(o,"H2",{class:!0});var ii=i(Ne);kt=r(ii,"A",{id:!0,class:!0,href:!0});var ff=i(kt);Ta=r(ff,"SPAN",{});var gf=i(Ta);v(Po.$$.fragment,gf),gf.forEach(t),ff.forEach(t),dp=u(ii),wa=r(ii,"SPAN",{});var _f=i(wa);cp=s(_f,"LukeForEntityPairClassification"),_f.forEach(t),ii.forEach(t),jr=u(o),S=r(o,"DIV",{class:!0});var _e=i(S);v(Ao.$$.fragment,_e),pp=u(_e),La=r(_e,"P",{});var kf=i(La);hp=s(kf,`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.`),kf.forEach(t),up=u(_e),So=r(_e,"P",{});var li=i(So);mp=s(li,"This model inherits from "),Zn=r(li,"A",{href:!0});var yf=i(Zn);fp=s(yf,"PreTrainedModel"),yf.forEach(t),gp=s(li,`. 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.)`),li.forEach(t),_p=u(_e),Oo=r(_e,"P",{});var di=i(Oo);kp=s(di,"This model is also a PyTorch "),Io=r(di,"A",{href:!0,rel:!0});var bf=i(Io);yp=s(bf,"torch.nn.Module"),bf.forEach(t),bp=s(di,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),di.forEach(t),vp=u(_e),ee=r(_e,"DIV",{class:!0});var Wt=i(ee);v(No.$$.fragment,Wt),Tp=u(Wt),De=r(Wt,"P",{});var ys=i(De);wp=s(ys,"The "),es=r(ys,"A",{href:!0});var vf=i(es);Lp=s(vf,"LukeForEntityPairClassification"),vf.forEach(t),$p=s(ys," forward method, overrides the "),$a=r(ys,"CODE",{});var Tf=i($a);zp=s(Tf,"__call__"),Tf.forEach(t),Ep=s(ys," special method."),ys.forEach(t),xp=u(Wt),v(yt.$$.fragment,Wt),Fp=u(Wt),v(bt.$$.fragment,Wt),Wt.forEach(t),_e.forEach(t),Mr=u(o),We=r(o,"H2",{class:!0});var ci=i(We);vt=r(ci,"A",{id:!0,class:!0,href:!0});var wf=i(vt);za=r(wf,"SPAN",{});var Lf=i(za);v(Do.$$.fragment,Lf),Lf.forEach(t),wf.forEach(t),qp=u(ci),Ea=r(ci,"SPAN",{});var $f=i(Ea);Cp=s($f,"LukeForEntitySpanClassification"),$f.forEach(t),ci.forEach(t),Pr=u(o),O=r(o,"DIV",{class:!0});var ke=i(O);v(Wo.$$.fragment,ke),jp=u(ke),xa=r(ke,"P",{});var zf=i(xa);Mp=s(zf,`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.`),zf.forEach(t),Pp=u(ke),Bo=r(ke,"P",{});var pi=i(Bo);Ap=s(pi,"This model inherits from "),ts=r(pi,"A",{href:!0});var Ef=i(ts);Sp=s(Ef,"PreTrainedModel"),Ef.forEach(t),Op=s(pi,`. 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.)`),pi.forEach(t),Ip=u(ke),Uo=r(ke,"P",{});var hi=i(Uo);Np=s(hi,"This model is also a PyTorch "),Ko=r(hi,"A",{href:!0,rel:!0});var xf=i(Ko);Dp=s(xf,"torch.nn.Module"),xf.forEach(t),Wp=s(hi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),hi.forEach(t),Bp=u(ke),te=r(ke,"DIV",{class:!0});var Bt=i(te);v(Ho.$$.fragment,Bt),Up=u(Bt),Be=r(Bt,"P",{});var bs=i(Be);Kp=s(bs,"The "),os=r(bs,"A",{href:!0});var Ff=i(os);Hp=s(Ff,"LukeForEntitySpanClassification"),Ff.forEach(t),Qp=s(bs," forward method, overrides the "),Fa=r(bs,"CODE",{});var qf=i(Fa);Rp=s(qf,"__call__"),qf.forEach(t),Vp=s(bs," special method."),bs.forEach(t),Yp=u(Bt),v(Tt.$$.fragment,Bt),Gp=u(Bt),v(wt.$$.fragment,Bt),Bt.forEach(t),ke.forEach(t),Ar=u(o),Ue=r(o,"H2",{class:!0});var ui=i(Ue);Lt=r(ui,"A",{id:!0,class:!0,href:!0});var Cf=i(Lt);qa=r(Cf,"SPAN",{});var jf=i(qa);v(Qo.$$.fragment,jf),jf.forEach(t),Cf.forEach(t),Jp=u(ui),Ca=r(ui,"SPAN",{});var Mf=i(Ca);Xp=s(Mf,"LukeForSequenceClassification"),Mf.forEach(t),ui.forEach(t),Sr=u(o),I=r(o,"DIV",{class:!0});var ye=i(I);v(Ro.$$.fragment,ye),Zp=u(ye),ja=r(ye,"P",{});var Pf=i(ja);eh=s(Pf,`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.`),Pf.forEach(t),th=u(ye),Vo=r(ye,"P",{});var mi=i(Vo);oh=s(mi,"This model inherits from "),ns=r(mi,"A",{href:!0});var Af=i(ns);nh=s(Af,"PreTrainedModel"),Af.forEach(t),sh=s(mi,`. 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.)`),mi.forEach(t),ah=u(ye),Yo=r(ye,"P",{});var fi=i(Yo);rh=s(fi,"This model is also a PyTorch "),Go=r(fi,"A",{href:!0,rel:!0});var Sf=i(Go);ih=s(Sf,"torch.nn.Module"),Sf.forEach(t),lh=s(fi,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),fi.forEach(t),dh=u(ye),H=r(ye,"DIV",{class:!0});var be=i(H);v(Jo.$$.fragment,be),ch=u(be),Ke=r(be,"P",{});var vs=i(Ke);ph=s(vs,"The "),ss=r(vs,"A",{href:!0});var Of=i(ss);hh=s(Of,"LukeForSequenceClassification"),Of.forEach(t),uh=s(vs," forward method, overrides the "),Ma=r(vs,"CODE",{});var If=i(Ma);mh=s(If,"__call__"),If.forEach(t),fh=s(vs," special method."),vs.forEach(t),gh=u(be),v($t.$$.fragment,be),_h=u(be),v(zt.$$.fragment,be),kh=u(be),v(Et.$$.fragment,be),be.forEach(t),ye.forEach(t),Or=u(o),He=r(o,"H2",{class:!0});var gi=i(He);xt=r(gi,"A",{id:!0,class:!0,href:!0});var Nf=i(xt);Pa=r(Nf,"SPAN",{});var Df=i(Pa);v(Xo.$$.fragment,Df),Df.forEach(t),Nf.forEach(t),yh=u(gi),Aa=r(gi,"SPAN",{});var Wf=i(Aa);bh=s(Wf,"LukeForMultipleChoice"),Wf.forEach(t),gi.forEach(t),Ir=u(o),N=r(o,"DIV",{class:!0});var ve=i(N);v(Zo.$$.fragment,ve),vh=u(ve),Sa=r(ve,"P",{});var Bf=i(Sa);Th=s(Bf,`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.`),Bf.forEach(t),wh=u(ve),en=r(ve,"P",{});var _i=i(en);Lh=s(_i,"This model inherits from "),as=r(_i,"A",{href:!0});var Uf=i(as);$h=s(Uf,"PreTrainedModel"),Uf.forEach(t),zh=s(_i,`. 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.)`),_i.forEach(t),Eh=u(ve),tn=r(ve,"P",{});var ki=i(tn);xh=s(ki,"This model is also a PyTorch "),on=r(ki,"A",{href:!0,rel:!0});var Kf=i(on);Fh=s(Kf,"torch.nn.Module"),Kf.forEach(t),qh=s(ki,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),ki.forEach(t),Ch=u(ve),oe=r(ve,"DIV",{class:!0});var Ut=i(oe);v(nn.$$.fragment,Ut),jh=u(Ut),Qe=r(Ut,"P",{});var Ts=i(Qe);Mh=s(Ts,"The "),rs=r(Ts,"A",{href:!0});var Hf=i(rs);Ph=s(Hf,"LukeForMultipleChoice"),Hf.forEach(t),Ah=s(Ts," forward method, overrides the "),Oa=r(Ts,"CODE",{});var Qf=i(Oa);Sh=s(Qf,"__call__"),Qf.forEach(t),Oh=s(Ts," special method."),Ts.forEach(t),Ih=u(Ut),v(Ft.$$.fragment,Ut),Nh=u(Ut),v(qt.$$.fragment,Ut),Ut.forEach(t),ve.forEach(t),Nr=u(o),Re=r(o,"H2",{class:!0});var yi=i(Re);Ct=r(yi,"A",{id:!0,class:!0,href:!0});var Rf=i(Ct);Ia=r(Rf,"SPAN",{});var Vf=i(Ia);v(sn.$$.fragment,Vf),Vf.forEach(t),Rf.forEach(t),Dh=u(yi),Na=r(yi,"SPAN",{});var Yf=i(Na);Wh=s(Yf,"LukeForTokenClassification"),Yf.forEach(t),yi.forEach(t),Dr=u(o),D=r(o,"DIV",{class:!0});var Te=i(D);v(an.$$.fragment,Te),Bh=u(Te),rn=r(Te,"P",{});var bi=i(rn);Uh=s(bi,`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, `),Da=r(bi,"CODE",{});var Gf=i(Da);Kh=s(Gf,"LukeForEntitySpanClassification"),Gf.forEach(t),Hh=s(bi,` is more suitable than this
class.`),bi.forEach(t),Qh=u(Te),ln=r(Te,"P",{});var vi=i(ln);Rh=s(vi,"This model inherits from "),is=r(vi,"A",{href:!0});var Jf=i(is);Vh=s(Jf,"PreTrainedModel"),Jf.forEach(t),Yh=s(vi,`. 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.)`),vi.forEach(t),Gh=u(Te),dn=r(Te,"P",{});var Ti=i(dn);Jh=s(Ti,"This model is also a PyTorch "),cn=r(Ti,"A",{href:!0,rel:!0});var Xf=i(cn);Xh=s(Xf,"torch.nn.Module"),Xf.forEach(t),Zh=s(Ti,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ti.forEach(t),eu=u(Te),ne=r(Te,"DIV",{class:!0});var Kt=i(ne);v(pn.$$.fragment,Kt),tu=u(Kt),Ve=r(Kt,"P",{});var ws=i(Ve);ou=s(ws,"The "),ls=r(ws,"A",{href:!0});var Zf=i(ls);nu=s(Zf,"LukeForTokenClassification"),Zf.forEach(t),su=s(ws," forward method, overrides the "),Wa=r(ws,"CODE",{});var eg=i(Wa);au=s(eg,"__call__"),eg.forEach(t),ru=s(ws," special method."),ws.forEach(t),iu=u(Kt),v(jt.$$.fragment,Kt),lu=u(Kt),v(Mt.$$.fragment,Kt),Kt.forEach(t),Te.forEach(t),Wr=u(o),Ye=r(o,"H2",{class:!0});var wi=i(Ye);Pt=r(wi,"A",{id:!0,class:!0,href:!0});var tg=i(Pt);Ba=r(tg,"SPAN",{});var og=i(Ba);v(hn.$$.fragment,og),og.forEach(t),tg.forEach(t),du=u(wi),Ua=r(wi,"SPAN",{});var ng=i(Ua);cu=s(ng,"LukeForQuestionAnswering"),ng.forEach(t),wi.forEach(t),Br=u(o),W=r(o,"DIV",{class:!0});var we=i(W);v(un.$$.fragment,we),pu=u(we),Ge=r(we,"P",{});var Ls=i(Ge);hu=s(Ls,`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 `),Ka=r(Ls,"CODE",{});var sg=i(Ka);uu=s(sg,"span start logits"),sg.forEach(t),mu=s(Ls," and "),Ha=r(Ls,"CODE",{});var ag=i(Ha);fu=s(ag,"span end logits"),ag.forEach(t),gu=s(Ls,")."),Ls.forEach(t),_u=u(we),mn=r(we,"P",{});var Li=i(mn);ku=s(Li,"This model inherits from "),ds=r(Li,"A",{href:!0});var rg=i(ds);yu=s(rg,"PreTrainedModel"),rg.forEach(t),bu=s(Li,`. 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.)`),Li.forEach(t),vu=u(we),fn=r(we,"P",{});var $i=i(fn);Tu=s($i,"This model is also a PyTorch "),gn=r($i,"A",{href:!0,rel:!0});var ig=i(gn);wu=s(ig,"torch.nn.Module"),ig.forEach(t),Lu=s($i,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),$i.forEach(t),$u=u(we),se=r(we,"DIV",{class:!0});var Ht=i(se);v(_n.$$.fragment,Ht),zu=u(Ht),Je=r(Ht,"P",{});var $s=i(Je);Eu=s($s,"The "),cs=r($s,"A",{href:!0});var lg=i(cs);xu=s(lg,"LukeForQuestionAnswering"),lg.forEach(t),Fu=s($s," forward method, overrides the "),Qa=r($s,"CODE",{});var dg=i(Qa);qu=s(dg,"__call__"),dg.forEach(t),Cu=s($s," special method."),$s.forEach(t),ju=u(Ht),v(At.$$.fragment,Ht),Mu=u(Ht),v(St.$$.fragment,Ht),Ht.forEach(t),we.forEach(t),this.h()},h(){c(d,"name","hf:doc:metadata"),c(d,"content",JSON.stringify(Og)),c(m,"id","luke"),c(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"),c(m,"href","#luke"),c(f,"class","relative group"),c(Ze,"id","overview"),c(Ze,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ze,"href","#overview"),c($e,"class","relative group"),c(Rt,"href","https://arxiv.org/abs/2010.01057"),c(Rt,"rel","nofollow"),c($n,"href","/docs/transformers/v4.27.1/en/model_doc/roberta#transformers.RobertaModel"),c(zn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeTokenizer"),c(En,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeTokenizer"),c(qn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForEntityClassification"),c(Jt,"href","https://www.cs.utexas.edu/~eunsol/html_pages/open_entity.html"),c(Jt,"rel","nofollow"),c(Cn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForEntityPairClassification"),c(Xt,"href","https://nlp.stanford.edu/projects/tacred/"),c(Xt,"rel","nofollow"),c(Mn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForEntitySpanClassification"),c(Pn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeTokenizer"),c(An,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForEntityPairClassification"),c(Zt,"href","https://github.com/NielsRogge/Transformers-Tutorials/tree/master/LUKE"),c(Zt,"rel","nofollow"),c(to,"href","https://github.com/studio-ousia/luke/tree/master/notebooks"),c(to,"rel","nofollow"),c(no,"href","https://huggingface.co/ikuyamada"),c(no,"rel","nofollow"),c(so,"href","https://huggingface.co/nielsr"),c(so,"rel","nofollow"),c(ao,"href","https://github.com/studio-ousia/luke"),c(ao,"rel","nofollow"),c(nt,"id","documentation-resources"),c(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"),c(nt,"href","#documentation-resources"),c(xe,"class","relative group"),c(On,"href","./tasks/sequence_classification"),c(In,"href","./tasks/token_classification"),c(Nn,"href","./tasks/question_answering"),c(Dn,"href","./tasks/masked_language_modeling"),c(Wn,"href","./tasks/multiple_choice"),c(st,"id","transformers.LukeConfig"),c(st,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(st,"href","#transformers.LukeConfig"),c(Fe,"class","relative group"),c(Bn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeModel"),c(co,"href","https://huggingface.co/studio-ousia/luke-base"),c(co,"rel","nofollow"),c(Un,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(Kn,"href","/docs/transformers/v4.27.1/en/main_classes/configuration#transformers.PretrainedConfig"),c(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(rt,"id","transformers.LukeTokenizer"),c(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"),c(rt,"href","#transformers.LukeTokenizer"),c(je,"class","relative group"),c(Hn,"href","/docs/transformers/v4.27.1/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),c(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Qn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ct,"id","transformers.LukeModel"),c(ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ct,"href","#transformers.LukeModel"),c(Me,"class","relative group"),c(Rn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(bo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(bo,"rel","nofollow"),c(Vn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeModel"),c(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ut,"id","transformers.LukeForMaskedLM"),c(ut,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ut,"href","#transformers.LukeForMaskedLM"),c(Ae,"class","relative group"),c(Yn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(zo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(zo,"rel","nofollow"),c(Gn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForMaskedLM"),c(pe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(ft,"id","transformers.LukeForEntityClassification"),c(ft,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(ft,"href","#transformers.LukeForEntityClassification"),c(Oe,"class","relative group"),c(Jn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(jo,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(jo,"rel","nofollow"),c(Xn,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForEntityClassification"),c(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(kt,"id","transformers.LukeForEntityPairClassification"),c(kt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(kt,"href","#transformers.LukeForEntityPairClassification"),c(Ne,"class","relative group"),c(Zn,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Io,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Io,"rel","nofollow"),c(es,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForEntityPairClassification"),c(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(vt,"id","transformers.LukeForEntitySpanClassification"),c(vt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(vt,"href","#transformers.LukeForEntitySpanClassification"),c(We,"class","relative group"),c(ts,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Ko,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Ko,"rel","nofollow"),c(os,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForEntitySpanClassification"),c(te,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Lt,"id","transformers.LukeForSequenceClassification"),c(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"),c(Lt,"href","#transformers.LukeForSequenceClassification"),c(Ue,"class","relative group"),c(ns,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(Go,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(Go,"rel","nofollow"),c(ss,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForSequenceClassification"),c(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(xt,"id","transformers.LukeForMultipleChoice"),c(xt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(xt,"href","#transformers.LukeForMultipleChoice"),c(He,"class","relative group"),c(as,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(on,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(on,"rel","nofollow"),c(rs,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForMultipleChoice"),c(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Ct,"id","transformers.LukeForTokenClassification"),c(Ct,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),c(Ct,"href","#transformers.LukeForTokenClassification"),c(Re,"class","relative group"),c(is,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(cn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(cn,"rel","nofollow"),c(ls,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForTokenClassification"),c(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(Pt,"id","transformers.LukeForQuestionAnswering"),c(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"),c(Pt,"href","#transformers.LukeForQuestionAnswering"),c(Ye,"class","relative group"),c(ds,"href","/docs/transformers/v4.27.1/en/main_classes/model#transformers.PreTrainedModel"),c(gn,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),c(gn,"rel","nofollow"),c(cs,"href","/docs/transformers/v4.27.1/en/model_doc/luke#transformers.LukeForQuestionAnswering"),c(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),c(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(o,g){e(document.head,d),k(o,y,g),k(o,f,g),e(f,m),e(m,_),T(l,_,null),e(f,p),e(f,E),e(E,zi),k(o,cr,g),k(o,$e,g),e($e,Ze),e(Ze,zs),T(Qt,zs,null),e($e,Ei),e($e,Es),e(Es,xi),k(o,pr,g),k(o,et,g),e(et,Fi),e(et,Rt),e(Rt,qi),e(et,Ci),k(o,hr,g),k(o,Tn,g),e(Tn,ji),k(o,ur,g),k(o,wn,g),e(wn,xs),e(xs,Mi),k(o,mr,g),k(o,Ln,g),e(Ln,Pi),k(o,fr,g),k(o,Y,g),e(Y,Fs),e(Fs,Vt),e(Vt,Ai),e(Vt,$n),e($n,Si),e(Vt,Oi),e(Y,Ii),e(Y,qs),e(qs,C),e(C,Ni),e(C,Cs),e(Cs,Di),e(C,Wi),e(C,js),e(js,Bi),e(C,Ui),e(C,Ms),e(Ms,Ki),e(C,Hi),e(C,Ps),e(Ps,Qi),e(C,Ri),e(C,zn),e(zn,Vi),e(C,Yi),e(Y,Gi),e(Y,Yt),e(Yt,G),e(G,En),e(En,Ji),e(G,Xi),e(G,As),e(As,Zi),e(G,el),e(G,Ss),e(Ss,tl),e(G,ol),e(G,Os),e(Os,nl),e(G,sl),e(Yt,al),e(Yt,Gt),e(Gt,xn),e(xn,Is),e(Is,rl),e(xn,il),e(Gt,ll),e(Gt,Fn),e(Fn,Ns),e(Ns,dl),e(Fn,cl),e(Y,pl),e(Y,R),e(R,Ds),e(Ds,hl),e(R,ul),e(R,ze),e(ze,tt),e(tt,qn),e(qn,ml),e(tt,fl),e(tt,Jt),e(Jt,gl),e(tt,_l),e(ze,kl),e(ze,ot),e(ot,Cn),e(Cn,yl),e(ot,bl),e(ot,Xt),e(Xt,vl),e(ot,Tl),e(ze,wl),e(ze,jn),e(jn,Mn),e(Mn,Ll),e(jn,$l),e(R,zl),e(R,U),e(U,Pn),e(Pn,El),e(U,xl),e(U,Ws),e(Ws,Fl),e(U,ql),e(U,Bs),e(Bs,Cl),e(U,jl),e(U,Us),e(Us,Ml),e(U,Pl),e(U,Ks),e(Ks,Al),e(U,Sl),e(R,Ol),e(R,Ee),e(Ee,Il),e(Ee,An),e(An,Nl),e(Ee,Dl),e(Ee,Zt),e(Zt,Wl),e(Ee,Bl),e(R,Ul),e(R,eo),e(eo,Kl),e(eo,to),e(to,Hl),e(eo,Ql),k(o,gr,g),k(o,Sn,g),e(Sn,Rl),k(o,_r,g),T(oo,o,g),k(o,kr,g),k(o,J,g),e(J,Vl),e(J,no),e(no,Yl),e(J,Gl),e(J,so),e(so,Jl),e(J,Xl),e(J,ao),e(ao,Zl),e(J,ed),k(o,yr,g),k(o,xe,g),e(xe,nt),e(nt,Hs),T(ro,Hs,null),e(xe,td),e(xe,Qs),e(Qs,od),k(o,br,g),k(o,K,g),e(K,Rs),e(Rs,On),e(On,nd),e(K,sd),e(K,Vs),e(Vs,In),e(In,ad),e(K,rd),e(K,Ys),e(Ys,Nn),e(Nn,id),e(K,ld),e(K,Gs),e(Gs,Dn),e(Dn,dd),e(K,cd),e(K,Js),e(Js,Wn),e(Wn,pd),k(o,vr,g),k(o,Fe,g),e(Fe,st),e(st,Xs),T(io,Xs,null),e(Fe,hd),e(Fe,Zs),e(Zs,ud),k(o,Tr,g),k(o,V,g),T(lo,V,null),e(V,md),e(V,qe),e(qe,fd),e(qe,Bn),e(Bn,gd),e(qe,_d),e(qe,co),e(co,kd),e(qe,yd),e(V,bd),e(V,Ce),e(Ce,vd),e(Ce,Un),e(Un,Td),e(Ce,wd),e(Ce,Kn),e(Kn,Ld),e(Ce,$d),e(V,zd),T(at,V,null),k(o,wr,g),k(o,je,g),e(je,rt),e(rt,ea),T(po,ea,null),e(je,Ed),e(je,ta),e(ta,xd),k(o,Lr,g),k(o,x,g),T(ho,x,null),e(x,Fd),e(x,oa),e(oa,qd),e(x,Cd),e(x,na),e(na,jd),e(x,Md),T(it,x,null),e(x,Pd),e(x,uo),e(uo,Ad),e(uo,sa),e(sa,Sd),e(uo,Od),e(x,Id),T(lt,x,null),e(x,Nd),e(x,j),e(j,Dd),e(j,Hn),e(Hn,Wd),e(j,Bd),e(j,aa),e(aa,Ud),e(j,Kd),e(j,ra),e(ra,Hd),e(j,Qd),e(j,ia),e(ia,Rd),e(j,Vd),e(j,la),e(la,Yd),e(j,Gd),e(x,Jd),e(x,dt),T(mo,dt,null),e(dt,Xd),e(dt,da),e(da,Zd),e(x,ec),e(x,Qn),T(fo,Qn,null),k(o,$r,g),k(o,Me,g),e(Me,ct),e(ct,ca),T(go,ca,null),e(Me,tc),e(Me,pa),e(pa,oc),k(o,zr,g),k(o,M,g),T(_o,M,null),e(M,nc),e(M,ha),e(ha,sc),e(M,ac),e(M,ko),e(ko,rc),e(ko,Rn),e(Rn,ic),e(ko,lc),e(M,dc),e(M,yo),e(yo,cc),e(yo,bo),e(bo,pc),e(yo,hc),e(M,uc),e(M,X),T(vo,X,null),e(X,mc),e(X,Pe),e(Pe,fc),e(Pe,Vn),e(Vn,gc),e(Pe,_c),e(Pe,ua),e(ua,kc),e(Pe,yc),e(X,bc),T(pt,X,null),e(X,vc),T(ht,X,null),k(o,Er,g),k(o,Ae,g),e(Ae,ut),e(ut,ma),T(To,ma,null),e(Ae,Tc),e(Ae,fa),e(fa,wc),k(o,xr,g),k(o,P,g),T(wo,P,null),e(P,Lc),e(P,ga),e(ga,$c),e(P,zc),e(P,Lo),e(Lo,Ec),e(Lo,Yn),e(Yn,xc),e(Lo,Fc),e(P,qc),e(P,$o),e($o,Cc),e($o,zo),e(zo,jc),e($o,Mc),e(P,Pc),e(P,pe),T(Eo,pe,null),e(pe,Ac),e(pe,Se),e(Se,Sc),e(Se,Gn),e(Gn,Oc),e(Se,Ic),e(Se,_a),e(_a,Nc),e(Se,Dc),e(pe,Wc),T(mt,pe,null),k(o,Fr,g),k(o,Oe,g),e(Oe,ft),e(ft,ka),T(xo,ka,null),e(Oe,Bc),e(Oe,ya),e(ya,Uc),k(o,qr,g),k(o,A,g),T(Fo,A,null),e(A,Kc),e(A,ba),e(ba,Hc),e(A,Qc),e(A,qo),e(qo,Rc),e(qo,Jn),e(Jn,Vc),e(qo,Yc),e(A,Gc),e(A,Co),e(Co,Jc),e(Co,jo),e(jo,Xc),e(Co,Zc),e(A,ep),e(A,Z),T(Mo,Z,null),e(Z,tp),e(Z,Ie),e(Ie,op),e(Ie,Xn),e(Xn,np),e(Ie,sp),e(Ie,va),e(va,ap),e(Ie,rp),e(Z,ip),T(gt,Z,null),e(Z,lp),T(_t,Z,null),k(o,Cr,g),k(o,Ne,g),e(Ne,kt),e(kt,Ta),T(Po,Ta,null),e(Ne,dp),e(Ne,wa),e(wa,cp),k(o,jr,g),k(o,S,g),T(Ao,S,null),e(S,pp),e(S,La),e(La,hp),e(S,up),e(S,So),e(So,mp),e(So,Zn),e(Zn,fp),e(So,gp),e(S,_p),e(S,Oo),e(Oo,kp),e(Oo,Io),e(Io,yp),e(Oo,bp),e(S,vp),e(S,ee),T(No,ee,null),e(ee,Tp),e(ee,De),e(De,wp),e(De,es),e(es,Lp),e(De,$p),e(De,$a),e($a,zp),e(De,Ep),e(ee,xp),T(yt,ee,null),e(ee,Fp),T(bt,ee,null),k(o,Mr,g),k(o,We,g),e(We,vt),e(vt,za),T(Do,za,null),e(We,qp),e(We,Ea),e(Ea,Cp),k(o,Pr,g),k(o,O,g),T(Wo,O,null),e(O,jp),e(O,xa),e(xa,Mp),e(O,Pp),e(O,Bo),e(Bo,Ap),e(Bo,ts),e(ts,Sp),e(Bo,Op),e(O,Ip),e(O,Uo),e(Uo,Np),e(Uo,Ko),e(Ko,Dp),e(Uo,Wp),e(O,Bp),e(O,te),T(Ho,te,null),e(te,Up),e(te,Be),e(Be,Kp),e(Be,os),e(os,Hp),e(Be,Qp),e(Be,Fa),e(Fa,Rp),e(Be,Vp),e(te,Yp),T(Tt,te,null),e(te,Gp),T(wt,te,null),k(o,Ar,g),k(o,Ue,g),e(Ue,Lt),e(Lt,qa),T(Qo,qa,null),e(Ue,Jp),e(Ue,Ca),e(Ca,Xp),k(o,Sr,g),k(o,I,g),T(Ro,I,null),e(I,Zp),e(I,ja),e(ja,eh),e(I,th),e(I,Vo),e(Vo,oh),e(Vo,ns),e(ns,nh),e(Vo,sh),e(I,ah),e(I,Yo),e(Yo,rh),e(Yo,Go),e(Go,ih),e(Yo,lh),e(I,dh),e(I,H),T(Jo,H,null),e(H,ch),e(H,Ke),e(Ke,ph),e(Ke,ss),e(ss,hh),e(Ke,uh),e(Ke,Ma),e(Ma,mh),e(Ke,fh),e(H,gh),T($t,H,null),e(H,_h),T(zt,H,null),e(H,kh),T(Et,H,null),k(o,Or,g),k(o,He,g),e(He,xt),e(xt,Pa),T(Xo,Pa,null),e(He,yh),e(He,Aa),e(Aa,bh),k(o,Ir,g),k(o,N,g),T(Zo,N,null),e(N,vh),e(N,Sa),e(Sa,Th),e(N,wh),e(N,en),e(en,Lh),e(en,as),e(as,$h),e(en,zh),e(N,Eh),e(N,tn),e(tn,xh),e(tn,on),e(on,Fh),e(tn,qh),e(N,Ch),e(N,oe),T(nn,oe,null),e(oe,jh),e(oe,Qe),e(Qe,Mh),e(Qe,rs),e(rs,Ph),e(Qe,Ah),e(Qe,Oa),e(Oa,Sh),e(Qe,Oh),e(oe,Ih),T(Ft,oe,null),e(oe,Nh),T(qt,oe,null),k(o,Nr,g),k(o,Re,g),e(Re,Ct),e(Ct,Ia),T(sn,Ia,null),e(Re,Dh),e(Re,Na),e(Na,Wh),k(o,Dr,g),k(o,D,g),T(an,D,null),e(D,Bh),e(D,rn),e(rn,Uh),e(rn,Da),e(Da,Kh),e(rn,Hh),e(D,Qh),e(D,ln),e(ln,Rh),e(ln,is),e(is,Vh),e(ln,Yh),e(D,Gh),e(D,dn),e(dn,Jh),e(dn,cn),e(cn,Xh),e(dn,Zh),e(D,eu),e(D,ne),T(pn,ne,null),e(ne,tu),e(ne,Ve),e(Ve,ou),e(Ve,ls),e(ls,nu),e(Ve,su),e(Ve,Wa),e(Wa,au),e(Ve,ru),e(ne,iu),T(jt,ne,null),e(ne,lu),T(Mt,ne,null),k(o,Wr,g),k(o,Ye,g),e(Ye,Pt),e(Pt,Ba),T(hn,Ba,null),e(Ye,du),e(Ye,Ua),e(Ua,cu),k(o,Br,g),k(o,W,g),T(un,W,null),e(W,pu),e(W,Ge),e(Ge,hu),e(Ge,Ka),e(Ka,uu),e(Ge,mu),e(Ge,Ha),e(Ha,fu),e(Ge,gu),e(W,_u),e(W,mn),e(mn,ku),e(mn,ds),e(ds,yu),e(mn,bu),e(W,vu),e(W,fn),e(fn,Tu),e(fn,gn),e(gn,wu),e(fn,Lu),e(W,$u),e(W,se),T(_n,se,null),e(se,zu),e(se,Je),e(Je,Eu),e(Je,cs),e(cs,xu),e(Je,Fu),e(Je,Qa),e(Qa,qu),e(Je,Cu),e(se,ju),T(At,se,null),e(se,Mu),T(St,se,null),Ur=!0},p(o,[g]){const kn={};g&2&&(kn.$$scope={dirty:g,ctx:o}),at.$set(kn);const Ra={};g&2&&(Ra.$$scope={dirty:g,ctx:o}),it.$set(Ra);const Va={};g&2&&(Va.$$scope={dirty:g,ctx:o}),lt.$set(Va);const Ya={};g&2&&(Ya.$$scope={dirty:g,ctx:o}),pt.$set(Ya);const yn={};g&2&&(yn.$$scope={dirty:g,ctx:o}),ht.$set(yn);const Ga={};g&2&&(Ga.$$scope={dirty:g,ctx:o}),mt.$set(Ga);const Ja={};g&2&&(Ja.$$scope={dirty:g,ctx:o}),gt.$set(Ja);const Xa={};g&2&&(Xa.$$scope={dirty:g,ctx:o}),_t.$set(Xa);const bn={};g&2&&(bn.$$scope={dirty:g,ctx:o}),yt.$set(bn);const Za={};g&2&&(Za.$$scope={dirty:g,ctx:o}),bt.$set(Za);const er={};g&2&&(er.$$scope={dirty:g,ctx:o}),Tt.$set(er);const tr={};g&2&&(tr.$$scope={dirty:g,ctx:o}),wt.$set(tr);const or={};g&2&&(or.$$scope={dirty:g,ctx:o}),$t.$set(or);const nr={};g&2&&(nr.$$scope={dirty:g,ctx:o}),zt.$set(nr);const ie={};g&2&&(ie.$$scope={dirty:g,ctx:o}),Et.$set(ie);const sr={};g&2&&(sr.$$scope={dirty:g,ctx:o}),Ft.$set(sr);const vn={};g&2&&(vn.$$scope={dirty:g,ctx:o}),qt.$set(vn);const ar={};g&2&&(ar.$$scope={dirty:g,ctx:o}),jt.$set(ar);const rr={};g&2&&(rr.$$scope={dirty:g,ctx:o}),Mt.$set(rr);const B={};g&2&&(B.$$scope={dirty:g,ctx:o}),At.$set(B);const ir={};g&2&&(ir.$$scope={dirty:g,ctx:o}),St.$set(ir)},i(o){Ur||(w(l.$$.fragment,o),w(Qt.$$.fragment,o),w(oo.$$.fragment,o),w(ro.$$.fragment,o),w(io.$$.fragment,o),w(lo.$$.fragment,o),w(at.$$.fragment,o),w(po.$$.fragment,o),w(ho.$$.fragment,o),w(it.$$.fragment,o),w(lt.$$.fragment,o),w(mo.$$.fragment,o),w(fo.$$.fragment,o),w(go.$$.fragment,o),w(_o.$$.fragment,o),w(vo.$$.fragment,o),w(pt.$$.fragment,o),w(ht.$$.fragment,o),w(To.$$.fragment,o),w(wo.$$.fragment,o),w(Eo.$$.fragment,o),w(mt.$$.fragment,o),w(xo.$$.fragment,o),w(Fo.$$.fragment,o),w(Mo.$$.fragment,o),w(gt.$$.fragment,o),w(_t.$$.fragment,o),w(Po.$$.fragment,o),w(Ao.$$.fragment,o),w(No.$$.fragment,o),w(yt.$$.fragment,o),w(bt.$$.fragment,o),w(Do.$$.fragment,o),w(Wo.$$.fragment,o),w(Ho.$$.fragment,o),w(Tt.$$.fragment,o),w(wt.$$.fragment,o),w(Qo.$$.fragment,o),w(Ro.$$.fragment,o),w(Jo.$$.fragment,o),w($t.$$.fragment,o),w(zt.$$.fragment,o),w(Et.$$.fragment,o),w(Xo.$$.fragment,o),w(Zo.$$.fragment,o),w(nn.$$.fragment,o),w(Ft.$$.fragment,o),w(qt.$$.fragment,o),w(sn.$$.fragment,o),w(an.$$.fragment,o),w(pn.$$.fragment,o),w(jt.$$.fragment,o),w(Mt.$$.fragment,o),w(hn.$$.fragment,o),w(un.$$.fragment,o),w(_n.$$.fragment,o),w(At.$$.fragment,o),w(St.$$.fragment,o),Ur=!0)},o(o){L(l.$$.fragment,o),L(Qt.$$.fragment,o),L(oo.$$.fragment,o),L(ro.$$.fragment,o),L(io.$$.fragment,o),L(lo.$$.fragment,o),L(at.$$.fragment,o),L(po.$$.fragment,o),L(ho.$$.fragment,o),L(it.$$.fragment,o),L(lt.$$.fragment,o),L(mo.$$.fragment,o),L(fo.$$.fragment,o),L(go.$$.fragment,o),L(_o.$$.fragment,o),L(vo.$$.fragment,o),L(pt.$$.fragment,o),L(ht.$$.fragment,o),L(To.$$.fragment,o),L(wo.$$.fragment,o),L(Eo.$$.fragment,o),L(mt.$$.fragment,o),L(xo.$$.fragment,o),L(Fo.$$.fragment,o),L(Mo.$$.fragment,o),L(gt.$$.fragment,o),L(_t.$$.fragment,o),L(Po.$$.fragment,o),L(Ao.$$.fragment,o),L(No.$$.fragment,o),L(yt.$$.fragment,o),L(bt.$$.fragment,o),L(Do.$$.fragment,o),L(Wo.$$.fragment,o),L(Ho.$$.fragment,o),L(Tt.$$.fragment,o),L(wt.$$.fragment,o),L(Qo.$$.fragment,o),L(Ro.$$.fragment,o),L(Jo.$$.fragment,o),L($t.$$.fragment,o),L(zt.$$.fragment,o),L(Et.$$.fragment,o),L(Xo.$$.fragment,o),L(Zo.$$.fragment,o),L(nn.$$.fragment,o),L(Ft.$$.fragment,o),L(qt.$$.fragment,o),L(sn.$$.fragment,o),L(an.$$.fragment,o),L(pn.$$.fragment,o),L(jt.$$.fragment,o),L(Mt.$$.fragment,o),L(hn.$$.fragment,o),L(un.$$.fragment,o),L(_n.$$.fragment,o),L(At.$$.fragment,o),L(St.$$.fragment,o),Ur=!1},d(o){t(d),o&&t(y),o&&t(f),$(l),o&&t(cr),o&&t($e),$(Qt),o&&t(pr),o&&t(et),o&&t(hr),o&&t(Tn),o&&t(ur),o&&t(wn),o&&t(mr),o&&t(Ln),o&&t(fr),o&&t(Y),o&&t(gr),o&&t(Sn),o&&t(_r),$(oo,o),o&&t(kr),o&&t(J),o&&t(yr),o&&t(xe),$(ro),o&&t(br),o&&t(K),o&&t(vr),o&&t(Fe),$(io),o&&t(Tr),o&&t(V),$(lo),$(at),o&&t(wr),o&&t(je),$(po),o&&t(Lr),o&&t(x),$(ho),$(it),$(lt),$(mo),$(fo),o&&t($r),o&&t(Me),$(go),o&&t(zr),o&&t(M),$(_o),$(vo),$(pt),$(ht),o&&t(Er),o&&t(Ae),$(To),o&&t(xr),o&&t(P),$(wo),$(Eo),$(mt),o&&t(Fr),o&&t(Oe),$(xo),o&&t(qr),o&&t(A),$(Fo),$(Mo),$(gt),$(_t),o&&t(Cr),o&&t(Ne),$(Po),o&&t(jr),o&&t(S),$(Ao),$(No),$(yt),$(bt),o&&t(Mr),o&&t(We),$(Do),o&&t(Pr),o&&t(O),$(Wo),$(Ho),$(Tt),$(wt),o&&t(Ar),o&&t(Ue),$(Qo),o&&t(Sr),o&&t(I),$(Ro),$(Jo),$($t),$(zt),$(Et),o&&t(Or),o&&t(He),$(Xo),o&&t(Ir),o&&t(N),$(Zo),$(nn),$(Ft),$(qt),o&&t(Nr),o&&t(Re),$(sn),o&&t(Dr),o&&t(D),$(an),$(pn),$(jt),$(Mt),o&&t(Wr),o&&t(Ye),$(hn),o&&t(Br),o&&t(W),$(un),$(_n),$(At),$(St)}}}const Og={local:"luke",sections:[{local:"overview",title:"Overview"},{local:"documentation-resources",title:"Documentation resources"},{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 Ig(z){return mg(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Hg extends cg{constructor(d){super();pg(this,d,Ig,Sg,hg,{})}}export{Hg as default,Og as metadata};
