CN113434653A - Method, device and equipment for processing query statement and storage medium - Google Patents

Method, device and equipment for processing query statement and storage medium Download PDF

Info

Publication number
CN113434653A
CN113434653A CN202110740228.4A CN202110740228A CN113434653A CN 113434653 A CN113434653 A CN 113434653A CN 202110740228 A CN202110740228 A CN 202110740228A CN 113434653 A CN113434653 A CN 113434653A
Authority
CN
China
Prior art keywords
question
answering
robot
answer
query statement
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
CN202110740228.4A
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202110740228.4A priority Critical patent/CN113434653A/en
Publication of CN113434653A publication Critical patent/CN113434653A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • 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/3331Query processing
    • G06F16/3332Query translation
    • G06F16/3334Selection or weighting of terms from queries, including natural language queries
    • 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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of language processing, and provides a method, a device, equipment and a storage medium for processing query sentences. The method comprises the following steps: acquiring a natural query statement input through an application program; determining a machine query statement corresponding to the natural query statement by using a keyword extraction model; determining an initial question and answer result corresponding to a machine query sentence according to the first question and answer robot; when the initial question-answering result is detected to comprise a jump instruction, determining a second question-answering robot based on the jump instruction; and determining a final question and answer result corresponding to the machine query sentence according to the second question and answer robot, and feeding the final question and answer result back to the user. For the application program end, whether the question is replied by other question-answering robots is controlled according to the question of the user, a knowledge base corresponding to other services does not need to be stored, the question answering speed is improved, and the memory pressure is reduced. For the user, the answer is directly obtained, the accuracy of answering the question is improved, and the user experience is improved.

Description

Method, device and equipment for processing query statement and storage medium
Technical Field
The present application belongs to the technical field of language processing, and in particular, to a method, an apparatus, a device, and a storage medium for processing a query statement.
Background
With the development of modern technology, in order to expand more services, there are a plurality of services of different subjects within the same carrier. Different business subjects have different question-answering robots. Different question-answering robots are used to answer questions that users propose for different services. For example, for an Application program (App), a plurality of services belonging to different subjects are built in, each service is responsible for a corresponding question-answering robot, and for the question-answering robot of the current service, if a user asks a service question not responsible for the question-answering robot, the question-answering robot cannot answer the question of the user, or answers the question, or prompts the user to consult through a telephone, so that the answer accuracy is low.
Disclosure of Invention
In view of this, embodiments of the present application provide a method, an apparatus, a device, and a storage medium for processing query sentences, so as to solve the problem that the existing question-answering robot cannot accurately answer all the questions of the user and has a low answer accuracy rate.
A first aspect of an embodiment of the present application provides a method for processing a query statement, where the method includes:
acquiring a natural query statement input through an application program;
determining a machine query statement corresponding to the natural query statement by using a trained keyword extraction model, wherein the natural query statement is used for querying a second service in the application program;
determining an initial question and answer result corresponding to the machine query sentence according to a first question and answer robot, wherein the first question and answer robot is a question and answer robot matched with a first service in the application program;
when the initial question-answering result is detected to comprise a jump instruction, determining a second question-answering robot based on the jump instruction, wherein the second question-answering robot is matched with a second service in the application program;
and determining a final question and answer result corresponding to the machine query sentence according to the second question and answer robot, and feeding back the final question and answer result to the user.
Optionally, the determining, by using the trained keyword extraction model, the machine query statement corresponding to the natural query statement includes:
inputting the natural query sentence into the keyword extraction model for processing to obtain a keyword corresponding to the natural query sentence;
and searching the machine query sentence matched with the keyword in a preset knowledge base.
Optionally, the inputting the natural query statement into the keyword extraction model for processing to obtain a keyword corresponding to the natural query statement includes:
performing word segmentation processing on the natural query sentence to obtain a plurality of words;
determining a word vector corresponding to each participle and a semantic vector corresponding to the natural query sentence based on the keyword extraction model;
determining cosine similarity between each word vector and the semantic vector;
and determining keywords corresponding to the natural query sentence in the multiple participles based on the cosine similarity between each word vector and the semantic vector.
Optionally, when it is detected that the initial question-answering result includes a jump instruction, determining a second question-answering robot based on the jump instruction includes:
when the initial question-answering result is detected to comprise a jump instruction, acquiring identification information corresponding to the second question-answering robot carried in the jump instruction;
and searching the second question-answering robot in all question-answering robots corresponding to the application program based on the identification information.
Optionally, after determining an initial question-answering result corresponding to the machine query sentence according to the first question-answering robot, the method further includes:
when the initial question-answering result is detected to comprise a jump instruction, detecting whether the application program supports a jump question-answering robot or not;
and when the detection result shows that the application program does not support the skip question-answering robot, generating prompt information, wherein the prompt information is used for prompting a user to update the version of the application program.
Optionally, before determining a final question-answer result corresponding to the machine query statement according to the second question-answer robot and feeding back the final question-answer result to the user, the method further includes:
and prompting the user in the application program that the final question and answer result is provided by the second question and answer robot.
Optionally, before determining the machine query statement corresponding to the natural query statement by using the trained keyword extraction model, the method further includes:
acquiring a sample training set, wherein the sample training set comprises a plurality of sample natural query sentences and sample keywords corresponding to each sample natural query sentence;
training an initial keyword extraction network based on the sample training set, and updating parameters of the initial keyword extraction network based on a training result;
and when detecting that the loss function corresponding to the initial keyword extraction network is converged, obtaining the trained keyword extraction model.
A second aspect of an embodiment of the present application provides an apparatus for processing a query statement, including:
an acquisition unit configured to acquire a natural query sentence input through an application;
a first determining unit, configured to determine, by using a trained keyword extraction model, a machine query statement corresponding to the natural query statement, where the natural query statement is used to query a second service in the application;
a second determining unit, configured to determine an initial question-answering result corresponding to the machine query statement according to a first question-answering robot, where the first question-answering robot is a question-answering robot that matches a first service in the application program;
a third determining unit, configured to determine, when it is detected that the initial question-answering result includes a jump instruction, a second question-answering robot based on the jump instruction, where the second question-answering robot is a question-answering robot that matches a second service in the application program;
and the fourth determining unit is used for determining a final question and answer result corresponding to the machine query sentence according to the second question and answer robot and feeding the final question and answer result back to the user.
A third aspect of the embodiments of the present application provides an apparatus for processing a query statement, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the method for processing a query statement as described in the first aspect.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, which stores a computer program, which when executed by a processor implements the steps of the method for processing a query statement as described in the first aspect.
A fifth aspect of embodiments of the present application provides a computer program product, which when run on an apparatus for processing a query statement, causes the apparatus to perform the steps of the method for processing a query statement according to the first aspect.
The method, the device, the equipment and the storage medium for processing the query statement provided by the embodiment of the application have the following beneficial effects:
and analyzing the obtained natural query sentence by using the trained keyword extraction model to obtain a machine query sentence corresponding to the natural query sentence. And determining an initial question-answering result corresponding to the machine query sentence according to the first question-answering robot. And when the initial question-answer result is detected to comprise a jump instruction, determining a second question-answer robot based on the jump instruction, determining a final question-answer result corresponding to the machine query sentence according to the second question-answer robot, and feeding back the final question-answer result to the user. For the server side of the application program, whether the question is replied by other question answering robots can be controlled according to the question of the user, a knowledge base corresponding to other services does not need to be stored, the question answering speed is increased, and the memory pressure is reduced. For the user, the user directly obtains the answer the user wants on the current page, so that the question and answer robot is avoided from jumping, or the answer to the question can be known only through telephone consultation. The accuracy and the efficiency of answering questions are improved, the user experience is improved, and meanwhile the benign development of the application program is promoted.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a schematic flow chart diagram illustrating a method for processing a query statement according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating an exemplary embodiment of the present application in detail for step S102 of a method for processing a query statement;
FIG. 3 is a schematic flow chart diagram of a method for processing a query statement in accordance with another embodiment of the present invention;
FIG. 4 is a schematic representation of a response provided by another embodiment of the present application;
FIG. 5 is a schematic representation of a response provided by yet another embodiment of the present application;
FIG. 6 is a schematic representation of a response provided by yet another embodiment of the present application;
FIG. 7 is a schematic flow chart diagram illustrating a method for processing a query statement in accordance with another embodiment of the present application;
FIG. 8 is a diagram illustrating an apparatus for processing a query statement according to an embodiment of the present application;
fig. 9 is a schematic diagram of an apparatus for processing a query statement according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the description of the embodiments of the present application, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present application, "a plurality" means two or more than two.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present embodiment, "a plurality" means two or more unless otherwise specified.
With the development of modern technology, in order to expand more services, there are a plurality of services of different subjects within the same carrier. Different business subjects have different question-answering robots. Different question-answering robots are used to answer questions that users propose for different services. For example, a plurality of services belonging to different subjects are built in one Application program (App), and each service is responsible for a corresponding question and answer robot. For example, a certain APP has a first service and a second service built therein, the first service is a main service of the APP, the first question-and-answer robot is used to answer questions related to the first service, and the second question-and-answer robot is used to answer questions related to the second service. If the user asks the question related to the second service at the first question-answering robot, the first question-answering robot cannot answer the question of the user, or answers the question, or prompts the user to consult through a telephone, so that the answering accuracy is low, the speed is slow, and bad experience is brought to the user.
In view of this, the present application provides a method for processing a query statement, in which a trained keyword extraction model is used to analyze an acquired natural query statement to obtain a machine query statement corresponding to the natural query statement. And determining an initial question-answering result corresponding to the machine query sentence according to the first question-answering robot. And when the initial question-answer result is detected to comprise a jump instruction, determining a second question-answer robot based on the jump instruction, determining a final question-answer result corresponding to the machine query sentence according to the second question-answer robot, and feeding back the final question-answer result to the user. For the server side of the application program, whether the question is replied by other question answering robots can be controlled according to the question of the user, a knowledge base corresponding to other services does not need to be stored, the question answering speed is increased, and the memory pressure is reduced. For the user, the user directly obtains the answer the user wants on the current page, so that the question and answer robot is avoided from jumping, or the answer to the question can be known only through telephone consultation. The accuracy and the efficiency of answering questions are improved, the user experience is improved, and meanwhile the benign development of the application program is promoted.
Referring to fig. 1, fig. 1 is a schematic flow chart of a method for processing a query statement according to an embodiment of the present application. The execution main body of the method for processing the query statement is equipment for processing the query statement, wherein the equipment includes but is not limited to mobile terminals such as smart phones, tablet computers, Personal Digital Assistants (PDAs), desktop computers and the like, and may further include various types of servers. The method of processing a query statement as shown in fig. 1 may include: s101 to S105 are as follows:
s101: and acquiring the natural query statement input by the application program.
The applications (apps) in this embodiment each have a function of providing automatic question answering, for example, various natural query sentences are input in an interface of the Application, and the Application can automatically reply to the natural query sentences. The type of the application program is not limited, and may be, for example, a shopping type APP, a financial type APP, a social type APP, a learning type APP, or the like. The application in this example may be run in various intelligent terminals. The intelligent terminal includes, but is not limited to, a mobile phone, a tablet computer, a notebook, a desktop computer, a learning machine, and the like. The description is given for illustrative purposes only and is not intended to be limiting.
Illustratively, a user may enter a natural query statement through an application. For example, when a user wants to obtain some information, a natural query statement may be input on an APP input interface on the terminal device, the terminal device sends the natural query statement to the server after obtaining the natural query statement, and the server obtains the natural query statement.
For example, the application may be a financial-type application. The user wants to obtain the related information about financing, and can input the information on which fund the best profit is currently, what the financing A product is, and the like in the input interface of the application program. The terminal device sends the information of which fund is the best in the current profit, the information of the financial A product and the like to the server. The server receives these natural query statements. The description is given for illustrative purposes only and is not intended to be limiting.
S102: and determining a machine query statement corresponding to the natural query statement by using the trained keyword extraction model, wherein the natural query statement is used for querying a second service in the application program.
Illustratively, the keyword extraction model is trained on an initial keyword extraction network based on a sample training set using a machine learning algorithm. The initial keyword extraction network refers to an untrained keyword extraction model. For example, the initial keyword extraction Network may include a Neural Network Language Model (NNLM).
The application may support multiple services, for example, a service corresponding to an application includes a first service and a second service. The first service is a main service corresponding to the application program, and the second service refers to all services borne by the application program except the main service. The natural query statement is used to query a second service in the application.
Optionally, in a possible implementation manner, the natural query statement may be preprocessed to obtain a preprocessed result corresponding to the natural query statement. Wherein, the preprocessing refers to extracting and removing redundant information in the natural query statement. Redundant information refers to information that has no practical meaning in a natural query statement. For example, the redundant information may be stop words, punctuation marks, etc. in the natural query statement. Stop words are typically qualifiers, moods, adverbs, prepositions, conjunctions, English characters, numbers, mathematical characters, and the like. Wherein, the English character is a letter which exists independently and has no practical meaning. If the English character is a letter combination and has meaning, the English character is determined as a valid character and cannot be removed. For example, when the english character is CPU, MAC, HR, etc., it remains as a valid character and is not removed. The description is given for illustrative purposes only and is not intended to be limiting. And inputting the preprocessed natural query sentence into the trained keyword extraction model for processing to obtain the keywords corresponding to the natural query sentence. And searching the machine query sentence matched with the keyword in a preset knowledge base to obtain the machine query sentence corresponding to the natural query sentence.
In the implementation mode, the natural query statement is preprocessed, redundant information in the natural query statement is removed in advance, so that when the subsequent keyword extraction model processes the preprocessed natural query statement, the interference of the redundant information is reduced, the processing speed of the keyword extraction model is increased, and the accuracy of a processing result is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating a step S102 of a method for processing a query statement according to an exemplary embodiment of the present application; optionally, in some possible implementations of the present application, the S102 may include S1021 to S1022, which are as follows:
s1021: and inputting the natural query sentence into the keyword extraction model for processing to obtain a keyword corresponding to the natural query sentence.
In this example, the natural query statement may be directly input into the keyword extraction model for processing without preprocessing, so as to obtain the keyword corresponding to the natural query statement. For example, in a possible implementation manner, a natural query statement may be input into the keyword extraction model to be processed, so as to obtain a keyword corresponding to the natural query statement. Or inputting the natural query sentence into the keyword extraction model for processing to obtain a plurality of keywords corresponding to the natural query sentence, and selecting the keyword which can most express the semantics of the natural query sentence from the plurality of keywords as the keyword corresponding to the natural query sentence finally.
Optionally, in some possible implementations of the present application, the S1021 may include S10211 to S10214, which are as follows:
s10211: and performing word segmentation processing on the natural query sentence to obtain a plurality of words.
The word segmentation processing means that a word sequence in a natural query sentence is divided into a plurality of word sequences, namely a plurality of word segments, by a word segmentation algorithm. The keyword extraction model may include a word segmentation algorithm, and the natural query sentence is subjected to word segmentation processing through the word segmentation algorithm to obtain a plurality of words corresponding to the natural query sentence. Namely, the content in the natural query sentence is divided into a plurality of participles through a participle algorithm. The word segmentation can be a word or a single word. Exemplarily, a plurality of word segmentation modes corresponding to the natural query statement can be determined according to a word segmentation algorithm, and a most suitable word segmentation mode is selected to segment the natural query statement, so as to obtain a plurality of words segmentation corresponding to the natural query statement.
It should be noted that, if the natural query statement is preprocessed in advance, the preprocessed natural query statement is then subjected to word segmentation, and the process of word segmentation is the same as the process of directly performing word segmentation on the natural query statement, and is not described herein again.
S10212: and determining a word vector corresponding to each participle and a semantic vector corresponding to the natural query sentence based on the keyword extraction model.
And vectorizing each participle and the natural query sentence by utilizing a network layer in the keyword extraction model. For example, a plurality of hidden layers in the keyword extraction model perform mapping processing on each participle and a natural query sentence, map each participle and the natural query sentence to a common semantic space, and output a word vector corresponding to each participle and a semantic vector corresponding to the natural query sentence.
S10213: a cosine similarity between each word vector and the semantic vector is determined.
And calculating the cosine similarity between the word vector corresponding to each participle and the semantic vector corresponding to the natural query sentence through a keyword extraction model. And aiming at each word vector, inputting the semantic vector corresponding to the word vector and the natural query sentence into a cosine distance formula for calculation to obtain cosine similarity between the participle corresponding to the word vector and the natural query sentence, namely the correlation degree between the participle and the natural query sentence. The cosine distance formula is as follows:
Figure BDA0003141154940000081
in the formula (1), cos θ represents cosine similarity, and the closer the value of cos θ is to 1, the more relevant the word vector and the semantic vector is, namely the higher the degree of correlation between the participle and the natural query sentence is; a represents a word vector, and B represents a semantic vector; i represents the dimension of the word vector and the semantic vector, namely AiI in (a) represents the dimension corresponding to the word vector, BiI in (2) represents the corresponding dimension of the semantic vector.
S10214: and determining keywords corresponding to the natural query sentence in the multiple participles based on the cosine similarity between each word vector and the semantic vector.
And carrying out normalization processing on each cosine similarity obtained by calculation by adopting a normalization index function to obtain a normalized probability distribution value. The larger the probability distribution value is, the more the participle can represent the semantics expressed by the natural query sentence; the smaller the probability distribution value, the less the token can represent the semantics of the natural query statement expression. And sequencing each participle according to the sequence of the probability distribution value from high to low, and selecting one or a plurality of the participles sequenced at the front as the corresponding key words of the natural query sentence and outputting the key words. Or, sequencing each participle according to the sequence of the probability distribution value from low to high, and selecting one or a plurality of sequenced participles as the corresponding key words of the natural query sentence and outputting the key words.
S1022: and searching the machine query sentence matched with the keyword in a preset knowledge base.
A plurality of different keywords and machine query sentences corresponding to the keywords are stored in a preset knowledge base. For example, the keyword is financial product a, and the corresponding machine query statement is: basic information of the financial product A is inquired (such as the fixed term of the financial product A, the purchase amount of the financial product A and the like). The key words are B-year return of the financial product, and the corresponding machine query statement is as follows: and inquiring the annual income of the financial product B. The key word is a credit card, and the corresponding machine query statement is as follows: basic information of the credit card (e.g., credit card bill, payment date, charge date, etc.) is queried. The key words are credit card repayment dates, and the corresponding machine query statements are as follows: date of repayment, date of checkout, etc.) of the credit card. The description is given for illustrative purposes only and is not intended to be limiting.
And searching the machine query sentence matched with the keyword in a preset knowledge base according to the determined keyword corresponding to the natural query sentence, so as to obtain the machine query sentence corresponding to the natural query sentence.
In the implementation mode, the keywords corresponding to the natural query sentence can be accurately extracted based on the trained keyword extraction model, and then the corresponding machine query sentence can be accurately found according to the keywords, so that accurate response can be provided for the user subsequently.
S103: and determining an initial question-answering result corresponding to the machine query sentence according to a first question-answering robot, wherein the first question-answering robot is matched with the first business in the application program.
Following the example in S102, the service corresponding to the application includes a first service and a second service, and the first service is a main service corresponding to the application. The first question-answering robot is a question-answering robot that matches the first business in the application. The second service refers to all services carried by the application except the main service. The second question-answering robot is a question-answering robot that matches a second business in the application.
Illustratively, the current service mainly operated by the application is the first service (main service) of the application, and the first question-answering robot is used for answering questions related to the main service. However, in order to realize a win-win situation, the application program also shows the business operated by other cooperation companies, and the business operated by other cooperation companies is referred to as a second business (sub-business) in the embodiment. For example, a financial application program is hosted by a business a, and the financial application program also shows a business B operated by the partner company 1 and a business C operated by the partner company 2. The first service is a and the second service is B, C. The first question-answering robot, which is a question-answering robot matched with the first service (service a), can answer questions related to the first service (service a) but cannot accurately answer questions related to the second service (service B, C).
The knowledge base of the first question-answering robot stores initial question-answering results corresponding to a plurality of different machine query sentences in advance. It should be noted that, if the machine query statement is used to query information about the first service, the initial question-answer result corresponding to the machine query statement is the final question-answer result corresponding to the natural query statement, and it can be understood that the initial question-answer result corresponding to the machine query statement is the result that can be directly used to answer the natural query statement input by the user.
If the machine query statement is used for querying information of the second service, the initial question-answer result corresponding to the machine query statement may include a jump instruction, and the jump instruction is used for assisting the server to search for the second question-answer robot. And then the second question-answering robot is used for answering the questions related to the second service.
It should be noted that, when there are a plurality of second services in the application program, each second service corresponds to one question-answering robot. For example, the second service B corresponds to a second question-answering robot B, and the second service C corresponds to a second question-answering robot C. The second question-answering robot B is used for answering questions related to the second service B, and the second question-answering robot C is used for answering questions related to the second service C.
Illustratively, based on the machine query statement, an initial question-and-answer result corresponding to the machine query statement is queried in a knowledge base of the first question-and-answer robot. And detecting whether the initial question-answer result comprises a jump instruction, and if the initial question-answer result does not comprise the jump instruction, proving that the initial question-answer result can directly answer the natural query sentence input by the user. At this time, the initial question-answering result is presented to the user in the application program based on the first question-answering robot. If the initial question-answering result includes the jump instruction, S104 is executed.
For example, the business hosted by a financial application is financial product a, and the financial application also shows business financial product B operated by the partner company 1. The user enters a natural query sentence "how do i want to know your financial a product? "will" how do I want to know your financing A product? "inputting into the keyword extraction model for processing, and obtaining the keyword corresponding to the natural query sentence as" financing A product ". According to the keyword: the financial product A acquires a corresponding machine query statement as follows: basic information of the financial product A is inquired (such as the fixed term of the financial product A, the purchase amount of the financial product A and the like). And acquiring an initial question-answering result corresponding to the basic information of the financial product A in the knowledge base of the first question-answering robot. Since the natural query sentence is about to query the relevant question about the first service of the application program, the initial question-answering result includes the fixed term of the financial product a, the purchase amount of the financial product a and other information, and the initial question-answering result is displayed to the user in the application program based on the first question-answering robot.
As another example, the user enters a natural query statement "how do i want to know your financial B product? "will" how do i want to know your financing B product? And inputting the natural query sentence into a keyword extraction model for processing to obtain a keyword corresponding to the natural query sentence, wherein the keyword is a financial B product. According to the keyword: and the financial product B acquires a corresponding machine query statement as follows: and inquiring basic information of the financial product B (such as a fixed term of the financial product B, a purchase amount of the financial product B and the like). And acquiring an initial question-answering result corresponding to the basic information of the financial product B in the knowledge base of the first question-answering robot. Because the natural query statement is about to query the relevant question about the second service of the application program, the initial question-answering result does not contain specific information about the financial product B, but contains a jump instruction, and the jump instruction is used for assisting the server to search for the second question-answering robot, namely, to search for the question-answering robot capable of answering the natural query statement. The description is given for illustrative purposes only and is not intended to be limiting.
S104: when it is detected that the initial question-answering result includes a jump instruction, a second question-answering robot is determined based on the jump instruction, and the second question-answering robot is a question-answering robot matched with a second service in the application program.
Illustratively, the second service refers to all other services borne by the application except the main service, and when there are a plurality of second services, there are a plurality of second question-answering robots, each second question-answering robot corresponds to a service, and each second question-answering robot is used for answering the relevant questions of the corresponding service.
When the initial question-answering result is detected to comprise a jump instruction, the fact that the current first question-answering robot cannot directly answer the natural query sentence input by the user is proved, the second question-answering robot needs to answer, and the second question-answering robot is determined based on the jump instruction.
And searching the second question-answering robot in all the question-answering robots corresponding to the application program based on the identification information of the second question-answering robot carried in the jump instruction. The jump instruction can also carry a jump link, the jump link is provided with an address of a second question-answering robot, and when the jump link is triggered, the server can switch the current first question-answering robot into the second question-answering robot. Optionally, in a possible implementation manner, when it is detected that the initial question-answering result includes a jump instruction, a jump link in the jump instruction is acquired, and the current first question-answering robot is switched to the second question-answering robot according to an address in the jump link.
It should be noted that switching to the second question-answering robot may be only the operation of the server, and then determining a final question-answering result corresponding to the machine query sentence based on the second question-answering robot, and feeding back the final question-answering result to the user. There is no change in the application interface used by the user. That is, it is the interface that the user sees that it is also the first question-answering robot that is serving it. In the implementation mode, the user directly obtains the answer the user wants on the current page, so that the question and answer robot is prevented from jumping, or the user can know the answer of the question only through telephone consultation. The accuracy and the efficiency of answering questions are improved, the user experience is improved, and meanwhile the benign development of the application program is promoted.
Optionally, in a possible implementation manner, the S104 may include S1041 to S1042, which are specifically as follows:
s1041: and when the initial question-answering result is detected to comprise a jump instruction, acquiring identification information corresponding to the second question-answering robot carried in the jump instruction.
Illustratively, when initial question and answer results corresponding to different machine query sentences are stored in a knowledge base of a first question and answer robot in advance, if the machine query sentences are not used for querying a first service, a second service corresponding to the machine query sentences is determined, identification information corresponding to a second question and answer robot corresponding to the second service is acquired, and the identification information corresponding to the second question and answer robot is preset in a jump instruction. And when the initial question-answering result is detected to comprise a jump instruction, acquiring identification information corresponding to the second question-answering robot carried in the jump instruction.
Following the example in S103, for example, the machine query statement is: and inquiring basic information of the financial product B. The machine query statement is about to query the relevant questions about the second service of the application program, the identification information corresponding to the second question-answering robot corresponding to the second service is determined, and the identification information is set in the jump instruction included in the initial question-answering result corresponding to the machine query statement.
S1042: and searching the second question-answering robot in all the question-answering robots corresponding to the application program based on the identification information.
When the application program bears a plurality of services, a plurality of question-answering robots are correspondingly arranged, and each question-answering robot has corresponding identification information in order to distinguish the question-answering robots. According to the identification information corresponding to the second question-answering robot, the second question-answering robot can be found in all the question-answering robots corresponding to the application program.
S105: and determining a final question-answer result corresponding to the machine query sentence according to the second question-answer robot, and feeding back the final question-answer result to the user.
The knowledge base of the second question-answering robot stores question-answering results corresponding to a plurality of different machine query sentences in advance. And finding the question and answer result corresponding to the machine query sentence in the knowledge base of the second question and answer robot, wherein the question and answer result is the final question and answer result. The final question-answering result can directly answer the natural query sentence of the user. And displaying the final question and answer result to the user on an interface of an application program.
In the scheme, the obtained natural query sentence is analyzed by using the trained keyword extraction model, and the machine query sentence corresponding to the natural query sentence is obtained. And determining an initial question-answering result corresponding to the machine query sentence according to the first question-answering robot. And when the initial question-answer result is detected to comprise a jump instruction, determining a second question-answer robot based on the jump instruction, determining a final question-answer result corresponding to the machine query sentence according to the second question-answer robot, and feeding back the final question-answer result to the user. For the server side of the application program, whether the question is replied by other question answering robots can be controlled according to the question of the user, a knowledge base corresponding to other services does not need to be stored, the question answering speed is increased, and the memory pressure is reduced. For the user, the user directly obtains the answer the user wants on the current page, so that the question and answer robot is avoided from jumping, or the answer to the question can be known only through telephone consultation. The accuracy and the efficiency of answering questions are improved, the user experience is improved, and meanwhile the benign development of the application program is promoted.
Optionally, in a possible implementation manner, when the final question-answering result is fed back to the user, although the final question-answering result is provided based on the second question-answering robot, the final question-answering result is still displayed to the user through the first question-answering robot on the display interface of the application program.
Optionally, in order to avoid that the user asks the final question-answering result and to avoid that the user follows up the responsibility for the first service if the user makes some wrong decisions according to the final question-answering result, before determining the final question-answering result corresponding to the machine query sentence according to the second question-answering robot and feeding back the final question-answering result to the user, the user may be prompted in the application program that the final question-answering result is provided by the second question-answering robot.
Following the example in S103, for the natural query sentence "how do i want to know your financing B product? "display text in the interface of the application: the response to the question you consult is provided by the second question-answering robot corresponding to the cooperative company 1. The description is given for illustrative purposes only and is not intended to be limiting.
Referring to fig. 3, fig. 3 is a schematic flow chart of a method for processing a query statement according to another embodiment of the present invention. The difference between the embodiment of the present embodiment and the embodiment corresponding to fig. 1 is S204 to S205, where S201 to S203 in the present embodiment are completely the same as S101 to S103 in the previous embodiment, and reference is specifically made to the related description of S101 to S103 in the previous embodiment, which is not repeated herein.
S204: and when the initial question-answering result is detected to comprise a jump instruction, detecting whether the application program supports the jump question-answering robot or not.
When the initial question-answering result is detected to comprise a jump instruction, the current first question-answering robot is proved to be incapable of directly answering the natural query sentence input by the user. At this time, whether the application program supports the jump question-answering robot or not can be detected, namely whether the application program supports other question-answering robots to reply to the natural query sentence input by the user or not can be detected. If the jump question-answering robot is supported, the first question-answering robot is switched into a second question-answering robot at the server end based on the jump instruction, a final question-answering result corresponding to the machine query sentence is searched in a knowledge base of the second question-answering robot, the second question-answering robot transmits the final question-answering result to the first question-answering robot, and the first question-answering robot displays the final question-answering result to the user on an interface of an application program.
Optionally, in a possible implementation manner, after the first question-answering robot obtains the final question-answering result, the final question-answering result is displayed to the user on an interface of the application program, and the interface of the application program prompts that the question-answering result is provided by the second question-answering robot.
S205: and when the detection result is that the application program does not support the skip question-answering robot, generating prompt information, wherein the prompt information is used for prompting a user to update the version of the application program.
And when the detection result shows that the application program does not support the jump question-answering robot, proving that the current version of the application program does not support other question-answering robots to reply the natural query sentence currently input by the user. At this time, the user is prompted to update the version of the application at the interface of the application. Optionally, the user can be prompted on the interface of the application program that the second service is consulted by the user, and the customer service hotline 123456 of the second service is called by the user, and the service time is 8:00-22: 00. The description is given for illustrative purposes only and is not intended to be limiting.
In the above embodiment, since the skip robot needs to update the application program, in order to bring better experience to the user, when the user uses the application program of the old version that does not support the skip question-and-answer robot, the user is prompted to update the version of the application program in time, so that an accurate response can be better provided for the user, and better experience is brought to the user.
Optionally, in a possible implementation manner, the processing of the query statement provided by the present application may also include: acquiring a natural query statement input through an application program; determining a machine query statement corresponding to a natural query statement by using the trained keyword extraction model, wherein the natural query statement is used for querying a second service in the application program; determining an initial question and answer result corresponding to a machine query sentence according to a first question and answer robot, wherein the first question and answer robot is a question and answer robot matched with a first service in an application program; and when the initial question-answering result is detected to comprise a jump instruction, acquiring a jump link carried in the jump instruction, displaying the jump link on an interface of an application program, and prompting a user that the question is replied by the second question-answering robot. If the user clicks the jump link, the server switches the current first question-answering robot into a second question-answering robot, simultaneously transmits the natural query sentence input by the user and the determined machine query sentence corresponding to the natural query sentence to the second question-answering robot together, is convenient for directly searching a final question-answering result corresponding to the machine query sentence in a knowledge base of the second question-answering robot, and feeds the final question-answering result back to the user based on the second question-answering robot. In the implementation mode, the question and answer robot is jumped, and the development workload is reduced. The parameters are transmitted through the front-end link, namely the first question-answering robot transmits the related data to the second question-answering robot, so that the user does not need to ask the same question again, and for the user, the user does not need to consult in an application program corresponding to the second service, and the user can obtain the answer required by the user only by clicking the jump link on the current page, thereby improving the user experience.
Referring to fig. 4, fig. 4 is a schematic diagram of a reply provided by another embodiment of the present application. Fig. 4 shows an interface of the response of the existing question-answering robot when the user consults the second service in the application program in the prior art. Because the existing question-answering robot can only answer the problems related to the first service, when the user consults the problems related to the second service, the user can only reply to the questions in a unified way, and the user can adopt other solutions. For example, reply: your good financing B product for your consultation belongs to the business of the cooperative company 1, and you call a customer service hotline 123456 for consultation, and the service time is 8:00-22: 00. Optionally, the interface of the application may also prompt the user for possible concerns or remind the user to manually resolve the problem. The description is given for illustrative purposes only and is not intended to be limiting.
Referring to fig. 5, fig. 5 is a schematic diagram of a response provided by another embodiment of the present application. In the application scenario shown in fig. 5, a natural query sentence "how do i want to know your financial B product" input through an application program is obtained? "will" how do i want to know your financing B product? And inputting the natural query sentence into a keyword extraction model for processing to obtain a keyword corresponding to the natural query sentence, wherein the keyword is a financial B product. According to the keyword: and the financial product B acquires a corresponding machine query statement as follows: and inquiring basic information of the financial product B (such as a fixed term of the financial product B, a purchase amount of the financial product B and the like). And acquiring an initial question-answering result corresponding to the basic information of the financial product B in the knowledge base of the first question-answering robot. Since the natural query sentence is intended to query the relevant question about the second service of the application program, the initial question-answering result does not contain specific information about the financial product B, but contains a jump instruction, and the second question-answering robot is determined based on the jump instruction. And prompting in an application program interface: the answer to the question you consult is provided by the second question-answering robot. And the final question and answer result is displayed to the user. The description is given for illustrative purposes only and is not intended to be limiting.
Referring to fig. 6, fig. 6 is a schematic diagram of a response provided by another embodiment of the present application. In the application scenario shown in fig. 5, when it is detected that the initial question-answering result includes a jump instruction, a jump link carried in the jump instruction is obtained, the jump link is displayed on an interface of an application program, and a user is prompted to: the questions asked by the user are answered by the second question-answering robot, whether the user agrees to switch the current first question-answering robot to the second question-answering robot or not is judged, and if yes, the user clicks the following jump link. If the user clicks the jump link, the server switches the current first question-answering robot into a second question-answering robot, simultaneously transmits the natural query sentence input by the user and the determined machine query sentence corresponding to the natural query sentence to the second question-answering robot together, is convenient for directly searching a final question-answering result corresponding to the machine query sentence in a knowledge base of the second question-answering robot, and feeds the final question-answering result back to the user based on the second question-answering robot.
Referring to fig. 7, fig. 7 is a schematic flow chart of a method for processing a query statement according to another embodiment of the present application. It mainly relates to a process of obtaining a keyword extraction model before performing a process of processing a query statement as shown in fig. 1. The method comprises the following steps:
s301: and acquiring a sample training set, wherein the sample training set comprises a plurality of sample natural query sentences and sample keywords corresponding to each sample natural query sentence.
The method comprises the steps of collecting a plurality of sample natural query sentences corresponding to various different services in advance, marking sample keywords corresponding to each sample natural query sentence for each sample natural query sentence, and forming a sample training set based on the plurality of sample natural query sentences and the sample keywords corresponding to each sample natural query sentence. And associating each sample keyword with the corresponding sample natural query sentence, so that the subsequent model can learn the relationship between the sample natural query sentence and the corresponding sample keyword in the training process.
Optionally, a part of data in the sample training set can be used as a test set, so that the model can be conveniently tested subsequently. For example, a plurality of sample natural query sentences are selected from the sample training set, and sample keywords corresponding to the sample natural query sentences are used as the test set.
S302: training the initial keyword extraction network based on the sample training set, and updating the parameters of the initial keyword extraction network based on the training result.
Exemplarily, each sample natural query statement in the sample training set is processed through the initial keyword extraction network, so as to obtain an actual keyword corresponding to each sample natural query statement. The specific process of extracting the network sample natural query statement from the initial keyword for processing may refer to the specific process in S1021, and is not described herein again.
S303: and when detecting that the loss function corresponding to the initial keyword extraction network is converged, obtaining a trained keyword extraction model.
And when the preset training times are reached, testing the initial keyword extraction network at the moment. Exemplarily, the sample natural query statement in the test set is input into the initial keyword extraction network at this time for processing, and the actual keyword corresponding to the sample natural query statement is output by the initial keyword extraction network at this time. And calculating a loss value between the actual keyword corresponding to the sample natural query statement and the sample keyword corresponding to the sample natural query statement in the test set based on a loss function. Wherein the loss function may be a cross entropy loss function.
When the loss value does not meet the preset condition, adjusting parameters of the initial keyword extraction network (for example, adjusting a weight value corresponding to a hidden layer of the initial keyword extraction network), and continuing to train the initial keyword extraction network. And when the loss value meets the preset condition, stopping training the initial keyword extraction network, and taking the trained initial keyword extraction network as a trained keyword extraction model. For example, assume that the preset condition is that the loss value is less than or equal to a preset loss value threshold. Then, when the loss value is greater than the loss value threshold, the parameters of the initial keyword extraction network are adjusted, and the training of the initial keyword extraction network is continued. And when the loss value is less than or equal to the loss value threshold value, stopping training the initial keyword extraction network, and taking the trained initial keyword extraction network as a trained keyword extraction model. The description is given for illustrative purposes only and is not intended to be limiting.
Optionally, in the process of training the initial keyword extraction network, the convergence condition of the loss function corresponding to the initial keyword extraction network may be observed. And when the loss function is not converged, adjusting the parameters of the initial keyword extraction network, and continuing to train the initial keyword extraction network based on the sample training set. And when the loss function is converged, stopping training the initial keyword extraction network, and taking the trained initial keyword extraction network as a trained keyword extraction model. Wherein, the convergence of the loss function means that the value of the loss function tends to be stable. The description is given for illustrative purposes only and is not intended to be limiting.
Referring to fig. 8, fig. 8 is a schematic diagram illustrating an apparatus for processing a query statement according to an embodiment of the present application. The device comprises units for executing the steps in the embodiments corresponding to fig. 1-3 and 7. Please refer to the related description of the embodiments corresponding to fig. 1 to fig. 3 and fig. 7. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 8, it includes:
an obtaining unit 410, configured to obtain a natural query statement input through an application;
a first determining unit 420, configured to determine, by using the trained keyword extraction model, a machine query statement corresponding to the natural query statement, where the natural query statement is used to query a second service in the application;
a second determining unit 430, configured to determine an initial question-answering result corresponding to the machine query statement according to a first question-answering robot, where the first question-answering robot is a question-answering robot matched with a first service in the application program;
a third determining unit 440, configured to determine, when it is detected that the initial question-answering result includes a jump instruction, a second question-answering robot based on the jump instruction, where the second question-answering robot is a question-answering robot that matches a second service in the application program;
a fourth determining unit 450, configured to determine a final question-answering result corresponding to the machine query statement according to the second question-answering robot, and feed back the final question-answering result to the user
Optionally, the first determining unit 420 includes:
the processing unit is used for inputting the natural query sentence into the keyword extraction model for processing to obtain a keyword corresponding to the natural query sentence;
and the searching unit is used for searching the machine query statement matched with the keyword in a preset knowledge base.
Optionally, the processing unit is specifically configured to:
performing word segmentation processing on the natural query sentence to obtain a plurality of words;
determining a word vector corresponding to each participle and a semantic vector corresponding to the natural query sentence based on the keyword extraction model;
determining cosine similarity between each word vector and the semantic vector;
and determining keywords corresponding to the natural query sentence in the multiple participles based on the cosine similarity between each word vector and the semantic vector.
Optionally, the third determining unit 440 is specifically configured to:
when the initial question-answering result is detected to comprise a jump instruction, acquiring identification information corresponding to the second question-answering robot carried in the jump instruction;
and searching the second question-answering robot in all question-answering robots corresponding to the application program based on the identification information.
Optionally, the apparatus further comprises:
the first detection unit is used for detecting whether the application program supports the skip question-answering robot or not when the initial question-answering result is detected to comprise a skip instruction;
and the second detection unit is used for generating prompt information when the detection result shows that the application program does not support the skip question-answering robot, wherein the prompt information is used for prompting a user to update the version of the application program.
Optionally, the apparatus further comprises:
and the prompting unit is used for prompting the final question and answer result of the user to be provided by the second question and answer robot in the application program.
Optionally, the apparatus further includes a training unit, and the training unit is specifically configured to:
acquiring a sample training set, wherein the sample training set comprises a plurality of sample natural query sentences and sample keywords corresponding to each sample natural query sentence;
training an initial keyword extraction network based on the sample training set, and updating parameters of the initial keyword extraction network based on a training result;
and when detecting that the loss function corresponding to the initial keyword extraction network is converged, obtaining the trained keyword extraction model.
Referring to fig. 9, fig. 9 is a schematic diagram of an apparatus for processing a query statement according to another embodiment of the present application. As shown in fig. 9, the apparatus 5 for processing a query statement of this embodiment includes: a processor 50, a memory 51, and computer instructions 52 stored in said memory 51 and executable on said processor 50. The processor 50, when executing the computer instructions 52, implements the steps in the various method embodiments described above for processing query statements, e.g., S101-S105 shown in fig. 1. Alternatively, the processor 50, when executing the computer instructions 52, implements the functions of the units in the above embodiments, such as the units 410 to 450 shown in fig. 8.
Illustratively, the computer instructions 52 may be divided into one or more units, which are stored in the memory 51 and executed by the processor 50 to accomplish the present application. The one or more units may be a series of computer instruction segments capable of performing specific functions, which are used to describe the execution of the computer instructions 52 in the device 5 for processing query statements. For example, the computer instructions 52 may be divided into an acquisition unit, a first determination unit, a second determination unit, a third determination unit, and a fourth determination unit, each of which functions specifically as described above.
The device for processing the query statement may include, but is not limited to, a processor 50 and a memory 51. It will be appreciated by those skilled in the art that fig. 9 is merely an example of the apparatus 5 for processing a query statement and does not constitute a limitation of the apparatus for processing a query statement and may include more or less components than those shown, or combine some components, or different components, for example, the apparatus for processing a query statement may also include an input-output device, a network access device, a bus, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 51 may be an internal storage unit of the device for processing the query statement, for example, a hard disk or a memory of the device for processing the query statement. The memory 51 may also be an external storage terminal of the device for processing query statements, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are equipped on the device for processing query statements. Further, the memory 51 may also include both an internal storage unit and an external storage terminal of the apparatus for processing a query statement. The memory 51 is used for storing the computer instructions and other programs and data required by the terminal. The memory 51 may also be used to temporarily store data that has been output or is to be output.
The embodiments of the present application further provide a computer storage medium, where the computer storage medium may be non-volatile or volatile, and the computer storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps in the above method embodiments for processing a query statement.
The present application also provides a computer program product, which when run on the apparatus, causes the apparatus to perform the steps in the above-described respective method embodiments of processing a query statement.
An embodiment of the present application further provides a chip or an integrated circuit, where the chip or the integrated circuit includes: and the processor is used for calling and running the computer program from the memory so that the device provided with the chip or the integrated circuit executes the steps in the method embodiment for processing the query statement.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not cause the essential features of the corresponding technical solutions to depart from the spirit scope of the technical solutions of the embodiments of the present application, and are intended to be included within the scope of the present application.

Claims (10)

1. A method of processing a query statement, comprising:
acquiring a natural query statement input through an application program;
determining a machine query statement corresponding to the natural query statement by using a trained keyword extraction model, wherein the natural query statement is used for querying a second service in the application program;
determining an initial question and answer result corresponding to the machine query sentence according to a first question and answer robot, wherein the first question and answer robot is a question and answer robot matched with a first service in the application program;
when the initial question-answering result is detected to comprise a jump instruction, determining a second question-answering robot based on the jump instruction, wherein the second question-answering robot is matched with a second service in the application program;
and determining a final question and answer result corresponding to the machine query sentence according to the second question and answer robot, and feeding back the final question and answer result to the user.
2. The method of claim 1, wherein determining the machine query statement to which the natural query statement corresponds using the trained keyword extraction model comprises:
inputting the natural query sentence into the keyword extraction model for processing to obtain a keyword corresponding to the natural query sentence;
and searching the machine query sentence matched with the keyword in a preset knowledge base.
3. The method of claim 2, wherein the inputting the natural query statement into the keyword extraction model for processing to obtain a keyword corresponding to the natural query statement comprises:
performing word segmentation processing on the natural query sentence to obtain a plurality of words;
determining a word vector corresponding to each participle and a semantic vector corresponding to the natural query sentence based on the keyword extraction model;
determining cosine similarity between each word vector and the semantic vector;
and determining keywords corresponding to the natural query sentence in the multiple participles based on the cosine similarity between each word vector and the semantic vector.
4. The method of claim 1, wherein determining a second question-answering robot based on the jump instruction when it is detected that the initial question-answering result includes the jump instruction comprises:
when the initial question-answering result is detected to comprise a jump instruction, acquiring identification information corresponding to the second question-answering robot carried in the jump instruction;
and searching the second question-answering robot in all question-answering robots corresponding to the application program based on the identification information.
5. The method of claim 1, wherein after determining an initial question-and-answer result corresponding to the machine query statement according to the first question-and-answer robot, the method further comprises:
when the initial question-answering result is detected to comprise a jump instruction, detecting whether the application program supports a jump question-answering robot or not;
and when the detection result shows that the application program does not support the skip question-answering robot, generating prompt information, wherein the prompt information is used for prompting a user to update the version of the application program.
6. The method of claim 1, wherein before determining a final question-answer result corresponding to the machine query sentence according to the second question-answer robot and feeding back the final question-answer result to the user, the method further comprises:
and prompting the user in the application program that the final question and answer result is provided by the second question and answer robot.
7. The method of any of claims 1-6, wherein prior to determining the machine query statement to which the natural query statement corresponds using the trained keyword extraction model, the method further comprises:
acquiring a sample training set, wherein the sample training set comprises a plurality of sample natural query sentences and sample keywords corresponding to each sample natural query sentence;
training an initial keyword extraction network based on the sample training set, and updating parameters of the initial keyword extraction network based on a training result;
and when detecting that the loss function corresponding to the initial keyword extraction network is converged, obtaining the trained keyword extraction model.
8. An apparatus for processing a query statement, comprising:
an acquisition unit configured to acquire a natural query sentence input through an application;
a first determining unit, configured to determine, by using a trained keyword extraction model, a machine query statement corresponding to the natural query statement, where the natural query statement is used to query a second service in the application;
a second determining unit, configured to determine an initial question-answering result corresponding to the machine query statement according to a first question-answering robot, where the first question-answering robot is a question-answering robot that matches a first service in the application program;
a third determining unit, configured to determine, when it is detected that the initial question-answering result includes a jump instruction, a second question-answering robot based on the jump instruction, where the second question-answering robot is a question-answering robot that matches a second service in the application program;
and the fourth determining unit is used for determining a final question and answer result corresponding to the machine query sentence according to the second question and answer robot and feeding the final question and answer result back to the user.
9. An apparatus for processing a query statement, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202110740228.4A 2021-06-30 2021-06-30 Method, device and equipment for processing query statement and storage medium Pending CN113434653A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110740228.4A CN113434653A (en) 2021-06-30 2021-06-30 Method, device and equipment for processing query statement and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110740228.4A CN113434653A (en) 2021-06-30 2021-06-30 Method, device and equipment for processing query statement and storage medium

Publications (1)

Publication Number Publication Date
CN113434653A true CN113434653A (en) 2021-09-24

Family

ID=77758279

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110740228.4A Pending CN113434653A (en) 2021-06-30 2021-06-30 Method, device and equipment for processing query statement and storage medium

Country Status (1)

Country Link
CN (1) CN113434653A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461661A (en) * 2022-01-05 2022-05-10 贵州具京网络科技有限公司 Data query method and system based on big data

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135143A (en) * 2017-03-27 2017-09-05 厦门快商通科技股份有限公司 Many chat robots switching systems and its dialogue method
KR20190064313A (en) * 2017-11-30 2019-06-10 삼성에스디에스 주식회사 Method for providing personalized chatbot service and apparatus thereof
JP2019159880A (en) * 2018-03-14 2019-09-19 Kddi株式会社 Answering device, answering method, answering program and answering system
CN110675875A (en) * 2019-09-30 2020-01-10 苏州思必驰信息科技有限公司 Intelligent voice conversation technology telephone experience method and device
CN111241249A (en) * 2020-01-21 2020-06-05 苏宁云计算有限公司 Man-machine conversation method, device, computer equipment and storage medium
CN111694939A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Method, device and equipment for intelligently calling robot and storage medium
CN112307166A (en) * 2020-10-29 2021-02-02 腾讯科技(深圳)有限公司 Intelligent question and answer method and device, storage medium and computer equipment
CN112395875A (en) * 2020-11-17 2021-02-23 中国平安人寿保险股份有限公司 Keyword extraction method, device, terminal and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107135143A (en) * 2017-03-27 2017-09-05 厦门快商通科技股份有限公司 Many chat robots switching systems and its dialogue method
KR20190064313A (en) * 2017-11-30 2019-06-10 삼성에스디에스 주식회사 Method for providing personalized chatbot service and apparatus thereof
JP2019159880A (en) * 2018-03-14 2019-09-19 Kddi株式会社 Answering device, answering method, answering program and answering system
CN110675875A (en) * 2019-09-30 2020-01-10 苏州思必驰信息科技有限公司 Intelligent voice conversation technology telephone experience method and device
CN111241249A (en) * 2020-01-21 2020-06-05 苏宁云计算有限公司 Man-machine conversation method, device, computer equipment and storage medium
CN111694939A (en) * 2020-04-28 2020-09-22 平安科技(深圳)有限公司 Method, device and equipment for intelligently calling robot and storage medium
CN112307166A (en) * 2020-10-29 2021-02-02 腾讯科技(深圳)有限公司 Intelligent question and answer method and device, storage medium and computer equipment
CN112395875A (en) * 2020-11-17 2021-02-23 中国平安人寿保险股份有限公司 Keyword extraction method, device, terminal and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114461661A (en) * 2022-01-05 2022-05-10 贵州具京网络科技有限公司 Data query method and system based on big data

Similar Documents

Publication Publication Date Title
US10795944B2 (en) Deriving user intent from a prior communication
CN108491433B (en) Chat response method, electronic device and storage medium
CN108804641B (en) Text similarity calculation method, device, equipment and storage medium
US9582757B1 (en) Scalable curation system
EP3696746A1 (en) Method and apparatus for determining description information, electronic device and computer storage medium
US11238050B2 (en) Method and apparatus for determining response for user input data, and medium
CN108664471B (en) Character recognition error correction method, device, equipment and computer readable storage medium
CN111274822A (en) Semantic matching method, device, equipment and storage medium
CN114398910A (en) Intelligent question and answer method, device, equipment and storage medium
CN112686051A (en) Semantic recognition model training method, recognition method, electronic device, and storage medium
CN112507139A (en) Knowledge graph-based question-answering method, system, equipment and storage medium
CN112581297B (en) Information pushing method and device based on artificial intelligence and computer equipment
CN113434653A (en) Method, device and equipment for processing query statement and storage medium
CN109684357B (en) Information processing method and device, storage medium and terminal
CN117278675A (en) Outbound method, device, equipment and medium based on intention classification
CN111639160A (en) Domain identification method, interaction method, electronic device and storage medium
CN116225956A (en) Automated testing method, apparatus, computer device and storage medium
CN114490986B (en) Computer-implemented data mining method, device, electronic equipment and storage medium
CN116150376A (en) Sample data distribution optimization method, device and storage medium
CN111078972B (en) Questioning behavior data acquisition method, questioning behavior data acquisition device and server
CN114297380A (en) Data processing method, device, equipment and storage medium
CN112989003A (en) Intention recognition method, device, processing equipment and medium
CN111708862A (en) Text matching method and device and electronic equipment
CN111309990A (en) Statement response method and device
CN110347818B (en) Word segmentation statistical method and device, electronic equipment and computer readable storage medium

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