PLM-ICD icon indicating copy to clipboard operation
PLM-ICD copied to clipboard

Using BERT for encoding

Open samarzeit opened this issue 1 year ago • 3 comments

Dear Authors,

Firstly, I would like to appreciate your excellent piece of work. My question extends to the question from the issue named "Segment Pooling Implementation #2 ", I had the same question and saw this issue. Could you please elaborate where exactly you are doing this encoding part and getting the representation of the entire document? Looking forward to hearing from you.

samarzeit avatar Jul 02 '24 01:07 samarzeit

Hi,

I appreciate your interest in our work! We split the documents into chunks and prepare the input_ids like I mentioned in Issue https://github.com/MiuLab/PLM-ICD/issues/2 So the shape of the input_ids is (batch_size, num_chunks, chunk_size). The actual encoding and aggregation happen in modeling_bert.py for the BERT model. You can find the implementation below:

https://github.com/MiuLab/PLM-ICD/blob/410655073b70b7cc41b7dbd600c95d72bd11a4d3/src/modeling_bert.py#L86-L107

Best, Chao-Wei

chaoweihuang avatar Jul 17 '24 07:07 chaoweihuang

Hi, can you provide the code on how to use the model, i have a task to generate cpt and icd codes from an input query, any help would be much appreciated

muizz-IHT avatar Nov 19 '24 14:11 muizz-IHT

I can't provide my code as I signed an NDA. But I can tell how I did it. I had to submit my work, so to avoid too many documents, I simply copied and pasted the necessary code from different files to a Jupyter notebook. You just have to spend some time going through the repo (I know it is hard) to see what is needed.

samarzeit avatar Nov 21 '24 13:11 samarzeit