Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
60414f31
Commit
60414f31
authored
Sep 19, 2019
by
LysandreJik
Browse files
GLUE updated with new methods
parent
baa74326
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
examples/utils_glue.py
examples/utils_glue.py
+8
-1
No files found.
examples/utils_glue.py
View file @
60414f31
...
...
@@ -405,7 +405,14 @@ def convert_examples_to_features(examples, label_list, max_seq_length,
if
ex_index
%
10000
==
0
:
logger
.
info
(
"Writing example %d of %d"
%
(
ex_index
,
len
(
examples
)))
input_ids
,
segment_ids
=
tokenizer
.
encode
(
example
.
text_a
,
example
.
text_b
,
add_special_tokens
=
True
,
output_mask
=
True
)
inputs
=
tokenizer
.
encode_plus
(
example
.
text_a
,
example
.
text_b
,
add_special_tokens
=
True
,
output_mask
=
True
,
max_length
=
max_seq_length
)
input_ids
,
segment_ids
=
inputs
[
"sequence"
],
inputs
[
"mask"
]
# The mask has 1 for real tokens and 0 for padding tokens. Only real
# tokens are attended to.
...
...
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