cpi-connect
commited on
Commit
•
7969312
1
Parent(s):
44c6516
Upload model
Browse files- configuration.py +91 -6
configuration.py
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
from transformers import PretrainedConfig
|
2 |
import torch
|
3 |
|
4 |
-
from . import utils
|
5 |
-
|
6 |
|
7 |
|
8 |
class CybersecurityKnowledgeGraphConfig(PretrainedConfig):
|
@@ -17,9 +15,96 @@ class CybersecurityKnowledgeGraphConfig(PretrainedConfig):
|
|
17 |
self.event_argument_model_path = event_argument_model_path
|
18 |
self.event_realis_model_path = event_realis_model_path
|
19 |
|
20 |
-
self.event_nugget_list = utils.event_nugget_list
|
21 |
-
self.event_args_list = utils.event_args_list
|
22 |
-
self.realis_list = utils.realis_list
|
23 |
-
self.arg_2_role = utils.arg_2_role
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
super().__init__(**kwargs)
|
|
|
1 |
from transformers import PretrainedConfig
|
2 |
import torch
|
3 |
|
|
|
|
|
4 |
|
5 |
|
6 |
class CybersecurityKnowledgeGraphConfig(PretrainedConfig):
|
|
|
15 |
self.event_argument_model_path = event_argument_model_path
|
16 |
self.event_realis_model_path = event_realis_model_path
|
17 |
|
18 |
+
# self.event_nugget_list = utils.event_nugget_list
|
19 |
+
# self.event_args_list = utils.event_args_list
|
20 |
+
# self.realis_list = utils.realis_list
|
21 |
+
# self.arg_2_role = utils.arg_2_role
|
22 |
+
|
23 |
+
self.event_nugget_list = ['O',
|
24 |
+
'B-Ransom',
|
25 |
+
'I-Ransom',
|
26 |
+
'B-DiscoverVulnerability',
|
27 |
+
'I-DiscoverVulnerability',
|
28 |
+
'B-PatchVulnerability',
|
29 |
+
'I-PatchVulnerability',
|
30 |
+
'B-Databreach',
|
31 |
+
'I-Databreach',
|
32 |
+
'B-Phishing',
|
33 |
+
'I-Phishing'
|
34 |
+
]
|
35 |
+
|
36 |
+
self.event_args_list = ['O',
|
37 |
+
'B-System',
|
38 |
+
'I-System',
|
39 |
+
'B-Organization',
|
40 |
+
'B-Money',
|
41 |
+
'I-Money',
|
42 |
+
'B-Device',
|
43 |
+
'B-Person',
|
44 |
+
'I-Person',
|
45 |
+
'B-Vulnerability',
|
46 |
+
'I-Vulnerability',
|
47 |
+
'B-Capabilities',
|
48 |
+
'I-Capabilities',
|
49 |
+
'I-Organization',
|
50 |
+
'B-PaymentMethod',
|
51 |
+
'I-PaymentMethod',
|
52 |
+
'B-Data',
|
53 |
+
'I-Data',
|
54 |
+
'B-Number',
|
55 |
+
'I-Number',
|
56 |
+
'B-Malware',
|
57 |
+
'I-Malware',
|
58 |
+
'B-PII',
|
59 |
+
'I-PII',
|
60 |
+
'B-CVE',
|
61 |
+
'I-CVE',
|
62 |
+
'B-Purpose',
|
63 |
+
'I-Purpose',
|
64 |
+
'B-File',
|
65 |
+
'I-File',
|
66 |
+
'I-Device',
|
67 |
+
'B-Time',
|
68 |
+
'I-Time',
|
69 |
+
'B-Software',
|
70 |
+
'I-Software',
|
71 |
+
'B-Patch',
|
72 |
+
'I-Patch',
|
73 |
+
'B-Version',
|
74 |
+
'I-Version',
|
75 |
+
'B-Website',
|
76 |
+
'I-Website',
|
77 |
+
'B-GPE',
|
78 |
+
'I-GPE'
|
79 |
+
]
|
80 |
+
|
81 |
+
self.realis_list =["O",
|
82 |
+
"Generic",
|
83 |
+
"Other",
|
84 |
+
"Actual"
|
85 |
+
]
|
86 |
+
self.arg_2_role = {
|
87 |
+
"File" : ['Tool', 'Trusted-Entity'],
|
88 |
+
"Person" : ['Victim', 'Attacker', 'Discoverer', 'Releaser', 'Trusted-Entity', 'Vulnerable_System_Owner'],
|
89 |
+
"Capabilities" : ['Attack-Pattern', 'Capabilities', 'Issues-Addressed'],
|
90 |
+
"Purpose" : ['Purpose'],
|
91 |
+
"Time" : ['Time'],
|
92 |
+
"PII" : ['Compromised-Data', 'Trusted-Entity'],
|
93 |
+
"Data" : ['Compromised-Data', 'Trusted-Entity'],
|
94 |
+
"Organization" : ['Victim', 'Releaser', 'Discoverer', 'Attacker', 'Vulnerable_System_Owner', 'Trusted-Entity'],
|
95 |
+
"Patch" : ['Patch'],
|
96 |
+
"Software" : ['Vulnerable_System', 'Victim', 'Trusted-Entity', 'Supported_Platform'],
|
97 |
+
"Vulnerability" : ['Vulnerability'],
|
98 |
+
"Version" : ['Patch-Number', 'Vulnerable_System_Version'],
|
99 |
+
"Device" : ['Vulnerable_System', 'Victim', 'Supported_Platform'],
|
100 |
+
"CVE" : ['CVE'],
|
101 |
+
"Number" : ['Number-of-Data', 'Number-of-Victim'],
|
102 |
+
"System" : ['Victim', 'Supported_Platform', 'Vulnerable_System', 'Trusted-Entity'],
|
103 |
+
"Malware" : ['Tool'],
|
104 |
+
"Money" : ['Price', 'Damage-Amount'],
|
105 |
+
"PaymentMethod" : ['Payment-Method'],
|
106 |
+
"GPE" : ['Place'],
|
107 |
+
"Website" : ['Trusted-Entity', 'Tool', 'Vulnerable_System', 'Victim', 'Supported_Platform'],
|
108 |
+
}
|
109 |
|
110 |
super().__init__(**kwargs)
|