Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
641b873c
Unverified
Commit
641b873c
authored
Jul 29, 2020
by
Lysandre Debut
Committed by
GitHub
Jul 29, 2020
Browse files
XLNet PLM Readme (#6121)
parent
8d157c93
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
examples/language-modeling/README.md
examples/language-modeling/README.md
+24
-0
No files found.
examples/language-modeling/README.md
View file @
641b873c
...
...
@@ -60,3 +60,27 @@ python run_language_modeling.py \
--mlm
```
### XLNet and permutation language modeling
XLNet uses a different training objective, which is permutation language modeling. It is an autoregressive method
to learn bidirectional contexts by maximizing the expected likelihood over all permutations of the input
sequence factorization order.
We use the
`--plm_probability`
flag to define the ratio of length of a span of masked tokens to surrounding
context length for permutation language modeling.
The
`--max_span_length`
flag may also be used to limit the length of a span of masked tokens used
for permutation language modeling.
```
bash
export
TRAIN_FILE
=
/path/to/dataset/wiki.train.raw
export
TEST_FILE
=
/path/to/dataset/wiki.test.raw
python run_language_modeling.py
\
--output_dir
=
output
\
--model_name_or_path
=
xlnet-base-cased
\
--do_train
\
--train_data_file
=
$TRAIN_FILE
\
--do_eval
\
--eval_data_file
=
$TEST_FILE
\
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment