# Reversal of the Word Sense Disambiguation Task Using a Deep Learning Model
## 3 Training
FrameNet sentences: Considering the planned future integration of FrameNet with WordNet, we investigated the inclusion of FrameNet sentences. While a comprehensive FrameNet-WordNet merger falls outside this study's scope, a subset of FrameNet sentences was incorporated to enhance the model's performance. Chatbot-generated sentences: Finally, we explored the use of chatbots (ChatGPT 3.5, Microsoft Copilot, and Google Gemini) for generating new training data. This method offered a convenient way to obtain novel sentences. However, rigorous human expert evaluation ensured that only accurate sentences were added to the training data. **Changing the training data. ** Following acquisition of the data, a process of data replacement ensued, whereby synset tags of certain words were substituted either due to mislabeling within the dataset or as a result of the consolidation of WordNet synsets by the knowledge base manager, thereby creating a new version of WordNet. All requisite transformations were documented in textual format on the GitHub portal, facilitating direct editing through the platform's integrated text editor. **KerasNLP BERT. ** Subsequently, the KerasNLP library was employed to generate embedding vectors for each word within the sentences. Noteworthy observations during this phase highlighted a limitation of the BERT model pertaining to its sensitivity when encountering words absent from its dictionary. For instance, the word \"Fujimoto\" would be tokenized into \"Fuji\", \"mo\", and \"to\", potentially leading to significant deviations in the embedded vectors for other words within the sentence. Nevertheless, the selection of the KerasNLP library was predicated upon its adherence to key non-functional requirements, namely stable performance, rapid loading of the model, and the anticipated long-term support. **Obtaining the components. ** This project explored a novel approach to word sense disambiguation (WSD) by leveraging neighborhood component analysis (NCA) in conjunction with word embedding vectors derived from the BERT neural network. While established methods such as fine-tuning and transfer learning excel at integrating pretrained networks for new tasks (e.g., sentiment analysis), they are often tailored towards creating new classifiers. Our objective, however, diverged from simply generating a WordNet synset classifier. Instead, we aimed to reshape WordNet's structure to align better with the knowledge encoded within BERT. This focus on interactive restructuring of knowledge necessitated a WSD method that facilitates the visualization of learned knowledge. Here, word embedding vectors and their multidimensional projections became the cornerstone of selecting the model due to their inherent visualizability. Following a comprehensive evaluation of the vector design methods offered by scikit-learn, NCA projections were chosen for their demonstrably superior performance in identifying the synset values. We further refined the NCA model by meticulously tuning its meta-parameters. Notably, each word sense was assigned a k-nearest neighbors (k-NN) classifier operating within the n-dimensional NCA component space. Exploration of these parameters (k ranging from 2 to 5, n ranging from 2 to 5) was conducted during the model's training, with a focus on maximizing the classification accuracy. Additionally, a stringent regularization criterion was implemented: each unit of increase in a parameter had to yield at least a 1% enhancement of the model's accuracy. This ensured robustness and stability during the training process. **Transforming the training data. ** In our model, we used a systematic approach to project word embedding vectors into the foundational NCA component space. This projection process constitutes the core architecture of our model, which is composed of two principal elements: the NCA component vectors and the training data projections derived from the NCA framework.