CN113392194A - Question expansion method, device, equipment and computer storage medium - Google Patents

Question expansion method, device, equipment and computer storage medium Download PDF

Info

Publication number
CN113392194A
CN113392194A CN202011372430.8A CN202011372430A CN113392194A CN 113392194 A CN113392194 A CN 113392194A CN 202011372430 A CN202011372430 A CN 202011372430A CN 113392194 A CN113392194 A CN 113392194A
Authority
CN
China
Prior art keywords
question
word
processed
expanded
semantic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011372430.8A
Other languages
Chinese (zh)
Inventor
周辉阳
闫昭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202011372430.8A priority Critical patent/CN113392194A/en
Publication of CN113392194A publication Critical patent/CN113392194A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The application provides a question expansion method, a question expansion device, question expansion equipment and a computer storage medium, relates to the technical field of artificial intelligence, in particular to natural language processing in artificial intelligence, and is used for improving the efficiency and accuracy of obtaining question in question and answer corpus. The method comprises the following steps: acquiring a question to be processed based on the received basic question; acquiring a semantic influence value of each first word in the question to be processed, wherein the semantic influence value represents the influence degree of each first word on the semantics of the question to be processed; and generating an expanded question set corresponding to the question to be processed based on the semantic influence value and the context associated information of each first word, wherein the expanded question set comprises expanded questions with semantic similarity greater than a first preset threshold with the question to be processed. The method automatically generates the extended question set corresponding to the question to be processed, avoids the error rate of manually extending the question, and improves the accuracy of extending the question; and time is saved, thereby improving the efficiency of expanding the question sentence.

Description

Question expansion method, device, equipment and computer storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a question expansion method, apparatus, device, and computer storage medium.
Background
In the construction process of the question-answer field, question-answer linguistic data (comprising question sentences and answers related to the question sentences) are important; however, in the related art, the question and the corresponding answer are often manually constructed to be used as question and answer linguistic data, or the historical question of a common user is captured through a log, and the historical question is manually marked and the corresponding answer is written to be used as the question and answer linguistic data; however, the former method takes a long time to obtain the question in the corpus, and the obtained question may not conform to the inquiry mode of the ordinary user, so that the accuracy of the obtained question is low; the latter may need to label the historical question sentences manually, which may seriously affect the efficiency and accuracy of obtaining the question sentences in the question and answer corpus, and therefore, the problems of small quantity of question sentences in the question and answer corpus, low accuracy and efficiency in the related art do not exist in the prior art, and an effective solution does not exist.
Disclosure of Invention
The embodiment of the application provides a question expansion method, a question expansion device, question expansion equipment and a computer storage medium, which are used for improving the efficiency and accuracy of obtaining question sentences in question and answer corpus.
In a first aspect of the present application, a question expansion method is provided, including:
acquiring a question to be processed based on the received basic question;
obtaining a semantic influence value of each first word in a question to be processed, wherein the semantic influence value represents the influence degree of each first word on the semantics of the question to be processed;
generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first word and the context associated information of each first word, wherein the expanded question set comprises expanded questions with semantic similarity greater than a first preset threshold with the question to be processed, and the context associated information represents the correlation between one word and each word belonging to the same question.
In a second aspect of the present application, there is provided a question expansion apparatus, including:
the information receiving unit is used for acquiring the question to be processed based on the received basic question;
the word processing unit is used for acquiring a semantic influence value of each first word in the question to be processed, and the semantic influence value represents the influence degree of each first word on the semantics of the question to be processed;
the question expansion unit is used for generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first word and the context associated information of each first word, wherein the expanded question set comprises expanded questions with semantic similarity larger than a first preset threshold with the question to be processed, and the context associated information represents the correlation between one word and each word belonging to the same question.
In a possible implementation manner, the information receiving unit is configured to input the basic question using a trained target neural network model, and determine a question output by the target neural network model and having semantic similarity with the question to be processed greater than a second preset threshold as the question to be processed, where the target neural network model is obtained by training in the following manner:
acquiring an initial target neural network model, wherein the initial target neural network model comprises a coding network and a decoding network; the coding network is used for learning and generating semantic vectors of all words in the question samples by using the question samples, and the semantic vector of one word is obtained by fusing the text vector of the word with the semantic information of the question sample; the decoding network is used for learning and generating a question with the same semantic as the question sample by utilizing the semantic vector of each word in the question sample;
adjusting the coding parameters of the coding network by using the question samples in the first question sample set;
randomly initializing decoding parameters of the initial decoding network;
and further adjusting the adjusted coding parameters and the decoding parameters after random initialization by using the question samples in the second question sample set, and obtaining a trained target neural network model based on the further adjusted coding parameters and decoding parameters.
In a possible implementation manner, the question sentence to be processed includes at least two, and the word processing unit is further configured to: before the semantic influence value of each first word in the question to be processed is obtained, determining a target question to be processed from the at least two question to be processed;
the word processing unit is specifically configured to: and acquiring the semantic influence value of each first word in the target question sentence to be processed.
In one possible implementation, the word processing unit is specifically configured to: randomly selecting part of the question sentences to be processed or all of the question sentences to be processed from the at least two question sentences to be processed as the target question sentences to be processed; or screening out the question to be processed with the semantic similarity greater than a third preset threshold from the at least two question to be processed, and determining the question to be processed as the target question to be processed.
In a possible implementation manner, the question expansion unit is further configured to:
after generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first word and the context associated information of each first word, displaying at least one expanded question in the expanded question set on a first display page;
the question expansion unit is further configured to: responding to a question grouping instruction triggered by the first account through a second display page, and acquiring expanded questions to be grouped; and adding the expanded question to be grouped into a question group indicated by the question grouping instruction.
In a possible implementation manner, the question expansion unit is further configured to:
responding to a question input operation triggered by a second account on a third display page, and acquiring a question to be answered and input by the second account;
determining a target question set containing the question to be answered;
acquiring answer information associated with the target question set;
and displaying the answer information on a fifth display page.
In a third aspect of the present application, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of the first aspect and any one of the possible embodiments when executing the program.
In a fourth aspect of the present application, a computer program product is provided that includes computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in the various possible implementations of the first aspect described above.
In a fifth aspect of the present application, there is provided a computer-readable storage medium having stored thereon computer instructions which, when executed on a computer, cause the computer to perform the method of any one of the first aspect and any one of the possible embodiments.
Due to the adoption of the technical scheme, the embodiment of the application has at least the following technical effects:
in the embodiment of the application, based on the semantic influence value of each first word in the question to be processed and the context associated information of each first word, an expanded question set corresponding to the question to be processed is automatically generated, so that the basic question is expanded, time is saved, the efficiency of obtaining the question in the question and answer corpus is improved, and the efficiency of expanding the question is improved; meanwhile, the problem that wrong question sentences are generated when the question-answer corpus is constructed manually is avoided, and therefore the accuracy of obtaining the question sentences in the question-answer corpus is improved.
Drawings
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present application;
fig. 2 is an exemplary diagram of a flow of a question expansion method provided in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a target neural network model according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a training principle of a target neural network model according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a training process of a target neural network model according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a process of acquiring an expanded question set according to an embodiment of the present application;
fig. 7 is a schematic diagram of a process of generating an expansion question provided in an embodiment of the present application;
fig. 8 is a schematic diagram of a process of generating a current word in an expanded question provided in an embodiment of the present application;
fig. 9 is an exemplary diagram of a fourth display page provided in the embodiment of the present application;
fig. 10 is an exemplary diagram of a first display page provided in an embodiment of the present application;
FIG. 11 is an illustration of another first display page provided by an embodiment of the present application;
fig. 12 is an exemplary diagram of a second display page provided in an embodiment of the present application;
fig. 13 is an exemplary diagram of a third display page provided in the embodiment of the present application;
fig. 14 is a block diagram of a neural network model system provided in an embodiment of the present application;
fig. 15 is a schematic diagram of richness of an expanded question provided in an embodiment of the present application;
FIG. 16 is a diagram illustrating richness of another expanded expansion question provided in the embodiments of the present application;
fig. 17 is a schematic process diagram of the accuracy of an expanded expanding question provided in the embodiment of the present application;
FIG. 18 is a diagram illustrating the accuracy of another expanded expansion question provided by an embodiment of the present application;
fig. 19 is a structural diagram of a question expansion apparatus according to an embodiment of the present application;
FIG. 20 is a block diagram of a computer device according to an embodiment of the present application;
fig. 21 is a structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to better understand the technical solutions provided by the embodiments of the present application, the following detailed description is made with reference to the drawings and specific embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In order to facilitate a better understanding of the technical solutions of the present application by those skilled in the art, the following description is given of the basic concepts related to the present application.
1) Question-answering system
Question Answering System (Question Answering System, QA): is a high-level form of information retrieval system, which can answer questions posed by users in natural language with accurate and concise natural language; the main reason for the rise of the research of the question-answering system is the demand of people for quickly and accurately acquiring information, and the current question-answering system is a research direction which is concerned with and has wide development prospect in the fields of artificial intelligence and natural language processing.
2) Account, first account and second account
In order to distinguish the two different accounts, in the embodiment of the application, a first account is used for referring to the user creating the question and answer corpus, and a second account is used for referring to the common account using the question and answer system; the first account can be an enterprise-level user in the question-answering system, and is used for inputting basic question sentences into the question-answering system and receiving an expanded question sentence set returned by the question-answering system; the second account may input a question to be answered to the question-answering system, and the question-answering system returns answer information associated with the question to be answered.
3) Question and answer corpus
The question-answer corpus in the embodiment of the application comprises question sentences and answer information related to the question sentences.
4) Word, first word and second word
Generally, a word generally refers to one or more characters in a text, and the form of the word has an association relationship with the voice form of the text, for example, when the language form of the text is chinese, a word can be a chinese character or a phrase composed of multiple chinese families, and when the language form of the text is english, a word can be an english word or a phrase composed of multiple english words, and the like; when the language form of the text is french, hindi, italian, japanese or korean, etc., a person skilled in the art can set the form of the corresponding word according to actual requirements;
in the embodiment of the present application, words in each question (such as a basic question, a question to be processed, an expanded question, or the like) and words in a preset word set are mainly related.
5) Semantic impact value and context association information of words
For a certain word in a sentence, the semantic influence value of the word represents the influence degree of the word on the semantics of the sentence; the context association information of the word represents the association between the word and each word in the sentence; contextual relevance information may be determined, but is not limited to, by the degree of relevance of the word to a word preceding the word, and the degree of relevance of the word to a word succeeding the word.
6) Bert (bidirectional Encoder Repressions from Transformer) model
The Bert model is a coding network (Encoder) of a bidirectional Transformer; the goal of the Bert model is to use large-scale unmarked corpus training to obtain semantic Representation (replication) of the text containing rich semantic information, and then to fine-tune the semantic Representation of the text in a specific Natural Language Processing (NLP) task, and finally apply the task to the specific NLP task.
7) Artificial Intelligence (AI)
Artificial intelligence is a theory, method, technology and application system for simulating, extending and expanding human intelligence by using a digital computer or a machine controlled by the digital computer, sensing the environment, acquiring knowledge and obtaining the best result by using the knowledge; that is, artificial intelligence is a comprehensive technique in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence; artificial intelligence, namely, the design principle and the realization method of various intelligent machines are researched, so that the machine has the functions of perception, reasoning and decision making; the artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning or deep learning and the like.
8) Natural Language Processing (NLP)
Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that enable efficient communication between humans and computers using natural language. Natural language processing is a science integrating linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language that people use everyday, so it is closely related to the research of linguistics. Natural language processing techniques typically include text processing, semantic understanding, machine translation, robotic question and answer, knowledge mapping, and the like.
The following explains the concept of the present application.
In the construction process of the question-answer field, question-answer linguistic data (comprising question sentences and answers related to the question sentences) are important; however, in the related art, the expanded question and answer corpus is usually obtained by manually constructing a question or expanding the existing question, but the efficiency of manually expanding the question is low, one person can only process a certain amount of data a day, if a large amount of question and answer corpus needs to be created, a large amount of question and answer are required to be expanded, the time is long, and the person creating the question and answer corpus cannot predict the variable question form of a common user, so that the accuracy and the richness of the expanded question and answer are low; in the related technology, historical question sentences of common users can be captured through logs, if the group of users is not large enough, the number of captured historical question sentences is small or small, and the form of the captured historical question sentences tends to be single, the number and the quality of the obtained question and answer linguistic data have obvious defects, in addition, the accuracy of the question sentences excavated in the log capturing mode is low, if the keywords are ' classroom ', the log capturing mode can recall some ' I want to listen to the song in classroom ', ' help I navigate to the place in classroom ', and the temperature of the classroom is what ', so that the fields of the three linguistic data belong to music, navigation and weather, do not belong to the field of question and answer classes at all, the accuracy of the question sentences captured through the logs is low, and in this way, extra technicians need to spend more time to capture and label the question sentences, time and labor are consumed, and further the efficiency of obtaining the question sentences in the question and answer corpus is low.
In view of the above, the inventors devised a question expansion method, apparatus, device, and computer storage medium; in the embodiment of the application, the time consumption and the low efficiency of manual creation and log capture of the question sentences in the question and answer corpus are considered, so that the question sentences in the question and answer corpus are obtained in a manner of expanding the question sentences in the embodiment of the application, and further more question and answer corpuses can be obtained based on the expanded question sentences; specifically, in the embodiment of the present application, a to-be-processed question is obtained based on a basic question, and an expanded question set corresponding to the to-be-processed question is generated based on a semantic influence value of each first word in the to-be-processed question and context associated information of each first word (that is, an expanded question set corresponding to the basic question is obtained); the expanded question set may include one or more expanded questions whose semantic similarity to the to-be-processed question is greater than a first preset threshold.
It should be noted that the question related in the embodiment of the present application may be, but is not limited to, text information or voice information, and those skilled in the art may set the question according to actual needs.
In order to more clearly understand the design idea of the present application, an application scenario of the embodiment of the present application is described as follows; referring to fig. 1, a schematic structural diagram of a question-answering system is provided, where the system includes a terminal device 100 and a question-answering server 200, and a question-answering client 110 may be installed on the terminal device 100 (such as but not limited to 100-1 or 100-2 in the figure), where the question-answering client 110 is a client of the question-answering system, and the question-answering server 200 is a server of the question-answering system; the question-answering client 110 and the question-answering server 200 communicate with each other.
The question-answering client 110 (such as but not limited to 110-1 or 110-2 included in the figure) may send, but not limited to, the basic question sentence indicated by the first account through the fourth display page to the question-answering server 200; or sending the question to be answered indicated by the second account through the third display page to the question-answering server 200; an expanded question or corresponding answer information may also be presented in a display page provided by the question-answering client 110 based on the instruction of the question-answering server 200.
The question-answering server 200 may, but is not limited to, obtain a basic question from the question-answering knowledge base 300 or receive the basic question sent by the question-answering client 110, obtain a question to be processed based on the basic question, and generate an expanded question set corresponding to the question to be processed based on the semantic influence value and the context correlation information of each first word in the question to be processed; further, the question-answering server 200 may also send the expanded set of question sentences corresponding to the to-be-processed question sentences to the question-answering client 110.
As an embodiment, the question-answering server 200 may further receive a question to be answered sent by the question-answering client 110, and return answer information associated with a target question group containing the question to be answered based on the question to be answered.
The question-answering server 200 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a plurality of cloud servers (such as but not limited to a server 200-1, a server 200-2, or a server 200-3 illustrated in the figure) providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms in a cloud service technology; the functions of the question answering server 200 may be implemented by one or more cloud servers, or by one or more cloud server clusters, etc.
The terminal device 100 in the embodiments of the present application may be a mobile terminal, a fixed terminal, or a portable terminal, such as a mobile handset, a station, a unit, a device, a multimedia computer, a multimedia tablet, an internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a Personal Communication System (PCS) device, a personal navigation device, a Personal Digital Assistant (PDA), an audio/video player, a digital camera/camcorder, a positioning device, a television receiver, a radio broadcast receiver, an electronic book device, a game device, or any combination thereof, including accessories and peripherals of these devices, or any combination thereof.
Based on the application scenario of fig. 1, a question expansion method related in the embodiment of the present application is described below as an example; referring to fig. 2, a question expansion method designed in the embodiment of the present application is shown, which is applied to the question-answering system (i.e., the question-answering server 200 or the combination of the question-answering server 200 and the question-answering client 110), and specifically includes the following steps:
step S201, acquiring a question to be processed based on the basic question.
As an example, before step S201, a basic question may be obtained, where the basic question may be obtained from the questions in the question and answer corpus in the question and answer database 300, for example, one or more questions may be randomly selected from the questions in the question and answer corpus as the basic question, or a question whose history is recalled more than a first threshold value may be selected from the questions in the question and answer corpus as the basic question according to the number of times of the history of each question in the question and answer corpus; the first time threshold is not limited, and can be set by a person skilled in the art according to actual requirements; in the embodiment of the application, the basic question can be obtained in response to a question input operation triggered by the first account on the fourth display page, namely, the question input on the fourth display page is determined as the basic question; therefore, the basic question to be expanded can be obtained in different modes, and the flexibility of obtaining the basic question is improved.
As an embodiment, one or more basic question sentences may be acquired in the embodiment of the present application, and in order to improve the diversity of the finally acquired expanded question set, in the embodiment of the present application, some or all of the basic question sentences may be directly determined as to-be-processed question sentences; if a basic question is obtained, determining the basic question as a question to be processed; if a plurality of basic question sentences are obtained, partial question sentences can be screened from the plurality of basic question sentences and determined as question sentences to be processed, or the plurality of basic question sentences are determined as question sentences to be processed.
Furthermore, in the process of screening partial questions from the multiple basic questions as questions to be processed, the partial questions can be randomly screened from the multiple basic questions, and the partial questions can also be screened in different ways according to different sources of the multiple basic questions; if a plurality of question sentences are obtained from the question sentences in the question-answer corpus, partial question sentences can be screened out according to the number of times of the history recall of each basic question sentence, the basic question sentences the number of times of which the history recall is greater than a second time threshold value can be screened out, and the basic question sentences are determined to be question sentences to be processed; if a plurality of basic question sentences are obtained in response to the question input operation, then K basic question sentences having the lowest semantic similarity with other basic question sentences can be selected as to-be-processed question sentences, or K basic question sentences with the most advanced input sequence can be selected as to-be-processed question sentences, and the like, wherein the second time threshold value is not limited, and a person skilled in the art can set the second time threshold value according to actual requirements, wherein K is a positive integer.
In the embodiment of the present application, a trained target neural network model may also be used to obtain a first similar question of the basic question as a question to be processed, where the target neural network model may include, but is not limited to, a Bert model, an Ernie model, an Albert model, and the like; in the embodiment of the application, the basic question (a part of the basic question or all the basic question) and the first similar question can be determined as the question to be processed; the first similar question of one basic question may include one or more questions, and the first similar question is a question whose semantic similarity with the basic question is greater than a third preset threshold; the manner of obtaining the target neural network model will be described in detail below; in the embodiment of the application, the question to be processed can be acquired in various ways, so that the flexibility of acquiring the question to be processed is improved, and the acquired diversity of the question to be processed is increased.
Step S202, obtaining semantic influence values of all first words in the question to be processed, wherein the semantic influence values represent the influence degree of all the first words on the semantics of the question to be processed.
As an embodiment, a first reference value and a second reference value of each first term may be obtained based on a second term in a preset term set; normalizing the first reference value and the second reference value to determine semantic influence values of the first words; the preset word set may be a pre-created word set, and the preset word set may include, but is not limited to, words with high usage frequency, and the like, and a person skilled in the art may set the preset word set according to actual needs;
the first reference value represents the probability of generating a corresponding word in the expanded question by using the first word, namely the first reference value represents the copying probability of the first word in the question to be processed when the expanded question is generated; the second reference value represents the probability of generating a corresponding word in the expanded question sentence by using a second word, the second word is a word in a preset word set, the semantic similarity between the second word and the first word is greater than a second preset threshold, namely the second reference value represents the generation probability of generating the first word by using the second word when the expanded question sentence is generated; the semantic influence values obtained in the process represent the influence degree of each first word on the semantics of the to-be-processed question, and the related first reference value and the second reference value can also determine whether the word of the to-be-processed question can be directly copied or not when the expanded question is generated, so that the efficiency and the accuracy of generating the expanded question can be improved.
As an embodiment, in the embodiment of the present application, a question feature vector of semantics of a question to be processed and a word feature vector of each first word may be obtained, and then a semantic influence value of each first word may be determined based on a distance between the word feature vector of each first word and the question feature vector; if but not limited to, the distance between the word feature vector and the question feature vector of each first word is directly determined as the semantic influence value of each first word, or the distance is weighted to obtain the semantic influence value of each first word; in the embodiment of the present application, a Copy mechanism (Copy) or the like may be further used to obtain a replication probability of directly replicating the first word and a generation probability of generating the first word by using words in a preset vocabulary during the process of generating the expanded question, and further obtain a semantic influence value of each first word after normalizing the replication probability and the generation probability of each first word, where the Copy mechanism refers to a segment located in an input sequence, and then copies the segment to one of output sequences, and the detailed content of the semantic influence value of each first word obtained by using the Copy mechanism will be described below; the semantic influence value of each first word can be determined in different modes based on business requirements in the process, and the flexibility of obtaining the semantic influence value of each first word is improved.
Step S203, generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first term and the context associated information of each first term, where the expanded question set includes expanded questions whose semantic similarity with the question to be processed is greater than a first preset threshold.
Specifically, in the embodiment of the present application, each first word is mapped to a word vector, the word vector is input to a context processing neural network, and the context processing neural network is used to perform an operation on the input word vector, so as to obtain context associated information of each first word, where the context processing neural network may be, but is not limited to, LSTM, BiSTM, or the like.
As an embodiment, the context associated information of a word in the embodiment of the present application represents a correlation between the word and each word belonging to the same question sentence; the context association information of a word (i.e. the current word) in a question may be, but is not limited to, determined by the first association degree and the second association degree of the current word; the first relevance degree represents the relevance degree of the current word and the previous word in the question sentence with the current word, and the second relevance degree represents the relevance degree of the current word and the next word in the question sentence with the current word; for ease of understanding, the first relevance may be, but is not limited to, a probability that the current word occurs after the previous word, and the second relevance may be, but is not limited to, a probability that the next word occurs after the current word, where an example of contextual relevance information is given: if the current word is "bright", the previous word of "bright" is "floating", and the next word is "woman", and if the probability of "bright" appearing after "floating" is 0.8 and the probability of "woman" appearing after "bright" is 0.5, the context related information of "bright" may be, but is not limited to, 0.8 × 0.5 — 0.01; the above-mentioned context related information of "bright" is only an exemplary illustration, and a person skilled in the art may also obtain the context related information of the current word by other means, such as determining the context related information of the current word based on the distance between the word vector mapped by the current word and the word vector mapped by the previous word, and the sum of the distances between the word vector mapped by the current word and the word vector mapped by the next word, etc.
As an embodiment, in the embodiment of the application, a plurality of expanded question sets are generated in a grouping manner, and a set of expanded questions in the expanded question sets is determined as the expanded question set, wherein one expanded question set at least comprises one expanded question, first words of different expanded questions in the same expanded question set can be the same, and first words of expanded questions in different expanded question sets can be different; therefore, a plurality of groups of expanded question sets with different first words can be obtained, and the quantity of the expanded questions and the richness of the expanded questions are greatly improved.
As an embodiment, in the step S203, but not limited to, obtaining the expansion question set through a dbs (diversity Beam search) decoding mechanism, and a person skilled in the art may also flexibly set other decoding mechanisms to implement the step S203.
As an example, the target neural network model involved in step S201 is explained in detail below: the target neural network model may be, but is not limited to, a Question Generation (QG) model; in the field of natural language processing, the QG model refers to a given text and corresponding answers, and generates a question (question sentence) corresponding to the answer according to the two pieces of information.
The target neural network model may also be an architecture formed by a plurality of neural networks with text processing function, please refer to fig. 3, an embodiment of the present application provides an architecture of a target neural network model, where the target neural network model includes an encoding network and a decoding network; the coding network is used for asking a sentence, learning and generating semantic vectors of all words in the asking sentence, wherein the semantic vector of one word is obtained by fusing the text vector of the word with the semantic information of the asking sentence; the decoding network is used for learning and generating the question with the same semantic as the question by utilizing the semantic vector of each word in the question; wherein the coding Network and the decoding Network may be formed by a Convolutional Neural Network (CNN) or a Recurrent Neural Network (RNN); the coding network and the decoding network can also be formed by a Transformer unit but are not limited to the above; the encoding network may be, but is not limited to, a Bert model; wherein the Bert model is a two-way language model, and each word can simultaneously utilize the context information of the word; the bidirectional representation model can simultaneously utilize two parts of information of a word before the word and a word after the word when processing a certain word; unlike the Bert model and the traditional language model, it does not predict the most likely current word given all preceding words, but rather randomly masks some words and predicts with all the words that are not masked.
In the following contents of the embodiment of the present application, a training process for obtaining a target neural network model is described by taking an example in which a target neural network model includes a coding network and a decoding network formed by Transform units; referring to fig. 4, in the embodiment of the present application, but not limited to, a coding network may be pre-trained, and then a fine-tuning mechanism is used to perform fine-tuning on coding parameters of the pre-trained coding network and decoding parameters of a decoding network, so as to obtain a trained target neural network model; in the embodiment of the application, the encoding parameters of the encoding network can be obtained by but not limited to pre-training through a Bert model, and then Fine tuning is performed on the encoding parameters and the decoding parameters through a Fine-tune; referring to fig. 5, the training process of the target neural network model specifically includes the following steps:
step S501, obtaining an initial target neural network model, wherein the initial target neural network model comprises a coding network and a decoding network; the coding network is used for learning and generating semantic vectors of all words in the question samples by using the question samples, and the semantic vector of one word is obtained by fusing the text vector of the word with the semantic information of the question sample; the decoding network is used for learning and generating the question with the same semantic as the question sample by using the semantic vector of each word in the question sample.
Step S502, using the question samples in the first question sample set to adjust the coding parameters of the coding network.
As an embodiment, the question samples in the embodiment of the present application may include a word feature vector sample mapped to each word in the question sample and a question feature vector sample mapped to the question sample, in step S502, the question sample may be input to a coding network, a predicted word feature vector and a predicted question feature vector of each word output by the coding network are obtained, a first prediction bias of the coding network is determined based on a deviation between the predicted word feature vector of each word and a corresponding word feature vector sample, and a deviation between the predicted question feature vector and the question feature vector sample, and a coding parameter of the coding network is adjusted through a loss function of the coding network toward a direction of reducing the first prediction bias until a coding network pre-training end condition is satisfied; when the encoding parameters are adjusted, gradient adjustment and the like can be performed on the encoding parameters, but not limited to; the coding network pre-training end condition may include, but is not limited to: the training time length reaches a first time length threshold value, the times of adjusting the coding parameters reach a first adjusting time threshold value or the first prediction deviation is smaller than a first prediction deviation threshold value and the like;
the coding network after the coding parameters are adjusted by the method can improve the accuracy of coding each word in the question by the coding network to obtain the word characteristic vector, and improve the accuracy of coding the question by the coding network to obtain the question characteristic vector; the encoding parameters of the encoding network may also be adjusted by other means by those skilled in the art, which are not limited herein.
Step S503, randomly initializing the decoding parameters of the initial decoding network.
Step S504, the question samples in the second question sample set are used for further adjusting the adjusted coding parameters and the decoding parameters after random initialization, and the trained target neural network model is obtained based on the further adjusted coding parameters and decoding parameters.
As an embodiment, the question samples in the second question sample set may include a question input sample and similar question samples having semantic similarity greater than a third preset threshold with respect to the question input sample, and in step S504, the question input sample may be input into a neural network model composed of an encoding network and a decoding network, and based on a second prediction bias between a predicted similar question output by the neural network model and the corresponding similar question sample, the adjusted encoding parameters and the randomly initialized decoding parameters are adjusted in a gradient descending manner toward a direction of reducing the second prediction bias until a training end condition is satisfied, so as to obtain a trained target neural network model, where the training end condition may include, but is not limited to: the training time length reaches a second time length threshold value, the times of adjusting the coding parameters or the decoding parameters reach a second adjusting time threshold value or a second prediction deviation is smaller than a second prediction deviation threshold value, and the like.
Through the steps S501 to S504, the coding network is pre-trained, the decoding network is randomized, the coding parameters of the coding network and the decoding parameters of the decoding network are adjusted through the Fine-tune, the accuracy and the depth of the adjusted parameters are increased in the process of training the target neural network model, and the accuracy of generating the first similar question of the basic question by the trained target neural network model is further improved.
As an embodiment, the first reference value, the second reference value, and the process of obtaining the semantic influence value of each first word referred to in step S202 are further described below.
In the embodiment of the application, a first reference value and a second reference value of each first word can be flexibly set and obtained; if a first word only includes a question to be processed but not a preset word set, and a second word with semantic similarity greater than a second threshold does not exist in the preset word set, setting a first reference value of the first word to 1, and setting a second reference value of the first word to 0; if a first word appears in the question to be processed and is included in the preset word set, the first reference value of the first word may be set to 0, and the second reference value of the first word may be set to 1; if a first word is included in the question to be processed and is not included in the preset word set, but a second word with semantic similarity greater than a second threshold exists in the preset word set, the first reference value of the first word may be set to be between 0 and 0.5, the second reference value of the first word may be set to be between 0.5 and 1, and so on, based on the semantic similarity between the second word and the first word.
As an embodiment, in the embodiment of the present application, a first reference value and a second reference value of each first word may also be generated through a Copy mechanism, and then normalization processing is performed on the first reference value and the second reference value to obtain a semantic influence value of each first word; the Copy mechanism: a decision layer after a decoding network is used for deciding whether each word is directly copied from the original word or is generated into a new word, a Copy mechanism has two modes when generating the word, one mode is a generation mode of the word, the other mode is a Copy mode of the word, and the generation model is a probability model combining the two modes, wherein a first reference value is the probability of the Copy mode, and a second reference value is the probability of the generation mode; in the embodiment of the application, a Copy mechanism is adopted to solve the problem of uncommon words (OOV, words not contained in the preset word set), namely, when the expanded question is generated, the uncommon words in the to-be-processed question can be directly copied, so that the semantic similarity between the expanded question library and the to-be-processed question is improved.
As an embodiment, the way of performing the normalization process on the first reference value and the second reference value in step S202 is not limited too much, and those skilled in the art may set according to actual requirements, for example, the normalization process may be performed on the first reference value and the second reference value based on the principle of the following formula (1), formula (2) or formula (3).
Pi=Pi_1+PiA2 formula (1)
Pi=Pi_1×k1+PiA2 Xk 2 formula (2)
Figure BDA0002806522980000171
In the above formulas (1) to (3), PiRepresenting the semantic influence value, P, of the ith (i is a positive integer) first word in the question to be processedi1 is the first reference value of the ith first word, Pi_2is the second reference value of the ith first word, k1 is the first weight value of the first reference value, k2 is the second weight value of the second reference value, k3 is the third weight value of the first reference value, and k4 is the weight value of the second reference value; the arrangement of k1 to k4 is not limited too much, and those skilled in the art can set the arrangement according to actual needs.
As an embodiment, after the first reference value and the second reference value of each first word are obtained through the Copy mechanism, the semantic influence value of each first word may be obtained by, but is not limited to, processing the first reference value and the second reference value through the principle of the following formula (4).
P(yt|st,yt-1,ct,M)=P(yt,c|st,yt-1,ct,M)+P(yt,g|st,yt-1,ctM) formula (4)
In formula (4), M is the set of input hidden layer states in Copy mechanism, t represents the word at time t, ctIs an attention score(s)tIs a hidden state of origin; g represents the probability of generating the corresponding words in the expanded question sentence by using the second words, and c represents the probability of generating the corresponding words in the expanded question sentence by using the first words; c | stFirst reference value, g | s, representing the word at time ttA second reference value representing the word at time t.
In the related technology, when a basic sentence is directly expanded through a QG model, sentences similar to a basic question sentence expanded by the QG model may not be smooth, and the semantics of the expanded sentences may not be consistent with those of the basic sentence; if the basic sentence before expansion is "how to look at the playback in XX classroom", the sentence expanded by the QG model is "how to look up the playback in XX classroom", and the sentence expanded by the Copy mechanism is "how to look up the playback in XX classroom", obviously, it is not clear that "XX classroom" refers to a house-like classroom or a classroom in "how to look up the playback in XX classroom"; furthermore, the Copy mechanism can well solve the problem of rarely-used words, for example, if the original sentence is "famous teacher joining XX classroom appears sparkling", the sentence expanded by the QG model is "famous teacher entering and leaving tenuous classroom [ unk ] [ unk ] bright", wherein [ unk ] [ unk ] is a character corresponding to the rarely-used character "sparkling", but the person who sees the sentence does not know the semantic of [ unk ] unk ], but the sentence expanded by the Copy mechanism is "famous teacher entering and leaving tenuous classroom sparkling", obviously, the application of the Copy mechanism can improve the accuracy of the expanded sentence, and therefore, the Copy mechanism is used in the embodiment of the application to determine the semantic influence value of each first word in the to-be-processed sentence, and the accuracy of the expanded sentence obtained when the to-be-processed sentence is expanded can be improved.
As an embodiment, a method of expanding the question to be processed in a packet form in step S203 will be further described below.
Referring to fig. 6, an expanded question set corresponding to a question to be processed may be obtained through the following steps:
step S601, determining a threshold N (N is a positive integer) of the number of expanding question sentences in the expanding question sentence set.
As an embodiment, the number threshold N may be preset, and those skilled in the art may set N according to actual requirements, such as but not limited to setting N to 3, 5, 6, or 9, etc.
Step S602, based on the semantic influence value of each first word in the question sentence to be processed, the first words corresponding to the first N largest semantic influence values are screened out.
Step S603, determining the screened N first words as first words of expansion sentences in each of the N expansion sentence groups.
As an embodiment, when the semantic influence value of a first word is greater than or equal to the semantic influence threshold, it means that the first word can be directly copied when an expanded question is generated, so that when the semantic influence value of the screened first word is greater than or equal to the semantic influence threshold, the first word can be directly used as the first word in the corresponding expanded question group; when the semantic influence value of the screened first word is smaller than the semantic influence threshold, a second word with semantic similarity larger than a second preset threshold with the first word in the preset word set can be used as a first word in the corresponding expanded question set; and the first words of the expanded questions in different expanded question groups are different, and the obtained expanded questions in the multiple expanded question groups have more various words under the condition of relatively similar semantics, so that the richness of the obtained expanded questions in the multiple expanded question groups is improved.
For convenience of understanding, a specific example is given here, please refer to fig. 7, and assuming that the question to be processed is "i can receive a failure fund for several months", N is 3, the 3 first words with the largest semantic influence values are "i", "missing" and "can", respectively, and the semantic influence values of "i" and "missing" are greater than the semantic influence threshold, and the semantic influence value of "can" is less than the semantic influence threshold, then "i" and "missing" can be respectively used as the first words of the expansion question in the 1 st expansion question set and the 2 nd expansion question set, and the "can" with the semantic similarity to "can" in the preset word set greater than the second preset threshold is determined as the first word of the expansion question in the 3 rd expansion question set.
Step S604, for each expanded question group of the N expanded question groups, acquiring expanded question sentences in each expanded question group according to the context associated information of the first word and the context associated information of the first word other than the first word.
For the convenience of understanding, an illustrative example is given here, and the context association information of the current word in the expanded question is determined by the first association degree and the second association degree of the current word; the first relevance characterizes the probability of the current word appearing after the previous word; the second relevance represents the probability of the occurrence of a subsequent word after the current word; referring to fig. 8, as for the 1 st expanded question set in fig. 7, the first word of the expanded question is "i me", in generating the second word of the expanded question (i.e., the second word is the current word described above), assuming that both words "can" and "want" may appear after "me", and the probability of "can" appearing after "i" is 0.9 (i.e., the first degree of association of "can" is 0.9), the probability of "can" appearing after "can" is 0.5 (i.e., the second degree of association of "about" is 0.5), the summary of "can" appearing after "i" is 0.1 (i.e., the first degree of association of "can" is 0.1), the probability of "can" appearing after "about" is 0.9, the probability of occurrence of "i am" (one form of the above-mentioned context-related information) is 0.9 × 0.5 ═ 0.45, the probability of occurrence of "i am" is 0.1 × 0.9 ═ 0.01, since 0.01 is much smaller than 0.45, the word appearing after "me" in the expanded question set is "can"; however, after the 'industry' is generated, the probability of occurrence of the 'industry insurance' is 0.36, the probability of occurrence of the 'industry gold' is 0.35, and the numerical values of 0.35 and 0.36 are relatively close, so that after the 'industry', the 'insurance' and the 'gold' are generated at the same time; the above contents are merely exemplary illustrations for easy understanding, and do not constitute a limitation on the question expansion method provided in the embodiments of the present application.
And step S605, generating an expanded question set corresponding to the to-be-processed question by using the expanded questions in each expanded question group.
Specifically, some or all of the expanded question sets may be screened out from the expanded question sets, and a set formed by the screened expanded question sets is determined as an expanded question set corresponding to the question to be processed; if a set formed by all the expanded questions in each expanded question group can be determined as the expanded question set corresponding to the question to be processed, one expanded question can be screened from each expanded question group to form the expanded question set corresponding to the question to be processed, and the like, a person skilled in the art can flexibly set the expanded question set according to business requirements.
As an embodiment, please refer to fig. 9, an example of a fourth display page is provided in the present application, where the first account may be, but is not limited to, a question input operation triggered by the fourth display page to indicate a basic question, the first account may also input answer information associated with the basic question through the fourth display page, and after logging in the fourth display page 900 through the first account, the head portrait, the name, and the like of the first account may be displayed in an account display area 901 in the fourth display page 900; the first account may input a basic question in a first information input box 903 in the question and answer management area 902, input answer information corresponding to the basic question in a second information input box 904, and the like; the second account may also search for corresponding question or answer information, etc. through the information search box 905.
As an embodiment, after step S203, expanded question sentences in the expanded set of expanded question sentences may also be displayed to a first account, and based on an instruction of the first account, the expanded question sentences may be grouped; specifically, at least one expanded question in the expanded question set may be displayed on a first display page; further responding to a question grouping instruction triggered by the first account through a second display page, and acquiring expanded questions to be grouped; adding the expanded question to be grouped into a question group indicated by the question grouping instruction; the second display page may be a page embedded in the first display page, or may be a page independent of the first display page.
For ease of understanding, referring to fig. 10, an example of a first display page is provided, in the first display page 1000, a basic question is "how aircraft position lights are distributed", an expanded question of a question to be processed obtained from the basic question (such as but not limited to including where the aircraft position lights illustrated in the figure are installed, how the aircraft position lights are installed on the aircraft, or where the position lights are distributed on the aircraft) and the like may be displayed in the first display area 1101, and answer information corresponding to the basic question is displayed in the second display area 1102.
Referring to fig. 11 and 12, another example of a first display page is provided, where in the first display page 1100, when a similar question (i.e., an expanded expansion question) is tested, data information to be fused of a basic question (i.e., 1 piece of data to be fused is illustrated in the figure, where the 1 piece of data is to be fused as information based on an expanded expansion question sentence "what you can answer") may be displayed, and a first account may enter a second display page 1200 after clicking the fused data information;
the first account may trigger a question grouping instruction through the first control 1201 in the second display page 1200, may also receive a grouping operation cancellation instruction for canceling a question grouping operation through the second control, and may confirm the question grouping instruction or the grouping operation cancellation instruction through the confirmation control 1203, or cancel the question grouping instruction or the grouping operation cancellation instruction through the cancellation control 1204, or the like.
As an embodiment, in the embodiment of the present application, the obtained question sets and answer information related to the question sets may be stored in a question-and-answer database, and when the first account uses a question-and-answer system, corresponding answer information may be returned to the first account based on the answer information of the question sets in the question-and-answer database; specifically, a question to be answered input by the first account may be acquired in response to a question input operation triggered by the first account on the third display page; determining a question group containing the question to be answered; acquiring answer information associated with the determined question set; displaying the answer information on a fifth display page; the fifth display page may be a page embedded in the third display page, or may be a page independent of the third display page.
Referring to fig. 13, an example of a third display page is provided, in a third display page 1300, a second account may input a question to be answered in a question input box 1301, and request corresponding answer information from the question-answering system through a search control 1302; the question-answering system displays answer information associated with a target question set containing the question to be answered in an answer display area 1304 of a fifth display page 1303, wherein the target question set is a question set in a question-answering knowledge base; furthermore, the second account can derive the answer information of the question to be answered from the question-answering system through the answer derivation control 1305, and the second account can also feed back that the displayed answer information has errors through the error feedback control 1306, and the like.
As an embodiment, there may be one or at least two to-be-processed question sentences obtained in step S201, so that when there are at least two to-be-processed question sentences, for each to-be-processed question sentence, an expanded question sentence set corresponding to each to-be-processed question sentence can be obtained through step S202 and step S203; before the step S202, a target question to be processed may be screened from at least two question to be processed, and then, in the step S202, a semantic influence value of each first term in the target question to be processed is obtained for each target question to be processed.
Further, in order to improve the accuracy of the obtained expanded question set, a target question to be processed may be determined from at least two question to be processed, but not limited to, by the following method:
the first question screening mode: and randomly selecting part of the question sentences to be processed or all of the question sentences to be processed from the at least two question sentences to be processed as the target question sentences to be processed.
The second question screening mode: and screening out the question to be processed with the semantic similarity greater than a third preset threshold from the at least two question to be processed, and determining the question to be processed as the target question to be processed.
A specific example of a question extension is provided below, and the question extension is composed of a neural network model system as shown in fig. 14, wherein the neural network model system comprises an encoding network, a decoding network Copy mechanism and a DBS decoding mechanism; wherein:
the coding network is used for receiving the basic question sentence, coding the basic question sentence, generating semantic vectors of all words in the basic question sentence, and transmitting the generated semantic vectors of all words to the decoding network;
the decoding network decodes the semantic vectors of all words in the basic question to obtain a question to be processed, the semantic similarity of which to the basic question is greater than a third preset threshold value, and transmits the question to be processed to a copy mechanism;
the Copy mechanism acquires a first reference value and a second reference value of each first word in the question to be processed based on a second word in the preset word set, and normalizes the acquired first reference value and second reference value to determine a semantic influence value of each first word;
the DBS decoding mechanism is configured to determine a number threshold N in an expanded question set that needs to be generated, generate N expanded question sets corresponding to the to-be-processed question based on a semantic influence value of each first word and context correlation information of each first word, and generate an expanded question set corresponding to the to-be-processed question (i.e., an expanded question set corresponding to a basic question) based on an expanded question in the N expanded question sets.
Please refer to table 1, which shows the effect comparison between the expanded question sentence generated by using the Beam Search (BS) BS decoding mechanism to generate the basic question sentence and the expanded question sentence generated by using the method provided in the embodiment of the present application.
Comparison of the effects of expanding question in different ways table 1
Figure BDA0002806522980000231
It is obvious from table 1 that the character similarity of the expanded question sentences 1-5 expanded by the BS decoding mechanism is very high, and the richness of the expanded question sentences is low; the expanded questions 1-5 expanded by the technical scheme provided by the embodiment of the application have low character similarity, and the expanded questions are rich.
In the embodiment of the present application, a diversity index is used to specifically measure the richness of the expanded expanding question (the number of discrete phrases in a set of diversity beam search results is counted, divided by the total number of words in the set of beams, and then the results of all data are averaged), please refer to fig. 15 and fig. 16, in which the abscissa represents the number of characters and the ordinate represents the diversity index, from which it can be seen that, no matter in the social security field or in the game field, the richness of the obtained expanded expanding question is significantly higher by expanding the basic question through the DBS decoding mechanism in the embodiment of the present application.
Please refer to fig. 17 and fig. 18, which respectively provide a comparison graph of an experimental result of semantic accuracy of an expanded question obtained by expanding a basic question by using different methods in the social security field and the medical field, and it can be seen that when the method provided by the embodiment of the present application is not used, the overall accuracy of the expanded question is very low, and after generalization indexes are performed in a question expansion process by using the method provided by the embodiment of the present application, the accuracy of the expanded question in different fields (such as but not limited to the illustrated social security field and the illustrated game field) is significantly improved.
In summary, in the embodiment of the application, based on the semantic influence value of each first word in the question to be processed and the context associated information of each first word, an expanded question set corresponding to the question to be processed is automatically generated, so that time is saved, and the efficiency of expanding the question is improved; and because the situation that wrong question sentences are generated when the question sentences are expanded manually is avoided, the semantic accuracy of the expanded question sentences is also improved; in addition, the questions to be processed are expanded in groups, and the first words of the expanded questions in different expanded question groups are different, so that the richness of the expanded questions is further improved.
Referring to fig. 19, based on the same inventive concept, an embodiment of the present application provides a question expansion apparatus 1900, including:
an information receiving unit 1901, configured to obtain a question to be processed based on the received basic question;
a word processing unit 1902, configured to obtain a semantic influence value of each first word in a question to be processed, where the semantic influence value represents a degree of influence of each first word on semantics of the question to be processed;
a question expansion unit 1903, configured to generate an expanded question set corresponding to the question to be processed based on the semantic influence value of each first word and the context correlation information of each first word, where the expanded question set includes expanded questions whose semantic similarity to the question to be processed is greater than a first preset threshold, and the context correlation information represents the correlation between the word and each word belonging to the same question.
As an example, the word processing unit 1902 is specifically configured to:
acquiring a first reference value and a second reference value of each first word based on a second word in a preset word set; the first reference value represents the probability of generating a corresponding word in the expanded question by using the first word, the second reference value represents the probability of generating a corresponding word in the expanded question by using the second word, and the second word is a word in the preset word set, wherein the semantic similarity of the second word and the first word is greater than a second preset threshold; and carrying out normalization processing on the first reference value and the second reference value, and determining the semantic influence value of each first word.
As an embodiment, the question expansion unit 1903 is specifically configured to: determining the quantity threshold value N of the expanded question sentences in the expanded question sentence set; screening out first words corresponding to the maximum first N semantic influence values based on the semantic influence values of the first words; respectively determining the screened N first words as the first words of the expanded questions in each expanded question group in the N expanded question groups; aiming at each expanded question group in the N expanded question groups, acquiring expanded question sentences in each expanded question group according to the context associated information of the first words and the context associated information of the first words except the first words; and generating an expanded question set corresponding to the question to be processed by utilizing the expanded questions in each expanded question group.
As an embodiment, the information receiving unit 1901 is specifically configured to: determining part of or all of the basic question sentences as the question sentences to be processed; or inputting the basic question by adopting a trained target neural network model, and determining the question output by the target neural network model and having semantic similarity with the basic question larger than a third preset threshold as the question to be processed.
As an embodiment, the information receiving unit 1901 is configured to input the basic question using a trained target neural network model, and determine a question output by the target neural network model and having semantic similarity with the question to be processed that is greater than a second preset threshold as the question to be processed, where the target neural network model is obtained by training in the following manner:
acquiring an initial target neural network model, wherein the initial target neural network model comprises a coding network and a decoding network; the coding network is used for learning and generating semantic vectors of all words in the question samples by using the question samples, and the semantic vector of one word is obtained by fusing the text vector of the word with the semantic information of the question sample; the decoding network is used for learning and generating a question with the same semantic as the question sample by using the semantic vector of each word in the question sample;
adjusting the coding parameters of the coding network by using the question samples in the first question sample set;
carrying out random initialization on the decoding parameters of the initial decoding network;
and further adjusting the adjusted coding parameters and the decoding parameters after random initialization by using the question samples in the second question sample set, and obtaining a trained target neural network model based on the further adjusted coding parameters and decoding parameters.
As an embodiment, the question to be processed includes at least two, and the word processing unit 1902 is further configured to: before the semantic influence value of each first word in the question to be processed is obtained, determining a target question to be processed from the at least two question to be processed;
the word processing unit 1902 is specifically configured to: and acquiring the semantic influence value of each first word in the target question sentence to be processed.
As an example, the word processing unit 1902 is specifically configured to: randomly selecting part of the question sentences to be processed or all of the question sentences to be processed from the at least two question sentences to be processed as the target question sentences to be processed; or screening out the question to be processed with the semantic similarity greater than a third preset threshold from the at least two question to be processed, and determining the question to be processed as the target question to be processed.
As an embodiment, the question extension unit 1903 is further configured to: after generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first word and the context associated information of each first word, displaying at least one expanded question in the expanded question set on a first display page;
question extension unit 1903 is also used to: responding to a question grouping instruction triggered by the first account through a second display page, and acquiring expanded questions to be grouped; and adding the expanded question to be grouped into the question group indicated by the question grouping instruction.
As an embodiment, the question extension unit 1903 is further configured to: responding to a question input operation triggered by a second account on a third display page, and acquiring a question to be answered and input by the second account; determining a target question set containing the question to be answered; acquiring answer information associated with the target question set; and displaying the answer information on a fifth display page.
As an example, the apparatus in fig. 19 may be used to implement any of the question expansion methods discussed above.
The above-described generating apparatus 1900 is, as one example of a hardware entity, a computer device shown in fig. 20, and includes a processor 2001, a storage medium 2002, and at least one external communication interface 2003; the processor 2001, the storage medium 2002, and the external communication interface 2003 are connected via a bus 2004.
The storage medium 2002 stores therein a computer program;
the processor 2001, when executing the computer program, implements a method of generating an intelligent contract for testing blockchain services as discussed above.
In fig. 20, one processor 2001 is illustrated as an example, but the number of processors 2001 is not limited in practice.
The storage medium 2002 may be a volatile storage medium (volatile memory), such as a random-access memory (RAM); the storage medium 2002 may also be a non-volatile storage medium (non-volatile memory), such as a read-only memory (rom), a flash memory (flash memory), a hard disk (HDD) or a solid-state drive (SSD), or the storage medium 2002 may be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this. The storage medium 2002 may be a combination of the storage media described above.
Based on the same inventive concept, the present embodiment provides a terminal device 100, which is described below.
Referring to fig. 21, the terminal device 100 includes a display unit 2140, a processor 2180 and a memory 2120, where the display unit 2140 includes a display panel 2141 for displaying information input by a user or information provided to the user, and various operation interfaces and display pages of the question and answer client 110, and in this embodiment, is mainly used for displaying an interface of a client installed in the terminal device 100, a shortcut window, and the like.
Alternatively, the Display panel 2141 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The processor 2180 is configured to read the computer program and then execute a method defined by the computer program, for example, the processor 2180 reads an application of the question answering client, so as to run the application on the terminal device 100 and display an interface of the application on the display unit 2140. The Processor 2180 may include one or more general-purpose processors, and may further include one or more DSPs (Digital Signal processors) for performing relevant operations to implement the solutions provided in the embodiments of the present application.
Memory 2120 typically includes both internal and external memory, which may be Random Access Memory (RAM), Read Only Memory (ROM), and CACHE memory (CACHE). The external memory can be a hard disk, an optical disk, a USB disk, a floppy disk or a tape drive. The memory 2120 is used for storing computer programs including application programs corresponding to clients and the like, and other data including data generated after an operating system or application programs are executed, including system data (for example, configuration parameters of the operating system) and user data. In the embodiment of the present application, the program instructions are stored in the memory 2120, and the processor 2180 executes the program instructions in the memory 2120 to implement any one of the question expansion methods discussed in the previous figures.
In addition, the terminal device 100 may further include a display unit 2140 for receiving input digital information, word information, or a contact touch operation or a non-contact gesture, and generating signal input related to user setting and function control of the terminal device 100, and the like. Specifically, in the embodiment of the present application, the display unit 2140 may include a display panel 2141. The display panel 2141, for example, a touch screen, may collect a touch operation by a user (for example, an operation of the user on the display panel 2141 or on the display panel 2141 using any suitable object or accessory such as a finger, a stylus pen, etc.) thereon or nearby, and drive the corresponding connection device according to a preset program. Alternatively, the display panel 2141 may include two portions of a touch detection device and a touch controller. The touch detection device detects the touch direction of a player, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 2180, and can receive and execute commands sent by the processor 2180. In this embodiment, if the user clicks the question-answering client 110, and a touch detection device in the display panel 2141 detects a touch operation, the touch controller transmits a signal corresponding to the detected touch operation, converts the signal into a touch point coordinate, and transmits the touch point coordinate to the processor 2180, and the processor 2180 determines that the user needs to operate the question-answering client 110 according to the received touch point coordinate.
The display panel 2141 may be implemented by various types, such as resistive, capacitive, infrared, and surface acoustic wave. The terminal device 100 may further include an input unit 2130 in addition to the display unit 2140, the input unit 2130 may include, but is not limited to, an image input device 2131 and other input devices 2132, and the other input devices 2132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
In addition to the above, the terminal device 100 may further include a power supply 2190 for supplying power to other modules, an audio circuit 2160, a near field communication module 2170, and an RF circuit 2110. The terminal device 100 may also include one or more sensors 2150, such as acceleration sensors, light sensors, pressure sensors, and the like. The audio circuit 2160 specifically includes a speaker 2161, a microphone 2162, and the like, for example, the terminal device 100 can collect the voice of the user through the microphone 2162, perform corresponding operations, and the like.
For one embodiment, the number of the processors 2180 may be one or more, and the processors 2180 and the memories 2120 may be coupled or relatively independent.
As an example, the processor 2180 in fig. 21 may be used to implement the functions of the information receiving unit 1901, the word processing unit 1902 and the question expanding unit 1903 in fig. 19.
As an example, processor 2180 in fig. 21 may be used to implement the question answering client 110 functionality discussed previously.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the computer program may be stored in a computer-readable storage medium, and when executed, executes the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the above methods of the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
Based on the same technical concept, the embodiment of the present application also provides a computer-readable storage medium, which stores computer instructions that, when executed on a computer, cause the computer to execute the question expansion method as discussed above.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (15)

1. A question expansion method, comprising:
acquiring a question to be processed based on the basic question;
obtaining a semantic influence value of each first word in a question to be processed, wherein the semantic influence value represents the influence degree of each first word on the semantics of the question to be processed;
generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first word and the context associated information of each first word, wherein the expanded question set comprises expanded questions with semantic similarity greater than a first preset threshold with the question to be processed, and the context associated information represents the correlation between one word and each word belonging to the same question.
2. The method of claim 1, wherein the obtaining the semantic influence value of each first term in the question sentence to be processed comprises:
acquiring a first reference value and a second reference value of each first word based on a second word in a preset word set; the first reference value represents the probability of generating corresponding words in the expanded question sentence by using the first words, the second reference value represents the probability of generating corresponding words in the expanded question sentence by using the second words, and the second words are words in the preset word set, wherein the semantic similarity between the second words and the first words is greater than a second preset threshold;
and carrying out normalization processing on the first reference value and the second reference value, and determining the semantic influence value of each first word.
3. The method according to claim 1, wherein the generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first term and the context associated information of each first term includes:
determining a quantity threshold value N of expansion question sentences in the expansion question sentence set, wherein N is a positive integer;
screening out first words corresponding to the maximum first N semantic influence values based on the semantic influence values of the first words;
respectively determining the screened N first words as the first words of the expanded questions in each expanded question group in the N expanded question groups;
aiming at each expanded question group in the N expanded question groups, acquiring expanded question sentences in each expanded question group according to the context associated information of the first word and the context associated information of the first word except the first word;
and generating an expanded question set corresponding to the question to be processed by utilizing the expanded questions in each expanded question group.
4. The method of claim 1, wherein obtaining the question to be processed based on the base question comprises:
determining part of or all of the basic question sentences as the question sentences to be processed; or
And inputting the obtained basic question by adopting a trained target neural network model, and determining the question output by the target neural network model and having semantic similarity with the basic question larger than a third preset threshold as the question to be processed.
5. The method of claim 4, wherein the basic question is input by using a trained target neural network model, and when a question output by the target neural network model and having semantic similarity with the question to be processed larger than a second preset threshold is determined as the question to be processed, the target neural network model is obtained by training in the following way:
acquiring an initial target neural network model, wherein the initial target neural network model comprises a coding network and a decoding network; the coding network is used for learning and generating semantic vectors of all words in the question samples by using the question samples, and the semantic vector of one word is obtained by fusing the text vector of the word with the semantic information of the question sample; the decoding network is used for learning and generating a question with the same semantic as the question sample by utilizing the semantic vector of each word in the question sample;
adjusting the coding parameters of the coding network by using the question samples in the first question sample set;
randomly initializing decoding parameters of the initial decoding network;
and further adjusting the adjusted coding parameters and the decoding parameters after random initialization by using the question samples in the second question sample set, and obtaining a trained target neural network model based on the further adjusted coding parameters and decoding parameters.
6. The method of claim 4, wherein the question to be processed includes at least two, and before the obtaining the semantic influence value of each first word in the question to be processed, the method further includes:
determining a target question to be processed from the at least two question to be processed;
the obtaining of the semantic influence value of each first word in the question sentence to be processed includes:
and acquiring the semantic influence value of each first word in the target question sentence to be processed.
7. The method of claim 6, wherein the determining a target question to be processed from the at least two question to be processed comprises:
randomly selecting part of the question sentences to be processed or all of the question sentences to be processed from the at least two question sentences to be processed as the target question sentences to be processed; or
And screening out the question to be processed with the semantic similarity greater than a third preset threshold value from the at least two question to be processed, and determining the question to be processed as the target question to be processed.
8. The method according to any one of claims 1 to 7, wherein after generating the expanded question set corresponding to the question to be processed based on the semantic influence value of each first term and the context associated information of each first term, the method further includes:
displaying at least one expanded question in the expanded question set on a first display page;
the method further comprises the following steps:
responding to a question grouping instruction triggered by the first account through a second display page, and acquiring expanded questions to be grouped;
and adding the expanded question to be grouped into a question group indicated by the question grouping instruction.
9. The method of claim 8, wherein the method further comprises:
responding to a question input operation triggered by a second account on a third display page, and acquiring a question to be answered and input by the second account;
determining a target question set containing the question to be answered;
acquiring answer information associated with the target question set;
and displaying the answer information on a fifth display page.
10. A question expansion apparatus, comprising:
the information receiving unit is used for acquiring the question to be processed based on the received basic question;
the word processing unit is used for acquiring a semantic influence value of each first word in the question to be processed, and the semantic influence value represents the influence degree of each first word on the semantics of the question to be processed;
the question expansion unit is used for generating an expanded question set corresponding to the question to be processed based on the semantic influence value of each first word and the context associated information of each first word, the expanded question set comprises expanded questions with semantic similarity larger than a first preset threshold with the question to be processed, and the context associated information represents the correlation between one word and each word belonging to the same question.
11. The apparatus of claim 10, wherein the word processing unit is specifically configured to:
acquiring a first reference value and a second reference value of each first word based on a second word in a preset word set; the first reference value represents the probability of generating corresponding words in the expanded question sentence by using the first words, the second reference value represents the probability of generating corresponding words in the expanded question sentence by using the second words, and the second words are words in the preset word set, wherein the semantic similarity between the second words and the first words is greater than a second preset threshold;
and carrying out normalization processing on the first reference value and the second reference value, and determining the semantic influence value of each first word.
12. The apparatus of claim 10, wherein the question extension unit is specifically configured to:
determining a quantity threshold value N of expansion question sentences in the expansion question sentence set, wherein N is a positive integer;
screening out first words corresponding to the maximum first N semantic influence values based on the semantic influence values of the first words;
respectively determining the screened N first words as the first words of the expanded questions in each expanded question group in the N expanded question groups;
aiming at each expanded question group in the N expanded question groups, acquiring expanded question sentences in each expanded question group according to the context associated information of the first word and the context associated information of the first word except the first word;
and generating an expanded question set corresponding to the question to be processed by utilizing the expanded questions in each expanded question group.
13. The apparatus of claim 10, wherein the information receiving unit is specifically configured to:
determining part of or all of the basic question sentences as the question sentences to be processed; or
And inputting the basic question by adopting a trained target neural network model, and determining the question output by the target neural network model and having semantic similarity with the basic question larger than a third preset threshold as the question to be processed.
14. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1-9 are implemented when the program is executed by the processor.
15. A computer-readable storage medium having stored thereon computer instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1-9.
CN202011372430.8A 2020-11-30 2020-11-30 Question expansion method, device, equipment and computer storage medium Pending CN113392194A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011372430.8A CN113392194A (en) 2020-11-30 2020-11-30 Question expansion method, device, equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011372430.8A CN113392194A (en) 2020-11-30 2020-11-30 Question expansion method, device, equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN113392194A true CN113392194A (en) 2021-09-14

Family

ID=77616551

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011372430.8A Pending CN113392194A (en) 2020-11-30 2020-11-30 Question expansion method, device, equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN113392194A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991875A (en) * 2023-09-26 2023-11-03 海信集团控股股份有限公司 SQL sentence generation and alias mapping method and device based on big model
CN117556906A (en) * 2024-01-11 2024-02-13 卓世智星(天津)科技有限公司 Question-answer data set generation method and device, electronic equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116991875A (en) * 2023-09-26 2023-11-03 海信集团控股股份有限公司 SQL sentence generation and alias mapping method and device based on big model
CN116991875B (en) * 2023-09-26 2024-03-08 海信集团控股股份有限公司 SQL sentence generation and alias mapping method and device based on big model
CN117556906A (en) * 2024-01-11 2024-02-13 卓世智星(天津)科技有限公司 Question-answer data set generation method and device, electronic equipment and storage medium
CN117556906B (en) * 2024-01-11 2024-04-05 卓世智星(天津)科技有限公司 Question-answer data set generation method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10878009B2 (en) Translating natural language utterances to keyword search queries
US10861456B2 (en) Generating dialogue responses in end-to-end dialogue systems utilizing a context-dependent additive recurrent neural network
US10691685B2 (en) Converting natural language input to structured queries
CN107210035B (en) Generation of language understanding systems and methods
WO2020147428A1 (en) Interactive content generation method and apparatus, computer device, and storage medium
CN111506714A (en) Knowledge graph embedding based question answering
CN104111972B (en) Transliteration for query expansion
CN109376222B (en) Question-answer matching degree calculation method, question-answer automatic matching method and device
US8073877B2 (en) Scalable semi-structured named entity detection
CN112507715A (en) Method, device, equipment and storage medium for determining incidence relation between entities
CN106202153A (en) The spelling error correction method of a kind of ES search engine and system
CN107112009B (en) Method, system and computer-readable storage device for generating a confusion network
US20210279622A1 (en) Learning with limited supervision for question-answering with light-weight markov models
JP2015162244A (en) Methods, programs and computation processing systems for ranking spoken words
CN114429133A (en) Relying on speech analysis to answer complex questions through neuro-machine reading understanding
CN112131401B (en) Concept knowledge graph construction method and device
JP7295200B2 (en) Generalization processing method, apparatus, device, computer storage medium and program
Dinarelli et al. Discriminative reranking for spoken language understanding
CN113392194A (en) Question expansion method, device, equipment and computer storage medium
Wang et al. Arobert: An asr robust pre-trained language model for spoken language understanding
US20230306205A1 (en) System and method for personalized conversational agents travelling through space and time
US20210081462A1 (en) Binary coding for improved semantic search
CN110287487A (en) The recognition methods of subject-predicate language, device, equipment and computer readable storage medium
Yang et al. Introspection unit in memory network: Learning to generalize inference in OOV scenarios
CN113609863B (en) Method, device and computer equipment for training and using data conversion model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40051733

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination