A computer system comprising one or more processors, one or more computer readable memories, one or more computer readable storage mediums, and program instructions stored on at least one of the one or more computer readable storage mediums for execution by at least one of the one or more processors via at least one of the one or more computer readable memories, the stored program instructions comprising:
- program instructions to receive multiple user-generated pairs of terms, wherein each of the multiple user-generated pairs of terms comprises a first term and a second term;
- program instructions to identify instances of the multiple user-generated pairs of terms as corpus terms in an original corpus of documents, wherein the corpus terms in the original corpus of documents are labeled with labels that describe the corpus terms without identifying a relationship between two or more of the corpus terms;
- program instructions to extract sentences, from the original corpus of documents, that contain one or more of the multiple user-generated pairs of terms;
- program instructions to combine the sentences into a training corpus;
- program instructions to train a word vector generating process using the training corpus, wherein the word vector generating process generates a numerical vector for each term from the user-generated pairs of terms such that each first term A from the user-generated pairs of terms is assigned a version of a first numerical vector {right arrow over (A)} and each second term B from the user-generated pairs of terms is assigned a version of a second numerical vector {right arrow over (B)};
- program instructions to retrieve a third term D from the original corpus of documents, wherein the third term D has a same label as the second term B;
- program instructions to generate, by implementing the word vector generating process, a third numerical vector {right arrow over (D)} for the third term D;
- program instructions to determine a search numerical vector {right arrow over (C′)} based on {right arrow over (A)}−{right arrow over (B)}+{right arrow over (D)}={right arrow over (C′)};
- program instructions to determine, based on {right arrow over (A)}−{right arrow over (B)}={right arrow over (C′)}−{right arrow over (D)}, that {right arrow over (C′)} and {right arrow over (D)} have a same vector relationship as A{right arrow over ( )} and {right arrow over (B)};
- program instructions to, in response to determining that {right arrow over (C′)} and {right arrow over (D)} have a same vector relationship as {right arrow over (A)} and {right arrow over (B)}, determine that a fourth term C and the third term D have a same relationship as a relationship between the first term A and the second term B;
- program instructions to receive a request for documents that contain terms that identify an entity that has a relationship to another term that matches the relationship between the first term A and the second term B;
- program instructions to compare previously generated term vectors for terms from a search corpus of documents to {right arrow over (C′)};
- program instructions to identify the previously generated term vectors that are within a predetermined vector distance of {right arrow over (C′)};
- program instructions to identify terms whose term vectors are within the predetermined vector distance of {right arrow over (C′)}, wherein the terms are from the search corpus;
- program instructions to receive a request from a client computer for documents from the search corpus that contain terms that describe an entity that has the relationship to another term that matches the relationship between the first term A and the second term B;
- program instructions to, in response to receiving the request, retrieve documents from the search corpus that contain at least one term whose assigned term vector is within the predetermined vector distance of {right arrow over (C′)};
- and
- program instructions to transmit, to the client computer, the documents from the search corpus that contain the at least one term whose assigned term vector is within the predetermined vector distance of {right arrow over (C′)}.