## 4 Discussion  
### Principal Results  
In this study, we evaluated the performance of an NLP based RoBERTa model to automatically identify a patient's LOC within the EMR of the ED. The model effectively determined LOC status by analyzing both pre- and post-diagnosis notes, leveraging specific words and contextual cues in these free-text medical records. Our comparative analysis highlighted the importance of pre-diagnosis notes, which provide valuable information for assessing LOC. These results demonstrate the model's capability to accurately identify injury-related variables, specifically LOC, within unstructured ED documentation. Figure 4: Interpretation of LOC classification and the importance of each word feature (English version). The figures indicate the importance of each word in the LOC classification for patients classified as C2 (**A**) and C3 (**B**). The right panel displays descriptive input consisting of pre- and post-diagnosis notes. The left panel of each figure shows the weight of features for visualization. We employed a weighted loss function to address the imbalance in our data, as only 3.4% of patients were classified as experiencing LOC, resulting in a significant imbalance between this minority class (patients with LOC) and the majority class (patients without LOC). This underrepresentation can bias the model toward the majority class, potentially compromising its accuracy in identifying LOC cases. Our results indicated that the weighted loss model was more effective in correctly identifying positive LOC cases, while maintaining low rates of false positives and false negatives compared to the conventional (non-weighted) model. Interestingly, while training loss values were similar across both approaches, validation data revealed a marked improvement with the weighted model. These findings align with previous research suggesting that weighted loss functions can effectively address challenges associated with imbalanced medical data, which is often due to the prevalence of certain conditions or patient characteristics [23]. The model also demonstrated a nuanced understanding of contextual language, as revealed through LIME analysis, by effectively distinguishing between straightforward LOC terms (as in group C3) and those with context-denying nuances (as in group C2). This sensitivity to the complex language often found in ED records is critical for accurately identifying injury-related conditions, capturing subtle variations in LOC expressions, and making the model particularly well-suited for ED documentation. Previous study has shown that LIME-based models enhance interpretability by highlighting word-level contributions, helping clinicians understand how specific terms influence predictions [24]. For example, terms like \"fragment\" and \"hemorrhage\" have been identified in fracture prediction, aligning with physicians' expertise and reinforcing the model's credibility. This transparency fosters trust and supports clinical decision-making by clearly illustrating the model's reasoning process. The choice of data source--pre-diagnosis, post-diagnosis, or combined notes--plays a critical role in the development of efficient and accurate NLP-based classification models. Pre-diagnosis notes, which are recorded upon a patient's arrival at the emergency department, contain a high proportion of patient-reported symptoms and triage assessments. These notes are available earlier in the clinical workflow, making them particularly valuable for rapid classification. Our findings demonstrate that models trained solely on pre-diagnosis notes achieved comparable performance to those trained on combined notes. Notably, significant differences in model performance were observed when using only pre-diagnosis notes or post-diagnosis notes, as evaluated through five-fold cross-validation (Student's \(t\)-test, \(p\) < 1.16 \(\times\) 10\({}^{-119}\)) (Table S3).