|
20 | 20 | from decimal import Decimal
|
21 | 21 |
|
22 | 22 | import numpy as np
|
23 |
| -from utils import convert_cls_examples, convert_ext_examples, set_seed, str2bool |
| 23 | +from utils import convert_cls_examples, convert_ext_examples, set_seed |
24 | 24 |
|
| 25 | +from paddlenlp.trainer.argparser import strtobool |
25 | 26 | from paddlenlp.utils.log import logger
|
26 | 27 |
|
27 | 28 |
|
@@ -167,7 +168,7 @@ def _save_examples(save_dir, file_name, examples):
|
167 | 168 | parser.add_argument("--task_type", choices=['ext', 'cls'], default="ext", type=str, help="Select task type, ext for the extraction task and cls for the classification task, defaults to ext.")
|
168 | 169 | parser.add_argument("--options", default=["正向", "负向"], type=str, nargs="+", help="Used only for the classification task, the options for classification")
|
169 | 170 | parser.add_argument("--prompt_prefix", default="情感倾向", type=str, help="Used only for the classification task, the prompt prefix for classification")
|
170 |
| - parser.add_argument("--is_shuffle", default="True", type=str2bool, help="Whether to shuffle the labeled dataset, defaults to True.") |
| 171 | + parser.add_argument("--is_shuffle", default="True", type=strtobool, help="Whether to shuffle the labeled dataset, defaults to True.") |
171 | 172 | parser.add_argument("--seed", type=int, default=1000, help="Random seed for initialization")
|
172 | 173 | parser.add_argument("--separator", type=str, default='##', help="Used only for entity/aspect-level classification task, separator for entity label and classification label")
|
173 | 174 | parser.add_argument("--schema_lang", choices=["ch", "en"], default="ch", help="Select the language type for schema.")
|
|
0 commit comments