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
8cbb5924
Commit
8cbb5924
authored
Aug 18, 2020
by
Hongkun Yu
Committed by
A. Unique TensorFlower
Aug 18, 2020
Browse files
Rename tagging_data_loader to tagging_dataloader for consistent naming.
PiperOrigin-RevId: 327179271
parent
1b5b2fe4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
official/nlp/data/tagging_dataloader.py
official/nlp/data/tagging_dataloader.py
+0
-0
official/nlp/data/tagging_dataloader_test.py
official/nlp/data/tagging_dataloader_test.py
+3
-3
official/nlp/tasks/tagging_test.py
official/nlp/tasks/tagging_test.py
+3
-3
No files found.
official/nlp/data/tagging_data
_
loader.py
→
official/nlp/data/tagging_dataloader.py
View file @
8cbb5924
File moved
official/nlp/data/tagging_data
_
loader_test.py
→
official/nlp/data/tagging_dataloader_test.py
View file @
8cbb5924
...
...
@@ -19,7 +19,7 @@ import os
import
numpy
as
np
import
tensorflow
as
tf
from
official.nlp.data
import
tagging_data
_
loader
from
official.nlp.data
import
tagging_dataloader
def
_create_fake_dataset
(
output_path
,
seq_length
):
...
...
@@ -51,12 +51,12 @@ class TaggingDataLoaderTest(tf.test.TestCase):
batch_size
=
10
train_data_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
'train.tf_record'
)
_create_fake_dataset
(
train_data_path
,
seq_length
)
data_config
=
tagging_data
_
loader
.
TaggingDataConfig
(
data_config
=
tagging_dataloader
.
TaggingDataConfig
(
input_path
=
train_data_path
,
seq_length
=
seq_length
,
global_batch_size
=
batch_size
)
dataset
=
tagging_data
_
loader
.
TaggingDataLoader
(
data_config
).
load
()
dataset
=
tagging_dataloader
.
TaggingDataLoader
(
data_config
).
load
()
features
,
labels
=
next
(
iter
(
dataset
))
self
.
assertCountEqual
([
'input_word_ids'
,
'input_mask'
,
'input_type_ids'
],
features
.
keys
())
...
...
official/nlp/tasks/tagging_test.py
View file @
8cbb5924
...
...
@@ -23,7 +23,7 @@ import tensorflow as tf
from
official.nlp.bert
import
configs
from
official.nlp.bert
import
export_tfhub
from
official.nlp.configs
import
encoders
from
official.nlp.data
import
tagging_data
_
loader
from
official.nlp.data
import
tagging_dataloader
from
official.nlp.tasks
import
tagging
...
...
@@ -56,7 +56,7 @@ class TaggingTest(tf.test.TestCase):
super
(
TaggingTest
,
self
).
setUp
()
self
.
_encoder_config
=
encoders
.
EncoderConfig
(
bert
=
encoders
.
BertEncoderConfig
(
vocab_size
=
30522
,
num_layers
=
1
))
self
.
_train_data_config
=
tagging_data
_
loader
.
TaggingDataConfig
(
self
.
_train_data_config
=
tagging_dataloader
.
TaggingDataConfig
(
input_path
=
"dummy"
,
seq_length
=
128
,
global_batch_size
=
1
)
def
_run_task
(
self
,
config
):
...
...
@@ -181,7 +181,7 @@ class TaggingTest(tf.test.TestCase):
seq_length
=
seq_length
,
num_labels
=
len
(
task_config
.
class_names
),
num_examples
=
num_examples
)
test_data_config
=
tagging_data
_
loader
.
TaggingDataConfig
(
test_data_config
=
tagging_dataloader
.
TaggingDataConfig
(
input_path
=
test_data_path
,
seq_length
=
seq_length
,
is_training
=
False
,
...
...
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