CN117035091A - Question answering method and device, electronic equipment and storage medium - Google Patents

Question answering method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117035091A
CN117035091A CN202310815761.1A CN202310815761A CN117035091A CN 117035091 A CN117035091 A CN 117035091A CN 202310815761 A CN202310815761 A CN 202310815761A CN 117035091 A CN117035091 A CN 117035091A
Authority
CN
China
Prior art keywords
information
question
target
module
identity
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
CN202310815761.1A
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.)
Qax Technology Group Inc
Original Assignee
Qax Technology Group Inc
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 Qax Technology Group Inc filed Critical Qax Technology Group Inc
Priority to CN202310815761.1A priority Critical patent/CN117035091A/en
Publication of CN117035091A publication Critical patent/CN117035091A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • G06N5/041Abduction
    • 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
    • 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/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/32User authentication using biometric data, e.g. fingerprints, iris scans or voiceprints
    • 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/042Knowledge-based neural networks; Logical representations of neural networks
    • 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/0464Convolutional networks [CNN, ConvNet]
    • 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
    • G06N3/088Non-supervised learning, e.g. competitive learning
    • 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
    • G06N3/09Supervised learning

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Databases & Information Systems (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a question and answer method, a question and answer device, electronic equipment and a storage medium, and relates to the technical field of artificial intelligence, wherein the question and answer method comprises the following steps: the information scheduling module is used for sending the first target information sent by the interaction module to the question-answering module; the first target information comprises user input information; determining the type of the user input information under the condition that the first target information further comprises target identity verification information through the question-answering module; the target identity verification information is used for representing the identity level of the user; under the condition that the type of the user input information is determined to be the question information type through the question and answer module and the user identity level is determined to meet the preset condition, answer information is generated based on the user input information of the question information type; the control question-answering module sends second target information comprising answer information to the interaction module through the information scheduling module; and displaying the answer information through the interaction module. The method can improve the safety of questions and answers.

Description

Question answering method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a question answering method, a question answering device, an electronic device, and a storage medium.
Background
A large-scale language model is an artificial intelligence model that can automatically generate language. The large-scale language model is usually obtained by learning and training based on massive language information and knowledge texts by a statistical method on the basis of an initial model. The trained large-scale language model can generate answer information according to the question information input by the user.
The large-scale language model uses massive information during training, so that the generated answer information also contains rich information, and the information contained in the answer information can relate to privacy or safety problems. The existing large-scale language model directly generates a text based on the question information after receiving the question information input by the user, and directly displays the generated answer information to the user, so that the condition of secret information leakage is possibly caused, and the influence is difficult to measure.
Therefore, how to safely use a large-scale language generation model to conduct questions and answers and improve the safety of the questions and the answers are a problem to be solved urgently.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a question answering method, a question answering device, electronic equipment and a storage medium.
By way of example, the embodiment of the invention provides the following technical scheme:
in a first aspect, an embodiment of the present invention provides a question-answering method, which is applied to an electronic device, where the electronic device includes a question-answering module, an information scheduling module and an interaction module; the method comprises the following steps:
under the condition that the information scheduling module determines that the received first target information is the information sent by the interaction module, the information scheduling module sends the first target information to the question-answering module; the first target information comprises user input information;
determining the type of the user input information by the question-answering module under the condition that the first target information also comprises target identity verification information by the question-answering module; the target identity verification information is used for representing the identity level of the user;
under the condition that the type of the user input information is determined to be a question information type through the question and answer module and the user identity level is determined to meet the preset condition, answer information is generated through the question and answer module based on the user input information of the question information type;
controlling the question-answering module to send second target information to the interaction module through the information scheduling module; the second target information comprises the answer information;
And displaying the answer information through the interaction module.
Further, the method further comprises:
generating third target information by the question-answering module under the condition that the first target information further comprises the target identity verification information and the type of the user input information is determined to be the identity information type; the third target information comprises first prompt information for prompting a user to input problem information;
the question-answering module is controlled to send the third target information to the interaction module through the information scheduling module;
and displaying the first prompt information through the interaction module.
Further, the method further comprises:
generating fourth target information by the question-answering module when the question-answering module determines that the target authentication information is not included in the first target information and determines that the type of the user input information is a question information type; the fourth target information comprises second prompt information for prompting a user to input identity information;
controlling the question-answering module to send the fourth target information to the interaction module through the information scheduling module;
And displaying the second prompt information through the interaction module.
Further, the electronic device further comprises an identity verification module; the method further comprises the steps of:
in the case that the first target information does not comprise the target identity verification information and the type of the user input information is determined to be the identity information type by the question-answering module, generating fifth target information based on the user input information of the identity information type by the question-answering module, and sending the fifth target information to the information scheduling module;
when the information scheduling module determines that the user input information of the identity information type is included in the fifth target information and the target identity verification information is not included, the information scheduling module sends the fifth target information to the identity verification module;
searching target identity verification information corresponding to the user input information of the identity information type in an identity information database through the identity verification module, and generating sixth target information based on the user input information of the identity information type and the target identity verification information;
controlling the identity verification module to send the sixth target information to the question-answering module through an information scheduling module;
And determining whether the sixth target information comprises target identity verification information or not through the question and answer module.
Further, the user input information of the identity information type comprises target identity information, and the target identity information comprises target identity information and target authentication information;
the searching, by the identity verification module, target identity verification information corresponding to user input information of the identity information type in an identity information database includes:
searching the identity information database for the target identity verification information associated with the first corresponding relation under the condition that the identity verification module searches the first corresponding relation between the target identity identification information and the target authentication information in the identity information database; the identity information database stores the corresponding relation between the identity identification information and the authentication information and the identity verification information associated with the corresponding relation.
Further, the method further comprises:
under the condition of adding new identity information, acquiring new identity information and new authentication information included in the new identity information, determining new identity verification information, and storing a second corresponding relation between the new identity information and the new authentication information and the new identity verification information associated with the second corresponding relation in the identity information database;
And under the condition that the identity information in the identity information database is changed, acquiring changed identity information and changed authentication information included in the changed identity information, and storing a third corresponding relation between the changed identity information and the changed authentication information and changed identity verification information associated with the third corresponding relation in the identity information database.
Further, the method further comprises:
generating seventh target information under the condition that the question-answering module determines that the type of the user input information is a question information type and that the user identity level does not meet the preset condition; the preset conditions comprise matching of user identity levels and question levels, wherein the question levels are levels corresponding to user input information of the question information types determined by the question-answering module; the seventh target information comprises third prompt information for prompting the user that the user identity level is lower than the question level;
controlling the question-answering module to send the seventh target information to the interaction module through the information scheduling module;
And displaying the third prompt information through the interaction module.
Further, the generating, by the question-answering module, answer information based on the user input information of the question information type includes:
inputting the user input information of the question information type into a question-answer model in the question-answer module to obtain the answer information output by the question-answer model;
the question-answering model is trained based on the following mode:
acquiring input information samples of a plurality of problem information types;
determining answer information labels corresponding to the input information samples;
inputting each input information sample into an initial question-answer model to obtain an answer information sample corresponding to each input information sample output by the initial question-answer model;
and optimizing the initial question-answering model based on each answer information sample and the corresponding answer information label to obtain the question-answering model.
In a second aspect, an embodiment of the present invention further provides a question-answering apparatus, where the question-answering apparatus includes:
the information scheduling module is used for sending the first target information to the question-answering module under the condition that the received first target information is determined to be the information sent by the interaction module; the first target information comprises user input information;
The question and answer module is used for determining the type of the user input information under the condition that the first target information also comprises target identity verification information; the target identity verification information is used for representing the identity level of the user;
the question and answer module is further used for generating answer information based on the user input information of the question information type under the condition that the type of the user input information is determined to be the question information type and the user identity level is determined to meet the preset condition;
the question-answering module is further used for sending second target information to the interaction module through the information scheduling module; the second target information comprises the answer information;
and the interaction module is used for displaying the answer information.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the question-answering method according to the first aspect when executing the computer program.
In a fourth aspect, embodiments of the present invention also provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the question-answering method according to the first aspect.
In a fifth aspect, embodiments of the present invention also provide a computer program product having stored thereon executable instructions that, when executed by a processor, cause the processor to implement the question-answering method according to the first aspect.
The method uses the information scheduling module to receive first target information comprising user input information, and sends the first target information to the question-answering module under the condition that the first target information is determined to be sent by the interaction module. The question-answering module determines whether the first target information comprises target identity verification information used for representing the identity level of the user, and if the first target information comprises the target identity verification information, the type of the user input information is determined; if the type of the user input information is a question information type and the user identity level represented by the target identity verification information meets a preset condition, the question-answering module generates answer information based on the user input information of the question information type in the first target information, and sends second target information comprising the answer information to the interaction module through the information scheduling module, and the answer information is displayed through the interaction module. Based on the method, the target identity verification information which indicates the user identity level in the user input information can be identified and judged before the user questions are answered, and the questions of the user are answered only when the user identity level meets the preset conditions, so that the question and answer safety can be effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a question-answering method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of internal communication of an electronic device according to an embodiment of the present invention;
FIG. 3 is a second flowchart of a question answering method according to the embodiment of the present invention;
FIG. 4 is a block flow diagram of an information scheduling module according to an embodiment of the present invention for distributing information of agents;
FIG. 5 is a block flow diagram of a question-answering module for receiving and sending information of each agent according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a question answering device according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an entity structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, in the present invention, the numbers of the described objects, such as "first", "second", etc., are only used to distinguish the described objects, and do not have any sequence or technical meaning.
With the rapid development of large-scale language generation model technologies such as ChatGPT (Chat Generative Pre-trained Transformer) and ChatGPT-like, various question-answering modules based on the large-scale language generation model technologies are applied in many question-answering task scenes. For example, a question and answer module is used for inquiring information; generating text or a document using a question and answer module; the question and answer module is used for searching codes or performing code complement and the like. Although the use of question-answering modules can bring about a number of positive effects, the consequent security issues become a major concern.
In the field with higher security, if the identity level of the user is not verified, when any user can use the question-answering module to conduct the question-answering task, answer information generated by the question-answering module may be illegally acquired by a malicious user, so that the condition of secret information leakage occurs. Therefore, the identity level of the user is identified, and when the identity level of the user meets the preset condition, the answer information is generated based on the user input information of the question information type, so that the safety of question and answer can be effectively improved, and the confidential information is prevented from being illegally acquired.
Based on the above, the embodiment of the invention provides a question and answer method, which can identify and judge the target identity verification information for indicating the user identity level in the user input information before answering the questions of the user, and answer the questions of the user by using a question and answer module under the condition that the user identity level meets the preset condition, so that the security of the questions and answers can be improved.
The question answering method provided by the embodiment of the invention is described below through specific embodiments and application scenes thereof by combining the attached drawings.
Fig. 1 is a schematic flow chart of a question-answering method provided by an embodiment of the present invention, where the question-answering method provided by the embodiment of the present invention is applied to an electronic device, and the electronic device includes a question-answering module, an information scheduling module and an interaction module. The electronic device may be at least one of a mobile phone, a tablet computer, an intelligent terminal, a computer, a server cluster, or the like, or may be a question-answering device provided in the electronic device, and the question-answering device may be implemented by software, hardware, or a combination of the two.
Fig. 2 is a schematic diagram of internal communication of an electronic device according to an embodiment of the present invention, where, as shown in fig. 2, an information scheduling module establishes communication connection with a question-answering module and also establishes communication connection with an interaction module. The user can input questions to the electronic device through the interaction module to acquire answer information.
The question-answering module, the information scheduling module and the interaction module are all functional modules with different functions, and can be arranged in the same electronic equipment or in different electronic equipment respectively. The interaction module and the question-answering module can communicate information through the information scheduling module so as to realize the scheduling and distributing functions of the information.
Communication between the functional modules can be realized based on an agent collaboration architecture. When the functional modules communicate based on the agent cooperation architecture, the functional modules, namely the agents, can exchange information in a unified format, and the information interacted between the agents is agent information. The information scheduling module identifies the type of the agent information, controls the distribution path of the agent information, sends the information to the corresponding agents, realizes mutual collaboration of the agents, and jointly completes the question-answering task serving the user. The concurrent multi-question-answer session tasks can be processed in each agent by adopting the agent cooperation architecture, so that the question-answer efficiency and the utilization rate of the electronic equipment resources can be effectively improved.
The interaction module may include a session Id (Identity document, identification) generation sub-module, an information input output sub-module, and a first communication interface. The session Id generation sub-module may generate a session Id corresponding to the session. In the process of carrying out a question-answering session between a user and electronic equipment, each user input information and other information generated due to the user input information carry the session Id, and each functional module can correspondingly identify and process each information generated by the session based on the session Id, so that each functional module can process a plurality of concurrent question-answering session tasks. The information input/output sub-module can provide a man-machine interaction interface for the user, receive the input of the user and display the answer information generated by the question-answer module. The first communication interface is used for realizing normal communication of data information between the interaction module and the information scheduling module.
The information scheduling module may include a rule-based service sub-module and a second communication interface. The information scheduling module receives information sent by other functional modules, and sends each information to the corresponding functional module based on the information distribution rule through the service submodule, so that the information scheduling and distribution function is realized. After receiving the information sent by the information scheduling module, the corresponding functional module processes the information according to the processing rules in the functional module and sends the processed information to the information scheduling module in real time. The second communication interface is used for realizing normal communication of data information between the information scheduling module and other functional modules.
The question-answering module may include a large-scale language model and a third communication interface, wherein the large-scale language model may be a deep neural network DNN (Deep Neural Networks, DNN). After inputting the information of the question information type in the user input information to the large-scale language model, answer information corresponding to the question information may be output. The question and answer module is also used for determining whether the received information contains authentication information. The third communication interface is used for realizing normal communication of data information between the question-answering module and the information scheduling module.
As shown in fig. 1, the question answering method provided by the embodiment of the invention includes steps 110 to 150.
Step 110, under the condition that the information scheduling module determines that the received first target information is the information sent by the interaction module, the information scheduling module sends the first target information to the question-answering module; the first target information includes user input information.
The first target information is, for example, information received by the information scheduling module including user input information, i.e., information entered by a user into the electronic device, the information generated by the user. The user can initiate a question-answering session task through the interaction module.
As shown in fig. 2, a user inputs user input information through an interaction module, and after receiving the information, the interaction module generates a session Id corresponding to the user input information. The interaction module generates first target information based on the user input information and the session Id, and sends the first target information to the information scheduling module. After receiving the first target information, the information scheduling module determines a sending source of the first target information, and if the sending source of the first target information is determined to be an interaction module, the information scheduling module sends the first target information to the question-answering module.
Table 1 is an exemplary table of categories and contents of agent interaction information provided by an embodiment of the present invention. The agent information interacted between the agents can adopt a unified information format, and all the information transmitted between the agents contains all the information in one question-answering session task. As shown in table 1, in each question-answering session task, all information sent and received by each agent includes the following six categories of information contents: session Id, identification information, authentication information, user input information, and answer information. The default values in table 1 indicate that when the specific information content of the category is not determined, the information content of the category should take the default values preset in the table. The identification information and the authentication information in table 1 may be used to determine the authentication information, which will be described in the following embodiments, and will not be described here again.
TABLE 1
For example, the user initiates a question-answering session task with three, and inputs the question "how many people the company recruits this year? ". The session Id generation submodule in the interaction module generates a session Id "001" which uniquely identifies the session task for the session task initiated by the user, and based on the session Id "001" and the information input by the user, "how many people the company recruits for today? ", first target information is generated in the order of the serial numbers of the respective information contents as in table 1, and can be expressed as" 001"," 0 "? The [ ]. The information contents of each category can be separated by commas, and the specific information content is uncertain and takes a default value. For example, 001 in the first target information indicates a session Id, which is used to distinguish each agent information of the current session from each agent information of other concurrent sessions; a 0 in the first target information indicates that the authentication information is an authentication error or is not authenticated; [ how many people the company recruits today? Inputting information for a user; [] The specific information content representing the answer information category is suspended.
Optionally, when determining whether the source of the first target information is the interaction module, the information scheduling module may determine whether the information content of each category in the first target information is a default value. For example, in the first target information [ 001, ",0, [ how many people the company recruits this year? In the above, the information content of the first and fifth categories is not a default value, and the information content of the second, third, fourth and sixth categories are all default values, so that the sending source of the first target information can be determined to be an interaction module.
Or, when determining whether the sending source of the first target information is the interaction module, the information scheduling module may determine the sending source of the first target information according to the direction of the information received by the second communication interface, for example, when determining that the first target information received by the second communication interface is the information sent by the first communication interface, determine that the first target information is the information sent by the interaction module; or other determination may be used, and embodiments of the present invention are not limited in this regard.
Step 120, determining the type of the user input information through the question and answer module under the condition that the first target information further comprises target identity verification information through the question and answer module; the target authentication information is used to characterize the user identity level.
The target authentication information may be, for example, information characterizing the user's identity level, and a determination is made by the question-answering module as to whether the target authentication information is included in the first target information. The authentication information may be, for example, a positive integer such as 1, 2, 3, or N.
For example, the first target information received by the question-answering module is [ 001, ",0, [ how many people the company recruits the year? The information content of the fourth category is a default value of 0, which indicates that the target identity authentication information is an authentication error or is not authenticated, that is, the target identity authentication information is not included in the first target information. The first target information received by the question-answering module is [ 001, "a01", "01",1, [ how many people the company recruits this year? The information content of the fourth category is 1, which means that the target authentication information is 1, that is, the first target information includes the target authentication information.
And after receiving the first target information sent by the information scheduling module, the question answering module determines whether the first target information comprises target identity verification information. When it is determined that the first target information includes the target authentication information, it is also necessary to determine the type of user input information in the first target information.
And 130, under the condition that the type of the user input information is determined to be the question information type through the question and answer module and the user identity level is determined to meet the preset condition, generating answer information based on the user input information of the question information type through the question and answer module.
For example, the type of the user input information may be a question information type, that is, a type in which the user input information is a question requiring a question answering module. The question-answering module may determine through semantic parsing of the user input information when determining whether the type of the user input information is a question information type. The preset condition may be a judgment condition preset for the authentication information, for judging the user identity level.
For example, the user identity levels represented by the authentication information are divided into four levels of level 1, level 2, level 3 and level 4, and preset conditions set for the four user identity levels are: the user identity level is greater than or equal to the authentication threshold. And the question and answer module is used for solving the user input information of the question information type under the condition that the user identity level meets the preset condition, so as to generate answer information.
Taking the authentication threshold as 1 as an example, if the first target information received by the question and answer module is [ 001, "a01", "01",1, [ how many people the company recruits for this year? When the method is carried out, the question and answer module is used for asking for the company how many people are recruited in the year? Performing semantic analysis to determine that the type of the user input information is a question information type, and that the target identity verification information in the first target information is 1 and equal to the identity verification threshold value 1, then the question-answering module is based on [ how many people the company recruits in the present year? And (3) carrying out question answering, wherein the generated answer information is [ 30 recruiters of the company in the present year ].
Step 140, the control question-answering module sends second target information to the interaction module through the information scheduling module; the second target information includes answer information.
For example, the second target information may be information including answer information. For example, the second target information may be information generated by solving user input information of the question information type by the question-answering module. The second target information can be sent to the information scheduling module by the question-answering module, the information scheduling module determines that the sending source of the second target information is the question-answering module after receiving the second target information, and determines that the receiving function module of the second target information is the interaction module, and then sends the second target information to the interaction module.
For example, the question and answer module receives the first target information [ 001, "a01", "01",1, [ how many people the company recruits this year? After [ ] ], user input information on the type of question information [ how many people the company recruits for this year? Answer is made, and the generated answer information is [ 30 recruiters of company in the present year ]. The second target information may be generated as "001," a01, "01," 1, [ how many people the company recruits this year? The second target information is sent to the information scheduling module. After the information scheduling module receives the second target information, the receiving function module of the second target information is determined, for example, the information scheduling module may determine according to the information content of each category in the second target information. And after the receiving function module of the second target information is determined to be the interaction module, the second target information is sent to the interaction module.
And 150, displaying the answer information through the interaction module.
The interaction module receives the second target information sent by the information scheduling module, and then displays answer information in the second target information through the information input/output sub-module.
For example, the information input/output submodule in the interaction module comprises a touch display screen, and the interaction module displays the answer information analyzed from the second target information through the touch display screen, so that a user can acquire the answer information in time.
According to the question-answering method provided by the embodiment of the invention, the information scheduling module is used for receiving the first target information comprising the user input information, and the first target information is sent to the question-answering module under the condition that the first target information is sent by the interaction module. The question-answering module determines whether the first target information comprises target identity verification information used for representing the identity level of the user, and if the first target information comprises the target identity verification information, the type of the user input information is determined; if the type of the user input information is a question information type and the user identity level represented by the target identity verification information meets a preset condition, the question-answering module generates answer information based on the user input information of the question information type in the first target information, and sends second target information comprising the answer information to the interaction module through the information scheduling module, and the answer information is displayed through the interaction module. Based on the method, the target identity verification information which indicates the user identity level in the user input information can be identified and judged before the user questions are answered, and the questions of the user are answered only when the user identity level meets the preset conditions, so that the question and answer safety can be effectively improved.
In some practical applications, although a user initiates a question-answering session task, the question-answering module cannot acquire the question information in time and cannot answer, so that the user needs to be reminded of inputting the question information in time to complete the answer of the question.
In one embodiment, the method further comprises: under the condition that the first target information further comprises target identity verification information and the type of the user input information is determined to be the identity information type through the question-answering module, third target information is generated through the question-answering module; the third target information comprises first prompt information for prompting a user to input problem information; the control question-answering module sends third target information to the interaction module through the information scheduling module; and displaying the first prompt information through the interaction module.
For example, after receiving the first target information, the question-answer module needs to determine whether the first target information includes target identity verification information, and determine whether the first target information is user input information of an identity information type by performing semantic analysis on the user input information in the first target information. If the first target information includes target identity verification information and the type of the user input information is the identity information type, third target information including first prompt information needs to be sent to the user so as to prompt the user to input the user input information of the problem information type. The question-answering module sends the third target information to the interaction module through the information scheduling module, and the interaction module displays the first prompt information in the third target information. The first prompt message may be a prompt word, a language, a picture, or the like, for example, the prompt word "please input your question" or the like.
For example, the first target information received by the question-answering module is [ 001, "a01", "01",1, [ my user Id is a01, password is 01], [ ] ], and according to the analysis of the user input information [ my user Id is a01, password is 01], the type of the user input information can be determined to be the identity information type, and the first target information includes the target identity verification information 1, the question-answering module generates the first prompt information for prompting the user to input the question information, and the first prompt information is [ please input your question ]. The first prompt information is used for replacing answer information, and third target information [ 001, "A01," "01," 1, [ My user Id is A01, password is 01], [ please input your question ] ] can be generated.
The question-answering module sends the third target information to the information scheduling module, and the information scheduling module forwards the received third target information to the interaction module. The interaction module analyzes the first prompt information from the received third target information, and displays the first prompt information through the information input/output sub-module so as to prompt a user to timely input the question information for question answering.
In this embodiment, the question-answering module determines the target identity verification information in the first target information and the user input information of the identity information type, so that third target information including the first prompt information can be timely generated, and the information scheduling module sends the third target information to the interaction module, so that the user can be prompted to input the question information, and the efficiency and usability of the question-answering method are improved.
In some practical applications, although question information is input in a question-answer session task initiated by a user, target identity verification information representing a user identity level cannot be obtained in first target information, and a question-answer module cannot determine whether the user identity level meets a preset condition or not and cannot generate answer information. Therefore, the second prompt information needs to be displayed to the user in time to prompt the user to input the identity information.
In one embodiment, the method further comprises: generating fourth target information by the question-answering module under the condition that the first target information does not comprise target identity verification information and the type of the user input information is determined to be the type of the question information; the fourth target information comprises second prompt information for prompting the user to input identity information; the control question-answering module sends fourth target information to the interaction module through the information scheduling module; and displaying the second prompt information through the interaction module.
For example, when the first target information does not include the target authentication information, the question-answer module cannot determine whether the user identity level meets the preset condition according to the target authentication information. In the first target information, when the type of the user input information is the question information type, the user is indicated to input the question information in the question-answering session. Therefore, the question-answering module needs to prompt the user under the condition that the first target information does not comprise the target identity verification information and the type of the user input information is determined to be the problem information type, so that the question-answering module can determine whether the user identity level meets the preset condition and answer the problem information input by the user.
The fourth target information can be generated by a question-answer module, the question-answer module sends the fourth target information to the interaction module through the information scheduling module, and the interaction module is used for displaying the second prompt information. The second prompting message may be a prompting word, language or picture, for example, prompting word "please input identity information" or the like.
For example, the first target information received by the question-answering module is [ 001, ",0, [ how many people the company recruits the year? In terms of the input information to the user [ how many people the company recruits this year? And the analysis of the information, the type of the input information of the user can be determined to be the problem information type, the identity verification information in the first target information is 0, and the first target information is determined to not comprise the target identity verification information, so that the question-answering module generates second prompt information for prompting the user to input the identity information, and the second prompt information is [ please input the identity information ]. The second prompt information is used to replace the answer information, and fourth target information [ 001, ",0, [ how many people the company recruits for this year? Please input identity information ].
The question-answering module sends the fourth target information to the information scheduling module, and the information scheduling module forwards the received fourth target information to the interaction module. The interaction module analyzes the second prompt information from the received fourth target information, and displays the second prompt information through the information input/output sub-module so as to prompt a user to timely input identity information.
In this embodiment, after determining whether the first target information includes the target authentication information and whether the user input information is of the problem information type, the question answering module may generate the fourth target information including the second prompt information in time when the first target information does not include the target authentication information and the type of the user input information is of the problem information type. And the fourth target information is sent to the interaction module through the information scheduling module, and the second prompt information can be displayed by the interaction module, so that the aim of timely prompting the user to input the identity information is fulfilled, and the safety and the usability of the question-answering method are improved.
In an embodiment, the electronic device further includes an identity verification module, and the identity verification module may search for corresponding target identity verification information and generate sixth target information based on the identity information database and user input information of the identity information type, and input the sixth target information into the question-answer module to determine whether the target identity verification information is included. Fig. 3 is a second flowchart of a question answering method according to an embodiment of the present invention, as shown in fig. 3, and the embodiment may be specifically implemented through steps 310 to 350.
Step 310, when the question-answering module determines that the first target information does not include the target identity verification information and determines that the type of the user input information is the identity information type, the question-answering module generates fifth target information based on the user input information of the identity information type and sends the fifth target information to the information scheduling module.
For example, the first target information does not include the target authentication information, and the type of the user input information is the type of the identity information, which may be a case that the user inputs the identity information in the initiated question-answer session, but does not determine the corresponding target authentication information according to the identity information input by the user. In this case, the question-answering module may generate fifth target information based on the user input information of the identity information type and transmit the fifth target information to the information scheduling module, so that the information scheduling module distributes the fifth target information to other functional modules.
Step 320, when it is determined by the information scheduling module that the fifth target information includes the user input information of the identity information type and does not include the target identity verification information, the information scheduling module sends the fifth target information to the identity verification module.
For example, as shown in fig. 2, after receiving the fifth target information, the information scheduling module may send the fifth target information to the identity verification module according to the case that the fifth target information includes the user input information of the identity information type and does not include the target identity verification information, so as to process the fifth target information through the identity verification module.
Step 330, searching for target identity verification information corresponding to the user input information of the identity information type in the identity information database through the identity verification module, and generating sixth target information based on the user input information of the identity information type and the target identity verification information.
For example, the identity information database may be a database storing correspondence between user input information of identity information type and authentication information. For example, a mapping table of user input information and authentication information of the identity information type is stored in the identity information database, and target authentication information can be queried and determined based on the mapping table. The authentication module may generate sixth target information based on the determined target authentication information and the user input information of the identity information type.
In one implementation, the user input information of the identity information type includes target identity information, which includes target identity information and target authentication information. In step 330, the identity verification module searches the identity information database for the target identity verification information corresponding to the user input information of the identity information type, which can be specifically implemented in the following manner:
under the condition that a first corresponding relation between target identity information and target authentication information is found in an identity information database through an identity authentication module, target identity authentication information associated with the first corresponding relation is found in the identity information database; the identity information database stores the corresponding relation between the identity identification information and the authentication information and the identity verification information associated with the corresponding relation.
By way of example, the target identity information may be information for determining a user identity level of the user, such as a user name, person code, password, fingerprint, voiceprint, image or iris, etc. When the target identity information is acquired, the target identity information can be input by a user in real time; the identity information stored by the user can also be extracted from the database based on the database; or may be obtained by other means.
The identity information includes identity information and authentication information, wherein the identity information may be information indicating the identity of the user in the identity information, such as a user name, a person code, or the like. The authentication information may be information in the identity information that authenticates the identity information, for example, a password, a fingerprint, a voiceprint, an image, an iris, or the like.
The identity information database may store in advance a correspondence between the identity information and the authentication information, and authentication information associated with the correspondence. The identity verification module may search whether there is a correspondence between the target identity information and the target authentication information, that is, a first correspondence, based on the identity information database, and determine, as the target identity verification information, the identity verification information associated with the first correspondence when the first correspondence can be found.
For example, the identity information database stores the correspondence between the identity information and the authentication information, and the authentication information associated with the correspondence, and may be stored in the form of a mapping table. Table 2 is a mapping table provided in the embodiment of the present invention, and as shown in table 2, the sequence numbers of each row represent the sequence numbers of each corresponding relationship. The correspondence in each row is associated with authentication information.
TABLE 2
The 1 st correspondence in table 2 is a correspondence between the identity information a01 and the authentication information 01, and the identity verification information associated with the correspondence is 1; the 2 nd corresponding relation is the corresponding relation between the identity information A02 and the authentication information 02, and the identity verification information associated with the corresponding relation is 2; the 3 rd correspondence is a correspondence between the identity information a03 and the authentication information 03, and the authentication information associated with the correspondence is 0.
For example, when the user inputs the identity information type by the interactive module that the user input information is "my user Id is a01 and the password is 01", the first target information generated by the interactive module is "001,", 0, [ my user Id is a01 and the password is 01], [ ] ", and inputs the first target information into the information scheduling module, the information scheduling module inputs the first target information into the question-answering module.
After the question-answering module receives the first target information, analyzing that target identity verification information in the first target information is a default value of 0, wherein the type of user input information [ My user Id is A01, password is 01] is identity information type, the question-answering module can generate fifth target information based on the type of user input information [ My user Id is A01, password is 01] of identity information type, the fifth target information is [ 001, "A01", "01",0, [ My user Id is A01, password is 01], [ ] ], namely, the default value at the corresponding position in the first target information is replaced by target identity identification information "A01" and target authentication information "01" input by the user, and then the fifth target information can be generated.
After the question-answering module sends the fifth target information to the information scheduling module, the information scheduling module determines that the fifth target information comprises user input information of identity information type, and sends the fifth target information to the identity verification module when the user input information does not comprise the target identity verification information.
After the authentication module receives the fifth target information sent by the information scheduling module, the mapping table of the table 2 is utilized to find the first corresponding relation between the target identity information "a01" and the target authentication information "01" in the identity information database, under the condition that the first corresponding relation is found, the authentication information 1 associated with the first corresponding relation can be determined as the target authentication information, the target authentication information 1 is replaced by the default value 0 in the fifth target information, and then sixth target information [ 001 "," a01",1, [ my user Id is a01, password is 01], [ ] ] can be generated, and the sixth target information is sent to the information scheduling module for being distributed to the corresponding functional module for processing.
It should be noted that, the identification information listed in table 2 adopts the type of identification information of personnel code. In practical application, each piece of identity information in the identity information database can be the same type of identity information, or can be different types of identity information. For example, some correspondences use user names as identity information, and other correspondences use person codes as identity information. Similarly, in a corresponding relationship, the identity information may be one type of identity information, or may be multiple types of identity information, which may be flexibly set according to actual application needs.
The first corresponding relation between the target identity information and the target authentication information is searched in the identity information database, and under the condition that the first corresponding relation is searched, the identity authentication information associated with the first corresponding relation is determined to be the target identity authentication information, so that the aim of quickly and reliably determining the target identity authentication information can be fulfilled, and the question and answer efficiency can be improved. Meanwhile, the identity information database is adopted, so that the interaction capability between the question-answering module and other functional modules or other entities such as databases can be realized, the question-answering module is not limited to the data in the database of the question-answering module, and the data in the database of the question-answering module can be inquired or called through other databases directly or indirectly connected with the question-answering module, so that the expandability of the question-answering method is improved.
In another implementation manner, in order to further improve the accuracy and reliability of determining the target authentication information, the data information stored in the identity information database may be updated and maintained. On the basis of the implementation manner, the question answering method can be further implemented in the following manner.
Under the condition of adding new identity information, acquiring new identity information and new authentication information included in the new identity information, determining new identity verification information, and storing a second corresponding relation between the new identity information and the new authentication information and new identity verification information associated with the second corresponding relation in an identity information database;
And under the condition that the identity information in the identity information database is changed, acquiring changed identity information and changed authentication information included in the changed identity information, and storing a third corresponding relation between the changed identity information and the changed authentication information and changed identity verification information associated with the third corresponding relation in the identity information database.
The new identity information includes, for example, new identification information and new authentication information. Under the condition that the identity information needs to be newly added, acquiring new identity information and new authentication information, and determining new identity verification information. And storing the second corresponding relation between the new identity information and the new authentication information and the new identity verification information associated with the second corresponding relation in an identity information database. Similarly, under the condition that the stored identity information needs to be changed, the changed identity information and the changed authentication information are obtained, and a third corresponding relation between the changed identity information and the changed authentication information associated with the third corresponding relation are stored in the identity information database so as to change at least one of the identity information, the authentication information or the authentication information, thereby realizing the updating and maintenance of related data in the identity information database. When the identity information is changed, at least one of the identity information, the authentication information or the authentication information may be changed, that is, some or all of the identity information, the authentication information or the authentication information may be modified according to the actual requirement of the change.
For example, when a new user needs to use the electronic device to answer questions, a second correspondence between new identification information and new authentication information of the new user and new authentication information associated with the second correspondence may be stored in the mapping table of the identity information database. The new user can input the stored new identity information and the new authentication information through the interaction module, so that the functional module of the electronic equipment can acquire the target identity information and the target authentication information, and the question-answering session task with higher security can be smoothly carried out. Similarly, when a user needs to change at least one of the stored identity information, authentication information or identity verification information in the identity information database, the content to be modified can be correspondingly modified, so that the data information in the identity information database is updated, and the applicability of the method is improved.
In this implementation, the newly added identity information may be stored in an identity information database. The method can also change the stored identity information, authentication information or identity verification information in the identity information database, thereby realizing the timely maintenance and updating of the identity information database, improving the usability of the method and expanding the application scene of the method.
And 340, controlling the identity verification module to send the sixth target information to the question-answering module through the information scheduling module.
For example, after the authentication module generates the sixth target information, the sixth target information is sent to the information scheduling module, and the information scheduling module may send the received sixth target information to the question-answering module, so as to determine the target authentication information in the sixth target information through the question-answering module.
Step 350, determining whether the sixth target information includes the target authentication information through the question-answer module.
For example, the question and answer module may determine whether the target authentication information is included in the sixth target information after receiving the sixth target information. When determining, the question-answering module may determine whether the information content in the sixth target information representing the identity verification information category is a default value, and when determining that the sixth target information includes the target identity verification information, may determine the sixth target information as new first target information, and return to the step 120 to continue to execute; when it is determined that the target authentication information is not included in the sixth target information, the sixth target information may be determined as new first target information, and the above-described step 310 may be returned to continue. For example, the sixth target information is "001," a01, "01," 1, [ my user Id is a01, password is 01], [ ], wherein the information content of the fourth category is 1, indicating that the target authentication information is 1 in the sixth target information.
In this embodiment, the electronic device includes an authentication module, and the method may generate, by using the question-answering module, fifth target information and find the target authentication information by using the authentication module, where the first target information does not include the target authentication information and the type of the user input information is the type of the identity information. And generating sixth target information based on the user input information of the identity information type and the target identity verification information by using the identity verification module, and determining whether the target identity verification information is included in the sixth target information by using the question-answering module. In this way, the corresponding target identity verification information can be determined through the user input information of the identity information type input by the user, so that the question-answering module can further generate answer information to complete the question-answering session task.
In one embodiment, the method further comprises: generating seventh target information under the condition that the type of the user input information is determined to be the problem information type and the user identity level is determined to not meet the preset condition through the question-answering module; the preset conditions comprise matching of user identity levels and question levels, wherein the question levels are levels corresponding to user input information of the question information types determined by the question-answering module; the seventh target information comprises third prompt information for prompting the user that the user identity level is lower than the problem level; the control question-answering module sends seventh target information to the interaction module through the information scheduling module; and displaying the third prompt information through the interaction module.
For example, the preset condition may be a preset judgment condition for the authentication information, for judging the user identity level, where the preset condition may include that the user identity level matches the problem level. The question level is a level corresponding to user input information of the question information type, and may be determined by a question-answering module, for example, the question level may be determined by a question level identifying sub-module in the question-answering module.
Alternatively, the question-answering module may include a question-level recognition sub-module, which may be a sub-module that performs a question-level determination on user input information of a question information type based on a question-level determination rule set therein. The problem level determination rule may be, for example, to divide the problem levels according to the problem security levels set by the company, divide the problem with a lower security level into low problem levels, and divide the problem with a higher security level into high problem levels. For example, a total of 4 question levels are divided: the problem level of the non-confidential problem is divided into 0 level, the problem level of the general confidential problem is divided into 1 level, the problem level of the medium-level confidential problem is divided into 2 level, and the problem level of the high-level confidential problem is divided into 3 level; when the user inputs the general secret-related problem as the user input information of the problem information type, the problem level corresponding to the user input information of the problem information type can be determined to be 1 level based on the problem level determining rule.
Alternatively, the issue level identification sub-module may include an issue level identification model. The problem-level recognition model may be a model obtained by training based on an initial neural network model, the initial neural network model may be a classification-based neural network, for example, a deep neural network DNN (Deep Neural Networks, DNN) or a convolutional neural network CNN (Convolutional Neural Network, CNN), and the training may be a supervised training mode or an unsupervised training mode.
The user identity level does not meet the preset condition, and the user identity level is not matched with the problem level of the problem posed by the user. The mismatch may be when the user identity level is not the same as the question level at which the user posed the question, or when the user identity level is lower than the question level at which the user posed the question, etc.
When the user identity level does not match the question level of the question posed by the user, the question-answering module may generate seventh target information including third prompt information for prompting the user that the user identity level is lower than the question level. The third prompt message may be a prompt word, a language, or a picture, for example, the prompt word "your level is lower than the level of the problem" or the like.
After the question-answering module generates seventh target information, the seventh target information is sent to the information scheduling module, and the information scheduling module sends the seventh target information to the interaction module. And after receiving the seventh target information, the interaction module analyzes the third prompt information and displays the third prompt information.
With question information [ how much is a company profitable the year? Question level 2 example. The question and answer module receives the agent information [ 001, "a01", "01",1, [ how much the company is in earnings in the year? After [ ] ], determining user input information [ how much is the company profitable this year? And if the type of the question is the question information type and the target identity verification information is 1, further determining that the user identity level 1 is lower than the question level 2 of the question information, and the user identity level does not meet the preset condition. In this way, the question-answering module generates the third prompt message [ the level of which is lower than the level of the question ], and replaces the answer message with the third prompt message, and then generates the seventh target message of [ 001, "a01," "01," 1, [ how much the company is profitable in the year? [ your level is lower than the level of the question ]. The question-answering module sends the seventh target information to the information scheduling module, the information scheduling module receives the seventh target information and forwards the seventh target information to the interaction module, the interaction module analyzes third prompt information from the received seventh target information, and the third prompt information can be displayed through the information input-output sub-module to prompt a user that the identity level of the user is lower than the level of the question and the question information cannot be answered.
In this embodiment, when it is determined that the user identity level does not meet the preset condition, seventh target information including the third prompt information may be generated, so that the user is effectively prevented from illegally obtaining corresponding answer information, and the security of question and answer is improved. Meanwhile, the third prompt information is used for prompting the user, so that the user can be timely reminded that the question-answering module cannot output answer information.
On the basis of the foregoing embodiments, in order to make the question-answering method more in line with the use requirements of the security field and the question-answering scenario of identity verification, the question-answering module may be adaptively adjusted.
In one embodiment, the question and answer module generates answer information based on the user input information of the question information type, specifically, the following modes can be realized:
inputting user input information of the question information type into a question-answer model in a question-answer module to obtain answer information output by the question-answer model; the question-answering model is trained based on the following modes: acquiring input information samples of a plurality of problem information types; determining answer information labels corresponding to the input information samples; inputting each input information sample into the initial question-answer model to obtain an answer information sample corresponding to each input information sample output by the initial question-answer model; and optimizing the initial question-answering model based on each answer information sample and the corresponding answer information label to obtain a question-answering model.
For example, the question-answering model may be trained in a supervised manner based on an initial question-answering model. For example, training of the initial question-answering model to adapt to the security domain and authentication question-answering scenario is performed by using fine tuning (fine tuning) and prompt learning (prompt learning) methods to obtain a question-answering model.
Table 3 is a sample example table of question-answer model training provided in the embodiment of the present invention, and as shown in table 3, the scene represents the object to be achieved by training, the input represents input information samples, and the output represents answer information samples corresponding to each input information sample.
TABLE 3 Table 3
As shown in table 3, when the fine tuning training is performed on the extraction of the identity information, the "my user Id is a01, the password is 01" is used as an input information sample, and the initial question-answer model is trained, so that the output of the initial question-answer model is "identity information: a01, authentication information: 01'; when fine tuning the question level extraction, "how many people the company recruits for this year? Training an initial question-answer model by taking the initial question-answer model as an input information sample to enable the output of the initial question-answer model to be 1; the other components will not be described in detail.
In this embodiment, after training and optimizing an initial question-answer model based on input information samples of a plurality of question information types and answer information labels corresponding to the input information samples, a question-answer model may be obtained. The question-answering model can accurately determine target identity verification information and question level, judge whether the target identity verification information and the question level meet preset conditions, answer the question information under the condition that the preset conditions are met, output answer information, realize safe question-answering, and meet the requirements of the safety field and the scene requiring the identity verification question-answering.
The information scheduling module is specifically described below.
After receiving the agent information, the information scheduling module may determine the distributed object according to the information content of each category in the agent information. For example, table 4 is an exemplary table for distributing agent information by the information scheduling module provided in the embodiment of the present invention, and as shown in table 4, a source agent indicates a functional module that sends agent information to the information scheduling module; the target agent represents a functional module for receiving the agent information sent by the information scheduling module; the information represents each agent information; the identity information indicates whether the agent information includes identity information; the authentication information indicates whether the agent information includes authentication information.
TABLE 4 Table 4
FIG. 4 is a flow chart of distributing agent information by an information scheduling module according to an embodiment of the present invention, where the information scheduling module determines the source of the agent information when receiving the agent information, and sends the agent information to a question-answering module when determining that the agent information is from an interaction module or an identity verification module; when the agent information is determined to come from the question-answer module, determining whether the agent information contains identity information but no identity verification information, and when the agent information is determined to contain identity information but no identity verification information, sending the agent information to the identity verification module; and when the identity information and the identity verification information exist in the agent information, sending the agent information to the interaction module.
The following is a detailed description of the question-answering module.
FIG. 5 is a flow chart of receiving and sending agent information by the question-answering module, wherein the question-answering module determines whether the agent information comprises identity verification information when the agent information is received, and indicates that identity is verified when the agent information comprises the identity verification information, then determines whether a user input information part of the agent information is identity information, generates prompt information for prompting to input problem information when the user input information part is identity information, and sends the prompt information as shown in FIG. 5; and when the user input information part is determined not to be identity information, generating answer information corresponding to the question information, and sending the answer information.
When the identity verification information is not included in the agent information, indicating that the identity is not verified, determining whether the identity information is in a user input information part of the agent information, analyzing the identity information when the identity information is determined to be in the user input information part, generating prompt information for verifying the identity based on the identity information, and sending the prompt information; and when the user input information part is determined not to be the identity information, generating prompt information for prompting to input the identity information, and sending the prompt information.
As can be seen from the contents shown in table 4, fig. 4 and fig. 5, the agent information [ 001, ",0, [ how many people the company recruits in the present year? In the process of the item, the information content of the target identity information and the information content of the target identity verification information are default values, which indicate that no identity information and no identity verification information exist, and the information scheduling module sends the agent information to the question-answering module; the information content of the target identity information is not a default value in the agent information [ 001, "A01", "01",0, [ My user Id is A01, password is 01], [ ] ], the information content of the target identity information is a default value of 0, the information content of the target identity information is represented to contain identity information and no identity authentication information, and the information scheduling module sends the agent information to the identity authentication module; therefore, each functional module can determine how to send the agent information to the corresponding functional module by using the information content in the agent information under the agent-based collaboration architecture. The manner in which information is sent may also be understood as analyzing the service rules of the network based on the type of information.
Table 5 is a process example table of the user question-answering method provided by the embodiment of the present invention, and the process of implementing question-answering by the user through the electronic device can be presented as an ordered behavior sequence through the information shown in table 5. As shown in table 5, the sequence number indicates the order of the behavior, the behavior indicates the user behavior or the electronic device behavior, the generator of the information indicates the object to generate the information, the sender of the information indicates the object to transmit the information, the receiver of the information indicates the object to receive the information, the generated information indicates the content of the information transmitted or received, the generated information indicates the information generated due to the behavior, and the behavior description indicates the behavior of the sequence number. The generator of the information may be a user or a function module, and the blank in table 5 indicates that the item is not present.
TABLE 5
/>
/>
/>
/>
The above table 5 exemplarily describes a part of the process of implementing one question-answering session task in a behavioral order, and when the concurrent question-answering session task is performed by using the question-answering method of the present invention, each functional module may process each information of all the question-answering session tasks according to respective processing rules.
In addition, it should be noted that the electronic device in the embodiment of the present invention may be the same electronic device, for example, a server, where the server includes the above functional modules, and the user may implement the question-answering method based on the server.
The electronic device in the embodiment of the invention can also be different electronic devices, for example, the electronic device comprises a server cluster and an intelligent terminal of a user, and the intelligent terminal comprises an interaction module. The server cluster comprises an information scheduling module, an identity verification module and a question and answer module. When a plurality of users implement the question-answering method on each intelligent terminal at the same time, each functional module in the server cluster can process a plurality of concurrent question-answering session tasks. The capability of each functional module in the server cluster can be configured according to the calculation power requirement of each functional module for processing the data information, and the use efficiency and the resource utilization rate of the electronic equipment can be improved. Meanwhile, the number of the functional modules can be timely adjusted according to the change of the workload so as to support the continuity of the service and realize quick response to the change of the service requirement.
The question answering device provided by the embodiment of the invention is described below, and the question answering device described below and the question answering method described above can be referred to correspondingly.
Fig. 6 is a schematic structural diagram of a question answering apparatus according to an embodiment of the present invention, and as shown in fig. 6, a question answering apparatus 600 includes:
the information scheduling module 610 is configured to send the first target information to the question-answering module 620 if it is determined that the received first target information is the information sent by the interaction module 630; the first target information comprises user input information;
a question-answering module 620, configured to determine a type of information input by the user in a case where it is determined that the first target information further includes target authentication information; the target identity verification information is used for representing the identity level of the user;
the question and answer module 620 is further configured to, when determining that the type of the user input information is a question information type and determining that the user identity level meets a preset condition, generate answer information based on the user input information of the question information type;
the question-answering module 620 is further configured to send second target information to the interaction module 630 through the information scheduling module 610; the second target information comprises answer information;
and the interaction module 630 is used for displaying the answer information.
Optionally, the question and answer module 620 is further configured to generate third target information if it is determined that the first target information further includes target authentication information and it is determined that the type of the user input information is the identity information type; the third target information comprises first prompt information for prompting a user to input problem information;
the question-answering module 620 is further configured to send third target information to the interaction module 630 through the information scheduling module 610;
the interaction module 630 is further configured to display the first prompt message.
Optionally, the question and answer module 620 is further configured to generate fourth target information if it is determined that the first target information does not include target authentication information and it is determined that the type of the user input information is a question information type; the fourth target information comprises second prompt information for prompting the user to input identity information;
the question-answering module 620 is further configured to send fourth target information to the interaction module 630 through the information scheduling module 610;
the interaction module 630 is further configured to display a second prompt message.
Optionally, the question answering apparatus 600 further includes an identity verification module;
the question-answering module 620 is further configured to, in a case where it is determined that the first target information does not include the target authentication information and it is determined that the type of the user input information is the identity information type, generate fifth target information based on the user input information of the identity information type, and send the fifth target information to the information scheduling module 610;
The information scheduling module 610 is further configured to send, when it is determined that the fifth target information includes user input information of an identity information type and does not include target identity verification information, the fifth target information to the identity verification module;
the identity verification module is used for searching target identity verification information corresponding to the user input information of the identity information type in the identity information database and generating sixth target information based on the user input information of the identity information type and the target identity verification information;
the identity verification module is further configured to send sixth target information to the question-answering module 620 through the information scheduling module 610;
the question and answer module 620 is further configured to determine whether the sixth target information includes target authentication information.
Optionally, the user input information of the identity information type includes target identity information, and the target identity information includes target identity information and target authentication information;
the identity verification module is specifically configured to, when a first correspondence between the target identity information and the target authentication information is found in the identity information database, find target identity verification information associated with the first correspondence in the identity information database; the identity information database stores the corresponding relation between the identity identification information and the authentication information and the identity verification information associated with the corresponding relation.
Optionally, the identity verification module is further configured to obtain new identity information and new authentication information included in the new identity information under the condition of adding the new identity information, determine the new identity verification information, and store a second correspondence between the new identity information and the new authentication information, and the new identity verification information associated with the second correspondence in the identity information database;
the identity verification module is further configured to, when the identity information in the identity information database is changed, obtain changed identity information and changed authentication information included in the changed identity information, and store a third correspondence between the changed identity information and the changed authentication information, and the changed identity verification information associated with the third correspondence in the identity information database.
Optionally, the question-answering module 620 is further configured to generate seventh target information if it is determined that the type of the user input information is a question information type and it is determined that the user identity level does not meet the preset condition; the preset conditions comprise matching of user identity levels and question levels, wherein the question levels are levels corresponding to user input information of the question information types determined by the question-answering module; the seventh target information comprises third prompt information for prompting the user that the user identity level is lower than the problem level;
The question-answering module 620 is further configured to send seventh target information to the interaction module 630 through the information scheduling module 610;
the interaction module 630 is further configured to display a third prompt message.
Optionally, the question-answering module 620 is specifically configured to input user input information of a question information type into a question-answering model in the question-answering module 620, so as to obtain answer information output by the question-answering model;
the question-answering model is trained based on the following modes:
acquiring input information samples of a plurality of problem information types;
determining answer information labels corresponding to the input information samples;
inputting each input information sample into the initial question-answer model to obtain an answer information sample corresponding to each input information sample output by the initial question-answer model;
and optimizing the initial question-answering model based on each answer information sample and the corresponding answer information label to obtain a question-answering model.
The device of the present embodiment may be used to execute the method of the question-answering method side embodiment, and its specific implementation process and technical effect are similar to those of the question-answering method side embodiment, and specific reference may be made to the detailed description of the question-answering method side embodiment, which is not repeated herein.
Fig. 7 is a schematic physical structure of an electronic device according to an embodiment of the present invention, as shown in fig. 7, where the electronic device may include: processor 710, communication interface (Communications Interface) 720, memory 730, and communication bus 740, wherein processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform the question-answering method provided by the above embodiments, the method comprising: under the condition that the received first target information is determined to be the information sent by the interaction module by the information scheduling module, the first target information is sent to the question-answering module by the information scheduling module; the first target information comprises user input information; under the condition that the first target information further comprises target identity verification information through the question and answer module, determining the type of the user input information through the question and answer module; the target identity verification information is used for representing the identity level of the user; under the condition that the type of the user input information is determined to be the question information type through the question and answer module and the user identity level is determined to meet the preset condition, generating answer information based on the user input information of the question information type through the question and answer module; the control question-answering module sends second target information to the interaction module through the information scheduling module; the second target information comprises answer information; and displaying the answer information through the interaction module.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, is implemented to perform the question-answering method provided in the above embodiment, the method including: under the condition that the received first target information is determined to be the information sent by the interaction module by the information scheduling module, the first target information is sent to the question-answering module by the information scheduling module; the first target information comprises user input information; under the condition that the first target information further comprises target identity verification information through the question and answer module, determining the type of the user input information through the question and answer module; the target identity verification information is used for representing the identity level of the user; under the condition that the type of the user input information is determined to be the question information type through the question and answer module and the user identity level is determined to meet the preset condition, generating answer information based on the user input information of the question information type through the question and answer module; the control question-answering module sends second target information to the interaction module through the information scheduling module; the second target information comprises answer information; and displaying the answer information through the interaction module.
In yet another aspect, embodiments of the present invention also provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the question-answering method provided by the above embodiments, the method comprising: under the condition that the received first target information is determined to be the information sent by the interaction module by the information scheduling module, the first target information is sent to the question-answering module by the information scheduling module; the first target information comprises user input information; under the condition that the first target information further comprises target identity verification information through the question and answer module, determining the type of the user input information through the question and answer module; the target identity verification information is used for representing the identity level of the user; under the condition that the type of the user input information is determined to be the question information type through the question and answer module and the user identity level is determined to meet the preset condition, generating answer information based on the user input information of the question information type through the question and answer module; the control question-answering module sends second target information to the interaction module through the information scheduling module; the second target information comprises answer information; and displaying the answer information through the interaction module.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (12)

1. The question-answering method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a question-answering module, an information scheduling module and an interaction module; the method comprises the following steps:
under the condition that the information scheduling module determines that the received first target information is the information sent by the interaction module, the information scheduling module sends the first target information to the question-answering module; the first target information comprises user input information;
determining the type of the user input information by the question-answering module under the condition that the first target information also comprises target identity verification information by the question-answering module; the target identity verification information is used for representing the identity level of the user;
Under the condition that the type of the user input information is determined to be a question information type through the question and answer module and the user identity level is determined to meet the preset condition, answer information is generated through the question and answer module based on the user input information of the question information type;
controlling the question-answering module to send second target information to the interaction module through the information scheduling module; the second target information comprises the answer information;
and displaying the answer information through the interaction module.
2. The question-answering method according to claim 1, further comprising:
generating third target information by the question-answering module under the condition that the first target information further comprises the target identity verification information and the type of the user input information is determined to be the identity information type; the third target information comprises first prompt information for prompting a user to input problem information;
the question-answering module is controlled to send the third target information to the interaction module through the information scheduling module;
and displaying the first prompt information through the interaction module.
3. The question-answering method according to claim 1, further comprising:
generating fourth target information by the question-answering module when the question-answering module determines that the target authentication information is not included in the first target information and determines that the type of the user input information is a question information type; the fourth target information comprises second prompt information for prompting a user to input identity information;
controlling the question-answering module to send the fourth target information to the interaction module through the information scheduling module;
and displaying the second prompt information through the interaction module.
4. A question-answering method according to claim 3, wherein the electronic device further comprises an identity verification module; the method further comprises the steps of:
in the case that the first target information does not comprise the target identity verification information and the type of the user input information is determined to be the identity information type by the question-answering module, generating fifth target information based on the user input information of the identity information type by the question-answering module, and sending the fifth target information to the information scheduling module;
When the information scheduling module determines that the user input information of the identity information type is included in the fifth target information and the target identity verification information is not included, the information scheduling module sends the fifth target information to the identity verification module;
searching target identity verification information corresponding to the user input information of the identity information type in an identity information database through the identity verification module, and generating sixth target information based on the user input information of the identity information type and the target identity verification information;
controlling the identity verification module to send the sixth target information to the question-answering module through an information scheduling module;
and determining whether the sixth target information comprises target identity verification information or not through the question and answer module.
5. The question-answering method according to claim 4, wherein the user input information of the identity information type includes target identity information including target identity information and target authentication information;
the searching, by the identity verification module, target identity verification information corresponding to user input information of the identity information type in an identity information database includes:
Searching the identity information database for the target identity verification information associated with the first corresponding relation under the condition that the identity verification module searches the first corresponding relation between the target identity identification information and the target authentication information in the identity information database; the identity information database stores the corresponding relation between the identity identification information and the authentication information and the identity verification information associated with the corresponding relation.
6. The question-answering method according to claim 5, further comprising:
under the condition of adding new identity information, acquiring new identity information and new authentication information included in the new identity information, determining new identity verification information, and storing a second corresponding relation between the new identity information and the new authentication information and the new identity verification information associated with the second corresponding relation in the identity information database;
and under the condition that the identity information in the identity information database is changed, acquiring changed identity information and changed authentication information included in the changed identity information, and storing a third corresponding relation between the changed identity information and the changed authentication information and changed identity verification information associated with the third corresponding relation in the identity information database.
7. The question-answering method according to any one of claims 1-6, further comprising:
generating seventh target information under the condition that the question-answering module determines that the type of the user input information is a question information type and that the user identity level does not meet the preset condition; the preset conditions comprise matching of user identity levels and question levels, wherein the question levels are levels corresponding to user input information of the question information types determined by the question-answering module; the seventh target information comprises third prompt information for prompting the user that the user identity level is lower than the question level;
controlling the question-answering module to send the seventh target information to the interaction module through the information scheduling module;
and displaying the third prompt information through the interaction module.
8. The question answering method according to any one of claims 1-6, wherein the generating answer information based on user input information of the question information type by the question answering module comprises:
inputting the user input information of the question information type into a question-answer model in the question-answer module to obtain the answer information output by the question-answer model;
The question-answering model is trained based on the following mode:
acquiring input information samples of a plurality of problem information types;
determining answer information labels corresponding to the input information samples;
inputting each input information sample into an initial question-answer model to obtain an answer information sample corresponding to each input information sample output by the initial question-answer model;
and optimizing the initial question-answering model based on each answer information sample and the corresponding answer information label to obtain the question-answering model.
9. A question-answering apparatus, characterized in that the question-answering apparatus comprises:
the information scheduling module is used for sending the first target information to the question-answering module under the condition that the received first target information is determined to be the information sent by the interaction module; the first target information comprises user input information;
the question and answer module is used for determining the type of the user input information under the condition that the first target information also comprises target identity verification information; the target identity verification information is used for representing the identity level of the user;
the question and answer module is further used for generating answer information based on the user input information of the question information type under the condition that the type of the user input information is determined to be the question information type and the user identity level is determined to meet the preset condition;
The question-answering module is further used for sending second target information to the interaction module through the information scheduling module; the second target information comprises the answer information;
and the interaction module is used for displaying the answer information.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the question-answering method according to any one of claims 1-8 when the computer program is executed by the processor.
11. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a question answering method according to any one of claims 1 to 8.
12. A computer program product having stored thereon executable instructions which, when executed by a processor, cause the processor to implement a question-answering method according to any one of claims 1 to 8.
CN202310815761.1A 2023-07-04 2023-07-04 Question answering method and device, electronic equipment and storage medium Pending CN117035091A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310815761.1A CN117035091A (en) 2023-07-04 2023-07-04 Question answering method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310815761.1A CN117035091A (en) 2023-07-04 2023-07-04 Question answering method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117035091A true CN117035091A (en) 2023-11-10

Family

ID=88621567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310815761.1A Pending CN117035091A (en) 2023-07-04 2023-07-04 Question answering method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117035091A (en)

Similar Documents

Publication Publication Date Title
US11677732B2 (en) Conversational authentication
CN109492764B (en) Training method, related equipment and medium for generating countermeasure network
CN111917878B (en) Message processing method, device, equipment and storage medium
CN110472045B (en) Short text false problem classification prediction method and device based on document embedding
CN108875404B (en) Data desensitization method and device based on machine learning and storage medium
US20230297849A1 (en) Federated learning method and device, and storage medium
US9536443B2 (en) Evaluating expert opinions in a question and answer system
US20090299932A1 (en) System and method for providing a virtual persona
US20180285775A1 (en) Systems and methods for machine learning classifiers for support-based group
CN112035638B (en) Information processing method, device, storage medium and equipment
CN109753561B (en) Automatic reply generation method and device
CN112966081A (en) Method, device, equipment and storage medium for processing question and answer information
CN109739969A (en) Answer generation method and intelligent conversational system
CN116933800B (en) Template-based generation type intention recognition method and device
CN116955573B (en) Question searching method, device, equipment and storage medium
CN117556057A (en) Knowledge question-answering method, vector database construction method and device
CN117332054A (en) Form question-answering processing method, device and equipment
CN109905359B (en) Communication message processing method, device, computer equipment and readable access medium
CN116186771A (en) Text processing method, device and medium applied to artificial intelligence generated content
CN117035091A (en) Question answering method and device, electronic equipment and storage medium
CN111008373B (en) Intelligent question-answering processing method and device, computer readable medium and electronic equipment
CN113901821A (en) Entity naming identification method, device, equipment and storage medium
CN112328871A (en) Reply generation method, device, equipment and storage medium based on RPA module
CN118036057B (en) Method, system, storage medium and program product for protecting user privacy
CN110674307A (en) Knowledge deduction method and system for knowledge center network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination