Skip to content

Commit d72e5a3

Browse files
committed
Fix quality
1 parent 73a5326 commit d72e5a3

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

examples/pytorch/token-classification/run_ner_no_trainer.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,16 @@ def parse_args():
7676
"--validation_file", type=str, default=None, help="A csv or a json file containing the validation data."
7777
)
7878
parser.add_argument(
79-
"--text_column_name", type=str, default=None, help="The column name of text to input in the file (a csv or JSON file)."
79+
"--text_column_name",
80+
type=str,
81+
default=None,
82+
help="The column name of text to input in the file (a csv or JSON file).",
8083
)
8184
parser.add_argument(
82-
"--label_column_name", type=str, default=None, help="The column name of label to input in the file (a csv or JSON file)."
85+
"--label_column_name",
86+
type=str,
87+
default=None,
88+
help="The column name of label to input in the file (a csv or JSON file).",
8389
)
8490
parser.add_argument(
8591
"--max_length",
@@ -266,17 +272,17 @@ def main():
266272
column_names = raw_datasets["validation"].column_names
267273
features = raw_datasets["validation"].features
268274

269-
if data_args.text_column_name is not None:
270-
text_column_name = data_args.text_column_name
275+
if args.text_column_name is not None:
276+
text_column_name = args.text_column_name
271277
elif "tokens" in column_names:
272278
text_column_name = "tokens"
273279
else:
274280
text_column_name = column_names[0]
275281

276-
if data_args.label_column_name is not None:
277-
label_column_name = data_args.label_column_name
278-
elif f"{data_args.task_name}_tags" in column_names:
279-
label_column_name = f"{data_args.task_name}_tags"
282+
if args.label_column_name is not None:
283+
label_column_name = args.label_column_name
284+
elif f"{args.task_name}_tags" in column_names:
285+
label_column_name = f"{args.task_name}_tags"
280286
else:
281287
label_column_name = column_names[1]
282288

0 commit comments

Comments
 (0)