Sentence processing method and apparatus, electronic device, and computer-readable storage medium

By constructing and dividing a semantic tag tree, the problem of inaccurate sentence segmentation in existing technologies is solved, and accurate segmentation of single-intent clauses is achieved, thereby improving the accuracy of sentence understanding.

CN116306577BActive Publication Date: 2026-06-26IFLYTEK CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
IFLYTEK CO LTD
Filing Date
2022-09-07
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, sentence segmentation methods mainly rely on punctuation marks or verbs, resulting in poor segmentation performance and an inability to accurately identify multi-intent clauses.

Method used

Construct a semantic tag tree, divide it into sub-tag trees, and split it based on the sub-tag trees to obtain clauses of a single intent.

Benefits of technology

It improves the accuracy of sentence segmentation, reduces the occurrence of clauses that fail to express intent, and enhances the accuracy of sentence comprehension.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116306577B_ABST
    Figure CN116306577B_ABST
Patent Text Reader

Abstract

The application discloses a sentence processing method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: constructing a semantic label tree of a target sentence; wherein the semantic label tree is formed by connecting a plurality of nodes, each node represents an entity semantic label, and the connection relationship between the nodes identifies the relationship between the corresponding entity semantic labels; dividing the semantic label tree into at least one sub-label tree; wherein the nodes included in each sub-label tree correspond to an entity semantic label group, and each label group represents an intent; and splitting the target sentence based on the at least one sub-label tree to obtain at least one target clause corresponding to the at least one sub-label tree. In the foregoing manner, the target sentence can be accurately split into single-intent clauses.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a sentence processing method, apparatus, electronic device, and computer-readable storage medium. Background Technology

[0002] With the rapid development of artificial intelligence, people are increasingly demanding higher levels of intelligence in many application scenarios. To meet these demands, effective human-computer interaction is essential. For human-computer interaction, the key to whether a machine can correctly understand the user's meaning lies in its ability to accurately identify the intent of the dialogue text. Therefore, how to identify multiple user intents to improve the user's interactive experience has become a pressing issue that needs to be addressed.

[0003] Currently, mainstream multi-intent recognition technologies mainly obtain multi-intent recognition results by splitting a sentence into multiple single-intent clauses and then performing intent recognition on each clause. This primarily involves splitting the user-input sentence into multiple single-intent clauses based on punctuation marks or verbs. However, splitting sentences based on punctuation marks or verbs only addresses the surface-level information of the sentence, resulting in poor sentence splitting performance. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide a sentence processing method, apparatus, electronic device, and computer-readable storage medium that can accurately split a target sentence into clauses with a single intent.

[0005] To address the aforementioned technical problems, this application provides a sentence processing method comprising: constructing a semantic tag tree of a target sentence; wherein the semantic tag tree is formed by connecting several nodes, each node representing an entity semantic tag, and the connection relationship between nodes identifying the relationship between corresponding entity semantic tags; dividing the semantic tag tree into at least one sub-tag tree; wherein the entity semantic tags corresponding to the nodes contained in each sub-tag tree form a tag group, and each tag group represents an intent; and splitting the target sentence based on the at least one sub-tag tree to obtain at least one target clause corresponding to the at least one sub-tag tree.

[0006] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a sentence processing apparatus, which includes a construction module, a partitioning module, and a splitting module; the construction module is used to construct a semantic tag tree of the target sentence; wherein, the semantic tag tree is formed by connecting several nodes, each node representing an entity semantic tag, and the connection relationship between nodes identifies the relationship between corresponding entity semantic tags; the partitioning module is used to divide the semantic tag tree into at least one sub-tag tree; wherein, the entity semantic tags corresponding to the nodes contained in each sub-tag tree form a tag group, and each tag group represents an intent; the splitting module is used to split the target sentence based on at least one sub-tag tree to obtain at least one target clause corresponding to at least one sub-tag tree respectively.

[0007] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide an electronic device, which includes a memory and a processor. The memory stores program instructions, and the processor executes the program instructions to implement the above-mentioned sentence processing method.

[0008] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing program instructions that can be executed to implement the above-mentioned sentence processing method.

[0009] The above technical solution divides several entity semantic tags in the target statement into at least one tag group, and then divides the target based on the at least one tag group to obtain at least one target clause corresponding to each of the at least one tag group. Therefore, since the target clauses obtained by splitting the target statement based on tag groups correspond to a tag group, and each tag group represents an intent, splitting the target statement based on tag groups can accurately split the target statement into single-intent target clauses, improving the accuracy of statement splitting and reducing the occurrence of clauses that cannot express intent. Attached Figure Description

[0010] Figure 1 This is a flowchart illustrating an embodiment of the sentence processing method provided in this application;

[0011] Figure 2 This is a schematic diagram of an embodiment of the semantic tag tree provided in this application;

[0012] Figure 3 This is a schematic diagram of an embodiment of the semantic tag representation system provided in this application;

[0013] Figure 4 yes Figure 1 The flowchart of step S11 shown is a schematic diagram of one embodiment.

[0014] Figure 5 This is a schematic diagram of the structure of an embodiment of the analytical model provided in this application;

[0015] Figure 6 yes Figure 1 A flowchart illustrating another embodiment of step S12 is shown.

[0016] Figure 7 This is a schematic diagram of an embodiment of dividing a semantic tag tree into at least two sub-tag trees provided in this application;

[0017] Figure 8 This is a schematic diagram of another embodiment of the semantic tag tree provided in this application, which is divided into at least two sub-tag trees;

[0018] Figure 9 yes Figure 1 The flowchart of step S13 shown is a schematic diagram of one embodiment.

[0019] Figure 10 yes Figure 9 The flowchart of step S131 shown is a schematic diagram of one embodiment;

[0020] Figure 11 This is a schematic diagram of another embodiment of the semantic tag tree provided in this application, which is divided into at least two sub-tag trees;

[0021] Figure 12 This is a flowchart illustrating another embodiment of the sentence processing method provided in this application;

[0022] Figure 13 yes Figure 12 The flowchart shown is a schematic diagram of an embodiment of step S1204;

[0023] Figure 14 yes Figure 13 The flowchart shown is a schematic diagram of an embodiment of step S1302;

[0024] Figure 15 This is a schematic diagram of the structure of an embodiment of the sentence processing apparatus provided in this application;

[0025] Figure 16 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application;

[0026] Figure 17 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0027] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0028] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.

[0029] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.

[0030] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the sentence processing method provided in this application. It should be noted that if substantially the same result is obtained, this embodiment does not necessarily use the same method. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes:

[0031] Step S11: Construct the semantic tag tree of the target statement.

[0032] The method in this embodiment is used to split a target statement into multiple single-intent clauses. In one embodiment, the target statement can be any sentence that needs to be split, specifically obtained from local storage or cloud storage. It is understood that in other embodiments, the target statement can also be obtained through real-time speech acquisition using a voice acquisition device; this is not specifically limited here.

[0033] Due to the complexity of natural language, shallow semantic information cannot adequately represent the textual content of a sentence. Therefore, in this embodiment, by constructing a semantic tag tree for the target sentence, the relationships between key semantic segments in the target sentence can be determined. This allows for the conversion of flat tags into structured tags based on the semantic tag tree corresponding to the target sentence to disambiguate, thereby improving the semantic understanding of the target sentence and enabling accurate segmentation of the target sentence.

[0034] The semantic tag tree is formed by connecting several nodes, each node representing an entity's semantic tag. The connections between nodes identify the relationships between the corresponding entity semantic tags. For example, ... Figure 2 As shown, Figure 2This is a schematic diagram of an embodiment of the semantic tag tree provided in this application. The semantic tag tree includes a root node "I just received a text message saying my credit card is overdue". The semantic tag tree is formed by connecting nodes "consultation", "command", "text message", "credit card", and "overdue". Each of the nodes "consultation", "command", "text message", "credit card", and "overdue" represents an entity semantic tag. The connection relationship identifier "operation" between the root node "I just received a text message saying my credit card is overdue" and the node "consultation" corresponds to the relationship between the entity semantic tag "consultation" and the root node. The connection relationship identifier "attributive relationship" between "My credit card is overdue" and the node "SMS" corresponds to the relationship between the entity semantic label "SMS" and the root node; the connection relationship identifier "verb-object" between the node "Consultation" and the node "Credit Card" corresponds to the relationship between the entity semantic labels "Consultation" and "Credit Card"; the connection relationship identifier "sentence structure" between the node "Consultation" and the node "Command" corresponds to the relationship between the entity semantic labels "Consultation" and "Command"; and the connection relationship identifier "constraint" between the node "Credit Card" and the node "Overdue" corresponds to the relationship between the entity semantic labels "Credit Card" and "Overdue".

[0035] In one embodiment, the Zhu-Liu algorithm is used to process the relationships between several entity semantic tags in the target statement, resulting in a semantic tag tree corresponding to the relationships between these relationships. Specifically, the relation extraction module of the parsing model determines the relationships between several entity semantic tags in the target statement based on several relational semantic tags present in the target statement; then, a relation matrix is ​​generated based on these relationships, and the Zhu-Liu algorithm is used to process the relation matrix to obtain the semantic tag tree corresponding to the relationships between the target statement and the several entity semantic tags. It is understood that in other embodiments, the semantic tag tree of the target statement can also be constructed in other ways, and no specific limitations are made here.

[0036] Step S12: Divide the semantic tag tree into at least one sub-tag tree.

[0037] In this embodiment, the semantic tag tree is divided into at least one sub-tag tree. Each sub-tag tree contains nodes whose corresponding entity semantic tags form a tag group, and each tag group represents an intent. Since each tag group corresponding to a sub-tag tree represents an intent, subsequent segmentation of the target statement based on the tag groups of the sub-tag trees can accurately split the target statement into clauses with single intents, improving the accuracy of statement segmentation and reducing the occurrence of clauses that cannot express the user's intent.

[0038] In one specific implementation, such as Figure 3 As shown, Figure 3 This is a schematic diagram of an embodiment of the semantic tag representation system provided in this application. It sets up six types of entity semantic tags: business entity semantic tags, skill entity semantic tags, attribute entity semantic tags, constraint entity semantic tags, pathway entity semantic tags, and sentence structure entity semantic tags. Among them, business entity semantic tags can be understood as specific business objects within a domain; skill entity semantic tags can be understood as operation words related to business; attribute entity tags can be understood as attributes contained in business products; constraint entity semantic tags can be understood as skill restrictions (e.g., status, negation, etc.); pathway entity semantic tags can be understood as business processing channels or carriers; and sentence structure entity semantic tags can be understood as sentence categories. Meanwhile, as... Figure 3 As shown, six types of relational semantic tags are set: operation-type relational semantic tags, verb-object-type relational semantic tags, subject-predicate-type relational semantic tags, constraint-type relational semantic tags, attributive-type relational semantic tags, and path-type relational semantic tags. Among them, operation-type relational semantic tags can be understood as the relationship between virtual root nodes and skill-type nodes; verb-object-type relational semantic tags can be understood as the relationship between skill-type nodes and their operation objects; subject-predicate-type relational semantic tags can be understood as the relationship between bidirectional skill nodes and the initial operation object; constraint-type relational semantic tags can be understood as the constraint modification on operation-type nodes; attributive-type relational semantic tags can be understood as the attributive of the terminating node as the starting node; and path-type relational semantic tags can be understood as a certain channel or method.

[0039] Furthermore, such as Figure 3 As shown, there are 72 entity semantic tags under the business entity semantic tag, 147 entity semantic tags under the skill entity semantic tag, 38 entity semantic tags under the attribute entity semantic tag, 17 entity semantic tags under the constraint entity semantic tag, 8 entity semantic tags under the path entity semantic tag, and 8 entity semantic tags under the sentence structure entity semantic tag.

[0040] It should be noted that when the semantic tag tree can only be divided into one sub-tag tree, the entity semantic tags that constitute this semantic tag tree are all the entity semantic tags that exist in the target statement. That is, there is no division of the semantic tag tree constructed for the target statement, and several entity semantic tags that exist in the target statement are all classified into the same sub-tag tree. However, when the semantic tag tree can be divided into two or more sub-tag trees, the entity semantic tags corresponding to each sub-tag tree are some of the entity semantic tags that exist in the target statement.

[0041] Step S13: Split the target statement based on at least one sub-tag tree to obtain at least one target clause corresponding to at least one sub-tag tree.

[0042] In this embodiment, the target statement is split based on at least one sub-tag tree to obtain at least one target clause corresponding to each sub-tag tree. Since each target clause obtained by splitting the target statement based on a sub-tag tree corresponds to one sub-tag tree, and each sub-tag tree represents an intent, splitting the target statement based on sub-tag trees can accurately divide the target statement into clauses with single intents, improving the accuracy of statement splitting and reducing the occurrence of clauses that cannot express the intent. It should be noted that if only one sub-tag tree is obtained in the above steps, it indicates that the target statement is a single-intent statement, and there is no need to further split it into single-intent clauses; or, in other words, if only one sub-tag tree is obtained in the above steps, the target clause obtained by splitting the target statement based on this single sub-tag tree is the target statement itself.

[0043] In one embodiment, based on the extraction position of each sub-tag tree within the target statement, the target clause corresponding to each sub-tag tree is extracted from the target statement. This extracts single-intent clauses from the target statement, thus splitting the target statement into single-intent clauses and improving the accuracy of target statement splitting. Understandably, in other embodiments, the target statement can also be split based on other relevant information from each sub-tag tree; this is not specifically limited here.

[0044] In the above implementation, the semantic tag tree corresponding to the target statement is divided into at least one sub-tag tree, and the target statement is further divided based on the at least one sub-tag tree to obtain at least one target clause corresponding to each of the at least one sub-tag tree. Therefore, since the target clauses obtained by splitting the target statement based on the sub-tag tree correspond to one sub-tag tree, and each sub-tag tree represents an intent, splitting the target statement based on the sub-tag tree can accurately split the target statement into single-intent target clauses, improving the accuracy of statement splitting and reducing the occurrence of situations where the split clauses cannot express the intent.

[0045] Please see Figure 4 , Figure 4 yes Figure 1 The flowchart shown is a schematic diagram of one embodiment of step S11. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 4 The illustrated process sequence is limited. For example... Figure 4 As shown, in this embodiment, a semantic tag tree is constructed based on the relationships between several entity semantic tags existing in the target statement, specifically including:

[0046] Step S111: Obtain the feature representation of the target statement.

[0047] In this embodiment, the feature representation of the target statement is obtained. In one embodiment, such as... Figure 5 As shown, Figure 5 This is a schematic diagram of the structure of an embodiment of the parsing model provided in this application. The step of obtaining the feature representation of the target statement is performed using the encoding module of the parsing model. Specifically, the encoding module of the parsing model is used to obtain the feature representation of the target statement. The target statement is input into the encoding module of the parsing model, and the encoding module of the parsing model encodes the context representation of the target statement, thereby obtaining the feature representation of the target statement. It is understood that in other embodiments, feature extraction algorithms or the like can also be used to obtain the feature representation of the target statement, and no specific limitation is made here.

[0048] In one specific implementation, the encoding module of the parsing model can be a BERT (Bidirectional Encoder Representation from Transformers) model.

[0049] Step S112: Based on feature representation, extract several entity semantic tags and several relation semantic tags that exist in the target statement.

[0050] In this embodiment, based on feature representation, several entity semantic tags and several relational semantic tags existing in the target statement are extracted. In one embodiment, the step of extracting several entity semantic tags and several relational semantic tags existing in the target statement based on feature representation is performed using the semantic tag module of the parsing model; that is, the semantic tag module of the parsing model extracts several entity semantic tags and several relational semantic tags existing in the target statement based on feature representation. It is understood that in other embodiments, entity semantic tags and relational semantic tags can also be extracted from the target statement using semantic tag extraction algorithms, etc., and no specific limitation is made here.

[0051] In one specific implementation, such as Figure 5 As shown, the semantic labeling module of the parsing model specifically includes two sub-modules: an entity extractor and a concept extractor. The entity extractor extracts entity semantic labels from the target statement based on feature representations, while the concept extractor extracts relational semantic labels from the target statement based on feature representations. For example, as... Figure 5As shown, taking the semantic labeling module of the parsing model as an example, which extracts several entity semantic labels and several relational semantic labels from the target statement based on the feature representation, and the target statement is "Can I change the query password of my savings card?", the feature representation of the target statement is input into the semantic labeling module of the parsing model. The entity extractor, a sub-module of the semantic labeling module of the parsing model, extracts the entity semantic labels that exist in the target statement. The specific entity semantic labels are "savings card" and "query password". The concept extractor, a sub-module of the semantic labeling module of the parsing model, extracts the relational semantic labels that exist in the target statement. The specific relational semantic labels are "consult", "modify", and "process".

[0052] Step S113: Based on several relational semantic tags, determine the relationship between several entity semantic tags.

[0053] In this embodiment, the relationships between several entity semantic tags are determined based on several relational semantic tags. That is, the relationships between entity semantic tags can be determined based on the relational semantic tags extracted from the target statement.

[0054] In one implementation, such as Figure 5 As shown, determining the relationship between several entity semantic tags based on several relational semantic tags is performed using the relation extractor module of the parsing model. That is, the relation extractor module of the parsing model determines the relationship between several entity semantic tags based on several relational semantic tags. Understandably, in other embodiments, the relationship between several entity semantic tags can also be determined based on several relational semantic tags using relation determination algorithms or other methods, and no specific limitation is made here.

[0055] Step S114: Construct a semantic tag tree based on several entity semantic tags and the relationships between several entity semantic tags.

[0056] In this embodiment, a semantic tag tree is constructed based on several entity semantic tags and the relationships between them. In one embodiment, the Zhu-Liu algorithm is used to process the relationships between several entity semantic tags in the target statement to construct the semantic tag tree for the target statement. Specifically, the relation extraction module of the parsing model determines the relationships between several entity semantic tags in the target statement based on several relational semantic tags present in the target statement; then, a relation matrix is ​​generated based on the relationships between the several entity semantic tags in the target statement, and the Zhu-Liu algorithm is used to process the relation matrix to construct the semantic tag tree for the target statement. It is understood that in other embodiments, the semantic tag tree can also be constructed based on several entity semantic tags and the relationships between them using other methods.

[0057] Please see Figure 6 , Figure 6 yes Figure 1 The flowchart shown is a schematic diagram of one embodiment of step S12. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow the same pattern. Figure 6 The illustrated process sequence is limited. For example... Figure 6 As shown, in this embodiment, the splitting of the semantic tag tree specifically includes the following sub-steps:

[0058] Step S121: Detect whether the semantic tag tree meets the preset partitioning conditions.

[0059] In this embodiment, it is detected whether the semantic tag tree meets a preset partitioning condition. Specifically, if the semantic tag tree meets the preset partitioning condition, step S122 is executed. In one embodiment, the preset partitioning condition is that at least two skill-type nodes are connected to the root node of the semantic tag tree; wherein, a skill-type node indicates that the semantic tag corresponding to the node belongs to the skill category. It is understood that in other embodiments, the preset partitioning condition may also be that there is a skill-type node in the semantic tag tree that has a verb-object relationship with at least two other nodes, etc., and this is not specifically limited here.

[0060] In one embodiment, before generating the semantic tag tree corresponding to the target statement and checking whether the semantic tag tree meets the preset partitioning conditions, it is also necessary to check whether there are skill-type nodes in the semantic tag tree to determine whether the generated semantic tag tree corresponding to the target statement is an empty tree. An empty tree indicates that the corresponding target statement has no intent. At this time, a query message is sent to the user to inform the user in a timely manner that the current target statement is an invalid statement, thereby improving processing efficiency.

[0061] Step S122: In response to the semantic tag tree satisfying the preset partitioning conditions, the semantic tag tree is divided into at least two sub-tag trees.

[0062] In this embodiment, in response to the semantic tag tree satisfying the preset partitioning conditions, the semantic tag tree is divided into at least two sub-tag trees. Since the entity semantic tags corresponding to the nodes contained in each sub-tag tree constitute a tag group, when the semantic tag tree satisfies the preset partitioning conditions, the semantic tag tree is divided into at least two sub-tag trees, thereby obtaining at least two tag groups.

[0063] For example, such as Figure 7 As shown, Figure 7This is a schematic diagram of an embodiment of dividing a semantic tag tree into at least two sub-tag trees provided in this application. Taking the preset division condition that at least two skill-type nodes are connected to the root node of the semantic tag tree as an example; since the root node of the semantic tag tree, "Query my bank card balance and transaction details," is connected to the skill-type nodes "Activate" and "Set," the semantic tag tree satisfies the preset division condition, dividing the semantic tag tree into subtree 1 (i.e., sub-tag tree 1) and subtree 2 (i.e., sub-tag tree 2); the entity semantic tag "Activate" corresponding to the node "Activate," the entity semantic tag "Command" corresponding to the node "Command," and the entity semantic tag "Credit Card" corresponding to the node "Credit Card" in subtree 1 form a tag group; the entity semantic tag "Query" corresponding to the node "Set," the entity semantic tag "Transaction Password" corresponding to the node "Transaction Password," and the entity semantic tag "Command" corresponding to the node "Command" in subtree 2 form a tag group. For example, as... Figure 8 As shown, Figure 8 This is a schematic diagram of another embodiment of the semantic tag tree provided in this application, which divides the semantic tag tree into at least two sub-tag trees. Taking the preset division condition that there is a skill-type node in the semantic tag tree that has a verb-object relationship with at least two other nodes as an example; since the skill node "query" in the semantic tag tree has a verb-object relationship with the node "transaction details" and the node "balance" respectively, the semantic tag tree satisfies the preset division condition and divides the semantic tag tree into subtree 1 (i.e., sub-tag tree 1) and subtree 2 (sub-tag tree 2); the entity semantic tag "query" corresponding to the node "query" and the entity semantic tag "balance" corresponding to the node "balance" contained in subtree 1 form a tag group; the entity semantic tag "query" corresponding to the node "query", the entity semantic tag "transaction details" corresponding to the node "transaction details", the entity semantic tag "bank card" corresponding to the node "bank card" and the entity semantic tag "command" corresponding to the node "command" contained in subtree 2 form a tag group.

[0064] If the semantic tag tree does not meet the preset partitioning conditions, it means that the semantic tag tree cannot be divided into at least two sub-tag trees. In this case, based on the relationships between several entity semantic tags, a tag group is obtained. This tag group consists of all entity semantic tags present in the target statement. For example, such as Figure 2As shown, taking the preset partitioning condition of having at least two skill-type nodes connected to the root node of the semantic tag tree or having a skill-type node in the semantic tag tree that has a verb-object relationship with at least two other nodes as an example; since the root node of the semantic tag tree is only connected to one skill-type node, or since there is no skill-type node in the semantic tag tree that has a verb-object relationship with at least two other nodes, the semantic tag tree does not meet the preset partitioning condition. All the nodes contained in the semantic tag tree, namely the entity semantic tag "consultation" corresponding to the node "consultation", the entity semantic tag "credit card" corresponding to the node "credit card", the entity semantic tag "overdue" corresponding to the node "overdue", the entity semantic tag "command" corresponding to the node "command", and the entity semantic tag "sMS" corresponding to the node "SMS", form a unique tag group.

[0065] Please see Figure 9 , Figure 9 yes Figure 1 The diagram shows a flowchart of one embodiment of step S13. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily follow that approach. Figure 9 The illustrated process sequence is limited. For example... Figure 9 As shown, in this embodiment, based on the extraction position of each sub-tag tree in the target statement, the target clause corresponding to each sub-tag tree is extracted from the target statement, specifically including:

[0066] Step S131: For each sub-tag tree, determine the extraction position corresponding to the sub-tag tree based on the corresponding position of each entity semantic tag in the tag group of the sub-tag tree in the target statement.

[0067] In this embodiment, for each sub-tag tree, the extraction position corresponding to the tag group corresponding to the sub-tag tree is determined based on the corresponding position of each entity semantic tag in the tag group of the sub-tag tree in the target statement. The tag group corresponding to the sub-tag tree consists of several entity semantic tags, so the extraction position of the tag group corresponding to the sub-tag tree in the target statement can be determined according to the corresponding position of each entity semantic tag in the tag group in the target statement.

[0068] In one embodiment, entity semantic tags include start position information and length information in the target statement. Therefore, the extraction position of the tag group corresponding to the sub-tag tree in the target statement can be determined based on the start position information and length information of each entity semantic tag in the tag group within the target statement. For example, Figure 10 As shown, Figure 10 yes Figure 9 The flowchart shown in step S131 is a schematic diagram of an embodiment. Determining the extraction position of the tag group in the target statement based on the starting position information and length information of each entity semantic tag in the tag group corresponding to the sub-tag tree in the target statement specifically includes the following sub-steps:

[0069] Step S1311: For each entity semantic tag in the tag group corresponding to the sub-tag tree, determine the end position of the entity semantic tag in the target statement based on the start position and length of the entity semantic tag in the target statement.

[0070] In this embodiment, for each entity semantic tag in the tag group corresponding to the sub-tag tree, the end position of the entity semantic tag in the target statement is determined based on the start position and length of the entity semantic tag in the target statement. In other words, knowing the start position and length of the entity semantic tag in the target statement allows us to determine the end position of the entity semantic tag in the target statement; that is, the end position of the entity semantic tag in the target statement = the start position of the entity semantic tag in the target statement + the length of the entity semantic tag.

[0071] For example, such as Figure 11 As shown, Figure 11 This is a schematic diagram of another embodiment of the semantic tag tree provided in this application, which is divided into at least two sub-tag trees. The tag group corresponding to sub-tag tree 1 (i.e., subtree 1) includes the entity semantic tag "query" and the entity semantic tag "balance". The starting positions of the entity semantic tags "query" and "balance" in the target statement are [{'query':1,'balance':3}] and the lengths of the entity semantic tags "query" and "balance" are both 2. Therefore, the ending position of the entity semantic tag "query" in the target statement is 1+2=3, and the ending position of the entity semantic tag "balance" in the target statement is 3+2=5.

[0072] Step S1312: Based on the start and end positions of the semantic tags of each entity in the tag group corresponding to the sub-tag tree in the target statement, determine the start and end extraction positions of the tag group corresponding to the sub-tag tree in the target statement.

[0073] In this embodiment, the starting and ending extraction positions of the tag group corresponding to the sub-tag tree in the target statement are determined based on the starting and ending positions of the semantic tags of each entity in the tag group corresponding to the sub-tag tree in the target statement. In other words, knowing the starting and ending positions of the semantic tags of each entity in the tag group corresponding to the sub-tag tree in the target statement allows us to determine the starting and ending extraction positions of the tag group corresponding to the sub-tag tree in the target statement. Specifically, the smallest starting position in the tag group corresponding to the sub-tag tree is taken as the starting extraction position of the tag group corresponding to the sub-tag tree in the target statement, and the largest ending position in the tag group corresponding to the sub-tag tree is taken as the ending extraction position of the tag group corresponding to the sub-tag tree in the target statement.

[0074] For example, such as Figure 11As shown, the tag group corresponding to sub-tag tree 1 (i.e., subtree 1) contains the entity semantic tag "query" and the entity semantic tag "balance". The starting position of the entity semantic tags "query" and "balance" in the target statement is [{'query':1,'balance':3}] and the ending position of the entity semantic tags "query" and "balance" in the target statement is [{'query':3,'balance':5}]. Therefore, the starting extraction position of the tag group corresponding to sub-tag tree 1 in the target statement is 1, and the ending extraction position of the tag group corresponding to sub-tag tree 1 in the target statement is 5. The tag group corresponding to sub-tag tree 2 (i.e., subtree 2) contains the entity semantic tags "modify", "password", and "consultation_how". The starting positions of the entity semantic tags "modify", "password", and "consultation_how" in the target statement are [{'consultation_how':15, 'password':7, 'modify':17}] and the ending positions of the entity semantic tags "password" and "consultation_how" in the target statement are [{'consultation_how':17, 'password':9, 'modify':19}]. Therefore, the starting extraction position of the tag group corresponding to sub-tag tree 2 in the target statement is 7, and the ending extraction position of the tag group corresponding to sub-tag tree 2 in the target statement is 19.

[0075] Step S132: Based on the extraction position corresponding to each sub-tag tree, extract the target clause corresponding to each sub-tag tree from the target statement.

[0076] In this embodiment, the target clause corresponding to each sub-tag tree group is extracted from the target statement based on the extraction position corresponding to each sub-tag tree. Since each sub-tag tree represents an intent, the target clause corresponding to the sub-tag tree extracted from the target statement based on the extraction position corresponding to the sub-tag tree is a single intent clause, so as to achieve accurate splitting of the target statement and reduce the occurrence of splitting out clauses that cannot express the user's intent.

[0077] In one implementation, the extraction position corresponding to each sub-tag tree is the start and end extraction positions of each sub-tag tree in the target statement. Therefore, for each sub-tag tree, the content between the start and end extraction positions of the corresponding sub-tag tree in the target statement can be used as the target clause corresponding to the sub-tag tree. This allows the extraction of the target clause corresponding to each sub-tag tree from the target statement based on its extraction position. In other words, after determining the start and end extraction positions of the sub-tag tree in the target statement, the content between these positions is the single-intent target clause corresponding to that sub-tag tree in the target statement. Therefore, by using the content between the start and end extraction positions of the corresponding sub-tag tree in the target statement as the target clause corresponding to the sub-tag tree, the target clause corresponding to each sub-tag tree can be extracted from the target statement.

[0078] For example, such as Figure 11 As shown, the target statement is "How to change the password security level when querying the balance?". The tag group corresponding to sub-tag tree 1 (i.e., subtree 1) contains the entity semantic tags "query" and "balance". The starting extraction position of the tag group corresponding to sub-tag tree 1 in the target statement is 1, and the ending extraction position is 5. Therefore, the content "query balance" between the starting extraction position 1 and the ending extraction position 5 of sub-tag tree 1 in the target statement is taken as the target clause corresponding to the tag group of sub-tag tree 1. The tag group corresponding to sub-tag tree 2 (subtree 2) contains the entity semantic tags "modify", "password", and "consult_how". The starting extraction position of the tag group corresponding to sub-tag tree 2 in the target statement is 7, and the ending extraction position is 19. Therefore, the content "How to change the password security level when it is low" between the starting extraction position 7 and the ending extraction position 19 of sub-tag tree 2 in the target statement is taken as the target clause corresponding to the tag group of sub-tag tree 2.

[0079] Please see Figure 12 , Figure 12 This is a flowchart illustrating another embodiment of the sentence processing method provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that result. Figure 12 The illustrated process sequence is limited. For example... Figure 12 As shown, this embodiment includes:

[0080] Step S1201: Construct the semantic tag tree of the target statement.

[0081] Step S1201 is similar to step S11, and will not be described again here.

[0082] Step S1202: Divide the semantic tag tree into at least one sub-tag tree.

[0083] Step S1202 is similar to step S12, and will not be described again here.

[0084] Step S1203: Split the target statement based on at least one sub-tag tree to obtain at least one target clause corresponding to at least one sub-tag tree.

[0085] Step S1203 is similar to step S13, and will not be described again here.

[0086] Step S1204: For each target clause, determine the intent information of the target clause.

[0087] In this embodiment, the intent information of each target clause is determined, which facilitates the subsequent determination of the intent recognition result of the target statement based on the intent information of each target clause. This makes it easier to determine whether the target statement has multiple intents and the specific content of each intent of the target statement based on the intent information of each target clause, thereby improving the accuracy of intent recognition of the target statement.

[0088] In one implementation, such as Figure 13 As shown, Figure 13 yes Figure 12 The flowchart shown in step S1204 is a schematic diagram of an embodiment. Determining the intent information of the target clause specifically includes the following sub-steps:

[0089] Step S1301: Obtain the target semantic features of the target clause and the target tree features corresponding to the label group of the target clause.

[0090] In this embodiment, the target semantic features of the target clause and the target tree features corresponding to the tag group of the target clause are obtained, so as to improve the accuracy of subsequent intent recognition of the target clause based on the target semantic features and the target tree features. Specifically, the target tree features are obtained by encoding the sub-tag tree composed of the tag group corresponding to the target clause, where each node in the sub-tag tree corresponds to the semantic tags of each entity in the tag group.

[0091] In one embodiment, the target semantic features and target tree features are obtained using a semantic feature extraction model and a tree feature extraction model, respectively. That is, in the intent recognition of the target clause, both a semantic feature extraction model and a tree feature extraction model are used simultaneously. This not only effectively captures the contextual semantic information of the target clause but also addresses the error problem that the semantic feature extraction model is prone to in complex scenarios with negation, redundancy, or interference from other entity semantic labels, thereby improving the accuracy of intent recognition of the target clause. The specific network architecture of the semantic feature extraction model and the tree feature extraction model is not limited. In one specific embodiment, the semantic feature extraction model is the BERT model. The BERT model uses Transformer as a feature extractor, which can fully learn the contextual semantic information of the text. Understandably, in other embodiments, the target semantic features of the target clause and the target tree features corresponding to the label group of the target clause can also be extracted using feature extraction algorithms, etc., and no specific limitation is made here.

[0092] Considering that there may be redundant information in the sub-label tree corresponding to the target clause that interferes with subsequent intent judgment and affects the extraction of effective tree features from the label group corresponding to the target clause, in one embodiment, before obtaining the target tree features corresponding to the label group corresponding to the target clause, nodes that meet the redundancy condition in the sub-label tree corresponding to the target clause are removed. This ensures that the obtained target tree features are encoded from the sub-label tree after removing redundant nodes, thus guaranteeing the effectiveness of the target tree features and improving the accuracy of the intent information of the target clause subsequently identified based on the target tree features.

[0093] This does not impose restrictions on redundancy conditions; they can be set according to actual usage needs. For example, it could be connected to the root node of the semantic tag tree and have a verb-object relationship with the root node. For instance, such as... Figure 2 As shown, in the sub-label tree corresponding to the target clause "I just received a message saying my credit card is overdue", the node "SMS" is connected to the root node and there is a verb-object relationship between the node "SMS" and the root node. Therefore, the node "SMS" meets the redundancy condition. So, the redundant nodes in the sub-label tree are pruned to remove the redundant node "SMS". Then, the remaining sub-label tree is encoded to obtain the target tree feature corresponding to the target clause.

[0094] Understandably, in other implementations, only the target semantic features of the target clause or the target tree features corresponding to the tag group of the target clause may be obtained, so that the subsequent intent recognition of the target clause is based only on the target semantic features or the target tree features. No specific limitation is made here.

[0095] Step S1302: Based on the target semantic features and target tree features, obtain the intent information of the target clause.

[0096] In this embodiment, the intent information of the target clause is obtained based on target semantic features and target tree features. That is, intent recognition of the target clause is performed simultaneously based on both the target semantic features and target tree features to obtain the intent information of the target clause. Since target semantic features can reflect the contextual semantic information of the target clause, and target tree features are encoded after removing redundant information from the target clause (i.e., target tree features do not include redundant information that might interfere with intent recognition), intent recognition based on target semantic features and target tree features improves the accuracy of intent recognition for the target clause.

[0097] In one implementation, such as Figure 14 As shown, Figure 14 yes Figure 13 The flowchart shown in step S1302 is a schematic diagram of an embodiment. Obtaining the intent information of the target clause based on target semantic features and target tree features specifically includes the following sub-steps:

[0098] Step S1401: Obtain the preset semantic features and preset tree features of each preset sentence pattern.

[0099] In this embodiment, the preset semantic features and preset tree features of each preset sentence pattern in the sentence pattern library are obtained. In one embodiment, the preset semantic features and preset tree features of each preset sentence pattern are obtained using a semantic feature extraction model and a tree feature extraction model, respectively. It is understood that in other embodiments, the preset semantic features and preset tree features of each preset sentence pattern can also be extracted using feature extraction algorithms, etc., and no specific limitation is made here.

[0100] There are no restrictions on the number of preset sentence patterns in the sentence pattern library or the specific content of each preset sentence pattern; these can be set according to actual usage needs.

[0101] Step S1402: For each preset sentence pattern, obtain the semantic matching score between the target semantic feature and the preset semantic feature of the preset sentence pattern, and obtain the tree matching score between the target tree feature and the preset tree feature of the preset sentence pattern.

[0102] In this embodiment, for each preset sentence pattern, the semantic matching score between the target semantic feature and the preset semantic feature of the preset sentence pattern is obtained, and the tree matching score between the target tree feature and the preset tree feature of the preset sentence pattern is obtained.

[0103] In one embodiment, the feature similarity between the target semantic feature and the preset semantic features of the preset sentence structure is calculated, and the feature similarity is used as the semantic matching score between the target semantic feature and the preset semantic features of the preset sentence structure. The greater the feature similarity between the target semantic feature and the preset semantic features of the preset sentence structure, the more similar the target clause corresponding to the target semantic feature is to the preset sentence structure. In a specific embodiment, the feature similarity between the target semantic feature and the preset semantic features of the preset sentence structure can be the cosine distance between them. It is understood that in other specific embodiments, the feature similarity between the target semantic feature and the preset semantic features of the preset sentence structure can also be calculated in other ways. It is also understood that in other embodiments, the semantic matching score between the target semantic feature and the preset semantic features of the preset sentence structure can also be obtained in other ways.

[0104] In one embodiment, the feature similarity between the target tree features and the preset tree features of the preset sentence is calculated, and this feature similarity is used as the tree matching score between the target tree features and the preset tree features of the preset sentence. The greater the feature similarity between the target tree features and the preset tree features of the preset sentence, the more similar the target clause corresponding to the target tree features is to the preset sentence. In a specific embodiment, the feature similarity between the target tree features and the preset tree features of the preset sentence can be the cosine distance between them. It is understood that in other specific embodiments, the feature similarity between the target tree features and the preset tree features of the preset sentence can also be calculated in other ways. It is also understood that in other embodiments, the tree matching score between the target tree features and the preset tree features of the preset sentence can also be obtained in other ways.

[0105] Step S1403: Based on the semantic matching score and tree matching score of each preset sentence pattern, obtain the target matching score of each preset sentence pattern.

[0106] In this embodiment, the target matching score for each preset sentence pattern is obtained based on its semantic matching score and tree matching score. In one embodiment, for each preset sentence pattern, the semantic matching score and tree matching score are weighted and summed to obtain the target matching score. The weights corresponding to the semantic matching score and tree matching score of the preset sentence pattern are not limited and can be set according to actual usage needs. It is understood that in other embodiments, the semantic matching score and tree matching score of each preset sentence pattern can also be averaged to obtain the target matching score; this is not specifically limited here.

[0107] Step S1404: Determine the intent information of the target clause based on the intent corresponding to the preset sentence pattern that meets the matching requirements according to the target matching score.

[0108] In this embodiment, the intent information of the target clause is determined based on the intent corresponding to a preset sentence pattern whose target matching score meets the matching requirements. Specifically, the intent corresponding to the preset sentence pattern whose target matching score meets the matching requirements is taken as the intent of the target clause, thereby determining the intent information of the target clause.

[0109] It should be noted that for each target clause obtained from the target statement, steps S1301-S1302 and steps S1401-S1404 need to be executed respectively.

[0110] Step S1205: Based on the intent information of each target clause, obtain the intent recognition result of the target statement.

[0111] In this embodiment, the intent recognition result of the target statement is obtained based on the intent information of each target clause. That is, after determining the intent information of each target clause, the individual intent information of the target statement can be determined. Since the above steps can accurately break down the target statement into single-intent target clauses, the intent recognition result of the target statement determined based on the intent information of each target clause will be more accurate.

[0112] For example, let's take a target statement as being split into target clause A, target clause B, and target clause C. It is determined that the intent information of target clause A is α, the intent information of target clause B is α, and the intent information of target clause C is β. Therefore, the target statement is determined to be a sentence with two intents, and the intent information of the target statement is α and β respectively.

[0113] Please see Figure 15 , Figure 15 This is a schematic diagram of an embodiment of the sentence processing apparatus provided in this application. The sentence processing apparatus 150 includes a construction module 1501, a partitioning module 1502, and a splitting module 1503. The construction module 1501 is used to construct a semantic tag tree of the target sentence; wherein, the semantic tag tree is formed by connecting several nodes, each node represents an entity semantic tag, and the connection relationship between nodes identifies the relationship between corresponding entity semantic tags; the partitioning module 1502 is used to partition the semantic tag tree into at least one sub-tag tree; wherein, the entity semantic tags corresponding to the nodes contained in each sub-tag tree form a tag group, and each tag group represents an intent; the splitting module 1503 is used to split the target sentence based on at least one sub-tag tree to obtain at least one target clause corresponding to at least one sub-tag tree.

[0114] The construction module 1501 is used to construct the semantic tag tree of the target statement, specifically including: obtaining the feature representation of the target statement; extracting several entity semantic tags and several relational semantic tags existing in the target statement based on the feature representation; determining the relationship between several entity semantic tags based on several relational semantic tags; and constructing the semantic tag tree based on several entity semantic tags and the relationship between several entity semantic tags.

[0115] The steps described above for obtaining the feature representation of the target statement are performed using the encoding module of the parsing model; the steps described above for extracting several entity semantic tags and several relational semantic tags existing in the target statement based on the feature representation are performed using the semantic tag module of the parsing model; and the steps described above for determining the relationship between several entity semantic tags based on several relational semantic tags are performed using the relation extraction module of the parsing model.

[0116] The segmentation module 1502 is used to divide the semantic tag tree into at least one sub-tag tree, specifically including: detecting whether the semantic tag tree meets a preset segmentation condition; and, in response to the semantic tag tree meeting the preset segmentation condition, dividing the semantic tag tree into at least two sub-tag trees. The preset segmentation condition is one of the following: at least two skill-type nodes are connected to the root node of the semantic tag tree; wherein a skill-type node indicates that the semantic tag corresponding to the node belongs to the skill category; and there exists a skill-type node in the semantic tag tree that has a verb-object relationship with at least two other nodes.

[0117] The splitting module 1503 is used to split the target statement based on at least one sub-tag tree to obtain at least one target clause corresponding to at least one sub-tag tree. Specifically, it includes: for each sub-tag tree, determining the extraction position corresponding to the sub-tag tree based on the corresponding position of each entity semantic tag in the tag group corresponding to the sub-tag tree in the target statement; and extracting the target clause corresponding to each sub-tag tree from the target statement based on the extraction position corresponding to each sub-tag tree.

[0118] The splitting module 1503 is used to determine the extraction position corresponding to the tag group of the sub-tag tree based on the corresponding position of each entity semantic tag in the tag group of the sub-tag tree in the target statement. Specifically, it includes: for each entity semantic tag in the tag group of the sub-tag tree, determining the end position of the entity semantic tag in the target statement based on the start position and length of the entity semantic tag in the target statement; and determining the start extraction position and end extraction position of the sub-tag tree in the target statement based on the start and end positions of each entity semantic tag in the tag group of the sub-tag tree. The splitting module 1503 is used to extract the target clause corresponding to each sub-tag tree from the target statement based on the extraction position corresponding to each sub-tag tree. Specifically, it includes: for each sub-tag tree, taking the content between the start extraction position and the end extraction position of the corresponding sub-tag tree in the target statement as the target clause corresponding to the sub-tag tree.

[0119] The sentence processing device 150 further includes an identification module 1504, which is used to split the target sentence based on at least one sub-label tree to obtain at least one target clause corresponding to at least one sub-label tree. Specifically, the identification module 1504 includes: determining the intent information of each target clause; and obtaining the intent recognition result of the target sentence based on the intent information of each target clause.

[0120] The identification module 1504 is used to determine the intent information of the target clause, specifically including: obtaining the target semantic features of the target clause and obtaining the target tree features corresponding to the tag group of the target clause; wherein, the target tree features are obtained by encoding the sub-tag tree composed of the tag group corresponding to the target clause, and each node in the sub-tag tree corresponds to the semantic tags of each entity in the tag group; based on the target semantic features and the target tree features, the intent information of the target clause is obtained.

[0121] The target semantic features and target tree features are obtained using a semantic feature extraction model and a tree feature extraction model, respectively. The sentence processing device 150 further includes a removal module 1505, which, before obtaining the target tree features corresponding to the tag group corresponding to the target clause, specifically removes nodes in the sub-tag tree corresponding to the target clause that meet the redundancy condition. The identification module 1504 obtains the intent information of the target clause based on the target semantic features and target tree features, specifically by: obtaining the preset semantic features and preset tree features of each preset sentence pattern; for each preset sentence pattern, obtaining the semantic matching score between the target semantic features and the preset semantic features of the preset sentence pattern, and obtaining the tree matching score between the target tree features and the preset tree features of the preset sentence pattern; obtaining the target matching score of each preset sentence pattern based on the semantic matching score and the tree matching score; and determining the intent information of the target clause based on the intent corresponding to the preset sentence pattern whose target matching score meets the matching requirements.

[0122] Please see Figure 16 , Figure 16 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device 160 includes a memory 1601 and a processor 1602 coupled to each other. The processor 1602 is used to execute program instructions stored in the memory 1601 to implement the steps of any of the above-described sentence processing method embodiments. In a specific implementation scenario, the electronic device 160 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 160 may also include mobile devices such as laptops and tablets, which are not limited here.

[0123] Specifically, processor 1602 controls itself and memory 1601 to implement the steps of any of the above-described sentence processing method embodiments. Processor 1602 can also be referred to as a CPU (Central Processing Unit). Processor 1602 may be an integrated circuit chip with signal processing capabilities. Processor 1602 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 1602 can be implemented using integrated circuit chips.

[0124] Please see Figure 17, Figure 17 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. The computer-readable storage medium 170 of this application embodiment stores program instructions 1701. When executed, the program instructions 1701 implement the methods provided by any embodiment of the sentence processing method of this application and any non-conflicting combination thereof. The program instructions 1701 can form a program file and be stored in the aforementioned computer-readable storage medium 170 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) executes all or part of the steps of the methods of various embodiments of this application. The aforementioned computer-readable storage medium 170 includes various media capable of storing program code, such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or terminal devices such as computers, servers, mobile phones, and tablets.

[0125] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0126] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A sentence processing method, characterized in that, The method includes: Construct a semantic tag tree for the target statement; wherein the semantic tag tree is formed by connecting several nodes, each node represents an entity semantic tag, and the connection relationship between the nodes identifies the relationship between the corresponding entity semantic tags; The semantic tag tree is divided into at least one sub-tag tree; wherein, the entity semantic tags corresponding to the nodes contained in each sub-tag tree form a group of tag groups, and each tag group represents an intent; The target statement is split based on the at least one sub-tag tree to obtain at least one target clause corresponding to the at least one sub-tag tree; The step of splitting the target statement based on the at least one sub-tag tree to obtain at least one target clause corresponding to each of the at least one sub-tag trees includes: For each sub-tag tree, the extraction position corresponding to the sub-tag tree is determined based on the corresponding position of each entity semantic tag in the tag group corresponding to the sub-tag tree in the target statement; Based on the extraction position corresponding to each of the sub-tag trees, the target clause corresponding to each of the sub-tag trees is extracted from the target statement.

2. The method according to claim 1, characterized in that, The construction of the semantic tag tree for the target statement includes: Obtain the feature representation of the target statement; Based on the feature representation, extract several entity semantic tags and several relation semantic tags that exist in the target statement; Based on the aforementioned relational semantic tags, determine the relationships between the aforementioned entity semantic tags; The semantic tag tree is constructed based on the semantic tags of the entities and the relationships between them.

3. The method according to claim 2, characterized in that, The step of obtaining the feature representation of the target statement is performed using the encoding module of the parsing model; the step of extracting several entity semantic tags and several relation semantic tags existing in the target statement based on the feature representation is performed using the semantic tag module of the parsing model; the step of determining the relationship between the several entity semantic tags based on the several relation semantic tags is performed using the relation extraction module of the parsing model.

4. The method according to claim 1, characterized in that, The step of dividing the semantic tag tree into at least one sub-tag tree includes: Detect whether the semantic tag tree meets the preset partitioning conditions; In response to the semantic tag tree satisfying the preset partitioning condition, the semantic tag tree is divided into at least two sub-tag trees.

5. The method according to claim 4, characterized in that, The preset division condition is one of the following: At least two skill-class nodes are connected to the root node of the semantic tag tree; wherein, the skill-class nodes indicate that the semantic tag of the entity corresponding to the node belongs to the skill class; In the semantic tag tree, there exists a skill-type node that has a verb-object relationship with at least two other nodes.

6. The method according to claim 1, characterized in that, The step of determining the extraction position corresponding to the sub-tag tree based on the corresponding position of each entity semantic tag in the tag group of the sub-tag tree in the target statement includes: For each entity semantic tag in the tag group corresponding to the sub-tag tree, the end position of the entity semantic tag in the target statement is determined based on the start position of the entity semantic tag in the target statement and the length of the entity semantic tag; Based on the start and end positions of the entity semantic tags in the tag group corresponding to the sub-tag tree in the target statement, the start extraction position and end extraction position of the sub-tag tree in the target statement are determined. The step of extracting the target clause corresponding to each sub-tag tree from the target statement based on the extraction position corresponding to each sub-tag tree includes: For each of the sub-tag trees, the content between the start extraction position and the end extraction position of the target statement corresponding to the sub-tag tree is taken as the target clause of the sub-tag tree.

7. The method according to claim 1, characterized in that, After splitting the target statement based on the at least one sub-tag tree to obtain at least one target clause corresponding to each of the at least one sub-tag trees, the method further includes: For each of the target clauses, determine the intent information of the target clause; Based on the intent information of each target clause, the intent recognition result of the target statement is obtained.

8. The method according to claim 7, characterized in that, The determination of the intent information for the target clause includes: Obtain the target semantic features of the target clause and the target tree features corresponding to the tag group of the target clause; wherein, the target tree features are obtained by encoding the sub-tag tree composed of the tag group corresponding to the target clause, and each node in the sub-tag tree corresponds to each entity semantic tag in the tag group; Based on the target semantic features and the target tree features, the intent information of the target clause is obtained.

9. The method according to claim 8, characterized in that, The target semantic features and the target tree features are obtained by using a semantic feature extraction model and a tree feature extraction model, respectively. And / or, before obtaining the target tree features corresponding to the label group corresponding to the target clause, the method further includes: Remove nodes that meet the redundancy condition from the sub-tag tree corresponding to the target clause; And / or, obtaining the intent information of the target clause based on the target semantic features and the target tree features includes: Obtain the preset semantic features and preset tree features for each preset sentence pattern; For each preset sentence pattern, obtain the semantic matching score between the target semantic feature and the preset semantic feature of the preset sentence pattern, and obtain the tree matching score between the target tree feature and the preset tree feature of the preset sentence pattern; Based on the semantic matching score and tree matching score of each preset sentence pattern, the target matching score of each preset sentence pattern is obtained; Based on the intent corresponding to the preset sentence pattern that meets the matching requirements according to the target matching score, the intent information of the target clause is determined.

10. A sentence processing device, characterized in that, The device includes: A construction module is used to construct a semantic tag tree for the target statement; wherein, the semantic tag tree is formed by connecting several nodes, each node represents an entity semantic tag, and the connection relationship between the nodes identifies the relationship between the corresponding entity semantic tags; A segmentation module is used to divide the semantic tag tree into at least one sub-tag tree; wherein the entity semantic tags corresponding to the nodes contained in each sub-tag tree form a group of tag groups, and each tag group represents an intent; The splitting module is used to split the target statement based on the at least one sub-tag tree to obtain at least one target clause corresponding to the at least one sub-tag tree respectively; The step of splitting the target statement based on the at least one sub-tag tree to obtain at least one target clause corresponding to each of the at least one sub-tag trees includes: For each sub-tag tree, the extraction position corresponding to the sub-tag tree is determined based on the corresponding position of each entity semantic tag in the tag group corresponding to the sub-tag tree in the target statement; Based on the extraction position corresponding to each of the sub-tag trees, the target clause corresponding to each of the sub-tag trees is extracted from the target statement.

11. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing program instructions, and the processor executing the program instructions to implement the sentence processing method as described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions that can be executed to implement the sentence processing method as described in any one of claims 1-9.