Skip to content

Commit bb290bd

Browse files
committed
commit
2 parents 4747081 + 18b6235 commit bb290bd

File tree

15 files changed

+2062
-677
lines changed

15 files changed

+2062
-677
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,8 @@
66
/src/__pycache__
77
/log
88
*.pt
9-
*.txt
9+
*.txt
10+
wandb/
11+
/test
12+
log/
13+
figures/

run.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#SBATCH --cpus-per-task=5
88
#SBATCH --mem=20GB
99
#SBATCH -d singleton
10+
<<<<<<< HEAD
1011
#SBATCH --exclude=node172,node181,node130,node152,node129,node127,node143,node161
1112

1213
echo "SLURM_JOBID="$SLURM_JOBID
@@ -21,8 +22,8 @@ conda activate event-relation-extraction
2122

2223
export PYTHONPATH="/home/tianyiyang/git/CE2ERE/"
2324

24-
python src/main.py --data_dir=data --model bilstm --embedding_type longformer-base --data_dir data --data_type hieve --downsample 0.02 --epochs 50 --lambda_anno 1 --lambda_trans 0 --learning_rate 1e-05 --log_batch_size 6 --lstm_hidden_size 256 --lstm_input_size 768 --mlp_size 512 --roberta_hidden_size 768 --num_layers 1
25-
25+
python src/__main__.py --data_dir=data --model bilstm --data_dir data --data_type matres --downsample 0.02 --epochs 50 --lambda_anno 1 --lambda_trans 0 --learning_rate 1e-05 --log_batch_size 6 --lstm_hidden_size 256 --lstm_input_size 768 --mlp_size 512 --roberta_hidden_size 768 --num_layers 1
26+
#python src/main.py --data_dir=data --model bilstm --embedding_type longformer-base --data_dir data --data_type hieve --downsample 0.02 --epochs 50 --lambda_anno 1 --lambda_trans 0 --learning_rate 1e-05 --log_batch_size 6 --lstm_hidden_size 256 --lstm_input_size 768 --mlp_size 512 --roberta_hidden_size 768 --num_layers 1
2627
# python src/main.py --data_dir=data --model box --embedding_type roberta-base --data_dir data --data_type hieve --downsample 0.02 --epochs 50 --lambda_anno 1 --lambda_trans 0 --learning_rate 1e-05 --log_batch_size 6 --lstm_hidden_size 256 --lstm_input_size 768 --mlp_size 512 --roberta_hidden_size 768 --num_layers 1
2728

2829
echo "DONE"

src/count.py

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
box_const_dict = {('h10', 'h10', 'h01'): 0, ('h10', 'h10', 'h11'): 0, ('h10', 'h10', 'h00'): 2, ('h10', 'h10', 'm01'): 65, ('h10', 'h11', 'h01'): 0, ('h10', 'h11', 'h11'): 0, ('h10', 'h11', 'h00'): 0, ('h10', 'h11', 'm01'): 0, ('h10', 'h00', 'h01'): 4, ('h10', 'h00', 'h11'): 0, ('h10', 'm10', 'm01'): 113, ('h10', 'm10', 'm11'): 0, ('h10', 'm10', 'm00'): 41, ('h10', 'm10', 'h01'): 101, ('h10', 'm10', 'h11'): 0, ('h10', 'm11', 'm01'): 3, ('h10', 'm11', 'm11'): 0, ('h10', 'm11', 'm00'): 0, ('h10', 'm11', 'h01'): 0, ('h10', 'm11', 'h11'): 0, ('h01', 'h01', 'h10'): 0, ('h01', 'h01', 'h11'): 0, ('h01', 'h01', 'h00'): 2, ('h01', 'h01', 'm10'): 113, ('h01', 'h11', 'h10'): 0, ('h01', 'h11', 'h11'): 0, ('h01', 'h11', 'h00'): 0, ('h01', 'h11', 'm10'): 0, ('h01', 'h00', 'h10'): 4, ('h01', 'h00', 'h11'): 0, ('h01', 'm01', 'm10'): 182, ('h01', 'm01', 'm11'): 0, ('h01', 'm01', 'm00'): 88, ('h01', 'm01', 'h10'): 59, ('h01', 'm01', 'h11'): 0, ('h01', 'm11', 'm10'): 9, ('h01', 'm11', 'm11'): 0, ('h01', 'm11', 'm00'): 1, ('h01', 'm11', 'h10'): 0, ('h01', 'm11', 'h11'): 0, ('h11', 'h10', 'h01'): 0, ('h11', 'h10', 'h11'): 0, ('h11', 'h10', 'h00'): 0, ('h11', 'h10', 'm01'): 0, ('h11', 'h01', 'h10'): 0, ('h11', 'h01', 'h11'): 0, ('h11', 'h01', 'h00'): 0, ('h11', 'h01', 'm10'): 0, ('h11', 'h11', 'h10'): 0, ('h11', 'h11', 'h01'): 0, ('h11', 'h11', 'h00'): 0, ('h11', 'h11', 'm10'): 0, ('h11', 'h11', 'm01'): 0, ('h11', 'h11', 'm00'): 0, ('h11', 'h00', 'h10'): 0, ('h11', 'h00', 'h01'): 0, ('h11', 'h00', 'h11'): 0, ('h11', 'm10', 'm01'): 0, ('h11', 'm10', 'm11'): 0, ('h11', 'm10', 'm00'): 0, ('h11', 'm10', 'h01'): 0, ('h11', 'm10', 'h11'): 0, ('h11', 'm01', 'm10'): 0, ('h11', 'm01', 'm11'): 0, ('h11', 'm01', 'm00'): 0, ('h11', 'm01', 'h10'): 0, ('h11', 'm01', 'h11'): 0, ('h11', 'm11', 'm10'): 0, ('h11', 'm11', 'm01'): 0, ('h11', 'm11', 'm00'): 0, ('h11', 'm00', 'm10'): 0, ('h11', 'm00', 'm01'): 0, ('h11', 'm00', 'm11'): 0, ('h00', 'h10', 'h01'): 0, ('h00', 'h10', 'h11'): 0, ('h00', 'h01', 'h10'): 2, ('h00', 'h01', 'h11'): 0, ('h00', 'h11', 'h10'): 0, ('h00', 'h11', 'h01'): 0, ('h00', 'h11', 'h11'): 0, ('m10', 'h10', 'm01'): 146, ('m10', 'h10', 'm11'): 0, ('m10', 'h10', 'm00'): 93, ('m10', 'h10', 'h01'): 88, ('m10', 'h10', 'h11'): 0, ('m10', 'h11', 'm01'): 0, ('m10', 'h11', 'm11'): 0, ('m10', 'h11', 'm00'): 0, ('m10', 'h11', 'h01'): 0, ('m10', 'h11', 'h11'): 0, ('m10', 'm10', 'm01'): 0, ('m10', 'm10', 'm11'): 0, ('m10', 'm10', 'm00'): 0, ('m10', 'm10', 'h01'): 209, ('m10', 'm10', 'h11'): 0, ('m10', 'm11', 'm01'): 0, ('m10', 'm11', 'm11'): 0, ('m10', 'm11', 'm00'): 0, ('m10', 'm11', 'h01'): 7, ('m10', 'm11', 'h11'): 0, ('m10', 'm00', 'm01'): 1, ('m10', 'm00', 'm11'): 0, ('m01', 'h01', 'm10'): 181, ('m01', 'h01', 'm11'): 1, ('m01', 'h01', 'm00'): 80, ('m01', 'h01', 'h10'): 61, ('m01', 'h01', 'h11'): 0, ('m01', 'h11', 'm10'): 0, ('m01', 'h11', 'm11'): 0, ('m01', 'h11', 'm00'): 0, ('m01', 'h11', 'h10'): 0, ('m01', 'h11', 'h11'): 0, ('m01', 'm01', 'm10'): 0, ('m01', 'm01', 'm11'): 0, ('m01', 'm01', 'm00'): 1, ('m01', 'm01', 'h10'): 103, ('m01', 'm01', 'h11'): 0, ('m01', 'm11', 'm10'): 0, ('m01', 'm11', 'm11'): 0, ('m01', 'm11', 'm00'): 1, ('m01', 'm11', 'h10'): 4, ('m01', 'm11', 'h11'): 0, ('m01', 'm00', 'm10'): 1, ('m01', 'm00', 'm11'): 0, ('m11', 'h10', 'm01'): 5, ('m11', 'h01', 'm10'): 3, ('m11', 'h11', 'm10'): 0, ('m11', 'h11', 'm01'): 0, ('m11', 'h11', 'm00'): 0, ('m11', 'm10', 'm01'): 0, ('m11', 'm10', 'm11'): 0, ('m11', 'm10', 'm00'): 0, ('m11', 'm10', 'h01'): 4, ('m11', 'm10', 'h11'): 0, ('m11', 'm01', 'm10'): 0, ('m11', 'm01', 'm11'): 0, ('m11', 'm01', 'm00'): 0, ('m11', 'm01', 'h10'): 8, ('m11', 'm01', 'h11'): 0, ('m11', 'm11', 'm10'): 0, ('m11', 'm11', 'm01'): 0, ('m11', 'm11', 'm00'): 0, ('m11', 'm00', 'm10'): 1, ('m11', 'm00', 'm01'): 1, ('m11', 'm00', 'm11'): 0, ('m11', 'm00', 'h11'): 0, ('m00', 'h11', 'm10'): 0, ('m00', 'h11', 'm01'): 0, ('m00', 'h11', 'm11'): 0, ('m00', 'h11', 'h11'): 0, ('m00', 'm10', 'm01'): 0, ('m00', 'm10', 'm11'): 0, ('m00', 'm01', 'm10'): 0, ('m00', 'm01', 'm11'): 0, ('m00', 'm11', 'm10'): 1, ('m00', 'm11', 'm01'): 1, ('m00', 'm11', 'm11'): 0}
3+
4+
# vector_const_dict = {(0, 0, 1): 0, (0, 0, 2): 4, (0, 0, 3): 12, (0, 0, 5): 388, (0, 2, 1): 1, (0, 2, 2): 66, (0, 2, 3): 21, (0, 2, 5): 207, (0, 3, 1): 93, (0, 3, 2): 83, (0, 4, 5): 730, (0, 4, 6): 0, (0, 4, 7): 93, (0, 4, 1): 487, (0, 4, 2): 564, (0, 6, 5): 4, (0, 6, 6): 2, (0, 6, 7): 0, (0, 6, 1): 0, (0, 6, 2): 0, (1, 1, 0): 0, (1, 1, 2): 0, (1, 1, 3): 4, (1, 1, 4): 336, (1, 2, 0): 3, (1, 2, 2): 51, (1, 2, 3): 28, (1, 2, 4): 552, (1, 3, 0): 12, (1, 3, 2): 11, (1, 5, 4): 966, (1, 5, 6): 2, (1, 5, 7): 167, (1, 5, 0): 693, (1, 5, 2): 245, (1, 6, 4): 0, (1, 6, 6): 1, (1, 6, 7): 0, (1, 6, 0): 0, (1, 6, 2): 0, (2, 0, 1): 2, (2, 0, 2): 42, (2, 0, 3): 38, (2, 0, 5): 350, (2, 1, 0): 6, (2, 1, 2): 31, (2, 1, 3): 32, (2, 1, 4): 246, (2, 2, 0): 38, (2, 2, 1): 29, (2, 2, 3): 17, (2, 2, 4): 179, (2, 2, 5): 67, (2, 2, 7): 8, (2, 3, 0): 113, (2, 3, 1): 31, (2, 3, 2): 25, (2, 4, 5): 131, (2, 4, 6): 0, (2, 4, 7): 41, (2, 4, 1): 247, (2, 4, 2): 184, (2, 5, 4): 174, (2, 5, 6): 0, (2, 5, 7): 20, (2, 5, 0): 427, (2, 5, 2): 78, (2, 6, 4): 0, (2, 6, 5): 2, (2, 6, 7): 0, (2, 7, 4): 83, (2, 7, 5): 16, (2, 7, 6): 0, (3, 0, 1): 13, (3, 0, 2): 57, (3, 1, 0): 5, (3, 1, 2): 18, (3, 2, 0): 24, (3, 2, 1): 36, (3, 2, 2): 43, (4, 0, 5): 1065, (4, 0, 6): 0, (4, 0, 7): 73, (4, 0, 1): 361, (4, 0, 2): 296, (4, 2, 5): 130, (4, 2, 6): 0, (4, 2, 7): 46, (4, 2, 1): 516, (4, 2, 2): 208, (4, 4, 5): 151, (4, 4, 6): 3, (4, 4, 7): 128, (4, 4, 1): 1293, (4, 4, 2): 371, (4, 6, 5): 5, (4, 6, 6): 4, (4, 6, 7): 4, (4, 6, 1): 0, (4, 6, 2): 0, (4, 7, 5): 129, (4, 7, 6): 8, (5, 1, 4): 910, (5, 1, 6): 0, (5, 1, 7): 340, (5, 1, 0): 343, (5, 1, 2): 440, (5, 2, 4): 133, (5, 2, 6): 0, (5, 2, 7): 15, (5, 2, 0): 194, (5, 2, 2): 107, (5, 5, 4): 9, (5, 5, 6): 2, (5, 5, 7): 1, (5, 5, 0): 432, (5, 5, 2): 26, (5, 6, 4): 0, (5, 6, 6): 1, (5, 6, 7): 0, (5, 6, 0): 0, (5, 6, 2): 0, (5, 7, 4): 97, (5, 7, 6): 0, (6, 0, 5): 0, (6, 1, 4): 0, (6, 2, 4): 0, (6, 2, 5): 0, (6, 2, 7): 0, (6, 4, 5): 3, (6, 4, 6): 7, (6, 4, 7): 9, (6, 4, 1): 0, (6, 4, 2): 0, (6, 5, 4): 0, (6, 5, 6): 0, (6, 5, 7): 1, (6, 5, 0): 0, (6, 5, 2): 0, (6, 6, 4): 0, (6, 6, 5): 0, (6, 6, 7): 0, (6, 7, 4): 0, (6, 7, 5): 0, (6, 7, 6): 0, (6, 7, 2): 0, (7, 2, 4): 78, (7, 2, 5): 24, (7, 2, 6): 0, (7, 2, 2): 15, (7, 4, 5): 97, (7, 4, 6): 13, (7, 5, 4): 63, (7, 5, 6): 2, (7, 6, 4): 0, (7, 6, 5): 0, (7, 6, 6): 0}
5+
vector_const_dict = {(0, 0, 1): 0, (0, 0, 2): 6, (0, 0, 3): 5, (0, 2, 1): 5, (0, 2, 2): 50, (0, 2, 3): 24, (0, 3, 1): 22, (0, 3, 2): 28, (1, 1, 0): 2, (1, 1, 2): 2, (1, 1, 3): 19, (1, 2, 0): 4, (1, 2, 2): 46, (1, 2, 3): 26, (1, 3, 0): 23, (1, 3, 2): 11, (2, 0, 1): 10, (2, 0, 2): 27, (2, 0, 3): 43, (2, 1, 0): 16, (2, 1, 2): 37, (2, 1, 3): 26, (2, 2, 0): 31, (2, 2, 1): 25, (2, 2, 3): 7, (2, 3, 0): 51, (2, 3, 1): 41, (2, 3, 2): 18, (3, 0, 1): 17, (3, 0, 2): 18, (3, 1, 0): 17, (3, 1, 2): 48, (3, 2, 0): 13, (3, 2, 1): 48, (3, 2, 2): 34}
6+
all_const_count_box = {
7+
("h10", "h10"): 0, ("h10", "h01"): 0, ("h10", "h11"): 0, ("h10", "h00"): 0,
8+
("h01", "h10"): 0, ("h01", "h01"): 0, ("h01", "h11"): 0, ("h01", "h00"): 0,
9+
("h11", "h10"): 0, ("h11", "h01"): 0, ("h11", "h11"): 0, ("h11", "h00"): 0,
10+
("h00", "h10"): 0, ("h00", "h01"): 0, ("h00", "h11"): 0, ("h00", "h00"): 0,
11+
12+
("m10", "m10"): 0, ("m10", "m01"): 0, ("m10", "m11"): 0, ("m10", "m00"): 0,
13+
("m01", "m10"): 0, ("m01", "m01"): 0, ("m01", "m11"): 0, ("m01", "m00"): 0,
14+
("m11", "m10"): 0, ("m11", "m01"): 0, ("m11", "m11"): 0, ("m11", "m00"): 0,
15+
("m00", "m10"): 0, ("m00", "m01"): 0, ("m00", "m11"): 0, ("m00", "m00"): 0,
16+
17+
("h10", "m10"): 0, ("h10", "m01"): 0, ("h10", "m11"): 0, ("h10", "m00"): 0,
18+
("h01", "m10"): 0, ("h01", "m01"): 0, ("h01", "m11"): 0, ("h01", "m00"): 0,
19+
("h11", "m10"): 0, ("h11", "m01"): 0, ("h11", "m11"): 0, ("h11", "m00"): 0,
20+
("h00", "m10"): 0, ("h00", "m01"): 0, ("h00", "m11"): 0, ("h00", "m00"): 0,
21+
22+
("m10", "h10"): 0, ("m10", "h01"): 0, ("m10", "h11"): 0, ("m10", "h00"): 0,
23+
("m01", "h10"): 0, ("m01", "h01"): 0, ("m01", "h11"): 0, ("m01", "h00"): 0,
24+
("m11", "h10"): 0, ("m11", "h01"): 0, ("m11", "h11"): 0, ("m11", "h00"): 0,
25+
("m00", "h10"): 0, ("m00", "h01"): 0, ("m00", "h11"): 0, ("m00", "h00"): 0,
26+
}
27+
28+
29+
all_const_count_vec = {
30+
(0, 0): 0, (0, 1): 0, (0, 2): 0, (0, 3): 0,
31+
(1, 0): 0, (1, 1): 0, (1, 2): 0, (1, 3): 0,
32+
(2, 0): 0, (2, 1): 0, (2, 2): 0, (2, 3): 0,
33+
(3, 0): 0, (3, 1): 0, (3, 2): 0, (3, 3): 0,
34+
35+
(4, 4): 0, (4, 5): 0, (4, 6): 0, (4, 7): 0,
36+
(5, 4): 0, (5, 5): 0, (5, 6): 0, (5, 7): 0,
37+
(6, 4): 0, (6, 5): 0, (6, 6): 0, (6, 7): 0,
38+
(7, 4): 0, (7, 5): 0, (7, 6): 0, (7, 7): 0,
39+
40+
(0, 4): 0, (0, 5): 0, (0, 6): 0, (0, 7): 0,
41+
(1, 4): 0, (1, 5): 0, (1, 6): 0, (1, 7): 0,
42+
(2, 4): 0, (2, 5): 0, (2, 6): 0, (2, 7): 0,
43+
(3, 4): 0, (3, 5): 0, (3, 6): 0, (3, 7): 0,
44+
45+
(4, 0): 0, (4, 1): 0, (4, 2): 0, (4, 3): 0,
46+
(5, 0): 0, (5, 1): 0, (5, 2): 0, (5, 3): 0,
47+
(6, 0): 0, (6, 1): 0, (6, 2): 0, (6, 3): 0,
48+
(7, 0): 0, (7, 1): 0, (7, 2): 0, (7, 3): 0,
49+
}
50+
51+
for (key, value) in box_const_dict.items():
52+
a,b,g = key
53+
54+
all_const_count_box[(a,b)] += value
55+
56+
for (key, value) in vector_const_dict.items():
57+
a,b,g = key
58+
59+
all_const_count_vec[(a,b)] += value
60+
61+
62+
print(all_const_count_box)
63+
print(all_const_count_vec)

0 commit comments

Comments
 (0)