Data processing method and related device

Through multi-layer matrix processing and deep learning model decoding technology, the problem of dictionary size limitation and slot nesting in natural language processing is solved, and the accuracy and user experience of slot text extraction are improved.

CN118690740APending Publication Date: 2024-09-24SHENZHEN HEYTAP TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310305803.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-21
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

When existing natural language processing technology identifies user intentions, it is limited by the size of the dictionary, and the extracted word slot information is not accurate enough and cannot effectively solve the problem of slot nesting, resulting in poor user experience.

Method used

By obtaining the intended text, multi-layer matrix processing is performed to extract dictionary features and sentence features, combined with a two-way long short-term memory network and a global pointer network, and decoding processing is performed to extract the target slot text, thereby improving the accuracy of slot text extraction.

Benefits of technology

The accuracy of extracting slot text is greatly improved, the problem of slot nesting is solved, and the user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690740A
    Figure CN118690740A
Patent Text Reader

Abstract

The invention provides a data processing method and a related device.Firstly, an intention text is obtained, the intention text comprises a text corresponding to a target word slot group, the target word slot group comprises at least one target word slot, and each target word slot corresponds to at least one slot position text; performing first processing on the intention text to obtain a first matrix; performing second processing on the intention text to obtain a second matrix; performing third processing on the intention text to obtain a third matrix; obtaining a fourth matrix according to the first matrix, the second matrix and the third matrix; the fourth matrix is input into a first model, a target matrix is obtained according to output of the first model, and the target matrix is used for indicating features of a target slot position text corresponding to each target word slot; and decoding the target matrix to obtain each target slot position text corresponding to each target word slot. The slot text extraction accuracy and the user experience can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing, and in particular to a data processing method and related devices. Background Art

[0002] With the development of technology, the field of natural language processing has become more and more intelligent. Identifying user intentions based on user input requires extracting key information of the user input. Generally speaking, identifying any intention requires necessary word slot information. Current solutions generally use dictionary matching and other methods to determine the word slot information, but due to the limitation of the dictionary size, the extracted word slot information is often not accurate enough. Summary of the invention

[0003] In view of this, the present application provides a data processing method and related devices, which can extract dictionary features and sentence features for intended text, and extract more accurate target slot text for the target slot, greatly improving the extraction accuracy and user experience.

[0004] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:

[0005] Acquire an intended text, wherein the intended text includes text corresponding to a target word slot group, wherein the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text;

[0006] Performing a first process on the intended text to obtain a first matrix, where the first matrix is ​​used to indicate features of the intended text;

[0007] Performing a second process on the intended text to obtain a second matrix, where the second matrix is ​​used to indicate features of each slot text corresponding to each target word slot;

[0008] Performing a third processing on the intended text to obtain a third matrix, where the third matrix is ​​used to indicate features of entity state information of the intended text;

[0009] Obtain a fourth matrix according to the first matrix, the second matrix and the third matrix;

[0010] Inputting the fourth matrix into the first model, obtaining a target matrix according to the output of the first model, wherein the target matrix is ​​used to indicate the features of the target slot text corresponding to each target word slot;

[0011] The target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot.

[0012] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0013] An acquisition unit, configured to acquire an intended text, wherein the intended text includes text corresponding to a target word slot group, wherein the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text;

[0014] A first processing unit, configured to perform a first processing on the intended text to obtain a first matrix, wherein the first matrix is ​​used to indicate a feature of the intended text;

[0015] A second processing unit performs a second processing on the intended text to obtain a second matrix, where the second matrix is ​​used to indicate a feature of each slot text corresponding to each target word slot;

[0016] A third processing unit, configured to perform a third processing on the intended text to obtain a third matrix, wherein the third matrix is ​​used to indicate features of entity state information of the intended text;

[0017] a fourth processing unit, configured to obtain a fourth matrix according to the first matrix, the second matrix and the third matrix; a determination unit, configured to input the fourth matrix into the first model, and obtain a target matrix according to the output of the first model, wherein the target matrix is ​​used to indicate the features of the target slot text corresponding to each target word slot;

[0018] A decoding unit is used to decode the target matrix to obtain each target slot text corresponding to each target word slot.

[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps of any method in the first aspect of the embodiment of the present application.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps described in any method of the first aspect of the embodiment of the present application.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product may be a software installation package.

[0022] It can be seen that through the above data processing method and related devices, first, the intended text is obtained, the intended text includes text corresponding to the target word slot group, the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text; the intended text is first processed to obtain a first matrix, the first matrix is ​​used to indicate the characteristics of the intended text; the intended text is second processed to obtain a second matrix, the second matrix is ​​used to indicate the characteristics of each slot text corresponding to each target word slot; the intended text is third processed to obtain a third matrix, the third matrix is ​​used to indicate the characteristics of the entity state information of the intended text; a fourth matrix is ​​obtained according to the first matrix, the second matrix and the third matrix; the fourth matrix is ​​input into the first model, and the target matrix is ​​obtained according to the output of the first model, the target matrix is ​​used to indicate the characteristics of the target slot text corresponding to each target word slot; the target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot. The extraction accuracy of the slot text and the user experience can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0024] Figure 1 A flowchart of a data processing method provided in an embodiment of the present application;

[0025] Figure 2 A flowchart of another data processing method provided in an embodiment of the present application;

[0026] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0027] Figure 4 A block diagram of the functional units of a data processing device provided in an embodiment of the present application;

[0028] Figure 5 A block diagram of the functional units of another data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0030] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0031] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article indicates that the associated objects before and after are in an "or" relationship. The "plurality" appearing in the embodiments of the present application refers to two or more.

[0032] In the embodiments of the present application, "at least one item" or similar expressions refer to any combination of these items, including any combination of single items or plural items, and refer to one or more, and multiple refers to two or more. For example, at least one item of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.

[0033] The "connection" that appears in the embodiments of the present application refers to various connection methods such as direct connection or indirect connection to achieve communication between devices, and the embodiments of the present application do not impose any limitations on this.

[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0035] The following is an explanation of the relevant contents, concepts, meanings, technical issues, technical solutions, beneficial effects, etc. involved in the embodiments of the present application.

[0036] Intent: refers to a task that an electronic device needs to complete, and this task has necessary conditions that include multiple situations.

[0037] Slot: refers to the necessary conditions for completing a task.

[0038] Slot text: refers to various situations in the required conditions.

[0039] For example, if you want to complete the task of playing a song, you must have the condition of the song name. In order to meet different needs, a lot of song name information is needed. Playing a song is the intention, the song name is the word slot, and a lot of song name information is the slot text.

[0040] Dictionary: It can be understood as a collection of words in a certain field. "Rain", "typhoon", and "sunny" all belong to the "weather" dictionary.

[0041] Currently, when a dictionary is used to extract slot text, it is generally through text matching. That is, if the dictionary corresponding to the target word slot contains the same text as the intended text, the text will be extracted as the slot text of the target word slot. For example, the intended text is "I want to listen to song A". In this case, the intention is the song, and the required target word slot is "song name". If the word "A song" exists in the song dictionary, then "A song" can be extracted as the slot text of the "song name" slot. However, in some cases, the word "A song" may not exist in the song dictionary. At this time, the corresponding slot text cannot be accurately extracted, resulting in the inability to execute the user's intention and a poor user experience.

[0042] Moreover, the current solution cannot solve the problem of slot nesting. The so-called slot nesting means that there are multiple slot texts in a word slot or a slot text belongs to multiple word slots at the same time. For example, the text is "Play Summer in a Small Town". There are three word slots at this time, namely, the "singer" word slot, the "song" word slot and the "album" word slot. The slot text of the "singer" word slot extracted from the "singer" dictionary is "small town", the slot text of the "song" word slot extracted from the "song" dictionary is "small town" and "summer", and the slot text of the "album" word slot extracted from the "album" dictionary is "summer". However, the user's intention is to play the song "Summer in a Small Town". Since the word "Summer in a Small Town" does not exist in the dictionary library, the accurate text cannot be extracted, resulting in the inability to execute the accurate user intention and poor user experience.

[0043] To solve the above problems, the embodiments of the present application provide a data processing method and related devices, which can extract more detailed features of the intended text for slot text extraction, which can greatly improve the accuracy of slot text extraction and thus improve the user experience.

[0044] Combine the following Figure 1 A data processing method in an embodiment of the present application is described. Figure 1 A flowchart of a data processing method provided in an embodiment of the present application specifically includes the following steps:

[0045] Step 101, obtaining the intended text.

[0046] Among them, the intended text includes the text corresponding to the target word slot group, the target word slot group includes at least one target word slot, each target word slot corresponds to at least one slot text, and the slot text can be a subset of the intended text. It can be understood that the intended text can be obtained by recognizing audio, pictures, text, video and other content input by the user, and no specific limitation is made here.

[0047] It can be understood that the target word slots are the word slots necessary to realize the intent of the intent text. For example, if the intent text is "play song B by singer A", the target word slots at this time are the "singer" word slot and the "song" word slot. If the intent text is "check today's weather", the target word slots can be the "time" word slot and the "weather" word slot. Identifying the target word slots of the intent text can be accomplished through semantic recognition technology, which will not be elaborated here.

[0048] Step 102: Perform a first process on the intended text to obtain a first matrix.

[0049] The first matrix is ​​used to indicate the characteristics of the intended text. The intended text can be converted into a word vector to obtain a first matrix, and the dimension of the first matrix is ​​the product of the number of words in the intended text and a first preset value.

[0050] In a possible embodiment, if the number of words in the intended text is 25, a matrix with a dimension of 25×768 can be obtained by word vector transformation.

[0051] It can be seen that by performing the first processing on the intended text to obtain the first matrix, more sentence features can be provided for subsequent features, so that the target slot text corresponding to each target word slot extracted subsequently is more accurate.

[0052] Step 103: Perform a second process on the intended text to obtain a second matrix.

[0053] The second matrix is ​​used to indicate the features of each slot text corresponding to each target word slot.

[0054] Among them, the target word slot information in the intended text can be determined, the target word slot information includes the target word slot number and the preset dictionary corresponding to each target word slot, and the following steps are performed for each target word slot to obtain the second matrix, and the dimension of the second matrix is ​​the product of the number of words in the intended text and the target word slot number:

[0055] S1, constructing a first vector sequence whose initial value is all 0, and the length of the first vector sequence is the number of words in the intended text.

[0056] S2, determining each slot text corresponding to the target word slot and the starting position and the ending position of each slot text according to the preset dictionary corresponding to the target word slot.

[0057] S3: adjusting the first vector sequence to a second vector sequence according to the starting position and the ending position of each slot text, and assigning a value of 1 to a portion of the slot text in the second vector sequence.

[0058] For example, assuming that the number of words in the intended text is 25, and the target slots are the "singer" slot, the "song" slot, and the "album" slot, the dimension of the final second matrix should be 25×3, that is, it is composed of a 25×1 vector sequence corresponding to the "singer" slot, a 25×1 vector sequence corresponding to the "song" slot, and a 25×1 vector sequence corresponding to the "album" slot. For ease of understanding, the following is an explanation of the determination of the vector sequence corresponding to the "singer" slot:

[0059] First, we can construct a vector sequence of 25 values ​​corresponding to the "singer" slot, all of which are 0. From the "singer" dictionary, we can determine that the slot text of "singer" in the intent text is "www". "www" consists of three characters. The position of the first w corresponds to the starting position in the intent text, and the position of the last w corresponds to the ending position in the intent text. At this time, assuming that we can determine that "www" is between the first character (including the first character) and the fourth character (excluding the fourth character), then we can assign 1 to the first to fourth values ​​in the vector sequence, and keep the value 0 for the rest.

[0060] Furthermore, the second matrix can be determined by the following formula:

[0061]

[0062] Among them, δ i,jrepresents the second matrix, i represents the position of each word in the intended text, j represents the number of target word slots, and the formula can be applied to each target word slot. Text represents the text position, w represents the slot text, and length(w) represents the number of words in the slot text. It can be seen that only when the content between the starting position and the ending position of the word in the intended text is equal to the slot text, it will be assigned a value of 1, and the rest will be assigned a value of 0. For example, the intended text is "I want to listen to Thousands of Miles Away", and it can be determined that the slot text corresponding to the "Song" slot is "Thousands of Miles Away", and its number of words is 4. Then the position of "Thousands of Miles Away" in the text starts from the fourth word and ends at the seventh word. Through this formula, it can be determined that when i is equal to 4, "Thousands of Miles Away" is included between the fourth and eighth words, and the fourth to seventh values ​​in the vector sequence can be assigned a value of 1, and the rest can be assigned a value of 0.

[0063] It can be seen that by performing the second processing on the intended text to obtain the second matrix, accurate dictionary features can be extracted, providing reliable support for subsequent data processing.

[0064] Step 104: Perform a third process on the intended text to obtain a third matrix.

[0065] Among them, the third matrix is ​​used to indicate the characteristics of the entity state information of the intended text, and a third vector sequence with an initial value of all 0s can be constructed, and the length of the third vector sequence is the number of words in the intended text; if the set of each slot text corresponding to each target word slot is equal to the intended text, the third vector sequence is adjusted to a fourth vector sequence to obtain the third matrix, and each value in the third matrix is ​​assigned 1; if the set of each slot text corresponding to each target word slot is not equal to the intended text, the third vector sequence is maintained to obtain the third matrix.

[0066] It can be understood that the third matrix is ​​used to determine whether the intended text is a pure entity. The entity status information may include a pure entity or a non-pure entity. The so-called pure entity is that the set of slot texts is equal to the intended text. For example, when the intended text is "thousands of miles away", it is a pure entity, because at this time the slot text corresponding to the "song" slot is "thousands of miles away", and the slot text corresponding to the "album" slot is also "thousands of miles away". When the intended text has no other content except the slot text, the intended text is a pure entity. It can be seen that when the intended text is a pure entity, the value of the third matrix is ​​all 1, and when the intended text is a non-pure entity, the value of the third matrix is ​​all 0.

[0067] It can be seen that performing the third processing on the intended text to obtain the third matrix can extract more sentence features and improve the accuracy of the target slot text extracted subsequently.

[0068] Step 105: Obtain a fourth matrix according to the first matrix, the second matrix and the third matrix.

[0069] Among them, the first matrix, the second matrix and the third matrix can be spliced ​​to obtain the fourth matrix, the dimension of the fourth matrix is ​​the product of the number of words in the intended text and a second preset value, and the second preset value is the sum of the first preset value and the target word slot number plus one.

[0070] For example, the first matrix is ​​a matrix with a dimension of 25×768, the second matrix is ​​a matrix with a dimension of 25×3, the third matrix is ​​a matrix with a dimension of 25×1, and the fourth matrix is ​​a matrix with a dimension of 25×772.

[0071] It can be seen that the fourth matrix can include dictionary features and sentence features, providing richer information to facilitate the subsequent extraction of the target slot text and improve the accuracy of the subsequently extracted target slot text.

[0072] Step 106: input the fourth matrix into the first model, and obtain the target matrix according to the output of the first model.

[0073] Among them, the first model can include a bidirectional long short-term memory network and a global pointer network.

[0074] Specifically, the vector sequence [h 1 ,h 2 ,…,h n ], two feature matrices with dimensions of n×n are obtained by copying and rotating through the global pointer network, and then the two feature matrices are multiplied by the multiplicative attention scoring mechanism to obtain the final feature matrix, and finally the target matrix with dimensions of N×25×25 is obtained through the fully connected layer, where N represents the number of target slots, such as N=3, and it can be understood that 25 is the number of words in the intended text.

[0075] The first model is a model trained with positive and negative training sets, and the first model may have at least one of the following characteristics:

[0076] In a possible embodiment, when the slot texts included in any target word slot are connected, the two slot texts can be merged. For example, if the intended text is "play small town summer", if the "song" word slot includes "small town" and "summer", they can be directly merged into the "song" word slot, and the target slot text of the "song" word slot is "small town summer". It can be seen that in this way, the accurate target slot text can be accurately extracted even when "small town summer" is not included in the dictionary, which greatly improves the user experience.

[0077] In a possible embodiment, when the slot texts included in any two target word slots are the same, the first model can output two identical target slot texts. For example, the intended text is "play Qilixiang". If the slot text of the "song" word slot is "Qilixiang" and the slot text of the "album" slot is also "Qilixiang", then the slot text of the "song" word slot and the slot text of the "album" slot can be output at the same time and handed over to the downstream for judgment, thereby improving the accuracy of the downstream judgment.

[0078] It can be seen that by combining the dictionary extraction slot and the pure entity rules to introduce dictionary information, and combining the bidirectional long short-term memory network and the global pointer network for encoding and generalization learning, the accuracy of the extracted target slot text can be greatly improved, thereby improving the user experience.

[0079] Step 107, decoding the target matrix to obtain each target slot text corresponding to each target word slot.

[0080] Among them, the matrix row or column index position with a value of 1 in the target matrix corresponding to each target word slot can be determined, and then the text corresponding to the matrix row or column index position with a value of 1 in the target matrix corresponding to each target word slot in the intended text is determined as the target slot text corresponding to each target word slot.

[0081] It can be understood that since the decoding matrix can be regarded as an upper triangular matrix or a lower triangular matrix, it is only necessary to find the matrix row or column index position with a value greater than 0 from the target matrix, and then calculate the current row and column index and the diagonal index to decode and obtain the target slot text, which will not be elaborated here.

[0082] It can be seen that the above data processing method can improve the extraction accuracy of slot text and user experience.

[0083] For ease of understanding, the following Figure 2 A data processing method in an embodiment of the present application is exemplarily described. Figure 2 Schematic diagram of a data processing method provided in an embodiment of the present application. It can be seen that the intended text is "Let Jay Chou's thousands of miles away". First, the intended text is converted into a word vector representation. The first matrix is ​​C in the figure. 1 To C 9 , there are "singer" slot, "album" slot and "song" slot, and the second vector sequence corresponding to the "singer" slot is 9 S 1 Composition, the second S 1 To the fourth S 1 The value is 1, and the second vector sequence corresponding to the "album" slot is 9 S 2 Composition, the sixth S 2 To the ninth S2 The second vector sequence corresponding to the "song" slot is composed of 9 S3s, and the sixth S 3 To the ninth S 3 The value is assigned to 1, and the pure entity rule is introduced to determine whether the intended text is a pure entity. The third matrix is ​​composed of the 9 E's in the figure. At this time, the 9 E's are assigned a value of 0. It can be seen that the fourth matrix can be formed in this way.

[0084] Next, the fourth matrix is ​​input into the bidirectional long short-term memory network to obtain the vector sequence h 1 to h 9 , then input the global pointer network, obtain a feature matrix through steps such as copying, rotating, and multiplication operators, and finally output the target matrix through the fully connected layer, and finally decode from the "singer" slot, "album" slot, and "song" slot respectively, and obtain the target slot text "Jay Chou" corresponding to the "singer" slot, the target slot text "Thousands of Miles Away" corresponding to the "album" slot, and the target slot text "Thousands of Miles Away" corresponding to the "song" slot. Specifically, the indexes with values ​​greater than 0 in the singer matrix: row index = 1, column index = 3, the row index of the horizontal diagonal = 1, and the column index = 1, so Jay Chou = Text[1:3+1] = Text[1:4], and the decoding of other slots is similar, so I will not repeat them here.

[0085] It can be seen that through the above data processing method, first, the intended text is obtained, the intended text includes the text corresponding to the target word slot group, the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text; the intended text is first processed to obtain a first matrix, the first matrix is ​​used to indicate the characteristics of the intended text; the intended text is second processed to obtain a second matrix, the second matrix is ​​used to indicate the characteristics of each slot text corresponding to each target word slot; the intended text is third processed to obtain a third matrix, the third matrix is ​​used to indicate the characteristics of the entity state information of the intended text; a fourth matrix is ​​obtained according to the first matrix, the second matrix and the third matrix; the fourth matrix is ​​input into the first model, and the target matrix is ​​obtained according to the output of the first model, the target matrix is ​​used to indicate the characteristics of the target slot text corresponding to each target word slot; the target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot. The extraction accuracy of the slot text and the user experience can be improved.

[0086] Combine the following Figure 3 An electronic device in an embodiment of the present application is described. Figure 33 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The electronic device 300 includes a processor 301 , a memory 302 , and a communication bus 303 for connecting the processor 301 and the memory 302 .

[0087] In some possible implementations, the memory 302 includes but is not limited to random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) or portable read-only memory (CD-ROM), and the memory 302 is used to store the program code executed by the electronic device 300 and the transmitted data.

[0088] In some possible implementations, the electronic device 300 further includes a communication interface for receiving and sending data.

[0089] In some possible implementations, the processor 301 may be one or more central processing units (CPUs). When the processor 301 is a central processing unit (CPU), the central processing unit (CPU) may be a single-core central processing unit (CPU) or a multi-core central processing unit (CPU).

[0090] In some possible implementations, the processor 301 may be a baseband chip, a chip, a central processing unit (CPU), a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof.

[0091] In a specific implementation, the processor 301 in the electronic device 300 is used to execute the program instructions 321 stored in the memory 302 to perform the following operations:

[0092] Acquire an intended text, wherein the intended text includes text corresponding to a target word slot group, wherein the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text;

[0093] Performing a first process on the intended text to obtain a first matrix, where the first matrix is ​​used to indicate features of the intended text;

[0094] Performing a second process on the intended text to obtain a second matrix, where the second matrix is ​​used to indicate features of each slot text corresponding to each target word slot;

[0095] Performing a third processing on the intended text to obtain a third matrix, where the third matrix is ​​used to indicate features of entity state information of the intended text;

[0096] Obtain a fourth matrix according to the first matrix, the second matrix and the third matrix;

[0097] Inputting the fourth matrix into the first model, obtaining a target matrix according to the output of the first model, wherein the target matrix is ​​used to indicate the features of the target slot text corresponding to each target word slot;

[0098] The target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot.

[0099] It can be seen that through the above data processing method and related devices, first, the intended text is obtained, the intended text includes text corresponding to the target word slot group, the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text; the intended text is first processed to obtain a first matrix, the first matrix is ​​used to indicate the characteristics of the intended text; the intended text is second processed to obtain a second matrix, the second matrix is ​​used to indicate the characteristics of each slot text corresponding to each target word slot; the intended text is third processed to obtain a third matrix, the third matrix is ​​used to indicate the characteristics of the entity state information of the intended text; a fourth matrix is ​​obtained according to the first matrix, the second matrix and the third matrix; the fourth matrix is ​​input into the first model, and the target matrix is ​​obtained according to the output of the first model, the target matrix is ​​used to indicate the characteristics of the target slot text corresponding to each target word slot; the target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot. The extraction accuracy of the slot text and the user experience can be improved.

[0100] It should be noted that the specific implementation of each operation can adopt the corresponding description of the method embodiment shown above, and the electronic device 300 can be used to execute the above method embodiment of the present application, which will not be described in detail.

[0101] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that, in order to realize the above functions, the electronic device includes a hardware structure and / or software module corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0102] The embodiment of the present application can divide the electronic device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0103] In the case of dividing each functional module into corresponding functional modules, Figure 4 This is a block diagram of the functional units of a data processing device provided in an embodiment of the present application. The data processing device 400 includes:

[0104] An acquisition unit 410 is used to acquire an intended text, wherein the intended text includes text corresponding to a target word slot group, wherein the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text;

[0105] A first processing unit 420, configured to perform a first processing on the intended text to obtain a first matrix, where the first matrix is ​​used to indicate a feature of the intended text;

[0106] A second processing unit 430 performs a second processing on the intended text to obtain a second matrix, where the second matrix is ​​used to indicate a feature of each slot text corresponding to each target word slot;

[0107] A third processing unit 440 is used to perform a third processing on the intended text to obtain a third matrix, where the third matrix is ​​used to indicate features of entity state information of the intended text;

[0108] A fourth processing unit 450, configured to obtain a fourth matrix according to the first matrix, the second matrix and the third matrix;

[0109] A determination unit 460 is configured to input the fourth matrix into the first model, and obtain a target matrix according to an output of the first model, wherein the target matrix is ​​used to indicate features of a target slot text corresponding to each target word slot;

[0110] The decoding unit 470 is used to decode the target matrix to obtain each target slot text corresponding to each target word slot.

[0111] It can be seen that through the above data processing method and related devices, first, the intended text is obtained, the intended text includes text corresponding to the target word slot group, the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text; the intended text is first processed to obtain a first matrix, the first matrix is ​​used to indicate the characteristics of the intended text; the intended text is second processed to obtain a second matrix, the second matrix is ​​used to indicate the characteristics of each slot text corresponding to each target word slot; the intended text is third processed to obtain a third matrix, the third matrix is ​​used to indicate the characteristics of the entity state information of the intended text; a fourth matrix is ​​obtained according to the first matrix, the second matrix and the third matrix; the fourth matrix is ​​input into the first model, and the target matrix is ​​obtained according to the output of the first model, the target matrix is ​​used to indicate the characteristics of the target slot text corresponding to each target word slot; the target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot. The extraction accuracy of the slot text and the user experience can be improved.

[0112] It should be noted that the specific implementation of each operation can adopt the corresponding description of the method embodiment shown above, and the data processing device 400 can be used to execute the above method embodiment of the present application, which will not be described in detail.

[0113] In the case of an integrated unit, the following combination Figure 5 Another data processing device 500 in an embodiment of the present application is described in detail, and the data processing device 500 includes a processing unit 501 and a communication unit 502, wherein the processing unit 501 is used to execute any step in the above method embodiment, and when performing data transmission such as sending, the communication unit 502 can be selectively called to complete the corresponding operation.

[0114] The data processing device 500 may further include a storage unit 503 for storing program codes and data. The processing unit 501 may be a processor, the communication unit 502 may be a wireless communication module, and the storage unit 503 may be a memory.

[0115] The processing unit 501 is specifically used for:

[0116] Acquire an intended text, wherein the intended text includes text corresponding to a target word slot group, wherein the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text;

[0117] Performing a first process on the intended text to obtain a first matrix, where the first matrix is ​​used to indicate features of the intended text;

[0118] Performing a second process on the intended text to obtain a second matrix, where the second matrix is ​​used to indicate features of each slot text corresponding to each target word slot;

[0119] Performing a third processing on the intended text to obtain a third matrix, where the third matrix is ​​used to indicate features of entity state information of the intended text;

[0120] Obtain a fourth matrix according to the first matrix, the second matrix and the third matrix;

[0121] Inputting the fourth matrix into the first model, obtaining a target matrix according to the output of the first model, wherein the target matrix is ​​used to indicate the features of the target slot text corresponding to each target word slot;

[0122] The target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot.

[0123] It can be seen that through the above data processing method and related devices, first, the intended text is obtained, the intended text includes text corresponding to the target word slot group, the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text; the intended text is first processed to obtain a first matrix, the first matrix is ​​used to indicate the characteristics of the intended text; the intended text is second processed to obtain a second matrix, the second matrix is ​​used to indicate the characteristics of each slot text corresponding to each target word slot; the intended text is third processed to obtain a third matrix, the third matrix is ​​used to indicate the characteristics of the entity state information of the intended text; a fourth matrix is ​​obtained according to the first matrix, the second matrix and the third matrix; the fourth matrix is ​​input into the first model, and the target matrix is ​​obtained according to the output of the first model, the target matrix is ​​used to indicate the characteristics of the target slot text corresponding to each target word slot; the target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot. The extraction accuracy of the slot text and the user experience can be improved.

[0124] It should be noted that the specific implementation of each operation can adopt the corresponding description of the method embodiment shown above, and the data processing device 500 can be used to execute the above method embodiment of the present application, which will not be described in detail.

[0125] An embodiment of the present application also provides a chip, including a processor, a memory, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps described in the above method embodiment.

[0126] An embodiment of the present application also provides a chip module, including a transceiver component and a chip, the chip including a processor, a memory and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps described in the above method embodiment.

[0127] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method recorded in the above method embodiment, and the above computer includes an electronic device.

[0128] The embodiment of the present application also provides a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, the computer program is operable to cause a computer to execute some or all of the steps of any method described in the method embodiment. The computer program product may be a software installation package, and the computer includes an electronic device.

[0129] It should be noted that, for the above-mentioned various embodiments, for the sake of simple description, they are all expressed as a series of action combinations. Those skilled in the art should be aware that the present application is not limited by the described order of actions, because some steps in the embodiments of the present application can be performed in other orders or simultaneously. In addition, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions, steps, modules or units involved are not necessarily required by the embodiments of the present application.

[0130] In the above embodiments, the embodiments of the present application have different focuses on the description of each embodiment. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0131] The steps of the method or algorithm described in the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (electrically EPROM, EEPROM), registers, hard disks, mobile hard disks, read-only compact disks (CD-ROMs) or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device or a management device. Of course, the processor and the storage medium can also be present in a terminal device or a management device as discrete components.

[0132] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0133] The modules / units included in the devices and products described in the above embodiments may be software modules / units or hardware modules / units, or may be partially software modules / units and partially hardware modules / units. For example, for the devices and products applied to or integrated in the chip, the modules / units included therein may all be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits; for the devices and products applied to or integrated in the chip module, the modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component (such as a chip, circuit module, etc.) or in different components of the chip module, or at least some of the modules / units may be implemented in the form of software programs. The software programs run on the processor integrated inside the chip, and the remaining (if any) modules / units may be implemented in the form of hardware such as circuits. It is implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining (if any) modules / units can be implemented in hardware such as circuits; for various devices and products applied to or integrated in the terminal equipment, the various modules / units contained therein can be implemented in hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or in different components in the terminal equipment, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal equipment, and the remaining (if any) modules / units can be implemented in hardware such as circuits.

[0134] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific implementation method of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.

Claims

1. A data processing method, It is characterized in that The method comprises: Acquire an intended text, wherein the intended text includes text corresponding to a target word slot group, wherein the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text; Performing a first process on the intended text to obtain a first matrix, where the first matrix is ​​used to indicate features of the intended text; Performing a second process on the intended text to obtain a second matrix, where the second matrix is ​​used to indicate features of each slot text corresponding to each target word slot; Performing a third processing on the intended text to obtain a third matrix, where the third matrix is ​​used to indicate features of entity state information of the intended text; Obtain a fourth matrix according to the first matrix, the second matrix and the third matrix; Inputting the fourth matrix into the first model, obtaining a target matrix according to the output of the first model, wherein the target matrix is ​​used to indicate the features of the target slot text corresponding to each target word slot; The target matrix is ​​decoded to obtain each target slot text corresponding to each target word slot.

2. The method according to claim 1, It is characterized in that The first processing of the intended text to obtain a first matrix includes: The intended text is converted into a word vector to obtain a first matrix, where the dimension of the first matrix is ​​the product of the number of words in the intended text and a first preset value.

3. The method according to claim 1, It is characterized in that The performing a second processing on the intended text to obtain a second matrix includes: Determine target word slot information in the intended text, wherein the target word slot information includes the number of target word slots and a preset dictionary corresponding to each target word slot; The following steps are performed for each target word slot to obtain the second matrix, where the dimension of the second matrix is ​​the product of the number of words in the intended text and the number of the target word slots: Constructing a first vector sequence whose initial value is all 0, wherein the length of the first vector sequence is the number of words in the intended text; Determine each slot text corresponding to the target word slot and the starting position and ending position of each slot text according to the preset dictionary corresponding to the target word slot; The first vector sequence is adjusted to a second vector sequence according to the starting position and the ending position of each slot text, and a value of 1 is assigned to a portion of the slot text in the second vector sequence.

4. The method according to claim 1, It is characterized in that The performing a third processing on the intended text to obtain a third matrix includes: Constructing a third vector sequence whose initial value is all 0, wherein the length of the third vector sequence is the number of words in the intended text; If the set of each slot text corresponding to each target word slot is equal to the intended text, the third vector sequence is adjusted to a fourth vector sequence to obtain the third matrix, and each value in the third matrix is ​​assigned a value of 1; If the set of each slot text corresponding to each target word slot is not equal to the intended text, the third vector sequence is maintained to obtain the third matrix.

5. The method according to any one of claims 2 to 4, It is characterized in that The obtaining a fourth matrix according to the first matrix, the second matrix and the third matrix comprises: The first matrix, the second matrix and the third matrix are concatenated to obtain the fourth matrix, wherein the dimension of the fourth matrix is ​​the product of the number of characters in the intended text and a second preset value, and the second preset value is the sum of the first preset value and the target word slot number plus one.

6. The method according to claim 5, It is characterized in that The step of inputting the fourth matrix into the first model and obtaining a target matrix according to an output of the first model comprises: The fourth matrix is ​​input into a bidirectional long short-term memory network and a global pointer network to obtain the target matrix, wherein the dimension of the target matrix is ​​the number of target word slots multiplied by the number of words in the intended text multiplied by the number of words in the intended text.

7. The method according to claim 6, It is characterized in that The decoding process of the target matrix to obtain each target slot text corresponding to each target word slot includes: Determine the matrix row or column index position with a value of 1 in the target matrix corresponding to each target word slot; The text corresponding to the matrix row or column index position with a value of 1 in the target matrix corresponding to each target word slot in the intended text is determined as the target slot text corresponding to each target word slot.

8. A data processing device, It is characterized in that The device comprises: An acquisition unit, configured to acquire an intended text, wherein the intended text includes text corresponding to a target word slot group, wherein the target word slot group includes at least one target word slot, and each target word slot corresponds to at least one slot text; A first processing unit, configured to perform a first processing on the intended text to obtain a first matrix, wherein the first matrix is ​​used to indicate a feature of the intended text; A second processing unit performs a second processing on the intended text to obtain a second matrix, where the second matrix is ​​used to indicate a feature of each slot text corresponding to each target word slot; A third processing unit, configured to perform a third processing on the intended text to obtain a third matrix, wherein the third matrix is ​​used to indicate features of entity state information of the intended text; a fourth processing unit, configured to obtain a fourth matrix according to the first matrix, the second matrix and the third matrix; A determination unit, configured to input the fourth matrix into the first model, and obtain a target matrix according to an output of the first model, wherein the target matrix is ​​used to indicate features of a target slot text corresponding to each target word slot; A decoding unit is used to decode the target matrix to obtain each target slot text corresponding to each target word slot.

9. An electronic device, It is characterized in that include: A processor, a memory, and one or more programs; the one or more programs are stored in the memory and are configured to be executed by the processor, the programs comprising instructions for executing the steps in the method according to any one of claims 1-7.

10. A computer storage medium, It is characterized in that The computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.