Definition retrieval and display
Provided is a method including obtaining a first text of a natural language text document displayed by the application, detecting a definitional statement in the first text, and parsing a defined term and a definition of the defined term from the definitional statement. The method also includes storing the defined term and the definition in an entry in a dictionary data structure and associating the entry with a location in the text document. The method also includes detecting the defined term being used in another location in the document and, in response, causing a visual indication to be presented in a first region in association with the defined term being used in the other location. The method may include causing the definitional statement or definition thereof to be displayed in a second region concurrently with displaying the defined term and the visual indication in the first region.
1 . A method comprising:
obtaining, with a computer system, from an application executing on the computer system, text of a first natural language text document displayed by the application, the text being natural language text;
detecting, with the computer system, a definitional statement in the text, wherein the definitional statement is not labeled as such in the first natural language text document, wherein detecting the definitional statement comprises:
causing at least some of the text of the first natural language text document to be input into a transformer model, wherein the transformer model is a trained, neural network-based model, and wherein the transformer model has multi-headed attention;
causing the transformer model to determine embedding vectors of segments of text in the first natural language text document, wherein the embedding vectors are based on context from at least some respective text adjacent the respective segments of text in the first natural language text document; and
causing the transformer model to associate, based on at least some of the embedding vectors, terms in the first natural language text document with text in the first natural language text document defining those terms by applying the multi-headed attention to map attention heads of the transformer model to definitional text in the first natural language text document;
determining, with the computer system, a defined term and a definition of the defined term from the definitional statement;
storing, with the computer system, a record associating the defined term with the definition;
detecting the defined term being used in another location of the first natural language text document; and
after detecting the defined term being used in the other location, causing:
a visual indication of the defined term to be presented in association with the defined term being used in the other location of the first natural language text document; and
the definitional statement or definition to be presented.
2 . The method of claim 1 , wherein:
the method further comprises storing an association between a singular form of the defined term and a plural form of the defined term, and wherein the defined term is first detected in the singular form; and
detecting the defined term comprises detecting the plural form of the defined term being used in the other location in the first natural language text document based on the stored association between the singular form of the defined term and the plural form of the defined term.
3 . The method of claim 1 , wherein the application comprises a first application, and wherein detecting the defined term comprises detecting the defined term using an instance of a second application, wherein the instance of the second application is executed concurrently with an instance of the first application by the computer system.
4 . The method of claim 1 , wherein storing the record associating the defined term with the definition comprises storing the defined term in association with a set of metadata tags, wherein the first natural language text document is labeled with the set of metadata tags.
5 . The method of claim 1 , further comprising:
determining a text boundary surrounding the defined term based on a set of formatting or spacing features of the text;
determining a first set of n-grams from a portion of the text of the first natural language text document within the text boundary of the defined term; and
determining a lexical chain based on the first set of n-grams by determining a set of topic scores based on the first set of n-grams, wherein each respective topic score of the set of topic scores is assigned to a respective topic using lexical chaining, and wherein each respective topic score of the set of topic scores is stored in association with the defined term.
6 . The method of claim 1 , wherein the defined term is a first defined term, and wherein the definition is a first definition, the method further comprising:
determining a second defined term and a second definition corresponding to the second defined term;
generating a directed graph, wherein a first node of the directed graph is associated with the first defined term, and wherein a second node of the directed graph is associated with the second defined term;
determining whether the directed graph comprises a cycle; and
in response to a determination that the directed graph comprises the cycle, generating an alert.
7 . The method of claim 1 , wherein the application is being executed by a first computing device, and wherein storing the record associating the defined term with the definition comprises transmitting a message comprising the defined term to a data structure stored in a second computing device that is remote with respect to the first computing device.
8 . The method of claim 1 , wherein the defined term is a first defined term, the method further comprising:
determining a set of parameters based on a set of symbols, formatting changes, or other terms surrounding the first defined term;
determining whether a second defined term is present in a third portion of the text of the first natural language text document, wherein the third portion of the text of the first natural language text document is associated with a first parameter of the set of parameters; and
in response to a determination that the second defined term is not present in the portion of the text, generating an alert.
9 . The method of claim 1 , further comprising determining whether an action trigger was activated, wherein the action trigger is associated with the defined term, and wherein the visual indication is presented in response to determining that the action trigger was activated.
10 . The method of claim 1 , further comprising:
determining whether an action trigger was activated;
detecting that the defined term is present in a second natural language text document;
detecting a hierarchical association from the second natural language text document to the first natural language text document; and
presenting the definition based on the hierarchical association.
11 . The method of claim 1 , wherein detecting the definitional statement in the text is performed with an add-on application, via an application programming interface to the application displaying the first natural language text document, the application displaying the first natural language text document being executed by a first thread and the add-on application being executed by a second thread.
12 . The method of claim 1 , further comprising:
determining that the definition is associated with a first definition category, wherein the first definition category is one of a plurality of definition categories.
13 . The method of claim 12 , wherein the definition is a first definition, the method further comprising:
determining whether a second definition is associated with a corresponding second defined term, wherein the second definition is associated with a second definition category different from the first definition category; and
in response to a determination that the second definition is associated with the second defined term, selecting the first definition as dominant based on the first definition category and the second definition category.
14 . The method of claim 1 , further comprising:
determining that a term lacks a definition and, in response, presenting an alert.
15 . The method of claim 1 , further comprising:
determining that a term is defined as having a numerical value and that the numerical value is outside a specified range, and in response, presenting an alert.
16 . The method of claim 1 , further comprising:
determining a set of word embeddings based on the text of the first natural language text document using a first neural network, wherein each respective embedding of the set of word embeddings comprises a respective vector;
determining a topic based on the set of word embeddings using a second neural network; and
wherein storing the record comprises storing the defined term in association with the topic.
17 . The method of claim 1 , further comprising steps for causing the definitional statement or definition thereof to be displayed, wherein the method comprises steps for determining context parameters, steps for merging terms, and steps for reducing spikes in computing load caused by analysis operations.
18 . The method of claim 1 , further comprising:
concurrently displaying the first natural language text document with a first thread and analyzing a cached copy of the first natural language text document with a second thread; and
repeatedly updating the cached copy with a synchronize operation requested by the second thread to obtain a version used by the first thread.
19 . The method of claim 1 , further comprising:
caching a copy of the first natural language text document, wherein the application is used to display the first natural language text document using a first thread, and wherein the defined term is detected from the copy of the first natural language text document using a second thread that is different from the first thread, the first and second threads being executed by the same computing device of the computer system.
20 . A tangible, non-transitory, machine-readable medium storing instructions that, when executed by a computer system, effectuate operations comprising:
obtaining, with the computer system, from an application executing on the computer system, text of a first natural language text document displayed by the application, the text being natural language text;
detecting, with the computer system, a definitional statement in the text, wherein the definitional statement is not labeled as such in the first natural language text document, wherein detecting the definitional statement comprises:
causing at least some of the text of the first natural language text document to be input into a transformer model, wherein the transformer model is a trained, neural network-based model, and wherein the transformer model has multi-headed attention;
causing the transformer model to determine embedding vectors of segments of text in the first natural language text document, wherein the embedding vectors are based on context from at least some respective text adjacent the respective segments of text in the first natural language text document; and
causing the transformer model to associate, based on at least some of the embedding vectors, terms in the first natural language text document with text in the first natural language text document defining those terms by applying the multi-headed attention to map attention heads of the transformer model to definitional text in the first natural language text document;
determining, with the computer system, a defined term and a definition of the defined term from the definitional statement;
storing, with the computer system, a record associating the defined term with the definition;
detecting the defined term being used in another location of the first natural language text document; and
after detecting the defined term being used in the other location, causing:
a visual indication of the defined term to be presented in association with the defined term being used in the other location of the first natural language text document; and
the definitional statement or definition to be presented.