import{S as Kw,i as Rw,s as Vw,e as a,k as c,w as T,t as n,M as Yw,c as r,d as t,m as p,a as i,x as w,h as s,b as f,G as e,g,y as v,q as N,o as $,B as x,v as Gw,L as Ve}from"../../chunks/vendor-hf-doc-builder.js";import{T as Je}from"../../chunks/Tip-hf-doc-builder.js";import{D as P}from"../../chunks/Docstring-hf-doc-builder.js";import{C as Ye}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Ze}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as Re}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function Jw(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import XLNetConfig, XLNetModel

# Initializing a XLNet configuration
configuration = XLNetConfig()

# Initializing a model (with random weights) from the configuration
model = XLNetModel(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> XLNetConfig, XLNetModel

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

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># Initializing a model (with random weights) from the configuration</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetModel(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:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Examples:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function Zw(q){let d,y,h,u,b;return u=new Ye({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=a("p"),y=n("sequence pair mask has the following format:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"sequence pair mask has the following format:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function ev(q){let d,y,h,u,b;return u=new Ye({props:{code:`0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence    | second sequence |`,highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`}}),{c(){d=a("p"),y=n("sequence pair mask has the following format:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"sequence pair mask has the following format:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function tv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function ov(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, XLNetModel
import torch

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = XLNetModel.from_pretrained("xlnet-base-cased")

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

last_hidden_states = outputs.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, XLNetModel
<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;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetModel.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=a("p"),y=n("Example:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function nv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function sv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, XLNetLMHeadModel
import torch

tokenizer = AutoTokenizer.from_pretrained("xlnet-large-cased")
model = XLNetLMHeadModel.from_pretrained("xlnet-large-cased")

# We show how to setup inputs to predict a next token using a bi-directional context.
input_ids = torch.tensor(
    tokenizer.encode("Hello, my dog is very <mask>", add_special_tokens=False)
).unsqueeze(
    0
)  # We will predict the masked token
perm_mask = torch.zeros((1, input_ids.shape[1], input_ids.shape[1]), dtype=torch.float)
perm_mask[:, :, -1] = 1.0  # Previous tokens don't see last token
target_mapping = torch.zeros(
    (1, 1, input_ids.shape[1]), dtype=torch.float
)  # Shape [1, 1, seq_length] => let's predict one token
target_mapping[
    0, 0, -1
] = 1.0  # Our first (and only) prediction will be the last token of the sequence (the masked token)

outputs = model(input_ids, perm_mask=perm_mask, target_mapping=target_mapping)
next_token_logits = outputs[
    0
]  # Output has shape [target_mapping.size(0), target_mapping.size(1), config.vocab_size]

# The same way can the XLNetLMHeadModel be used to be trained by standard auto-regressive language modeling.
input_ids = torch.tensor(
    tokenizer.encode("Hello, my dog is very <mask>", add_special_tokens=False)
).unsqueeze(
    0
)  # We will predict the masked token
labels = torch.tensor(tokenizer.encode("cute", add_special_tokens=False)).unsqueeze(0)
assert labels.shape[0] == 1, "only one word will be predicted"
perm_mask = torch.zeros((1, input_ids.shape[1], input_ids.shape[1]), dtype=torch.float)
perm_mask[
    :, :, -1
] = 1.0  # Previous tokens don't see last token as is done in standard auto-regressive lm training
target_mapping = torch.zeros(
    (1, 1, input_ids.shape[1]), dtype=torch.float
)  # Shape [1, 1, seq_length] => let's predict one token
target_mapping[
    0, 0, -1
] = 1.0  # Our first (and only) prediction will be the last token of the sequence (the masked token)

outputs = model(input_ids, perm_mask=perm_mask, target_mapping=target_mapping, labels=labels)
loss = outputs.loss
next_token_logits = (
    outputs.logits
)  # Logits have shape [target_mapping.size(0), target_mapping.size(1), config.vocab_size]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, XLNetLMHeadModel
<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;xlnet-large-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetLMHeadModel.from_pretrained(<span class="hljs-string">&quot;xlnet-large-cased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We show how to setup inputs to predict a next token using a bi-directional context.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(
<span class="hljs-meta">... </span>    tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is very &lt;mask&gt;&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>)
<span class="hljs-meta">... </span>).unsqueeze(
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># We will predict the masked token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>perm_mask = torch.zeros((<span class="hljs-number">1</span>, input_ids.shape[<span class="hljs-number">1</span>], input_ids.shape[<span class="hljs-number">1</span>]), dtype=torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>perm_mask[:, :, -<span class="hljs-number">1</span>] = <span class="hljs-number">1.0</span>  <span class="hljs-comment"># Previous tokens don&#x27;t see last token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_mapping = torch.zeros(
<span class="hljs-meta">... </span>    (<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, input_ids.shape[<span class="hljs-number">1</span>]), dtype=torch.<span class="hljs-built_in">float</span>
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># Shape [1, 1, seq_length] =&gt; let&#x27;s predict one token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_mapping[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, -<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>] = <span class="hljs-number">1.0</span>  <span class="hljs-comment"># Our first (and only) prediction will be the last token of the sequence (the masked token)</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids, perm_mask=perm_mask, target_mapping=target_mapping)
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># Output has shape [target_mapping.size(0), target_mapping.size(1), config.vocab_size]</span>

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># The same way can the XLNetLMHeadModel be used to be trained by standard auto-regressive language modeling.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(
<span class="hljs-meta">... </span>    tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is very &lt;mask&gt;&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>)
<span class="hljs-meta">... </span>).unsqueeze(
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># We will predict the masked token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>labels = torch.tensor(tokenizer.encode(<span class="hljs-string">&quot;cute&quot;</span>, add_special_tokens=<span class="hljs-literal">False</span>)).unsqueeze(<span class="hljs-number">0</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">assert</span> labels.shape[<span class="hljs-number">0</span>] == <span class="hljs-number">1</span>, <span class="hljs-string">&quot;only one word will be predicted&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>perm_mask = torch.zeros((<span class="hljs-number">1</span>, input_ids.shape[<span class="hljs-number">1</span>], input_ids.shape[<span class="hljs-number">1</span>]), dtype=torch.<span class="hljs-built_in">float</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>perm_mask[
<span class="hljs-meta">... </span>    :, :, -<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>] = <span class="hljs-number">1.0</span>  <span class="hljs-comment"># Previous tokens don&#x27;t see last token as is done in standard auto-regressive lm training</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_mapping = torch.zeros(
<span class="hljs-meta">... </span>    (<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, input_ids.shape[<span class="hljs-number">1</span>]), dtype=torch.<span class="hljs-built_in">float</span>
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># Shape [1, 1, seq_length] =&gt; let&#x27;s predict one token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_mapping[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, -<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>] = <span class="hljs-number">1.0</span>  <span class="hljs-comment"># Our first (and only) prediction will be the last token of the sequence (the masked token)</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids, perm_mask=perm_mask, target_mapping=target_mapping, labels=labels)
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss
<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = (
<span class="hljs-meta">... </span>    outputs.logits
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># Logits have shape [target_mapping.size(0), target_mapping.size(1), config.vocab_size]</span>`}}),{c(){d=a("p"),y=n("Examples:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Examples:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function av(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function rv(q){let d,y,h,u,b;return u=new Ye({props:{code:`import torch
from transformers import AutoTokenizer, XLNetForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = XLNetForSequenceClassification.from_pretrained("xlnet-base-cased")

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 = XLNetForSequenceClassification.from_pretrained("xlnet-base-cased", 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, XLNetForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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 = XLNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example of single-label classification:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function iv(q){let d,y,h,u,b;return u=new Ye({props:{code:`import torch
from transformers import AutoTokenizer, XLNetForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = XLNetForSequenceClassification.from_pretrained("xlnet-base-cased", 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 = XLNetForSequenceClassification.from_pretrained(
    "xlnet-base-cased", 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, XLNetForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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 = XLNetForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;xlnet-base-cased&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:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example of multi-label classification:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function lv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function dv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, XLNetForMultipleChoice
import torch

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = XLNetForMultipleChoice.from_pretrained("xlnet-base-cased")

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, XLNetForMultipleChoice
<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;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function cv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function pv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, XLNetForTokenClassification
import torch

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = XLNetForTokenClassification.from_pretrained("xlnet-base-cased")

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, XLNetForTokenClassification
<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;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetForTokenClassification.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function mv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function hv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, XLNetForQuestionAnsweringSimple
import torch

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = XLNetForQuestionAnsweringSimple.from_pretrained("xlnet-base-cased")

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, XLNetForQuestionAnsweringSimple
<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;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetForQuestionAnsweringSimple.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function uv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function fv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, XLNetForQuestionAnswering
import torch

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = XLNetForQuestionAnswering.from_pretrained("xlnet-base-cased")

input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute", add_special_tokens=True)).unsqueeze(
    0
)  # Batch size 1
start_positions = torch.tensor([1])
end_positions = torch.tensor([3])
outputs = model(input_ids, start_positions=start_positions, end_positions=end_positions)

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, XLNetForQuestionAnswering
<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;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = XLNetForQuestionAnswering.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = torch.tensor(tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is cute&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>)).unsqueeze(
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># Batch size 1</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>start_positions = torch.tensor([<span class="hljs-number">1</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>end_positions = torch.tensor([<span class="hljs-number">3</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(input_ids, start_positions=start_positions, end_positions=end_positions)

<span class="hljs-meta">&gt;&gt;&gt; </span>loss = outputs.loss`}}),{c(){d=a("p"),y=n("Example:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function gv(q){let d,y,h,u,b,l,m,z,ke,me,D,ae,ee,L,be,R,ye,he,Q,Te,re,Y,we,ue,B,ve,fe,K,de,Ne,ne,M,E,ge,A,ie,$e,V,xe,Le,C,le,G,ce,Fe,J,Xe,te,I,pe,Z,qe,oe,j,ze,O,Me,Ee;return{c(){d=a("p"),y=n("TensorFlow models and layers in "),h=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=c(),m=a("ul"),z=a("li"),ke=n("having all inputs as keyword arguments (like PyTorch models), or"),me=c(),D=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=c(),L=a("p"),be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),ye=n("model.fit()"),he=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Te=n("model.fit()"),re=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a("code"),we=n("fit()"),ue=n(" and "),B=a("code"),ve=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),K=a("code"),de=n("Functional"),Ne=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),M=a("ul"),E=a("li"),ge=n("a single Tensor with "),A=a("code"),ie=n("input_ids"),$e=n(" only and nothing else: "),V=a("code"),xe=n("model(input_ids)"),Le=c(),C=a("li"),le=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=a("code"),ce=n("model([input_ids, attention_mask])"),Fe=n(" or "),J=a("code"),Xe=n("model([input_ids, attention_mask, token_type_ids])"),te=c(),I=a("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=c(),j=a("p"),ze=n(`Note that when creating models and layers with
`),O=a("a"),Me=n("subclassing"),Ee=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(k){d=r(k,"P",{});var F=i(d);y=s(F,"TensorFlow models and layers in "),h=r(F,"CODE",{});var Ie=i(h);u=s(Ie,"transformers"),Ie.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),l=p(k),m=r(k,"UL",{});var se=i(m);z=r(se,"LI",{});var _e=i(z);ke=s(_e,"having all inputs as keyword arguments (like PyTorch models), or"),_e.forEach(t),me=p(se),D=r(se,"LI",{});var He=i(D);ae=s(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),se.forEach(t),ee=p(k),L=r(k,"P",{});var X=i(L);be=s(X,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=r(X,"CODE",{});var Qe=i(R);ye=s(Qe,"model.fit()"),Qe.forEach(t),he=s(X,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(X,"CODE",{});var Ue=i(Q);Te=s(Ue,"model.fit()"),Ue.forEach(t),re=s(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r(X,"CODE",{});var Oe=i(Y);we=s(Oe,"fit()"),Oe.forEach(t),ue=s(X," and "),B=r(X,"CODE",{});var We=i(B);ve=s(We,"predict()"),We.forEach(t),fe=s(X,`, such as when creating your own layers or models with
the Keras `),K=r(X,"CODE",{});var Be=i(K);de=s(Be,"Functional"),Be.forEach(t),Ne=s(X,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),X.forEach(t),ne=p(k),M=r(k,"UL",{});var S=i(M);E=r(S,"LI",{});var H=i(E);ge=s(H,"a single Tensor with "),A=r(H,"CODE",{});var je=i(A);ie=s(je,"input_ids"),je.forEach(t),$e=s(H," only and nothing else: "),V=r(H,"CODE",{});var Pe=i(V);xe=s(Pe,"model(input_ids)"),Pe.forEach(t),H.forEach(t),Le=p(S),C=r(S,"LI",{});var U=i(C);le=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=r(U,"CODE",{});var Ke=i(G);ce=s(Ke,"model([input_ids, attention_mask])"),Ke.forEach(t),Fe=s(U," or "),J=r(U,"CODE",{});var Se=i(J);Xe=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),U.forEach(t),te=p(S),I=r(S,"LI",{});var Ce=i(I);pe=s(Ce,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=r(Ce,"CODE",{});var De=i(Z);qe=s(De,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),De.forEach(t),Ce.forEach(t),S.forEach(t),oe=p(k),j=r(k,"P",{});var W=i(j);ze=s(W,`Note that when creating models and layers with
`),O=r(W,"A",{href:!0,rel:!0});var Ae=i(O);Me=s(Ae,"subclassing"),Ae.forEach(t),Ee=s(W,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),W.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(k,F){g(k,d,F),e(d,y),e(d,h),e(h,u),e(d,b),g(k,l,F),g(k,m,F),e(m,z),e(z,ke),e(m,me),e(m,D),e(D,ae),g(k,ee,F),g(k,L,F),e(L,be),e(L,R),e(R,ye),e(L,he),e(L,Q),e(Q,Te),e(L,re),e(L,Y),e(Y,we),e(L,ue),e(L,B),e(B,ve),e(L,fe),e(L,K),e(K,de),e(L,Ne),g(k,ne,F),g(k,M,F),e(M,E),e(E,ge),e(E,A),e(A,ie),e(E,$e),e(E,V),e(V,xe),e(M,Le),e(M,C),e(C,le),e(C,G),e(G,ce),e(C,Fe),e(C,J),e(J,Xe),e(M,te),e(M,I),e(I,pe),e(I,Z),e(Z,qe),g(k,oe,F),g(k,j,F),e(j,ze),e(j,O),e(O,Me),e(j,Ee)},d(k){k&&t(d),k&&t(l),k&&t(m),k&&t(ee),k&&t(L),k&&t(ne),k&&t(M),k&&t(oe),k&&t(j)}}}function _v(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function kv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, TFXLNetModel
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = TFXLNetModel.from_pretrained("xlnet-base-cased")

inputs = tokenizer("Hello, my dog is cute", return_tensors="tf")
outputs = model(inputs)

last_hidden_states = outputs.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, TFXLNetModel
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLNetModel.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>last_hidden_states = outputs.last_hidden_state`}}),{c(){d=a("p"),y=n("Example:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function bv(q){let d,y,h,u,b,l,m,z,ke,me,D,ae,ee,L,be,R,ye,he,Q,Te,re,Y,we,ue,B,ve,fe,K,de,Ne,ne,M,E,ge,A,ie,$e,V,xe,Le,C,le,G,ce,Fe,J,Xe,te,I,pe,Z,qe,oe,j,ze,O,Me,Ee;return{c(){d=a("p"),y=n("TensorFlow models and layers in "),h=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=c(),m=a("ul"),z=a("li"),ke=n("having all inputs as keyword arguments (like PyTorch models), or"),me=c(),D=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=c(),L=a("p"),be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),ye=n("model.fit()"),he=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Te=n("model.fit()"),re=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a("code"),we=n("fit()"),ue=n(" and "),B=a("code"),ve=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),K=a("code"),de=n("Functional"),Ne=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),M=a("ul"),E=a("li"),ge=n("a single Tensor with "),A=a("code"),ie=n("input_ids"),$e=n(" only and nothing else: "),V=a("code"),xe=n("model(input_ids)"),Le=c(),C=a("li"),le=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=a("code"),ce=n("model([input_ids, attention_mask])"),Fe=n(" or "),J=a("code"),Xe=n("model([input_ids, attention_mask, token_type_ids])"),te=c(),I=a("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=c(),j=a("p"),ze=n(`Note that when creating models and layers with
`),O=a("a"),Me=n("subclassing"),Ee=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(k){d=r(k,"P",{});var F=i(d);y=s(F,"TensorFlow models and layers in "),h=r(F,"CODE",{});var Ie=i(h);u=s(Ie,"transformers"),Ie.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),l=p(k),m=r(k,"UL",{});var se=i(m);z=r(se,"LI",{});var _e=i(z);ke=s(_e,"having all inputs as keyword arguments (like PyTorch models), or"),_e.forEach(t),me=p(se),D=r(se,"LI",{});var He=i(D);ae=s(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),se.forEach(t),ee=p(k),L=r(k,"P",{});var X=i(L);be=s(X,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=r(X,"CODE",{});var Qe=i(R);ye=s(Qe,"model.fit()"),Qe.forEach(t),he=s(X,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(X,"CODE",{});var Ue=i(Q);Te=s(Ue,"model.fit()"),Ue.forEach(t),re=s(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r(X,"CODE",{});var Oe=i(Y);we=s(Oe,"fit()"),Oe.forEach(t),ue=s(X," and "),B=r(X,"CODE",{});var We=i(B);ve=s(We,"predict()"),We.forEach(t),fe=s(X,`, such as when creating your own layers or models with
the Keras `),K=r(X,"CODE",{});var Be=i(K);de=s(Be,"Functional"),Be.forEach(t),Ne=s(X,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),X.forEach(t),ne=p(k),M=r(k,"UL",{});var S=i(M);E=r(S,"LI",{});var H=i(E);ge=s(H,"a single Tensor with "),A=r(H,"CODE",{});var je=i(A);ie=s(je,"input_ids"),je.forEach(t),$e=s(H," only and nothing else: "),V=r(H,"CODE",{});var Pe=i(V);xe=s(Pe,"model(input_ids)"),Pe.forEach(t),H.forEach(t),Le=p(S),C=r(S,"LI",{});var U=i(C);le=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=r(U,"CODE",{});var Ke=i(G);ce=s(Ke,"model([input_ids, attention_mask])"),Ke.forEach(t),Fe=s(U," or "),J=r(U,"CODE",{});var Se=i(J);Xe=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),U.forEach(t),te=p(S),I=r(S,"LI",{});var Ce=i(I);pe=s(Ce,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=r(Ce,"CODE",{});var De=i(Z);qe=s(De,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),De.forEach(t),Ce.forEach(t),S.forEach(t),oe=p(k),j=r(k,"P",{});var W=i(j);ze=s(W,`Note that when creating models and layers with
`),O=r(W,"A",{href:!0,rel:!0});var Ae=i(O);Me=s(Ae,"subclassing"),Ae.forEach(t),Ee=s(W,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),W.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(k,F){g(k,d,F),e(d,y),e(d,h),e(h,u),e(d,b),g(k,l,F),g(k,m,F),e(m,z),e(z,ke),e(m,me),e(m,D),e(D,ae),g(k,ee,F),g(k,L,F),e(L,be),e(L,R),e(R,ye),e(L,he),e(L,Q),e(Q,Te),e(L,re),e(L,Y),e(Y,we),e(L,ue),e(L,B),e(B,ve),e(L,fe),e(L,K),e(K,de),e(L,Ne),g(k,ne,F),g(k,M,F),e(M,E),e(E,ge),e(E,A),e(A,ie),e(E,$e),e(E,V),e(V,xe),e(M,Le),e(M,C),e(C,le),e(C,G),e(G,ce),e(C,Fe),e(C,J),e(J,Xe),e(M,te),e(M,I),e(I,pe),e(I,Z),e(Z,qe),g(k,oe,F),g(k,j,F),e(j,ze),e(j,O),e(O,Me),e(j,Ee)},d(k){k&&t(d),k&&t(l),k&&t(m),k&&t(ee),k&&t(L),k&&t(ne),k&&t(M),k&&t(oe),k&&t(j)}}}function yv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function Tv(q){let d,y,h,u,b;return u=new Ye({props:{code:`import tensorflow as tf
import numpy as np
from transformers import AutoTokenizer, TFXLNetLMHeadModel

tokenizer = AutoTokenizer.from_pretrained("xlnet-large-cased")
model = TFXLNetLMHeadModel.from_pretrained("xlnet-large-cased")

# We show how to setup inputs to predict a next token using a bi-directional context.
input_ids = tf.constant(tokenizer.encode("Hello, my dog is very <mask>", add_special_tokens=True))[
    None, :
]  # We will predict the masked token

perm_mask = np.zeros((1, input_ids.shape[1], input_ids.shape[1]))
perm_mask[:, :, -1] = 1.0  # Previous tokens don't see last token

target_mapping = np.zeros(
    (1, 1, input_ids.shape[1])
)  # Shape [1, 1, seq_length] => let's predict one token
target_mapping[
    0, 0, -1
] = 1.0  # Our first (and only) prediction will be the last token of the sequence (the masked token)

outputs = model(
    input_ids,
    perm_mask=tf.constant(perm_mask, dtype=tf.float32),
    target_mapping=tf.constant(target_mapping, dtype=tf.float32),
)

next_token_logits = outputs[
    0
]  # Output has shape [target_mapping.size(0), target_mapping.size(1), config.vocab_size]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLNetLMHeadModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-large-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLNetLMHeadModel.from_pretrained(<span class="hljs-string">&quot;xlnet-large-cased&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># We show how to setup inputs to predict a next token using a bi-directional context.</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>input_ids = tf.constant(tokenizer.encode(<span class="hljs-string">&quot;Hello, my dog is very &lt;mask&gt;&quot;</span>, add_special_tokens=<span class="hljs-literal">True</span>))[
<span class="hljs-meta">... </span>    <span class="hljs-literal">None</span>, :
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># We will predict the masked token</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>perm_mask = np.zeros((<span class="hljs-number">1</span>, input_ids.shape[<span class="hljs-number">1</span>], input_ids.shape[<span class="hljs-number">1</span>]))
<span class="hljs-meta">&gt;&gt;&gt; </span>perm_mask[:, :, -<span class="hljs-number">1</span>] = <span class="hljs-number">1.0</span>  <span class="hljs-comment"># Previous tokens don&#x27;t see last token</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>target_mapping = np.zeros(
<span class="hljs-meta">... </span>    (<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, input_ids.shape[<span class="hljs-number">1</span>])
<span class="hljs-meta">... </span>)  <span class="hljs-comment"># Shape [1, 1, seq_length] =&gt; let&#x27;s predict one token</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>target_mapping[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, -<span class="hljs-number">1</span>
<span class="hljs-meta">... </span>] = <span class="hljs-number">1.0</span>  <span class="hljs-comment"># Our first (and only) prediction will be the last token of the sequence (the masked token)</span>

<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(
<span class="hljs-meta">... </span>    input_ids,
<span class="hljs-meta">... </span>    perm_mask=tf.constant(perm_mask, dtype=tf.float32),
<span class="hljs-meta">... </span>    target_mapping=tf.constant(target_mapping, dtype=tf.float32),
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>next_token_logits = outputs[
<span class="hljs-meta">... </span>    <span class="hljs-number">0</span>
<span class="hljs-meta">... </span>]  <span class="hljs-comment"># Output has shape [target_mapping.size(0), target_mapping.size(1), config.vocab_size]</span>`}}),{c(){d=a("p"),y=n("Examples:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Examples:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function wv(q){let d,y,h,u,b,l,m,z,ke,me,D,ae,ee,L,be,R,ye,he,Q,Te,re,Y,we,ue,B,ve,fe,K,de,Ne,ne,M,E,ge,A,ie,$e,V,xe,Le,C,le,G,ce,Fe,J,Xe,te,I,pe,Z,qe,oe,j,ze,O,Me,Ee;return{c(){d=a("p"),y=n("TensorFlow models and layers in "),h=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=c(),m=a("ul"),z=a("li"),ke=n("having all inputs as keyword arguments (like PyTorch models), or"),me=c(),D=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=c(),L=a("p"),be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),ye=n("model.fit()"),he=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Te=n("model.fit()"),re=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a("code"),we=n("fit()"),ue=n(" and "),B=a("code"),ve=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),K=a("code"),de=n("Functional"),Ne=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),M=a("ul"),E=a("li"),ge=n("a single Tensor with "),A=a("code"),ie=n("input_ids"),$e=n(" only and nothing else: "),V=a("code"),xe=n("model(input_ids)"),Le=c(),C=a("li"),le=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=a("code"),ce=n("model([input_ids, attention_mask])"),Fe=n(" or "),J=a("code"),Xe=n("model([input_ids, attention_mask, token_type_ids])"),te=c(),I=a("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=c(),j=a("p"),ze=n(`Note that when creating models and layers with
`),O=a("a"),Me=n("subclassing"),Ee=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(k){d=r(k,"P",{});var F=i(d);y=s(F,"TensorFlow models and layers in "),h=r(F,"CODE",{});var Ie=i(h);u=s(Ie,"transformers"),Ie.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),l=p(k),m=r(k,"UL",{});var se=i(m);z=r(se,"LI",{});var _e=i(z);ke=s(_e,"having all inputs as keyword arguments (like PyTorch models), or"),_e.forEach(t),me=p(se),D=r(se,"LI",{});var He=i(D);ae=s(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),se.forEach(t),ee=p(k),L=r(k,"P",{});var X=i(L);be=s(X,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=r(X,"CODE",{});var Qe=i(R);ye=s(Qe,"model.fit()"),Qe.forEach(t),he=s(X,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(X,"CODE",{});var Ue=i(Q);Te=s(Ue,"model.fit()"),Ue.forEach(t),re=s(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r(X,"CODE",{});var Oe=i(Y);we=s(Oe,"fit()"),Oe.forEach(t),ue=s(X," and "),B=r(X,"CODE",{});var We=i(B);ve=s(We,"predict()"),We.forEach(t),fe=s(X,`, such as when creating your own layers or models with
the Keras `),K=r(X,"CODE",{});var Be=i(K);de=s(Be,"Functional"),Be.forEach(t),Ne=s(X,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),X.forEach(t),ne=p(k),M=r(k,"UL",{});var S=i(M);E=r(S,"LI",{});var H=i(E);ge=s(H,"a single Tensor with "),A=r(H,"CODE",{});var je=i(A);ie=s(je,"input_ids"),je.forEach(t),$e=s(H," only and nothing else: "),V=r(H,"CODE",{});var Pe=i(V);xe=s(Pe,"model(input_ids)"),Pe.forEach(t),H.forEach(t),Le=p(S),C=r(S,"LI",{});var U=i(C);le=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=r(U,"CODE",{});var Ke=i(G);ce=s(Ke,"model([input_ids, attention_mask])"),Ke.forEach(t),Fe=s(U," or "),J=r(U,"CODE",{});var Se=i(J);Xe=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),U.forEach(t),te=p(S),I=r(S,"LI",{});var Ce=i(I);pe=s(Ce,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=r(Ce,"CODE",{});var De=i(Z);qe=s(De,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),De.forEach(t),Ce.forEach(t),S.forEach(t),oe=p(k),j=r(k,"P",{});var W=i(j);ze=s(W,`Note that when creating models and layers with
`),O=r(W,"A",{href:!0,rel:!0});var Ae=i(O);Me=s(Ae,"subclassing"),Ae.forEach(t),Ee=s(W,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),W.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(k,F){g(k,d,F),e(d,y),e(d,h),e(h,u),e(d,b),g(k,l,F),g(k,m,F),e(m,z),e(z,ke),e(m,me),e(m,D),e(D,ae),g(k,ee,F),g(k,L,F),e(L,be),e(L,R),e(R,ye),e(L,he),e(L,Q),e(Q,Te),e(L,re),e(L,Y),e(Y,we),e(L,ue),e(L,B),e(B,ve),e(L,fe),e(L,K),e(K,de),e(L,Ne),g(k,ne,F),g(k,M,F),e(M,E),e(E,ge),e(E,A),e(A,ie),e(E,$e),e(E,V),e(V,xe),e(M,Le),e(M,C),e(C,le),e(C,G),e(G,ce),e(C,Fe),e(C,J),e(J,Xe),e(M,te),e(M,I),e(I,pe),e(I,Z),e(Z,qe),g(k,oe,F),g(k,j,F),e(j,ze),e(j,O),e(O,Me),e(j,Ee)},d(k){k&&t(d),k&&t(l),k&&t(m),k&&t(ee),k&&t(L),k&&t(ne),k&&t(M),k&&t(oe),k&&t(j)}}}function vv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function Nv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, TFXLNetForSequenceClassification
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = TFXLNetForSequenceClassification.from_pretrained("xlnet-base-cased")

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

logits = model(**inputs).logits

predicted_class_id = int(tf.math.argmax(logits, axis=-1)[0])`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLNetForSequenceClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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;tf&quot;</span>)

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

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])`}}),{c(){d=a("p"),y=n("Example:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function $v(q){let d,y;return d=new Ye({props:{code:'# To train a model on `num_labels` classes, you can pass `num_labels=num_labels` to `.from_pretrained(...)`\nnum_labels = len(model.config.id2label)\nmodel = TFXLNetForSequenceClassification.from_pretrained("xlnet-base-cased", num_labels=num_labels)\n\nlabels = tf.constant(1)\nloss = model(**inputs, labels=labels).loss',highlighted:'<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>\n<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(model.config.id2label)\n<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLNetForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>, num_labels=num_labels)\n\n<span class="hljs-meta">&gt;&gt;&gt; </span>labels = tf.constant(<span class="hljs-number">1</span>)\n<span class="hljs-meta">&gt;&gt;&gt; </span>loss = model(**inputs, labels=labels).loss'}}),{c(){T(d.$$.fragment)},l(h){w(d.$$.fragment,h)},m(h,u){v(d,h,u),y=!0},p:Ve,i(h){y||(N(d.$$.fragment,h),y=!0)},o(h){$(d.$$.fragment,h),y=!1},d(h){x(d,h)}}}function xv(q){let d,y,h,u,b,l,m,z,ke,me,D,ae,ee,L,be,R,ye,he,Q,Te,re,Y,we,ue,B,ve,fe,K,de,Ne,ne,M,E,ge,A,ie,$e,V,xe,Le,C,le,G,ce,Fe,J,Xe,te,I,pe,Z,qe,oe,j,ze,O,Me,Ee;return{c(){d=a("p"),y=n("TensorFlow models and layers in "),h=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=c(),m=a("ul"),z=a("li"),ke=n("having all inputs as keyword arguments (like PyTorch models), or"),me=c(),D=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=c(),L=a("p"),be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),ye=n("model.fit()"),he=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Te=n("model.fit()"),re=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a("code"),we=n("fit()"),ue=n(" and "),B=a("code"),ve=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),K=a("code"),de=n("Functional"),Ne=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),M=a("ul"),E=a("li"),ge=n("a single Tensor with "),A=a("code"),ie=n("input_ids"),$e=n(" only and nothing else: "),V=a("code"),xe=n("model(input_ids)"),Le=c(),C=a("li"),le=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=a("code"),ce=n("model([input_ids, attention_mask])"),Fe=n(" or "),J=a("code"),Xe=n("model([input_ids, attention_mask, token_type_ids])"),te=c(),I=a("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=c(),j=a("p"),ze=n(`Note that when creating models and layers with
`),O=a("a"),Me=n("subclassing"),Ee=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(k){d=r(k,"P",{});var F=i(d);y=s(F,"TensorFlow models and layers in "),h=r(F,"CODE",{});var Ie=i(h);u=s(Ie,"transformers"),Ie.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),l=p(k),m=r(k,"UL",{});var se=i(m);z=r(se,"LI",{});var _e=i(z);ke=s(_e,"having all inputs as keyword arguments (like PyTorch models), or"),_e.forEach(t),me=p(se),D=r(se,"LI",{});var He=i(D);ae=s(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),se.forEach(t),ee=p(k),L=r(k,"P",{});var X=i(L);be=s(X,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=r(X,"CODE",{});var Qe=i(R);ye=s(Qe,"model.fit()"),Qe.forEach(t),he=s(X,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(X,"CODE",{});var Ue=i(Q);Te=s(Ue,"model.fit()"),Ue.forEach(t),re=s(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r(X,"CODE",{});var Oe=i(Y);we=s(Oe,"fit()"),Oe.forEach(t),ue=s(X," and "),B=r(X,"CODE",{});var We=i(B);ve=s(We,"predict()"),We.forEach(t),fe=s(X,`, such as when creating your own layers or models with
the Keras `),K=r(X,"CODE",{});var Be=i(K);de=s(Be,"Functional"),Be.forEach(t),Ne=s(X,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),X.forEach(t),ne=p(k),M=r(k,"UL",{});var S=i(M);E=r(S,"LI",{});var H=i(E);ge=s(H,"a single Tensor with "),A=r(H,"CODE",{});var je=i(A);ie=s(je,"input_ids"),je.forEach(t),$e=s(H," only and nothing else: "),V=r(H,"CODE",{});var Pe=i(V);xe=s(Pe,"model(input_ids)"),Pe.forEach(t),H.forEach(t),Le=p(S),C=r(S,"LI",{});var U=i(C);le=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=r(U,"CODE",{});var Ke=i(G);ce=s(Ke,"model([input_ids, attention_mask])"),Ke.forEach(t),Fe=s(U," or "),J=r(U,"CODE",{});var Se=i(J);Xe=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),U.forEach(t),te=p(S),I=r(S,"LI",{});var Ce=i(I);pe=s(Ce,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=r(Ce,"CODE",{});var De=i(Z);qe=s(De,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),De.forEach(t),Ce.forEach(t),S.forEach(t),oe=p(k),j=r(k,"P",{});var W=i(j);ze=s(W,`Note that when creating models and layers with
`),O=r(W,"A",{href:!0,rel:!0});var Ae=i(O);Me=s(Ae,"subclassing"),Ae.forEach(t),Ee=s(W,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),W.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(k,F){g(k,d,F),e(d,y),e(d,h),e(h,u),e(d,b),g(k,l,F),g(k,m,F),e(m,z),e(z,ke),e(m,me),e(m,D),e(D,ae),g(k,ee,F),g(k,L,F),e(L,be),e(L,R),e(R,ye),e(L,he),e(L,Q),e(Q,Te),e(L,re),e(L,Y),e(Y,we),e(L,ue),e(L,B),e(B,ve),e(L,fe),e(L,K),e(K,de),e(L,Ne),g(k,ne,F),g(k,M,F),e(M,E),e(E,ge),e(E,A),e(A,ie),e(E,$e),e(E,V),e(V,xe),e(M,Le),e(M,C),e(C,le),e(C,G),e(G,ce),e(C,Fe),e(C,J),e(J,Xe),e(M,te),e(M,I),e(I,pe),e(I,Z),e(Z,qe),g(k,oe,F),g(k,j,F),e(j,ze),e(j,O),e(O,Me),e(j,Ee)},d(k){k&&t(d),k&&t(l),k&&t(m),k&&t(ee),k&&t(L),k&&t(ne),k&&t(M),k&&t(oe),k&&t(j)}}}function Lv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function Fv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, TFXLNetForMultipleChoice
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = TFXLNetForMultipleChoice.from_pretrained("xlnet-base-cased")

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."

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

# the linear classifier still needs to be trained
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, TFXLNetForMultipleChoice
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLNetForMultipleChoice.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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>encoding = tokenizer([prompt, prompt], [choice0, choice1], return_tensors=<span class="hljs-string">&quot;tf&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = {k: tf.expand_dims(v, <span class="hljs-number">0</span>) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> encoding.items()}
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(inputs)  <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>logits = outputs.logits`}}),{c(){d=a("p"),y=n("Example:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function Xv(q){let d,y,h,u,b,l,m,z,ke,me,D,ae,ee,L,be,R,ye,he,Q,Te,re,Y,we,ue,B,ve,fe,K,de,Ne,ne,M,E,ge,A,ie,$e,V,xe,Le,C,le,G,ce,Fe,J,Xe,te,I,pe,Z,qe,oe,j,ze,O,Me,Ee;return{c(){d=a("p"),y=n("TensorFlow models and layers in "),h=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=c(),m=a("ul"),z=a("li"),ke=n("having all inputs as keyword arguments (like PyTorch models), or"),me=c(),D=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=c(),L=a("p"),be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),ye=n("model.fit()"),he=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Te=n("model.fit()"),re=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a("code"),we=n("fit()"),ue=n(" and "),B=a("code"),ve=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),K=a("code"),de=n("Functional"),Ne=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),M=a("ul"),E=a("li"),ge=n("a single Tensor with "),A=a("code"),ie=n("input_ids"),$e=n(" only and nothing else: "),V=a("code"),xe=n("model(input_ids)"),Le=c(),C=a("li"),le=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=a("code"),ce=n("model([input_ids, attention_mask])"),Fe=n(" or "),J=a("code"),Xe=n("model([input_ids, attention_mask, token_type_ids])"),te=c(),I=a("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=c(),j=a("p"),ze=n(`Note that when creating models and layers with
`),O=a("a"),Me=n("subclassing"),Ee=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(k){d=r(k,"P",{});var F=i(d);y=s(F,"TensorFlow models and layers in "),h=r(F,"CODE",{});var Ie=i(h);u=s(Ie,"transformers"),Ie.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),l=p(k),m=r(k,"UL",{});var se=i(m);z=r(se,"LI",{});var _e=i(z);ke=s(_e,"having all inputs as keyword arguments (like PyTorch models), or"),_e.forEach(t),me=p(se),D=r(se,"LI",{});var He=i(D);ae=s(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),se.forEach(t),ee=p(k),L=r(k,"P",{});var X=i(L);be=s(X,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=r(X,"CODE",{});var Qe=i(R);ye=s(Qe,"model.fit()"),Qe.forEach(t),he=s(X,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(X,"CODE",{});var Ue=i(Q);Te=s(Ue,"model.fit()"),Ue.forEach(t),re=s(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r(X,"CODE",{});var Oe=i(Y);we=s(Oe,"fit()"),Oe.forEach(t),ue=s(X," and "),B=r(X,"CODE",{});var We=i(B);ve=s(We,"predict()"),We.forEach(t),fe=s(X,`, such as when creating your own layers or models with
the Keras `),K=r(X,"CODE",{});var Be=i(K);de=s(Be,"Functional"),Be.forEach(t),Ne=s(X,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),X.forEach(t),ne=p(k),M=r(k,"UL",{});var S=i(M);E=r(S,"LI",{});var H=i(E);ge=s(H,"a single Tensor with "),A=r(H,"CODE",{});var je=i(A);ie=s(je,"input_ids"),je.forEach(t),$e=s(H," only and nothing else: "),V=r(H,"CODE",{});var Pe=i(V);xe=s(Pe,"model(input_ids)"),Pe.forEach(t),H.forEach(t),Le=p(S),C=r(S,"LI",{});var U=i(C);le=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=r(U,"CODE",{});var Ke=i(G);ce=s(Ke,"model([input_ids, attention_mask])"),Ke.forEach(t),Fe=s(U," or "),J=r(U,"CODE",{});var Se=i(J);Xe=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),U.forEach(t),te=p(S),I=r(S,"LI",{});var Ce=i(I);pe=s(Ce,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=r(Ce,"CODE",{});var De=i(Z);qe=s(De,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),De.forEach(t),Ce.forEach(t),S.forEach(t),oe=p(k),j=r(k,"P",{});var W=i(j);ze=s(W,`Note that when creating models and layers with
`),O=r(W,"A",{href:!0,rel:!0});var Ae=i(O);Me=s(Ae,"subclassing"),Ae.forEach(t),Ee=s(W,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),W.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(k,F){g(k,d,F),e(d,y),e(d,h),e(h,u),e(d,b),g(k,l,F),g(k,m,F),e(m,z),e(z,ke),e(m,me),e(m,D),e(D,ae),g(k,ee,F),g(k,L,F),e(L,be),e(L,R),e(R,ye),e(L,he),e(L,Q),e(Q,Te),e(L,re),e(L,Y),e(Y,we),e(L,ue),e(L,B),e(B,ve),e(L,fe),e(L,K),e(K,de),e(L,Ne),g(k,ne,F),g(k,M,F),e(M,E),e(E,ge),e(E,A),e(A,ie),e(E,$e),e(E,V),e(V,xe),e(M,Le),e(M,C),e(C,le),e(C,G),e(G,ce),e(C,Fe),e(C,J),e(J,Xe),e(M,te),e(M,I),e(I,pe),e(I,Z),e(Z,qe),g(k,oe,F),g(k,j,F),e(j,ze),e(j,O),e(O,Me),e(j,Ee)},d(k){k&&t(d),k&&t(l),k&&t(m),k&&t(ee),k&&t(L),k&&t(ne),k&&t(M),k&&t(oe),k&&t(j)}}}function qv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function zv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, TFXLNetForTokenClassification
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = TFXLNetForTokenClassification.from_pretrained("xlnet-base-cased")

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

logits = model(**inputs).logits
predicted_token_class_ids = tf.math.argmax(logits, axis=-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] for t in predicted_token_class_ids[0].numpy().tolist()]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLNetForTokenClassification
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLNetForTokenClassification.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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;tf&quot;</span>
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_token_class_ids = tf.math.argmax(logits, axis=-<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] <span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> predicted_token_class_ids[<span class="hljs-number">0</span>].numpy().tolist()]`}}),{c(){d=a("p"),y=n("Example:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function Mv(q){let d,y;return d=new Ye({props:{code:`labels = predicted_token_class_ids
loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = predicted_token_class_ids
<span class="hljs-meta">&gt;&gt;&gt; </span>loss = tf.math.reduce_mean(model(**inputs, labels=labels).loss)`}}),{c(){T(d.$$.fragment)},l(h){w(d.$$.fragment,h)},m(h,u){v(d,h,u),y=!0},p:Ve,i(h){y||(N(d.$$.fragment,h),y=!0)},o(h){$(d.$$.fragment,h),y=!1},d(h){x(d,h)}}}function Ev(q){let d,y,h,u,b,l,m,z,ke,me,D,ae,ee,L,be,R,ye,he,Q,Te,re,Y,we,ue,B,ve,fe,K,de,Ne,ne,M,E,ge,A,ie,$e,V,xe,Le,C,le,G,ce,Fe,J,Xe,te,I,pe,Z,qe,oe,j,ze,O,Me,Ee;return{c(){d=a("p"),y=n("TensorFlow models and layers in "),h=a("code"),u=n("transformers"),b=n(" accept two formats as input:"),l=c(),m=a("ul"),z=a("li"),ke=n("having all inputs as keyword arguments (like PyTorch models), or"),me=c(),D=a("li"),ae=n("having all inputs as a list, tuple or dict in the first positional argument."),ee=c(),L=a("p"),be=n(`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=a("code"),ye=n("model.fit()"),he=n(` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=a("code"),Te=n("model.fit()"),re=n(` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=a("code"),we=n("fit()"),ue=n(" and "),B=a("code"),ve=n("predict()"),fe=n(`, such as when creating your own layers or models with
the Keras `),K=a("code"),de=n("Functional"),Ne=n(` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),ne=c(),M=a("ul"),E=a("li"),ge=n("a single Tensor with "),A=a("code"),ie=n("input_ids"),$e=n(" only and nothing else: "),V=a("code"),xe=n("model(input_ids)"),Le=c(),C=a("li"),le=n(`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=a("code"),ce=n("model([input_ids, attention_mask])"),Fe=n(" or "),J=a("code"),Xe=n("model([input_ids, attention_mask, token_type_ids])"),te=c(),I=a("li"),pe=n(`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=a("code"),qe=n('model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),oe=c(),j=a("p"),ze=n(`Note that when creating models and layers with
`),O=a("a"),Me=n("subclassing"),Ee=n(` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),this.h()},l(k){d=r(k,"P",{});var F=i(d);y=s(F,"TensorFlow models and layers in "),h=r(F,"CODE",{});var Ie=i(h);u=s(Ie,"transformers"),Ie.forEach(t),b=s(F," accept two formats as input:"),F.forEach(t),l=p(k),m=r(k,"UL",{});var se=i(m);z=r(se,"LI",{});var _e=i(z);ke=s(_e,"having all inputs as keyword arguments (like PyTorch models), or"),_e.forEach(t),me=p(se),D=r(se,"LI",{});var He=i(D);ae=s(He,"having all inputs as a list, tuple or dict in the first positional argument."),He.forEach(t),se.forEach(t),ee=p(k),L=r(k,"P",{});var X=i(L);be=s(X,`The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
and layers. Because of this support, when using methods like `),R=r(X,"CODE",{});var Qe=i(R);ye=s(Qe,"model.fit()"),Qe.forEach(t),he=s(X,` things should \u201Cjust work\u201D for you - just
pass your inputs and labels in any format that `),Q=r(X,"CODE",{});var Ue=i(Q);Te=s(Ue,"model.fit()"),Ue.forEach(t),re=s(X,` supports! If, however, you want to use the second
format outside of Keras methods like `),Y=r(X,"CODE",{});var Oe=i(Y);we=s(Oe,"fit()"),Oe.forEach(t),ue=s(X," and "),B=r(X,"CODE",{});var We=i(B);ve=s(We,"predict()"),We.forEach(t),fe=s(X,`, such as when creating your own layers or models with
the Keras `),K=r(X,"CODE",{});var Be=i(K);de=s(Be,"Functional"),Be.forEach(t),Ne=s(X,` API, there are three possibilities you can use to gather all the input Tensors in the first
positional argument:`),X.forEach(t),ne=p(k),M=r(k,"UL",{});var S=i(M);E=r(S,"LI",{});var H=i(E);ge=s(H,"a single Tensor with "),A=r(H,"CODE",{});var je=i(A);ie=s(je,"input_ids"),je.forEach(t),$e=s(H," only and nothing else: "),V=r(H,"CODE",{});var Pe=i(V);xe=s(Pe,"model(input_ids)"),Pe.forEach(t),H.forEach(t),Le=p(S),C=r(S,"LI",{});var U=i(C);le=s(U,`a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
`),G=r(U,"CODE",{});var Ke=i(G);ce=s(Ke,"model([input_ids, attention_mask])"),Ke.forEach(t),Fe=s(U," or "),J=r(U,"CODE",{});var Se=i(J);Xe=s(Se,"model([input_ids, attention_mask, token_type_ids])"),Se.forEach(t),U.forEach(t),te=p(S),I=r(S,"LI",{});var Ce=i(I);pe=s(Ce,`a dictionary with one or several input Tensors associated to the input names given in the docstring:
`),Z=r(Ce,"CODE",{});var De=i(Z);qe=s(De,'model({"input_ids": input_ids, "token_type_ids": token_type_ids})'),De.forEach(t),Ce.forEach(t),S.forEach(t),oe=p(k),j=r(k,"P",{});var W=i(j);ze=s(W,`Note that when creating models and layers with
`),O=r(W,"A",{href:!0,rel:!0});var Ae=i(O);Me=s(Ae,"subclassing"),Ae.forEach(t),Ee=s(W,` then you don\u2019t need to worry
about any of this, as you can just pass inputs like you would to any other Python function!`),W.forEach(t),this.h()},h(){f(O,"href","https://keras.io/guides/making_new_layers_and_models_via_subclassing/"),f(O,"rel","nofollow")},m(k,F){g(k,d,F),e(d,y),e(d,h),e(h,u),e(d,b),g(k,l,F),g(k,m,F),e(m,z),e(z,ke),e(m,me),e(m,D),e(D,ae),g(k,ee,F),g(k,L,F),e(L,be),e(L,R),e(R,ye),e(L,he),e(L,Q),e(Q,Te),e(L,re),e(L,Y),e(Y,we),e(L,ue),e(L,B),e(B,ve),e(L,fe),e(L,K),e(K,de),e(L,Ne),g(k,ne,F),g(k,M,F),e(M,E),e(E,ge),e(E,A),e(A,ie),e(E,$e),e(E,V),e(V,xe),e(M,Le),e(M,C),e(C,le),e(C,G),e(G,ce),e(C,Fe),e(C,J),e(J,Xe),e(M,te),e(M,I),e(I,pe),e(I,Z),e(Z,qe),g(k,oe,F),g(k,j,F),e(j,ze),e(j,O),e(O,Me),e(j,Ee)},d(k){k&&t(d),k&&t(l),k&&t(m),k&&t(ee),k&&t(L),k&&t(ne),k&&t(M),k&&t(oe),k&&t(j)}}}function Cv(q){let d,y,h,u,b;return{c(){d=a("p"),y=n("Although the recipe for forward pass needs to be defined within this function, one should call the "),h=a("code"),u=n("Module"),b=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 m=i(d);y=s(m,"Although the recipe for forward pass needs to be defined within this function, one should call the "),h=r(m,"CODE",{});var z=i(h);u=s(z,"Module"),z.forEach(t),b=s(m,`
instance afterwards instead of this since the former takes care of running the pre and post processing steps while
the latter silently ignores them.`),m.forEach(t)},m(l,m){g(l,d,m),e(d,y),e(d,h),e(h,u),e(d,b)},d(l){l&&t(d)}}}function jv(q){let d,y,h,u,b;return u=new Ye({props:{code:`from transformers import AutoTokenizer, TFXLNetForQuestionAnsweringSimple
import tensorflow as tf

tokenizer = AutoTokenizer.from_pretrained("xlnet-base-cased")
model = TFXLNetForQuestionAnsweringSimple.from_pretrained("xlnet-base-cased")

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

inputs = tokenizer(question, text, return_tensors="tf")
outputs = model(**inputs)

answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer, TFXLNetForQuestionAnsweringSimple
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFXLNetForQuestionAnsweringSimple.from_pretrained(<span class="hljs-string">&quot;xlnet-base-cased&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;tf&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(**inputs)

<span class="hljs-meta">&gt;&gt;&gt; </span>answer_start_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.start_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>answer_end_index = <span class="hljs-built_in">int</span>(tf.math.argmax(outputs.end_logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])

<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>]`}}),{c(){d=a("p"),y=n("Example:"),h=c(),T(u.$$.fragment)},l(l){d=r(l,"P",{});var m=i(d);y=s(m,"Example:"),m.forEach(t),h=p(l),w(u.$$.fragment,l)},m(l,m){g(l,d,m),e(d,y),g(l,h,m),v(u,l,m),b=!0},p:Ve,i(l){b||(N(u.$$.fragment,l),b=!0)},o(l){$(u.$$.fragment,l),b=!1},d(l){l&&t(d),l&&t(h),x(u,l)}}}function Ov(q){let d,y;return d=new Ye({props:{code:`# target is "nice puppet"
target_start_index = tf.constant([14])
target_end_index = tf.constant([15])

outputs = model(**inputs, start_positions=target_start_index, end_positions=target_end_index)
loss = tf.math.reduce_mean(outputs.loss)`,highlighted:`<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 = tf.constant([<span class="hljs-number">14</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>target_end_index = tf.constant([<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 = tf.math.reduce_mean(outputs.loss)`}}),{c(){T(d.$$.fragment)},l(h){w(d.$$.fragment,h)},m(h,u){v(d,h,u),y=!0},p:Ve,i(h){y||(N(d.$$.fragment,h),y=!0)},o(h){$(d.$$.fragment,h),y=!1},d(h){x(d,h)}}}function Av(q){let d,y,h,u,b,l,m,z,ke,me,D,ae,ee,L,be,R,ye,he,Q,Te,re,Y,we,ue,B,ve,fe,K,de,Ne,ne,M,E,ge,A,ie,$e,V,xe,Le,C,le,G,ce,Fe,J,Xe,te,I,pe,Z,qe,oe,j,ze,O,Me,Ee,k,F,Ie,se,_e,He,X,Qe,Ue,Oe,We,Be,S,H,je,Pe,U,Ke,Se,Ce,De,W,Ae,sm,Ot,am,jr,rm,im,Or,lm,dm,hs,cm,pm,mm,to,hm,Ar,um,fm,Pr,gm,_m,km,Zo,Bd,oo,en,Yi,us,bm,Gi,ym,Kd,Ge,fs,Tm,gs,wm,_s,vm,Nm,$m,ks,xm,Sr,Lm,Fm,Xm,It,bs,qm,Ji,zm,Mm,ys,Dr,Em,Zi,Cm,jm,Ir,Om,el,Am,Pm,tn,Ts,Sm,ws,Dm,tl,Im,Hm,Qm,bt,vs,Um,ol,Wm,Bm,on,Km,no,Rm,nl,Vm,Ym,sl,Gm,Jm,Zm,Hr,Ns,Rd,so,nn,al,$s,eh,rl,th,Vd,rt,xs,oh,ao,nh,il,sh,ah,Ls,rh,ih,lh,Fs,dh,Qr,ch,ph,mh,Ht,Xs,hh,ll,uh,fh,qs,Ur,gh,dl,_h,kh,Wr,bh,cl,yh,Th,yt,zs,wh,pl,vh,Nh,sn,$h,ro,xh,ml,Lh,Fh,hl,Xh,qh,Yd,io,an,ul,Ms,zh,fl,Mh,Gd,lo,Es,Eh,Cs,Ch,Br,jh,Oh,Jd,co,js,Ah,Os,Ph,Kr,Sh,Dh,Zd,po,As,Ih,Ps,Hh,Rr,Qh,Uh,ec,mo,Ss,Wh,Ds,Bh,Vr,Kh,Rh,tc,ho,Is,Vh,Hs,Yh,gl,Gh,Jh,oc,uo,Qs,Zh,Us,eu,Yr,tu,ou,nc,fo,Ws,nu,Bs,su,Gr,au,ru,sc,go,Ks,iu,Rs,lu,Jr,du,cu,ac,_o,Vs,pu,Ys,mu,Zr,hu,uu,rc,ko,Gs,fu,Js,gu,ei,_u,ku,ic,bo,Zs,bu,ea,yu,ti,Tu,wu,lc,yo,ta,vu,oa,Nu,_l,$u,xu,dc,To,na,Lu,sa,Fu,oi,Xu,qu,cc,wo,rn,kl,aa,zu,bl,Mu,pc,it,ra,Eu,yl,Cu,ju,ia,Ou,ni,Au,Pu,Su,la,Du,da,Iu,Hu,Qu,Tt,ca,Uu,vo,Wu,si,Bu,Ku,Tl,Ru,Vu,Yu,ln,Gu,dn,mc,No,cn,wl,pa,Ju,vl,Zu,hc,lt,ma,ef,Nl,tf,of,ha,nf,ai,sf,af,rf,ua,lf,fa,df,cf,pf,wt,ga,mf,$o,hf,ri,uf,ff,$l,gf,_f,kf,pn,bf,mn,uc,xo,hn,xl,_a,yf,Ll,Tf,fc,dt,ka,wf,Fl,vf,Nf,ba,$f,ii,xf,Lf,Ff,ya,Xf,Ta,qf,zf,Mf,ut,wa,Ef,Lo,Cf,li,jf,Of,Xl,Af,Pf,Sf,un,Df,fn,If,gn,gc,Fo,_n,ql,va,Hf,zl,Qf,_c,ct,Na,Uf,Ml,Wf,Bf,$a,Kf,di,Rf,Vf,Yf,xa,Gf,La,Jf,Zf,eg,vt,Fa,tg,Xo,og,ci,ng,sg,El,ag,rg,ig,kn,lg,bn,kc,qo,yn,Cl,Xa,dg,jl,cg,bc,pt,qa,pg,Ol,mg,hg,za,ug,pi,fg,gg,_g,Ma,kg,Ea,bg,yg,Tg,Nt,Ca,wg,zo,vg,mi,Ng,$g,Al,xg,Lg,Fg,Tn,Xg,wn,yc,Mo,vn,Pl,ja,qg,Sl,zg,Tc,mt,Oa,Mg,Eo,Eg,Dl,Cg,jg,Il,Og,Ag,Pg,Aa,Sg,hi,Dg,Ig,Hg,Pa,Qg,Sa,Ug,Wg,Bg,$t,Da,Kg,Co,Rg,ui,Vg,Yg,Hl,Gg,Jg,Zg,Nn,e_,$n,wc,jo,xn,Ql,Ia,t_,Ul,o_,vc,ht,Ha,n_,Oo,s_,Wl,a_,r_,Bl,i_,l_,d_,Qa,c_,fi,p_,m_,h_,Ua,u_,Wa,f_,g_,__,xt,Ba,k_,Ao,b_,gi,y_,T_,Kl,w_,v_,N_,Ln,$_,Fn,Nc,Po,Xn,Rl,Ka,x_,Vl,L_,$c,et,Ra,F_,Yl,X_,q_,Va,z_,_i,M_,E_,C_,Ya,j_,Ga,O_,A_,P_,qn,S_,Lt,Ja,D_,So,I_,ki,H_,Q_,Gl,U_,W_,B_,zn,K_,Mn,xc,Do,En,Jl,Za,R_,Zl,V_,Lc,tt,er,Y_,ed,G_,J_,tr,Z_,bi,ek,tk,ok,or,nk,nr,sk,ak,rk,Cn,ik,Ft,sr,lk,Io,dk,yi,ck,pk,td,mk,hk,uk,jn,fk,On,Fc,Ho,An,od,ar,gk,nd,_k,Xc,ot,rr,kk,sd,bk,yk,ir,Tk,Ti,wk,vk,Nk,lr,$k,dr,xk,Lk,Fk,Pn,Xk,ft,cr,qk,Qo,zk,wi,Mk,Ek,ad,Ck,jk,Ok,Sn,Ak,Dn,Pk,In,qc,Uo,Hn,rd,pr,Sk,id,Dk,zc,nt,mr,Ik,ld,Hk,Qk,hr,Uk,vi,Wk,Bk,Kk,ur,Rk,fr,Vk,Yk,Gk,Qn,Jk,Xt,gr,Zk,Wo,eb,Ni,tb,ob,dd,nb,sb,ab,Un,rb,Wn,Mc,Bo,Bn,cd,_r,ib,pd,lb,Ec,st,kr,db,md,cb,pb,br,mb,$i,hb,ub,fb,yr,gb,Tr,_b,kb,bb,Kn,yb,gt,wr,Tb,Ko,wb,xi,vb,Nb,hd,$b,xb,Lb,Rn,Fb,Vn,Xb,Yn,Cc,Ro,Gn,ud,vr,qb,fd,zb,jc,at,Nr,Mb,Vo,Eb,gd,Cb,jb,_d,Ob,Ab,Pb,$r,Sb,Li,Db,Ib,Hb,xr,Qb,Lr,Ub,Wb,Bb,Jn,Kb,_t,Fr,Rb,Yo,Vb,Fi,Yb,Gb,kd,Jb,Zb,ey,Zn,ty,es,oy,ts,Oc;return l=new Ze({}),L=new Ze({}),U=new Ze({}),Ae=new P({props:{name:"class transformers.XLNetConfig",anchor:"transformers.XLNetConfig",parameters:[{name:"vocab_size",val:" = 32000"},{name:"d_model",val:" = 1024"},{name:"n_layer",val:" = 24"},{name:"n_head",val:" = 16"},{name:"d_inner",val:" = 4096"},{name:"ff_activation",val:" = 'gelu'"},{name:"untie_r",val:" = True"},{name:"attn_type",val:" = 'bi'"},{name:"initializer_range",val:" = 0.02"},{name:"layer_norm_eps",val:" = 1e-12"},{name:"dropout",val:" = 0.1"},{name:"mem_len",val:" = 512"},{name:"reuse_len",val:" = None"},{name:"use_mems_eval",val:" = True"},{name:"use_mems_train",val:" = False"},{name:"bi_data",val:" = False"},{name:"clamp_len",val:" = -1"},{name:"same_length",val:" = False"},{name:"summary_type",val:" = 'last'"},{name:"summary_use_proj",val:" = True"},{name:"summary_activation",val:" = 'tanh'"},{name:"summary_last_dropout",val:" = 0.1"},{name:"start_n_top",val:" = 5"},{name:"end_n_top",val:" = 5"},{name:"pad_token_id",val:" = 5"},{name:"bos_token_id",val:" = 1"},{name:"eos_token_id",val:" = 2"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetConfig.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>, <em>optional</em>, defaults to 32000) &#x2014;
Vocabulary size of the XLNet model. Defines the number of different tokens that can be represented by the
<code>inputs_ids</code> passed when calling <a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetModel">XLNetModel</a> or <a href="/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetModel">TFXLNetModel</a>.`,name:"vocab_size"},{anchor:"transformers.XLNetConfig.d_model",description:`<strong>d_model</strong> (<code>int</code>, <em>optional</em>, defaults to 1024) &#x2014;
Dimensionality of the encoder layers and the pooler layer.`,name:"d_model"},{anchor:"transformers.XLNetConfig.n_layer",description:`<strong>n_layer</strong> (<code>int</code>, <em>optional</em>, defaults to 24) &#x2014;
Number of hidden layers in the Transformer encoder.`,name:"n_layer"},{anchor:"transformers.XLNetConfig.n_head",description:`<strong>n_head</strong> (<code>int</code>, <em>optional</em>, defaults to 16) &#x2014;
Number of attention heads for each attention layer in the Transformer encoder.`,name:"n_head"},{anchor:"transformers.XLNetConfig.d_inner",description:`<strong>d_inner</strong> (<code>int</code>, <em>optional</em>, defaults to 4096) &#x2014;
Dimensionality of the &#x201C;intermediate&#x201D; (often named feed-forward) layer in the Transformer encoder.`,name:"d_inner"},{anchor:"transformers.XLNetConfig.ff_activation",description:`<strong>ff_activation</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 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:"ff_activation"},{anchor:"transformers.XLNetConfig.untie_r",description:`<strong>untie_r</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to untie relative position biases`,name:"untie_r"},{anchor:"transformers.XLNetConfig.attn_type",description:`<strong>attn_type</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;bi&quot;</code>) &#x2014;
The attention type used by the model. Set <code>&quot;bi&quot;</code> for XLNet, <code>&quot;uni&quot;</code> for Transformer-XL.`,name:"attn_type"},{anchor:"transformers.XLNetConfig.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.XLNetConfig.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.XLNetConfig.dropout",description:`<strong>dropout</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:"dropout"},{anchor:"transformers.XLNetConfig.mem_len",description:`<strong>mem_len</strong> (<code>int</code> or <code>None</code>, <em>optional</em>) &#x2014;
The number of tokens to cache. The key/value pairs that have already been pre-computed in a previous
forward pass won&#x2019;t be re-computed. See the
<a href="https://huggingface.co/transformers/quickstart.html#using-the-past" rel="nofollow">quickstart</a> for more information.`,name:"mem_len"},{anchor:"transformers.XLNetConfig.reuse_len",description:`<strong>reuse_len</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The number of tokens in the current batch to be cached and reused in the future.`,name:"reuse_len"},{anchor:"transformers.XLNetConfig.bi_data",description:`<strong>bi_data</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use bidirectional input pipeline. Usually set to <code>True</code> during pretraining and <code>False</code>
during finetuning.`,name:"bi_data"},{anchor:"transformers.XLNetConfig.clamp_len",description:`<strong>clamp_len</strong> (<code>int</code>, <em>optional</em>, defaults to -1) &#x2014;
Clamp all relative distances larger than clamp_len. Setting this attribute to -1 means no clamping.`,name:"clamp_len"},{anchor:"transformers.XLNetConfig.same_length",description:`<strong>same_length</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to use the same attention length for each token.`,name:"same_length"},{anchor:"transformers.XLNetConfig.summary_type",description:`<strong>summary_type</strong> (<code>str</code>, <em>optional</em>, defaults to &#x201C;last&#x201D;) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Has to be one of the following options:</p>
<ul>
<li><code>&quot;last&quot;</code>: Take the last token hidden state (like XLNet).</li>
<li><code>&quot;first&quot;</code>: Take the first token hidden state (like BERT).</li>
<li><code>&quot;mean&quot;</code>: Take the mean of all tokens hidden states.</li>
<li><code>&quot;cls_index&quot;</code>: Supply a Tensor of classification token position (like GPT/GPT-2).</li>
<li><code>&quot;attn&quot;</code>: Not implemented now, use multi-head attention.</li>
</ul>`,name:"summary_type"},{anchor:"transformers.XLNetConfig.summary_use_proj",description:`<strong>summary_use_proj</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Whether or not to add a projection after the vector extraction.`,name:"summary_use_proj"},{anchor:"transformers.XLNetConfig.summary_activation",description:`<strong>summary_activation</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Argument used when doing sequence summary. Used in the sequence classification and multiple choice models.</p>
<p>Pass <code>&quot;tanh&quot;</code> for a tanh activation to the output, any other value will result in no activation.`,name:"summary_activation"},{anchor:"transformers.XLNetConfig.summary_proj_to_labels",description:`<strong>summary_proj_to_labels</strong> (<code>boo</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Used in the sequence classification and multiple choice models.</p>
<p>Whether the projection outputs should have <code>config.num_labels</code> or <code>config.hidden_size</code> classes.`,name:"summary_proj_to_labels"},{anchor:"transformers.XLNetConfig.summary_last_dropout",description:`<strong>summary_last_dropout</strong> (<code>float</code>, <em>optional</em>, defaults to 0.1) &#x2014;
Used in the sequence classification and multiple choice models.</p>
<p>The dropout ratio to be used after the projection and activation.`,name:"summary_last_dropout"},{anchor:"transformers.XLNetConfig.start_n_top",description:`<strong>start_n_top</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Used in the SQuAD evaluation script.`,name:"start_n_top"},{anchor:"transformers.XLNetConfig.end_n_top",description:`<strong>end_n_top</strong> (<code>int</code>, <em>optional</em>, defaults to 5) &#x2014;
Used in the SQuAD evaluation script.`,name:"end_n_top"},{anchor:"transformers.XLNetConfig.use_mems_eval",description:`<strong>use_mems_eval</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should make use of the recurrent memory mechanism in evaluation mode.`,name:"use_mems_eval"},{anchor:"transformers.XLNetConfig.use_mems_train",description:`<strong>use_mems_train</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the model should make use of the recurrent memory mechanism in train mode.</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>For pretraining, it is recommended to set <code>use_mems_train</code> to <code>True</code>. For fine-tuning, it is recommended to
set <code>use_mems_train</code> to <code>False</code> as discussed
<a href="https://github.com/zihangdai/xlnet/issues/41#issuecomment-505102587" rel="nofollow">here</a>. If <code>use_mems_train</code> is set to
<code>True</code>, one has to make sure that the train batches are correctly pre-processed, <em>e.g.</em> <code>batch_1 = [[This line is], [This is the]]</code> and <code>batch_2 = [[ the first line], [ second line]]</code> and that all batches are of
equal size.</p>

					</div>`,name:"use_mems_train"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/configuration_xlnet.py#L32"}}),Zo=new Re({props:{anchor:"transformers.XLNetConfig.example",$$slots:{default:[Jw]},$$scope:{ctx:q}}}),us=new Ze({}),fs=new P({props:{name:"class transformers.XLNetTokenizer",anchor:"transformers.XLNetTokenizer",parameters:[{name:"vocab_file",val:""},{name:"do_lower_case",val:" = False"},{name:"remove_space",val:" = True"},{name:"keep_accents",val:" = False"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"sep_token",val:" = '<sep>'"},{name:"pad_token",val:" = '<pad>'"},{name:"cls_token",val:" = '<cls>'"},{name:"mask_token",val:" = '<mask>'"},{name:"additional_special_tokens",val:" = ['<eop>', '<eod>']"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .spm extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.XLNetTokenizer.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.XLNetTokenizer.remove_space",description:`<strong>remove_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to strip the text when tokenizing (removing excess spaces before and after the string).`,name:"remove_space"},{anchor:"transformers.XLNetTokenizer.keep_accents",description:`<strong>keep_accents</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to keep accents when tokenizing.`,name:"keep_accents"},{anchor:"transformers.XLNetTokenizer.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.XLNetTokenizer.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.XLNetTokenizer.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.XLNetTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;sep&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.XLNetTokenizer.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.XLNetTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;cls&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.XLNetTokenizer.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.XLNetTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;eop&gt;&quot;, &quot;&lt;eod&gt;&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"},{anchor:"transformers.XLNetTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.XLNetTokenizer.sp_model",description:`<strong>sp_model</strong> (<code>SentencePieceProcessor</code>) &#x2014;
The <em>SentencePiece</em> processor that is used for every conversion (string, tokens and IDs).`,name:"sp_model"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet.py#L53"}}),bs=new P({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.XLNetTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XLNetTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.XLNetTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet.py#L293",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Ts=new P({props:{name:"get_special_tokens_mask",anchor:"transformers.XLNetTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.XLNetTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.XLNetTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.XLNetTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet.py#L318",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),vs=new P({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.XLNetTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XLNetTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.XLNetTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet.py#L346",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),on=new Re({props:{anchor:"transformers.XLNetTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[Zw]},$$scope:{ctx:q}}}),Ns=new P({props:{name:"save_vocabulary",anchor:"transformers.XLNetTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet.py#L376"}}),$s=new Ze({}),xs=new P({props:{name:"class transformers.XLNetTokenizerFast",anchor:"transformers.XLNetTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"do_lower_case",val:" = False"},{name:"remove_space",val:" = True"},{name:"keep_accents",val:" = False"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"sep_token",val:" = '<sep>'"},{name:"pad_token",val:" = '<pad>'"},{name:"cls_token",val:" = '<cls>'"},{name:"mask_token",val:" = '<mask>'"},{name:"additional_special_tokens",val:" = ['<eop>', '<eod>']"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
<a href="https://github.com/google/sentencepiece" rel="nofollow">SentencePiece</a> file (generally has a .spm extension) that
contains the vocabulary necessary to instantiate a tokenizer.`,name:"vocab_file"},{anchor:"transformers.XLNetTokenizerFast.do_lower_case",description:`<strong>do_lower_case</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to lowercase the input when tokenizing.`,name:"do_lower_case"},{anchor:"transformers.XLNetTokenizerFast.remove_space",description:`<strong>remove_space</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to strip the text when tokenizing (removing excess spaces before and after the string).`,name:"remove_space"},{anchor:"transformers.XLNetTokenizerFast.keep_accents",description:`<strong>keep_accents</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to keep accents when tokenizing.`,name:"keep_accents"},{anchor:"transformers.XLNetTokenizerFast.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.XLNetTokenizerFast.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.XLNetTokenizerFast.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.XLNetTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;sep&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.XLNetTokenizerFast.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.XLNetTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;cls&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.XLNetTokenizerFast.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.XLNetTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;eop&gt;&quot;, &quot;&lt;eod&gt;&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"},{anchor:"transformers.XLNetTokenizerFast.sp_model",description:`<strong>sp_model</strong> (<code>SentencePieceProcessor</code>) &#x2014;
The <em>SentencePiece</em> processor that is used for every conversion (string, tokens and IDs).`,name:"sp_model"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet_fast.py#L63"}}),Xs=new P({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.XLNetTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XLNetTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.XLNetTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet_fast.py#L174",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),zs=new P({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.XLNetTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.XLNetTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.XLNetTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/tokenization_xlnet_fast.py#L199",returnDescription:`
<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),sn=new Re({props:{anchor:"transformers.XLNetTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[ev]},$$scope:{ctx:q}}}),Ms=new Ze({}),Es=new P({props:{name:"class transformers.models.xlnet.modeling_xlnet.XLNetModelOutput",anchor:"transformers.models.xlnet.modeling_xlnet.XLNetModelOutput",parameters:[{name:"last_hidden_state",val:": FloatTensor"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the last layer of the model.</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.`,name:"last_hidden_state"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetModelOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetModelOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetModelOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L579"}}),js=new P({props:{name:"class transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput",anchor:"transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling loss (for next-token prediction).`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L613"}}),As=new P({props:{name:"class transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput",anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) &#x2014;
Classification (or regression if config.num_labels==1) loss.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.num_labels)</code>) &#x2014;
Classification (or regression if config.num_labels==1) scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L650"}}),Ss=new P({props:{name:"class transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput",anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Classification loss.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_choices)</code>) &#x2014;
<em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L718"}}),Is=new P({props:{name:"class transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput",anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"logits",val:": FloatTensor = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  &#x2014;
Classification loss.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput.logits",description:`<strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) &#x2014;
Classification scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L684"}}),Qs=new P({props:{name:"class transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput",anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_logits",val:": FloatTensor = None"},{name:"end_logits",val:": FloatTensor = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput.start_logits",description:`<strong>start_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length,)</code>) &#x2014;
Span-start scores (before SoftMax).`,name:"start_logits"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput.end_logits",description:`<strong>end_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length,)</code>) &#x2014;
Span-end scores (before SoftMax).`,name:"end_logits"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L754"}}),Ws=new P({props:{name:"class transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput",anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput",parameters:[{name:"loss",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_top_log_probs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"start_top_index",val:": typing.Optional[torch.LongTensor] = None"},{name:"end_top_log_probs",val:": typing.Optional[torch.FloatTensor] = None"},{name:"end_top_index",val:": typing.Optional[torch.LongTensor] = None"},{name:"cls_logits",val:": typing.Optional[torch.FloatTensor] = None"},{name:"mems",val:": typing.Optional[typing.List[torch.FloatTensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[torch.FloatTensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.loss",description:`<strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned if both <code>start_positions</code> and <code>end_positions</code> are provided) &#x2014;
Classification loss as the sum of start token, end token (and is_impossible if provided) classification
losses.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.start_top_log_probs",description:`<strong>start_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the top config.start_n_top start token possibilities (beam-search).`,name:"start_top_log_probs"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.start_top_index",description:`<strong>start_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Indices for the top config.start_n_top start token possibilities (beam-search).`,name:"start_top_index"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.end_top_log_probs",description:`<strong>end_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities
(beam-search).`,name:"end_top_log_probs"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.end_top_index",description:`<strong>end_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Indices for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities (beam-search).`,name:"end_top_index"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.cls_logits",description:`<strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) &#x2014;
Log probabilities for the <code>is_impossible</code> label of the answers.`,name:"cls_logits"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.hidden_states",description:`<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>) &#x2014;
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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput.attentions",description:`<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>) &#x2014;
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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L791"}}),Ks=new P({props:{name:"class transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput",anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput",parameters:[{name:"last_hidden_state",val:": Tensor = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput.last_hidden_state",description:`<strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_predict, hidden_size)</code>) &#x2014;
Sequence of hidden-states at the last layer of the model.</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.`,name:"last_hidden_state"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L809"}}),Vs=new P({props:{name:"class transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput",anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"logits",val:": Tensor = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput.loss",description:`<strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Language modeling loss (for next-token prediction).`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput.logits",description:`<strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_predict, config.vocab_size)</code>) &#x2014;
Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L843"}}),Gs=new P({props:{name:"class transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput",anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"logits",val:": Tensor = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput.loss",description:`<strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) &#x2014;
Classification (or regression if config.num_labels==1) loss.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput.logits",description:`<strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, config.num_labels)</code>) &#x2014;
Classification (or regression if config.num_labels==1) scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L880"}}),Zs=new P({props:{name:"class transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput",anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"logits",val:": Tensor = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput.loss",description:`<strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Classification loss.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput.logits",description:`<strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_choices)</code>) &#x2014;
<em>num_choices</em> is the second dimension of the input tensors. (see <em>input_ids</em> above).</p>
<p>Classification scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L948"}}),ta=new P({props:{name:"class transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput",anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"logits",val:": Tensor = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput.loss",description:`<strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided)  &#x2014;
Classification loss.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput.logits",description:`<strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) &#x2014;
Classification scores (before SoftMax).`,name:"logits"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L914"}}),na=new P({props:{name:"class transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput",anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput",parameters:[{name:"loss",val:": typing.Optional[tensorflow.python.framework.ops.Tensor] = None"},{name:"start_logits",val:": Tensor = None"},{name:"end_logits",val:": Tensor = None"},{name:"mems",val:": typing.Optional[typing.List[tensorflow.python.framework.ops.Tensor]] = None"},{name:"hidden_states",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"},{name:"attentions",val:": typing.Optional[typing.Tuple[tensorflow.python.framework.ops.Tensor]] = None"}],parametersDescription:[{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput.loss",description:`<strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>labels</code> is provided) &#x2014;
Total span extraction loss is the sum of a Cross-Entropy for the start and end positions.`,name:"loss"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput.start_logits",description:`<strong>start_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length,)</code>) &#x2014;
Span-start scores (before SoftMax).`,name:"start_logits"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput.end_logits",description:`<strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length,)</code>) &#x2014;
Span-end scores (before SoftMax).`,name:"end_logits"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput.mems",description:`<strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.`,name:"mems"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput.hidden_states",description:`<strong>hidden_states</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_hidden_states=True</code> is passed or when <code>config.output_hidden_states=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"hidden_states"},{anchor:"transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput.attentions",description:`<strong>attentions</strong> (<code>tuple(tf.Tensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) &#x2014;
Tuple of <code>tf.Tensor</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.`,name:"attentions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L984"}}),aa=new Ze({}),ra=new P({props:{name:"class transformers.XLNetModel",anchor:"transformers.XLNetModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L931"}}),ca=new P({props:{name:"forward",anchor:"transformers.XLNetModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mems",val:": typing.Optional[torch.Tensor] = None"},{name:"perm_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"target_mapping",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XLNetModel.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.XLNetModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.XLNetModel.forward.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.XLNetModel.forward.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.XLNetModel.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.XLNetModel.forward.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.XLNetModel.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.XLNetModel.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.XLNetModel.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.XLNetModel.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.XLNetModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1060",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetModelOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, hidden_size)</code>) \u2014 Sequence of hidden-states at the last layer of the model.</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</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>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetModelOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),ln=new Je({props:{$$slots:{default:[tv]},$$scope:{ctx:q}}}),dn=new Re({props:{anchor:"transformers.XLNetModel.forward.example",$$slots:{default:[ov]},$$scope:{ctx:q}}}),pa=new Ze({}),ma=new P({props:{name:"class transformers.XLNetLMHeadModel",anchor:"transformers.XLNetLMHeadModel",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLNetLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1296"}}),ga=new P({props:{name:"forward",anchor:"transformers.XLNetLMHeadModel.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mems",val:": typing.Optional[torch.Tensor] = None"},{name:"perm_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"target_mapping",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetLMHeadModel.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XLNetLMHeadModel.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.XLNetLMHeadModel.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.XLNetLMHeadModel.forward.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.XLNetLMHeadModel.forward.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.XLNetLMHeadModel.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.XLNetLMHeadModel.forward.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.XLNetLMHeadModel.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.XLNetLMHeadModel.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.XLNetLMHeadModel.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.XLNetLMHeadModel.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.XLNetLMHeadModel.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLNetLMHeadModel.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_predict)</code>, <em>optional</em>) &#x2014;
Labels for masked language modeling. <code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If
<code>target_mapping</code> is <code>None</code>, then <code>num_predict</code> corresponds to <code>sequence_length</code>.</p>
<p>The labels should correspond to the masked input words that should be predicted and depends on
<code>target_mapping</code>. Note in order to perform standard auto-regressive language modeling a <em><mask></mask></em> token has
to be added to the <code>input_ids</code> (see the <code>prepare_inputs_for_generation</code> function and examples below)</p>
<p>Indices are selected in <code>[-100, 0, ..., config.vocab_size]</code> All labels set to <code>-100</code> are ignored, the loss
is only computed for labels in <code>[0, ..., config.vocab_size]</code>`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1358",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</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)
Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</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>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetLMHeadModelOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),pn=new Je({props:{$$slots:{default:[nv]},$$scope:{ctx:q}}}),mn=new Re({props:{anchor:"transformers.XLNetLMHeadModel.forward.example",$$slots:{default:[sv]},$$scope:{ctx:q}}}),_a=new Ze({}),ka=new P({props:{name:"class transformers.XLNetForSequenceClassification",anchor:"transformers.XLNetForSequenceClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLNetForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1502"}}),wa=new P({props:{name:"forward",anchor:"transformers.XLNetForSequenceClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mems",val:": typing.Optional[torch.Tensor] = None"},{name:"perm_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"target_mapping",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetForSequenceClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XLNetForSequenceClassification.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.XLNetForSequenceClassification.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.XLNetForSequenceClassification.forward.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.XLNetForSequenceClassification.forward.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.XLNetForSequenceClassification.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.XLNetForSequenceClassification.forward.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.XLNetForSequenceClassification.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.XLNetForSequenceClassification.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.XLNetForSequenceClassification.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.XLNetForSequenceClassification.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.XLNetForSequenceClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLNetForSequenceClassification.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1515",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</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>label</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>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</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>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForSequenceClassificationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),un=new Je({props:{$$slots:{default:[av]},$$scope:{ctx:q}}}),fn=new Re({props:{anchor:"transformers.XLNetForSequenceClassification.forward.example",$$slots:{default:[rv]},$$scope:{ctx:q}}}),gn=new Re({props:{anchor:"transformers.XLNetForSequenceClassification.forward.example-2",$$slots:{default:[iv]},$$scope:{ctx:q}}}),va=new Ze({}),Na=new P({props:{name:"class transformers.XLNetForMultipleChoice",anchor:"transformers.XLNetForMultipleChoice",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLNetForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1698"}}),Fa=new P({props:{name:"forward",anchor:"transformers.XLNetForMultipleChoice.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mems",val:": typing.Optional[torch.Tensor] = None"},{name:"perm_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"target_mapping",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetForMultipleChoice.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XLNetForMultipleChoice.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.XLNetForMultipleChoice.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.XLNetForMultipleChoice.forward.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.XLNetForMultipleChoice.forward.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.XLNetForMultipleChoice.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.XLNetForMultipleChoice.forward.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.XLNetForMultipleChoice.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.XLNetForMultipleChoice.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.XLNetForMultipleChoice.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.XLNetForMultipleChoice.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.XLNetForMultipleChoice.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLNetForMultipleChoice.forward.labels",description:`<strong>labels</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the multiple choice classification loss. Indices should be in <code>[0, ..., num_choices-1]</code> where <code>num_choices</code> is the size of the second dimension of the input tensors. (See
<code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1709",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</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>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</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>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForMultipleChoiceOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),kn=new Je({props:{$$slots:{default:[lv]},$$scope:{ctx:q}}}),bn=new Re({props:{anchor:"transformers.XLNetForMultipleChoice.forward.example",$$slots:{default:[dv]},$$scope:{ctx:q}}}),Xa=new Ze({}),qa=new P({props:{name:"class transformers.XLNetForTokenClassification",anchor:"transformers.XLNetForTokenClassification",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLNetForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1611"}}),Ca=new P({props:{name:"forward",anchor:"transformers.XLNetForTokenClassification.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mems",val:": typing.Optional[torch.Tensor] = None"},{name:"perm_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"target_mapping",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"labels",val:": typing.Optional[torch.Tensor] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetForTokenClassification.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XLNetForTokenClassification.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.XLNetForTokenClassification.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.XLNetForTokenClassification.forward.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.XLNetForTokenClassification.forward.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.XLNetForTokenClassification.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.XLNetForTokenClassification.forward.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.XLNetForTokenClassification.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.XLNetForTokenClassification.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.XLNetForTokenClassification.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.XLNetForTokenClassification.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.XLNetForTokenClassification.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLNetForTokenClassification.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]</code>
where <em>num_choices</em> is the size of the second dimension of the input tensors. (see <em>input_ids</em> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1622",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</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>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</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>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForTokenClassificationOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Tn=new Je({props:{$$slots:{default:[cv]},$$scope:{ctx:q}}}),wn=new Re({props:{anchor:"transformers.XLNetForTokenClassification.forward.example",$$slots:{default:[pv]},$$scope:{ctx:q}}}),ja=new Ze({}),Oa=new P({props:{name:"class transformers.XLNetForQuestionAnsweringSimple",anchor:"transformers.XLNetForQuestionAnsweringSimple",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLNetForQuestionAnsweringSimple.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1801"}}),Da=new P({props:{name:"forward",anchor:"transformers.XLNetForQuestionAnsweringSimple.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mems",val:": typing.Optional[torch.Tensor] = None"},{name:"perm_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"target_mapping",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetForQuestionAnsweringSimple.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XLNetForQuestionAnsweringSimple.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.XLNetForQuestionAnsweringSimple.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.XLNetForQuestionAnsweringSimple.forward.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.XLNetForQuestionAnsweringSimple.forward.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.XLNetForQuestionAnsweringSimple.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.XLNetForQuestionAnsweringSimple.forward.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.XLNetForQuestionAnsweringSimple.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.XLNetForQuestionAnsweringSimple.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.XLNetForQuestionAnsweringSimple.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.XLNetForQuestionAnsweringSimple.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.XLNetForQuestionAnsweringSimple.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLNetForQuestionAnsweringSimple.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.XLNetForQuestionAnsweringSimple.forward.end_positions",description:`<strong>end_positions</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1812",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</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>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</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>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringSimpleOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Nn=new Je({props:{$$slots:{default:[mv]},$$scope:{ctx:q}}}),$n=new Re({props:{anchor:"transformers.XLNetForQuestionAnsweringSimple.forward.example",$$slots:{default:[hv]},$$scope:{ctx:q}}}),Ia=new Ze({}),Ha=new P({props:{name:"class transformers.XLNetForQuestionAnswering",anchor:"transformers.XLNetForQuestionAnswering",parameters:[{name:"config",val:""}],parametersDescription:[{anchor:"transformers.XLNetForQuestionAnswering.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1911"}}),Ba=new P({props:{name:"forward",anchor:"transformers.XLNetForQuestionAnswering.forward",parameters:[{name:"input_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"attention_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"mems",val:": typing.Optional[torch.Tensor] = None"},{name:"perm_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"target_mapping",val:": typing.Optional[torch.Tensor] = None"},{name:"token_type_ids",val:": typing.Optional[torch.Tensor] = None"},{name:"input_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"head_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"inputs_embeds",val:": typing.Optional[torch.Tensor] = None"},{name:"start_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"end_positions",val:": typing.Optional[torch.Tensor] = None"},{name:"is_impossible",val:": typing.Optional[torch.Tensor] = None"},{name:"cls_index",val:": typing.Optional[torch.Tensor] = None"},{name:"p_mask",val:": typing.Optional[torch.Tensor] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.XLNetForQuestionAnswering.forward.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.XLNetForQuestionAnswering.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.XLNetForQuestionAnswering.forward.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.XLNetForQuestionAnswering.forward.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.XLNetForQuestionAnswering.forward.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.XLNetForQuestionAnswering.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.XLNetForQuestionAnswering.forward.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.XLNetForQuestionAnswering.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.XLNetForQuestionAnswering.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.XLNetForQuestionAnswering.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.XLNetForQuestionAnswering.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.XLNetForQuestionAnswering.forward.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.XLNetForQuestionAnswering.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.XLNetForQuestionAnswering.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"},{anchor:"transformers.XLNetForQuestionAnswering.forward.is_impossible",description:`<strong>is_impossible</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels whether a question has an answer or no answer (SQuAD 2.0)`,name:"is_impossible"},{anchor:"transformers.XLNetForQuestionAnswering.forward.cls_index",description:`<strong>cls_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the classification token to use as input for computing plausibility of the
answer.`,name:"cls_index"},{anchor:"transformers.XLNetForQuestionAnswering.forward.p_mask",description:`<strong>p_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Optional mask of tokens which can&#x2019;t be in answers (e.g. [CLS], [PAD], &#x2026;). 1.0 means token should be
masked. 0.0 mean token is not masked.`,name:"p_mask"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_xlnet.py#L1925",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput</a> or a tuple of
<code>torch.FloatTensor</code> (if <code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various
elements depending on the configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>torch.FloatTensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned if both <code>start_positions</code> and <code>end_positions</code> are provided) \u2014 Classification loss as the sum of start token, end token (and is_impossible if provided) classification
losses.</p>
</li>
<li>
<p><strong>start_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the top config.start_n_top start token possibilities (beam-search).</p>
</li>
<li>
<p><strong>start_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Indices for the top config.start_n_top start token possibilities (beam-search).</p>
</li>
<li>
<p><strong>end_top_log_probs</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities
(beam-search).</p>
</li>
<li>
<p><strong>end_top_index</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, config.start_n_top * config.end_n_top)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Indices for the top <code>config.start_n_top * config.end_n_top</code> end token possibilities (beam-search).</p>
</li>
<li>
<p><strong>cls_logits</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>, returned if <code>start_positions</code> or <code>end_positions</code> is not provided) \u2014 Log probabilities for the <code>is_impossible</code> label of the answers.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</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>attentions</strong> (<code>tuple(torch.FloatTensor)</code>, <em>optional</em>, returned when <code>output_attentions=True</code> is passed or when <code>config.output_attentions=True</code>) \u2014 Tuple of <code>torch.FloatTensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput"
>transformers.models.xlnet.modeling_xlnet.XLNetForQuestionAnsweringOutput</a> or <code>tuple(torch.FloatTensor)</code></p>
`}}),Ln=new Je({props:{$$slots:{default:[uv]},$$scope:{ctx:q}}}),Fn=new Re({props:{anchor:"transformers.XLNetForQuestionAnswering.forward.example",$$slots:{default:[fv]},$$scope:{ctx:q}}}),Ka=new Ze({}),Ra=new P({props:{name:"class transformers.TFXLNetModel",anchor:"transformers.TFXLNetModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLNetModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1139"}}),qn=new Je({props:{$$slots:{default:[gv]},$$scope:{ctx:q}}}),Ja=new P({props:{name:"call",anchor:"transformers.TFXLNetModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"mems",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"perm_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"target_mapping",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"input_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLNetModel.call.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLNetModel.call.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.TFXLNetModel.call.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.TFXLNetModel.call.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.TFXLNetModel.call.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.TFXLNetModel.call.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.TFXLNetModel.call.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.TFXLNetModel.call.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.TFXLNetModel.call.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.TFXLNetModel.call.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.TFXLNetModel.call.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.TFXLNetModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1144",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>last_hidden_state</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_predict, hidden_size)</code>) \u2014 Sequence of hidden-states at the last layer of the model.</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),zn=new Je({props:{$$slots:{default:[_v]},$$scope:{ctx:q}}}),Mn=new Re({props:{anchor:"transformers.TFXLNetModel.call.example",$$slots:{default:[kv]},$$scope:{ctx:q}}}),Za=new Ze({}),er=new P({props:{name:"class transformers.TFXLNetLMHeadModel",anchor:"transformers.TFXLNetLMHeadModel",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLNetLMHeadModel.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1203"}}),Cn=new Je({props:{$$slots:{default:[bv]},$$scope:{ctx:q}}}),sr=new P({props:{name:"call",anchor:"transformers.TFXLNetLMHeadModel.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"mems",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"perm_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"target_mapping",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"input_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLNetLMHeadModel.call.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLNetLMHeadModel.call.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.TFXLNetLMHeadModel.call.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.TFXLNetLMHeadModel.call.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.TFXLNetLMHeadModel.call.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.TFXLNetLMHeadModel.call.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.TFXLNetLMHeadModel.call.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.TFXLNetLMHeadModel.call.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.TFXLNetLMHeadModel.call.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.TFXLNetLMHeadModel.call.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.TFXLNetLMHeadModel.call.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.TFXLNetLMHeadModel.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFXLNetLMHeadModel.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the cross entropy classification loss. Indices should be in <code>[0, ..., config.vocab_size - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1257",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <em>(1,)</em>, <em>optional</em>, returned when <code>labels</code> is provided)
Language modeling loss (for next-token prediction).</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, num_predict, config.vocab_size)</code>) \u2014 Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).</p>
<p><code>num_predict</code> corresponds to <code>target_mapping.shape[1]</code>. If <code>target_mapping</code> is <code>None</code>, then <code>num_predict</code>
corresponds to <code>sequence_length</code>.</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetLMHeadModelOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),jn=new Je({props:{$$slots:{default:[yv]},$$scope:{ctx:q}}}),On=new Re({props:{anchor:"transformers.TFXLNetLMHeadModel.call.example",$$slots:{default:[Tv]},$$scope:{ctx:q}}}),ar=new Ze({}),rr=new P({props:{name:"class transformers.TFXLNetForSequenceClassification",anchor:"transformers.TFXLNetForSequenceClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLNetForSequenceClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1370"}}),Pn=new Je({props:{$$slots:{default:[wv]},$$scope:{ctx:q}}}),cr=new P({props:{name:"call",anchor:"transformers.TFXLNetForSequenceClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"mems",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"perm_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"target_mapping",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"input_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLNetForSequenceClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLNetForSequenceClassification.call.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.TFXLNetForSequenceClassification.call.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.TFXLNetForSequenceClassification.call.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.TFXLNetForSequenceClassification.call.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.TFXLNetForSequenceClassification.call.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.TFXLNetForSequenceClassification.call.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.TFXLNetForSequenceClassification.call.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.TFXLNetForSequenceClassification.call.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.TFXLNetForSequenceClassification.call.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.TFXLNetForSequenceClassification.call.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.TFXLNetForSequenceClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFXLNetForSequenceClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for computing the sequence classification/regression loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>. If <code>config.num_labels == 1</code> a regression loss is computed (Mean-Square loss), If
<code>config.num_labels &gt; 1</code> a classification loss is computed (Cross-Entropy).`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1383",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</code> of shape <code>(1,)</code>, <em>optional</em>, returned when <code>label</code> is provided) \u2014 Classification (or regression if config.num_labels==1) loss.</p>
</li>
<li>
<p><strong>logits</strong> (<code>tf.Tensor</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>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForSequenceClassificationOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Sn=new Je({props:{$$slots:{default:[vv]},$$scope:{ctx:q}}}),Dn=new Re({props:{anchor:"transformers.TFXLNetForSequenceClassification.call.example",$$slots:{default:[Nv]},$$scope:{ctx:q}}}),In=new Re({props:{anchor:"transformers.TFXLNetForSequenceClassification.call.example-2",$$slots:{default:[$v]},$$scope:{ctx:q}}}),pr=new Ze({}),mr=new P({props:{name:"class transformers.TFXLNetForMultipleChoice",anchor:"transformers.TFXLNetForMultipleChoice",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLNetForMultipleChoice.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1466"}}),Qn=new Je({props:{$$slots:{default:[xv]},$$scope:{ctx:q}}}),gr=new P({props:{name:"call",anchor:"transformers.TFXLNetForMultipleChoice.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"input_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"mems",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"perm_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"target_mapping",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLNetForMultipleChoice.call.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, num_choices, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLNetForMultipleChoice.call.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.TFXLNetForMultipleChoice.call.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.TFXLNetForMultipleChoice.call.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.TFXLNetForMultipleChoice.call.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.TFXLNetForMultipleChoice.call.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.TFXLNetForMultipleChoice.call.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.TFXLNetForMultipleChoice.call.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.TFXLNetForMultipleChoice.call.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.TFXLNetForMultipleChoice.call.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.TFXLNetForMultipleChoice.call.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.TFXLNetForMultipleChoice.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFXLNetForMultipleChoice.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</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]</code>
where <code>num_choices</code> is the size of the second dimension of the input tensors. (See <code>input_ids</code> above)`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1488",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</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>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForMultipleChoiceOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Un=new Je({props:{$$slots:{default:[Lv]},$$scope:{ctx:q}}}),Wn=new Re({props:{anchor:"transformers.TFXLNetForMultipleChoice.call.example",$$slots:{default:[Fv]},$$scope:{ctx:q}}}),_r=new Ze({}),kr=new P({props:{name:"class transformers.TFXLNetForTokenClassification",anchor:"transformers.TFXLNetForTokenClassification",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLNetForTokenClassification.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1598"}}),Kn=new Je({props:{$$slots:{default:[Xv]},$$scope:{ctx:q}}}),wr=new P({props:{name:"call",anchor:"transformers.TFXLNetForTokenClassification.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"mems",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"perm_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"target_mapping",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"input_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"labels",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLNetForTokenClassification.call.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLNetForTokenClassification.call.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.TFXLNetForTokenClassification.call.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.TFXLNetForTokenClassification.call.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.TFXLNetForTokenClassification.call.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.TFXLNetForTokenClassification.call.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.TFXLNetForTokenClassification.call.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.TFXLNetForTokenClassification.call.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.TFXLNetForTokenClassification.call.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.TFXLNetForTokenClassification.call.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.TFXLNetForTokenClassification.call.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.TFXLNetForTokenClassification.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFXLNetForTokenClassification.call.labels",description:`<strong>labels</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length)</code>, <em>optional</em>) &#x2014;
Labels for computing the token classification loss. Indices should be in <code>[0, ..., config.num_labels - 1]</code>.`,name:"labels"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1608",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</code> of shape <code>(batch_size, sequence_length, config.num_labels)</code>) \u2014 Classification scores (before SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForTokenClassificationOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Rn=new Je({props:{$$slots:{default:[qv]},$$scope:{ctx:q}}}),Vn=new Re({props:{anchor:"transformers.TFXLNetForTokenClassification.call.example",$$slots:{default:[zv]},$$scope:{ctx:q}}}),Yn=new Re({props:{anchor:"transformers.TFXLNetForTokenClassification.call.example-2",$$slots:{default:[Mv]},$$scope:{ctx:q}}}),vr=new Ze({}),Nr=new P({props:{name:"class transformers.TFXLNetForQuestionAnsweringSimple",anchor:"transformers.TFXLNetForQuestionAnsweringSimple",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.config",description:`<strong>config</strong> (<a href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig">XLNetConfig</a>) &#x2014; Model configuration class with all the parameters of the model.
Initializing with a config file does not load the weights associated with the model, only the
configuration. Check out the <a href="/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel.from_pretrained">from_pretrained()</a> method to load the model weights.`,name:"config"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1685"}}),Jn=new Je({props:{$$slots:{default:[Ev]},$$scope:{ctx:q}}}),Fr=new P({props:{name:"call",anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call",parameters:[{name:"input_ids",val:": typing.Union[typing.List[tensorflow.python.framework.ops.Tensor], typing.List[numpy.ndarray], typing.List[keras.engine.keras_tensor.KerasTensor], typing.Dict[str, tensorflow.python.framework.ops.Tensor], typing.Dict[str, numpy.ndarray], typing.Dict[str, keras.engine.keras_tensor.KerasTensor], tensorflow.python.framework.ops.Tensor, numpy.ndarray, keras.engine.keras_tensor.KerasTensor, NoneType] = None"},{name:"attention_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"mems",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"perm_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"target_mapping",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"token_type_ids",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"input_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"head_mask",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"inputs_embeds",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"use_mems",val:": typing.Optional[bool] = 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"},{name:"start_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"end_positions",val:": typing.Union[numpy.ndarray, tensorflow.python.framework.ops.Tensor, NoneType] = None"},{name:"training",val:": bool = False"}],parametersDescription:[{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.input_ids",description:`<strong>input_ids</strong> (<code>torch.LongTensor</code> of shape <code>(batch_size, sequence_length)</code>) &#x2014;
Indices of input sequence tokens in the vocabulary.</p>
<p>Indices can be obtained using <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoTokenizer">AutoTokenizer</a>. See <a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode">PreTrainedTokenizer.encode()</a> and
<a href="/docs/transformers/main/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.__call__">PreTrainedTokenizer.<strong>call</strong>()</a> for details.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a>`,name:"input_ids"},{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.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.TFXLNetForQuestionAnsweringSimple.call.mems",description:`<strong>mems</strong> (<code>List[torch.FloatTensor]</code> of length <code>config.n_layers</code>) &#x2014;
Contains pre-computed hidden-states (see <code>mems</code> output below) . Can be used to speed up sequential
decoding. The token ids which have their past given to this model should not be passed as <code>input_ids</code> as
they have already been computed.</p>
<p><code>use_mems</code> has to be set to <code>True</code> to make use of <code>mems</code>.`,name:"mems"},{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.perm_mask",description:`<strong>perm_mask</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, sequence_length, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the attention pattern for each input token with values selected in <code>[0, 1]</code>:</p>
<ul>
<li>if <code>perm_mask[k, i, j] = 0</code>, i attend to j in batch k;</li>
<li>if <code>perm_mask[k, i, j] = 1</code>, i does not attend to j in batch k.</li>
</ul>
<p>If not set, each token attends to all the others (full bidirectional attention). Only used during
pretraining (to define factorization order) or for sequential decoding (generation).`,name:"perm_mask"},{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.target_mapping",description:`<strong>target_mapping</strong> (<code>torch.FloatTensor</code> of shape <code>(batch_size, num_predict, sequence_length)</code>, <em>optional</em>) &#x2014;
Mask to indicate the output tokens to use. If <code>target_mapping[k, i, j] = 1</code>, the i-th predict in batch k is
on the j-th token. Only used during pretraining for partial prediction or for sequential decoding
(generation).`,name:"target_mapping"},{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.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.TFXLNetForQuestionAnsweringSimple.call.input_mask",description:`<strong>input_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. Negative of <code>attention_mask</code>, i.e. with 0 for
real tokens and 1 for padding which is kept for compatibility with the original code base.</p>
<p>Mask values selected in <code>[0, 1]</code>:</p>
<ul>
<li>1 for tokens that are <strong>masked</strong>,</li>
<li>0 for tokens that are <strong>not masked</strong>.</li>
</ul>
<p>You can only uses one of <code>input_mask</code> and <code>attention_mask</code>.`,name:"input_mask"},{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.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.TFXLNetForQuestionAnsweringSimple.call.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.TFXLNetForQuestionAnsweringSimple.call.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.TFXLNetForQuestionAnsweringSimple.call.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.TFXLNetForQuestionAnsweringSimple.call.return_dict",description:`<strong>return_dict</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to return a <a href="/docs/transformers/main/en/main_classes/output#transformers.utils.ModelOutput">ModelOutput</a> instead of a plain tuple.`,name:"return_dict"},{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.start_positions",description:`<strong>start_positions</strong> (<code>tf.Tensor</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.TFXLNetForQuestionAnsweringSimple.call.end_positions",description:`<strong>end_positions</strong> (<code>tf.Tensor</code> of shape <code>(batch_size,)</code>, <em>optional</em>) &#x2014;
Labels for position (index) of the end of the labelled span for computing the token classification loss.
Positions are clamped to the length of the sequence (<code>sequence_length</code>). Position outside of the sequence
are not taken into account for computing the loss.`,name:"end_positions"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/xlnet/modeling_tf_xlnet.py#L1693",returnDescription:`
<p>A <a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput</a> or a tuple of <code>tf.Tensor</code> (if
<code>return_dict=False</code> is passed or when <code>config.return_dict=False</code>) comprising various elements depending on the
configuration (<a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetConfig"
>XLNetConfig</a>) and inputs.</p>
<ul>
<li>
<p><strong>loss</strong> (<code>tf.Tensor</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>tf.Tensor</code> of shape <code>(batch_size, sequence_length,)</code>) \u2014 Span-start scores (before SoftMax).</p>
</li>
<li>
<p><strong>end_logits</strong> (<code>tf.Tensor</code> of shape <code>(batch_size, sequence_length,)</code>) \u2014 Span-end scores (before SoftMax).</p>
</li>
<li>
<p><strong>mems</strong> (<code>List[tf.Tensor]</code> of length <code>config.n_layers</code>) \u2014 Contains pre-computed hidden-states. Can be used (see <code>mems</code> input) to speed up sequential decoding. The
token ids which have their past given to this model should not be passed as <code>input_ids</code> as they have
already been computed.</p>
</li>
<li>
<p><strong>hidden_states</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</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>attentions</strong> (<code>tuple(tf.Tensor)</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>tf.Tensor</code> (one for each layer) of shape <code>(batch_size, num_heads, sequence_length, sequence_length)</code>.</p>
<p>Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
heads.</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/main/en/model_doc/xlnet#transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput"
>transformers.models.xlnet.modeling_tf_xlnet.TFXLNetForQuestionAnsweringSimpleOutput</a> or <code>tuple(tf.Tensor)</code></p>
`}}),Zn=new Je({props:{$$slots:{default:[Cv]},$$scope:{ctx:q}}}),es=new Re({props:{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.example",$$slots:{default:[jv]},$$scope:{ctx:q}}}),ts=new Re({props:{anchor:"transformers.TFXLNetForQuestionAnsweringSimple.call.example-2",$$slots:{default:[Ov]},$$scope:{ctx:q}}}),{c(){d=a("meta"),y=c(),h=a("h1"),u=a("a"),b=a("span"),T(l.$$.fragment),m=c(),z=a("span"),ke=n("XLNet"),me=c(),D=a("h2"),ae=a("a"),ee=a("span"),T(L.$$.fragment),be=c(),R=a("span"),ye=n("Overview"),he=c(),Q=a("p"),Te=n("The XLNet model was proposed in "),re=a("a"),Y=n("XLNet: Generalized Autoregressive Pretraining for Language Understanding"),we=n(` by Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov,
Quoc V. Le. XLnet is an extension of the Transformer-XL model pre-trained using an autoregressive method to learn
bidirectional contexts by maximizing the expected likelihood over all permutations of the input sequence factorization
order.`),ue=c(),B=a("p"),ve=n("The abstract from the paper is the following:"),fe=c(),K=a("p"),de=a("em"),Ne=n(`With the capability of modeling bidirectional contexts, denoising autoencoding based pretraining like BERT achieves
better performance than pretraining approaches based on autoregressive language modeling. However, relying on
corrupting the input with masks, BERT neglects dependency between the masked positions and suffers from a
pretrain-finetune discrepancy. In light of these pros and cons, we propose XLNet, a generalized autoregressive
pretraining method that (1) enables learning bidirectional contexts by maximizing the expected likelihood over all
permutations of the factorization order and (2) overcomes the limitations of BERT thanks to its autoregressive
formulation. Furthermore, XLNet integrates ideas from Transformer-XL, the state-of-the-art autoregressive model, into
pretraining. Empirically, under comparable experiment settings, XLNet outperforms BERT on 20 tasks, often by a large
margin, including question answering, natural language inference, sentiment analysis, and document ranking.`),ne=c(),M=a("p"),E=n("Tips:"),ge=c(),A=a("ul"),ie=a("li"),$e=n("The specific attention pattern can be controlled at training and test time using the "),V=a("code"),xe=n("perm_mask"),Le=n(" input."),C=c(),le=a("li"),G=n(`Due to the difficulty of training a fully auto-regressive model over various factorization order, XLNet is pretrained
using only a sub-set of the output tokens as target which are selected with the `),ce=a("code"),Fe=n("target_mapping"),J=n(" input."),Xe=c(),te=a("li"),I=n("To use XLNet for sequential decoding (i.e. not in fully bi-directional setting), use the "),pe=a("code"),Z=n("perm_mask"),qe=n(` and
`),oe=a("code"),j=n("target_mapping"),ze=n(` inputs to control the attention span and outputs (see examples in
`),O=a("em"),Me=n("examples/pytorch/text-generation/run_generation.py"),Ee=n(")"),k=c(),F=a("li"),Ie=n("XLNet is one of the few models that has no sequence length limit."),se=c(),_e=a("p"),He=n("This model was contributed by "),X=a("a"),Qe=n("thomwolf"),Ue=n(". The original code can be found "),Oe=a("a"),We=n("here"),Be=n("."),S=c(),H=a("h2"),je=a("a"),Pe=a("span"),T(U.$$.fragment),Ke=c(),Se=a("span"),Ce=n("XLNetConfig"),De=c(),W=a("div"),T(Ae.$$.fragment),sm=c(),Ot=a("p"),am=n("This is the configuration class to store the configuration of a "),jr=a("a"),rm=n("XLNetModel"),im=n(" or a "),Or=a("a"),lm=n("TFXLNetModel"),dm=n(`. It is used to
instantiate a XLNet 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
`),hs=a("a"),cm=n("xlnet-large-cased"),pm=n(" architecture."),mm=c(),to=a("p"),hm=n("Configuration objects inherit from "),Ar=a("a"),um=n("PretrainedConfig"),fm=n(` and can be used to control the model outputs. Read the
documentation from `),Pr=a("a"),gm=n("PretrainedConfig"),_m=n(" for more information."),km=c(),T(Zo.$$.fragment),Bd=c(),oo=a("h2"),en=a("a"),Yi=a("span"),T(us.$$.fragment),bm=c(),Gi=a("span"),ym=n("XLNetTokenizer"),Kd=c(),Ge=a("div"),T(fs.$$.fragment),Tm=c(),gs=a("p"),wm=n("Construct an XLNet tokenizer. Based on "),_s=a("a"),vm=n("SentencePiece"),Nm=n("."),$m=c(),ks=a("p"),xm=n("This tokenizer inherits from "),Sr=a("a"),Lm=n("PreTrainedTokenizer"),Fm=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Xm=c(),It=a("div"),T(bs.$$.fragment),qm=c(),Ji=a("p"),zm=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLNet sequence has the following format:`),Mm=c(),ys=a("ul"),Dr=a("li"),Em=n("single sequence: "),Zi=a("code"),Cm=n("X <sep> <cls>"),jm=c(),Ir=a("li"),Om=n("pair of sequences: "),el=a("code"),Am=n("A <sep> B <sep> <cls>"),Pm=c(),tn=a("div"),T(Ts.$$.fragment),Sm=c(),ws=a("p"),Dm=n(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),tl=a("code"),Im=n("prepare_for_model"),Hm=n(" method."),Qm=c(),bt=a("div"),T(vs.$$.fragment),Um=c(),ol=a("p"),Wm=n("Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLNet"),Bm=c(),T(on.$$.fragment),Km=c(),no=a("p"),Rm=n("If "),nl=a("code"),Vm=n("token_ids_1"),Ym=n(" is "),sl=a("code"),Gm=n("None"),Jm=n(", this method only returns the first portion of the mask (0s)."),Zm=c(),Hr=a("div"),T(Ns.$$.fragment),Rd=c(),so=a("h2"),nn=a("a"),al=a("span"),T($s.$$.fragment),eh=c(),rl=a("span"),th=n("XLNetTokenizerFast"),Vd=c(),rt=a("div"),T(xs.$$.fragment),oh=c(),ao=a("p"),nh=n("Construct a \u201Cfast\u201D XLNet tokenizer (backed by HuggingFace\u2019s "),il=a("em"),sh=n("tokenizers"),ah=n(` library). Based on
`),Ls=a("a"),rh=n("Unigram"),ih=n("."),lh=c(),Fs=a("p"),dh=n("This tokenizer inherits from "),Qr=a("a"),ch=n("PreTrainedTokenizerFast"),ph=n(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),mh=c(),Ht=a("div"),T(Xs.$$.fragment),hh=c(),ll=a("p"),uh=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLNet sequence has the following format:`),fh=c(),qs=a("ul"),Ur=a("li"),gh=n("single sequence: "),dl=a("code"),_h=n("X <sep> <cls>"),kh=c(),Wr=a("li"),bh=n("pair of sequences: "),cl=a("code"),yh=n("A <sep> B <sep> <cls>"),Th=c(),yt=a("div"),T(zs.$$.fragment),wh=c(),pl=a("p"),vh=n("Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLNet"),Nh=c(),T(sn.$$.fragment),$h=c(),ro=a("p"),xh=n("If "),ml=a("code"),Lh=n("token_ids_1"),Fh=n(" is "),hl=a("code"),Xh=n("None"),qh=n(", this method only returns the first portion of the mask (0s)."),Yd=c(),io=a("h2"),an=a("a"),ul=a("span"),T(Ms.$$.fragment),zh=c(),fl=a("span"),Mh=n("XLNet specific outputs"),Gd=c(),lo=a("div"),T(Es.$$.fragment),Eh=c(),Cs=a("p"),Ch=n("Output type of "),Br=a("a"),jh=n("XLNetModel"),Oh=n("."),Jd=c(),co=a("div"),T(js.$$.fragment),Ah=c(),Os=a("p"),Ph=n("Output type of "),Kr=a("a"),Sh=n("XLNetLMHeadModel"),Dh=n("."),Zd=c(),po=a("div"),T(As.$$.fragment),Ih=c(),Ps=a("p"),Hh=n("Output type of "),Rr=a("a"),Qh=n("XLNetForSequenceClassification"),Uh=n("."),ec=c(),mo=a("div"),T(Ss.$$.fragment),Wh=c(),Ds=a("p"),Bh=n("Output type of "),Vr=a("a"),Kh=n("XLNetForMultipleChoice"),Rh=n("."),tc=c(),ho=a("div"),T(Is.$$.fragment),Vh=c(),Hs=a("p"),Yh=n("Output type of "),gl=a("code"),Gh=n("XLNetForTokenClassificationOutput"),Jh=n("."),oc=c(),uo=a("div"),T(Qs.$$.fragment),Zh=c(),Us=a("p"),eu=n("Output type of "),Yr=a("a"),tu=n("XLNetForQuestionAnsweringSimple"),ou=n("."),nc=c(),fo=a("div"),T(Ws.$$.fragment),nu=c(),Bs=a("p"),su=n("Output type of "),Gr=a("a"),au=n("XLNetForQuestionAnswering"),ru=n("."),sc=c(),go=a("div"),T(Ks.$$.fragment),iu=c(),Rs=a("p"),lu=n("Output type of "),Jr=a("a"),du=n("TFXLNetModel"),cu=n("."),ac=c(),_o=a("div"),T(Vs.$$.fragment),pu=c(),Ys=a("p"),mu=n("Output type of "),Zr=a("a"),hu=n("TFXLNetLMHeadModel"),uu=n("."),rc=c(),ko=a("div"),T(Gs.$$.fragment),fu=c(),Js=a("p"),gu=n("Output type of "),ei=a("a"),_u=n("TFXLNetForSequenceClassification"),ku=n("."),ic=c(),bo=a("div"),T(Zs.$$.fragment),bu=c(),ea=a("p"),yu=n("Output type of "),ti=a("a"),Tu=n("TFXLNetForMultipleChoice"),wu=n("."),lc=c(),yo=a("div"),T(ta.$$.fragment),vu=c(),oa=a("p"),Nu=n("Output type of "),_l=a("code"),$u=n("TFXLNetForTokenClassificationOutput"),xu=n("."),dc=c(),To=a("div"),T(na.$$.fragment),Lu=c(),sa=a("p"),Fu=n("Output type of "),oi=a("a"),Xu=n("TFXLNetForQuestionAnsweringSimple"),qu=n("."),cc=c(),wo=a("h2"),rn=a("a"),kl=a("span"),T(aa.$$.fragment),zu=c(),bl=a("span"),Mu=n("XLNetModel"),pc=c(),it=a("div"),T(ra.$$.fragment),Eu=c(),yl=a("p"),Cu=n("The bare XLNet Model transformer outputting raw hidden-states without any specific head on top."),ju=c(),ia=a("p"),Ou=n("This model inherits from "),ni=a("a"),Au=n("PreTrainedModel"),Pu=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.)`),Su=c(),la=a("p"),Du=n("This model is also a PyTorch "),da=a("a"),Iu=n("torch.nn.Module"),Hu=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Qu=c(),Tt=a("div"),T(ca.$$.fragment),Uu=c(),vo=a("p"),Wu=n("The "),si=a("a"),Bu=n("XLNetModel"),Ku=n(" forward method, overrides the "),Tl=a("code"),Ru=n("__call__"),Vu=n(" special method."),Yu=c(),T(ln.$$.fragment),Gu=c(),T(dn.$$.fragment),mc=c(),No=a("h2"),cn=a("a"),wl=a("span"),T(pa.$$.fragment),Ju=c(),vl=a("span"),Zu=n("XLNetLMHeadModel"),hc=c(),lt=a("div"),T(ma.$$.fragment),ef=c(),Nl=a("p"),tf=n("XLNet Model with a language modeling head on top (linear layer with weights tied to the input embeddings)."),of=c(),ha=a("p"),nf=n("This model inherits from "),ai=a("a"),sf=n("PreTrainedModel"),af=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.)`),rf=c(),ua=a("p"),lf=n("This model is also a PyTorch "),fa=a("a"),df=n("torch.nn.Module"),cf=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),pf=c(),wt=a("div"),T(ga.$$.fragment),mf=c(),$o=a("p"),hf=n("The "),ri=a("a"),uf=n("XLNetLMHeadModel"),ff=n(" forward method, overrides the "),$l=a("code"),gf=n("__call__"),_f=n(" special method."),kf=c(),T(pn.$$.fragment),bf=c(),T(mn.$$.fragment),uc=c(),xo=a("h2"),hn=a("a"),xl=a("span"),T(_a.$$.fragment),yf=c(),Ll=a("span"),Tf=n("XLNetForSequenceClassification"),fc=c(),dt=a("div"),T(ka.$$.fragment),wf=c(),Fl=a("p"),vf=n(`XLNet Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),Nf=c(),ba=a("p"),$f=n("This model inherits from "),ii=a("a"),xf=n("PreTrainedModel"),Lf=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.)`),Ff=c(),ya=a("p"),Xf=n("This model is also a PyTorch "),Ta=a("a"),qf=n("torch.nn.Module"),zf=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Mf=c(),ut=a("div"),T(wa.$$.fragment),Ef=c(),Lo=a("p"),Cf=n("The "),li=a("a"),jf=n("XLNetForSequenceClassification"),Of=n(" forward method, overrides the "),Xl=a("code"),Af=n("__call__"),Pf=n(" special method."),Sf=c(),T(un.$$.fragment),Df=c(),T(fn.$$.fragment),If=c(),T(gn.$$.fragment),gc=c(),Fo=a("h2"),_n=a("a"),ql=a("span"),T(va.$$.fragment),Hf=c(),zl=a("span"),Qf=n("XLNetForMultipleChoice"),_c=c(),ct=a("div"),T(Na.$$.fragment),Uf=c(),Ml=a("p"),Wf=n(`XLNet Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RACE/SWAG tasks.`),Bf=c(),$a=a("p"),Kf=n("This model inherits from "),di=a("a"),Rf=n("PreTrainedModel"),Vf=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.)`),Yf=c(),xa=a("p"),Gf=n("This model is also a PyTorch "),La=a("a"),Jf=n("torch.nn.Module"),Zf=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),eg=c(),vt=a("div"),T(Fa.$$.fragment),tg=c(),Xo=a("p"),og=n("The "),ci=a("a"),ng=n("XLNetForMultipleChoice"),sg=n(" forward method, overrides the "),El=a("code"),ag=n("__call__"),rg=n(" special method."),ig=c(),T(kn.$$.fragment),lg=c(),T(bn.$$.fragment),kc=c(),qo=a("h2"),yn=a("a"),Cl=a("span"),T(Xa.$$.fragment),dg=c(),jl=a("span"),cg=n("XLNetForTokenClassification"),bc=c(),pt=a("div"),T(qa.$$.fragment),pg=c(),Ol=a("p"),mg=n(`XLNet Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),hg=c(),za=a("p"),ug=n("This model inherits from "),pi=a("a"),fg=n("PreTrainedModel"),gg=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.)`),_g=c(),Ma=a("p"),kg=n("This model is also a PyTorch "),Ea=a("a"),bg=n("torch.nn.Module"),yg=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tg=c(),Nt=a("div"),T(Ca.$$.fragment),wg=c(),zo=a("p"),vg=n("The "),mi=a("a"),Ng=n("XLNetForTokenClassification"),$g=n(" forward method, overrides the "),Al=a("code"),xg=n("__call__"),Lg=n(" special method."),Fg=c(),T(Tn.$$.fragment),Xg=c(),T(wn.$$.fragment),yc=c(),Mo=a("h2"),vn=a("a"),Pl=a("span"),T(ja.$$.fragment),qg=c(),Sl=a("span"),zg=n("XLNetForQuestionAnsweringSimple"),Tc=c(),mt=a("div"),T(Oa.$$.fragment),Mg=c(),Eo=a("p"),Eg=n(`XLNet 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 `),Dl=a("code"),Cg=n("span start logits"),jg=n(" and "),Il=a("code"),Og=n("span end logits"),Ag=n(")."),Pg=c(),Aa=a("p"),Sg=n("This model inherits from "),hi=a("a"),Dg=n("PreTrainedModel"),Ig=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.)`),Hg=c(),Pa=a("p"),Qg=n("This model is also a PyTorch "),Sa=a("a"),Ug=n("torch.nn.Module"),Wg=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Bg=c(),$t=a("div"),T(Da.$$.fragment),Kg=c(),Co=a("p"),Rg=n("The "),ui=a("a"),Vg=n("XLNetForQuestionAnsweringSimple"),Yg=n(" forward method, overrides the "),Hl=a("code"),Gg=n("__call__"),Jg=n(" special method."),Zg=c(),T(Nn.$$.fragment),e_=c(),T($n.$$.fragment),wc=c(),jo=a("h2"),xn=a("a"),Ql=a("span"),T(Ia.$$.fragment),t_=c(),Ul=a("span"),o_=n("XLNetForQuestionAnswering"),vc=c(),ht=a("div"),T(Ha.$$.fragment),n_=c(),Oo=a("p"),s_=n(`XLNet 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 `),Wl=a("code"),a_=n("span start logits"),r_=n(" and "),Bl=a("code"),i_=n("span end logits"),l_=n(")."),d_=c(),Qa=a("p"),c_=n("This model inherits from "),fi=a("a"),p_=n("PreTrainedModel"),m_=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.)`),h_=c(),Ua=a("p"),u_=n("This model is also a PyTorch "),Wa=a("a"),f_=n("torch.nn.Module"),g_=n(` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),__=c(),xt=a("div"),T(Ba.$$.fragment),k_=c(),Ao=a("p"),b_=n("The "),gi=a("a"),y_=n("XLNetForQuestionAnswering"),T_=n(" forward method, overrides the "),Kl=a("code"),w_=n("__call__"),v_=n(" special method."),N_=c(),T(Ln.$$.fragment),$_=c(),T(Fn.$$.fragment),Nc=c(),Po=a("h2"),Xn=a("a"),Rl=a("span"),T(Ka.$$.fragment),x_=c(),Vl=a("span"),L_=n("TFXLNetModel"),$c=c(),et=a("div"),T(Ra.$$.fragment),F_=c(),Yl=a("p"),X_=n("The bare XLNet Model transformer outputting raw hidden-states without any specific head on top."),q_=c(),Va=a("p"),z_=n("This model inherits from "),_i=a("a"),M_=n("TFPreTrainedModel"),E_=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.)`),C_=c(),Ya=a("p"),j_=n("This model is also a "),Ga=a("a"),O_=n("tf.keras.Model"),A_=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),P_=c(),T(qn.$$.fragment),S_=c(),Lt=a("div"),T(Ja.$$.fragment),D_=c(),So=a("p"),I_=n("The "),ki=a("a"),H_=n("TFXLNetModel"),Q_=n(" forward method, overrides the "),Gl=a("code"),U_=n("__call__"),W_=n(" special method."),B_=c(),T(zn.$$.fragment),K_=c(),T(Mn.$$.fragment),xc=c(),Do=a("h2"),En=a("a"),Jl=a("span"),T(Za.$$.fragment),R_=c(),Zl=a("span"),V_=n("TFXLNetLMHeadModel"),Lc=c(),tt=a("div"),T(er.$$.fragment),Y_=c(),ed=a("p"),G_=n("XLNet Model with a language modeling head on top (linear layer with weights tied to the input embeddings)."),J_=c(),tr=a("p"),Z_=n("This model inherits from "),bi=a("a"),ek=n("TFPreTrainedModel"),tk=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.)`),ok=c(),or=a("p"),nk=n("This model is also a "),nr=a("a"),sk=n("tf.keras.Model"),ak=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),rk=c(),T(Cn.$$.fragment),ik=c(),Ft=a("div"),T(sr.$$.fragment),lk=c(),Io=a("p"),dk=n("The "),yi=a("a"),ck=n("TFXLNetLMHeadModel"),pk=n(" forward method, overrides the "),td=a("code"),mk=n("__call__"),hk=n(" special method."),uk=c(),T(jn.$$.fragment),fk=c(),T(On.$$.fragment),Fc=c(),Ho=a("h2"),An=a("a"),od=a("span"),T(ar.$$.fragment),gk=c(),nd=a("span"),_k=n("TFXLNetForSequenceClassification"),Xc=c(),ot=a("div"),T(rr.$$.fragment),kk=c(),sd=a("p"),bk=n(`XLNet Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),yk=c(),ir=a("p"),Tk=n("This model inherits from "),Ti=a("a"),wk=n("TFPreTrainedModel"),vk=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.)`),Nk=c(),lr=a("p"),$k=n("This model is also a "),dr=a("a"),xk=n("tf.keras.Model"),Lk=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Fk=c(),T(Pn.$$.fragment),Xk=c(),ft=a("div"),T(cr.$$.fragment),qk=c(),Qo=a("p"),zk=n("The "),wi=a("a"),Mk=n("TFXLNetForSequenceClassification"),Ek=n(" forward method, overrides the "),ad=a("code"),Ck=n("__call__"),jk=n(" special method."),Ok=c(),T(Sn.$$.fragment),Ak=c(),T(Dn.$$.fragment),Pk=c(),T(In.$$.fragment),qc=c(),Uo=a("h2"),Hn=a("a"),rd=a("span"),T(pr.$$.fragment),Sk=c(),id=a("span"),Dk=n("TFLNetForMultipleChoice"),zc=c(),nt=a("div"),T(mr.$$.fragment),Ik=c(),ld=a("p"),Hk=n(`XLNET 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.`),Qk=c(),hr=a("p"),Uk=n("This model inherits from "),vi=a("a"),Wk=n("TFPreTrainedModel"),Bk=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.)`),Kk=c(),ur=a("p"),Rk=n("This model is also a "),fr=a("a"),Vk=n("tf.keras.Model"),Yk=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Gk=c(),T(Qn.$$.fragment),Jk=c(),Xt=a("div"),T(gr.$$.fragment),Zk=c(),Wo=a("p"),eb=n("The "),Ni=a("a"),tb=n("TFXLNetForMultipleChoice"),ob=n(" forward method, overrides the "),dd=a("code"),nb=n("__call__"),sb=n(" special method."),ab=c(),T(Un.$$.fragment),rb=c(),T(Wn.$$.fragment),Mc=c(),Bo=a("h2"),Bn=a("a"),cd=a("span"),T(_r.$$.fragment),ib=c(),pd=a("span"),lb=n("TFXLNetForTokenClassification"),Ec=c(),st=a("div"),T(kr.$$.fragment),db=c(),md=a("p"),cb=n(`XLNet Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),pb=c(),br=a("p"),mb=n("This model inherits from "),$i=a("a"),hb=n("TFPreTrainedModel"),ub=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.)`),fb=c(),yr=a("p"),gb=n("This model is also a "),Tr=a("a"),_b=n("tf.keras.Model"),kb=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),bb=c(),T(Kn.$$.fragment),yb=c(),gt=a("div"),T(wr.$$.fragment),Tb=c(),Ko=a("p"),wb=n("The "),xi=a("a"),vb=n("TFXLNetForTokenClassification"),Nb=n(" forward method, overrides the "),hd=a("code"),$b=n("__call__"),xb=n(" special method."),Lb=c(),T(Rn.$$.fragment),Fb=c(),T(Vn.$$.fragment),Xb=c(),T(Yn.$$.fragment),Cc=c(),Ro=a("h2"),Gn=a("a"),ud=a("span"),T(vr.$$.fragment),qb=c(),fd=a("span"),zb=n("TFXLNetForQuestionAnsweringSimple"),jc=c(),at=a("div"),T(Nr.$$.fragment),Mb=c(),Vo=a("p"),Eb=n(`XLNet 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 `),gd=a("code"),Cb=n("span start logits"),jb=n(" and "),_d=a("code"),Ob=n("span end logits"),Ab=n(")."),Pb=c(),$r=a("p"),Sb=n("This model inherits from "),Li=a("a"),Db=n("TFPreTrainedModel"),Ib=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.)`),Hb=c(),xr=a("p"),Qb=n("This model is also a "),Lr=a("a"),Ub=n("tf.keras.Model"),Wb=n(` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Bb=c(),T(Jn.$$.fragment),Kb=c(),_t=a("div"),T(Fr.$$.fragment),Rb=c(),Yo=a("p"),Vb=n("The "),Fi=a("a"),Yb=n("TFXLNetForQuestionAnsweringSimple"),Gb=n(" forward method, overrides the "),kd=a("code"),Jb=n("__call__"),Zb=n(" special method."),ey=c(),T(Zn.$$.fragment),ty=c(),T(es.$$.fragment),oy=c(),T(ts.$$.fragment),this.h()},l(o){const _=Yw('[data-svelte="svelte-1phssyn"]',document.head);d=r(_,"META",{name:!0,content:!0}),_.forEach(t),y=p(o),h=r(o,"H1",{class:!0});var Xr=i(h);u=r(Xr,"A",{id:!0,class:!0,href:!0});var bd=i(u);b=r(bd,"SPAN",{});var yd=i(b);w(l.$$.fragment,yd),yd.forEach(t),bd.forEach(t),m=p(Xr),z=r(Xr,"SPAN",{});var Td=i(z);ke=s(Td,"XLNet"),Td.forEach(t),Xr.forEach(t),me=p(o),D=r(o,"H2",{class:!0});var qr=i(D);ae=r(qr,"A",{id:!0,class:!0,href:!0});var wd=i(ae);ee=r(wd,"SPAN",{});var vd=i(ee);w(L.$$.fragment,vd),vd.forEach(t),wd.forEach(t),be=p(qr),R=r(qr,"SPAN",{});var Nd=i(R);ye=s(Nd,"Overview"),Nd.forEach(t),qr.forEach(t),he=p(o),Q=r(o,"P",{});var zr=i(Q);Te=s(zr,"The XLNet model was proposed in "),re=r(zr,"A",{href:!0,rel:!0});var $d=i(re);Y=s($d,"XLNet: Generalized Autoregressive Pretraining for Language Understanding"),$d.forEach(t),we=s(zr,` by Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov,
Quoc V. Le. XLnet is an extension of the Transformer-XL model pre-trained using an autoregressive method to learn
bidirectional contexts by maximizing the expected likelihood over all permutations of the input sequence factorization
order.`),zr.forEach(t),ue=p(o),B=r(o,"P",{});var xd=i(B);ve=s(xd,"The abstract from the paper is the following:"),xd.forEach(t),fe=p(o),K=r(o,"P",{});var Ld=i(K);de=r(Ld,"EM",{});var Fd=i(de);Ne=s(Fd,`With the capability of modeling bidirectional contexts, denoising autoencoding based pretraining like BERT achieves
better performance than pretraining approaches based on autoregressive language modeling. However, relying on
corrupting the input with masks, BERT neglects dependency between the masked positions and suffers from a
pretrain-finetune discrepancy. In light of these pros and cons, we propose XLNet, a generalized autoregressive
pretraining method that (1) enables learning bidirectional contexts by maximizing the expected likelihood over all
permutations of the factorization order and (2) overcomes the limitations of BERT thanks to its autoregressive
formulation. Furthermore, XLNet integrates ideas from Transformer-XL, the state-of-the-art autoregressive model, into
pretraining. Empirically, under comparable experiment settings, XLNet outperforms BERT on 20 tasks, often by a large
margin, including question answering, natural language inference, sentiment analysis, and document ranking.`),Fd.forEach(t),Ld.forEach(t),ne=p(o),M=r(o,"P",{});var Xd=i(M);E=s(Xd,"Tips:"),Xd.forEach(t),ge=p(o),A=r(o,"UL",{});var At=i(A);ie=r(At,"LI",{});var Mr=i(ie);$e=s(Mr,"The specific attention pattern can be controlled at training and test time using the "),V=r(Mr,"CODE",{});var qd=i(V);xe=s(qd,"perm_mask"),qd.forEach(t),Le=s(Mr," input."),Mr.forEach(t),C=p(At),le=r(At,"LI",{});var Er=i(le);G=s(Er,`Due to the difficulty of training a fully auto-regressive model over various factorization order, XLNet is pretrained
using only a sub-set of the output tokens as target which are selected with the `),ce=r(Er,"CODE",{});var zd=i(ce);Fe=s(zd,"target_mapping"),zd.forEach(t),J=s(Er," input."),Er.forEach(t),Xe=p(At),te=r(At,"LI",{});var Pt=i(te);I=s(Pt,"To use XLNet for sequential decoding (i.e. not in fully bi-directional setting), use the "),pe=r(Pt,"CODE",{});var Md=i(pe);Z=s(Md,"perm_mask"),Md.forEach(t),qe=s(Pt,` and
`),oe=r(Pt,"CODE",{});var Ed=i(oe);j=s(Ed,"target_mapping"),Ed.forEach(t),ze=s(Pt,` inputs to control the attention span and outputs (see examples in
`),O=r(Pt,"EM",{});var Cd=i(O);Me=s(Cd,"examples/pytorch/text-generation/run_generation.py"),Cd.forEach(t),Ee=s(Pt,")"),Pt.forEach(t),k=p(At),F=r(At,"LI",{});var jd=i(F);Ie=s(jd,"XLNet is one of the few models that has no sequence length limit."),jd.forEach(t),At.forEach(t),se=p(o),_e=r(o,"P",{});var Go=i(_e);He=s(Go,"This model was contributed by "),X=r(Go,"A",{href:!0,rel:!0});var Od=i(X);Qe=s(Od,"thomwolf"),Od.forEach(t),Ue=s(Go,". The original code can be found "),Oe=r(Go,"A",{href:!0,rel:!0});var Ad=i(Oe);We=s(Ad,"here"),Ad.forEach(t),Be=s(Go,"."),Go.forEach(t),S=p(o),H=r(o,"H2",{class:!0});var Cr=i(H);je=r(Cr,"A",{id:!0,class:!0,href:!0});var Pd=i(je);Pe=r(Pd,"SPAN",{});var Sd=i(Pe);w(U.$$.fragment,Sd),Sd.forEach(t),Pd.forEach(t),Ke=p(Cr),Se=r(Cr,"SPAN",{});var Dd=i(Se);Ce=s(Dd,"XLNetConfig"),Dd.forEach(t),Cr.forEach(t),De=p(o),W=r(o,"DIV",{class:!0});var St=i(W);w(Ae.$$.fragment,St),sm=p(St),Ot=r(St,"P",{});var Dt=i(Ot);am=s(Dt,"This is the configuration class to store the configuration of a "),jr=r(Dt,"A",{href:!0});var Id=i(jr);rm=s(Id,"XLNetModel"),Id.forEach(t),im=s(Dt," or a "),Or=r(Dt,"A",{href:!0});var Hd=i(Or);lm=s(Hd,"TFXLNetModel"),Hd.forEach(t),dm=s(Dt,`. It is used to
instantiate a XLNet 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
`),hs=r(Dt,"A",{href:!0,rel:!0});var Qd=i(hs);cm=s(Qd,"xlnet-large-cased"),Qd.forEach(t),pm=s(Dt," architecture."),Dt.forEach(t),mm=p(St),to=r(St,"P",{});var Jo=i(to);hm=s(Jo,"Configuration objects inherit from "),Ar=r(Jo,"A",{href:!0});var Ud=i(Ar);um=s(Ud,"PretrainedConfig"),Ud.forEach(t),fm=s(Jo,` and can be used to control the model outputs. Read the
documentation from `),Pr=r(Jo,"A",{href:!0});var Wd=i(Pr);gm=s(Wd,"PretrainedConfig"),Wd.forEach(t),_m=s(Jo," for more information."),Jo.forEach(t),km=p(St),w(Zo.$$.fragment,St),St.forEach(t),Bd=p(o),oo=r(o,"H2",{class:!0});var Ac=i(oo);en=r(Ac,"A",{id:!0,class:!0,href:!0});var iy=i(en);Yi=r(iy,"SPAN",{});var ly=i(Yi);w(us.$$.fragment,ly),ly.forEach(t),iy.forEach(t),bm=p(Ac),Gi=r(Ac,"SPAN",{});var dy=i(Gi);ym=s(dy,"XLNetTokenizer"),dy.forEach(t),Ac.forEach(t),Kd=p(o),Ge=r(o,"DIV",{class:!0});var kt=i(Ge);w(fs.$$.fragment,kt),Tm=p(kt),gs=r(kt,"P",{});var Pc=i(gs);wm=s(Pc,"Construct an XLNet tokenizer. Based on "),_s=r(Pc,"A",{href:!0,rel:!0});var cy=i(_s);vm=s(cy,"SentencePiece"),cy.forEach(t),Nm=s(Pc,"."),Pc.forEach(t),$m=p(kt),ks=r(kt,"P",{});var Sc=i(ks);xm=s(Sc,"This tokenizer inherits from "),Sr=r(Sc,"A",{href:!0});var py=i(Sr);Lm=s(py,"PreTrainedTokenizer"),py.forEach(t),Fm=s(Sc,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),Sc.forEach(t),Xm=p(kt),It=r(kt,"DIV",{class:!0});var Xi=i(It);w(bs.$$.fragment,Xi),qm=p(Xi),Ji=r(Xi,"P",{});var my=i(Ji);zm=s(my,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLNet sequence has the following format:`),my.forEach(t),Mm=p(Xi),ys=r(Xi,"UL",{});var Dc=i(ys);Dr=r(Dc,"LI",{});var ny=i(Dr);Em=s(ny,"single sequence: "),Zi=r(ny,"CODE",{});var hy=i(Zi);Cm=s(hy,"X <sep> <cls>"),hy.forEach(t),ny.forEach(t),jm=p(Dc),Ir=r(Dc,"LI",{});var sy=i(Ir);Om=s(sy,"pair of sequences: "),el=r(sy,"CODE",{});var uy=i(el);Am=s(uy,"A <sep> B <sep> <cls>"),uy.forEach(t),sy.forEach(t),Dc.forEach(t),Xi.forEach(t),Pm=p(kt),tn=r(kt,"DIV",{class:!0});var Ic=i(tn);w(Ts.$$.fragment,Ic),Sm=p(Ic),ws=r(Ic,"P",{});var Hc=i(ws);Dm=s(Hc,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),tl=r(Hc,"CODE",{});var fy=i(tl);Im=s(fy,"prepare_for_model"),fy.forEach(t),Hm=s(Hc," method."),Hc.forEach(t),Ic.forEach(t),Qm=p(kt),bt=r(kt,"DIV",{class:!0});var os=i(bt);w(vs.$$.fragment,os),Um=p(os),ol=r(os,"P",{});var gy=i(ol);Wm=s(gy,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLNet"),gy.forEach(t),Bm=p(os),w(on.$$.fragment,os),Km=p(os),no=r(os,"P",{});var qi=i(no);Rm=s(qi,"If "),nl=r(qi,"CODE",{});var _y=i(nl);Vm=s(_y,"token_ids_1"),_y.forEach(t),Ym=s(qi," is "),sl=r(qi,"CODE",{});var ky=i(sl);Gm=s(ky,"None"),ky.forEach(t),Jm=s(qi,", this method only returns the first portion of the mask (0s)."),qi.forEach(t),os.forEach(t),Zm=p(kt),Hr=r(kt,"DIV",{class:!0});var by=i(Hr);w(Ns.$$.fragment,by),by.forEach(t),kt.forEach(t),Rd=p(o),so=r(o,"H2",{class:!0});var Qc=i(so);nn=r(Qc,"A",{id:!0,class:!0,href:!0});var yy=i(nn);al=r(yy,"SPAN",{});var Ty=i(al);w($s.$$.fragment,Ty),Ty.forEach(t),yy.forEach(t),eh=p(Qc),rl=r(Qc,"SPAN",{});var wy=i(rl);th=s(wy,"XLNetTokenizerFast"),wy.forEach(t),Qc.forEach(t),Vd=p(o),rt=r(o,"DIV",{class:!0});var Qt=i(rt);w(xs.$$.fragment,Qt),oh=p(Qt),ao=r(Qt,"P",{});var zi=i(ao);nh=s(zi,"Construct a \u201Cfast\u201D XLNet tokenizer (backed by HuggingFace\u2019s "),il=r(zi,"EM",{});var vy=i(il);sh=s(vy,"tokenizers"),vy.forEach(t),ah=s(zi,` library). Based on
`),Ls=r(zi,"A",{href:!0,rel:!0});var Ny=i(Ls);rh=s(Ny,"Unigram"),Ny.forEach(t),ih=s(zi,"."),zi.forEach(t),lh=p(Qt),Fs=r(Qt,"P",{});var Uc=i(Fs);dh=s(Uc,"This tokenizer inherits from "),Qr=r(Uc,"A",{href:!0});var $y=i(Qr);ch=s($y,"PreTrainedTokenizerFast"),$y.forEach(t),ph=s(Uc,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),Uc.forEach(t),mh=p(Qt),Ht=r(Qt,"DIV",{class:!0});var Mi=i(Ht);w(Xs.$$.fragment,Mi),hh=p(Mi),ll=r(Mi,"P",{});var xy=i(ll);uh=s(xy,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLNet sequence has the following format:`),xy.forEach(t),fh=p(Mi),qs=r(Mi,"UL",{});var Wc=i(qs);Ur=r(Wc,"LI",{});var ay=i(Ur);gh=s(ay,"single sequence: "),dl=r(ay,"CODE",{});var Ly=i(dl);_h=s(Ly,"X <sep> <cls>"),Ly.forEach(t),ay.forEach(t),kh=p(Wc),Wr=r(Wc,"LI",{});var ry=i(Wr);bh=s(ry,"pair of sequences: "),cl=r(ry,"CODE",{});var Fy=i(cl);yh=s(Fy,"A <sep> B <sep> <cls>"),Fy.forEach(t),ry.forEach(t),Wc.forEach(t),Mi.forEach(t),Th=p(Qt),yt=r(Qt,"DIV",{class:!0});var ns=i(yt);w(zs.$$.fragment,ns),wh=p(ns),pl=r(ns,"P",{});var Xy=i(pl);vh=s(Xy,"Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLNet"),Xy.forEach(t),Nh=p(ns),w(sn.$$.fragment,ns),$h=p(ns),ro=r(ns,"P",{});var Ei=i(ro);xh=s(Ei,"If "),ml=r(Ei,"CODE",{});var qy=i(ml);Lh=s(qy,"token_ids_1"),qy.forEach(t),Fh=s(Ei," is "),hl=r(Ei,"CODE",{});var zy=i(hl);Xh=s(zy,"None"),zy.forEach(t),qh=s(Ei,", this method only returns the first portion of the mask (0s)."),Ei.forEach(t),ns.forEach(t),Qt.forEach(t),Yd=p(o),io=r(o,"H2",{class:!0});var Bc=i(io);an=r(Bc,"A",{id:!0,class:!0,href:!0});var My=i(an);ul=r(My,"SPAN",{});var Ey=i(ul);w(Ms.$$.fragment,Ey),Ey.forEach(t),My.forEach(t),zh=p(Bc),fl=r(Bc,"SPAN",{});var Cy=i(fl);Mh=s(Cy,"XLNet specific outputs"),Cy.forEach(t),Bc.forEach(t),Gd=p(o),lo=r(o,"DIV",{class:!0});var Kc=i(lo);w(Es.$$.fragment,Kc),Eh=p(Kc),Cs=r(Kc,"P",{});var Rc=i(Cs);Ch=s(Rc,"Output type of "),Br=r(Rc,"A",{href:!0});var jy=i(Br);jh=s(jy,"XLNetModel"),jy.forEach(t),Oh=s(Rc,"."),Rc.forEach(t),Kc.forEach(t),Jd=p(o),co=r(o,"DIV",{class:!0});var Vc=i(co);w(js.$$.fragment,Vc),Ah=p(Vc),Os=r(Vc,"P",{});var Yc=i(Os);Ph=s(Yc,"Output type of "),Kr=r(Yc,"A",{href:!0});var Oy=i(Kr);Sh=s(Oy,"XLNetLMHeadModel"),Oy.forEach(t),Dh=s(Yc,"."),Yc.forEach(t),Vc.forEach(t),Zd=p(o),po=r(o,"DIV",{class:!0});var Gc=i(po);w(As.$$.fragment,Gc),Ih=p(Gc),Ps=r(Gc,"P",{});var Jc=i(Ps);Hh=s(Jc,"Output type of "),Rr=r(Jc,"A",{href:!0});var Ay=i(Rr);Qh=s(Ay,"XLNetForSequenceClassification"),Ay.forEach(t),Uh=s(Jc,"."),Jc.forEach(t),Gc.forEach(t),ec=p(o),mo=r(o,"DIV",{class:!0});var Zc=i(mo);w(Ss.$$.fragment,Zc),Wh=p(Zc),Ds=r(Zc,"P",{});var ep=i(Ds);Bh=s(ep,"Output type of "),Vr=r(ep,"A",{href:!0});var Py=i(Vr);Kh=s(Py,"XLNetForMultipleChoice"),Py.forEach(t),Rh=s(ep,"."),ep.forEach(t),Zc.forEach(t),tc=p(o),ho=r(o,"DIV",{class:!0});var tp=i(ho);w(Is.$$.fragment,tp),Vh=p(tp),Hs=r(tp,"P",{});var op=i(Hs);Yh=s(op,"Output type of "),gl=r(op,"CODE",{});var Sy=i(gl);Gh=s(Sy,"XLNetForTokenClassificationOutput"),Sy.forEach(t),Jh=s(op,"."),op.forEach(t),tp.forEach(t),oc=p(o),uo=r(o,"DIV",{class:!0});var np=i(uo);w(Qs.$$.fragment,np),Zh=p(np),Us=r(np,"P",{});var sp=i(Us);eu=s(sp,"Output type of "),Yr=r(sp,"A",{href:!0});var Dy=i(Yr);tu=s(Dy,"XLNetForQuestionAnsweringSimple"),Dy.forEach(t),ou=s(sp,"."),sp.forEach(t),np.forEach(t),nc=p(o),fo=r(o,"DIV",{class:!0});var ap=i(fo);w(Ws.$$.fragment,ap),nu=p(ap),Bs=r(ap,"P",{});var rp=i(Bs);su=s(rp,"Output type of "),Gr=r(rp,"A",{href:!0});var Iy=i(Gr);au=s(Iy,"XLNetForQuestionAnswering"),Iy.forEach(t),ru=s(rp,"."),rp.forEach(t),ap.forEach(t),sc=p(o),go=r(o,"DIV",{class:!0});var ip=i(go);w(Ks.$$.fragment,ip),iu=p(ip),Rs=r(ip,"P",{});var lp=i(Rs);lu=s(lp,"Output type of "),Jr=r(lp,"A",{href:!0});var Hy=i(Jr);du=s(Hy,"TFXLNetModel"),Hy.forEach(t),cu=s(lp,"."),lp.forEach(t),ip.forEach(t),ac=p(o),_o=r(o,"DIV",{class:!0});var dp=i(_o);w(Vs.$$.fragment,dp),pu=p(dp),Ys=r(dp,"P",{});var cp=i(Ys);mu=s(cp,"Output type of "),Zr=r(cp,"A",{href:!0});var Qy=i(Zr);hu=s(Qy,"TFXLNetLMHeadModel"),Qy.forEach(t),uu=s(cp,"."),cp.forEach(t),dp.forEach(t),rc=p(o),ko=r(o,"DIV",{class:!0});var pp=i(ko);w(Gs.$$.fragment,pp),fu=p(pp),Js=r(pp,"P",{});var mp=i(Js);gu=s(mp,"Output type of "),ei=r(mp,"A",{href:!0});var Uy=i(ei);_u=s(Uy,"TFXLNetForSequenceClassification"),Uy.forEach(t),ku=s(mp,"."),mp.forEach(t),pp.forEach(t),ic=p(o),bo=r(o,"DIV",{class:!0});var hp=i(bo);w(Zs.$$.fragment,hp),bu=p(hp),ea=r(hp,"P",{});var up=i(ea);yu=s(up,"Output type of "),ti=r(up,"A",{href:!0});var Wy=i(ti);Tu=s(Wy,"TFXLNetForMultipleChoice"),Wy.forEach(t),wu=s(up,"."),up.forEach(t),hp.forEach(t),lc=p(o),yo=r(o,"DIV",{class:!0});var fp=i(yo);w(ta.$$.fragment,fp),vu=p(fp),oa=r(fp,"P",{});var gp=i(oa);Nu=s(gp,"Output type of "),_l=r(gp,"CODE",{});var By=i(_l);$u=s(By,"TFXLNetForTokenClassificationOutput"),By.forEach(t),xu=s(gp,"."),gp.forEach(t),fp.forEach(t),dc=p(o),To=r(o,"DIV",{class:!0});var _p=i(To);w(na.$$.fragment,_p),Lu=p(_p),sa=r(_p,"P",{});var kp=i(sa);Fu=s(kp,"Output type of "),oi=r(kp,"A",{href:!0});var Ky=i(oi);Xu=s(Ky,"TFXLNetForQuestionAnsweringSimple"),Ky.forEach(t),qu=s(kp,"."),kp.forEach(t),_p.forEach(t),cc=p(o),wo=r(o,"H2",{class:!0});var bp=i(wo);rn=r(bp,"A",{id:!0,class:!0,href:!0});var Ry=i(rn);kl=r(Ry,"SPAN",{});var Vy=i(kl);w(aa.$$.fragment,Vy),Vy.forEach(t),Ry.forEach(t),zu=p(bp),bl=r(bp,"SPAN",{});var Yy=i(bl);Mu=s(Yy,"XLNetModel"),Yy.forEach(t),bp.forEach(t),pc=p(o),it=r(o,"DIV",{class:!0});var Ut=i(it);w(ra.$$.fragment,Ut),Eu=p(Ut),yl=r(Ut,"P",{});var Gy=i(yl);Cu=s(Gy,"The bare XLNet Model transformer outputting raw hidden-states without any specific head on top."),Gy.forEach(t),ju=p(Ut),ia=r(Ut,"P",{});var yp=i(ia);Ou=s(yp,"This model inherits from "),ni=r(yp,"A",{href:!0});var Jy=i(ni);Au=s(Jy,"PreTrainedModel"),Jy.forEach(t),Pu=s(yp,`. 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.)`),yp.forEach(t),Su=p(Ut),la=r(Ut,"P",{});var Tp=i(la);Du=s(Tp,"This model is also a PyTorch "),da=r(Tp,"A",{href:!0,rel:!0});var Zy=i(da);Iu=s(Zy,"torch.nn.Module"),Zy.forEach(t),Hu=s(Tp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Tp.forEach(t),Qu=p(Ut),Tt=r(Ut,"DIV",{class:!0});var ss=i(Tt);w(ca.$$.fragment,ss),Uu=p(ss),vo=r(ss,"P",{});var Ci=i(vo);Wu=s(Ci,"The "),si=r(Ci,"A",{href:!0});var eT=i(si);Bu=s(eT,"XLNetModel"),eT.forEach(t),Ku=s(Ci," forward method, overrides the "),Tl=r(Ci,"CODE",{});var tT=i(Tl);Ru=s(tT,"__call__"),tT.forEach(t),Vu=s(Ci," special method."),Ci.forEach(t),Yu=p(ss),w(ln.$$.fragment,ss),Gu=p(ss),w(dn.$$.fragment,ss),ss.forEach(t),Ut.forEach(t),mc=p(o),No=r(o,"H2",{class:!0});var wp=i(No);cn=r(wp,"A",{id:!0,class:!0,href:!0});var oT=i(cn);wl=r(oT,"SPAN",{});var nT=i(wl);w(pa.$$.fragment,nT),nT.forEach(t),oT.forEach(t),Ju=p(wp),vl=r(wp,"SPAN",{});var sT=i(vl);Zu=s(sT,"XLNetLMHeadModel"),sT.forEach(t),wp.forEach(t),hc=p(o),lt=r(o,"DIV",{class:!0});var Wt=i(lt);w(ma.$$.fragment,Wt),ef=p(Wt),Nl=r(Wt,"P",{});var aT=i(Nl);tf=s(aT,"XLNet Model with a language modeling head on top (linear layer with weights tied to the input embeddings)."),aT.forEach(t),of=p(Wt),ha=r(Wt,"P",{});var vp=i(ha);nf=s(vp,"This model inherits from "),ai=r(vp,"A",{href:!0});var rT=i(ai);sf=s(rT,"PreTrainedModel"),rT.forEach(t),af=s(vp,`. 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.)`),vp.forEach(t),rf=p(Wt),ua=r(Wt,"P",{});var Np=i(ua);lf=s(Np,"This model is also a PyTorch "),fa=r(Np,"A",{href:!0,rel:!0});var iT=i(fa);df=s(iT,"torch.nn.Module"),iT.forEach(t),cf=s(Np,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Np.forEach(t),pf=p(Wt),wt=r(Wt,"DIV",{class:!0});var as=i(wt);w(ga.$$.fragment,as),mf=p(as),$o=r(as,"P",{});var ji=i($o);hf=s(ji,"The "),ri=r(ji,"A",{href:!0});var lT=i(ri);uf=s(lT,"XLNetLMHeadModel"),lT.forEach(t),ff=s(ji," forward method, overrides the "),$l=r(ji,"CODE",{});var dT=i($l);gf=s(dT,"__call__"),dT.forEach(t),_f=s(ji," special method."),ji.forEach(t),kf=p(as),w(pn.$$.fragment,as),bf=p(as),w(mn.$$.fragment,as),as.forEach(t),Wt.forEach(t),uc=p(o),xo=r(o,"H2",{class:!0});var $p=i(xo);hn=r($p,"A",{id:!0,class:!0,href:!0});var cT=i(hn);xl=r(cT,"SPAN",{});var pT=i(xl);w(_a.$$.fragment,pT),pT.forEach(t),cT.forEach(t),yf=p($p),Ll=r($p,"SPAN",{});var mT=i(Ll);Tf=s(mT,"XLNetForSequenceClassification"),mT.forEach(t),$p.forEach(t),fc=p(o),dt=r(o,"DIV",{class:!0});var Bt=i(dt);w(ka.$$.fragment,Bt),wf=p(Bt),Fl=r(Bt,"P",{});var hT=i(Fl);vf=s(hT,`XLNet Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),hT.forEach(t),Nf=p(Bt),ba=r(Bt,"P",{});var xp=i(ba);$f=s(xp,"This model inherits from "),ii=r(xp,"A",{href:!0});var uT=i(ii);xf=s(uT,"PreTrainedModel"),uT.forEach(t),Lf=s(xp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),xp.forEach(t),Ff=p(Bt),ya=r(Bt,"P",{});var Lp=i(ya);Xf=s(Lp,"This model is also a PyTorch "),Ta=r(Lp,"A",{href:!0,rel:!0});var fT=i(Ta);qf=s(fT,"torch.nn.Module"),fT.forEach(t),zf=s(Lp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Lp.forEach(t),Mf=p(Bt),ut=r(Bt,"DIV",{class:!0});var Kt=i(ut);w(wa.$$.fragment,Kt),Ef=p(Kt),Lo=r(Kt,"P",{});var Oi=i(Lo);Cf=s(Oi,"The "),li=r(Oi,"A",{href:!0});var gT=i(li);jf=s(gT,"XLNetForSequenceClassification"),gT.forEach(t),Of=s(Oi," forward method, overrides the "),Xl=r(Oi,"CODE",{});var _T=i(Xl);Af=s(_T,"__call__"),_T.forEach(t),Pf=s(Oi," special method."),Oi.forEach(t),Sf=p(Kt),w(un.$$.fragment,Kt),Df=p(Kt),w(fn.$$.fragment,Kt),If=p(Kt),w(gn.$$.fragment,Kt),Kt.forEach(t),Bt.forEach(t),gc=p(o),Fo=r(o,"H2",{class:!0});var Fp=i(Fo);_n=r(Fp,"A",{id:!0,class:!0,href:!0});var kT=i(_n);ql=r(kT,"SPAN",{});var bT=i(ql);w(va.$$.fragment,bT),bT.forEach(t),kT.forEach(t),Hf=p(Fp),zl=r(Fp,"SPAN",{});var yT=i(zl);Qf=s(yT,"XLNetForMultipleChoice"),yT.forEach(t),Fp.forEach(t),_c=p(o),ct=r(o,"DIV",{class:!0});var Rt=i(ct);w(Na.$$.fragment,Rt),Uf=p(Rt),Ml=r(Rt,"P",{});var TT=i(Ml);Wf=s(TT,`XLNet Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
softmax) e.g. for RACE/SWAG tasks.`),TT.forEach(t),Bf=p(Rt),$a=r(Rt,"P",{});var Xp=i($a);Kf=s(Xp,"This model inherits from "),di=r(Xp,"A",{href:!0});var wT=i(di);Rf=s(wT,"PreTrainedModel"),wT.forEach(t),Vf=s(Xp,`. Check the superclass documentation for the generic methods the
library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
etc.)`),Xp.forEach(t),Yf=p(Rt),xa=r(Rt,"P",{});var qp=i(xa);Gf=s(qp,"This model is also a PyTorch "),La=r(qp,"A",{href:!0,rel:!0});var vT=i(La);Jf=s(vT,"torch.nn.Module"),vT.forEach(t),Zf=s(qp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),qp.forEach(t),eg=p(Rt),vt=r(Rt,"DIV",{class:!0});var rs=i(vt);w(Fa.$$.fragment,rs),tg=p(rs),Xo=r(rs,"P",{});var Ai=i(Xo);og=s(Ai,"The "),ci=r(Ai,"A",{href:!0});var NT=i(ci);ng=s(NT,"XLNetForMultipleChoice"),NT.forEach(t),sg=s(Ai," forward method, overrides the "),El=r(Ai,"CODE",{});var $T=i(El);ag=s($T,"__call__"),$T.forEach(t),rg=s(Ai," special method."),Ai.forEach(t),ig=p(rs),w(kn.$$.fragment,rs),lg=p(rs),w(bn.$$.fragment,rs),rs.forEach(t),Rt.forEach(t),kc=p(o),qo=r(o,"H2",{class:!0});var zp=i(qo);yn=r(zp,"A",{id:!0,class:!0,href:!0});var xT=i(yn);Cl=r(xT,"SPAN",{});var LT=i(Cl);w(Xa.$$.fragment,LT),LT.forEach(t),xT.forEach(t),dg=p(zp),jl=r(zp,"SPAN",{});var FT=i(jl);cg=s(FT,"XLNetForTokenClassification"),FT.forEach(t),zp.forEach(t),bc=p(o),pt=r(o,"DIV",{class:!0});var Vt=i(pt);w(qa.$$.fragment,Vt),pg=p(Vt),Ol=r(Vt,"P",{});var XT=i(Ol);mg=s(XT,`XLNet Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),XT.forEach(t),hg=p(Vt),za=r(Vt,"P",{});var Mp=i(za);ug=s(Mp,"This model inherits from "),pi=r(Mp,"A",{href:!0});var qT=i(pi);fg=s(qT,"PreTrainedModel"),qT.forEach(t),gg=s(Mp,`. 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.)`),Mp.forEach(t),_g=p(Vt),Ma=r(Vt,"P",{});var Ep=i(Ma);kg=s(Ep,"This model is also a PyTorch "),Ea=r(Ep,"A",{href:!0,rel:!0});var zT=i(Ea);bg=s(zT,"torch.nn.Module"),zT.forEach(t),yg=s(Ep,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Ep.forEach(t),Tg=p(Vt),Nt=r(Vt,"DIV",{class:!0});var is=i(Nt);w(Ca.$$.fragment,is),wg=p(is),zo=r(is,"P",{});var Pi=i(zo);vg=s(Pi,"The "),mi=r(Pi,"A",{href:!0});var MT=i(mi);Ng=s(MT,"XLNetForTokenClassification"),MT.forEach(t),$g=s(Pi," forward method, overrides the "),Al=r(Pi,"CODE",{});var ET=i(Al);xg=s(ET,"__call__"),ET.forEach(t),Lg=s(Pi," special method."),Pi.forEach(t),Fg=p(is),w(Tn.$$.fragment,is),Xg=p(is),w(wn.$$.fragment,is),is.forEach(t),Vt.forEach(t),yc=p(o),Mo=r(o,"H2",{class:!0});var Cp=i(Mo);vn=r(Cp,"A",{id:!0,class:!0,href:!0});var CT=i(vn);Pl=r(CT,"SPAN",{});var jT=i(Pl);w(ja.$$.fragment,jT),jT.forEach(t),CT.forEach(t),qg=p(Cp),Sl=r(Cp,"SPAN",{});var OT=i(Sl);zg=s(OT,"XLNetForQuestionAnsweringSimple"),OT.forEach(t),Cp.forEach(t),Tc=p(o),mt=r(o,"DIV",{class:!0});var Yt=i(mt);w(Oa.$$.fragment,Yt),Mg=p(Yt),Eo=r(Yt,"P",{});var Si=i(Eo);Eg=s(Si,`XLNet 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 `),Dl=r(Si,"CODE",{});var AT=i(Dl);Cg=s(AT,"span start logits"),AT.forEach(t),jg=s(Si," and "),Il=r(Si,"CODE",{});var PT=i(Il);Og=s(PT,"span end logits"),PT.forEach(t),Ag=s(Si,")."),Si.forEach(t),Pg=p(Yt),Aa=r(Yt,"P",{});var jp=i(Aa);Sg=s(jp,"This model inherits from "),hi=r(jp,"A",{href:!0});var ST=i(hi);Dg=s(ST,"PreTrainedModel"),ST.forEach(t),Ig=s(jp,`. 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.)`),jp.forEach(t),Hg=p(Yt),Pa=r(Yt,"P",{});var Op=i(Pa);Qg=s(Op,"This model is also a PyTorch "),Sa=r(Op,"A",{href:!0,rel:!0});var DT=i(Sa);Ug=s(DT,"torch.nn.Module"),DT.forEach(t),Wg=s(Op,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Op.forEach(t),Bg=p(Yt),$t=r(Yt,"DIV",{class:!0});var ls=i($t);w(Da.$$.fragment,ls),Kg=p(ls),Co=r(ls,"P",{});var Di=i(Co);Rg=s(Di,"The "),ui=r(Di,"A",{href:!0});var IT=i(ui);Vg=s(IT,"XLNetForQuestionAnsweringSimple"),IT.forEach(t),Yg=s(Di," forward method, overrides the "),Hl=r(Di,"CODE",{});var HT=i(Hl);Gg=s(HT,"__call__"),HT.forEach(t),Jg=s(Di," special method."),Di.forEach(t),Zg=p(ls),w(Nn.$$.fragment,ls),e_=p(ls),w($n.$$.fragment,ls),ls.forEach(t),Yt.forEach(t),wc=p(o),jo=r(o,"H2",{class:!0});var Ap=i(jo);xn=r(Ap,"A",{id:!0,class:!0,href:!0});var QT=i(xn);Ql=r(QT,"SPAN",{});var UT=i(Ql);w(Ia.$$.fragment,UT),UT.forEach(t),QT.forEach(t),t_=p(Ap),Ul=r(Ap,"SPAN",{});var WT=i(Ul);o_=s(WT,"XLNetForQuestionAnswering"),WT.forEach(t),Ap.forEach(t),vc=p(o),ht=r(o,"DIV",{class:!0});var Gt=i(ht);w(Ha.$$.fragment,Gt),n_=p(Gt),Oo=r(Gt,"P",{});var Ii=i(Oo);s_=s(Ii,`XLNet 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 `),Wl=r(Ii,"CODE",{});var BT=i(Wl);a_=s(BT,"span start logits"),BT.forEach(t),r_=s(Ii," and "),Bl=r(Ii,"CODE",{});var KT=i(Bl);i_=s(KT,"span end logits"),KT.forEach(t),l_=s(Ii,")."),Ii.forEach(t),d_=p(Gt),Qa=r(Gt,"P",{});var Pp=i(Qa);c_=s(Pp,"This model inherits from "),fi=r(Pp,"A",{href:!0});var RT=i(fi);p_=s(RT,"PreTrainedModel"),RT.forEach(t),m_=s(Pp,`. 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.)`),Pp.forEach(t),h_=p(Gt),Ua=r(Gt,"P",{});var Sp=i(Ua);u_=s(Sp,"This model is also a PyTorch "),Wa=r(Sp,"A",{href:!0,rel:!0});var VT=i(Wa);f_=s(VT,"torch.nn.Module"),VT.forEach(t),g_=s(Sp,` subclass.
Use it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage
and behavior.`),Sp.forEach(t),__=p(Gt),xt=r(Gt,"DIV",{class:!0});var ds=i(xt);w(Ba.$$.fragment,ds),k_=p(ds),Ao=r(ds,"P",{});var Hi=i(Ao);b_=s(Hi,"The "),gi=r(Hi,"A",{href:!0});var YT=i(gi);y_=s(YT,"XLNetForQuestionAnswering"),YT.forEach(t),T_=s(Hi," forward method, overrides the "),Kl=r(Hi,"CODE",{});var GT=i(Kl);w_=s(GT,"__call__"),GT.forEach(t),v_=s(Hi," special method."),Hi.forEach(t),N_=p(ds),w(Ln.$$.fragment,ds),$_=p(ds),w(Fn.$$.fragment,ds),ds.forEach(t),Gt.forEach(t),Nc=p(o),Po=r(o,"H2",{class:!0});var Dp=i(Po);Xn=r(Dp,"A",{id:!0,class:!0,href:!0});var JT=i(Xn);Rl=r(JT,"SPAN",{});var ZT=i(Rl);w(Ka.$$.fragment,ZT),ZT.forEach(t),JT.forEach(t),x_=p(Dp),Vl=r(Dp,"SPAN",{});var ew=i(Vl);L_=s(ew,"TFXLNetModel"),ew.forEach(t),Dp.forEach(t),$c=p(o),et=r(o,"DIV",{class:!0});var qt=i(et);w(Ra.$$.fragment,qt),F_=p(qt),Yl=r(qt,"P",{});var tw=i(Yl);X_=s(tw,"The bare XLNet Model transformer outputting raw hidden-states without any specific head on top."),tw.forEach(t),q_=p(qt),Va=r(qt,"P",{});var Ip=i(Va);z_=s(Ip,"This model inherits from "),_i=r(Ip,"A",{href:!0});var ow=i(_i);M_=s(ow,"TFPreTrainedModel"),ow.forEach(t),E_=s(Ip,`. 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.forEach(t),C_=p(qt),Ya=r(qt,"P",{});var Hp=i(Ya);j_=s(Hp,"This model is also a "),Ga=r(Hp,"A",{href:!0,rel:!0});var nw=i(Ga);O_=s(nw,"tf.keras.Model"),nw.forEach(t),A_=s(Hp,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Hp.forEach(t),P_=p(qt),w(qn.$$.fragment,qt),S_=p(qt),Lt=r(qt,"DIV",{class:!0});var cs=i(Lt);w(Ja.$$.fragment,cs),D_=p(cs),So=r(cs,"P",{});var Qi=i(So);I_=s(Qi,"The "),ki=r(Qi,"A",{href:!0});var sw=i(ki);H_=s(sw,"TFXLNetModel"),sw.forEach(t),Q_=s(Qi," forward method, overrides the "),Gl=r(Qi,"CODE",{});var aw=i(Gl);U_=s(aw,"__call__"),aw.forEach(t),W_=s(Qi," special method."),Qi.forEach(t),B_=p(cs),w(zn.$$.fragment,cs),K_=p(cs),w(Mn.$$.fragment,cs),cs.forEach(t),qt.forEach(t),xc=p(o),Do=r(o,"H2",{class:!0});var Qp=i(Do);En=r(Qp,"A",{id:!0,class:!0,href:!0});var rw=i(En);Jl=r(rw,"SPAN",{});var iw=i(Jl);w(Za.$$.fragment,iw),iw.forEach(t),rw.forEach(t),R_=p(Qp),Zl=r(Qp,"SPAN",{});var lw=i(Zl);V_=s(lw,"TFXLNetLMHeadModel"),lw.forEach(t),Qp.forEach(t),Lc=p(o),tt=r(o,"DIV",{class:!0});var zt=i(tt);w(er.$$.fragment,zt),Y_=p(zt),ed=r(zt,"P",{});var dw=i(ed);G_=s(dw,"XLNet Model with a language modeling head on top (linear layer with weights tied to the input embeddings)."),dw.forEach(t),J_=p(zt),tr=r(zt,"P",{});var Up=i(tr);Z_=s(Up,"This model inherits from "),bi=r(Up,"A",{href:!0});var cw=i(bi);ek=s(cw,"TFPreTrainedModel"),cw.forEach(t),tk=s(Up,`. 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.)`),Up.forEach(t),ok=p(zt),or=r(zt,"P",{});var Wp=i(or);nk=s(Wp,"This model is also a "),nr=r(Wp,"A",{href:!0,rel:!0});var pw=i(nr);sk=s(pw,"tf.keras.Model"),pw.forEach(t),ak=s(Wp,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Wp.forEach(t),rk=p(zt),w(Cn.$$.fragment,zt),ik=p(zt),Ft=r(zt,"DIV",{class:!0});var ps=i(Ft);w(sr.$$.fragment,ps),lk=p(ps),Io=r(ps,"P",{});var Ui=i(Io);dk=s(Ui,"The "),yi=r(Ui,"A",{href:!0});var mw=i(yi);ck=s(mw,"TFXLNetLMHeadModel"),mw.forEach(t),pk=s(Ui," forward method, overrides the "),td=r(Ui,"CODE",{});var hw=i(td);mk=s(hw,"__call__"),hw.forEach(t),hk=s(Ui," special method."),Ui.forEach(t),uk=p(ps),w(jn.$$.fragment,ps),fk=p(ps),w(On.$$.fragment,ps),ps.forEach(t),zt.forEach(t),Fc=p(o),Ho=r(o,"H2",{class:!0});var Bp=i(Ho);An=r(Bp,"A",{id:!0,class:!0,href:!0});var uw=i(An);od=r(uw,"SPAN",{});var fw=i(od);w(ar.$$.fragment,fw),fw.forEach(t),uw.forEach(t),gk=p(Bp),nd=r(Bp,"SPAN",{});var gw=i(nd);_k=s(gw,"TFXLNetForSequenceClassification"),gw.forEach(t),Bp.forEach(t),Xc=p(o),ot=r(o,"DIV",{class:!0});var Mt=i(ot);w(rr.$$.fragment,Mt),kk=p(Mt),sd=r(Mt,"P",{});var _w=i(sd);bk=s(_w,`XLNet Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
for GLUE tasks.`),_w.forEach(t),yk=p(Mt),ir=r(Mt,"P",{});var Kp=i(ir);Tk=s(Kp,"This model inherits from "),Ti=r(Kp,"A",{href:!0});var kw=i(Ti);wk=s(kw,"TFPreTrainedModel"),kw.forEach(t),vk=s(Kp,`. 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.)`),Kp.forEach(t),Nk=p(Mt),lr=r(Mt,"P",{});var Rp=i(lr);$k=s(Rp,"This model is also a "),dr=r(Rp,"A",{href:!0,rel:!0});var bw=i(dr);xk=s(bw,"tf.keras.Model"),bw.forEach(t),Lk=s(Rp,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Rp.forEach(t),Fk=p(Mt),w(Pn.$$.fragment,Mt),Xk=p(Mt),ft=r(Mt,"DIV",{class:!0});var Jt=i(ft);w(cr.$$.fragment,Jt),qk=p(Jt),Qo=r(Jt,"P",{});var Wi=i(Qo);zk=s(Wi,"The "),wi=r(Wi,"A",{href:!0});var yw=i(wi);Mk=s(yw,"TFXLNetForSequenceClassification"),yw.forEach(t),Ek=s(Wi," forward method, overrides the "),ad=r(Wi,"CODE",{});var Tw=i(ad);Ck=s(Tw,"__call__"),Tw.forEach(t),jk=s(Wi," special method."),Wi.forEach(t),Ok=p(Jt),w(Sn.$$.fragment,Jt),Ak=p(Jt),w(Dn.$$.fragment,Jt),Pk=p(Jt),w(In.$$.fragment,Jt),Jt.forEach(t),Mt.forEach(t),qc=p(o),Uo=r(o,"H2",{class:!0});var Vp=i(Uo);Hn=r(Vp,"A",{id:!0,class:!0,href:!0});var ww=i(Hn);rd=r(ww,"SPAN",{});var vw=i(rd);w(pr.$$.fragment,vw),vw.forEach(t),ww.forEach(t),Sk=p(Vp),id=r(Vp,"SPAN",{});var Nw=i(id);Dk=s(Nw,"TFLNetForMultipleChoice"),Nw.forEach(t),Vp.forEach(t),zc=p(o),nt=r(o,"DIV",{class:!0});var Et=i(nt);w(mr.$$.fragment,Et),Ik=p(Et),ld=r(Et,"P",{});var $w=i(ld);Hk=s($w,`XLNET 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.`),$w.forEach(t),Qk=p(Et),hr=r(Et,"P",{});var Yp=i(hr);Uk=s(Yp,"This model inherits from "),vi=r(Yp,"A",{href:!0});var xw=i(vi);Wk=s(xw,"TFPreTrainedModel"),xw.forEach(t),Bk=s(Yp,`. 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.)`),Yp.forEach(t),Kk=p(Et),ur=r(Et,"P",{});var Gp=i(ur);Rk=s(Gp,"This model is also a "),fr=r(Gp,"A",{href:!0,rel:!0});var Lw=i(fr);Vk=s(Lw,"tf.keras.Model"),Lw.forEach(t),Yk=s(Gp,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),Gp.forEach(t),Gk=p(Et),w(Qn.$$.fragment,Et),Jk=p(Et),Xt=r(Et,"DIV",{class:!0});var ms=i(Xt);w(gr.$$.fragment,ms),Zk=p(ms),Wo=r(ms,"P",{});var Bi=i(Wo);eb=s(Bi,"The "),Ni=r(Bi,"A",{href:!0});var Fw=i(Ni);tb=s(Fw,"TFXLNetForMultipleChoice"),Fw.forEach(t),ob=s(Bi," forward method, overrides the "),dd=r(Bi,"CODE",{});var Xw=i(dd);nb=s(Xw,"__call__"),Xw.forEach(t),sb=s(Bi," special method."),Bi.forEach(t),ab=p(ms),w(Un.$$.fragment,ms),rb=p(ms),w(Wn.$$.fragment,ms),ms.forEach(t),Et.forEach(t),Mc=p(o),Bo=r(o,"H2",{class:!0});var Jp=i(Bo);Bn=r(Jp,"A",{id:!0,class:!0,href:!0});var qw=i(Bn);cd=r(qw,"SPAN",{});var zw=i(cd);w(_r.$$.fragment,zw),zw.forEach(t),qw.forEach(t),ib=p(Jp),pd=r(Jp,"SPAN",{});var Mw=i(pd);lb=s(Mw,"TFXLNetForTokenClassification"),Mw.forEach(t),Jp.forEach(t),Ec=p(o),st=r(o,"DIV",{class:!0});var Ct=i(st);w(kr.$$.fragment,Ct),db=p(Ct),md=r(Ct,"P",{});var Ew=i(md);cb=s(Ew,`XLNet Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
Named-Entity-Recognition (NER) tasks.`),Ew.forEach(t),pb=p(Ct),br=r(Ct,"P",{});var Zp=i(br);mb=s(Zp,"This model inherits from "),$i=r(Zp,"A",{href:!0});var Cw=i($i);hb=s(Cw,"TFPreTrainedModel"),Cw.forEach(t),ub=s(Zp,`. 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.)`),Zp.forEach(t),fb=p(Ct),yr=r(Ct,"P",{});var em=i(yr);gb=s(em,"This model is also a "),Tr=r(em,"A",{href:!0,rel:!0});var jw=i(Tr);_b=s(jw,"tf.keras.Model"),jw.forEach(t),kb=s(em,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),em.forEach(t),bb=p(Ct),w(Kn.$$.fragment,Ct),yb=p(Ct),gt=r(Ct,"DIV",{class:!0});var Zt=i(gt);w(wr.$$.fragment,Zt),Tb=p(Zt),Ko=r(Zt,"P",{});var Ki=i(Ko);wb=s(Ki,"The "),xi=r(Ki,"A",{href:!0});var Ow=i(xi);vb=s(Ow,"TFXLNetForTokenClassification"),Ow.forEach(t),Nb=s(Ki," forward method, overrides the "),hd=r(Ki,"CODE",{});var Aw=i(hd);$b=s(Aw,"__call__"),Aw.forEach(t),xb=s(Ki," special method."),Ki.forEach(t),Lb=p(Zt),w(Rn.$$.fragment,Zt),Fb=p(Zt),w(Vn.$$.fragment,Zt),Xb=p(Zt),w(Yn.$$.fragment,Zt),Zt.forEach(t),Ct.forEach(t),Cc=p(o),Ro=r(o,"H2",{class:!0});var tm=i(Ro);Gn=r(tm,"A",{id:!0,class:!0,href:!0});var Pw=i(Gn);ud=r(Pw,"SPAN",{});var Sw=i(ud);w(vr.$$.fragment,Sw),Sw.forEach(t),Pw.forEach(t),qb=p(tm),fd=r(tm,"SPAN",{});var Dw=i(fd);zb=s(Dw,"TFXLNetForQuestionAnsweringSimple"),Dw.forEach(t),tm.forEach(t),jc=p(o),at=r(o,"DIV",{class:!0});var jt=i(at);w(Nr.$$.fragment,jt),Mb=p(jt),Vo=r(jt,"P",{});var Ri=i(Vo);Eb=s(Ri,`XLNet 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 `),gd=r(Ri,"CODE",{});var Iw=i(gd);Cb=s(Iw,"span start logits"),Iw.forEach(t),jb=s(Ri," and "),_d=r(Ri,"CODE",{});var Hw=i(_d);Ob=s(Hw,"span end logits"),Hw.forEach(t),Ab=s(Ri,")."),Ri.forEach(t),Pb=p(jt),$r=r(jt,"P",{});var om=i($r);Sb=s(om,"This model inherits from "),Li=r(om,"A",{href:!0});var Qw=i(Li);Db=s(Qw,"TFPreTrainedModel"),Qw.forEach(t),Ib=s(om,`. 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.)`),om.forEach(t),Hb=p(jt),xr=r(jt,"P",{});var nm=i(xr);Qb=s(nm,"This model is also a "),Lr=r(nm,"A",{href:!0,rel:!0});var Uw=i(Lr);Ub=s(Uw,"tf.keras.Model"),Uw.forEach(t),Wb=s(nm,` subclass. Use it
as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
behavior.`),nm.forEach(t),Bb=p(jt),w(Jn.$$.fragment,jt),Kb=p(jt),_t=r(jt,"DIV",{class:!0});var eo=i(_t);w(Fr.$$.fragment,eo),Rb=p(eo),Yo=r(eo,"P",{});var Vi=i(Yo);Vb=s(Vi,"The "),Fi=r(Vi,"A",{href:!0});var Ww=i(Fi);Yb=s(Ww,"TFXLNetForQuestionAnsweringSimple"),Ww.forEach(t),Gb=s(Vi," forward method, overrides the "),kd=r(Vi,"CODE",{});var Bw=i(kd);Jb=s(Bw,"__call__"),Bw.forEach(t),Zb=s(Vi," special method."),Vi.forEach(t),ey=p(eo),w(Zn.$$.fragment,eo),ty=p(eo),w(es.$$.fragment,eo),oy=p(eo),w(ts.$$.fragment,eo),eo.forEach(t),jt.forEach(t),this.h()},h(){f(d,"name","hf:doc:metadata"),f(d,"content",JSON.stringify(Pv)),f(u,"id","xlnet"),f(u,"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"),f(u,"href","#xlnet"),f(h,"class","relative group"),f(ae,"id","overview"),f(ae,"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"),f(ae,"href","#overview"),f(D,"class","relative group"),f(re,"href","https://arxiv.org/abs/1906.08237"),f(re,"rel","nofollow"),f(X,"href","https://huggingface.co/thomwolf"),f(X,"rel","nofollow"),f(Oe,"href","https://github.com/zihangdai/xlnet/"),f(Oe,"rel","nofollow"),f(je,"id","transformers.XLNetConfig"),f(je,"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"),f(je,"href","#transformers.XLNetConfig"),f(H,"class","relative group"),f(jr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetModel"),f(Or,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetModel"),f(hs,"href","https://huggingface.co/xlnet-large-cased"),f(hs,"rel","nofollow"),f(Ar,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(Pr,"href","/docs/transformers/main/en/main_classes/configuration#transformers.PretrainedConfig"),f(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(en,"id","transformers.XLNetTokenizer"),f(en,"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"),f(en,"href","#transformers.XLNetTokenizer"),f(oo,"class","relative group"),f(_s,"href","https://github.com/google/sentencepiece"),f(_s,"rel","nofollow"),f(Sr,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),f(It,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(tn,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(bt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Hr,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(nn,"id","transformers.XLNetTokenizerFast"),f(nn,"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"),f(nn,"href","#transformers.XLNetTokenizerFast"),f(so,"class","relative group"),f(Ls,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=unigram#models"),f(Ls,"rel","nofollow"),f(Qr,"href","/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),f(Ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(yt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(rt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(an,"id","transformers.models.xlnet.modeling_xlnet.XLNetModelOutput"),f(an,"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"),f(an,"href","#transformers.models.xlnet.modeling_xlnet.XLNetModelOutput"),f(io,"class","relative group"),f(Br,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetModel"),f(lo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Kr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetLMHeadModel"),f(co,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Rr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForSequenceClassification"),f(po,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Vr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForMultipleChoice"),f(mo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ho,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Yr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForQuestionAnsweringSimple"),f(uo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Gr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForQuestionAnswering"),f(fo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Jr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetModel"),f(go,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Zr,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetLMHeadModel"),f(_o,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ei,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetForSequenceClassification"),f(ko,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ti,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetForMultipleChoice"),f(bo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(yo,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(oi,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetForQuestionAnsweringSimple"),f(To,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(rn,"id","transformers.XLNetModel"),f(rn,"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"),f(rn,"href","#transformers.XLNetModel"),f(wo,"class","relative group"),f(ni,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(da,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(da,"rel","nofollow"),f(si,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetModel"),f(Tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(it,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(cn,"id","transformers.XLNetLMHeadModel"),f(cn,"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"),f(cn,"href","#transformers.XLNetLMHeadModel"),f(No,"class","relative group"),f(ai,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(fa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(fa,"rel","nofollow"),f(ri,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetLMHeadModel"),f(wt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(hn,"id","transformers.XLNetForSequenceClassification"),f(hn,"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"),f(hn,"href","#transformers.XLNetForSequenceClassification"),f(xo,"class","relative group"),f(ii,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(Ta,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Ta,"rel","nofollow"),f(li,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForSequenceClassification"),f(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(_n,"id","transformers.XLNetForMultipleChoice"),f(_n,"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"),f(_n,"href","#transformers.XLNetForMultipleChoice"),f(Fo,"class","relative group"),f(di,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(La,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(La,"rel","nofollow"),f(ci,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForMultipleChoice"),f(vt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(yn,"id","transformers.XLNetForTokenClassification"),f(yn,"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"),f(yn,"href","#transformers.XLNetForTokenClassification"),f(qo,"class","relative group"),f(pi,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(Ea,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Ea,"rel","nofollow"),f(mi,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForTokenClassification"),f(Nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(vn,"id","transformers.XLNetForQuestionAnsweringSimple"),f(vn,"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"),f(vn,"href","#transformers.XLNetForQuestionAnsweringSimple"),f(Mo,"class","relative group"),f(hi,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(Sa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Sa,"rel","nofollow"),f(ui,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForQuestionAnsweringSimple"),f($t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(mt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(xn,"id","transformers.XLNetForQuestionAnswering"),f(xn,"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"),f(xn,"href","#transformers.XLNetForQuestionAnswering"),f(jo,"class","relative group"),f(fi,"href","/docs/transformers/main/en/main_classes/model#transformers.PreTrainedModel"),f(Wa,"href","https://pytorch.org/docs/stable/nn.html#torch.nn.Module"),f(Wa,"rel","nofollow"),f(gi,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.XLNetForQuestionAnswering"),f(xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ht,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Xn,"id","transformers.TFXLNetModel"),f(Xn,"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"),f(Xn,"href","#transformers.TFXLNetModel"),f(Po,"class","relative group"),f(_i,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(Ga,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Ga,"rel","nofollow"),f(ki,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetModel"),f(Lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(En,"id","transformers.TFXLNetLMHeadModel"),f(En,"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"),f(En,"href","#transformers.TFXLNetLMHeadModel"),f(Do,"class","relative group"),f(bi,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(nr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(nr,"rel","nofollow"),f(yi,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetLMHeadModel"),f(Ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(An,"id","transformers.TFXLNetForSequenceClassification"),f(An,"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"),f(An,"href","#transformers.TFXLNetForSequenceClassification"),f(Ho,"class","relative group"),f(Ti,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(dr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(dr,"rel","nofollow"),f(wi,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetForSequenceClassification"),f(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(ot,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Hn,"id","transformers.TFXLNetForMultipleChoice"),f(Hn,"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"),f(Hn,"href","#transformers.TFXLNetForMultipleChoice"),f(Uo,"class","relative group"),f(vi,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(fr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(fr,"rel","nofollow"),f(Ni,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetForMultipleChoice"),f(Xt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(nt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Bn,"id","transformers.TFXLNetForTokenClassification"),f(Bn,"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"),f(Bn,"href","#transformers.TFXLNetForTokenClassification"),f(Bo,"class","relative group"),f($i,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(Tr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Tr,"rel","nofollow"),f(xi,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetForTokenClassification"),f(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(Gn,"id","transformers.TFXLNetForQuestionAnsweringSimple"),f(Gn,"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"),f(Gn,"href","#transformers.TFXLNetForQuestionAnsweringSimple"),f(Ro,"class","relative group"),f(Li,"href","/docs/transformers/main/en/main_classes/model#transformers.TFPreTrainedModel"),f(Lr,"href","https://www.tensorflow.org/api_docs/python/tf/keras/Model"),f(Lr,"rel","nofollow"),f(Fi,"href","/docs/transformers/main/en/model_doc/xlnet#transformers.TFXLNetForQuestionAnsweringSimple"),f(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),f(at,"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,_){e(document.head,d),g(o,y,_),g(o,h,_),e(h,u),e(u,b),v(l,b,null),e(h,m),e(h,z),e(z,ke),g(o,me,_),g(o,D,_),e(D,ae),e(ae,ee),v(L,ee,null),e(D,be),e(D,R),e(R,ye),g(o,he,_),g(o,Q,_),e(Q,Te),e(Q,re),e(re,Y),e(Q,we),g(o,ue,_),g(o,B,_),e(B,ve),g(o,fe,_),g(o,K,_),e(K,de),e(de,Ne),g(o,ne,_),g(o,M,_),e(M,E),g(o,ge,_),g(o,A,_),e(A,ie),e(ie,$e),e(ie,V),e(V,xe),e(ie,Le),e(A,C),e(A,le),e(le,G),e(le,ce),e(ce,Fe),e(le,J),e(A,Xe),e(A,te),e(te,I),e(te,pe),e(pe,Z),e(te,qe),e(te,oe),e(oe,j),e(te,ze),e(te,O),e(O,Me),e(te,Ee),e(A,k),e(A,F),e(F,Ie),g(o,se,_),g(o,_e,_),e(_e,He),e(_e,X),e(X,Qe),e(_e,Ue),e(_e,Oe),e(Oe,We),e(_e,Be),g(o,S,_),g(o,H,_),e(H,je),e(je,Pe),v(U,Pe,null),e(H,Ke),e(H,Se),e(Se,Ce),g(o,De,_),g(o,W,_),v(Ae,W,null),e(W,sm),e(W,Ot),e(Ot,am),e(Ot,jr),e(jr,rm),e(Ot,im),e(Ot,Or),e(Or,lm),e(Ot,dm),e(Ot,hs),e(hs,cm),e(Ot,pm),e(W,mm),e(W,to),e(to,hm),e(to,Ar),e(Ar,um),e(to,fm),e(to,Pr),e(Pr,gm),e(to,_m),e(W,km),v(Zo,W,null),g(o,Bd,_),g(o,oo,_),e(oo,en),e(en,Yi),v(us,Yi,null),e(oo,bm),e(oo,Gi),e(Gi,ym),g(o,Kd,_),g(o,Ge,_),v(fs,Ge,null),e(Ge,Tm),e(Ge,gs),e(gs,wm),e(gs,_s),e(_s,vm),e(gs,Nm),e(Ge,$m),e(Ge,ks),e(ks,xm),e(ks,Sr),e(Sr,Lm),e(ks,Fm),e(Ge,Xm),e(Ge,It),v(bs,It,null),e(It,qm),e(It,Ji),e(Ji,zm),e(It,Mm),e(It,ys),e(ys,Dr),e(Dr,Em),e(Dr,Zi),e(Zi,Cm),e(ys,jm),e(ys,Ir),e(Ir,Om),e(Ir,el),e(el,Am),e(Ge,Pm),e(Ge,tn),v(Ts,tn,null),e(tn,Sm),e(tn,ws),e(ws,Dm),e(ws,tl),e(tl,Im),e(ws,Hm),e(Ge,Qm),e(Ge,bt),v(vs,bt,null),e(bt,Um),e(bt,ol),e(ol,Wm),e(bt,Bm),v(on,bt,null),e(bt,Km),e(bt,no),e(no,Rm),e(no,nl),e(nl,Vm),e(no,Ym),e(no,sl),e(sl,Gm),e(no,Jm),e(Ge,Zm),e(Ge,Hr),v(Ns,Hr,null),g(o,Rd,_),g(o,so,_),e(so,nn),e(nn,al),v($s,al,null),e(so,eh),e(so,rl),e(rl,th),g(o,Vd,_),g(o,rt,_),v(xs,rt,null),e(rt,oh),e(rt,ao),e(ao,nh),e(ao,il),e(il,sh),e(ao,ah),e(ao,Ls),e(Ls,rh),e(ao,ih),e(rt,lh),e(rt,Fs),e(Fs,dh),e(Fs,Qr),e(Qr,ch),e(Fs,ph),e(rt,mh),e(rt,Ht),v(Xs,Ht,null),e(Ht,hh),e(Ht,ll),e(ll,uh),e(Ht,fh),e(Ht,qs),e(qs,Ur),e(Ur,gh),e(Ur,dl),e(dl,_h),e(qs,kh),e(qs,Wr),e(Wr,bh),e(Wr,cl),e(cl,yh),e(rt,Th),e(rt,yt),v(zs,yt,null),e(yt,wh),e(yt,pl),e(pl,vh),e(yt,Nh),v(sn,yt,null),e(yt,$h),e(yt,ro),e(ro,xh),e(ro,ml),e(ml,Lh),e(ro,Fh),e(ro,hl),e(hl,Xh),e(ro,qh),g(o,Yd,_),g(o,io,_),e(io,an),e(an,ul),v(Ms,ul,null),e(io,zh),e(io,fl),e(fl,Mh),g(o,Gd,_),g(o,lo,_),v(Es,lo,null),e(lo,Eh),e(lo,Cs),e(Cs,Ch),e(Cs,Br),e(Br,jh),e(Cs,Oh),g(o,Jd,_),g(o,co,_),v(js,co,null),e(co,Ah),e(co,Os),e(Os,Ph),e(Os,Kr),e(Kr,Sh),e(Os,Dh),g(o,Zd,_),g(o,po,_),v(As,po,null),e(po,Ih),e(po,Ps),e(Ps,Hh),e(Ps,Rr),e(Rr,Qh),e(Ps,Uh),g(o,ec,_),g(o,mo,_),v(Ss,mo,null),e(mo,Wh),e(mo,Ds),e(Ds,Bh),e(Ds,Vr),e(Vr,Kh),e(Ds,Rh),g(o,tc,_),g(o,ho,_),v(Is,ho,null),e(ho,Vh),e(ho,Hs),e(Hs,Yh),e(Hs,gl),e(gl,Gh),e(Hs,Jh),g(o,oc,_),g(o,uo,_),v(Qs,uo,null),e(uo,Zh),e(uo,Us),e(Us,eu),e(Us,Yr),e(Yr,tu),e(Us,ou),g(o,nc,_),g(o,fo,_),v(Ws,fo,null),e(fo,nu),e(fo,Bs),e(Bs,su),e(Bs,Gr),e(Gr,au),e(Bs,ru),g(o,sc,_),g(o,go,_),v(Ks,go,null),e(go,iu),e(go,Rs),e(Rs,lu),e(Rs,Jr),e(Jr,du),e(Rs,cu),g(o,ac,_),g(o,_o,_),v(Vs,_o,null),e(_o,pu),e(_o,Ys),e(Ys,mu),e(Ys,Zr),e(Zr,hu),e(Ys,uu),g(o,rc,_),g(o,ko,_),v(Gs,ko,null),e(ko,fu),e(ko,Js),e(Js,gu),e(Js,ei),e(ei,_u),e(Js,ku),g(o,ic,_),g(o,bo,_),v(Zs,bo,null),e(bo,bu),e(bo,ea),e(ea,yu),e(ea,ti),e(ti,Tu),e(ea,wu),g(o,lc,_),g(o,yo,_),v(ta,yo,null),e(yo,vu),e(yo,oa),e(oa,Nu),e(oa,_l),e(_l,$u),e(oa,xu),g(o,dc,_),g(o,To,_),v(na,To,null),e(To,Lu),e(To,sa),e(sa,Fu),e(sa,oi),e(oi,Xu),e(sa,qu),g(o,cc,_),g(o,wo,_),e(wo,rn),e(rn,kl),v(aa,kl,null),e(wo,zu),e(wo,bl),e(bl,Mu),g(o,pc,_),g(o,it,_),v(ra,it,null),e(it,Eu),e(it,yl),e(yl,Cu),e(it,ju),e(it,ia),e(ia,Ou),e(ia,ni),e(ni,Au),e(ia,Pu),e(it,Su),e(it,la),e(la,Du),e(la,da),e(da,Iu),e(la,Hu),e(it,Qu),e(it,Tt),v(ca,Tt,null),e(Tt,Uu),e(Tt,vo),e(vo,Wu),e(vo,si),e(si,Bu),e(vo,Ku),e(vo,Tl),e(Tl,Ru),e(vo,Vu),e(Tt,Yu),v(ln,Tt,null),e(Tt,Gu),v(dn,Tt,null),g(o,mc,_),g(o,No,_),e(No,cn),e(cn,wl),v(pa,wl,null),e(No,Ju),e(No,vl),e(vl,Zu),g(o,hc,_),g(o,lt,_),v(ma,lt,null),e(lt,ef),e(lt,Nl),e(Nl,tf),e(lt,of),e(lt,ha),e(ha,nf),e(ha,ai),e(ai,sf),e(ha,af),e(lt,rf),e(lt,ua),e(ua,lf),e(ua,fa),e(fa,df),e(ua,cf),e(lt,pf),e(lt,wt),v(ga,wt,null),e(wt,mf),e(wt,$o),e($o,hf),e($o,ri),e(ri,uf),e($o,ff),e($o,$l),e($l,gf),e($o,_f),e(wt,kf),v(pn,wt,null),e(wt,bf),v(mn,wt,null),g(o,uc,_),g(o,xo,_),e(xo,hn),e(hn,xl),v(_a,xl,null),e(xo,yf),e(xo,Ll),e(Ll,Tf),g(o,fc,_),g(o,dt,_),v(ka,dt,null),e(dt,wf),e(dt,Fl),e(Fl,vf),e(dt,Nf),e(dt,ba),e(ba,$f),e(ba,ii),e(ii,xf),e(ba,Lf),e(dt,Ff),e(dt,ya),e(ya,Xf),e(ya,Ta),e(Ta,qf),e(ya,zf),e(dt,Mf),e(dt,ut),v(wa,ut,null),e(ut,Ef),e(ut,Lo),e(Lo,Cf),e(Lo,li),e(li,jf),e(Lo,Of),e(Lo,Xl),e(Xl,Af),e(Lo,Pf),e(ut,Sf),v(un,ut,null),e(ut,Df),v(fn,ut,null),e(ut,If),v(gn,ut,null),g(o,gc,_),g(o,Fo,_),e(Fo,_n),e(_n,ql),v(va,ql,null),e(Fo,Hf),e(Fo,zl),e(zl,Qf),g(o,_c,_),g(o,ct,_),v(Na,ct,null),e(ct,Uf),e(ct,Ml),e(Ml,Wf),e(ct,Bf),e(ct,$a),e($a,Kf),e($a,di),e(di,Rf),e($a,Vf),e(ct,Yf),e(ct,xa),e(xa,Gf),e(xa,La),e(La,Jf),e(xa,Zf),e(ct,eg),e(ct,vt),v(Fa,vt,null),e(vt,tg),e(vt,Xo),e(Xo,og),e(Xo,ci),e(ci,ng),e(Xo,sg),e(Xo,El),e(El,ag),e(Xo,rg),e(vt,ig),v(kn,vt,null),e(vt,lg),v(bn,vt,null),g(o,kc,_),g(o,qo,_),e(qo,yn),e(yn,Cl),v(Xa,Cl,null),e(qo,dg),e(qo,jl),e(jl,cg),g(o,bc,_),g(o,pt,_),v(qa,pt,null),e(pt,pg),e(pt,Ol),e(Ol,mg),e(pt,hg),e(pt,za),e(za,ug),e(za,pi),e(pi,fg),e(za,gg),e(pt,_g),e(pt,Ma),e(Ma,kg),e(Ma,Ea),e(Ea,bg),e(Ma,yg),e(pt,Tg),e(pt,Nt),v(Ca,Nt,null),e(Nt,wg),e(Nt,zo),e(zo,vg),e(zo,mi),e(mi,Ng),e(zo,$g),e(zo,Al),e(Al,xg),e(zo,Lg),e(Nt,Fg),v(Tn,Nt,null),e(Nt,Xg),v(wn,Nt,null),g(o,yc,_),g(o,Mo,_),e(Mo,vn),e(vn,Pl),v(ja,Pl,null),e(Mo,qg),e(Mo,Sl),e(Sl,zg),g(o,Tc,_),g(o,mt,_),v(Oa,mt,null),e(mt,Mg),e(mt,Eo),e(Eo,Eg),e(Eo,Dl),e(Dl,Cg),e(Eo,jg),e(Eo,Il),e(Il,Og),e(Eo,Ag),e(mt,Pg),e(mt,Aa),e(Aa,Sg),e(Aa,hi),e(hi,Dg),e(Aa,Ig),e(mt,Hg),e(mt,Pa),e(Pa,Qg),e(Pa,Sa),e(Sa,Ug),e(Pa,Wg),e(mt,Bg),e(mt,$t),v(Da,$t,null),e($t,Kg),e($t,Co),e(Co,Rg),e(Co,ui),e(ui,Vg),e(Co,Yg),e(Co,Hl),e(Hl,Gg),e(Co,Jg),e($t,Zg),v(Nn,$t,null),e($t,e_),v($n,$t,null),g(o,wc,_),g(o,jo,_),e(jo,xn),e(xn,Ql),v(Ia,Ql,null),e(jo,t_),e(jo,Ul),e(Ul,o_),g(o,vc,_),g(o,ht,_),v(Ha,ht,null),e(ht,n_),e(ht,Oo),e(Oo,s_),e(Oo,Wl),e(Wl,a_),e(Oo,r_),e(Oo,Bl),e(Bl,i_),e(Oo,l_),e(ht,d_),e(ht,Qa),e(Qa,c_),e(Qa,fi),e(fi,p_),e(Qa,m_),e(ht,h_),e(ht,Ua),e(Ua,u_),e(Ua,Wa),e(Wa,f_),e(Ua,g_),e(ht,__),e(ht,xt),v(Ba,xt,null),e(xt,k_),e(xt,Ao),e(Ao,b_),e(Ao,gi),e(gi,y_),e(Ao,T_),e(Ao,Kl),e(Kl,w_),e(Ao,v_),e(xt,N_),v(Ln,xt,null),e(xt,$_),v(Fn,xt,null),g(o,Nc,_),g(o,Po,_),e(Po,Xn),e(Xn,Rl),v(Ka,Rl,null),e(Po,x_),e(Po,Vl),e(Vl,L_),g(o,$c,_),g(o,et,_),v(Ra,et,null),e(et,F_),e(et,Yl),e(Yl,X_),e(et,q_),e(et,Va),e(Va,z_),e(Va,_i),e(_i,M_),e(Va,E_),e(et,C_),e(et,Ya),e(Ya,j_),e(Ya,Ga),e(Ga,O_),e(Ya,A_),e(et,P_),v(qn,et,null),e(et,S_),e(et,Lt),v(Ja,Lt,null),e(Lt,D_),e(Lt,So),e(So,I_),e(So,ki),e(ki,H_),e(So,Q_),e(So,Gl),e(Gl,U_),e(So,W_),e(Lt,B_),v(zn,Lt,null),e(Lt,K_),v(Mn,Lt,null),g(o,xc,_),g(o,Do,_),e(Do,En),e(En,Jl),v(Za,Jl,null),e(Do,R_),e(Do,Zl),e(Zl,V_),g(o,Lc,_),g(o,tt,_),v(er,tt,null),e(tt,Y_),e(tt,ed),e(ed,G_),e(tt,J_),e(tt,tr),e(tr,Z_),e(tr,bi),e(bi,ek),e(tr,tk),e(tt,ok),e(tt,or),e(or,nk),e(or,nr),e(nr,sk),e(or,ak),e(tt,rk),v(Cn,tt,null),e(tt,ik),e(tt,Ft),v(sr,Ft,null),e(Ft,lk),e(Ft,Io),e(Io,dk),e(Io,yi),e(yi,ck),e(Io,pk),e(Io,td),e(td,mk),e(Io,hk),e(Ft,uk),v(jn,Ft,null),e(Ft,fk),v(On,Ft,null),g(o,Fc,_),g(o,Ho,_),e(Ho,An),e(An,od),v(ar,od,null),e(Ho,gk),e(Ho,nd),e(nd,_k),g(o,Xc,_),g(o,ot,_),v(rr,ot,null),e(ot,kk),e(ot,sd),e(sd,bk),e(ot,yk),e(ot,ir),e(ir,Tk),e(ir,Ti),e(Ti,wk),e(ir,vk),e(ot,Nk),e(ot,lr),e(lr,$k),e(lr,dr),e(dr,xk),e(lr,Lk),e(ot,Fk),v(Pn,ot,null),e(ot,Xk),e(ot,ft),v(cr,ft,null),e(ft,qk),e(ft,Qo),e(Qo,zk),e(Qo,wi),e(wi,Mk),e(Qo,Ek),e(Qo,ad),e(ad,Ck),e(Qo,jk),e(ft,Ok),v(Sn,ft,null),e(ft,Ak),v(Dn,ft,null),e(ft,Pk),v(In,ft,null),g(o,qc,_),g(o,Uo,_),e(Uo,Hn),e(Hn,rd),v(pr,rd,null),e(Uo,Sk),e(Uo,id),e(id,Dk),g(o,zc,_),g(o,nt,_),v(mr,nt,null),e(nt,Ik),e(nt,ld),e(ld,Hk),e(nt,Qk),e(nt,hr),e(hr,Uk),e(hr,vi),e(vi,Wk),e(hr,Bk),e(nt,Kk),e(nt,ur),e(ur,Rk),e(ur,fr),e(fr,Vk),e(ur,Yk),e(nt,Gk),v(Qn,nt,null),e(nt,Jk),e(nt,Xt),v(gr,Xt,null),e(Xt,Zk),e(Xt,Wo),e(Wo,eb),e(Wo,Ni),e(Ni,tb),e(Wo,ob),e(Wo,dd),e(dd,nb),e(Wo,sb),e(Xt,ab),v(Un,Xt,null),e(Xt,rb),v(Wn,Xt,null),g(o,Mc,_),g(o,Bo,_),e(Bo,Bn),e(Bn,cd),v(_r,cd,null),e(Bo,ib),e(Bo,pd),e(pd,lb),g(o,Ec,_),g(o,st,_),v(kr,st,null),e(st,db),e(st,md),e(md,cb),e(st,pb),e(st,br),e(br,mb),e(br,$i),e($i,hb),e(br,ub),e(st,fb),e(st,yr),e(yr,gb),e(yr,Tr),e(Tr,_b),e(yr,kb),e(st,bb),v(Kn,st,null),e(st,yb),e(st,gt),v(wr,gt,null),e(gt,Tb),e(gt,Ko),e(Ko,wb),e(Ko,xi),e(xi,vb),e(Ko,Nb),e(Ko,hd),e(hd,$b),e(Ko,xb),e(gt,Lb),v(Rn,gt,null),e(gt,Fb),v(Vn,gt,null),e(gt,Xb),v(Yn,gt,null),g(o,Cc,_),g(o,Ro,_),e(Ro,Gn),e(Gn,ud),v(vr,ud,null),e(Ro,qb),e(Ro,fd),e(fd,zb),g(o,jc,_),g(o,at,_),v(Nr,at,null),e(at,Mb),e(at,Vo),e(Vo,Eb),e(Vo,gd),e(gd,Cb),e(Vo,jb),e(Vo,_d),e(_d,Ob),e(Vo,Ab),e(at,Pb),e(at,$r),e($r,Sb),e($r,Li),e(Li,Db),e($r,Ib),e(at,Hb),e(at,xr),e(xr,Qb),e(xr,Lr),e(Lr,Ub),e(xr,Wb),e(at,Bb),v(Jn,at,null),e(at,Kb),e(at,_t),v(Fr,_t,null),e(_t,Rb),e(_t,Yo),e(Yo,Vb),e(Yo,Fi),e(Fi,Yb),e(Yo,Gb),e(Yo,kd),e(kd,Jb),e(Yo,Zb),e(_t,ey),v(Zn,_t,null),e(_t,ty),v(es,_t,null),e(_t,oy),v(ts,_t,null),Oc=!0},p(o,[_]){const Xr={};_&2&&(Xr.$$scope={dirty:_,ctx:o}),Zo.$set(Xr);const bd={};_&2&&(bd.$$scope={dirty:_,ctx:o}),on.$set(bd);const yd={};_&2&&(yd.$$scope={dirty:_,ctx:o}),sn.$set(yd);const Td={};_&2&&(Td.$$scope={dirty:_,ctx:o}),ln.$set(Td);const qr={};_&2&&(qr.$$scope={dirty:_,ctx:o}),dn.$set(qr);const wd={};_&2&&(wd.$$scope={dirty:_,ctx:o}),pn.$set(wd);const vd={};_&2&&(vd.$$scope={dirty:_,ctx:o}),mn.$set(vd);const Nd={};_&2&&(Nd.$$scope={dirty:_,ctx:o}),un.$set(Nd);const zr={};_&2&&(zr.$$scope={dirty:_,ctx:o}),fn.$set(zr);const $d={};_&2&&($d.$$scope={dirty:_,ctx:o}),gn.$set($d);const xd={};_&2&&(xd.$$scope={dirty:_,ctx:o}),kn.$set(xd);const Ld={};_&2&&(Ld.$$scope={dirty:_,ctx:o}),bn.$set(Ld);const Fd={};_&2&&(Fd.$$scope={dirty:_,ctx:o}),Tn.$set(Fd);const Xd={};_&2&&(Xd.$$scope={dirty:_,ctx:o}),wn.$set(Xd);const At={};_&2&&(At.$$scope={dirty:_,ctx:o}),Nn.$set(At);const Mr={};_&2&&(Mr.$$scope={dirty:_,ctx:o}),$n.$set(Mr);const qd={};_&2&&(qd.$$scope={dirty:_,ctx:o}),Ln.$set(qd);const Er={};_&2&&(Er.$$scope={dirty:_,ctx:o}),Fn.$set(Er);const zd={};_&2&&(zd.$$scope={dirty:_,ctx:o}),qn.$set(zd);const Pt={};_&2&&(Pt.$$scope={dirty:_,ctx:o}),zn.$set(Pt);const Md={};_&2&&(Md.$$scope={dirty:_,ctx:o}),Mn.$set(Md);const Ed={};_&2&&(Ed.$$scope={dirty:_,ctx:o}),Cn.$set(Ed);const Cd={};_&2&&(Cd.$$scope={dirty:_,ctx:o}),jn.$set(Cd);const jd={};_&2&&(jd.$$scope={dirty:_,ctx:o}),On.$set(jd);const Go={};_&2&&(Go.$$scope={dirty:_,ctx:o}),Pn.$set(Go);const Od={};_&2&&(Od.$$scope={dirty:_,ctx:o}),Sn.$set(Od);const Ad={};_&2&&(Ad.$$scope={dirty:_,ctx:o}),Dn.$set(Ad);const Cr={};_&2&&(Cr.$$scope={dirty:_,ctx:o}),In.$set(Cr);const Pd={};_&2&&(Pd.$$scope={dirty:_,ctx:o}),Qn.$set(Pd);const Sd={};_&2&&(Sd.$$scope={dirty:_,ctx:o}),Un.$set(Sd);const Dd={};_&2&&(Dd.$$scope={dirty:_,ctx:o}),Wn.$set(Dd);const St={};_&2&&(St.$$scope={dirty:_,ctx:o}),Kn.$set(St);const Dt={};_&2&&(Dt.$$scope={dirty:_,ctx:o}),Rn.$set(Dt);const Id={};_&2&&(Id.$$scope={dirty:_,ctx:o}),Vn.$set(Id);const Hd={};_&2&&(Hd.$$scope={dirty:_,ctx:o}),Yn.$set(Hd);const Qd={};_&2&&(Qd.$$scope={dirty:_,ctx:o}),Jn.$set(Qd);const Jo={};_&2&&(Jo.$$scope={dirty:_,ctx:o}),Zn.$set(Jo);const Ud={};_&2&&(Ud.$$scope={dirty:_,ctx:o}),es.$set(Ud);const Wd={};_&2&&(Wd.$$scope={dirty:_,ctx:o}),ts.$set(Wd)},i(o){Oc||(N(l.$$.fragment,o),N(L.$$.fragment,o),N(U.$$.fragment,o),N(Ae.$$.fragment,o),N(Zo.$$.fragment,o),N(us.$$.fragment,o),N(fs.$$.fragment,o),N(bs.$$.fragment,o),N(Ts.$$.fragment,o),N(vs.$$.fragment,o),N(on.$$.fragment,o),N(Ns.$$.fragment,o),N($s.$$.fragment,o),N(xs.$$.fragment,o),N(Xs.$$.fragment,o),N(zs.$$.fragment,o),N(sn.$$.fragment,o),N(Ms.$$.fragment,o),N(Es.$$.fragment,o),N(js.$$.fragment,o),N(As.$$.fragment,o),N(Ss.$$.fragment,o),N(Is.$$.fragment,o),N(Qs.$$.fragment,o),N(Ws.$$.fragment,o),N(Ks.$$.fragment,o),N(Vs.$$.fragment,o),N(Gs.$$.fragment,o),N(Zs.$$.fragment,o),N(ta.$$.fragment,o),N(na.$$.fragment,o),N(aa.$$.fragment,o),N(ra.$$.fragment,o),N(ca.$$.fragment,o),N(ln.$$.fragment,o),N(dn.$$.fragment,o),N(pa.$$.fragment,o),N(ma.$$.fragment,o),N(ga.$$.fragment,o),N(pn.$$.fragment,o),N(mn.$$.fragment,o),N(_a.$$.fragment,o),N(ka.$$.fragment,o),N(wa.$$.fragment,o),N(un.$$.fragment,o),N(fn.$$.fragment,o),N(gn.$$.fragment,o),N(va.$$.fragment,o),N(Na.$$.fragment,o),N(Fa.$$.fragment,o),N(kn.$$.fragment,o),N(bn.$$.fragment,o),N(Xa.$$.fragment,o),N(qa.$$.fragment,o),N(Ca.$$.fragment,o),N(Tn.$$.fragment,o),N(wn.$$.fragment,o),N(ja.$$.fragment,o),N(Oa.$$.fragment,o),N(Da.$$.fragment,o),N(Nn.$$.fragment,o),N($n.$$.fragment,o),N(Ia.$$.fragment,o),N(Ha.$$.fragment,o),N(Ba.$$.fragment,o),N(Ln.$$.fragment,o),N(Fn.$$.fragment,o),N(Ka.$$.fragment,o),N(Ra.$$.fragment,o),N(qn.$$.fragment,o),N(Ja.$$.fragment,o),N(zn.$$.fragment,o),N(Mn.$$.fragment,o),N(Za.$$.fragment,o),N(er.$$.fragment,o),N(Cn.$$.fragment,o),N(sr.$$.fragment,o),N(jn.$$.fragment,o),N(On.$$.fragment,o),N(ar.$$.fragment,o),N(rr.$$.fragment,o),N(Pn.$$.fragment,o),N(cr.$$.fragment,o),N(Sn.$$.fragment,o),N(Dn.$$.fragment,o),N(In.$$.fragment,o),N(pr.$$.fragment,o),N(mr.$$.fragment,o),N(Qn.$$.fragment,o),N(gr.$$.fragment,o),N(Un.$$.fragment,o),N(Wn.$$.fragment,o),N(_r.$$.fragment,o),N(kr.$$.fragment,o),N(Kn.$$.fragment,o),N(wr.$$.fragment,o),N(Rn.$$.fragment,o),N(Vn.$$.fragment,o),N(Yn.$$.fragment,o),N(vr.$$.fragment,o),N(Nr.$$.fragment,o),N(Jn.$$.fragment,o),N(Fr.$$.fragment,o),N(Zn.$$.fragment,o),N(es.$$.fragment,o),N(ts.$$.fragment,o),Oc=!0)},o(o){$(l.$$.fragment,o),$(L.$$.fragment,o),$(U.$$.fragment,o),$(Ae.$$.fragment,o),$(Zo.$$.fragment,o),$(us.$$.fragment,o),$(fs.$$.fragment,o),$(bs.$$.fragment,o),$(Ts.$$.fragment,o),$(vs.$$.fragment,o),$(on.$$.fragment,o),$(Ns.$$.fragment,o),$($s.$$.fragment,o),$(xs.$$.fragment,o),$(Xs.$$.fragment,o),$(zs.$$.fragment,o),$(sn.$$.fragment,o),$(Ms.$$.fragment,o),$(Es.$$.fragment,o),$(js.$$.fragment,o),$(As.$$.fragment,o),$(Ss.$$.fragment,o),$(Is.$$.fragment,o),$(Qs.$$.fragment,o),$(Ws.$$.fragment,o),$(Ks.$$.fragment,o),$(Vs.$$.fragment,o),$(Gs.$$.fragment,o),$(Zs.$$.fragment,o),$(ta.$$.fragment,o),$(na.$$.fragment,o),$(aa.$$.fragment,o),$(ra.$$.fragment,o),$(ca.$$.fragment,o),$(ln.$$.fragment,o),$(dn.$$.fragment,o),$(pa.$$.fragment,o),$(ma.$$.fragment,o),$(ga.$$.fragment,o),$(pn.$$.fragment,o),$(mn.$$.fragment,o),$(_a.$$.fragment,o),$(ka.$$.fragment,o),$(wa.$$.fragment,o),$(un.$$.fragment,o),$(fn.$$.fragment,o),$(gn.$$.fragment,o),$(va.$$.fragment,o),$(Na.$$.fragment,o),$(Fa.$$.fragment,o),$(kn.$$.fragment,o),$(bn.$$.fragment,o),$(Xa.$$.fragment,o),$(qa.$$.fragment,o),$(Ca.$$.fragment,o),$(Tn.$$.fragment,o),$(wn.$$.fragment,o),$(ja.$$.fragment,o),$(Oa.$$.fragment,o),$(Da.$$.fragment,o),$(Nn.$$.fragment,o),$($n.$$.fragment,o),$(Ia.$$.fragment,o),$(Ha.$$.fragment,o),$(Ba.$$.fragment,o),$(Ln.$$.fragment,o),$(Fn.$$.fragment,o),$(Ka.$$.fragment,o),$(Ra.$$.fragment,o),$(qn.$$.fragment,o),$(Ja.$$.fragment,o),$(zn.$$.fragment,o),$(Mn.$$.fragment,o),$(Za.$$.fragment,o),$(er.$$.fragment,o),$(Cn.$$.fragment,o),$(sr.$$.fragment,o),$(jn.$$.fragment,o),$(On.$$.fragment,o),$(ar.$$.fragment,o),$(rr.$$.fragment,o),$(Pn.$$.fragment,o),$(cr.$$.fragment,o),$(Sn.$$.fragment,o),$(Dn.$$.fragment,o),$(In.$$.fragment,o),$(pr.$$.fragment,o),$(mr.$$.fragment,o),$(Qn.$$.fragment,o),$(gr.$$.fragment,o),$(Un.$$.fragment,o),$(Wn.$$.fragment,o),$(_r.$$.fragment,o),$(kr.$$.fragment,o),$(Kn.$$.fragment,o),$(wr.$$.fragment,o),$(Rn.$$.fragment,o),$(Vn.$$.fragment,o),$(Yn.$$.fragment,o),$(vr.$$.fragment,o),$(Nr.$$.fragment,o),$(Jn.$$.fragment,o),$(Fr.$$.fragment,o),$(Zn.$$.fragment,o),$(es.$$.fragment,o),$(ts.$$.fragment,o),Oc=!1},d(o){t(d),o&&t(y),o&&t(h),x(l),o&&t(me),o&&t(D),x(L),o&&t(he),o&&t(Q),o&&t(ue),o&&t(B),o&&t(fe),o&&t(K),o&&t(ne),o&&t(M),o&&t(ge),o&&t(A),o&&t(se),o&&t(_e),o&&t(S),o&&t(H),x(U),o&&t(De),o&&t(W),x(Ae),x(Zo),o&&t(Bd),o&&t(oo),x(us),o&&t(Kd),o&&t(Ge),x(fs),x(bs),x(Ts),x(vs),x(on),x(Ns),o&&t(Rd),o&&t(so),x($s),o&&t(Vd),o&&t(rt),x(xs),x(Xs),x(zs),x(sn),o&&t(Yd),o&&t(io),x(Ms),o&&t(Gd),o&&t(lo),x(Es),o&&t(Jd),o&&t(co),x(js),o&&t(Zd),o&&t(po),x(As),o&&t(ec),o&&t(mo),x(Ss),o&&t(tc),o&&t(ho),x(Is),o&&t(oc),o&&t(uo),x(Qs),o&&t(nc),o&&t(fo),x(Ws),o&&t(sc),o&&t(go),x(Ks),o&&t(ac),o&&t(_o),x(Vs),o&&t(rc),o&&t(ko),x(Gs),o&&t(ic),o&&t(bo),x(Zs),o&&t(lc),o&&t(yo),x(ta),o&&t(dc),o&&t(To),x(na),o&&t(cc),o&&t(wo),x(aa),o&&t(pc),o&&t(it),x(ra),x(ca),x(ln),x(dn),o&&t(mc),o&&t(No),x(pa),o&&t(hc),o&&t(lt),x(ma),x(ga),x(pn),x(mn),o&&t(uc),o&&t(xo),x(_a),o&&t(fc),o&&t(dt),x(ka),x(wa),x(un),x(fn),x(gn),o&&t(gc),o&&t(Fo),x(va),o&&t(_c),o&&t(ct),x(Na),x(Fa),x(kn),x(bn),o&&t(kc),o&&t(qo),x(Xa),o&&t(bc),o&&t(pt),x(qa),x(Ca),x(Tn),x(wn),o&&t(yc),o&&t(Mo),x(ja),o&&t(Tc),o&&t(mt),x(Oa),x(Da),x(Nn),x($n),o&&t(wc),o&&t(jo),x(Ia),o&&t(vc),o&&t(ht),x(Ha),x(Ba),x(Ln),x(Fn),o&&t(Nc),o&&t(Po),x(Ka),o&&t($c),o&&t(et),x(Ra),x(qn),x(Ja),x(zn),x(Mn),o&&t(xc),o&&t(Do),x(Za),o&&t(Lc),o&&t(tt),x(er),x(Cn),x(sr),x(jn),x(On),o&&t(Fc),o&&t(Ho),x(ar),o&&t(Xc),o&&t(ot),x(rr),x(Pn),x(cr),x(Sn),x(Dn),x(In),o&&t(qc),o&&t(Uo),x(pr),o&&t(zc),o&&t(nt),x(mr),x(Qn),x(gr),x(Un),x(Wn),o&&t(Mc),o&&t(Bo),x(_r),o&&t(Ec),o&&t(st),x(kr),x(Kn),x(wr),x(Rn),x(Vn),x(Yn),o&&t(Cc),o&&t(Ro),x(vr),o&&t(jc),o&&t(at),x(Nr),x(Jn),x(Fr),x(Zn),x(es),x(ts)}}}const Pv={local:"xlnet",sections:[{local:"overview",title:"Overview"},{local:"transformers.XLNetConfig",title:"XLNetConfig"},{local:"transformers.XLNetTokenizer",title:"XLNetTokenizer"},{local:"transformers.XLNetTokenizerFast",title:"XLNetTokenizerFast"},{local:"transformers.models.xlnet.modeling_xlnet.XLNetModelOutput",title:"XLNet specific outputs"},{local:"transformers.XLNetModel",title:"XLNetModel"},{local:"transformers.XLNetLMHeadModel",title:"XLNetLMHeadModel"},{local:"transformers.XLNetForSequenceClassification",title:"XLNetForSequenceClassification"},{local:"transformers.XLNetForMultipleChoice",title:"XLNetForMultipleChoice"},{local:"transformers.XLNetForTokenClassification",title:"XLNetForTokenClassification"},{local:"transformers.XLNetForQuestionAnsweringSimple",title:"XLNetForQuestionAnsweringSimple"},{local:"transformers.XLNetForQuestionAnswering",title:"XLNetForQuestionAnswering"},{local:"transformers.TFXLNetModel",title:"TFXLNetModel"},{local:"transformers.TFXLNetLMHeadModel",title:"TFXLNetLMHeadModel"},{local:"transformers.TFXLNetForSequenceClassification",title:"TFXLNetForSequenceClassification"},{local:"transformers.TFXLNetForMultipleChoice",title:"TFLNetForMultipleChoice"},{local:"transformers.TFXLNetForTokenClassification",title:"TFXLNetForTokenClassification"},{local:"transformers.TFXLNetForQuestionAnsweringSimple",title:"TFXLNetForQuestionAnsweringSimple"}],title:"XLNet"};function Sv(q){return Gw(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Bv extends Kw{constructor(d){super();Rw(this,d,Sv,Av,Vw,{})}}export{Bv as default,Pv as metadata};
