CPC G06F 40/30 (2020.01) [G06F 18/214 (2023.01); G06F 18/24147 (2023.01); G06F 40/279 (2020.01); G06N 5/022 (2013.01)] | 15 Claims |
1. A text processing method based on natural language and a knowledge graph comprises:
receiving a text processing request input by a user, wherein the text processing request is used to request that a text be processed according to a semantic representation of a prediction object in the text;
inputting the prediction object to a joint learning model that has been pre-trained to obtain the semantic representation of the prediction object, wherein the joint learning model is used for knowledge graph representation learning and natural language representation learning, and the semantic representation is obtained by the joint learning model by combining the knowledge graph representation learning and the natural language representation learning; and
processing the text according to the semantic representation;
wherein before the receiving the text processing request input by the user, further comprising:
performing training on training samples to obtain the joint learning model, wherein the joint learning model comprises a natural language learning layer, a joint learning correlation layer and a knowledge graph learning layer, and the joint learning correlation layer is used to correlate the knowledge graph learning layer with the natural language learning layer;
wherein the performing the training on the training samples to obtain the joint learning model comprises:
determining, at the natural language learning layer, a neighbor sample of a target training sample in the training samples;
determining, at the joint learning correlation layer, a weight of the target training sample relative to each entity in the knowledge graph learning layer according to the neighbor sample;
determining a knowledge graph semantic representation of the target training sample according to the weight of each entity; and
determining a training result of the target training sample according to the knowledge graph semantic representation and the neighbor sample.
|