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
ModelZoo
ResNet50_tensorflow
Commits
8a22165b
Commit
8a22165b
authored
Apr 03, 2020
by
Chen Chen
Committed by
A. Unique TensorFlower
Apr 03, 2020
Browse files
Internal change
PiperOrigin-RevId: 304556292
parent
8bf2b3be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
official/nlp/data/create_pretraining_data.py
official/nlp/data/create_pretraining_data.py
+10
-4
No files found.
official/nlp/data/create_pretraining_data.py
View file @
8a22165b
...
@@ -184,9 +184,15 @@ def create_float_feature(values):
...
@@ -184,9 +184,15 @@ def create_float_feature(values):
return
feature
return
feature
def
create_training_instances
(
input_files
,
tokenizer
,
max_seq_length
,
def
create_training_instances
(
input_files
,
dupe_factor
,
short_seq_prob
,
masked_lm_prob
,
tokenizer
,
max_predictions_per_seq
,
rng
,
do_whole_word_mask
):
max_seq_length
,
dupe_factor
,
short_seq_prob
,
masked_lm_prob
,
max_predictions_per_seq
,
rng
,
do_whole_word_mask
=
False
):
"""Create `TrainingInstance`s from raw text."""
"""Create `TrainingInstance`s from raw text."""
all_documents
=
[[]]
all_documents
=
[[]]
...
@@ -232,7 +238,7 @@ def create_training_instances(input_files, tokenizer, max_seq_length,
...
@@ -232,7 +238,7 @@ def create_training_instances(input_files, tokenizer, max_seq_length,
def
create_instances_from_document
(
def
create_instances_from_document
(
all_documents
,
document_index
,
max_seq_length
,
short_seq_prob
,
all_documents
,
document_index
,
max_seq_length
,
short_seq_prob
,
masked_lm_prob
,
max_predictions_per_seq
,
vocab_words
,
rng
,
masked_lm_prob
,
max_predictions_per_seq
,
vocab_words
,
rng
,
do_whole_word_mask
):
do_whole_word_mask
=
False
):
"""Creates `TrainingInstance`s for a single document."""
"""Creates `TrainingInstance`s for a single document."""
document
=
all_documents
[
document_index
]
document
=
all_documents
[
document_index
]
...
...
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