File size: 10,537 Bytes
05b0e9e |
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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
"""
Input config for pipeline
"""
def config_file() -> dict:
config = {
"BERT_config": {
"model_emb": 'bert',
"model_option": {
"PathologyEmoryPubMedBERT": {
"model_folder":"models/higher_order_hierarchy/PathologyEmoryPubMedBERT/"
},
"PathologyEmoryBERT": {
"model_folder":"models/higher_order_hierarchy/PathologyEmoryBERT/"
},
"ClinicalBERT": {
"model_folder":"models/higher_order_hierarchy/ClinicalBERT/"
},
"BlueBERT": {
"model_folder":"models/higher_order_hierarchy/BlueBERT/"
},
"BioBERT": {
"model_folder":"models/higher_order_hierarchy/BioBERT/"
},
"BERT": {
"model_folder":"models/higher_order_hierarchy/BERT/"
},
},
"max_seq_length": "64",
"threshold_prediction":0.5,
"classes": ['Invasive breast cancer-IBC','Non-breast cancer-NBC','In situ breast cancer-ISC',
'Borderline lesion-BLL','High risk lesion-HRL','Benign-B','Negative'],
"worst_rank" : ['Invasive breast cancer-IBC', 'In situ breast cancer-ISC', 'High risk lesion-HRL',
'Borderline lesion-BLL','Benign-B','Non-breast cancer-NBC','Negative']
},
"ibc_config": {
"model_option": {
"single_tfidf": {
"path_model":"models/all_labels_hierarchy/single_tfidf/classifiers",
"model": "ibc_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"vectorizer":"vectorizer_all_branches.pkl",
"path_bigrmas":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
},
"branch_tfidf": {
"path_model":"models/all_labels_hierarchy/branch_tfidf/classifiers",
"model": "ibc_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"vectorizer":"ibc_vectorizer.pkl",
"path_bigrmas":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
}
},
"classes": ['apocrine carcinoma','grade i','grade ii','grade iii','invasive ductal carcinoma','invasive lobular carcinoma','medullary carcinoma','metaplastic carcinoma','mucinous carcinoma','tubular carcinoma','lymph node - metastatic']
},
"isc_config": {
"model_option": {
"single_tfidf": {
"path_model":"models/all_labels_hierarchy/single_tfidf/classifiers",
"model": "isc_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"vectorizer":"vectorizer_all_branches.pkl",
"path_bigrmas":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
},
"branch_tfidf": {
"path_model":"models/all_labels_hierarchy/branch_tfidf/classifiers",
"model": "isc_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"vectorizer":"isc_vectorizer.pkl",
"path_bigrmas":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
}
},
"classes": ['ductal carcinoma in situ','high','intermediate','intracystic papillary carcinoma','intraductal papillary carcinoma','low','pagets','fna - malignant']
},
"hrl_config": {
"model_option": {
"single_tfidf": {
"path_model":"models/all_labels_hierarchy/single_tfidf/classifiers",
"model": "hrl_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"vectorizer":"vectorizer_all_branches.pkl",
"path_bigrmas":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
},
"branch_tfidf": {
"path_model":"models/all_labels_hierarchy/branch_tfidf/classifiers",
"model": "hrl_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"vectorizer":"hrl_vectorizer.pkl",
"path_bigrmas":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
}
},
"classes": ['atypical ductal hyperplasia','atypical lobular hyperplasia','atypical papilloma','columnar cell change with atypia','flat epithelial atypia','hyperplasia with atypia','intraductal papilloma','lobular carcinoma in situ','microscopic papilloma','radial scar']
},
"bll_config": {
"model_option": {
"single_tfidf": {
"path_model":"models/all_labels_hierarchy/single_tfidf/classifiers",
"model": "bll_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"vectorizer":"vectorizer_all_branches.pkl",
"path_bigrmas":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
},
"branch_tfidf": {
"path_model":"models/all_labels_hierarchy/branch_tfidf/classifiers",
"model": "bll_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"vectorizer":"bll_vectorizer.pkl",
"path_bigrmas":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
}
},
"classes": ['atypical phyllodes', 'granular cell tumor', 'mucocele']
},
"benign_config": {
"model_option": {
"single_tfidf": {
"path_model":"models/all_labels_hierarchy/single_tfidf/classifiers",
"model": "benign_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"vectorizer":"vectorizer_all_branches.pkl",
"path_bigrmas":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
},
"branch_tfidf": {
"path_model":"models/all_labels_hierarchy/branch_tfidf/classifiers",
"model": "benign_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"vectorizer":"benign_vectorizer.pkl",
"path_bigrmas":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
}
},
"classes": ['apocrine metaplasia','biopsy site changes','columnar cell change without atypia','cyst','excisional or post-surgical change','fat necrosis','fibroadenoma','fibroadenomatoid','fibrocystic disease','fibromatoses','fibrosis','hamartoma','hemangioma','lactational change','lymph node - benign','myofibroblastoma','myxoma','phyllodes','pseudoangiomatous stromal hyperplasia','sclerosing adenosis','usual ductal hyperplasia','fna - benign','seroma']
},
"nbc_config": {
"model_option": {
"single_tfidf": {
"path_model":"models/all_labels_hierarchy/single_tfidf/classifiers",
"model": "nbc_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"vectorizer":"vectorizer_all_branches.pkl",
"path_bigrmas":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/single_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
},
"branch_tfidf": {
"path_model":"models/all_labels_hierarchy/branch_tfidf/classifiers",
"model": "nbc_xgboost_classifier.pkl",
"path_vectorizer":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"vectorizer":"nbc_vectorizer.pkl",
"path_bigrmas":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"bigrams":"best_bigrams.csv",
"path_phrase_bigrams":"models/all_labels_hierarchy/branch_tfidf/vectorizers",
"phrase_bigrams" : "phrase_bigrams.pkl"
}
},
"classes": ['lymphoma', 'malignant(sarcomas)', 'non-breast metastasis']
},
}
return config
if __name__ == '__main__':
pass
|