## 4 Results and Discussion
### BERT and EMLO Embedding
```
1:functionPreprocess(\(\mathcal{T}\))
2:\(\mathcal{T}_{\text{lower}}\leftarrow\text{lowercase}\left(\mathcal{T}\right)\)\(\triangleright\) Convert text to lowercase
3:\(\mathcal{T}_{\text{clean}}\leftarrow\text{remove}\left(\mathcal{T}_{\text{lower}},\text{ URLs},\text{special chars}\right)\)\(\triangleright\) Remove URLs and special characters
4:return\(\mathcal{T}_{\text{clean}}\)
5:endfunction\(\triangleright\) Preprocess text data
6:\(\mathcal{D}_{1},\mathcal{D}_{2}\leftarrow\text{Load datasets from specified paths}\)\(\triangleright\) Load two separate datasets for processing
7:\(\mathcal{D}_{1}^{\text{clean}}\leftarrow\text{map}\left(\text{Preprocess}, \mathcal{D}_{1}\right)\)
8:\(\mathcal{D}_{2}^{\text{clean}}\leftarrow\text{map}\left(\text{Preprocess}, \mathcal{D}_{2}\right)\)\(\triangleright\) Apply preprocessing to both datasets
9:functionGenerateBERTEmbeddings(\(\mathcal{S}\))
10:\(\mathcal{T}_{\text{tokenized}}\leftarrow\text{Tokenize}\left(\mathcal{S}, \text{BERT Tokenizer}\right)\)\(\triangleright\) Tokenize text using BERT's tokenizer
11:\(\mathcal{E}_{\text{BERT}}\leftarrow\text{BERT Model}\left(\mathcal{T}_{\text{tokenized}}\right)\)\(\triangleright\) Generate embeddings using BERT
12:return\(\mathcal{E}_{\text{BERT}}\)\(\triangleright\) Function to generate BERT embeddings
13:endfunction\(\triangleright\) Function to generate BERT embeddings
14:functionGenerateELMoEmbeddings(\(\mathcal{S}\))
15:\(\mathcal{E}_{\text{ELMo}}\leftarrow\text{ELMo Model}\left(\mathcal{S}\right)\)\(\triangleright\) Generate embeddings using ELMo
16:return\(\mathcal{E}_{\text{ELMo}}\)
17:endfunction\(\triangleright\) Function to generate ELMo embeddings
18:\(\mathcal{E}_{1}\leftarrow\text{GenerateBERTEmbeddings}\left(\mathcal{D}_{1}^{\text{clean}}\right)\)
19:\(\mathcal{E}_{2}\leftarrow\text{GenerateELMoEmbeddings}\left(\mathcal{D}_{2}^{ \text{clean}}\right)\)\(\triangleright\) Generate embeddings for each cleaned dataset
20: Split datasets into training and testing sets\(\triangleright\) Divide data for model evaluation
21: Train classifiers on respective embeddings \(\triangleright\) Use embeddings to train text classification models
22: Predict and evaluate on test sets\(\triangleright\) Assess model performance on unseen data
23: Print classification reports and accuracies\(\triangleright\) Display model evaluation results \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Model** & \multicolumn{2}{c}{**Twitter Dataset**} & \multicolumn{2}{c}{**YouTube Dataset**} \\ \cline{2-5}  & **EMLO** & **BERT** & **EMLO** & **BERT** \\ \hline f1-score & 90\% & 83\% & 93\% & 91\% \\ Precision & 91\% & 87\% & 98\% & 94\% \\ Recall & 89\% & 79\% & 88\% & 87\% \\ Accuracy & 90\% & 84\% & 94\% & 91\% \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Validation Accuracy for EMLO and BERT Models. The comparative assessment reveals consistent gains achieved by ELMo over BERT for spam detection across both Twitter and YouTube datasets, as evidenced visually in Figures 10 and 11. The Receiver Operating Characteristic (ROC) plots showcase ELISA's stronger discrimination capability, with Area Under Curve (AUC) values up to 0.96 for YouTube, significantly higher than BERT's 0.88. Additionally, the precision-recall curves demonstrate ELMo's superior trade-off by achieving over 90% precision at 80% recall levels on both datasets. In contrast, BERT sees an acute decline in precision as recall increases, indicating higher false positive rates. We posit ELMo's bidirectional conditioning enables the modeling of nuanced contextual cues within noisy textual data, leading to more reliable predictions. Quantitatively, as compiled in Table 5, standalone ELMo surpasses BERT on all evaluation metrics, with relative gains of 5-15% in accuracy, precision, recall, and F1-scores. This aligns with the visual evaluation. The big performance gaps show that ELMo is good at encoding complex semantic features, which is important for keeping up with spam campaigns that are always changing.