Conversational text analysis result positioning and highlighting implementation method
By storing the dialogue text analysis results using a red-black tree data structure, merging overlapping fields and marking them with identifiers, the problems of low search efficiency and overlapping highlighting in existing technologies are solved, achieving efficient positioning and highlighting.
Patent Information
- Application Number
- CN202311064192.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2043-08-22
AI Technical Summary
Existing technologies suffer from low search efficiency for dialogue text analysis results, difficulty in role segmentation, difficulty in locating analysis results, easy overlap of highlighting processes, and difficulty in accurately locating a specific segment of the dialogue text.
The analysis results are stored using a red-black tree data structure. By retrieving overlapping target fields and merging them into a single target field, the results are marked using front and back labels and a two-dimensional array is generated to represent the position of the merged target field, which is then highlighted.
It improves the search efficiency of dialogue text analysis results, simplifies role segmentation, avoids overlapping errors in highlighting, and achieves accurate positioning and efficient highlighting processing.
Smart Images

Figure CN117093665B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of text processing, in particular to a method for positioning and highlighting analysis results of dialogue text. BACKGROUND
[0002] The analysis results of dialogue text are stored in a linked list data structure, which is simple, but when searching, each object in the linked list needs to be read in a loop and then corresponding judgment is made as to whether it is consistent, which makes the search efficiency low; the roles of dialogue text generally include customers, customer service representatives / business representatives, but if it is an online scenario, there will be robots, which makes it difficult to position the analysis results, and the roles also change with the development of the business; the position of the analysis results is only for the entire dialogue text, and if it needs to be positioned to a certain dialogue, additional operations are required; and the highlighting is simply processed, which is easy to overlap. SUMMARY
[0003] Therefore, embodiments of the present application aim to provide a method for positioning and highlighting analysis results of dialogue text.
[0004] The first aspect of the present application provides a method for positioning and highlighting analysis results of dialogue text, comprising:
[0005] obtaining analysis results of dialogue text; wherein the analysis results include dialogue text, target fields in the dialogue text, and positions corresponding to the target fields;
[0006] storing the analysis results in a red-black tree data structure;
[0007] in the step of storing the analysis results, retrieving target fields having an overlapping relationship;
[0008] merging target fields that overlap with each other into one target field;
[0009] displaying the dialogue text and highlighting the target fields in the dialogue text.
[0010] In some embodiments, the step of storing the analysis results in a red-black tree data structure comprises:
[0011] dividing the dialogue text into multiple sub-paragraphs according to the order of role dialogue;
[0012] adding a front side identifier to the front side of each target field in each sub-paragraph, and adding a back side identifier to the back side of each target field in each sub-paragraph;
[0013] storing each sub-paragraph in a red-black tree data structure.
[0014] In some embodiments, in storing the analysis result, the target field with the relationship of overlap is retrieved;
[0015] In storing the analysis result, the case where there is no rear side identifier between two front side identifiers is retrieved;
[0016] If there is no rear side identifier between two front side identifiers in the same sub-paragraph, the target field corresponding to each of the front side identifiers is the target field with the relationship of overlap.
[0017] In some embodiments, the merging of the target fields with the relationship of overlap into one target field comprises:
[0018] If there is no rear side identifier between two front side identifiers, the later one of the two front side identifiers is deleted;
[0019] If there is no front side identifier between two rear side identifiers, the earlier one of the two rear side identifiers is deleted;
[0020] The sub-paragraph between the remaining front side identifier of the two front side identifiers and the remaining rear side identifier of the two rear side identifiers is the target field.
[0021] In some embodiments, the merging of the target fields with the relationship of overlap into one target field comprises:
[0022] For each target field, a two-dimensional array representing the target field is generated;
[0023] In the two-dimensional array, the first number represents the order of the first word in the target field in the sub-paragraph, and the second number represents the order of the last word in the target field in the sub-paragraph.
[0024] The minimum number in the two-dimensional array of the target fields with the relationship of overlap is selected as the first target number;
[0025] The maximum number in the two-dimensional array of the target fields with the relationship of overlap is selected as the second target number;
[0026] Based on the manner that the first target number is in front of the second target number, a new two-dimensional array is generated;
[0027] The new two-dimensional array represents the position of the target field obtained by merging the target fields that overlap with each other. The method for positioning and highlighting the analysis result of the dialogue text provided by the application comprises the following steps: obtaining the analysis result of the dialogue text; the analysis result comprises the dialogue text, the target field in the dialogue text, and the position corresponding to the target field; storing the analysis result by using a red-black tree data structure; searching for the target fields with overlapping relationship in the stored analysis result; merging the target fields that overlap with each other into one target field; displaying the dialogue text and highlighting the target field in the dialogue text. In this way, the target fields that overlap with each other are merged into one target field, so that the display error caused by the overlapping target fields in the process of highlighting the target field is avoided. BRIEF DESCRIPTION OF DRAWINGS
[0028] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description of embodiments of the present application taken in conjunction with the accompanying drawings. The drawings provided in the present application are used to provide further understanding of the embodiments of the present application, and constitute a part of the specification, and are used to explain the present application together with the embodiments of the present application, and do not constitute a limitation of the present application. In the drawings, the same reference numerals generally represent the same components or steps.
[0029] Figure 1 FIG. 1 is a flowchart of the method for positioning and highlighting the analysis result of the dialogue text provided by an embodiment of the present application. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0031] SUMMARY
[0032] The dialogue text analysis result is stored by using a linked list data structure. This structure is simple, and when searching, each object in the linked list needs to be read in a loop, and then corresponding judgment is performed to determine whether it is consistent, which makes the search efficiency not high. The dialogue text roles generally include customers, customer service representatives / sales representatives, but if it is an online scenario, there will be robots, which makes it difficult to position the analysis result, and the roles need to be split, and the roles will also change with the development of the business. The position of the analysis result is only for the entire dialogue text, and if it needs to be positioned to a certain dialogue, additional operations are required. The highlighting is simply processed, and overlapping may exist.
[0033] To solve the above problems, the application provides a scheme including: obtaining an analysis result of a dialogue text; wherein the analysis result includes the dialogue text, a target field in the dialogue text, and a position corresponding to the target field; storing the analysis result by using a red-black tree data structure; in the storage of the analysis result, searching for target fields with overlapping relationships; merging target fields that overlap with each other into one target field; displaying the dialogue text and highlighting the target field in the dialogue text. In this way, the overlapping target fields are merged into one target field, avoiding display errors in the process of highlighting the target field due to the overlapping of the target fields.
[0034] After introducing the basic principles of the application, various non-limiting embodiments of the application will be specifically introduced below with reference to the accompanying drawings.
[0035] Figure 1 is a flowchart of a dialogue text analysis result positioning and highlighting implementation method provided by an embodiment of the application. As shown in the figure, the method includes the following contents. Figure 1
[0036] Step S110, obtaining an analysis result of a dialogue text; wherein the analysis result includes the dialogue text, a target field in the dialogue text, and a position corresponding to the target field;
[0037] It should be noted that the audio data obtained in actual application is generally processed to obtain the dialogue text, and the target field in the dialogue text can be obtained by searching or other character matching methods, and the position of the target field is recorded.
[0038] Specifically, the target field can be a preset sensitive word. For example, the target field can be: "express delivery", "order number", "refund", and "pay money".
[0039] Step S120, storing the analysis result by using a red-black tree data structure;
[0040] Specifically, the red-black tree is a self-balancing binary search tree, and the red-black tree has good efficiency, which can complete searching, adding, deleting, and other operations in O(logN) time.
[0041] Step S130, in the storage of the analysis result, searching for target fields with overlapping relationships;
[0042] Step S140, merging target fields that overlap with each other into one target field;
[0043] Step S150, displaying the dialogue text and highlighting the target field in the dialogue text.
[0044] In this way, the overlapping target fields are combined into one target field, so that errors caused by overlapping target fields during highlighting of the target fields are avoided.
[0045] In some embodiments, the analysis result is stored in a red-black tree data structure, including:
[0046] The dialogue text is divided into multiple sub-paragraphs according to the role dialogue order;
[0047] A front side identifier is added to the front side of each target field in each sub-paragraph, and a rear side identifier is added to the rear side of each target field in each sub-paragraph;
[0048] Each sub-paragraph is stored in a red-black tree data structure.
[0049] It should be noted that the storage of the dialogue text analysis result in the scheme provided in the present application adopts a red-black tree data structure, which controls the balance and depth of the tree through spinning, thereby improving the search efficiency; for role splitting, a flexible regular manner is adopted, and the storage is in a distributed configuration center, so that with the development of business, only the configuration center needs to be modified, and the modification takes effect immediately without the need to modify the code; for the present application, the red-black tree structure commonly used in the industry is extended to some extent to meet the business needs, that is, left and right indexes are added to store the start and end position values of each dialogue, thereby simplifying the search operation.
[0050] Specifically, in the step of storing the analysis result, target fields having an overlapping relationship are searched;
[0051] In the step of storing the analysis result, a case where no rear side identifier exists between two front side identifiers is searched;
[0052] If no rear side identifier exists between two front side identifiers in the same sub-paragraph, the target fields corresponding to the front side identifiers are target fields having an overlapping relationship.
[0053] Generally, identifiers can be added before and after sensitive words, for example, “order” and “order number” are target fields, and identifiers are added to “order” and “order number” in a sentence “Please provide an order number”, and the result after addition is as follows: “Please provide an order number <em>subscription <em>Single< / em> number< / em> ” where, <em>For the front side identification,< / em> is a rear side identifier. Therefore, when searching for target fields having an overlapping relationship, the case where no rear side identifier exists between two front side identifiers can be searched; if the above <em>subscription <em>Single< / em> number< / em>}, it indicates that the target fields have an overlapping relationship.
[0054] Specifically, the step of combining the target fields having an overlapping relationship into one target field includes:
[0055] If there are two front-side marks without a rear-side mark between them, the rear-side mark of the two front-side marks is deleted;
[0056] If there are two rear-side marks without a front-side mark between them, the front-side mark of the two rear-side marks is deleted;
[0057] The sub-section between the remaining front-side mark of the two front-side marks and the remaining rear-side mark of the two rear-side marks is the target field.
[0058] Specifically, still taking the above example, <em>subscription <em>Single< / em> number< / em> After the above operation, it becomes <em>Order number< / em> , and a new target field "order number" that needs to be highlighted is obtained.
[0059] In some embodiments, the merging of the target fields that overlap each other into one target field comprises:
[0060] For each target field, a two-dimensional array representing the target field is generated;
[0061] The first number in the two-dimensional array represents the order of the first word in the target field in the sub-paragraph, and the second number in the two-dimensional array represents the order of the last word in the target field in the sub-paragraph.
[0062] The minimum number in the two-dimensional array of the target fields that overlap each other is selected as the first target number;
[0063] The maximum number in the two-dimensional array of the target fields that overlap each other is selected as the second target number;
[0064] A new two-dimensional array is generated based on the first target number before the second target number;
[0065] The new two-dimensional array represents the position of the target field obtained by merging the target fields that overlap each other.
[0066] For example, the array corresponding to "order" in "order number" is 【5, 6】, and the array corresponding to "number" is 【6, 7】. The new array 【5, 7】 is obtained by merging the arrays 【5, 6】 and 【6, 7】. The sub-section with the position 【5, 7】 is highlighted. 。
[0067] In addition to the above method and device, the embodiments of the present application can also be a computer program product, which includes computer program instructions that, when executed by a processor, cause the processor to perform the steps of the natural dialogue text analysis result positioning and highlighting implementation method according to various embodiments of the present application described in the "Exemplary Method" section of the present specification.
[0068] The computer program product can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. The embodiments of the present application are not limited by the
[0069] In addition, the embodiments of the present application can also be a computer readable storage medium, which stores computer program instructions, and the computer program instructions make the processor execute the steps of the dialog text analysis result positioning and highlighting implementation method according to various embodiments of the present application described in the above "Exemplary Method" part of the specification when being run by the processor.
[0070] The computer readable storage medium can be any combination of one or more computer readable medium(s). The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable disc, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0071] The above description is given for illustrative and descriptive purposes. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain modifications, permutations, additions, and sub-combinations thereof.
Claims
1. A method for positioning and highlighting of conversational text analysis results, characterized in that, The method comprises the following steps: obtaining an analysis result of dialogue text; wherein the analysis result comprises dialogue text, a target field in the dialogue text, and a position corresponding to the target field; storing the analysis result by using a red-black tree data structure; in the step of storing the analysis result, searching for target fields having an overlapping relationship; merging target fields having an overlapping relationship into one target field; displaying the dialogue text and highlighting the target field in the dialogue text; the step of storing the analysis result by using a red-black tree data structure comprises the following steps: dividing the dialogue text into multiple sub-paragraphs according to the order of role dialogue; adding a front-side identifier to the front side of each target field in each sub-paragraph, and adding a back-side identifier to the back side of each target field in each sub-paragraph; storing each sub-paragraph by using a red-black tree data structure; in the step of storing the analysis result, searching for target fields having an overlapping relationship; in the step of storing the analysis result, searching for a case where there is no back-side identifier between two front-side identifiers; if there is no back-side identifier between two front-side identifiers in the same sub-paragraph, the target fields corresponding to the two front-side identifiers are target fields having an overlapping relationship.
2. The method of claim 1, wherein, the step of merging target fields having an overlapping relationship into one target field comprises the following steps: if there is no back-side identifier between two front-side identifiers, deleting the later front-side identifier of the two front-side identifiers; if there is no front-side identifier between two back-side identifiers, deleting the earlier back-side identifier of the two back-side identifiers; the sub-paragraph between the remaining front-side identifier of the two front-side identifiers and the remaining back-side identifier of the two back-side identifiers is a target field.
3. The method of claim 1, wherein, the step of merging target fields having an overlapping relationship into one target field comprises the following steps: generating a two-dimensional array representing each target field; wherein the first number in the two-dimensional array represents the order of the first word in the target field in the sub-paragraph, and the second number in the two-dimensional array represents the order of the last word in the target field in the sub-paragraph; selecting the minimum number in the two-dimensional array of the target fields having an overlapping relationship as a first target number; selecting the maximum number in the two-dimensional array of the target fields having an overlapping relationship as a second target number; generating a new two-dimensional array based on the first target number in front of the second target number; wherein the new two-dimensional array represents the position of the target field obtained by merging the target fields having an overlapping relationship.
Citation Information
Patent Citations
Method and system for realizing dynamic highlight and storage medium
CN115344771A
Layout file highlighting method and highlighting system based on keyword positioning
CN115952278A