zjunlp / DocuNet

[IJCAI 2021] Document-level Relation Extraction as Semantic Segmentation
MIT License
132 stars 20 forks source link

No train_bio.py #13

Closed yangjingla closed 2 years ago

yangjingla commented 2 years ago

Both in CDR and GDA running bash

#! /bin/bash
export CUDA_VISIBLE_DEVICES=0

if true; then
type=context-based
bs=4
bl=3e-5
uls=(4e-4)
accum=1
for ul in ${uls[@]}
do
python -u  ./train_bio.py --data_dir ./dataset/cdr \
  --max_height 35 \
  --channel_type $type \
  --bert_lr $bl \
  --transformer_type bert \
  --model_name_or_path allenai/scibert_scivocab_cased \
  --train_file train.data \
  --dev_file dev.data \
  --test_file test.data \
  --train_batch_size $bs \
  --test_batch_size $bs \
  --gradient_accumulation_steps $accum \
  --num_labels 1 \
  --learning_rate $ul \
  --max_grad_norm 1.0 \
  --warmup_ratio 0.06 \
  --num_train_epochs 30 \
  --seed 111 \
  --num_class 2 \
  --save_path ./checkpoint/cdr/train_scibert-lr${bl}_accum${accum}_unet-lr${ul}_bs${bs}.pt \
  --log_dir ./logs/cdr/train_scibert-lr${bl}_accum${accum}_unet-lr${ul}_bs${bs}.log
done
fi
yangjingla commented 2 years ago

And this code is obviously modified based on ATLOP(https://github.com/wzhouad/ATLOP), I think it is better to state this in the README😄

zxlzr commented 2 years ago

We have revised the README and stated this, many thanks.

ady-yu commented 2 years ago

We have revised the README and stated this, many thanks. when I run the cdr dataset . It occurs following mistake. ret = torch.addmm(bias, input, weight.t()) RuntimeError: mat1 dim 1 must match mat2 dim 0

TimelordRi commented 2 years ago

@ady-yu I just clone and re-run the code but no error appears. Could you offer a full error traceback message or check the changes you make to the code?

TimelordRi commented 2 years ago

@ady-yu Hey there! I find this bug when I re-run the code and fix it rightnow. You could see the update to solve this error. Thx! : )

ady-yu commented 2 years ago

@ady-yu Hey there! I find this bug when I re-run the code and fix it rightnow. You could see the update to solve this error. Thx! : )

Thanks a lot!!!

ady-yu commented 2 years ago

@ady-yu Hey there! I find this bug when I re-run the code and fix it rightnow. You could see the update to solve this error. Thx! : )

image Is there something wrong? when I run the cdr dataset , the f1 score is so high!