Context disambiguation using deep neural networks
A computer-implemented process for updating an electronic document includes the following operations. Using a preprocessor, preprocessing is performed on the electronic document to generate a computer data structure. The computer data structure is evaluated using a word sense disambiguation (WSD) engine and a deep neural network to determine a context of a sentence within the electronic document. Based upon the context, a determination is made that a word within the sentence is a word of interest. The sentence is rewritten using a mitigation engine and a large language model to generate a revised sentence that does not include the word of interest. A determination is made that the revised sentence does not include any other word of interest; and the electronic document is updated to include the revised sentence.
1 . A computer-implemented method for updating an electronic document employing a preprocessor, a word sense disambiguation (WSD) engine, and a mitigation engine, comprising:
performing preprocessing on the electronic document, using the preprocessor, to generate a computer data structure;
identifying, using a knowledge base that stores a mapping between one or more words of interest and one or more contexts, that a sentence within the electronic document includes a potential word of interest by identifying at least one context of the one or more contexts in which the potential word of interest is a word of interest;
determining, by evaluating the computer data structure using the WSD engine and a deep neural network, a particular context of the potential word of interest using the knowledge base;
determining, based upon the particular context, that the potential word of interest is the word of interest;
rewriting the sentence, using the mitigation engine and a large language model, to generate a revised sentence that does not include the word of interest;
determining, using a similarity engine to compare a contextual meaning associated with the sentence and the revised sentence, that the revised sentence is sufficiently similar to the sentence;
determining that the revised sentence does not include any other word of interest; and
updating the electronic document to include the revised sentence responsive to determining that the revised sentence is sufficiently similar to the sentence and responsive to determining that the revised sentence does not include the any other word of interest.
2 . The method of claim 1 , wherein
the deep neural network includes an Adaptive Skip-gram (AdaGram) model.
3 . The method of claim 1 , wherein
a graphical user interface is presented to a user, and
the graphical user interface is configured to prompt the user to generate the revised sentence.
4 . The method of claim 1 , wherein
the revised sentence is generated using a modification template.
5 . The method of claim 4 , wherein
the modification template is automatically selected by the mitigation engine.
6 . The method of claim 4 , wherein
a graphical user interface is presented to a user, and
the graphical user interface is configured to provide word level explainability regarding the sentence.
7 . The method of claim 4 , wherein
a second modification template is used to generate the revised sentence after an initial revised sentence was determined to meet a similarity evaluation.
8 . The method of claim 4 , wherein
a second modification template is used to generate the revised sentence after an initial revised sentence was determined to contain other words of interest.
9 . A computer hardware system for updating an electronic document, comprising:
a hardware processor including a preprocessor, a word sense disambiguation (WSD) engine, and a mitigation engine configured to perform the following executable operations:
performing preprocessing on the electronic document, using the preprocessor, to generate a computer data structure;
identifying, using a knowledge base that stores a mapping between one or more words of interest and one or more contexts, that a sentence within the electronic document includes a potential word of interest by identifying at least one context of the one or more contexts in which the potential word of interest is a word of interest;
determining, by evaluating the computer data structure using the WSD engine and a deep neural network, a particular context of the potential word of interest using the knowledge base;
determining, based upon the particular context, that the potential word of interest is the word of interest;
rewriting the sentence, using the mitigation engine and a large language model, to generate a revised sentence that does not include the word of interest;
determining, using a similarity engine to compare a contextual meaning associated with the sentence and the revised sentence, that the revised sentence is sufficiently similar to the sentence;
determining that the revised sentence does not include any other word of interest; and
updating the electronic document to include the revised sentence responsive to determining that the revised sentence is sufficiently similar to the sentence and responsive to determining that the revised sentence does not include the any other word of interest.
10 . The system of claim 9 , wherein
the deep neural network includes an Adaptive Skip-gram (AdaGram) model.
11 . The system of claim 9 , wherein
a graphical user interface is presented to a user, and
the graphical user interface is configured to prompt the user to generate the revised sentence.
12 . The system of claim 9 , wherein
the revised sentence is generated using a modification template.
13 . The system of claim 12 , wherein
the modification template is automatically selected by the mitigation engine.
14 . The system of claim 12 , wherein
a graphical user interface is presented to a user, and
the graphical user interface is configured to provide word level explainability regarding the sentence.
15 . The system of claim 12 , wherein
a second modification template is used to generate the revised sentence after an initial revised sentence was determined to meet a similarity evaluation.
16 . The system of claim 12 , wherein
a second modification template is used to generate the revised sentence after an initial revised sentence was determined to contain other words of interest.
17 . A computer program product, comprising:
a computer readable storage medium having stored therein program code for updating an electronic document,
the program code, which when executed by a computer hardware system including a preprocessor, a word sense disambiguation (WSD) engine, and a mitigation engine, cause the computer hardware system to perform:
performing preprocessing on the electronic document, using the preprocessor, to generate a computer data structure;
identifying, using a knowledge base that stores a mapping between one or more words of interest and one or more contexts, that a sentence within the electronic document includes a potential word of interest by identifying at least one context of the one or more contexts in which the potential word of interest is a word of interest;
determining, by evaluating the computer data structure using the WSD engine and a deep neural network, a particular context of the potential word of interest using the knowledge base;
determining, based upon the particular context, that the potential word of interest is the word of interest;
rewriting the sentence, using the mitigation engine and a large language model, to generate a revised sentence that does not include the word of interest;
determining, using a similarity engine to compare a contextual meaning associated with the sentence and the revised sentence, that the revised sentence is sufficiently similar to the sentence;
determining that the revised sentence does not include any other word of interest; and
updating the electronic document to include the revised sentence responsive to determining that the revised sentence is sufficiently similar to the sentence and responsive to determining that the revised sentence does not include the any other word of interest.
18 . The computer program product of claim 17 , wherein
the deep neural network includes an Adaptive Skip-gram (AdaGram) model.
19 . The computer program product of claim 17 , wherein
the revised sentence is generated using a modification template.
20 . The computer program product of claim 17 , wherein
a second modification template is used to generate the revised sentence after an initial revised sentence was determined to:
meet a similarity evaluation or
contain other words of interest.