Detailed Description
features and exemplary embodiments of various aspects of the present specification will be described in detail below, and in order to make objects, technical solutions and advantages of the specification more apparent, the specification will be further described in detail below with reference to the accompanying drawings and specific embodiments. It is to be understood that the embodiments described herein are only a few embodiments of the present disclosure, and not all embodiments. It will be apparent to one skilled in the art that the present description may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present specification by illustrating examples thereof.
it is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
fig. 1 shows a system architecture diagram of a customer service robot system as an example in the prior art. As shown in fig. 1, the customer service robot system includes a user device 110 and a server 120 of the customer service robot, and application software having a function of the customer service robot is installed on the user device 110.
in this specification, the user device 110 may be a mobile phone, a tablet computer, a personal computer, or the like. The server 120 may be a high-performance electronic calculator for storing and processing data.
At present, when a user uses a customer service robot to perform a question consultation, a question statement needs to be input into application software in user equipment 110, after the user equipment 110 receives the question statement, a user consultation request is generated based on the question statement, then the user consultation request is sent to a server 120 of the customer service robot, after the server 120 receives the user consultation request, a standard question is matched for the question statement, consultation feedback information is generated according to an answer corresponding to the matched standard question, then the consultation feedback information is sent to the user equipment 110, and the matched answer is displayed to the user by the user equipment 110 through the application software.
However, when the server 120 matches the standard questions for the user by using the similarity, the accuracy of the matched standard questions is low, so that the answers provided by the customer service robot based on the matched standard questions are not related to the question sentences input by the user, and the customer gets a surprise and wonderful answer, thereby reducing the user experience.
In order to solve the above problems in the prior art, the present specification provides a problem matching method, apparatus, device, and computer-readable storage medium.
fig. 2 is a flowchart illustrating a problem matching method according to an embodiment of the present disclosure. As shown in fig. 2, the problem matching method includes:
s210, acquiring question sentences input by a user;
S220, extracting a sentence characteristic word set of the question sentence;
S230, acquiring a plurality of necessary feature word sets and an expanded feature word tree of each necessary feature word in the plurality of necessary feature word sets;
S240, determining a target necessary feature word matched with each sentence feature word in the sentence feature word set in a plurality of necessary feature words corresponding to the plurality of necessary feature word sets by utilizing the expanded feature word tree;
S250, determining whether a target necessary feature word set matched with the sentence feature word set exists in a necessary feature word set to which the determined target necessary feature words belong, wherein each necessary feature word in the target necessary feature word set has a matched sentence feature word;
And S260, if the target necessary feature word set is determined to exist, determining a standard problem matched with the problem statement according to the target necessary feature word set.
according to the embodiment of the present specification, it is possible to match a target necessary feature word for each sentence feature word in a sentence feature word set extracted from a question sentence by using an extended feature word tree of each necessary feature word in a plurality of preset necessary feature word sets, then determine a target necessary feature word set in which each necessary feature word included in the matched sentence feature word set belongs among necessary feature word sets to which the matched target necessary feature word belongs, as a necessary feature word set matched with the question sentence, and determine a standard question matched with the question sentence by using the target necessary feature word set, thereby limiting a question matching rule by using the preset necessary feature words, the extended feature word tree of the necessary feature words, and the necessary feature word set, and by using a preset condition for determining the target necessary feature word set, the standard questions meeting the question matching rules are matched for the question sentences by utilizing the target necessary feature word set matched with the question sentences, so that the accuracy of the matched standard questions is improved, and the customer service robot is prevented from giving the inexplicable answers to the users based on the matched labeled questions. In addition, in one or more embodiments of the present disclosure, a problem sentence is matched with a standard problem by using a preset necessary feature word, an extended feature word tree of the necessary feature word, and a set of the necessary feature word, and by using a preset condition for determining a target set of the necessary feature word, so that the problem matching rule has editability, interpretability of the problem matching rule can be increased, and human involvement of the problem matching rule and flexibility in modifying the problem matching rule are improved.
In this embodiment, a user may input a question statement through the application software with the function of a customer service robot on the user equipment 110 in fig. 1, and after the application software of the user equipment 110 receives the question statement input by the user, a user consultation request may be generated in response to receiving the question statement, and the user consultation request may be sent to the server 120 of the customer service robot through the user equipment 110.
after receiving the user consultation request, the server 120 of the customer service robot may execute step S210 in this embodiment to obtain a question sentence input by the user.
in step S220 of the embodiment of the present specification, a sentence characteristic word set of a question sentence may be extracted in response to acquiring the question sentence.
in some embodiments of the present specification, a specific method of extracting a sentence feature word set of a question sentence may include:
performing dependency syntax analysis on the question sentences to obtain sentence analysis results;
and extracting a plurality of sentence characteristic words of the question sentence according to the sentence analysis result to form a sentence characteristic word set.
Specifically, through dependency syntax analysis, main, predicate, object, shape, complement and other grammar components in the question sentence can be analyzed, and the dependency relationship among the grammar components is analyzed, so that the dependency relationship among the grammar components of the question sentence is obtained as a sentence analysis result, the syntax structure of the question sentence is revealed, and a plurality of sentence characteristic words of the question sentence can be extracted more accurately.
Fig. 3 is a diagram illustrating a statement analysis result of a question statement provided in an embodiment of the present specification.
the question sentence input by the user may be "how my cannot check the refund of the balance treasure", and the result of the dependency syntax analysis on the question sentence is shown in fig. 3, where core words of the sentence are "check", "cannot" and "check" have a dependency relationship, the "balance treasure" and "check" have a dependency relationship, and the "refund" and "balance treasure" have a dependency relationship.
In an embodiment of the present specification, the sentence feature word set may include at least one of a solid type feature word, an action type feature word, and an event type feature word, so that a complete concept of a question sentence input by a user may be determined based on the sentence feature word set to match a standard question for the question sentence.
therefore, the entity type feature words, the action type feature words, and the event type feature words can be extracted from the sentence components as the plurality of sentence feature words of the question sentence based on the sentence analysis result.
continuing with the example of the dependency parsing result shown in fig. 3, the "view" may be used as a verb type feature word, the "unable" and the "view" may constitute a verb compound word, and may also be used as a verb type feature word, the "balance treasure" may be used as a solid type feature word, and the "refund" may be used as an event type feature word. At this time, "not to view", "remaining sum treasure", and "refund" in the question sentence input by the user may be extracted as sentence feature words, respectively, and a sentence feature word set is formed using these three sentence feature words.
in this embodiment of the present specification, the plurality of necessary feature word sets and the expanded feature word tree of each necessary feature word in the plurality of necessary feature word sets in step S230 may be manually constructed in advance according to a standard question in a standard question bank.
Specifically, step S230 may include:
Acquiring a preset standard problem path structure tree, wherein a plurality of path nodes of each path branch of the standard problem path structure tree are determined according to a standard problem corresponding to the path branch;
Determining a necessary characteristic word set corresponding to each path branch according to a plurality of path nodes of each path branch to obtain a plurality of necessary characteristic word sets;
acquiring a plurality of expansion characteristic words of each necessary characteristic word in a plurality of necessary characteristic word sets;
and generating an expanded characteristic word tree of each necessary characteristic word according to the plurality of expanded characteristic words of each necessary characteristic word.
it can be seen that, in the embodiment of the present specification, the necessary feature word set needs to be obtained according to the standard question path structure tree, and therefore, the standard question path structure tree needs to be manually constructed in advance according to the standard questions in the standard question bank.
firstly, words can be cut for each standard question in the standard question bank to obtain a standard question word segmentation set of each standard question. The standard problem can be word-cut to obtain at least one of action type characteristic words, entity type characteristic words, event type characteristic words and query word characteristic words. For example, the standard question "why the balance treasure refunds" can be cut into words to obtain the solid type characteristic word "balance treasure", the event type characteristic word "refund", and the questioning word characteristic word "why". For another example, the standard question "why the refund of the balance treasure cannot be found" may be cut into a real-type feature word "balance treasure", an event-type feature word "refund", an action-type feature word "cannot be found", and a query word "why".
then, according to the sequence of the entity type feature words, the event type feature words, the action type feature words and the query word feature words to which the event type feature words belong, the standard problem participles of each standard problem are sequentially set as root nodes, sub-nodes at all levels and leaf nodes in a plurality of path nodes of corresponding path branches in the standard problem path structure tree, and therefore the standard problem path structure tree is formed. Each path branch of the standard problem path structure tree comprises path nodes corresponding to all standard problem participles of the corresponding standard problem, and the path nodes of each path branch comprise at least one necessary path node and at least one unnecessary path node. The necessary path nodes correspond to the entity type feature words, the action type feature words and the event type feature words in the standard problems, and the unnecessary path nodes correspond to the classification of the standard problems, the fictional words and the query words in the standard problems.
in order to clearly express a complete concept of the standard problem, determining a necessary feature word set corresponding to each path branch according to a plurality of path nodes of each path branch to obtain a plurality of necessary feature word sets, which specifically comprises:
acquiring at least one necessary path node in the plurality of path nodes of each path branch;
And generating a necessary characteristic word set corresponding to each path branch according to at least one necessary path node of each path branch to obtain a plurality of necessary characteristic word sets.
Therefore, each necessary feature word set can comprise at least one of a solid type feature word, an action type feature word and an event type feature word, so that each necessary feature word set can clearly express the complete concept of the corresponding standard problem, and the accuracy of the standard problem matched for the problem statement is improved.
Fig. 4 shows a structural diagram of a standard problem path structure tree provided in an embodiment of the present specification. As shown in fig. 4, the root path node of the standard problem path structure tree is "balance treasure", the first-level sub path node includes "basic attribute", "basic operation", "basic state", etc., and the second-level sub path node includes "refund", "open", etc., wherein the second-level sub path node "refund" and "open" the next-level path node belonging to the "basic operation", the second-level sub path node "opens" the next-level path node belonging to the "basic state", the third-level sub path node includes "no check" and "why", etc., the third-level sub path node "no check" and "why" the next-level path node belonging to the "refund", the fourth-level sub path node includes "why", etc., and the fourth-level sub path node "why" belongs to the "no check" next-level path node. In addition, the "reason" of the three-level sub-path node and the "reason" of the four-level sub-path node are also leaf path nodes of the standard problem path structure tree.
the standard question corresponding to the path branch to which the four-level sub-path node "why" belongs is "why the balance treasure cannot be found for refund", and the necessary path node of the path branch includes a solid type feature word "balance treasure", an event type feature word "refund" and an action type feature word "cannot be found", so that the generated necessary feature word set includes necessary feature words "balance treasure", "refund" and "cannot be found". The standard question corresponding to the path branch to which the three-level sub-path node 'why' belongs is 'why the balance treasures' and the necessary path node of the path branch comprises a solid type characteristic word 'balance treasures' and an event type characteristic word 'refunds', so that the generated necessary characteristic word set comprises necessary characteristic words 'balance treasures' and 'refunds'.
in the embodiment of the present specification, each path node and path branch of the standard problem path structure tree may be manually configured, so that the problem matching rule has high manual engagement degree and flexibility, and meanwhile, the artificially constructed standard problem path structure tree has stronger generalization capability than a regular expression. Therefore, the necessary feature word set obtained based on the standard problem path structure tree also has high human involvement and flexibility, and interpretability.
In this embodiment of the present specification, the plurality of expansion feature words of each necessary feature word may be manually configured, and specifically, at least one of a synonymy feature word, an upper and lower relation feature word, and an implication relation feature word of each necessary feature word may be used as an expansion feature word, and then an expansion feature word tree of each necessary feature word in a hierarchical structure is established based on the plurality of expansion feature words of each necessary feature word.
in some embodiments of the present specification, if the required feature word is a solid-type feature word, an action-type feature word composed of words, or an event-type feature word, the required feature word constitutes a root node of an extended feature word tree, and the extended feature word of the required feature word constitutes a leaf node of the extended feature word tree.
in other embodiments of the present disclosure, if the necessary feature word is an action-type feature word formed by a compound word, the compound word forms a root node of an extended feature word tree, the extended feature word of the compound word forms a first-level child node, and the extended feature word of each word in the extended feature word of the compound word forms a leaf node of the extended feature word tree. Namely, the expansion feature word tree includes the expansion feature words of the compound words and the expansion feature words of the compound words.
fig. 5 illustrates a structural diagram of an extended feature word tree provided in an embodiment of the present specification. As shown in fig. 5, an essential feature word in the essential feature word set is "cannot be found", the "cannot be found" has an extended feature word tree, a root node of the extended feature word tree is "cannot be found", an extended feature word "cannot be found" of the "cannot be found" is a first-level child node, and the "cannot be found" has words "cannot" and "can be found", so the "cannot" extended feature words "cannot be found", "cannot" and the like can be used as a next-level child node of the "cannot", and also are leaf nodes of the extended feature word tree, and the "query" and "see" of the "finding" can be used as a next-level child node of the "finding", and also are leaf nodes of the extended feature word tree.
Because the expansion characteristic words corresponding to each node of the expansion characteristic word tree can be manually configured, the expansion characteristic word tree has high manual participation degree and flexibility, and meanwhile, the expansion characteristic word tree constructed manually has stronger generalization capability than a regular expression.
In step S240 in this embodiment of the present specification, leaf nodes identical to each sentence feature word may be first found in leaf nodes of an expanded feature word tree of each necessary feature word in a plurality of necessary feature word sets, and the necessary feature words corresponding to the leaf nodes are sequentially searched for in a reverse-pushing manner according to paths corresponding to the leaf nodes, so that each sentence feature word matches at least one target necessary feature word.
In step S250 of the embodiment of the present specification, it is determined whether there is a target necessary feature word set in which each necessary feature word has a matched sentence feature word, among all necessary feature word sets to which at least one target necessary feature word that is determined to be matched with each sentence feature word belongs.
For example, the necessary feature word set includes necessary feature words "balance treasure", "refund", "cannot be found", and only when the necessary feature words include the above three words, a complete concept can be completely expressed, and only when any word alone does not represent the complete concept expressed by the above three words, so that when matching the necessary feature word set, strict character string matching principle needs to be followed. When the question sentence input by the user is 'how can not go to check the refund of the balance treasure', all necessary feature words of the necessary feature word set can be matched by using the sentence feature word set, so that the necessary feature word set can be used as a target necessary feature word set matched with the sentence feature word set.
in step 260 of the embodiment of the present specification, if it is determined that the target necessary feature word set exists, the standard question matched with the question sentence may be determined according to the target necessary feature word set.
it should be noted that one sentence feature word set may be matched to a plurality of target necessary feature word sets, and at this time, a standard problem corresponding to each target necessary feature word set may be determined as a standard problem matched with the question sentence; the target necessary feature word set with the largest number of necessary feature words may be selected from the plurality of target necessary feature word sets, and the standard question corresponding to the selected target necessary feature word set may be determined as the standard question matched with the question sentence.
In an embodiment of the present specification, a specific method for determining a standard question matched with a question sentence according to a target essential feature word set may include:
Sequentially searching a path node corresponding to each necessary characteristic word in the target necessary characteristic word set according to the node level sequence of the path node corresponding to each necessary characteristic word in the target necessary characteristic word set in the standard problem path structure tree;
Determining a path branch formed by the searched path node;
And inquiring the standard question corresponding to the determined path branch as the standard question matched with the question statement.
In this embodiment of the present specification, after the standard problem path structure tree is set, the standard problem corresponding to each path branch may be categorized and stored in a folder set hierarchically according to the corresponding relationship between each path branch and the standard problem and the hierarchical relationship of each path node of each path branch in the standard problem path structure tree. Therefore, the standard questions in the standard question bank can be classified and stored according to the folders arranged in the hierarchy, and when the standard questions and the answers thereof are inquired, the data processing amount in the inquiry process can be reduced, and the inquiry efficiency is improved.
For example, when determining that the target necessary feature word set matching the question statement "how my cannot check the refund of the balance treasures" is a necessary feature word set including the necessary feature words "balance treasures", "refunds", and "no-found", the target necessary feature word set may be used to match the necessary path nodes from the root path node to the leaf path nodes step by step, for example, the target necessary feature word set may be used to match the root path node "balance treasures", then may be matched to the second level sub-path node "refunds", then may be matched to the "no-found" in the third level sub-path node corresponding to the "refunds", so that the target necessary feature word set may correspond to all necessary path nodes in the path branches "balance treasures" - "basic operations" - "refunds" - "no-found" - "why", "for example, the standard question corresponding to the path branch may be used as the standard question corresponding to the target required feature word set. And then, searching in a folder with a hierarchical structure in the standard question library according to the hierarchical order based on the hierarchical order of the matched path nodes, and finally finding the standard question and the answer thereof.
In the embodiment of the specification, through the hierarchical structure of the standard question path structure tree and the necessary path nodes, the standard question matched with the question statement only by the expression mode approved by the service is limited, and the standard question matched with the question statement can be sequentially matched from shallow to deep according to the classification of the standard question, so that the data processing amount and difficulty of the question matching are effectively reduced, the efficiency and accuracy of the question matching are improved, the answer of the question statement input by the user can be quickly and accurately fed back to the user, and the use experience of the user is improved.
Fig. 6 is a flow chart illustrating a problem matching method according to another embodiment of the present disclosure. As shown in fig. 6, the problem matching method further includes:
S270, if the target necessary feature word set does not exist, determining at least one feature word to be supplemented according to the plurality of necessary feature word sets and the sentence feature word set;
And S280, generating a supplement prompt statement according to at least one feature word to be supplemented.
Specifically, if it is determined that there is no target necessary feature word set in the necessary feature word set to which the target necessary feature word belongs, at least one necessary feature word set in which the number of necessary feature words not having matching sentence feature words meets a predetermined number range and necessary feature words not having matching sentence feature words in the determined necessary feature word set are determined, the necessary feature words not having matching sentence feature words are taken as feature words to be supplemented, and a supplementary prompt sentence is generated based on the feature words to be supplemented.
In the embodiment of the present specification, since the necessary feature word set includes all necessary feature words necessary for each standard question, for a question sentence lacking the necessary feature words input by the user, a question back can be asked for the lacking feature words to be supplemented by combining the necessary feature word set, so that the user inputs the feature words to be supplemented based on the supplement prompt sentence, and supplements the feature words to be supplemented to the sentence feature word set as one sentence feature word in the sentence feature word set, and re-matches the target necessary feature word set by using the supplemented sentence feature word set, thereby finally finding out a correct answer required by the user.
fig. 7 is a schematic flow chart illustrating a flow of the customer service robot answering a user question according to an embodiment of the present specification. As shown in fig. 7, when the customer service robot answers the user's question, the specific processing flow of the server of the customer service robot includes the following steps:
S301, acquiring question sentences input by a user;
S302, extracting a sentence characteristic word set of the question sentence;
s303, acquiring a plurality of necessary feature word sets and an expanded feature word tree of each necessary feature word in the plurality of necessary feature word sets, and determining a target necessary feature word matched with each sentence feature word in the sentence feature word set in the plurality of necessary feature words corresponding to the plurality of necessary feature word sets by using the expanded feature word tree;
s304, determining whether a target necessary characteristic word set matched with the sentence characteristic word set exists in the necessary characteristic word set to which the determined target necessary characteristic word belongs, if so, executing a step S305, and if not, executing a step S309;
S305, determining a path branch corresponding to the target necessary feature word set in the standard problem path structure tree;
S306, searching a standard problem corresponding to the determined path branch in a folder with a hierarchical structure in a standard problem library according to the node hierarchical sequence of the standard problem path structure tree;
s307, obtaining answers corresponding to the searched standard problems;
s308, generating consultation feedback information based on the obtained answers;
S309, determining at least one feature word to be supplemented according to the plurality of necessary feature word sets and the sentence feature word set;
s310, generating a supplementary prompt statement according to at least one feature word to be supplemented;
s311, at least one feature word to be supplemented is obtained, and the step S303 is executed.
fig. 8 is a schematic structural diagram illustrating a problem matching apparatus provided in an embodiment of the present specification. As shown in fig. 8, the problem matching apparatus 400 includes:
A sentence receiving module 410 configured to obtain a question sentence input by a user;
A feature word extraction module 420 configured to extract a sentence feature word set of the question sentence;
a feature word obtaining module 430 configured to obtain a plurality of necessary feature word sets and an expanded feature word tree of each necessary feature word in the plurality of necessary feature word sets;
the feature word matching module 440 is configured to determine, by using the expanded feature word tree, a target necessary feature word matched with each sentence feature word in the sentence feature word set among a plurality of necessary feature words corresponding to the plurality of necessary feature word sets;
a set matching module 450, configured to determine whether a target necessary feature word set matching the sentence feature word set exists in the determined necessary feature word set to which the target necessary feature word belongs, where each necessary feature word in the target necessary feature word set has a matching sentence feature word;
And the sentence matching module 460 is configured to determine a standard question matched with the question sentence according to the target necessary feature word set if the target necessary feature word set is determined to exist.
According to the embodiment of the present specification, it is possible to match a target necessary feature word for each sentence feature word in a sentence feature word set extracted from a question sentence by using an extended feature word tree of each necessary feature word in a plurality of preset necessary feature word sets, then determine a target necessary feature word set in which each necessary feature word included in the matched sentence feature word set belongs among necessary feature word sets to which the matched target necessary feature word belongs, as a necessary feature word set matched with the question sentence, and determine a standard question matched with the question sentence by using the target necessary feature word set, thereby limiting a question matching rule by using the preset necessary feature words, the extended feature word tree of the necessary feature words, and the necessary feature word set, and by using a preset condition for determining the target necessary feature word set, the standard questions meeting the question matching rules are matched for the question sentences by utilizing the target necessary feature word set matched with the question sentences, so that the accuracy of the matched standard questions is improved, and the customer service robot is prevented from giving the inexplicable answers to the users based on the matched labeled questions. In addition, in one or more embodiments of the present disclosure, a problem sentence is matched with a standard problem by using a preset necessary feature word, an extended feature word tree of the necessary feature word, and a set of the necessary feature word, and by using a preset condition for determining a target set of the necessary feature word, so that the problem matching rule has editability, interpretability of the problem matching rule can be increased, and human involvement of the problem matching rule and flexibility in modifying the problem matching rule are improved.
The problem matching apparatus 400 of the embodiment of the present specification can be applied to the server 120 of the customer service robot shown in fig. 1.
In this specification embodiment, the statement receiving module 410 may receive a question statement of a user input sent by the user device 110 shown in fig. 1.
in this embodiment, the feature word extraction module 420 is further configured to: performing dependency syntax analysis on the question sentences to obtain sentence analysis results; and extracting a plurality of sentence characteristic words of the question sentence according to the sentence analysis result to form a sentence characteristic word set.
the sentence feature word set comprises at least one of entity type feature words, action type feature words and event type feature words, so that the complete concept of the question sentences input by the user can be determined based on the sentence feature word set to match standard questions for the question sentences.
in this embodiment, the feature word obtaining module 430 is further configured to: acquiring a preset standard problem path structure tree, wherein a plurality of path nodes of each path branch of the standard problem path structure tree are determined according to a standard problem corresponding to the path branch; determining a necessary characteristic word set corresponding to each path branch according to a plurality of path nodes of each path branch to obtain a plurality of necessary characteristic word sets; acquiring a plurality of expansion characteristic words of each necessary characteristic word in a plurality of necessary characteristic word sets; and generating an expanded characteristic word tree of each necessary characteristic word according to the plurality of expanded characteristic words of each necessary characteristic word.
the necessary feature word set comprises at least one of entity type feature words, action type feature words and event type feature words, and the plurality of expansion feature words comprise at least one of synonymy feature words, superior-inferior relation feature words and implication relation feature words of the necessary feature words.
In the present specification, because the extended feature words corresponding to each node of the extended feature word tree can be configured manually, the extended feature word tree has high manual engagement degree and flexibility, and meanwhile, the manually constructed extended feature word tree has stronger generalization capability than a regular expression.
In an embodiment of the specification, the plurality of path nodes of each path branch of the standard problem path structure tree includes at least one required path node and at least one unnecessary path node.
specifically, the feature word obtaining module 430 is further configured to: acquiring at least one necessary path node in the plurality of path nodes of each path branch; and generating a necessary characteristic word set corresponding to each path branch according to at least one necessary path node of each path branch to obtain a plurality of necessary characteristic word sets.
in the embodiment of the present specification, each path node and path branch of the standard problem path structure tree may be manually configured, so that the problem matching rule has high manual engagement degree and flexibility, and meanwhile, the artificially constructed standard problem path structure tree has stronger generalization capability than a regular expression. Therefore, the necessary feature word set obtained based on the standard problem path structure tree also has high human involvement and flexibility, and interpretability.
further, the sentence matching module 460 is further configured to: sequentially searching a path node corresponding to each necessary characteristic word in the target necessary characteristic word set according to the node level sequence of the path node corresponding to each necessary characteristic word in the target necessary characteristic word set in the standard problem path structure tree; determining a path branch formed by the searched path node; and inquiring the standard question corresponding to the determined path branch as the standard question matched with the question statement.
in the embodiment of the specification, through the hierarchical structure of the standard question path structure tree and the necessary path nodes, the standard question matched with the question statement only by the expression mode approved by the service is limited, and the standard question matched with the question statement can be sequentially matched from shallow to deep according to the classification of the standard question, so that the data processing amount and difficulty of the question matching are effectively reduced, the efficiency and accuracy of the question matching are improved, the answer of the question statement input by the user can be quickly and accurately fed back to the user, and the use experience of the user is improved.
In the embodiment of the present specification, the problem matching apparatus 400 further includes:
the characteristic word determining module is configured to determine at least one characteristic word to be supplemented according to a plurality of necessary characteristic word sets and a sentence characteristic word set if the target necessary characteristic word set is determined not to exist;
and the sentence generating module is configured to generate a supplementary prompt sentence according to at least one feature word to be supplemented.
specifically, if it is determined that there is no target necessary feature word set in the necessary feature word set to which the target necessary feature word belongs, at least one necessary feature word set having no necessary feature words with matching sentence feature words in a predetermined number range and the necessary feature words having no matching sentence feature words in the determined necessary feature word set are determined, the necessary feature words having no matching sentence feature words are taken as the feature words to be supplemented, and the supplementary hint sentence is generated based on the feature words to be supplemented, among the necessary feature word sets to which the target necessary feature words belong.
In the embodiment of the present specification, since the necessary feature word set includes all necessary feature words necessary for each standard question, for a question sentence lacking the necessary feature words input by the user, a question back can be asked for the lacking feature words to be supplemented by combining the necessary feature word set, so that the user inputs the feature words to be supplemented based on the supplement prompt sentence, and supplements the feature words to be supplemented to the sentence feature word set as one sentence feature word in the sentence feature word set, and re-matches the target necessary feature word set by using the supplemented sentence feature word set, thereby finally finding out a correct answer required by the user.
fig. 9 is a schematic diagram illustrating a hardware structure of a problem matching apparatus according to an embodiment of the present specification. The problem matching device described in the embodiments of the present specification may be a server. As shown in fig. 9, the question matching device 500 includes an input device 501, an input interface 502, a central processor 503, a memory 504, an output interface 505, and an output device 506. The input interface 502, the central processing unit 503, the memory 504, and the output interface 505 are connected to each other through a bus 510, and the input device 501 and the output device 506 are connected to the bus 510 through the input interface 502 and the output interface 505, respectively, and further connected to other components of the problem matching device 500.
specifically, the input device 501 receives input information from the outside and transmits the input information to the central processor 503 through the input interface 502; the central processor 503 processes input information based on computer-executable instructions stored in the memory 504 to generate output information, temporarily or permanently stores the output information in the memory 504, and then transmits the output information to the output device 506 through the output interface 505; the output device 506 outputs the output information to the outside of the question matching device 500 for use by the user.
That is, the problem matching apparatus shown in fig. 9 may also be implemented to include: a memory storing computer-executable instructions; and a processor that, when executing computer-executable instructions, may implement the problem matching method and apparatus described in embodiments of this specification.
Embodiments of the present specification also provide a computer-readable storage medium having computer program instructions stored thereon; the computer program instructions, when executed by a processor, implement the problem matching method provided by embodiments of the present specification.
The functional blocks shown in the above structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of this specification are programs or code segments that are used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include electronic circuits, semiconductor memory devices, ROM, flash memory, Erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, Radio Frequency (RF) links, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the above describes certain embodiments of the specification. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in the order of execution in different embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
As described above, only the specific implementation manner of the present specification is provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the module and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present disclosure is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present disclosure, and these modifications or substitutions should be covered within the scope of the present disclosure.