Using BERT for encoding
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.
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
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
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.