zjunlp / DeepKE

[EMNLP 2022] An Open Toolkit for Knowledge Graph Extraction and Construction
http://deepke.zjukg.cn/
MIT License
3.46k stars 677 forks source link

关于ae/standard #486

Closed Sangs3112 closed 5 months ago

Sangs3112 commented 5 months ago

Describe the question

A clear and concise description of what the question is.

已经成功安装环境,但是运行报错

warnings.warn( [2024-04-28 17:50:59,912][main][INFO] - cwd: /home/sangs/project/DeepKE/example/ae/standard preprocess: true data_path: data/origin out_path: data/out chinese_split: true min_freq: 3 pos_limit: 30 seed: 1 use_gpu: true gpu_id: 0 epoch: 50 batch_size: 32 learning_rate: 0.0003 lr_factor: 0.7 lr_patience: 3 weight_decay: 0.001 early_stopping_patience: 6 train_log: true log_interval: 10 show_plot: false only_comparison_plot: false plot_utils: matplot predict_plot: true use_multi_gpu: false gpu_ids: 0,1 vocab_size: ??? word_dim: 60 pos_size: 62 pos_dim: 10 dim_strategy: sum num_attributes: 7 fp: xxx/checkpoints/2019-12-03_17-35-30/cnn_epoch21.pth model_name: gcn num_layers: 3 input_size: ??? hidden_size: 100 dropout: 0.3

[2024-04-28 17:50:59,933][main][INFO] - device: cuda:0 [2024-04-28 17:50:59,933][deepke.attribution_extraction.standard.tools.preprocess][INFO] - ===== start preprocess data ===== [2024-04-28 17:50:59,934][deepke.attribution_extraction.standard.tools.preprocess][INFO] - load raw files... [2024-04-28 17:50:59,934][utils.ioUtils][INFO] - load csv from /home/sangs/project/DeepKE/example/ae/standard/data/origin/train.csv [2024-04-28 17:50:59,934][utils.ioUtils][INFO] - load csv from /home/sangs/project/DeepKE/example/ae/standard/data/origin/valid.csv [2024-04-28 17:50:59,934][utils.ioUtils][INFO] - load csv from /home/sangs/project/DeepKE/example/ae/standard/data/origin/test.csv [2024-04-28 17:50:59,934][utils.ioUtils][INFO] - load csv from /home/sangs/project/DeepKE/example/ae/standard/data/origin/attribute.csv [2024-04-28 17:50:59,934][deepke.attribution_extraction.standard.tools.preprocess][INFO] - convert attribution into index... Traceback (most recent call last): File "run.py", line 58, in main preprocess(cfg) File "/home/sangs/.conda/envs/ae/lib/python3.8/site-packages/deepke/attribution_extraction/standard/tools/preprocess.py", line 100, in preprocess atts = _handle_attribute_data(attribute_data) File "/home/sangs/.conda/envs/ae/lib/python3.8/site-packages/deepke/attribution_extraction/standard/tools/preprocess.py", line 79, in _handle_attribute_data attribute_data = sorted(attribute_data, key=lambda i: int(i['index'])) File "/home/sangs/.conda/envs/ae/lib/python3.8/site-packages/deepke/attribution_extraction/standard/tools/preprocess.py", line 79, in attribute_data = sorted(attribute_data, key=lambda i: int(i['index'])) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

Sangs3112 commented 5 months ago

我是仿照着官方的数据集自己建的,train.csv里面是这样的 sentence,attribute,entity,entity_offset,attribute_value,attribute_value_offset B型主动脉夹层是一种严重危害生命健康的血管疾病,有较高的病死率,特点,B型主动脉夹层,0,较高的病死率,25 B型主动脉夹层又叫做TBAD,简称,B型主动脉夹层,0,TBAD,10 B型主动脉夹层具有起病急、发展快的特点,特点,B型主动脉夹层,0,起病急、发展快,9 主动脉夹层(aortic dissection,AD),简称,主动脉夹层,0,AD,24 典型的主动脉夹层(aortic dissection,AD)是由于各种原因导致的主动脉内膜撕裂,血液流入动脉壁间,主动脉壁分层、分离,血管腔被游离的内膜片分隔为真腔和假腔,发病结果,主动脉夹层,0,主动脉内膜撕裂,血液流入动脉壁间,主动脉壁分层、分离,血管腔被游离的内膜片分隔为真腔和假腔,40 Ⅰ型:原发破口位于升主动脉或主动脉弓,夹层累及范围自升主动脉至腹主动脉,位置,Ⅰ型,0,原发破口位于升主动脉或主动脉弓,夹层累及范围自升主动脉至腹主动脉,3 0区:主动脉窦-升主动脉移行处至无名动脉开口远端,位置,0区,0,主动脉窦-升主动脉移行处至无名动脉开口远端,3 1区:无名动脉开口远端至左颈总动脉开口远端,位置,1区,0,无名动脉开口远端至左颈总动脉开口远端,3 2区:左颈总动脉开口远端至左锁骨下动脉开口远端,位置,2区,0,左颈总动脉开口远端至左锁骨下动脉开口远端,3 3区:左锁骨下动脉开口远端至左锁骨下动脉开口以远2 cm处,位置,3区,0,左锁骨下动脉开口远端至左锁骨下动脉开口以远2 cm处,3 4区:左锁骨下动脉开口以远2 cm处至胸降主动脉中点(约胸6水平),位置,4区,0,左锁骨下动脉开口以远2 cm处至胸降主动脉中点,3