| CPC G06N 5/02 (2013.01) | 15 Claims |

|
1. A natural language processing method, comprising:
acquiring a target sentence of a natural language question-answering task to be processed, and identifying each first entity in the target sentence of the natural language question-answering task, wherein the first entity is a noun in the target sentence of the natural language question-answering task;
for each first entity, in response to the first entity being present in a preset entity set, identifying, in the preset entity set, a second entity in maximum correlation with the first entity, wherein the second entity is a noun in the preset entity set, and the preset entity set is a collection of nouns;
outputting extended information based on the determined second entity, and generating an updated target sentence by adding the extended information after a location of the first entity in the target sentence of the natural language question-answering task, wherein the updated target sentence of the natural language question-answering task contains the target sentence of the natural language question-answering task and the extended information, wherein the second entity is any entity in the preset entity set other than the first entity; and
transferring the updated target sentence of the natural language question-answering task to a bidirectional encoder representation from transformer (BERT) model, wherein the BERT model identifies the first entity and the extended information related to the first entity from the updated target sentence of the natural language question-answering task and outputs an optimal answer to the natural language question-answering task;
wherein the identifying each first entity in the target sentence of the natural language question-answering task comprises:
converting each word in the target sentence into a 1024-dimensional vector, to obtain a vector set; and
inputting the vector set to an entity recognition model, such that the entity recognition model recognizes each first entity in the target sentence, the entity recognition model comprises a transformer, and the transformer comprises six multi-head self-attention modules;
wherein the identifying, in the preset entity set, a second entity of a plurality of second entities in maximum correlation with the first entity comprises:
taking the first entity as a target object, and identifying a maximum relation probability value of the target object relative to each second entity of the plurality of second entities, to obtain N−1 pieces of maximum relation probability values, wherein N−1 represents a quantity of the plurality of second entities, and N represents a total quantity of entities comprised in the preset entity set, wherein one first entity and one second entity is represented by an M-dimensional vector, the M-dimensional vector includes M relation probability values, a maximum value in the M relation probability values is determined as a maximum relation probability value between the first entity and the second entity, the M-dimensional vector is obtained by a relation between two entities in each entity group by using a relation recognition model;
identifying a correlation between each second entity of the plurality of second entities and the target sentence, to obtain N−1 pieces of correlations;
for each second entity of the plurality of second entities, calculating a product of the correlation corresponding to the second entity and the maximum relation probability value corresponding to the second entity, to obtain a correlation score corresponding to the second entity to obtain N−1 pieces of correlation scores; and
taking a second entity corresponding to a maximum correlation score of the N−1 pieces of correlation scores as the second entity in maximum correlation with the target object.
|