Fig. 4

Proposed architecture: The architecture utilizes token embeddings generated by the NER system before the classification layer. Each token embedding classified by the NER system as an entity (Entity Embedding) undergoes a weighting process through a token attentional layer. This produces a weighted average of the same embedding size, named as Sentence Embedding. The sentence embeddings derived from all sentences in a patient’s clinical reports, are then fed into a sentence attentional layer, which shares weights with the token attentional layer. The outcome is a weighted average vector, maintaining the original embedding size \({d_E}\), referred to as the patient embedding \({{\mathbf{x}}^{(i)}}\). The patient embedding is the input of the risk assessment network