Abstract Background Limited evidence exists regarding real-world practices and outcomes of oral anticoagulation in patients with Non-Valvular Atrial Fibrillation (NVAF). Purpose To conduct a retrospective real-world data (RWD) study using Natural Language Processing (NLP) and Machine Learning (ML) on Electronic Health Records (EHRs) to evaluate the efficacy and safety of Direct Oral Anticoagulants (DOACs) and vitamin K antagonists (VKAs) in NVAF patients. Methods Retrospective study in 15 Spanish hospitals between 2014-2020 including adult NVAF patients treated with oral anticoagulants without anticoagulation history, recent thrombotic events, rheumatic mitral valvular heart disease, mitral valve stenosis, venous thromboembolism, nor pregnancy. We employed EHRead®, a free text analysis engine utilizing NLP and ML to extract RWD from EHRs based in SNOMED CT (standardized coding system). Free-text information was extracted and organized in an anonymized database for population-based descriptive and comparative analysis. After matching patients using propensity-score matching (PSM), we used Kaplan-Meier curves to compare VKA vs DOAC efficacy on thrombotic prevention, safety, and mortality. Results After evaluating 138,773,332 EHRs from 4.6 million patients, 44,292 NVAF patients were included; 35,267 (79.6%) treated with VKA and 9,025 (20.4%) with DOAC. Half of them were men (53.0%) with a mean (SD) age of 76.3 (12.7) years. VKA-treated patients tended to be older, with more cardiovascular comorbidities and higher CHA2DS2-VASc scores than DOACs-treated patients (Table 1). Using PSM, 8,930 patients were matched per subgroup with standardized mean differences below 10% for all confounders. The comparative analysis showed that DOAC-treated patients had a significant lower risk of thrombotic, minor bleeding events, and mortality than VKA-treated ones, with no significant differences in major bleeding (Figure 1). Conclusion The application of NLP and ML allowed us to create an extensive, plausible, and detailed database of Spanish NVAF patients from RWD in EHRs. In our cohort, we found a higher efficacy and lower mortality and minor bleeding events with DOACs over VKAs, without differences in major bleeding events. This study was sponsored by Pfizer and Bristol Myers Squibb. JCS, MA & CS were paid consultants to Pfizer and Bristol Myers Squibb in connection with the development of this abstract. CAC & LMS are employes of the SAVANA who were paid consultants to Pfizer and Bristol Myers Squibb in connection with the development of this abstract. DA & SFC are employees of Pfizer.Table 1Figure 1