medal-contender / nbme-score-clinical-patient-notes

BERTs based automated scoring clinical patient notes program
https://www.kaggle.com/c/nbme-score-clinical-patient-notes
0 stars 0 forks source link

modified for local machine #49

Closed HyeonhoonLee closed 2 years ago

HyeonhoonLee commented 2 years ago

@Kingthegarden 께서 지난 issue에서 말씀해주셨던 대로, 새로 만들어진 folder tree에 맞게 변경하였습니다.

주 목적은 kaggle env가 아닌 local env에서 tokenizer을 새로 생성하는 작업이 가능하도록 변경한 것입니다.

아래 코드들을 추가하였고,

from medal_contender.tokenizer import load_tokenizer from medal_contender.configs import MAKE_TOKENIZER

os.environ["TOKENIZERS_PARALLELISM"] = "true"

또한 main 함수에서 tokenizer를 local 경로에서 가져올 수 있도록 하였습니다.

CFG.tokenizer = DebertaV2TokenizerFast.from_pretrained(BERT_MODEL_LIST[CFG.model_param.model_name]) CFG.tokenizer.save_pretrained(os.path.join(root_save_dir, 'get_token'))