In theory, our collective entity disambiguation model is capable of processing documents of arbitrary length. However, there are practical constraints. First, the GPU memory limit enforces an upper bound on the number of mentions that can be processed together, and secondly, BERT stipulates the maximum length of the input sequence to be 512 tokens. To circumvent these constraints, we segment each document so that each chunk contains a maximum of 8 mentions or a maximum of 512 tokens (whichever happens earlier). After this data wrangling process, the \(4,392\)  original documents in the MedMentions dataset are split into \(44,983\)  segmented documents. Note that during inference our model can process more than 8 mentions. However, without loss of generality, we assumed the same segmentation method during inference.
We postulate that with more GPU memory and longer context [1]}, our collective entity disambiguation model will be able to process documents of arbitrary length without segmentation during training and inference.
