HUSTAI / uie_pytorch

PaddleNLP UIE模型的PyTorch版实现
Apache License 2.0
586 stars 99 forks source link

情感分类支持微调吗? #22

Open hw-cw opened 1 year ago

hw-cw commented 1 year ago

训练集: {"content": "不错的上网本,外形很漂亮,操作系统应该是个很大的 卖点,电池还可以。整体上讲,作为一个上网本的定位,还是不错的。\t", "result_list": [{"text": "正向", "start": -7, "end": -5}], "prompt": "情感倾向[正向,负向]"} {"content": "<荐书> 推荐所有喜欢<红楼>的红迷们一定要收藏这本书,要知道当年我听说这本书的时候花很长时间去图书馆找和借都没能如愿,所以这次一看到当当有,马上买了,红迷们也要记得备货哦!\t", "result_list": [{"text": "正向", "start": -4, "end": -2}], "prompt": "情感倾向[负向,正向]"}

用这个去微调情感分类会报错显示: RequestsDependencyWarning) Traceback (most recent call last): File "finetune.py", line 253, in do_train() File "finetune.py", line 35, in do_train tokenizer = BertTokenizerFast.from_pretrained(args.model) File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 1706, in from_pretrained local_files_only=local_files_only, File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/transformers/utils/hub.py", line 711, in get_file_from_repo use_auth_token=use_auth_token, File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/transformers/utils/hub.py", line 292, in cached_path local_files_only=local_files_only, File "/home/ma-user/anaconda3/envs/PyTorch-1.8/lib/python3.7/site-packages/transformers/utils/hub.py", line 563, in get_from_cache "Connection error, and we cannot find the requested files in the cached path." ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on.

NickThrone commented 1 year ago

应该支持吧,就是不太清楚数据集的时候,----task_type 应该设置成什么样子。

NickThrone commented 1 year ago

支持,我看了,--task_type应该设置成 cls,就可以了