Evaluating Word Embedding Models in Ecuadorian Legal Texts: A Comparison of CBOW and Skip-Gram for Semantic Analysis
摘要
This study evaluates the effectiveness of the Continuous Bag-of-Words (CBOW) and Skip-gram models in capturing semantic relationships within Ecuadorian legal texts. Utilizing a comprehensive corpus that includes the Ecuadorian Constitution, the Comprehensive Organic Criminal Code (COIP), and the General Organic Code of Processes (COGEP), among other national laws, we analyze the models’ ability to represent the complex semantics of legal language. The CBOW model predicts target words based on their surrounding context, while Skip-gram predicts the context from a given target word, making them suitable for identifying intricate patterns in legal documents. A rigorous preprocessing phase was applied to the legal texts, including normalization, stopword removal, and lemmatization, ensuring high-quality input data for training. The models were then evaluated using semantic similarity (Spearman’s correlation) and topic coherence metrics. Results indicate that while both models show potential in capturing semantic relationships, CBOW demonstrated a marginally higher performance with a Spearman correlation of 0.24 and a topic coherence score of 0.6637, compared to Skip-gram’s 0.19 and 0.6573, respectively. Despite these findings, neither model fully captured the complexities inherent in legal language, suggesting a need for further refinement in NLP techniques for legal texts. These findings provide a foundation for improving semantic search and information retrieval systems tailored to the legal domain, offering tools to assist legal professionals in analyzing and understanding complex legal texts.