Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help: BERT Fine Tuning #215

Closed
abhishekdhiman25 opened this issue Feb 27, 2024 · 1 comment
Closed

Need help: BERT Fine Tuning #215

abhishekdhiman25 opened this issue Feb 27, 2024 · 1 comment

Comments

@abhishekdhiman25
Copy link

abhishekdhiman25 commented Feb 27, 2024

Hi Reader

I have installed TRAM using developer's setup guide in windows system.
I want to fine tune SciBERT using "fine_tune_multi_label.ipynb" notebook with my own data.
I want to know do i need to change the classes in according to my data.
Actually i have prepared training data for all 537 ATT&CK labels in similar format as of "multi_label.json".
Is it is necessary to change the Classes in 2nd cell code of "fine_tune_multi_label.ipynb", If Yes how it can be done , is there a particular format for this.
My colleague tried this earlier and got some error related to out_features of bert model set to 50 , so he set it to 537 but accuracy score dropped to zero.

Please tell me some way how can i fine tune it on my data with larger number of ATT&CK labels more than 50.

For reference 2nd cell Code:
from sklearn.preprocessing import MultiLabelBinarizer as MLB

CLASSES = [
'T1003.001', 'T1005', 'T1012', 'T1016', 'T1021.001', 'T1027',
'T1033', 'T1036.005', 'T1041', 'T1047', 'T1053.005', 'T1055',
'T1056.001', 'T1057', 'T1059.003', 'T1068', 'T1070.004',
'T1071.001', 'T1072', 'T1074.001', 'T1078', 'T1082', 'T1083',
'T1090', 'T1095', 'T1105', 'T1106', 'T1110', 'T1112', 'T1113',
'T1140', 'T1190', 'T1204.002', 'T1210', 'T1218.011', 'T1219',
'T1484.001', 'T1518.001', 'T1543.003', 'T1547.001', 'T1548.002',
'T1552.001', 'T1557.001', 'T1562.001', 'T1564.001', 'T1566.001',
'T1569.002', 'T1570', 'T1573.001', 'T1574.002'
]

mlb = MLB(classes=CLASSES)
mlb.fit([[c] for c in CLASSES])

mlb

@abhishekdhiman25 abhishekdhiman25 changed the title Need help regarding Sci-BERT Fine Tuning Need help: BERT Fine Tuning Feb 29, 2024
@mehaase
Copy link
Contributor

mehaase commented Mar 18, 2024

I think this is answered in #216. Please re-open if there's something I missed.

@mehaase mehaase closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants