-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ini
64 lines (48 loc) · 11.1 KB
/
config.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
###################################
# configuration #
###################################
[DATA]
dataset=ace
tagset_size = 3
tag2id = {"B":1, "I":2, "O":0}
position2id = {'[PAD]': 0, 0: 1, 1: 2, -1: 3, 2: 4, -2: 5, 3: 6, -3: 7, 4: 8, -4: 9, 5: 10, -5: 11, 6: 12, -6: 13, 7: 14, -7: 15, 8: 16, -8: 17, 9: 18, -9: 19, 10: 20, -10: 21, 11: 22, -11: 23, 12: 24, -12: 25, 13: 26, -13: 27, 14: 28, -14: 29, 15: 30, -15: 31, 16: 32, -16: 33, 17: 34, -17: 35, 18: 36, -18: 37, 19: 38, -19: 39, 20: 40, -20: 41, 21: 42, -21: 43, 22: 44, -22: 45, 23: 46, -23: 47, 24: 48, -24: 49, 25: 50, -25: 51, 26: 52, -26: 53, 27: 54, -27: 55, 28: 56, -28: 57, 29: 58, -29: 59, 30: 60, -30: 61, 31: 62, -31: 63, 32: 64, -32: 65, 33: 66, -33: 67, 34: 68, -34: 69, 35: 70, -35: 71, 36: 72, -36: 73, 37: 74, -37: 75, 38: 76, -38: 77, 39: 78, -39: 79, 40: 80, -40: 81, 41: 82, -41: 83, 42: 84, -42: 85, 43: 86, -43: 87, 44: 88, -44: 89, 45: 90, -45: 91, 46: 92, -46: 93, 47: 94, -47: 95, 48: 96, -48: 97, 49: 98, -49: 99, 50: 100, -50: 101, 51: 102, -51: 103, 52: 104, -52: 105, 53: 106, -53: 107, 54: 108, -54: 109, 55: 110, -55: 111, 56: 112, -56: 113, 57: 114, -57: 115, 58: 116, -58: 117, 59: 118, -59: 119, 60: 120, -60: 121, 61: 122, -61: 123, 62: 124, -62: 125, 63: 126, -63: 127, 64: 128, -64: 129, 65: 130, -65: 131, 66: 132, -66: 133, 67: 134, -67: 135, 68: 136, -68: 137, 69: 138, -69: 139, 70: 140, -70: 141, 71: 142, -71: 143, 72: 144, -72: 145, 73: 146, -73: 147, 74: 148, -74: 149, 75: 150, -75: 151, 76: 152, -76: 153, 77: 154, -77: 155, 78: 156, -78: 157, 79: 158, -79: 159, 80: 160, -80: 161, 81: 162, -81: 163, 82: 164, -82: 165, 83: 166, -83: 167, 84: 168, -84: 169, 85: 170, -85: 171, 86: 172, -86: 173, 87: 174, -87: 175, 88: 176, -88: 177, 89: 178, -89: 179, 90: 180, -90: 181, 91: 182, -91: 183, 92: 184, -92: 185, 93: 186, -93: 187, 94: 188, -94: 189, 95: 190, -95: 191, 96: 192, -96: 193, 97: 194, -97: 195, 98: 196, -98: 197, 99: 198, -99: 199, 100: 200, -100: 201, 101: 202, -101: 203, 102: 204, -102: 205, 103: 206, -103: 207, 104: 208, -104: 209, 105: 210, -105: 211, 106: 212, -106: 213, 107: 214, -107: 215, 108: 216, -108: 217, 109: 218, -109: 219, 110: 220, -110: 221, 111: 222, -111: 223, 112: 224, -112: 225, 113: 226, -113: 227, 114: 228, -114: 229, 115: 230, -115: 231, 116: 232, -116: 233, 117: 234, -117: 235, 118: 236, -118: 237, 119: 238, -119: 239, 120: 240, -120: 241, 121: 242, -121: 243, 122: 244, -122: 245, 123: 246, -123: 247, 124: 248, -124: 249, 125: 250, -125: 251, 126: 252, -126: 253, 127: 254, -127: 255, 128: 256, -128: 257, 129: 258, -129: 259, 130: 260, -130: 261, 131: 262, -131: 263, 132: 264, -132: 265, 133: 266, -133: 267, 134: 268, -134: 269, 135: 270, -135: 271, 136: 272, -136: 273, 137: 274, -137: 275, 138: 276, -138: 277, 139: 278, -139: 279, 140: 280, -140: 281, 141: 282, -141: 283, 142: 284, -142: 285, 143: 286, -143: 287, 144: 288, -144: 289, 145: 290, -145: 291, 146: 292, -146: 293, 147: 294, -147: 295, 148: 296, -148: 297, 149: 298, -149: 299, 150: 300, -150: 301, 151: 302, -151: 303, 152: 304, -152: 305, 153: 306, -153: 307, 154: 308, -154: 309, 155: 310, -155: 311, 156: 312, -156: 313, 157: 314, -157: 315, 158: 316, -158: 317, 159: 318, -159: 319, 160: 320, -160: 321, 161: 322, -161: 323, 162: 324, -162: 325, 163: 326, -163: 327, 164: 328, -164: 329, 165: 330, -165: 331, 166: 332, -166: 333, 167: 334, -167: 335, 168: 336, -168: 337, 169: 338, -169: 339, 170: 340, -170: 341, 171: 342, -171: 343, 172: 344, -172: 345, 173: 346, -173: 347, 174: 348, -174: 349, 175: 350, -175: 351, 176: 352, -176: 353, 177: 354, -177: 355, 178: 356, -178: 357, 179: 358, -179: 359, 180: 360, -180: 361, 181: 362, -181: 363, 182: 364, -182: 365, 183: 366, -183: 367, 184: 368, -184: 369, 185: 370, -185: 371, 186: 372, -186: 373, 187: 374, -187: 375, 188: 376, -188: 377, 189: 378, -189: 379, 190: 380, -190: 381, 191: 382, -191: 383, 192: 384, -192: 385, 193: 386, -193: 387, 194: 388, -194: 389, 195: 390, -195: 391, 196: 392, -196: 393, 197: 394, -197: 395, 198: 396, -198: 397, 199: 398, -199: 399, 200: 400, -200: 401, 201: 402, -201: 403, 202: 404, -202: 405, 203: 406, -203: 407, 204: 408, -204: 409, 205: 410, -205: 411, 206: 412, -206: 413, 207: 414, -207: 415, 208: 416, -208: 417, 209: 418, -209: 419, 210: 420, -210: 421, 211: 422, -211: 423, 212: 424, -212: 425, 213: 426, -213: 427, 214: 428, -214: 429, 215: 430, -215: 431, 216: 432, -216: 433, 217: 434, -217: 435, 218: 436, -218: 437, 219: 438, -219: 439, 220: 440, -220: 441, 221: 442, -221: 443, 222: 444, -222: 445, 223: 446, -223: 447, 224: 448, -224: 449, 225: 450, -225: 451, 226: 452, -226: 453, 227: 454, -227: 455, 228: 456, -228: 457, 229: 458, -229: 459, 230: 460, -230: 461, 231: 462, -231: 463, 232: 464, -232: 465, 233: 466, -233: 467, 234: 468, -234: 469, 235: 470, -235: 471, 236: 472, -236: 473, 237: 474, -237: 475, 238: 476, -238: 477, 239: 478, -239: 479, 240: 480, -240: 481, 241: 482, -241: 483, 242: 484, -242: 485, 243: 486, -243: 487, 244: 488, -244: 489, 245: 490, -245: 491, 246: 492, -246: 493, 247: 494, -247: 495, 248: 496, -248: 497, 249: 498, -249: 499, 250: 500, -250: 501}
role2id = {'[PAD]': 0, 'Prosecutor': 1, 'Origin': 2, 'Org': 3, 'Person': 4, 'Destination': 5, 'Buyer': 6, 'Instrument': 7, 'Position': 8, 'Artifact': 9, 'Sentence': 10, 'Target': 11, 'Price': 12, 'Crime': 13, 'Beneficiary': 14, 'Agent': 15, 'Seller': 16, 'Money': 17, 'Giver': 18, 'Defendant': 19, 'Vehicle': 20, 'Adjudicator': 21, 'Recipient': 22, 'Victim': 23, 'Plaintiff': 24, 'Place': 25, 'Attacker': 26, 'Entity': 27, 'Time-At-End': 28, 'Time-Before': 29, 'Time-At-Beginning': 30, 'Time-Ending': 31, 'Time-Holds': 32, 'Time-After': 33, 'Time-Starting': 34, 'Time-Within': 35}
event2id = {'[PAD]': 0, 'Justice:Trial-Hearing': 1, 'Business:Merge-Org': 2, 'Personnel:Start-Position': 3, 'Justice:Acquit': 4, 'Business:Start-Org': 5, 'Justice:Convict': 6, 'Life:Be-Born': 7, 'Contact:Phone-Write': 8, 'Life:Marry': 9, 'Justice:Sue': 10, 'Justice:Fine': 11, 'Justice:Pardon': 12, 'Justice:Release-Parole': 13, 'Life:Die': 14, 'Personnel:Elect': 15, 'Transaction:Transfer-Ownership': 16, 'Transaction:Transfer-Money': 17, 'Personnel:Nominate': 18, 'Justice:Appeal': 19, 'Business:Declare-Bankruptcy': 20, 'Contact:Meet': 21, 'Movement:Transport': 22, 'Justice:Charge-Indict': 23, 'Justice:Execute': 24, 'Life:Injure': 25, 'Business:End-Org': 26, 'Life:Divorce': 27, 'Conflict:Demonstrate': 28, 'Justice:Sentence': 29, 'Personnel:End-Position': 30, 'Conflict:Attack': 31, 'Justice:Arrest-Jail': 32, 'Justice:Extradite': 33}
event2role = {'Business:Declare-Bankruptcy': ['Org', 'Time-After', 'Place', 'Time-Within', 'Time-At-Beginning'], 'Business:End-Org': ['Place', 'Org', 'Time-Within', 'Time-After', 'Time-Holds', 'Time-At-Beginning'], 'Business:Merge-Org': ['Org', 'Time-Ending'], 'Business:Start-Org': ['Org', 'Agent', 'Place', 'Time-Within', 'Time-Starting', 'Time-Before', 'Time-After'], 'Conflict:Attack': ['Attacker', 'Place', 'Target', 'Time-Within', 'Time-Ending', 'Instrument', 'Time-Holds', 'Time-At-Beginning', 'Victim', 'Time-After', 'Time-Starting', 'Time-Before', 'Time-At-End', 'Agent'], 'Conflict:Demonstrate': ['Place', 'Entity', 'Time-Within', 'Time-Starting', 'Time-At-End'], 'Contact:Meet': ['Place', 'Entity', 'Time-Within', 'Time-Holds', 'Time-At-Beginning', 'Time-Starting', 'Time-Ending', 'Time-After'], 'Contact:Phone-Write': ['Entity', 'Time-Within', 'Time-Before', 'Place', 'Time-Holds', 'Time-Starting', 'Time-After'], 'Justice:Acquit': ['Defendant', 'Adjudicator', 'Crime', 'Time-Within'], 'Justice:Appeal': ['Adjudicator', 'Plaintiff', 'Place', 'Crime', 'Time-Within', 'Time-Holds'], 'Justice:Arrest-Jail': ['Person', 'Agent', 'Time-Within', 'Place', 'Crime', 'Time-Holds', 'Time-Ending', 'Time-Starting', 'Time-Before', 'Time-At-Beginning'], 'Justice:Charge-Indict': ['Adjudicator', 'Defendant', 'Crime', 'Prosecutor', 'Time-Within', 'Place', 'Time-Before', 'Time-Ending'], 'Justice:Convict': ['Defendant', 'Adjudicator', 'Crime', 'Place', 'Time-Within', 'Time-At-Beginning'], 'Justice:Execute': ['Agent', 'Place', 'Person', 'Time-After', 'Time-Within', 'Crime', 'Time-At-Beginning'], 'Justice:Extradite': ['Destination', 'Origin', 'Person', 'Agent', 'Time-Within'], 'Justice:Fine': ['Entity', 'Money', 'Crime', 'Adjudicator', 'Place', 'Time-Within'], 'Justice:Pardon': ['Defendant', 'Adjudicator', 'Place', 'Time-At-End'], 'Justice:Release-Parole': ['Person', 'Entity', 'Time-Within', 'Place', 'Crime', 'Time-After'], 'Justice:Sentence': ['Adjudicator', 'Defendant', 'Sentence', 'Crime', 'Place', 'Time-Within', 'Time-Starting', 'Time-At-End'], 'Justice:Sue': ['Plaintiff', 'Defendant', 'Crime', 'Adjudicator', 'Place', 'Time-Within', 'Time-Holds'], 'Justice:Trial-Hearing': ['Defendant', 'Crime', 'Adjudicator', 'Prosecutor', 'Place', 'Time-Starting', 'Time-Within', 'Time-At-End', 'Time-Holds'], 'Life:Be-Born': ['Place', 'Person', 'Time-Within', 'Time-Holds'], 'Life:Die': ['Victim', 'Agent', 'Place', 'Time-Within', 'Instrument', 'Time-Before', 'Time-After', 'Person', 'Time-Holds', 'Time-Starting', 'Time-Ending', 'Time-At-Beginning'], 'Life:Divorce': ['Person', 'Time-Within', 'Place'], 'Life:Injure': ['Victim', 'Agent', 'Place', 'Time-Within', 'Instrument'], 'Life:Marry': ['Person', 'Time-Within', 'Place', 'Time-Holds', 'Time-Before'], 'Movement:Transport': ['Vehicle', 'Artifact', 'Destination', 'Agent', 'Time-At-Beginning', 'Time-Within', 'Origin', 'Time-At-End', 'Time-Starting', 'Time-Ending', 'Time-After', 'Time-Holds', 'Victim', 'Place', 'Time-Before'], 'Personnel:Elect': ['Person', 'Position', 'Entity', 'Place', 'Time-Within', 'Time-Starting', 'Time-Holds', 'Time-Before', 'Time-At-Beginning'], 'Personnel:End-Position': ['Person', 'Entity', 'Position', 'Time-Within', 'Place', 'Time-Ending', 'Time-Holds', 'Time-Before', 'Time-Starting', 'Time-After', 'Time-At-End'], 'Personnel:Nominate': ['Person', 'Agent', 'Time-Within', 'Position'], 'Personnel:Start-Position': ['Person', 'Entity', 'Position', 'Place', 'Time-Within', 'Time-At-Beginning', 'Time-After', 'Time-Starting', 'Time-Holds', 'Time-Before'], 'Transaction:Transfer-Money': ['Giver', 'Recipient', 'Money', 'Beneficiary', 'Time-Holds', 'Time-Within', 'Time-Starting', 'Place', 'Time-Before', 'Time-After'], 'Transaction:Transfer-Ownership': ['Artifact', 'Buyer', 'Seller', 'Time-Within', 'Place', 'Time-Before', 'Beneficiary', 'Price', 'Time-At-Beginning', 'Time-Ending']}
[MODEL]
seed = 12345
pretrained_model_name=bert-base-uncased
#pretrained_model_name=bert-large-uncased
#transformers_path = /bert-large-uncased
transformers_path= /bert-base-uncased
hidden_dim = 512
trans_head = 8
trans_layer = 2
unit_layer = 3
trans_drop = 0.1
#before transformer
cla_drop = 0.1
#before classification
[Train]
num_train_epochs=50.0
# Total number of training epochs to perform.
learning_rate=2e-5
# The initial learning rate for Adam.
per_gpu_train_batch_size=24
# Batch size per GPU/CPU for training.
per_gpu_eval_batch_size=12
# Batch size per GPU/CPU for evaluation.
# opitimier
weight_decay=1e-3
# Weight deay if we apply some.
adam_epsilon=1e-8
# Epsilon for Adam optimizer.
max_grad_norm=1.0
# Max gradient norm.
warmup_steps=0
# Linear warmup over warmup_steps.
train_optimi_step = -1
#total training steps
early_stop = 15
print_step=20
#Print log every k steps in training process