NER Explainability Framework: Utilizing LIME to Enhance Clarity and Robustness in Named Entity Recognition
摘要
Named Entity Recognition (NER) is crucial for many Natural Language Processing (NLP) applications, yet current models often lack explainability and robustness, particularly against lexical variations. While methods like Local Interpretable Model-agnostic Explanations (LIME) have enhanced explainability in text classification, their application to sequence-based tasks like NER remains an open challenge. This paper introduces the NER Explainability Framework (NEF), a novel approach that transforms the sequence-based NER task into a multi-classification problem. This transformation enables the application of LIME to any NER architecture. NEF provides precise, interpretable insights into model decisions by highlighting which parts of the input text most influence tagging decisions, significantly advancing explainability in NER. To address the critical gap in assessing model resilience, we also present the Misspelling Robustness Score (MRS), a new metric designed to quantify NER model resilience against lexical variations, particularly misspellings. MRS offers a comprehensive evaluation of model performance in the face of spelling variations and errors. We apply NEF to four widely used NER models (SpaCy, Flair, Stanza, and RoBERTa) using the CoNLL-2003 dataset, revealing critical patterns and weaknesses in model behavior. Our method enables targeted improvements, demonstrated by fine-tuning the SpaCy model to achieve a significant 17.5% increase in robustness against misspellings. These findings lay the groundwork for developing more robust, accurate, and interpretable NER systems, providing practical strategies to address existing challenges in NLP. The universal applicability of NEF across NER architectures and the insights provided by MRS offers valuable tools for researchers and practitioners in advancing the field of NER.