Text processing method and device, electronic equipment and storage medium

By obtaining and updating the tag attribute information in the text annotation results, determining and rendering the overlapping parts, the problem of unintuitive display of the text annotation results in the existing technology is solved, and clear distinction between single and multiple tag annotated local texts is achieved, improving Improve quality inspection efficiency.

CN118657116APending Publication Date: 2024-09-17MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410374588.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the existing technology, on the display page of the text annotation results, it is difficult to visually display text that overlaps and hits multiple tag types, causing quality inspection staff to be time-consuming and labor-intensive and unable to clearly distinguish between a single text classification tag and a part marked by multiple tags. text.

Method used

By obtaining the label attribute information of the text classification label of the text to be rendered, the target character sequence is determined as the overlapping part, the label attribute information is updated, and the rendering process is performed based on the updated information to optimize the display page of the text annotation results.

Benefits of technology

It achieves a clearer distinction in the text to be rendered between partial text marked only by a single text classification and partial text marked by multiple text classification labels at the same time, improving the intuitiveness and efficiency of the text labeling results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657116A
    Figure CN118657116A
Patent Text Reader

Abstract

Embodiments of the invention provide a text processing method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining tag attribute information of a text classification tag of a to-be-rendered text; each text classification label labels one sub-text in the to-be-rendered text; the label attribute information comprises first position information of a sub-text labeled by the text classification label in the to-be-rendered text; determining a target character sequence in the to-be-rendered text according to the first position information; the target character sequence belongs to sub-texts labeled by a plurality of text classification labels; updating the label attribute information according to the target character sequence; and rendering the to-be-rendered text according to the updated tag attribute information. Therefore, the visual effect of the display page of the text labeling result can be optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a text processing method, device, electronic device and storage medium. Background Art

[0002] With the development of Internet technology, the amount of multimedia data transmitted in the network is increasing. On this basis, the demand for text quality inspection of texts converted from multimedia data is also growing rapidly.

[0003] Text annotation for texts that require quality inspection is a common quality inspection method. The visual effect of the display page of the text annotation results is likely to affect the behavior of subsequent quality inspection staff. Therefore, how to optimize the display page of text annotation results has attracted more and more attention. Summary of the invention

[0004] The embodiments of the present application provide a text processing method, device, electronic device and storage medium to optimize the display page of text annotation results.

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

[0006] Acquire label attribute information of a text classification label of a text to be rendered; each of the text classification labels marks a subtext in the text to be rendered; the label attribute information includes first position information of the subtext marked by the text classification label in the text to be rendered;

[0007] According to the first position information, a target character sequence is determined in the text to be rendered; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels;

[0008] According to the target character sequence, updating the tag attribute information;

[0009] The text to be rendered is rendered according to the updated tag attribute information.

[0010] In a second aspect, an embodiment of the present application provides a text processing device, including:

[0011] An acquiring unit, configured to acquire label attribute information of a text classification label of a text to be rendered; each of the text classification labels annotates a subtext in the text to be rendered; the label attribute information includes first position information of the subtext annotated by the text classification label in the text to be rendered;

[0012] A determination unit, configured to determine a target character sequence in the text to be rendered according to the first position information; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels;

[0013] An updating unit, used for updating the tag attribute information according to the target character sequence;

[0014] A rendering unit is used to render the text to be rendered according to the updated tag attribute information.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor; and a memory configured to store computer-executable instructions, wherein the computer-executable instructions, when executed, cause the processor to execute the text processing method as described in the first aspect.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the text processing method as described in the first aspect.

[0017] It can be seen that in the embodiment of the present application, considering that each text classification label annotates a sub-text in the text to be rendered, and that different text classification labels may not be obtained by the same batch when the text is annotated in advance, the sub-texts annotated by different text classification labels may have overlapping parts, and the overlapping parts are target character sequences annotated by multiple text classification labels at the same time. The overlapping part is determined by the first position information of each text classification label, and then the label attribute information is updated using the overlapping part, and the text to be rendered is rendered according to the updated label attribute information, which is conducive to more clearly distinguishing the local text annotated by only a single text classification label and the local text annotated by multiple text classification labels at the same time in the text to be rendered, and optimizing the display page of the text annotation results. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.

[0019] Figure 1 A schematic diagram of an implementation environment of a text processing method provided in an embodiment of the present application;

[0020] Figure 2A processing flow chart of a text processing method provided in an embodiment of the present application;

[0021] Figure 3 A first partial flow chart of a text processing method provided in an embodiment of the present application;

[0022] Figure 4 A second partial flow chart of a text processing method provided in an embodiment of the present application;

[0023] Figure 5 A third partial flow chart of a text processing method provided in an embodiment of the present application;

[0024] Figure 6 A fourth partial flow chart of a text processing method provided in an embodiment of the present application;

[0025] Figure 7 A fifth partial flow chart of a text processing method provided in an embodiment of the present application;

[0026] Figure 8 A sixth partial flow chart of a text processing method provided in an embodiment of the present application;

[0027] Fig. 9 An application interface diagram of a text processing method provided in an embodiment of the present application;

[0028] Fig.10 Another application interface diagram of a text processing method provided in an embodiment of the present application;

[0029] Fig.11 A schematic diagram of a text processing device provided in an embodiment of the present application;

[0030] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions 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 this specification, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0032] This specification provides a text processing method embodiment:

[0033] In a quality inspection scenario, after text annotation is performed on the text that has quality inspection requirements, the text annotation results can be displayed to the quality inspection staff as quality inspection results.

[0034] When there are various labels in the text annotation results, if you check the hits of the corresponding text classification labels in the text one by one according to the label type, you need to frequently switch the filter conditions, which is time-consuming and labor-intensive, and cannot intuitively display the situation of overlapping texts with multiple label types, which is not intuitive enough.

[0035] Therefore, in order to solve the above problems, an embodiment of the present application provides a text processing method.

[0036] The text processing method provided in one or more embodiments of this specification may be applicable to the implementation environment of the text processing method, such as Figure 1 As shown, the implementation environment at least includes a server 101 for processing text to be rendered.

[0037] The server 101 may be a single server, or a server cluster consisting of a plurality of servers, or one or more cloud servers in a cloud computing platform, for processing text to be rendered.

[0038] In this implementation environment, when processing the text to be rendered, the server 101 first obtains the label attribute information of the text classification label of the text to be rendered; each text classification label marks a sub-text in the text to be rendered; the label attribute information includes the first position information of the sub-text marked by the text classification label in the text to be rendered; then, according to the first position information, the target character sequence is determined in the text to be rendered; the target character sequence belongs to the sub-text marked by multiple text classification labels; then, according to the target character sequence, the label attribute information is updated; finally, the text to be rendered is rendered according to the updated label attribute information. In this way, considering that each text classification label marks a sub-text in the text to be rendered, and that when the text is marked in advance, different text classification labels may not be marked in the same batch, the sub-texts marked by different text classification labels may have overlapping parts, and the overlapping parts are the target character sequences marked by multiple text classification labels at the same time. The overlapping part is determined by the first position information of each text classification label, and the label attribute information is then updated using the overlapping part, and the text to be rendered is rendered according to the updated label attribute information. This helps to more clearly distinguish between local text annotated by only a single text classification label and local text annotated by multiple text classification labels in the text to be rendered, and optimizes the display page of the text annotation results.

[0039] Figure 2 A processing flow chart of a text processing method provided in an embodiment of the present application. Figure 2 The text processing method provided in this embodiment specifically includes steps S202 to S208:

[0040] Step S202, obtaining label attribute information of the text classification label of the text to be rendered; each text classification label marks a subtext in the text to be rendered; the label attribute information includes the first position information of the subtext marked by the text classification label in the text to be rendered.

[0041] The text to be rendered can be any text that needs to be rendered.

[0042] The text classification label of the text to be rendered may be a label obtained after the text to be rendered is pre-annotated. The number of text classification labels of the text to be rendered may be one or more. When the number of text classification labels of the text to be rendered is more than one, each text classification label annotates a subtext of the text to be rendered.

[0043] Text annotation processing can be the process of marking the features of text, labeling it with specific semantics, composition, context, purpose, emotion and other raw data labels.

[0044] Each subtext may be a character sequence, that is, one or more characters arranged in a preset order. Each subtext may include one character or multiple characters.

[0045] For example, the text to be rendered is "ABCDEFG". After the text to be rendered is pre-annotated, three labels are obtained, among which label 1 marks a sub-text "ABC" in the text to be rendered, label 2 marks a sub-text "CD" in the text to be rendered, and label 3 marks a sub-text "F" in the text to be rendered.

[0046] In addition, the text to be rendered may include one sentence or multiple sentences. When the text to be rendered includes multiple sentences, each sentence is processed in the same manner. The sentences in the text to be rendered may be divided by preset punctuation marks, for example, the preset punctuation marks include commas and periods.

[0047] Label attribute information can describe the characteristics of text classification labels.

[0048] Exemplarily, the tag attribute information includes one or more of the following: tag identification, tag type, and the like.

[0049] Among them, the label identifier can be used to identify the unique corresponding text classification label.

[0050] For example, the text classification labels of the text to be rendered include: label 1, label 2, and label 3, wherein the label identifier of label 1 is 001, the label identifier of label 2 is 002, and the label identifier of label 3 is 003.

[0051] Type refers to an abstract concept that contains common points extracted from various special things or phenomena. Before performing text annotation processing on the rendered text, multiple preset label types can be pre-configured. The label type of each text classification label can be one of the multiple preset label types.

[0052] For example, the text classification labels of the text to be rendered include: label 1, label 2, label 3 and label 4, among which the label type of label 1 is "available information", the label type of label 2 is "abnormal information", the label type of label 3 is "prompt information", and the label type of label 4 is "available information".

[0053] The tag attribute information may also include first position information of the subtext marked by the text classification tag in the text to be rendered. The first position information may be used to indicate the position of the subtext in the text to be rendered.

[0054] The ordinal numbers such as "first" and "second" in this specification are merely for the convenience of distinguishing different technical features and have no actual meaning, and will not be elaborated below.

[0055] For example, the text to be rendered is "ABCDEFG", and tag 1 marks a subtext "BCD" in the text to be rendered, then the attribute information of tag 1 includes the first position information of the subtext "BCD" in the text to be rendered "ABCDEFG".

[0056] In a specific implementation, the first position information can be represented by a numerical interval consisting of a start index value and an end index value of the text classification label, wherein the start index value is used to represent the position information of the first character of the subtext marked by the text classification label in the text to be rendered, and the end index value is used to represent the position information of the first character after the subtext marked by the text classification label in the text to be rendered.

[0057] For example, the text to be rendered is "ABCDEFG", and tag 1 marks a subtext "BCD" in the text to be rendered. The first position information of tag 1 can be represented by [2, 5), where "2" is the start index value of tag 1 and "5" is the end index value of tag 1. "2" represents the position information of the first character "B" of the subtext marked by tag 1 in the text to be rendered, and "5" represents the position information of the first character "E" after the subtext "BCD" marked by tag 1 in the text to be rendered "ABCDEFG". [2, 5) means that the subtext marked by tag 1 in the text to be rendered includes the second character, the third character and the fourth character in the text to be rendered.

[0058] In the case where the text to be rendered includes multiple sentences, the first position information of the subtext annotated by the text classification label that hits the nth sentence in the text to be rendered may be the first position information of the text classification label in the nth sentence. n is a natural number greater than or equal to 1. The text classification label that hits the nth sentence means that the subtext annotated by the text classification label belongs to the nth sentence.

[0059] For example, the text classification labels of the text to be rendered include label 1 that hits the first sentence and label 2 that hits the third sentence. The first position information of subtext 1 marked by label 1 in the text to be rendered may be the position information of subtext 1 in the first sentence; the first position information of subtext 2 marked by label 2 in the text to be rendered may be the position information of subtext 2 in the third sentence.

[0060] In addition, when the text to be rendered includes multiple sentences, the tag attribute information of the text classification tag may also include the arrangement sequence number of the sentence matched by the text classification tag in the text to be rendered.

[0061] For example, the text classification labels of the text to be rendered include label 1 for the first sentence and label 2 for the third sentence. The label attribute information of label 1 includes the sentence arrangement number "1", and the label attribute information of label 3 includes the sentence arrangement number "3".

[0062] Acquiring the tag attribute information of the text classification tag of the text to be rendered may be that the Web front end calls an interface to obtain the text annotation result of the text to be rendered from the back end, and the text annotation result includes the tag attribute information of the text classification tag.

[0063] Among them, the Web front end is also called the Web development front end, which refers to the web page interface that users see and operate on the browser. As an important part of Web development, it is responsible for realizing the visible interface and interactive functions of the web page. The back end refers to the server.

[0064] In addition, after obtaining the text annotation results, the label attribute information of the text classification label can be organized into an array format for ease of use in subsequent steps.

[0065] For example, [{seqNo:1, index:[2,8)},{seqNo:1, index:[3,7)},{seqNo:2, index:[4,5)},…]. “{seqNo:1, index:[2,8]}” represents the label attribute information of a text classification label, where “seqNo:1” indicates that the arrangement number of the sentence hit by the text classification label in the text to be rendered is “1”, and “index:[2,8)” indicates the first position information of the subtext marked by the text classification label in the first sentence of the text to be rendered. Specifically, “2” is the starting index value of the text classification label, and “8” is the ending index value of the text classification label. “{seqNo:1, index:[3,7)}” and “{seqNo:2, index:[4,5)}” are similar to {seqNo:1, index:[2,8)}, and will not be repeated one by one.

[0066] Step S204: determining a target character sequence in the text to be rendered according to the first position information; the target character sequence belongs to a subtext annotated with a plurality of text classification tags.

[0067] The text to be rendered may be obtained by performing speech recognition processing on audio data, or may be obtained by performing text recognition processing on image data, and so on.

[0068] Speech recognition can use ASR (Automatic Speech Recognition, artificial intelligence speech recognition) technology, which is a technology that converts human speech into text or instructions that can be processed by computers.

[0069] Text recognition can use OCR (Optical Character Recognition) technology. Text recognition refers to the process of an electronic device, such as a scanner or a digital camera, checking the characters printed on paper and then translating the shapes into computer text using character recognition methods. That is, the text data is scanned and then the image file is analyzed and processed to obtain text and layout information.

[0070] Before executing step S204, the text to be rendered may be obtained.

[0071] In specific implementation, the Web front end can call an interface to obtain a text information array of the text to be rendered from the back end, and the text information array may include multiple text information, wherein each text information includes a sentence sequence number and sentence text content.

[0072] For example: text information array [{seqNo:1, content: sentence text content 1}, {seqNo:2, content: sentence text content 2}, …]. Among them, "seqNo:1" means that the sequence number of sentence 1 in the text to be rendered is "1", and "content: sentence text content 1" means that the content of sentence 1 is "sentence text content 1". "seqNo:2" means that the sequence number of sentence 2 in the text to be rendered is "2", and "content: sentence text content 2" means that the content of sentence 2 is "sentence text content 2".

[0073] If the text to be rendered is obtained by performing speech recognition processing on audio data, each text information in the text information array of the text to be rendered may also include a starting time point of a sentence in the audio data.

[0074] A character sequence is one or more characters arranged in a preset order. A target character sequence is a character sequence belonging to multiple subtexts. A target character sequence may be an overlapping portion of at least two subtexts, so the target character sequence may be the same as the aforementioned subtext, or may be a part of a subtext.

[0075] The target character sequence includes one or more characters.

[0076] To facilitate the distinction between the target character sequence and the subtext, considering that the first position information is used to indicate the position of the subtext in the text to be rendered, the position of the target character sequence in the text to be rendered may be indicated by the second position information.

[0077] For example, the text to be rendered is ABCDEFG, label 1 marks subtext 1: BCD, the first position information of subtext 1 is [2, 5), label 2 marks subtext 2: DE, the first position information of subtext 2 is [4, 6), then the target character sequence that belongs to both subtext 1 and subtext 2 is "D", and the second position information of the target character sequence in the text to be rendered is [4, 5).

[0078] For another example, the text to be rendered is ABCDEFG, label 1 marks subtext 1: BCD, and the first position information of subtext 1 is [2, 5), label 3 marks subtext 3: CDEF, and the first position information of subtext 3 is [3, 7), then the target character sequence that belongs to both subtext 1 and subtext 3 is "CD", and the second position information of the target character sequence in the text to be rendered is [3, 5).

[0079] In a specific implementation, in order to facilitate tag insertion in subsequent steps, the second position information of the target character sequence in the text to be rendered may be represented by a semi-open and semi-closed numerical interval.

[0080] When the target character sequence includes only a single character and the single character is the i-th character in the text to be rendered, the second position information of the target character sequence can be represented by a numerical interval [i, i+1), where i is a natural number greater than or equal to 1.

[0081] For example, the text to be rendered is "ABCDEFG", subtext 1 marked by label 1 is "BCD", and subtext 2 marked by label 2 is "DE", then the second position information of the target character sequence "D" that belongs to both subtext 1 and subtext 2 can be represented by the numerical interval [4, 5).

[0082] In the case where the target character sequence includes a plurality of characters arranged continuously and the first character of the plurality of characters is the i-th character in the text to be rendered, and the first character after the plurality of characters is the j-th character in the text to be rendered, the second position information of the target character sequence can be represented by a numerical interval [i, j). i is a natural number greater than or equal to 1, and j is a natural number greater than 2.

[0083] For example, the text to be rendered is "ABCDEFG", the subtext 1 marked by tag 1 is "BCD", and the subtext 3 marked by tag 3 is "CDEF", then the second position information of the target character sequence "CD" that belongs to both subtext 1 and subtext 3 can be represented by the numerical interval [3, 5).

[0084] In a specific implementation, a target character sequence is determined in a text to be rendered based on first position information, including: sorting text classification labels based on the first position information; determining a label pair consisting of two adjacent text classification labels in the sorted text classification labels to obtain a label pair set corresponding to the text to be rendered; determining a target character sequence in the text to be rendered based on text position information of the label pairs in the label pair set; the text position information of the label pairs includes first position information of sub-texts marked by two text classification labels in the label pairs.

[0085] The sorting is based on the consideration that if the sub-texts marked by two text classification labels are adjacent, then the sub-texts marked by the two text classification labels are more likely to overlap. By sorting first, then constructing a label pair based on the two adjacent text classification labels, and then determining in turn whether the sub-texts marked by the two text classification labels in each label pair have overlapping parts, each target character sequence in the text to be rendered can be found efficiently and without omission.

[0086] In the case where the first position information includes a start index value and an end index value, the text classification labels are sorted according to the first position information, and the text classification labels are sorted according to the start index value. After the sorting process, the smaller the value of the start index value is, the closer the text classification label is to the front; the larger the value of the start index value is, the closer the text classification label is to the back.

[0087] For example, the text classification labels of the text to be rendered include label 1, label 2, and label 3. Before the sorting process: label 1->label 2->label 3. The first position information of label 1 can be represented by index:[4,8), and its start index value is "4"; the first position information of label 2 can be represented by index:[2,5), and its start index value is "2"; the first position information of label 3 can be represented by index:[3,6), and its start index value is "3". The text classification labels are sorted according to the start index value. Since 2<3<4, after the sorting process: label 2->label 3->label 1.

[0088] It should be noted that if the start index values ​​of at least two text classification labels are the same, the at least two text classification labels may be sorted according to the end index value, or the original order may be retained unchanged.

[0089] In specific implementation, the sorting method used in the sorting process may be bubble sort. The text classification labels are sorted according to the first position information, and the text classification labels are sorted according to the start index value.

[0090] Bubble sort is a relatively simple sorting algorithm in the field of computer science. It repeatedly visits the element column to be sorted, compares two adjacent elements in turn, and swaps them if the order is wrong. For example, the order of the element column can be from large to small, or from the first letter from Z to A, and so on. The work of visiting the elements is repeated until there are no adjacent elements to be swapped, that is, the element column has been sorted.

[0091] Bubble sort the text classification labels according to the starting index value, which can be combined with Figure 3 Provide specific instructions.

[0092] Figure 3 The first partial flowchart of a text processing method provided in an embodiment of the present application. Figure 3 The specific implementation process of performing bubble sorting on text classification labels is exemplified.

[0093] like Figure 3 As shown, in step S302, i=0, obtaining the hit tag index array.

[0094] The hit label index array may be an array consisting of the first position information of the text classification labels of the text to be rendered. Exemplarily, the hit label index array may be named array.

[0095] For example, the text classification labels of the text to be rendered include label 1, label 2 and label 3. Among them, the first position information of label 1 can be represented by index:[a1,a2), where a1 is the start index value of label 1 and a2 is the end index value of label 1; the first position information of label 2 can be represented by index:[b1,b2), where b1 is the start index value of label 2 and b2 is the end index value of label 2; the first position information of label 3 can be represented by index:[c1,c2), where c1 is the start index value of label 3 and c2 is the end index value of label 3. The hit label index array array=[index:[a1,a2), index:[b1,b2), index:[c1,c2)].

[0096] array[i] can be used to represent the i+1th element in the hit tag index array. For example, if the array array includes 3 elements, the first element in the array array can be represented by array[0], the second element in the array array can be represented by array[1], and the third element in the array array can be represented by array[2].

[0097] When i=0, array[i]=array[0]=index:[a1,a2).

[0098] a1, a2, b1, b2, c1, c2 are all natural numbers greater than 0.

[0099] Step S304, i<array length.

[0100] If i<the array length of the hit tag index array, execute step S306; if i≥the array length, execute step S318.

[0101] The array length reflects the number of elements in the hit tag index array.

[0102] For example, array = [index: [a1, a2), index: [b1, b2), index: [c1, c2)], the array length is 3, that is, the array array includes 3 elements.

[0103] Exemplarily, the array length of the hit tag index array may be represented by array.length.

[0104] Step S306, j=0.

[0105] j can be a custom variable, and its initial value is 0.

[0106] Step S308, j<array length-i-1.

[0107] If j<array length-i-1, execute step S310; if j≥array length-i-1, execute step S316.

[0108] Step S310, the starting index of the j-th hit tag>the starting index of the j+1-th hit tag.

[0109] If the starting index of the jth hit tag is greater than the starting index of the j+1th hit tag, execute step S312; if the starting index of the jth hit tag is less than or equal to the starting index of the j+1th hit tag, execute step S314.

[0110] The hit label is the text classification label of the text to be rendered.

[0111] The start index may refer to the start index value of the aforementioned text classification label.

[0112] For example, array = [index: [a1, a2), index: [b1, b2), index: [c1, c2)]. When j = 0, the starting index of the j-th hit tag is a1, and the starting index of the j+1-th hit tag is b1.

[0113] Exemplarily, the starting index of the j-th hit tag > the starting index of the j+1-th hit tag can be expressed as array[j][index'][0]>array[j+1][index'][0]. Among them, array[j][index'][0] is used to represent the 0th element of the subarray index in the j-th element in the array array, that is, the starting index of the j-th hit tag, and array[j+1][index'][0] is used to represent the 0th element of the subarray index in the j+1-th element in the array array, that is, the starting index of the j+1-th hit tag.

[0114] Step S312, swapping the positions of two adjacent items.

[0115] The positions of the first position information of the j-th hit tag and the first position information of the j+1-th hit tag are exchanged in the hit tag index array.

[0116] For example, array = [index: [a1, a2), index: [b1, b2), index: [c1, c2)], j = 0. Swap the positions of index: [a1, a2) and index: [b1, b2), and after the swap, array = [index: [b1, b2), index: [a1, a2), index: [c1, c2)].

[0117] Step S314, j=j+1.

[0118] Step S316, i=i+1.

[0119] Step S318, return the sorted array.

[0120] After sorting, the elements in the hit label index array are arranged in ascending order according to the starting index value, and each element has a corresponding text classification label. The sorted hit label index array can be used to determine the sorted text classification label.

[0121] Determine the label pairs consisting of two adjacent text classification labels in the text classification labels after sorting, and obtain the label pair set corresponding to the text to be rendered. For example, after sorting: label 1 -> label 2 -> label 3 -> label 4. Label pair 1 consists of label 1 and label 2, label pair 2 consists of label 2 and label 3, and label pair 3 consists of label 3 and label 4. The label pair set corresponding to the text to be rendered includes: label pair 1, label pair 2, and label pair 3.

[0122] The target character sequence in the text to be rendered is determined according to the text position information of the tag pair in the tag pair set. The text position information of the tag pair includes the first position information of the subtext annotated by the two text classification tags in the tag pair.

[0123] For example, the label pair is [label 1, label 2], the first position information of subtext 1 marked by label 1 in the text to be rendered is [1,5), and the first position information of subtext 2 marked by label 2 in the text to be rendered is [3,8), then the text position information of label pair 1 includes: [1,5) and [3,8).

[0124] In the case where there are multiple text classification labels that hit the text to be rendered, it may happen that most of the text classification labels do not cross-hits, and only a small number of sub-texts annotated with text classification labels have overlapping parts. Therefore, each label pair can be processed in sequence according to the arrangement order of each label pair in the label pair set. For any label pair, according to the text position information of the label pair, determine whether there is a target character sequence corresponding to the label pair in the text to be rendered. If so, add the target character sequence corresponding to the label pair to the target character sequence set of the text to be rendered. If not, skip the label pair and continue to process the next label pair until all label pairs in the label pair set are processed.

[0125] For example, after sorting: label 1, label 3, label 2, these three labels can form two label pairs arranged in sequence: [label 1, label 3], [label 3, label 2].

[0126] The text to be rendered is ABCDEFG, subtext 1 marked by label 1 is AB, subtext 3 marked by label 3 is DE, and subtext 2 marked by label 2 is EFG.

[0127] For the label pair: [label 1, label 3], AB and DE do not overlap, so it is obvious that AB and EFG are farther apart and are less likely to have overlapping parts. That is, if the sub-texts annotated by two adjacent text classification labels do not overlap, it means that the first text classification label in the label pair and the text classification labels after the second text classification label in the label pair in the sorting result are less likely to overlap. In this case, it means that the label pair currently being processed does not need to consider the problem of cross-hit, and there is no target character sequence corresponding to the label pair. The label pair can be skipped and the next label pair can be processed.

[0128] For another example, the tag pair set includes 100 tag pairs. In the process of executing the step "determining the target character sequence in the text to be rendered based on the text position information of the tag pairs in the tag pair set", the 1st to 100th tag pairs are processed in sequence. Among the 100 tag pairs, 80 tag pairs have no overlap, and 20 tag pairs have overlap. The tag pairs without overlap do not have corresponding target character sequences, and the tag pairs with overlap have corresponding target character sequences. 20 target character sequences can be finally determined using the text position information of the 100 tag pairs.

[0129] In a specific implementation, for each text classification label, the first position information of the subtext marked by the text classification label is determined by the first arrangement number of the first character in the subtext marked by the text classification label in the text to be rendered and the second arrangement number of the last character in the subtext marked by the text classification label in the text to be rendered; according to the text position information of the label pair in the label pair set, the target character sequence in the text to be rendered is determined, including: comparing the second arrangement number of the first text classification label in the target label pair and the first arrangement number of the second text classification label in the target label pair to obtain a sequence number comparison result; if the sequence number comparison result indicates that the subtext marked by the first text classification label in the target label pair overlaps with the subtext marked by the second text classification label in the target label pair, then according to the second arrangement number of the first text classification label in the target label pair and the first arrangement number of the second text classification label in the target label pair, the target character sequence corresponding to the target label pair is determined in the text to be rendered.

[0130] The first arrangement sequence number may refer to the start index value of the aforementioned text classification label, and the second arrangement sequence number may be regarded as the end index value of the aforementioned text classification label minus one.

[0131] The first position information of the subtext marked with the text classification label is determined by the first arrangement number of the first character in the subtext marked with the text classification label in the text to be rendered and the second arrangement number of the last character in the subtext marked with the text classification label in the text to be rendered.

[0132] Exemplarily, the first position information may be represented by a semi-closed and semi-open numerical interval [first arrangement sequence number, second arrangement sequence number+1).

[0133] A comparison is performed based on the second arrangement sequence number of the first text classification label in the target label pair and the first arrangement sequence number of the second text classification label in the target label pair to obtain a sequence comparison result; if the sequence comparison result indicates that the sub-text marked by the first text classification label in the target label pair overlaps with the sub-text marked by the second text classification label in the target label pair, then the target character sequence corresponding to the target label pair is determined in the text to be rendered based on the second arrangement sequence number of the first text classification label in the target label pair and the first arrangement sequence number of the second text classification label in the target label pair; if the sequence comparison result indicates that the sub-text marked by the first text classification label in the target label pair does not overlap with the sub-text marked by the second text classification label in the target label pair, then it is determined to skip processing the target label pair and continue processing the next label pair of the target label pair.

[0134] Considering that the label pair is determined after sorting the text classification labels, the label pair includes two text classification labels, and the first arrangement sequence number of the first text classification label of the two text classification labels is less than or equal to the first arrangement sequence number of the second text classification label.

[0135] The target label pair can be any label pair in the label pair set.

[0136] The comparison is performed based on the second arrangement number of the first text classification label in the target label pair and the first arrangement number of the second text classification label in the target label pair. The comparison can be performed by comparing the second arrangement number + 1 of the first text classification label in the target label pair with the first arrangement number of the second text classification label in the target label pair.

[0137] If the second permutation sequence number + 1 of the first text classification label in the label pair is greater than the first permutation sequence number of the second text classification label in the label pair, it means that the sub-texts annotated by the two text classification labels in the label pair have overlapping parts. If the second permutation sequence number + 1 of the first text classification label in the label pair is equal to the first permutation sequence number of the second text classification label in the label pair, it means that the sub-texts annotated by the two text classification labels in the label pair do not have overlapping parts. If the second permutation sequence number of the first text classification label in the label pair is less than the first permutation sequence number of the second text classification label in the label pair, it means that the sub-texts annotated by the two text classification labels in the label pair do not have overlapping parts.

[0138] For example, for each label pair, the text position information of the label pair can be represented by two sets. The text position information of label pair 1 includes: [a1, a2), [b1, b2), where a1 is the first permutation number of the first text classification label in label pair 1, a2 is the second permutation number of the first text classification label in label pair 1 + 1, b1 is the first permutation number of the second text classification label in label pair 1, and b2 is the second permutation number of the second text classification label in label pair 1 + 1.

[0139] The process of determining the target character sequence is as follows: first compare a2 and b1 to obtain a serial number comparison result. If the serial number comparison result is that a2 is less than or equal to b1, it means that there is no overlap, and the target character sequence corresponding to the label pair 1 does not exist in the text to be rendered, and the next label pair can be processed; if the serial number comparison result is that a2 is greater than b1, then the intersection of the two sets is obtained to obtain [b1, a2), that is, the sub-texts marked by the two labels in the label pair 1 overlap, the target character sequence corresponding to the label pair 1 exists in the text to be rendered, and the second position information of the target character sequence can be represented by the intersection [b1, a2).

[0140] For another example, the tag pair set includes tag pair 1, tag pair 2, and tag pair 3 which are arranged in sequence.

[0141] Tag pair 1 includes tag 1 and tag 2, wherein the first position information of tag 1 is index: [2, 5), and the first position information of tag 2 is index: [4, 5).

[0142] The first arrangement number of tag 1 is "2", and the second arrangement number of tag 1 is "4". Subtext 1 marked by tag 1 includes the second to fourth characters in the text to be rendered, but does not include the fifth character.

[0143] The first arrangement number of tag 2 is "4", and the second arrangement number of tag 2 is "4". Subtext 2 marked by tag 2 includes the 4th character in the text to be rendered, but does not include the 5th character.

[0144] The second arrangement number of label 1 is "4"+1=5, and "5" is greater than the first arrangement number of label 2, "4", which means that there is an overlap between subtext 1 marked by label 1 and subtext 2 marked by label 2. The overlap is the target character sequence 1 corresponding to label pair 1. The second position information of the target character sequence 1 in the text to be rendered can be represented by index:[4,5).

[0145] Tag pair 2 includes tag 2 and tag 3, wherein the first position information of tag 2 is index: [4, 5), and the first position information of tag 3 is index: [5, 7).

[0146] The first arrangement number of tag 2 is "4", and the second arrangement number of tag 2 is "4". Subtext 2 marked by tag 2 includes the 4th character in the text to be rendered, but does not include the 5th character.

[0147] The first arrangement number of tag 3 is "5", and the second arrangement number of tag 3 is "6". Subtext 3 marked by tag 3 includes the 5th to 6th characters in the text to be rendered, but does not include the 7th character.

[0148] The second arrangement number of label 2 "4" + 1 = 5, "5" is equal to the first arrangement number of label 3 "5", indicating that there is no overlapping part between the subtext 2 marked by label 2 and the subtext 3 marked by label 3, that is, there is no target character sequence corresponding to label pair 2.

[0149] Tag pair 3 includes tag 3 and tag 4, wherein the first position information of tag 3 is index: [5, 7), and the first position information of tag 4 is index: [8, 10).

[0150] The first arrangement number of tag 3 is "5", and the second arrangement number of tag 3 is "6". Subtext 3 marked by tag 3 includes the 5th to 6th characters in the text to be rendered, but does not include the 7th character.

[0151] The first arrangement number of tag 4 is "8", and the second arrangement number of tag 4 is "9". Subtext 4 marked by tag 4 includes the 8th to 9th characters in the text to be rendered, but does not include the 10th character.

[0152] The second arrangement number of label 3 "6" + 1 = 7, "7" is smaller than the first arrangement number of label 4 "8", indicating that there is no overlapping part between subtext 3 marked by label 3 and subtext 4 marked by label 4, that is, there is no target character sequence corresponding to label pair 3.

[0153] Step S206: updating the tag attribute information according to the target character sequence.

[0154] When determining that the target character sequence exists, second position information of the target character sequence in the text to be rendered may be obtained.

[0155] The tag attribute information is updated according to the target character sequence, and may be updated according to the second position information of the target character sequence.

[0156] During specific implementation, a corresponding relationship between a tag pair and the second position information of a target character sequence corresponding to the tag pair may be established.

[0157] For example, label pair 1 includes label 1 and label 2, and the target character sequence corresponding to label pair 1 is character sequence A. A corresponding relationship between label pair 1 and the second position information of character sequence A can be established.

[0158] The tag attribute information is updated according to the second position information, and a tag pair corresponding to the second position information is determined, and the first position information of each text classification tag in the tag pair is updated according to the second position information.

[0159] The first position information can be represented by a numerical interval. According to the second position information, the first position information of each text classification label in the label pair is updated, and the two intersecting numerical intervals can be updated to three non-intersecting numerical intervals according to the second position information.

[0160] For example, label pair 1 includes label 1 and label 2, the first position information of label 1 is index:[2,8), the first position information of label 2 is index:[5,10), and the second position information of the target character sequence corresponding to label pair 1 is index:[5,8). According to the second position information index:[5,8), the first position information index:[2,8) of label 1 and the first position information index:[5,10) of label 2 are updated to obtain three first position information: index:[2,5), index:[5,8) and index:[8,10).

[0161] For another example, label pair 2 includes label 3 and label 4, the first position information of label 3 is index:[2,10), the first position information of label 4 is index:[5,8), and the second position information of the target character sequence corresponding to label pair 2 is index:[5,8). According to the second position information index:[5,8), the first position information index:[2,10) of label 3 and the first position information index:[5,8) of label 4 are updated to obtain three first position information: index:[2,5), index:[5,8) and index:[8,10).

[0162] The first position information of each text classification label in the label pair is updated according to the second position information, or two intersecting numerical intervals are updated to two non-intersecting numerical intervals according to the second position information.

[0163] For example, label pair 1 includes label 1 and label 2, the first position information of label 1 is index:[2,10), the first position information of label 2 is index:[5,10), and the second position information of the target character sequence corresponding to label pair 1 is index:[5,10). According to the second position information index:[5,10), the first position information index:[2,10) of label 1 and the first position information index:[5,10) of label 2 are updated to obtain two new first position information: index:[2,5) and index:[5,10).

[0164] In a specific implementation, the label attribute information also includes the label type of the text classification label; the label attribute information is updated according to the target character sequence, including: if the label types of the text classification labels included in the target label pair are the same, the label attribute information of the target label pair is merged; if the label types of the text classification labels included in the target label pair are different, the second position information of the target character sequence in the text to be rendered is obtained; according to the second position information, the label attribute information of the intermediate text classification label is inserted between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair; the intermediate text classification label marks the target character sequence, and the label type of the intermediate text classification label is a mixed label.

[0165] The label type of each text classification label may be one of a plurality of preset label types.

[0166] If the label types of the two text classification labels in the target label pair are the same, the label attribute information of the two text classification labels in the target label pair is merged.

[0167] In a specific implementation, the label attribute information of the two text classification labels in the target label pair is merged, and the first position information of the first text classification label in the target label pair can be changed according to the end index value of the second text classification label in the target label pair, and the label attribute information of the second text classification label is deleted.

[0168] For example, the label attribute information of the text classification label of the text to be rendered includes:

[0169] [{seqNo:1,type:'usable',index:[2,5]},{seqNo:1,type:'usable',index:[3,7]},…].

[0170] The target label pair includes label 1 and label 2.

[0171] Among them, "seqNo:1" indicates that the sequence number of the sentence hit by tag 1 in the text to be rendered is "1", and "type:'usable'" is used to indicate that the tag type of tag 1 is usable information, that is, "usable". "index:[2,5)" indicates the first position information of subtext 1 marked by tag 1 in the first sentence of the text to be rendered. Specifically, "2" is the starting index value of tag 1, and "5" is the ending index value of tag 1.

[0172] "seqNo:1" indicates that the arrangement serial number of the statement hit by label 2 in the text to be rendered is "1", and "type:'usable'" is used to indicate that the label type of label 2 is available information, that is, "usable". "index:[3,7)" indicates the first position information of the sub-text 2 marked by this label 2 in the first statement of the text to be rendered. Specifically, "3" is the start index value of this label 2, and "7" is the end index value of this label 2.

[0173] Perform a merging process on the label attribute information of label 1 and label 2. It can be to update the first position information of the sub-text marked by label 1 in the first statement of the text to be rendered from "index:[2,5)" to "index:[2,7)", and, delete the label attribute information of label 2.

[0174] After the merging process, the label attribute information of the text classification label of the text to be rendered includes:

[0175] [{seqNo:1,type:'usable',index:[2,7],…}.

[0176] If the label types of the two text classification labels in the target label pair are different, obtain the second position information of the target character sequence in the text to be rendered; according to the second position information, insert the label attribute information of the intermediate text classification label between the label attribute information of the first text classification label and the label attribute information of the second text classification label in the target label pair. The intermediate text classification label marks the target character sequence, and the label type of the intermediate text classification label is a mixed label.

[0177] The label attribute information of the first text classification label in the target label pair includes the first position information [a1,a2), and the label attribute information of the second text classification label in the target label pair includes the first position information [b1,b2).

[0178] If a2 < b2, the second position information of the target character sequence is [b1,a2). According to the second position information, when inserting the label attribute information of the intermediate text classification label between the label attribute information of the first text classification label and the label attribute information of the second text classification label in the target label pair, it can be to use the second position information [b1,a2) of this target character sequence as the first attribute information of the intermediate text classification label, and insert the first attribute information [b1,a2) of this intermediate text classification label between the first position information [a1,a2) of the first text classification label and the first position information [b1,b2) of the second text classification label. After the insertion operation is executed, the label attribute information corresponding to the text to be rendered includes: [a1,a2), [b1,a2), [b1,b2).

[0179] If a2=b2, the second position information of the target character sequence is [b1,b2). According to the second position information, the label attribute information of the intermediate text classification label is inserted between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair. This can be to use the second position information [b1,b2) of the target character sequence as the first attribute information of the intermediate text classification label, and insert the first attribute information [b1,b2) of the intermediate text classification label between the first position information [a1,a2) of the first text classification label and the first position information [b1,b2) of the second text classification label. After the insertion operation is performed, the label attribute information corresponding to the text to be rendered includes: [a1,a2), [b1,b2), [b1,b2).

[0180] If a2>b2, the second position information of the target character sequence is [b1,b2). According to the second position information, the label attribute information of the intermediate text classification label is inserted between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair. The second position information [b1,b2) of the target character sequence is used as the first attribute information of the intermediate text classification label, and the first attribute information [b1,b2) of the intermediate text classification label is inserted between the first position information [a1,a2) of the first text classification label and the first position information [b1,b2) of the second text classification label. After the insertion operation is performed, the label attribute information corresponding to the text to be rendered includes: [a1,a2), [b1,b2), [b1,b2).

[0181] In a specific implementation, if the target label pair includes text classification labels of different label types, the method further includes: changing the text position information of the target label pair; if the second arrangement sequence number of the first text classification label in the target label pair is greater than the second arrangement sequence number of the second text classification label in the target label pair, replacing the label type of the second text classification label in the target label pair with the label type of the first text classification label in the target label pair.

[0182] The inserted tag attribute information may include the first position information of the intermediate text classification tag, or the inserted tag attribute information may include the first position information of the intermediate text classification tag and the tag type of the intermediate text classification tag.

[0183] In the target label pair, the first position information [a1, a2) of the first text classification label includes a start index value a1 and an end index value a2, and the first position information [b1, b2) of the second text classification label includes a start index value b1 and an end index value b2. When there is a corresponding target character sequence for the target label pair, a2 is greater than b1. a1, a2, b1, and b2 are all natural numbers greater than 0. Before performing the insertion operation, the label attribute information corresponding to the target label pair includes: [a1, a2), [b1, b2).

[0184] If a2 < b2, the second position information of the target character sequence is [b1, a2). During the process of changing the text position information of the target label pair, the following steps can be executed:

[0185] (s11) Replace the first position information [a1, a2) of the first text classification label with the start index value b1 of the second text classification label to obtain [a1, b1).

[0186] (s12) Replace the first position information [b1, b2) of the second text classification label with the end index value a2 of the first text classification label to obtain [a2, b2).

[0187] In addition, during the process of inserting the label attribute information of the intermediate text classification label between the label attribute information of the first text classification label and the label attribute information of the second text classification label in the target label pair, the following steps can be executed:

[0188] (s13) Insert the first position information [b1, a2) of the intermediate text classification label between the first position information of the first text classification label and the first position information of the second text classification label.

[0189] In specific implementation, the execution order of the above steps (s11), (s12), and (s13) can be freely exchanged, or at least two of the steps (s11), (s12), and (s13) can be executed simultaneously.

[0190] If a2 = b2, the second position information of the target character sequence is [b1, b2). During the process of changing the text position information of the target label pair, the following steps can be executed:

[0191] (s21) Replace the first position information [a1, a2) of the first text classification label with the start index value b1 of the second text classification label to obtain [a1, b1).

[0192] (s22) Delete the first position information [b1, b2) of the second text classification label.

[0193] In addition, in the process of inserting the label attribute information of the intermediate text classification label between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair, the following steps may be performed:

[0194] (s23) Insert the first position information [b1, b2) of the intermediate text classification label after the first position information of the first text classification label.

[0195] In specific implementation, the execution order of the above-mentioned steps (s21), (s22) and (s23) can be freely exchanged, or at least two of the steps (s21), (s22) and (s23) can be executed simultaneously.

[0196] If a2>b2, the second position information of the target character sequence is [b1,b2). In the process of changing the text position information of the target label pair, the following steps can be performed:

[0197] (s31) The first position information [a1, a2) of the first text classification label is replaced by the starting index value b1 of the second text classification label to obtain [a1, b1).

[0198] (s32) The first position information [b1, b2) of the second text classification label is replaced by the end index value b2 of the second text classification label and the end index value a2 of the first text classification label to obtain [b2, a2).

[0199] In addition, in the process of inserting the label attribute information of the intermediate text classification label between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair, the following steps may be performed:

[0200] (s33) Inserting the first position information [b1, b2) of the intermediate text classification label between the first position information of the first text classification label and the first position information of the second text classification label.

[0201] In specific implementation, the execution order of the above-mentioned steps (s1), (s2) and (s3) can be freely exchanged, or at least two of the steps (s1), (s2) and (s3) can be executed simultaneously.

[0202] For example, target tag pair 1 includes tag 1 and tag 2. The first position information of tag 1 is index:[2,8), and the first position information of tag 2 is index:[5,10). Among them, "2" is the starting index value of tag 1, and "8" is the ending index value of tag 1. "5" is the starting index value of tag 2, and "10" is the ending index value of tag 2.

[0203] Change the first position information of label 1 from index:[2,8) to index:[2,5). Change the first position information of label 2 from index:[5,10) to index:[8,10). Insert the first position information of the intermediate text classification label index:[5,8) between index:[2,5) and index:[8,10).

[0204] Target tag pair 2 includes tag 3 and tag 4. The first position information of tag 3 is index:[2,8), and the first position information of tag 4 is index:[5,8). Among them, "2" is the starting index value of tag 3, and "8" is the ending index value of tag 3. "5" is the starting index value of tag 4, and "8" is the ending index value of tag 4.

[0205] Change the first position information of label 3 from index:[2,8) to index:[2,5). Delete the first position information of label 2, index:[5,8). Insert the first position information of the intermediate text classification label, index:[5,8), after index:[2,5).

[0206] The target tag pair includes tag 5 and tag 6. The first position information of tag 5 is index:[2,8), and the first position information of tag 6 is index:[5,7). Among them, "2" is the starting index value of tag 5, and "8" is the ending index value of tag 5. "5" is the starting index value of tag 6, and "7" is the ending index value of tag 6.

[0207] Change the first position information of label 5 from index:[2,8) to index:[2,5). Change the first position information of label 2 from index:[5,7) to index:[7,8). Insert the first position information of the intermediate text classification label index:[5,7) between index:[2,5) and index:[7,8).

[0208] If the second permutation sequence number of the first text classification label in the target label pair is greater than the second permutation sequence number of the second text classification label in the target label pair, the label type of the second text classification label in the target label pair is replaced by the label type of the first text classification label in the target label pair.

[0209] The second arrangement sequence number of the first text classification label in the target label pair is greater than the second arrangement sequence number of the second text classification label in the target label pair, and the above-mentioned steps (s31) to (s33) may be referred to.

[0210] After the text position information of the target label pair is changed, the sub-text annotated with the first text classification label after the change is a part of the sub-text annotated with the first text classification label before the change, and the sub-text annotated with the second text classification label after the change is also a part of the sub-text annotated with the first text classification label before the change. Therefore, the label type of the second text classification label needs to be modified.

[0211] For example, the target label pair includes label 1 and label 2. The first position information of label 1 is index: [2, 10), and the first position information of label 2 is index: [5, 8). The label type of label 1 is available information, and the label type of label 2 is abnormal information.

[0212] The text position information of the target label pair is changed, and the first position information of label 1 is changed from index: [2, 10) to index: [2, 5) and the first position information of label 2 is changed from index: [5, 8) to index: [8, 10) .

[0213] The subtext represented by index:[2,5) and the subtext represented by index:[8,10) are both part of the subtext represented by index:[2,10) before the change process. Therefore, it is necessary to replace the label type of label 2 with the label type of label 1, that is, change the label type of label 2 from "abnormal information" to "available information".

[0214] Considering that the rendering operation in the subsequent steps uses the label attribute information, therefore, according to the second position information, inserting the label attribute information of the intermediate text classification label between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair can be approximately regarded as performing a label insertion operation. Specifically, a new text classification label, namely the intermediate text classification label, is inserted between the two text classification labels included in the target label pair. This label insertion operation may cause the order of the text classification labels to be disrupted. In practical applications, step S204 and step S206 can be performed alternately. The disrupted order of the text classification labels is not conducive to determining the new second position information. Therefore, after each insertion of the label attribute information of the intermediate text classification label, the text classification labels can be reordered to avoid missing characters that are simultaneously labeled by multiple text classification labels.

[0215] In a specific implementation, the text processing method further includes: sorting the text classification labels and the inserted intermediate text classification labels to obtain a sorting result; and updating a label pair set corresponding to the text to be rendered according to the sorting result.

[0216] The label attribute information inserted into the intermediate text classification label can be roughly regarded as splitting two labels with overlapping parts into three labels that are adjacent but non-overlapping. For example, the text to be rendered is ABCDEFG, the subtext 1 marked by label 1 in the target label pair is BCD, and the subtext 2 marked by label 2 in the target label pair is DEF. After inserting the label attribute information of the intermediate text classification label, the subtext 1 marked by label 1 is changed to BC, the target character sequence marked by the intermediate text classification label is D, and the subtext 2 marked by label 2 is changed to EF.

[0217] Considering that inserting an intermediate text classification label may disrupt the original sorting results, if the original label pair is still processed, omissions may occur, for example, label pairs that should be merged are not merged, etc. Therefore, after inserting the label attribute information of each intermediate text classification label, the labels can be reordered and the label pairs can be updated.

[0218] For example, the text to be rendered is ABCDEFG, the subtext 1 marked by label 1 in the target label pair is BCD, the subtext 2 marked by label 2 in the target label pair is DEF, the next label pair of the target label pair includes label 2 and label 3, and the subtext 3 marked by label 3 is EFG.

[0219] If the label pairs are not reordered and updated, and are processed in the order of the original target label pair and the next label pair, the label attribute information of the text to be rendered will be changed to: Label 1: BC, label type 1; intermediate text classification label 1: D, mixed label; intermediate text classification label 2: EF, mixed label; Label 3: G, label type 2. The two middle labels should have been merged but were omitted.

[0220] Therefore, after each execution of inserting the label attribute information of the intermediate text classification label, the following steps can be performed: sorting the text classification labels and the inserted intermediate text classification labels to obtain the sorting results; and updating the label pair set corresponding to the text to be rendered according to the sorting results.

[0221] The text classification labels and the inserted intermediate text classification labels are sorted by performing a bubble sort process based on the first position information of the text classification labels and the first position information of the inserted intermediate text classification labels to obtain a sorting result. For details, please refer to the corresponding instructions for sorting the text classification labels based on the first position information.

[0222] Updating the label pair set corresponding to the text to be rendered according to the sorting result may be to determine a label pair consisting of two adjacent text classification labels in the sorting result, and based on the determined label pair, update the label pair set corresponding to the text to be rendered. Determining the label pair consisting of two adjacent text classification labels in the sorting result may refer to the aforementioned determination of a label pair consisting of two adjacent text classification labels in the text classification labels after sorting to obtain the corresponding description part of the label pair set corresponding to the text to be rendered.

[0223] For example, sorting is performed according to the first sorting sequence number. The smaller the first sorting sequence number, the closer it is to the front. The original order is label 1, label 2, label 3, label 4, label 5. The label pair set includes: [label 1, label 2], [label 2, label 3], [label 3, label 4], [label 4, label 5].

[0224] A new tag X is inserted between tag 2 and tag 3. Tag X is the aforementioned intermediate text classification tag. After the tag attribute information of tags 2 and 3 is updated, the first arrangement number c1 in the first position information [c1, c2) of subtext 3 marked by tag 3 becomes larger. This may cause the first arrangement number of tag 4, which is originally located after tag 3, to be smaller than the first arrangement number of the updated tag 3. After re-arrangement, it becomes: tag 1, tag 2, tag X, tag 4, tag 3, tag 5.

[0225] After the order is changed, the constructed label pairs are also updated accordingly, and the updated label pair set becomes: [label 1, label 2], [label 2, label X], [label X, label 4] [label 4, label 3], [label 3, label 5].

[0226] Next, in order to better understand the alternate execution of step S204 and step S206, Figure 4-Figure 6 The specific processing method of the target character sequence is illustrated by way of example.

[0227] Figure 4 A second partial flow chart of a text processing method provided in an embodiment of the present application.

[0228] Step S402, initializing data.

[0229] During specific implementation, a preset data structure may be created, and the initial value of i may be set to 0. i is a custom variable.

[0230] The preset data structure may be a Map structure. Map is a data structure, and ES6 (ECMAScript6) provides a Map data structure. ES6 is a standard of the officially released JavaScript language. The Map structure is similar to an object and is also a collection of key-value pairs, but the scope of the "key" is not limited to strings, and values ​​of various types can be used as keys.

[0231] Before creating the preset data structure, the tag attribute information of the text classification tag of the text to be rendered can be obtained. The tag attribute information of each text classification tag includes a sentence sequence number, first position information, and tag type. For obtaining the tag attribute information, please refer to the corresponding description of the aforementioned step S202.

[0232] For example, [{seqNo:1, type: 'usable', index: [2, 8)}, {seqNo:1, type: 'danger', index: [3, 7)}, ...].

[0233] "{seqNo:1, type:'usable', index:[2,8]}" represents the label attribute information of a text classification label, where "seqNo:1" indicates that the arrangement number of the sentence hit by the text classification label in the text to be rendered is "1", "type:'usable'" indicates that the label type of the text classification label is the available information "usable", and "index:[2,8)" indicates the first position information of the subtext marked by the text classification label in the first sentence of the text to be rendered. Specifically, "2" is the starting index value of the text classification label, and "8" is the ending index value of the text classification label. "{seqNo:1, type:'danger', index:[3,7)}" is similar to "{seqNo:1, type:'usable', index:[2,8)}", and will not be repeated one by one.

[0234] Before creating the preset data structure, a text information array of the text to be rendered may also be obtained. The text information array includes a plurality of text information, wherein each text information may include a sentence sequence number and a sentence text content. Each text information corresponds to a sentence. When the text to be rendered includes k sentences, the text information array of the text to be rendered includes k text information, where k is a natural number greater than or equal to 1.

[0235] For example, the text information array is [{seqNo:1, content: sentence text content 1}, {seqNo:2, content: sentence text content 2}, …]. Among them, "seqNo:1" means that the sequence number of sentence 1 in the text to be rendered is "1", and "content: sentence text content 1" means that the content of sentence 1 is "sentence text content 1". "seqNo:2" means that the sequence number of sentence 2 in the text to be rendered is "2", and "content: sentence text content 2" means that the content of sentence 2 is "sentence text content 2".

[0236] In the process of creating the preset data structure, the text information array of the obtained text to be rendered can be traversed, and the sentence sequence number in the tag attribute information of the text classification tag is matched according to the sentence sequence number of each text information, and the hit content array of each text information in the expression attribute information of the text classification tag is obtained, and the preset data structure is configured according to the hit content array. Exemplarily, the hit content array can be represented by curTextHitInfoList.

[0237] Matching the sentence number in the label attribute information of the text classification label according to the sentence number of each text information means merging the text information with the same sentence number with the label attribute information of the text classification label to obtain a hit content array corresponding to the sentence number.

[0238] The hit content array of each sentence may include a sentence sequence number, sentence text content, and label attribute information of one or more text classification labels that hit the sentence.

[0239] Taking the preset data structure as a Map structure as an example, the Map structure may be a set of key-value pairs, each of which includes a key and a value that have a corresponding relationship.

[0240] The preset data structure is configured according to the hit content array, which can be to set the key-value pairs in the Map structure one by one, wherein the key is the statement sequence number, i.e., seqNo, and the value is an object, which can include the statement text content and the hit content array curTextHitInfoList.

[0241] After the preset data structure is created, the hit content array curTextHitInfoList may be sorted based on the start index value. For details, please refer to the corresponding description section of sorting the text classification labels according to the first position information.

[0242] Step S404: Check whether the traversal of the preset data structure is completed.

[0243] If the traversal is completed, step S422 is executed; if the traversal is not completed, step S406 is executed.

[0244] The key-value pair currently being processed is the i+1th key-value pair in the preset data structure, which corresponds to a sentence in the text to be rendered.

[0245] For example, i=0, Map[0] can represent the first key-value pair in the Map structure. The Map includes a total of 10 key-value pairs, which can be represented by Map[0]-Map[9] respectively.

[0246] If i is equal to the number of key-value pairs in the preset data structure, it means that the preset data structure has been traversed; if i is less than the number of key-value pairs in the preset data structure, it means that the preset data structure has not been traversed.

[0247] Step S406, the current hit information index array length>0.

[0248] The current hit information refers to the i+1th key-value pair in the preset data structure, for example, Map[i].

[0249] The index array refers to an array consisting of the first position information of one or more text classification labels of the hit sentence.

[0250] For the sentence corresponding to the current hit information in the text to be rendered, when the current hit information index array length > 0, the number of text classification labels that hit the sentence is greater than 0; when the current hit information index array length = 0, there is no text classification label that hits the sentence.

[0251] If the current hit information index array length>0, execute step S408; if the current hit information index array length=0, execute step S420.

[0252] Step S408, j=0; obtain the current statement hit information array.

[0253] j can be a custom variable, and its initial value is 0.

[0254] The current sentence hit information array may be a hit content array curTextHitInfoList in the i+1th key-value pair in the preset data structure. The hit content array may include label attribute information of the text classification label after sorting.

[0255] The array length of the hit content array may be determined by the number of text classification labels of the hit sentence.

[0256] Step S410, j<array length.

[0257] Determine whether j is less than the array length of the hit content array.

[0258] Exemplarily, the array length of the hit content array may be represented by curTextHitInfoList.length.

[0259] If j<array length, execute step S412; if j≥array length, execute step S420.

[0260] Step S412: whether the j+1th element exists.

[0261] Whether the j+1th element in the hit content array exists refers to whether the label attribute information of the j+1th text classification label in the hit content array exists.

[0262] If it exists, execute step S414; if it does not exist, execute step S418.

[0263] Step S414, execute sub-process 1.

[0264] The specific content of sub-process 1 can be referred to as follows Figure 5 .

[0265] Step S416, j=j+1.

[0266] Step S418, exit the current loop.

[0267] Step S420, i=i+1.

[0268] Step S422, returning to the preset data structure.

[0269] Exemplarily, in order to easily distinguish the preset data structure created when initializing data in step S402 from the preset data structure returned in this step, the preset data structure created in step S402 can be called Map, and the preset data structure returned in step S422 can be called finalMap.

[0270] Figure 5 The third partial flowchart of a text processing method provided in an embodiment of the present application. Figure 5 Shown above Figure 4 Sub-process 1 in step S414.

[0271] Step S502: Check whether there are any overlapping parts between adjacent hit tags.

[0272] If there is an overlapping part, execute step S504; if there is no overlapping part, end.

[0273] Considering Figure 5 Shown above Figure 4Sub-process 1 in step S414 of the embodiment is as follows: Figure 4 As shown, continue to execute step S416 and subsequent steps.

[0274] Adjacent hit labels refer to two text classification labels whose label attribute information is adjacent in the hit content array.

[0275] Considering that the hit content array includes the label attribute information of the sorted text classification labels, it can be determined whether adjacent hit labels have overlapping parts according to the first position information of the subtexts annotated by two adjacent text classification labels.

[0276] This step may refer to the corresponding description of the aforementioned step S204. The overlapping part of adjacent hit labels is the target character sequence.

[0277] Step S504: Check whether the types of adjacent hit tags are the same.

[0278] Whether the tag types of adjacent hit tags are the same; if they are the same, execute step S508; if they are different, execute step S506.

[0279] Step S506, execute sub-process 2.

[0280] The specific content of sub-process 2 can be referred to as follows Figure 6 .

[0281] Step S508: Take the union of the two labels, assign it to the first label, and delete the second label.

[0282] After the adjacent hit labels are merged, j=j-1 can be set so that the merged label and the next label after the second label are subsequently processed as adjacent hit labels.

[0283] This step may refer to the corresponding description part of merging the label attribute information of the target label pair if the label types of the text classification labels included in the target label pair are the same.

[0284] Step S510, storing the processed hit information into a preset data structure.

[0285] Figure 6 This is the fourth partial flowchart of a text processing method provided in an embodiment of the present application. Figure 6 Shown above Figure 5 Sub-process 2 in step S506.

[0286] Step S602, assign the index value of the currently traversed hit tag to: [the start index of the current hit tag, the start index of the next hit tag].

[0287] The current hit label can refer to the first text classification label in the aforementioned target label pair, and the next hit label can refer to the second text classification label in the aforementioned target label pair.

[0288] Step S604, assigning the index value of the next hit tag to: [the smaller value of the two tag end indexes, the larger value of the two tag end indexes].

[0289] For steps S602 to S604 , reference may be made to the corresponding description section of the aforementioned process of changing the text position information of the target tag pair.

[0290] Step S606: Whether the end index value of the current tag is greater than the end index value of the next tag.

[0291] If yes, execute step S608; if no, execute step S610.

[0292] Step S608: assign the tag type of the next tag to the hit tag type of the current tag.

[0293] This step may refer to the corresponding description part of replacing the label type of the second text classification label in the target label pair by the label type of the first text classification label in the target label pair.

[0294] Step S610, add an item indicating the intersection of two tags after the current tag, the index value is [the start index of the original next tag, the smaller value of the end index of the original current tag and the next tag], and set the tag type to a mixed tag.

[0295] In specific implementation, the splice method of JavaScript can be used to add an item to the current tag to represent the intersection of two tags. JavaScript is a lightweight, interpreted or just-in-time compiled programming language with function priority. The splice method can be used to delete elements in an array, and can also be used to add new elements to an array.

[0296] Adding an item representing the intersection of two labels can be roughly regarded as a label insertion operation, that is, a new label is inserted after the current label.

[0297] Step S610 can refer to the aforementioned if the label types of the text classification labels included in the target label pair are different, then obtain the second position information of the target character sequence in the text to be rendered; according to the second position information, insert the corresponding description part of the label attribute information of the intermediate text classification label between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair.

[0298] Step S612, re-bubble sort the tags according to the start index value.

[0299] After each label insertion operation, the hit content array may be out of order, for example, it is not sorted from small to large according to the starting index value. In this case, the hit content array needs to be bubble sorted according to the starting index value and a new preset data structure is returned to avoid missing characters that are labeled by multiple text classification labels at the same time.

[0300] Since the technical concept is the same, Figure 4-Figure 6 The implementation method shown is described in a relatively simple manner, and for the relevant parts, please refer to the corresponding description of the embodiments of the present application in the previous text.

[0301] Step S208: Rendering the text to be rendered according to the updated tag attribute information.

[0302] Rendering the text to be rendered according to the updated label attribute information can be performed by adding a corresponding label style for each text classification label in the updated label attribute information, and then rendering the text to be rendered according to the label style of the text classification label to display the text annotation result.

[0303] By rendering the text to be rendered according to the updated label attribute information, it is possible to distinguish and display a character sequence that is labeled with a single text classification label before executing the text processing method provided by the embodiment of the present application, and a target character sequence that is labeled with at least two text classification labels before executing the text processing method provided by the embodiment of the present application, thereby making the text labeling result more intuitive.

[0304] In a specific implementation, rendering processing is performed on the text to be rendered according to the updated tag attribute information, including: determining the rendering method of the text classification label according to the tag type of the text classification label in the updated tag attribute information; rendering processing is performed on the sub-text or target character sequence marked by the text classification label in the text to be rendered according to the rendering method of the text classification label.

[0305] During specific implementation, the corresponding relationship between the preset tag type and the rendering mode may be preconfigured.

[0306] The rendering mode can change the visual effect of the text to be rendered in one or more dimensions, such as font color, font, background color, etc.

[0307] The label type of each text classification label can be one of a plurality of preset label types. Therefore, after determining the label type of the text classification label in the label attribute information after the update processing, for the label type of any of the text classification labels, the corresponding relationship between the label type and the preset label type and the rendering mode can be combined to determine the rendering mode of the text classification label, and then, the sub-text annotated with the text classification label in the text to be rendered is rendered according to the rendering mode of the text classification label.

[0308] For example, the multiple preset label types are: available information, abnormal information, prompt information, and mixed labels. The sub-text marked with the text classification label of available information can be rendered in yellow font through the rendering method corresponding to available information, the sub-text marked with the text classification label of abnormal information can be rendered in red font through the rendering method corresponding to abnormal information, the sub-text marked with the text classification label of prompt information can be rendered in blue font through the rendering method corresponding to prompt information, and the target character sequence marked with the text classification label of mixed label can be rendered in green font through the rendering method corresponding to mixed labels.

[0309] In the quality inspection scenario, rendering sub-text or target character sequences annotated with text classification labels of different label types through different rendering methods is conducive to intuitively displaying the text annotation results, which reflect the quality inspection results of the text to be rendered.

[0310] The following can be combined Figure 7 and Figure 8 The rendering process flow is illustrated by way of example. Figure 7 This is the fifth partial flowchart of a text processing method provided in an embodiment of the present application. Figure 7 The specific implementation process of how to perform rendering after obtaining the updated tag attribute information is shown.

[0311] Step S702, obtaining a preset data structure and label attribute information of a text classification label; i=0.

[0312] The preset data structure obtained in this step can refer to the above Figure 4 The preset data structure finalMap returned in step S422. In addition, the preset data structure obtained in this step can also be regarded as the tag attribute information after the update process.

[0313] In this step, the label attribute information of the text classification label can be obtained by referring to the corresponding description part of step S202.

[0314] i can be a custom variable, and its initial value is 0.

[0315] Step S704, i<array length.

[0316] After obtaining the label attribute information of the text classification label, the label attribute information can be sorted into an array format to obtain a label attribute information array, in which each element is the label attribute information of a text classification label, and the array length in this step is the length of the label attribute information array. The array length can be determined by the number of text classification labels of the text to be rendered.

[0317] If i < array length, execute step S706; if i ≥ array length, end.

[0318] Step S706, find the corresponding hit content array in the preset data structure according to the sentence sequence number of the current hit tag, and determine whether there is a text classification tag that hits the current sentence.

[0319] The current hit label is the text classification label corresponding to the i-th element in the label attribute information array.

[0320] The preset data structure includes a key-value pair set, each key-value pair in the key-value pair set includes a key and a value, wherein the key is a statement sequence number, namely seqNo, and the value is an object, which may include statement text content and a hit content array curTextHitInfoList.

[0321] The tag attribute information of the current hit tag may include a sentence number, which can be used to query the hit content array corresponding to the current hit tag in the preset data structure. Then, based on the hit content array, it can be determined whether there is a text classification tag that hits the current sentence. Figure 4 Corresponding description section.

[0322] If there is a text classification label that matches the current sentence, execute step S710; if there is no text classification label that matches the current sentence, execute step S708.

[0323] Step S708, i++.

[0324] i++ is used to indicate i=i+1.

[0325] Step S710, obtaining the current statement hit label.

[0326] Step S712, traverse the hit content array, and add an identifier representing the tag type to the hit tag index array.

[0327] The hit label index array may include first position information of subtexts annotated with one or more text classification labels that hit the same sentence.

[0328] In specific implementation, the tag type can be added after the first position information through the concat method of js.

[0329] Step S714, deduplicate the hit content array.

[0330] In specific implementation, the getUniqueIndexList method may be used to remove duplicates in the hit content array according to whether the first position information is the same. The getUniqueIndexList method may be used to remove duplicate content in an array.

[0331] In addition, the execution order of step S712 and step S714 can be exchanged.

[0332] Step S716, execute sub-process 3.

[0333] Sub-process 3 is used to wrap the text classification label with an html (Hyper Text Markup Language) tag and set the corresponding class.

[0334] HTML is a language used to describe web pages. The class tag can be used to attach one or more class names to HTML elements. These names are usually used to define a style or multiple style rules for multiple elements, and the same style can be specified by multiple class names. By using the class tag, the HTML structure and style layers can be separated.

[0335] The specific content of sub-process 3 can be referred to as follows Figure 8 .

[0336] Step S718, traverse the preset data structure and concatenate all sentence text contents of each item in the preset data structure.

[0337] Traverse the finalMap and concatenate all the statement text contents of each item in finalMap. In addition, you can also add some events and outer html tags and classes to make the statement underlined when you click on any statement.

[0338] Figure 8 This is the sixth partial flowchart of a text processing method provided in an embodiment of the present application. Figure 8 Shown above Figure 7 Sub-process 3 in step S716.

[0339] Step S802, obtaining rendering initialization data.

[0340] The rendering initialization data includes the sentence text content of the target sentence hit by the text classification tag to be processed in the sentence to be rendered, the tag attribute information after update processing, the initialization HTML string and an object for mapping the tag type and the class name. And, i=0.

[0341] i is a custom variable whose initial value is 0.

[0342] The updated label attribute information may include the first position information of the subtext annotated by each text classification label of the hit content array of the target sentence and the label type of each text classification label.

[0343] For example, the initialization html string can be represented by str. The object for mapping the tag type and the class name can be represented by itemAttrClass.

[0344] Step S804, i is less than the array length.

[0345] The array length in this step refers to the array length of the hit content array of the target sentence.

[0346] If i is less than the array length, execute step S806; if i is greater than or equal to the array length, execute step S820.

[0347] Step S806, obtaining the content corresponding to the current hit tag index in the text.

[0348] Get the subtext annotated by the text classification label to be processed in the target sentence.

[0349] Step S808: Check whether the value of the content corresponding to the current hit tag index exists in the text.

[0350] If it exists, execute step S810; if it does not exist, execute step S812.

[0351] Step S810, wrap the text corresponding to the currently traversed tag with an HTML tag, set the corresponding style, and then splice it into the string.

[0352] Wrap the string marked with the text classification label to be processed in the target sentence with HTML tags, and set the corresponding style and splice it to the aforementioned initialization HTML string str.

[0353] In the specific implementation, when wrapping the HTML tag, the corresponding class can be added to the tag according to the tag type, so as to set the CSS (Cascading Style Sheets) style such as color, font background color, etc. CSS is a computer language used to express file styles.

[0354] By including html tags and adding classes, the tag type of the text classification tag can be bound to the rendering method of the text classification tag. This is beneficial for distinguishing and displaying sub-texts or target character sequences marked by text classification tags of different tag types through rendering processing when there are multiple tag types.

[0355] Step S812, calculating the following missed text according to the end index of the current hit tag and the start index of the next hit tag.

[0356] Step S814, whether the hit text exists.

[0357] Step S816, i=i+1.

[0358] Step S818, concatenate the missed texts to the character string.

[0359] Step S820, return the character string.

[0360] Since the technical concept is the same, Figure 7-Figure 8 The implementation method shown is described in a relatively simple manner, and for the relevant parts, please refer to the corresponding description of the embodiments of the present application in the previous text.

[0361] In an embodiment of the present application, first, obtain the label attribute information of the text classification label of the text to be rendered; each text classification label marks a sub-text in the text to be rendered; the label attribute information includes the first position information of the sub-text marked by the text classification label in the text to be rendered; then, determine the target character sequence in the text to be rendered according to the first position information; the target character sequence belongs to the sub-text marked by multiple text classification labels; then, according to the target character sequence, update the label attribute information; finally, render the text to be rendered according to the updated label attribute information. In this way, considering that each text classification label marks a sub-text in the text to be rendered, and that when the text is marked in advance, different text classification labels may not be marked in the same batch, so the sub-texts marked by different text classification labels may have overlapping parts, and the overlapping parts are the target character sequences marked by multiple text classification labels at the same time. The overlapping part is determined by the first position information of each text classification label, and the label attribute information is then updated using the overlapping part, and the text to be rendered is rendered according to the updated label attribute information. This helps to more clearly distinguish between local text annotated by only a single text classification label and local text annotated by multiple text classification labels in the text to be rendered, and optimizes the display page of the text annotation results.

[0362] Based on the same technical concept, Fig. 9 An application interface diagram of a text processing method provided in an embodiment of the present application. Fig. 9 A display page of audio quality inspection results of an audio and video quality inspection system that applies the text processing method provided by the aforementioned method embodiment is shown.

[0363] The main function of the audio and video quality inspection system is to conduct quality inspection on multimedia material data based on the construction of the quality inspection model, covering various business scenarios, such as customer service, marketing, collection, retail, etc. By analyzing the quality inspection data, it is helpful to proactively discover potential risks and opportunities. Multimedia materials can be pictures, videos, audio, etc.

[0364] like Fig. 9 As shown, the display interface 900 of the audio quality inspection result of the audio and video quality inspection system includes tag detail information 902 , material content 904 , and an audio playback area 906 .

[0365] The label detail information 902 includes the text annotation results of the text to be inspected. In the text annotation results, the text to be inspected hits the text classification label with the label type of "available information" once, and the text to be inspected hits the text classification label with the label type of "abnormal information" once.

[0366] The material content 904 may include the rendered text to be inspected, which is the result of processing the text to be inspected by using the text processing method provided in the above method embodiment after obtaining the text annotation result of the text to be inspected.

[0367] like Fig. 9 As shown, in the text to be inspected after the rendering process, the sub-text marked with the text classification label with the label type of "available information" is rendered by changing the original font to the first font, and the sub-text marked with the text classification label with the label type of "abnormal information" is rendered by changing the original font to the second font. In the case where the target character sequence belongs to the sub-text marked with two text classification labels, the rendering method of the target character sequence is to add underline.

[0368] The audio data 1 played in the audio playing area 906 is the original material for generating the text to be inspected. The text to be inspected can be obtained by performing speech-to-text processing on the audio data 1. The conversion process is performed before the quality inspection.

[0369] In addition, by creating events, adding HTML tags, and creating classes in the tags added to the quality inspection text, it is possible to click on a certain sentence in the material content 904, and the sentence will be underlined. According to the start time point of the sentence in the audio data, the corresponding position in the audio is calculated and jumped to the position for audio playback. If the text content of the sentence includes the target character sequence, the mouse hovering point position can display detailed hit results, that is, the different hit situations of each tag type in the sentence text are displayed by category, and it can also support cross-tag search for material content.

[0370] Since the technical concept is the same, the description in this embodiment is relatively simple, and the relevant parts may refer to the corresponding description of the method embodiment provided above.

[0371] Based on the same technical concept, Fig.10 Another application interface diagram of a text processing method provided in an embodiment of the present application. Fig.10 A display page of video quality inspection results of an audio and video quality inspection system to which the text processing method provided by the aforementioned method embodiment is applied is shown.

[0372] like Fig.10 As shown, the display interface 1000 of the video quality inspection result of the audio and video quality inspection system includes tag detail information 1002 , material content 1004 , and a video playback area 1006 .

[0373] The label detail information 1002 includes the text annotation results of the text to be inspected. In the text annotation results, the text to be inspected hits the text classification label with the label type of "available information" once, and the text to be inspected hits the text classification label with the label type of "abnormal information" once.

[0374] The material content 1004 may include the rendered text to be inspected, which is the result of processing the text to be inspected by using the text processing method provided in the above method embodiment after obtaining the text annotation result of the text to be inspected.

[0375] like Fig.10 As shown, in the text to be inspected after the rendering process, the sub-text marked with the text classification label with the label type of "available information" is rendered by changing the original font to the first font, and the sub-text marked with the text classification label with the label type of "abnormal information" is rendered by changing the original font to the second font. The target character sequence in the text to be inspected is rendered by adding underlines.

[0376] The video data 1 played in the video playing area 1006 is the original material for generating the text to be checked. The text to be checked can be obtained by performing speech-to-text processing on the audio sub-data of the video data 1. The conversion process is performed before the quality inspection.

[0377] In addition, by creating events, adding HTML tags, and creating classes in the tags added to the quality inspection text, it is possible to click on a certain sentence in the material content 1004, and the sentence will be underlined. According to the start time point of the sentence in the video data, the corresponding position in the video is calculated and the video is played at that position. If the text content of the sentence includes the target character sequence, the mouse hovering point position can display detailed hit results, that is, the different hit situations of each tag type in the sentence are displayed by category, and it can also support cross-tag search for material content.

[0378] Since the technical concept is the same, the description in this embodiment is relatively simple, and the relevant parts may refer to the corresponding description of the method embodiment provided above.

[0379] An embodiment of a text processing device provided in this specification is as follows:

[0380] In the above-mentioned embodiment, a text processing method is provided. Based on the same technical concept, the embodiment of the present application also provides a text processing device, which is described below in conjunction with the accompanying drawings.

[0381] Fig.11Schematic diagram of a text processing device provided in an embodiment of the present application. This embodiment provides a text processing device 1100, including:

[0382] An acquiring unit 1102 is configured to acquire label attribute information of a text classification label of a text to be rendered; each of the text classification labels annotates a subtext of the text to be rendered; the label attribute information includes first position information of the subtext annotated by the text classification label in the text to be rendered;

[0383] A determining unit 1104 is configured to determine a target character sequence in the text to be rendered according to the first position information; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels;

[0384] An updating unit 1106, configured to update the tag attribute information according to the target character sequence;

[0385] The rendering unit 1108 is used to render the text to be rendered according to the updated tag attribute information.

[0386] Optionally, when determining a target character sequence in the text to be rendered according to the first position information, the determining unit 1104 performs the following steps:

[0387] Sorting the text classification labels according to the first position information;

[0388] Determine a label pair consisting of two adjacent text classification labels in the sorted text classification labels to obtain a label pair set corresponding to the text to be rendered;

[0389] The target character sequence in the text to be rendered is determined according to the text position information of the tag pair in the tag pair set; the text position information of the tag pair includes the first position information of the subtexts annotated by the two text classification tags in the tag pair.

[0390] Optionally, for each of the text classification labels, the first position information of the subtext annotated by the text classification label is determined by the first arrangement sequence number of the first character in the subtext annotated by the text classification label in the text to be rendered and the second arrangement sequence number of the last character in the subtext annotated by the text classification label in the text to be rendered; when determining the target character sequence in the text to be rendered according to the text position information of the label pairs in the label pair set, the determining unit 1104 performs the following steps:

[0391] Comparing the second permutation sequence number of the first text classification label in the target label pair with the first permutation sequence number of the second text classification label in the target label pair to obtain a sequence number comparison result;

[0392] If the serial number comparison result indicates that the sub-text marked with the first text classification label in the target label pair overlaps with the sub-text marked with the second text classification label in the target label pair, then the target character sequence corresponding to the target label pair is determined in the text to be rendered according to the second arrangement serial number of the first text classification label in the target label pair and the first arrangement serial number of the second text classification label in the target label pair.

[0393] Optionally, the label attribute information further includes a label type of the text classification label; when the updating unit 1106 updates the label attribute information according to the target character sequence, the updating unit 1106 performs the following steps:

[0394] If the text classification labels included in the target label pair have the same label type, merging the label attribute information of the target label pair;

[0395] If the label types of the text classification labels included in the target label pair are different, the second position information of the target character sequence in the text to be rendered is obtained; according to the second position information, the label attribute information of the intermediate text classification label is inserted between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair; the intermediate text classification label marks the target character sequence, and the label type of the intermediate text classification label is a mixed label.

[0396] Optionally, when rendering the text to be rendered according to the updated tag attribute information, the rendering unit 1108 performs the following steps:

[0397] Determining a rendering method of the text classification label according to the label type of the text classification label in the label attribute information after the update process;

[0398] According to the rendering method of the text classification label, the sub-text or target character sequence marked by the text classification label in the text to be rendered is rendered.

[0399] Optionally, if the text classification labels included in the target label pair are of different label types, the text processing device 1100 further includes:

[0400] A changing unit, used for changing the text position information of the target tag pair;

[0401] A replacement unit is used to replace the label type of the second text classification label in the target label pair with the label type of the first text classification label in the target label pair if the second arrangement sequence number of the first text classification label in the target label pair is greater than the second arrangement sequence number of the second text classification label in the target label pair.

[0402] Optionally, the text processing device 1100 further includes:

[0403] A sorting unit, used for sorting the text classification labels and the inserted intermediate text classification labels to obtain a sorting result;

[0404] The updating unit is further configured to update the tag pair set corresponding to the text to be rendered according to the sorting result.

[0405] In an embodiment of the present application, a text processing device includes: an acquisition unit, used to acquire label attribute information of a text classification label of a text to be rendered; each text classification label annotates a subtext in the text to be rendered; the label attribute information includes the first position information of the subtext annotated by the text classification label in the text to be rendered; a determination unit, used to determine a target character sequence in the text to be rendered according to the first position information; the target character sequence belongs to a subtext annotated by multiple text classification labels; an update unit, used to update the label attribute information according to the target character sequence; a rendering unit, used to render the text to be rendered according to the updated label attribute information. In this way, considering that each text classification label annotates a subtext in the text to be rendered, and that when the text is annotated in advance, different text classification labels may not be obtained by the same batch, the subtexts annotated by different text classification labels may have overlapping parts, and the overlapping parts are the target character sequences annotated by multiple text classification labels at the same time. The overlapping part is determined by the first position information of each text classification label, and the label attribute information is then updated using the overlapping part, and the text to be rendered is rendered according to the updated label attribute information. This helps to more clearly distinguish between local text annotated by only a single text classification label and local text annotated by multiple text classification labels in the text to be rendered, and optimizes the display page of the text annotation results.

[0406] Corresponding to the above-described text processing method, based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the above-provided text processing method. Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0407] like Fig.12As shown, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 1201 and memory 1202, and the memory 1202 may store one or more storage applications or data. Among them, the memory 1202 may be a short-term storage or a persistent storage. The application stored in the memory 1202 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 1201 may be configured to communicate with the memory 1202 to execute a series of computer executable instructions in the memory 1202 on the electronic device. The electronic device may also include one or more power supplies 1203, one or more wired or wireless network interfaces 1204, one or more input / output interfaces 1205, one or more keyboards 1206, etc.

[0408] In a specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs configured to be executed by one or more processors include the following computer executable instructions:

[0409] Acquire label attribute information of a text classification label of a text to be rendered; each of the text classification labels marks a subtext in the text to be rendered; the label attribute information includes first position information of the subtext marked by the text classification label in the text to be rendered;

[0410] According to the first position information, a target character sequence is determined in the text to be rendered; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels;

[0411] According to the target character sequence, updating the tag attribute information;

[0412] The text to be rendered is rendered according to the updated tag attribute information.

[0413] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions. When the computer-executable instructions are executed by a processor, the following process is implemented:

[0414] Acquire label attribute information of a text classification label of a text to be rendered; each of the text classification labels marks a subtext in the text to be rendered; the label attribute information includes first position information of the subtext marked by the text classification label in the text to be rendered;

[0415] According to the first position information, a target character sequence is determined in the text to be rendered; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels;

[0416] According to the target character sequence, updating the tag attribute information;

[0417] The text to be rendered is rendered according to the updated tag attribute information.

[0418] It should be noted that the embodiment of the computer-readable storage medium in this specification and the embodiment of the text processing method in this specification are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding method mentioned above, and the repeated parts will not be repeated.

[0419] Another embodiment of the present disclosure further provides a computer program product, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following process is implemented:

[0420] Acquire label attribute information of a text classification label of a text to be rendered; each of the text classification labels marks a subtext in the text to be rendered; the label attribute information includes first position information of the subtext marked by the text classification label in the text to be rendered;

[0421] According to the first position information, a target character sequence is determined in the text to be rendered; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels;

[0422] According to the target character sequence, updating the tag attribute information;

[0423] The text to be rendered is rendered according to the updated tag attribute information.

[0424] The computer program product in the embodiment of the present disclosure can implement each process of the above-mentioned text processing method embodiment and achieve the same effect and function, which will not be repeated here.

[0425] In an embodiment of the present application, first, obtain the label attribute information of the text classification label of the text to be rendered; each text classification label marks a sub-text in the text to be rendered; the label attribute information includes the first position information of the sub-text marked by the text classification label in the text to be rendered; then, determine the target character sequence in the text to be rendered according to the first position information; the target character sequence belongs to the sub-text marked by multiple text classification labels; then, according to the target character sequence, update the label attribute information; finally, render the text to be rendered according to the updated label attribute information. In this way, considering that each text classification label marks a sub-text in the text to be rendered, and that when the text is marked in advance, different text classification labels may not be marked in the same batch, so the sub-texts marked by different text classification labels may have overlapping parts, and the overlapping parts are the target character sequences marked by multiple text classification labels at the same time. The overlapping part is determined by the first position information of each text classification label, and the label attribute information is then updated using the overlapping part, and the text to be rendered is rendered according to the updated label attribute information. This helps to more clearly distinguish between local text annotated by only a single text classification label and local text annotated by multiple text classification labels in the text to be rendered, and optimizes the display page of the text annotation results.

[0426] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0427] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the embodiments of the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this specification may adopt the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0428] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable electronic device to produce a machine, so that the instructions executed by the processor of the computer or other programmable electronic device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0429] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable electronic device to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0430] These computer program instructions may also be loaded onto a computer or other programmable electronic device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0431] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0432] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0433] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0434] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0435] Embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0436] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0437] The above description is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this document should be included in the scope of the claims of this document.

Claims

1. A text processing method, characterized in that: include: Acquire label attribute information of a text classification label of the text to be rendered; each of the text classification labels marks a subtext in the text to be rendered; The tag attribute information includes first position information of the subtext marked by the text classification tag in the text to be rendered; According to the first position information, a target character sequence is determined in the text to be rendered; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels; According to the target character sequence, updating the tag attribute information; The text to be rendered is rendered according to the updated tag attribute information.

2. The method according to claim 1, characterized in that The step of determining a target character sequence in the text to be rendered according to the first position information includes: Sorting the text classification labels according to the first position information; Determine a label pair consisting of two adjacent text classification labels in the sorted text classification labels to obtain a label pair set corresponding to the text to be rendered; The target character sequence in the text to be rendered is determined according to the text position information of the tag pair in the tag pair set; the text position information of the tag pair includes the first position information of the subtexts annotated by the two text classification tags in the tag pair.

3. The method according to claim 2, characterized in that For each of the text classification labels, the first position information of the subtext marked by the text classification label is determined by the first arrangement number of the first character in the subtext marked by the text classification label in the text to be rendered and the second arrangement number of the last character in the subtext marked by the text classification label in the text to be rendered; determining the target character sequence in the text to be rendered according to the text position information of the label pairs in the label pair set includes: Comparing the second permutation sequence number of the first text classification label in the target label pair with the first permutation sequence number of the second text classification label in the target label pair to obtain a sequence number comparison result; If the serial number comparison result indicates that the sub-text marked with the first text classification label in the target label pair overlaps with the sub-text marked with the second text classification label in the target label pair, then the target character sequence corresponding to the target label pair is determined in the text to be rendered according to the second arrangement serial number of the first text classification label in the target label pair and the first arrangement serial number of the second text classification label in the target label pair.

4. The method according to claim 3, characterized in that The label attribute information also includes the label type of the text classification label; and the updating process of the label attribute information according to the target character sequence includes: If the text classification labels included in the target label pair have the same label type, merging the label attribute information of the target label pair; If the label types of the text classification labels included in the target label pair are different, the second position information of the target character sequence in the text to be rendered is obtained; according to the second position information, the label attribute information of the intermediate text classification label is inserted between the label attribute information of the first text classification label in the target label pair and the label attribute information of the second text classification label in the target label pair; the intermediate text classification label marks the target character sequence, and the label type of the intermediate text classification label is a mixed label.

5. The method according to claim 4, characterized in that The rendering process of the text to be rendered according to the updated tag attribute information includes: Determining a rendering method of the text classification label according to the label type of the text classification label in the label attribute information after the update process; According to the rendering method of the text classification label, the sub-text or target character sequence marked by the text classification label in the text to be rendered is rendered.

6. The method according to claim 4, characterized in that If the text classification labels included in the target label pair are of different label types, the method further includes: Performing a change process on the text position information of the target tag pair; If the second arrangement sequence number of the first text classification label in the target label pair is greater than the second arrangement sequence number of the second text classification label in the target label pair, the label type of the second text classification label in the target label pair is replaced by the label type of the first text classification label in the target label pair.

7. The method according to claim 6, characterized in that Also includes: Sorting the text classification labels and the inserted intermediate text classification labels to obtain a sorting result; The tag pair set corresponding to the text to be rendered is updated according to the sorting result.

8. A text processing device, characterized in that: include: An acquiring unit, configured to acquire label attribute information of a text classification label of the text to be rendered; each of the text classification labels marks a subtext of the text to be rendered; The tag attribute information includes first position information of the subtext marked by the text classification tag in the text to be rendered; A determination unit, configured to determine a target character sequence in the text to be rendered according to the first position information; the target character sequence belongs to a subtext annotated by a plurality of the text classification labels; An updating unit, used for updating the tag attribute information according to the target character sequence; A rendering unit is used to render the text to be rendered according to the updated tag attribute information.

9. An electronic device, characterized in that: include: processor; And, a memory configured to store computer executable instructions, which, when executed, cause the processor to perform the text processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and the computer-executable instructions, when executed by a processor, implement the text processing method according to any one of claims 1 to 7.

11. A computer program product, characterized in that The invention comprises a computer program, which implements the text processing method according to any one of claims 1 to 7 when executed by a processor.