# A Methodological Framework for AI-Driven Textual Data Analysis in Digital Media
## 3 The Proposed Approach: Data Analysis Framework for Information and Media
### Data Preprocessing and Enrichment  
After extracting the data of interest, it is necessary to conduct verification and preprocessing routines to ensure data quality and maximize its analytical value. Numerical checks and routines based on regular expressions are particularly useful for data cleaning and enrichment procedures, such as identifying occurrences of relevant terms, including links, social media mentions, or hashtags. Furthermore, the use of artificial intelligence techniques associated with named entity recognition models (such as persons, geographic locations, objects, and brands) enhances data enrichment by enabling a deeper understanding of the semantic context of textual content [56]. Figure 3 illustrates the proposed framework for applying data preprocessing and enrichment routines. Following this approach, Exploratory Data Analysis (EDA) can be employed to assess the quality of the collected data, enabling the investigation of the semantic and structural properties of the dataset [57]. One of the primary challenges in data analysis is mitigating biases stemming from datasets that are insufficiently representative or exhibit anomalies, such as inconsistent, missing, or extreme values (outliers). EDA, through techniques such as correlation matrices, histograms, boxplots, and frequency analysis, allows for the verification and, if necessary, the treatment of candidate data for analysis, ensuring sample representativeness. An essential aspect, particularly when dealing with textual data, is the use of natural language processing (NLP) techniques to verify semantic consistency. These techniques facilitate, for example, the identification of discrepancies in the categorization of entities or in the standardization of terms, guiding the refinement of preprocessing procedures such as cleaning and normalization [58; 59]. Within this context, actions are implemented to ensure the uniformity and quality of the corpus. One of the initial steps involves normalizing text capitalization to address inconsistencies arising from variations in the writing of specific terms. Subsequently, the removal of special characters, including punctuation marks, symbols, and numbers with no relevant semantic value for the analysis, is carried out. This contributes to noise reduction and enhances the structural clarity of the data. It is important to emphasize that these procedures should align with the type of analysis to be performed and the context of the digital platform being studied, as structural differences exist in the composition of textual corpora from platforms serving distinct purposes. For instance, textual data from social media, where writing tends to be more informal and  
Figure 3: Data preprocessing and enrichment scheme. spontaneous, contrasts with data from news portals, which generally adhere to stricter grammatical standards and formal writing conventions. In the preprocessing stage of textual data, lemmatization is particularly relevant in contexts with high variability in writing styles, especially on social media. This technique reduces words to their base or root forms, enabling them to be treated as a single entity. Lemmatization is crucial for term-based analyses as it reduces redundancy and enhances semantic coherence. Additionally, the use of semantic embeddings, such as Word2 Vec [60; 61; 62], GloVe [63], or an LLM like BERT [64], transforms words into vector representations, capturing semantic meaning in various contexts. This facilitates the application of models to measure semantic similarity between words and phrases, aiding in the detection of out-of-context or miscategorized terms, thus improving the accuracy and consistency of textual analyses. The next stage involves identifying attributes derived from structured textual markers, which represents a key aspect of data enrichment. These attributes correspond to textual occurrences that follow predefined patterns, such as mentions and hashtags on social media or hyperlinks in general.