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
4452b44b
Unverified
Commit
4452b44b
authored
Feb 21, 2020
by
Martin Malmsten
Committed by
GitHub
Feb 21, 2020
Browse files
Labels are now added to model config under id2label and label2id (#2945)
parent
53ce3854
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
examples/ner/run_ner.py
examples/ner/run_ner.py
+2
-0
No files found.
examples/ner/run_ner.py
View file @
4452b44b
...
...
@@ -586,6 +586,8 @@ def main():
config
=
config_class
.
from_pretrained
(
args
.
config_name
if
args
.
config_name
else
args
.
model_name_or_path
,
num_labels
=
num_labels
,
id2label
=
{
str
(
i
):
label
for
i
,
label
in
enumerate
(
labels
)},
label2id
=
{
label
:
i
for
i
,
label
in
enumerate
(
labels
)},
cache_dir
=
args
.
cache_dir
if
args
.
cache_dir
else
None
,
)
tokenizer
=
tokenizer_class
.
from_pretrained
(
...
...
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