Man-machine conversation method, electronic device, and computer-readable medium
AssigneeTencent Technology (Shenzhen) Company Limited
InventorsQiu Ran, Xiao Zhou, Cheng Niu, Jie Zhou
Life of this patent
Estimating the term…
Abstract
A man-machine conversation method includes: extracting a keyword from input information of a user; determining a candidate article according to the keyword; obtaining a plurality of sentences in the candidate article, and determining a score of each of the plurality of sentences; extracting part of the plurality of sentences based on the score of each of the plurality of sentences; and generating return information that includes the extracted part of the plurality of sentences.
Claims19
A man-machine conversation method, performed by an electronic device, the method comprising:
- extracting a keyword from input information of a user, comprising:
- performing word segmentation on the input information, to obtain a plurality of input words;
- determining word vectors of the plurality of input words and similarities between the word vectors;
- using the word vectors as vertices, using co-occurrence relationships of node pairs as edges, setting weights of the edges based on to the similarities between the corresponding word vectors, to construct a keyword graph, wherein a co-occurrence relationship of a node pair indicates words corresponding to two nodes of the node pair co-occur in a window with a length of K, K representing a size of the window;
- assigning random initial weights for the nodes and propagating the weights of the nodes through recursive calculation, until an error rate of a node in the keyword graph is less than a preset value, determining importance levels of the words based on the weights of nodes;
- and
- determining the keyword according to a sorting order of the importance levels;
- determining a candidate article according to the keyword;
- obtaining a plurality of sentences in the candidate article, and determining a score of each of the plurality of sentences, wherein determining the score comprises determining a score according to a similarity between the each of the plurality of sentences and the input information;
- extracting part of the plurality of sentences based on the score of each of the plurality of sentences;
- and
- generating return information that includes the extracted part of the plurality of sentences.
An electronic device, comprising:
- one or more processors;
- and a storage apparatus, configured to store one or more programs;
- the one or more processors are, when executing the one or more programs, configured to perform:
- extracting a keyword from input information of a user;
- determining a candidate article according to the keyword, comprising:
- performing word segmentation on the input information, to obtain a plurality of input words;
- determining word vectors of the plurality of input words and similarities between the word vectors;
- using the word vectors as vertices, using co-occurrence relationships of node pairs as edges, setting weights of the edges based on to the similarities between the corresponding word vectors, to construct a keyword graph, wherein a co-occurrence relationship of a node pair indicates words corresponding to two nodes of the node pair co-occur in a window with a length of K, K representing a size of the window;
- assigning random initial weights for the nodes and propagating the weights of the nodes through recursive calculation, until an error rate of a node in the keyword graph is less than a preset value, determining importance levels of the words based on the weights of nodes;
- and
- determining the keyword according to a sorting order of the importance levels;
- obtaining a plurality of sentences in the candidate article, and determining a score of each of the plurality of sentences, wherein determining the score comprises determining a score according to a similarity between the each of the plurality of sentences and the input information;
- extracting part of the plurality of sentences based on the score of each of the plurality of sentences;
- and
- generating return information that includes the extracted part of the plurality of sentences.
A non-transitory computer-readable medium, storing a computer program, the program, when executed by a processor, cause the processor to perform:
- extracting a keyword from input information of a user, comprising:
- performing word segmentation on the input information, to obtain a plurality of input words;
- determining word vectors of the plurality of input words and similarities between the word vectors;
- using the word vectors as vertices, using co-occurrence relationships of node pairs as edges, setting weights of the edges based on to the similarities between the corresponding word vectors, to construct a keyword graph, wherein a co-occurrence relationship of a node pair indicates words corresponding to two nodes of the node pair co-occur in a window with a length of K, K representing a size of the window;
- assigning random initial weights for the nodes and propagating the weights of the nodes through recursive calculation, until an error rate of a node in the keyword graph is less than a preset value, determining importance levels of the words based on the weights of nodes;
- and
- determining the keyword according to a sorting order of the importance levels;
- determining a candidate article according to the keyword;
- obtaining a plurality of sentences in the candidate article, and determining a score of each of the plurality of sentences, wherein determining the score comprises determining a score according to a similarity between the each of the plurality of sentences and the input information;
- extracting part of the plurality of sentences based on the score of each of the plurality of sentences;
- and
- generating return information that includes the extracted part of the plurality of sentences.
Dependencies are inferred from the claim text.