# US 2023/0418868 A1 · Virtual knowledge graph construction for zero-shot domain-specific document retrieval

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0418868 A1
- Document ID: US20230418868A1
- Status: Published application
- Kind: A1
- Application number: 17/808,599
- Filed: 2022-06-24
- Published: 2023-12-28
- Earliest claimed: 2022-06-24
- Assignees: Adobe Inc.
- Applicants: Adobe Inc.
- Inventors: Yeon Seonwoo; Seunghyun Yoon; Trung Huu Bui; Franck Dernoncourt; Roger K. Brooks; Mihir Naware
- Web page: https://patentgrep.com/patent/US20230418868A1

## CPC

- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F 16/313: {Selection or weighting of terms for indexing}
- G06F 16/90335: {Query processing}
- G06F 16/9038: Presentation of query results
- G06F 16/93: Document management systems
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for text processing are described. Embodiments of the present disclosure receive a query comprising a natural language expression; extract a plurality of mentions from the query; generate a relation vector between a pair of the plurality of mentions using a relation encoder network, wherein the relation encoder network is trained using a contrastive learning process where mention pairs from a same document are labeled as positive samples and mention pairs from different documents are labeled as negative samples; combine the plurality of mentions with the relation vector to obtain a virtual knowledge graph of the query; identify a document corresponding to the query by comparing the virtual knowledge graph of the query to a virtual knowledge graph of the document; and transmit a response to the query, wherein the response includes a reference to the document.

## Claims

### Claim 1

A method for text processing, comprising:
receiving a query comprising a natural language expression;
extracting a plurality of mentions from the query;
generating a relation vector between a pair of the plurality of mentions using a relation encoder network, wherein the relation encoder network is trained using a contrastive learning process where mention pairs from a same document are labeled as positive samples and mention pairs from different documents are labeled as negative samples;
combining the plurality of mentions with the relation vector to obtain a virtual knowledge graph of the query;
identifying a document corresponding to the query by comparing the virtual knowledge graph of the query to a virtual knowledge graph of the document; and
transmitting a response to the query, wherein the response includes a reference to the document.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
providing a document search interface;
receiving an input from a user via the document search interface, wherein the query is based on the input; and
displaying the response via the document search interface.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
identifying a text delimiter;
dividing the query into a plurality of spans based on the text delimiter;
computing an entity score for each of the plurality of spans; and
selecting the plurality of mentions based on the entity score for each of the plurality of spans.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
determining that the pair corresponds to a same entity based on the relation vector.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
identifying the pair from the plurality of mentions, wherein the pair includes a first mention and a second mention;
masking the first mention and the second mention using a first entity token and a second entity token, respectively; and
inserting a head token adjacent to the first mention and a tail token adjacent to the second mention, wherein the relation vector is generated based on the first entity token, the second entity token, the head token, and the tail token.

### Claim 6 (depends on 1)

The method of claim 1, wherein:
each of the plurality of mentions comprises a document index, a start index, an end index, and a corresponding entity.

### Claim 7 (depends on 1)

The method of claim 1, wherein:
the virtual knowledge graph of the query includes a plurality of nodes corresponding to the plurality of mentions and an edge corresponding to the relation vector.

### Claim 8 (depends on 7)

The method of claim 7, wherein:
the edge comprises a head mention, a tail mention, and the relation vector.

### Claim 9 (depends on 1)

The method of claim 1, further comprising:
identifying matching mentions in the query and the document based on the virtual knowledge graph of the query and the virtual knowledge graph of the document; and
computing a similarity score for the query and the document based on the matching mentions, wherein the document is identified based on the similarity score.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
computing a candidate knowledge graph for each of a plurality of candidate documents; and
comparing the virtual knowledge graph of the query to the candidate knowledge graph for each of the plurality of candidate documents, wherein the document is identified based on the comparison. and

### Claim 11 (depends on 10)

The method of claim 10, further comprising:
performing a bag-of-words analysis on each document in a collection of documents;
selecting the plurality of candidate documents from the collection of documents based on the bag-of-words analysis.

### Claim 12

A method for training a machine learning model, comprising:
receiving a training set including a plurality of documents;
extracting a plurality of mentions from the plurality of documents;
generating a relation vector between a pair of the plurality of mentions in each document using a relation encoder network; and
updating parameters of the relation encoder network based on the relation vector using a contrastive learning process where mention pairs from a same document are labeled as positive samples and mention pairs from different documents are labeled as negative samples.

### Claim 13 (depends on 12)

The method of claim 12, further comprising:
identifying a positive sample pair comprising a first mention pair and a second mention pair from a first document;
identifying a negative sample pair comprising the first mention pair from the first document and a third mention pair from a second document; and
computing a contrastive learning loss based on the positive sample pair and negative sample pair, wherein the parameters of the relation encoder network are updated based on the contrastive learning loss.

### Claim 14 (depends on 13)

The method of claim 13, further comprising:
computing a first dot product of relation vectors representing the positive sample pair; and
computing a second dot product of relation vectors representing the negative sample pair, wherein the contrastive learning loss is computed based on the first dot product and the second dot product.

### Claim 15 (depends on 12)

The method of claim 12, further comprising:
receiving ground truth training data associating the pair of the plurality of mentions with a common entity; and
computing a cross-entropy loss based on the relation vector and the ground truth training data, wherein the parameters of the relation encoder network are updated based on the cross-entropy loss. query;

### Claim 16

An apparatus for text processing, comprising:
a mention extraction component configured to extract a plurality of mentions from a
a relation encoder network configured to generate a relation vector between a pair of the plurality of mentions, wherein the relation encoder network is trained using a contrastive learning process where mention pairs from a same document are labeled as positive samples and mention pairs from different documents are labeled as negative samples;
a graph component configured to combine the plurality of mentions with the relation vector to obtain a virtual knowledge graph of the query; and
a document retrieval component configured to identify a document corresponding to the query by comparing the virtual knowledge graph of the query to a virtual knowledge graph of the document.

### Claim 17 (depends on 16)

The apparatus of claim 16, further comprising:
a training component configured to compute a contrastive learning loss and to update parameters of the relation encoder network based on the contrastive learning loss.

### Claim 18 (depends on 16)

The apparatus of claim 16, further comprising:
a filter component configured to select a plurality of candidate documents from a collection of documents based on a bag-of-words analysis.

### Claim 19 (depends on 16)

The apparatus of claim 16, further comprising:
a document search interface configured to receive the query from a user and to display the document.

### Claim 20 (depends on 16)

The apparatus of claim 16, wherein:
the relation encoder network comprises a transformer architecture.
