Search

CN-111695354-B - Text question-answering method and device based on named entity and readable storage medium

CN111695354BCN 111695354 BCN111695354 BCN 111695354BCN-111695354-B

Abstract

The invention relates to an artificial intelligence technology and discloses a text question-answering method based on a named entity, which comprises the steps of receiving consultation texts input by users, executing named entity recognition on the consultation texts to obtain an entity text set, obtaining a question-answering corpus, executing named entity recognition and named entity division on the question-answering corpus to obtain a plurality of question-answering corpus subsets, extracting question-answering corpus subsets related to the consultation texts from the question-answering corpus subsets to form an answer text set, executing segmentation and coding operation on the answer text set to obtain a question-answering code set, and inputting the question-answering code set into a pre-trained deep learning question-answering model to obtain the answer text of the consultation texts. The invention also provides a text question-answering device based on the named entity, electronic equipment and a computer readable storage medium. The invention can solve the problems of large calculation amount and poor answer effect in the text answer process.

Inventors

  • Hao Xindong
  • WANG KEQIANG

Assignees

  • 平安科技(深圳)有限公司
  • 平安科技(深圳)有限公司

Dates

Publication Date
20260421
Application Date
20200520
Priority Date
20200520

Claims (5)

  1. 1. A named entity-based text question-answering method, the method comprising: receiving consultation texts input by a user, and executing named entity recognition on the consultation texts to obtain an entity text set; Acquiring a question-answer corpus, and executing named entity identification and named entity division on the question-answer corpus to obtain a plurality of question-answer corpus subsets; extracting a question-answer corpus subset related to the consultation text from a plurality of question-answer corpus subsets to form an answer text set, performing at least one round of segmentation operation on the answer text set according to a preset segmentation sequence, segmentation quantity and segmentation tolerance according to a preset segmentation dictionary to obtain a plurality of segmentation vocabularies until the plurality of segmentation vocabularies appear in the segmentation dictionary, summarizing to obtain a question answering speech set, and performing vector coding operation on the question-answer corpus set to obtain a question-answer code set; inputting the question-answer coding set into a pre-trained deep learning question-answer model to obtain an answer text of the consultation text; the method includes the steps that at least one round of segmentation operation is carried out on the answer text set according to a preset segmentation sequence, segmentation quantity and segmentation tolerance to obtain a plurality of segmentation vocabularies, the segmentation vocabularies appear in the segmentation dictionary, and a answering speech group set is obtained through summarization, and the method includes the steps that: Step I, extracting each answer text in the answer text set; Step II, according to a preset segmentation rule, segmenting the answer text to obtain answer segmentation words; step III, judging whether the answer segmentation word appears in the segmentation dictionary, and returning to the step II if the answer segmentation word does not appear in the segmentation dictionary; step IV, if the answer segmentation word appears in the segmentation dictionary, continuing to segment the answer text until the answer text set is extracted to obtain the question-answer phrase set; the training of the deep learning question-answering model comprises the following steps: Step A, according to a preset network combination weight function, combining a plurality of groups of long-short-term memory networks to obtain a deep learning question-answer model to be trained, obtaining a question-answer training set and a question-answer label set, and inputting the question-answer training set into the deep learning question-answer model to be trained; step B, calculating the association weights among each group of long-short-term memory networks to obtain an association weight set; step C, carrying out weighted summation and activation processing on the associated weight set to obtain a question-answer prediction set; Step D, calculating error values of the question-answer prediction set and the question-answer label set, if the error values are larger than a preset error threshold value, recalculating association weights among each group of long-short-term memory networks according to a pre-constructed optimization function to obtain an association weight set, and returning to the step C; And E, if the error value is smaller than or equal to the error threshold value, obtaining the training-completed deep learning question-answering model.
  2. 2. The named entity-based text question-answering method according to claim 1, wherein the performing named entity recognition and named entity division on the question-answer corpus to obtain a plurality of question-answer corpus subsets comprises: Carrying out named entity recognition on the question-answer corpus to obtain a question-answer entity set; And according to the question-answering entities included in the question-answering entity set, carrying out text division on the question-answering corpus to obtain a plurality of question-answering corpus subsets.
  3. 3. A named entity-based text question-answering apparatus, the apparatus comprising: The entity text calculation module is used for receiving the consultation text input by the user, and executing named entity recognition on the consultation text to obtain an entity text set; the question-answer corpus calculation module is used for obtaining a question-answer corpus set, and executing named entity identification and named entity division on the question-answer corpus set to obtain a plurality of question-answer corpus subsets; The coding module is used for extracting a question-answer corpus related to the consultation text from a plurality of question-answer corpus subsets to form an answer text set, executing at least one round of segmentation operation on the answer text set according to a preset segmentation sequence, segmentation quantity and segmentation tolerance to obtain a plurality of segmentation words, until the plurality of segmentation words all appear in the segmentation dictionary, summarizing to obtain a question answering speech set, executing vector coding operation on the question-answer corpus to obtain a question-answer corpus, executing at least one round of segmentation operation on the answer text set according to the preset segmentation dictionary according to the preset segmentation sequence, segmentation quantity and segmentation tolerance to obtain a plurality of segmentation words, until the plurality of segmentation words all appear in the segmentation dictionary, summarizing to obtain a question answering speech set, wherein the step I is used for extracting each answer text in the answer text set, and the step II is used for carrying out segmentation on the answer text according to the preset segmentation rules to obtain segmentation words; The method comprises a step A of combining a plurality of groups of long-term memory networks according to a preset network combination weight function to obtain a deep learning question-answer model to be trained, a step B of inputting the question-answer training set into the deep learning question-answer model to be trained, a step B of calculating the association weight between each group of long-term memory networks to obtain an association weight set, a step C of carrying out weighted summation and activation processing on the association weight set to obtain a question-answer prediction set, a step D of calculating the error value of the question-answer prediction set and the question-answer label set, and if the error value is larger than a preset error threshold, recalculating the association weight between each group of long-term memory networks to obtain the association weight set according to a preset optimization function, and returning to the step C, wherein the step E is that if the error value is smaller than or equal to the error threshold, the deep learning question-answer model is obtained.
  4. 4. An electronic device, the electronic device comprising: At least one processor, and A memory communicatively coupled to the at least one processor, wherein, The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the named entity based text question answering method according to any one of claims 1 to 2.
  5. 5. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements a named entity based text question answering method according to any one of claims 1 to 2.

Description

Text question-answering method and device based on named entity and readable storage medium Technical Field The invention relates to the technical field of artificial intelligence, in particular to a text question-answering method and device based on named entities, electronic equipment and a readable storage medium. Background With the popularization and development of big data and artificial intelligence technology in various industries in recent years, intelligent scenes of various industries are layered endlessly, wherein a question-answering system is a main intelligent scene representative. The prior question-answering system mainly comprises a first step of converting a text input by a user into a word vector based on a word vector conversion method, a second step of calculating the size of a space distance between the word vector and a text vector of a word stock and selecting a word stock text with the smallest space distance to finish question-answering, and a third step of finishing question-answering based on a deep learning model. The first question-answering system based on the word vector conversion method is simple in method and often cannot meet the requirements of the current scene when the questions are answered, and the second question-answering system based on the deep learning model can meet the requirements of the current scene, but needs to perform a large amount of data calculation due to the deep learning model, and if a plurality of users use the question-answering system at the same time, the question-answering system cannot respond timely due to high calculation amount and is poor in timeliness. Disclosure of Invention The invention provides a text question-answering method, a device, electronic equipment and a computer readable storage medium based on named entities, which mainly aim to solve the problems of large calculation amount and poor answering effect in a text answering process. In order to achieve the above purpose, the text question-answering method based on named entities provided by the invention comprises the following steps: receiving consultation texts input by a user, and executing named entity recognition on the consultation texts to obtain an entity text set; Acquiring a question-answer corpus, and executing named entity identification and named entity division on the question-answer corpus to obtain a plurality of question-answer corpus subsets; extracting a question-answer corpus subset related to the consultation text from a plurality of question-answer corpus subsets to form an answer text set, and carrying out segmentation and coding operations on the answer text set to obtain a question-answer coding set; and inputting the question-answer coding set into a pre-trained deep learning question-answer model to obtain an answer text of the consultation text. Optionally, the answer text set is subjected to segmentation and coding operations to obtain a question-answer coding set, which comprises the following steps: executing segmentation operation on the answer text set according to a pre-constructed segmentation dictionary to obtain a answering speech group set; And executing the coding operation on the question-answer phrase set to obtain a question-answer code set. Optionally, executing the segmentation operation on the answer text set according to the pre-built segmentation dictionary to obtain a set of questions answering speech, including: Step I, extracting each answer text in the answer text set; Step II, according to a preset segmentation rule, segmenting the answer text to obtain answer segmentation words; step III, judging whether the answer segmentation word appears in the segmentation dictionary, and returning to the step II if the answer segmentation word does not appear in the segmentation dictionary; and IV, if the answer segmentation word appears in the segmentation dictionary, continuing to segment the answer text until the answer text set is extracted to obtain the question-answer phrase set. Optionally, the method further comprises training the deep learning question-answering model, wherein the training comprises: Step A, according to a preset network combination weight function, combining a plurality of groups of long-short-term memory networks to obtain a deep learning question-answer model to be trained, obtaining a question-answer training set and a question-answer label set, and inputting the question-answer training set into the deep learning question-answer model to be trained; step B, calculating the association weights among each group of long-short-term memory networks to obtain an association weight set; step C, carrying out weighted summation and activation processing on the associated weight set to obtain a question-answer prediction set; Step D, calculating error values of the question-answer prediction set and the question-answer label set, if the error values are larger than a preset error threshold value, recalculating as