A text processing method and device

By converting Chinese text into English text and using the English key phrase extraction algorithm, the problem of low efficiency and low accuracy in Chinese key phrase extraction is solved, and more efficient and accurate Chinese key phrase extraction is achieved.

CN111858837BInactive Publication Date: 2024-09-24BEIJING DIDI INFINITY TECH & DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910269029.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-04
Publication Date
2024-09-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing technology, Chinese key phrase extraction based on Chinese text has problems of low efficiency and low accuracy, mainly due to limitations of character encoding and language habits.

Method used

By segmenting Chinese text and using a preset Chinese-English mapping table to convert Chinese words into English text, a mature English key phrase extraction algorithm is used to extract key phrases from the English text and then convert them into Chinese key phrases.

Benefits of technology

It improves the accuracy and efficiency of Chinese key phrase extraction and reduces the complexity and calculation amount of Chinese-English correspondence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111858837B
    Figure CN111858837B
Patent Text Reader

Abstract

The present application relates to the technical field of text processing, and more particularly to a text processing method and device. The present application performs word segmentation processing on the acquired Chinese text to obtain a plurality of Chinese words, searches for the English letter sequences corresponding to each Chinese word in a preset Chinese-English mapping table, and then converts the Chinese text into the corresponding English text. Furthermore, a plurality of English key phrases are extracted from the English text, and each English key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared with the method of extracting Chinese key phrases based only on Chinese text in the prior art, the present application converts Chinese text into English text through preset rules, and uses a mature English key phrase extraction algorithm to extract English key phrases from the English text, and then converts the English key phrases into Chinese key phrases, which can improve the accuracy and efficiency of Chinese key phrase extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of text processing technology, and in particular to a text processing method and apparatus. Background Technology

[0002] Automatic key phrase extraction is an important technology in text information processing. It is a key technology that is used in text information understanding tasks such as automatic text summarization, automatic text classification, topic extraction, and patent search analysis.

[0003] Currently, existing technologies for extracting key phrases from Chinese text suffer from issues such as character encoding and language habits, resulting in low efficiency and accuracy in key phrase extraction. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a text processing method and apparatus that can improve the accuracy and efficiency of Chinese key phrase extraction.

[0005] This mainly includes the following aspects:

[0006] In a first aspect, embodiments of this application provide a text processing method, the text processing method comprising:

[0007] The obtained Chinese text is segmented into words to obtain multiple Chinese words;

[0008] Find the English letter sequence corresponding to each Chinese word in the pre-defined Chinese-English mapping table;

[0009] Based on the found multiple English letter sequences, the Chinese text is converted into the corresponding English text;

[0010] Extract several key English phrases from the English text;

[0011] Based on the English-Chinese mapping table, each English key phrase is converted into a Chinese key phrase.

[0012] In one possible implementation, the Chinese-English mapping table is established according to the following steps:

[0013] Retrieve all Chinese words from the Chinese word database and number each word.

[0014] Based on the number corresponding to each Chinese word, determine the English letter sequence corresponding to each Chinese word;

[0015] The Chinese-English mapping table is established based on the correspondence between each Chinese word, its corresponding number, and the English letter sequence.

[0016] In one possible implementation, determining the English letter sequence corresponding to each Chinese word based on its corresponding number includes:

[0017] Divide the number corresponding to each Chinese word by a preset value, and determine the quotient and remainder in each division result;

[0018] Determine the English letter sequence corresponding to each Chinese word based on the quotient and remainder of each Chinese word.

[0019] In one possible implementation, the extraction of multiple key English phrases from the English text includes:

[0020] By combining at least two consecutive sequences of English letters in the English text, multiple English letter phrases can be identified;

[0021] The multiple English letter phrases and the multiple English letter sequences found are identified as multiple candidate English key phrases;

[0022] Extract English key phrases from the plurality of candidate English key phrases.

[0023] In one possible implementation, the step of extracting English key phrases from the plurality of candidate English key phrases includes:

[0024] Determine the popularity, aggregation, and information content of each candidate English keyword phrase;

[0025] Each candidate English keyword phrase is scored based on its popularity, aggregation, and information content.

[0026] A predetermined number of English key phrases are determined from the plurality of candidate English key phrases, wherein the score of each of the predetermined number of English key phrases is higher than the score of each of the other candidate English key phrases in the plurality of candidate English key phrases.

[0027] In one possible implementation, the popularity of each candidate English keyword phrase is determined according to the following steps:

[0028] A first ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the first ratio corresponding to each candidate English key phrase is determined as a numerical value of the popularity of each candidate English key phrase.

[0029] In one possible implementation, the degree of aggregation of each candidate English keyword phrase is determined according to the following steps:

[0030] The ratio between the first probability of each candidate English key phrase appearing in the English text and the product of the second probability of each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appearing in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the numerical value of the degree of aggregation of each candidate English key phrase.

[0031] In one possible implementation, the first probability is determined according to the following steps:

[0032] A second ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the second ratio corresponding to each candidate English key phrase is determined as the first probability of each candidate English key phrase.

[0033] In one possible implementation, the second probability is determined according to the following steps:

[0034] The ratio between the number of times each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the second probability of each English letter sequence.

[0035] In one possible implementation, the information content of each candidate English keyword phrase is determined according to the following steps:

[0036] The English text is divided into multiple short English texts; each short English text includes a series of consecutive English letter sequences that represent a semantic meaning;

[0037] Determine the ratio between the total number of short English texts contained in the English text and the number of short English texts containing each candidate English key phrase, and determine the information content of each candidate English key phrase based on the ratio corresponding to each candidate English key phrase.

[0038] Secondly, embodiments of this application also provide a text processing apparatus, the text processing apparatus comprising:

[0039] The processing module is used to segment the acquired Chinese text into multiple Chinese words;

[0040] The search module is used to find the English letter sequence corresponding to each Chinese word in a pre-defined Chinese-English mapping table.

[0041] The conversion module is used to convert the Chinese text into corresponding English text based on the multiple sequences of English letters found.

[0042] An extraction module is used to extract multiple key English phrases from the English text;

[0043] The conversion module is also used to convert each English key phrase into a Chinese key phrase according to the English-Chinese mapping table.

[0044] In one possible implementation, the text processing device further includes:

[0045] The acquisition module is used to acquire all Chinese words in the Chinese word database and assign a number to each Chinese word.

[0046] The determination module is used to determine the English letter sequence corresponding to each Chinese word based on the number corresponding to each Chinese word.

[0047] A module is established to create the Chinese-English mapping table according to the correspondence between each Chinese word, its corresponding number, and the English letter sequence.

[0048] In one possible implementation, the determining module is specifically configured to determine the English letter sequence corresponding to each Chinese word according to the following steps:

[0049] Divide the number corresponding to each Chinese word by a preset value, and determine the quotient and remainder in each division result;

[0050] Determine the English letter sequence corresponding to each Chinese word based on the quotient and remainder of each Chinese word.

[0051] In one possible implementation, the extraction module is specifically used to extract multiple English key phrases according to the following steps:

[0052] By combining at least two consecutive sequences of English letters in the English text, multiple English letter phrases can be identified;

[0053] The multiple English letter phrases and the multiple English letter sequences found are identified as multiple candidate English key phrases;

[0054] Extract English key phrases from the plurality of candidate English key phrases.

[0055] In one possible implementation, the extraction module includes:

[0056] The first determining unit is used to determine the popularity, aggregation degree, and information content of each candidate English key phrase;

[0057] The scoring unit is used to score each candidate English key phrase based on its popularity, aggregation, and information content.

[0058] The second determining unit is used to determine a preset number of English key phrases from the plurality of candidate English key phrases, wherein the score of each preset number of English key phrases is higher than the score of each candidate English key phrase other than the plurality of candidate English key phrases.

[0059] In one possible implementation, the first determining unit is specifically configured to determine the popularity of each candidate English keyword phrase according to the following steps:

[0060] A first ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the ratio corresponding to each candidate English key phrase is determined as a numerical value of the popularity of each candidate English key phrase.

[0061] In one possible implementation, the first determining unit is specifically configured to determine the aggregation degree of each candidate English key phrase according to the following steps:

[0062] The ratio between the first probability of each candidate English key phrase appearing in the English text and the product of the second probability of each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appearing in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the numerical value of the degree of aggregation of each candidate English key phrase.

[0063] In one possible implementation, the first determining unit is specifically configured to determine the first probability according to the following steps:

[0064] A second ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the ratio corresponding to each candidate English key phrase is determined as the first probability of each candidate English key phrase.

[0065] In one possible implementation, the first determining unit is specifically configured to determine the second probability according to the following steps:

[0066] The ratio between the number of times each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the second probability of each English letter sequence.

[0067] In one possible implementation, the first determining unit is specifically configured to determine the information content of each candidate English key phrase according to the following steps:

[0068] The English text is divided into multiple short English texts; each short English text includes a series of consecutive English letter sequences that represent a semantic meaning;

[0069] Determine the ratio between the total number of short English texts contained in the English text and the number of short English texts containing each candidate English key phrase, and determine the information content of each candidate English key phrase based on the ratio corresponding to each candidate English key phrase.

[0070] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory through the bus, and the machine-readable instructions are executed by the processor to perform the steps of the text processing method described in the first aspect or any possible implementation of the first aspect.

[0071] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the text processing method described in the first aspect or any possible implementation of the first aspect.

[0072] In this embodiment, the acquired Chinese text is segmented to obtain multiple Chinese words. A pre-defined Chinese-English mapping table is used to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared to existing methods that extract Chinese key phrases solely from Chinese text, this application converts the Chinese text into English text using pre-defined rules and employs a mature English key phrase extraction algorithm to extract key phrases, thereby converting them into Chinese key phrases. This improves the accuracy and efficiency of Chinese key phrase extraction.

[0073] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0074] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0075] Figure 1 A flowchart of a text processing method provided in Embodiment 1 of this application is shown;

[0076] Figure 2 A flowchart of another text processing method provided in Embodiment 2 of this application is shown;

[0077] Figure 3 This illustration shows one of the functional block diagrams of a text processing apparatus provided in Embodiment 3 of this application;

[0078] Figure 4 This shows a second functional block diagram of a text processing device provided in Embodiment 3 of this application;

[0079] Figure 5 This paper shows a schematic diagram of the structure of an extraction module in a text processing device according to Embodiment 3 of this application;

[0080] Figure 6 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of this application is shown. Detailed Implementation

[0081] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0082] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0083] To enable those skilled in the art to use the content of this application and, in conjunction with the specific application scenario of "extracting key phrases from text", the following implementation methods are provided. For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application.

[0084] The methods, apparatus, electronic devices, or computer-readable storage media described in this application can be applied to any scenario requiring text processing. This application does not limit specific application scenarios, and any scheme using the text processing methods and apparatus provided in this application is within the protection scope of this application.

[0085] It is worth noting that prior to this application, existing methods for extracting Chinese key phrases based on Chinese text suffer from issues such as character encoding and language habits, resulting in low efficiency and low accuracy in extracting Chinese key phrases.

[0086] To address the aforementioned issues, this application's embodiments perform word segmentation on the acquired Chinese text to obtain multiple Chinese words. A pre-defined Chinese-English mapping table is used to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared to existing methods that extract Chinese key phrases solely from Chinese text, this application converts the Chinese text into English text using pre-defined rules and employs a mature English key phrase extraction algorithm to extract key phrases, thereby converting them into Chinese key phrases. This improves the accuracy and efficiency of Chinese key phrase extraction.

[0087] It should be noted that automatic key phrase extraction is an important technology in text information processing. It is a key technology that is applied in text information understanding tasks such as automatic text summarization, automatic text classification, topic extraction, and patent search analysis.

[0088] For the convenience of understanding this application, the technical solutions provided by this application will be described in detail below in conjunction with specific embodiments.

[0089] Embodiment 1

[0090] Please refer to Figure 1 , Figure 1 which is a flowchart of a text processing method provided by Embodiment 1 of this application. As Figure 1 shown in

[0091] S101: Perform word segmentation on the obtained Chinese text to obtain multiple Chinese words.

[0092] In specific implementation, first, obtain the Chinese text that needs to extract Chinese key phrases. Then, perform word segmentation on the Chinese text through a word segmentation tool (such as jieba), and multiple Chinese words can be obtained.

[0093] Here, the format of the Chinese text is in units of lines, and each line is a sentence. In this way, it is convenient for the word segmentation tool to perform word segmentation on the Chinese text.

[0094] In one example, a piece of Chinese text is "Thank you for your patience". After word segmentation by the word segmentation tool, 5 Chinese words "Thank", "you", "for", "patience", and "wait" will be obtained.

[0095] S102: Look up the English letter sequence corresponding to each Chinese word in a preset Chinese-English mapping table.

[0096] In specific implementation, since the algorithms for extracting key phrases based on English text are relatively mature at present, therefore, by converting the Chinese text into English text and using the English text to extract key phrases, it is a feasible solution to improve the accuracy of extracting Chinese key phrases. However, the computational complexity of translating Chinese text into English text in the traditional sense is relatively high. To address the above problems, this application proposes a new Chinese-English mapping method. Specifically, a Chinese-English mapping table can be established in advance. The Chinese-English mapping table stores Chinese words and English letter sequences in a one-to-one correspondence. In this way, according to the multiple Chinese words obtained after word segmentation, the English letter sequence corresponding to each Chinese word can be looked up in the Chinese-English mapping table. Here, the English letter sequence corresponding to the Chinese word only needs to uniquely represent this Chinese word. For example, use the English letter sequence "as" to represent the Chinese word "Thank", and it does not need to be semantically corresponding. Therefore, only less computational complexity is required, and the complexity of the Chinese-English correspondence relationship can be reduced.

[0097] S103: Based on the multiple sequences of English letters found, convert the Chinese text into the corresponding English text.

[0098] In practice, after finding the corresponding English letter sequence for each Chinese word obtained after word segmentation in the Chinese-English mapping table, each Chinese word at the corresponding position in the Chinese text is replaced with the corresponding English letter sequence. This process converts the Chinese text into its corresponding English text. Using this method, only a small amount of computation is required to convert Chinese text into its corresponding English text, saving significant time.

[0099] S104: Extract multiple key English phrases from the English text.

[0100] In practice, after converting the Chinese text from which Chinese key phrases need to be extracted into the corresponding English text, we can use the relatively mature English key phrase extraction methods to extract multiple English key phrases from the English text. In this way, extracting English key phrases through English text can improve the accuracy and efficiency of English key phrase extraction.

[0101] S105: Based on the English-Chinese mapping table, convert each English key phrase into a Chinese key phrase.

[0102] In practice, after extracting multiple English key phrases from the English text, the corresponding Chinese key phrases are found in a pre-established Chinese-English mapping table. This completes the entire process of extracting Chinese key phrases from the Chinese text.

[0103] In this embodiment, the acquired Chinese text is segmented to obtain multiple Chinese words. A pre-defined Chinese-English mapping table is used to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared to existing methods that extract Chinese key phrases solely from Chinese text, this application converts the Chinese text into English text using pre-defined rules and employs a mature English key phrase extraction algorithm to extract key phrases, thereby converting them into Chinese key phrases. This improves the accuracy and efficiency of Chinese key phrase extraction.

[0104] In one possible implementation, the Chinese-English mapping table is established according to the following steps:

[0105] Step (1): Obtain all Chinese words in the Chinese word database and assign a number to each Chinese word.

[0106] In its implementation, this application proposes a new method for Chinese-English comparison, and then establishes a Chinese-English mapping table based on this comparison relationship. Specifically, all Chinese words are first obtained from the Chinese word database, and each Chinese word is numbered. In this way, each Chinese word corresponds to a unique number.

[0107] Here, the Chinese word database can be a Chinese dictionary.

[0108] Step (2): Based on the number corresponding to each Chinese word, determine the English letter sequence corresponding to each Chinese word.

[0109] In practice, since each Chinese word corresponds to a unique number, the number can be used as a bridge between the Chinese word and the English letter sequence. Each number can also be associated with a unique English letter sequence. Furthermore, a simple mapping function can be used to establish the correspondence between each number and the English letter sequence. In this way, the complexity of the correspondence between Chinese and English can be reduced with less computation.

[0110] Step (3): Establish the Chinese-English mapping table according to the correspondence between each Chinese word, the corresponding number of each Chinese word and the English letter sequence.

[0111] In practice, since each number corresponds to a Chinese word and an English letter sequence, each Chinese word, its corresponding number, and its corresponding English letter sequence can be stored according to their correspondence. This allows for the creation of a Chinese-English mapping table based on the correspondence between the Chinese words, numbers, and English letter sequences.

[0112] In one possible implementation, step (2) involves determining the English letter sequence corresponding to each Chinese word based on the corresponding number, including the following steps:

[0113] Divide the number corresponding to each Chinese word by a preset value, and determine the quotient and remainder in each division result; based on the quotient and remainder corresponding to each Chinese word, determine the English letter sequence corresponding to each Chinese word.

[0114] In specific implementation, the present application uses a mapping function (such as the CONCATENATE function) to establish the relationship between each number and the English letter sequence. Specifically, some English letter sequences corresponding to numbers with smaller numbers can be directly set first. For numbers with larger numbers, the English letter sequence corresponding to this number can be determined according to this mapping function. Here, for numbers with larger numbers, each larger number is divided by the same preset value. In this way, the quotient value and remainder in each division calculation result can be obtained. Furthermore, according to the quotient value and remainder, the English letter sequence corresponding to each Chinese word can be determined.

[0115] Specifically, the mapping function is where id is the number, the preset value is 26, is the quotient value obtained by dividing the number by the preset value, is the remainder obtained by dividing by the preset value. When id < 26, it is preset that f(0) = a, f(1) = b,..., f(25) = z. When id ≥ 26, this mapping function is used to determine the English letter sequence according to the number.

[0116] In an example, the English letter sequence corresponding to the Chinese word (quotient value) with the number id = 51 is f(51) = concatenate(f(1), f(25)) = bz. Therefore, the English letter sequence corresponding to the Chinese word "quotient value" is "bz".

[0117] It should be noted that since there are 26 letters in English, for the convenience of calculation, the preset value in the present application is set to 26. Of course, it can also be set to other values, and the number of numbers corresponding to the English letter sequence that needs to be directly given will be adjusted accordingly.

[0118] In this embodiment, through the number corresponding to each Chinese word and a mapping function, the English letter sequence corresponding to each number can be determined. Furthermore, each Chinese word corresponds to an English letter sequence respectively. In this way, the English letter sequence corresponding to the Chinese word only needs to uniquely represent this Chinese word. For example, the English letter sequence "as" is used to represent the Chinese word "thanks", and there is no need to be semantically corresponding. Therefore, only a small amount of calculation is required, and the complexity of the Chinese-English correspondence relationship can be reduced.

[0119] This application segments the acquired Chinese text into multiple Chinese words. It then searches a pre-defined Chinese-English mapping table to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into its corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the mapping table. Compared to existing methods for extracting Chinese key phrases from Chinese text, this application uses pre-defined rules to convert the Chinese text into English text and employs a mature English key phrase extraction algorithm to extract key phrases, thereby improving the accuracy and efficiency of Chinese key phrase extraction.

[0120] Example 2

[0121] See also Figure 2 , Figure 2 This is a flowchart illustrating another text processing method provided in Embodiment 2 of this application. Figure 2 As shown in the figure, the text processing method provided in this application embodiment includes the following steps:

[0122] S201: Perform word segmentation on the obtained Chinese text to obtain multiple Chinese words.

[0123] In practice, firstly, the Chinese text from which key phrases need to be extracted is obtained. Then, the Chinese text is segmented using a word segmentation tool to obtain multiple Chinese words.

[0124] S202: Find the English letter sequence corresponding to each Chinese word in the preset Chinese-English mapping table.

[0125] In specific implementation, since the algorithms for extracting key phrases from English texts are relatively mature at present, therefore, transforming Chinese texts into English texts and using the English texts to extract key phrases is a feasible solution to improve the accuracy of extracting Chinese key phrases. However, the computational amount and complexity of the traditional method of translating Chinese texts into English texts are relatively high. To address the above problems, the present application proposes a new Chinese-English comparison method. Specifically, a Chinese-English mapping table can be established in advance, and Chinese words and English letter sequences are stored in a one-to-one correspondence in the Chinese-English mapping table. In this way, multiple Chinese words obtained through word segmentation processing can be used to look up the corresponding English letter sequences for each Chinese word in the Chinese-English mapping table. Here, the English letter sequence corresponding to a Chinese word only needs to uniquely represent this Chinese word. For example, the English letter sequence "as" is used to represent the Chinese word "感谢" (thanks), and there is no need for semantic correspondence. Therefore, only a relatively small amount of computational work is required, which can reduce the complexity of the Chinese-English correspondence relationship.

[0126] S203: According to the multiple English letter sequences found, transform the Chinese text into the corresponding English text.

[0127] In specific implementation, after respectively finding the English letter sequences corresponding to each Chinese word obtained after word segmentation of the Chinese text in the Chinese-English mapping table, each Chinese word at the corresponding position in the Chinese text is respectively replaced with the English letter sequence corresponding to each Chinese word segment. In this way, the Chinese text can be transformed into the corresponding English text. By adopting this method, the Chinese text can be transformed into the corresponding English text with only a relatively small amount of computational work, which can save a large amount of time cost.

[0128] S204: Combine at least two consecutive English letter sequences in the English text to determine multiple English letter phrases.

[0129] In specific implementation, Chinese key phrases can be not only Chinese words but also Chinese phrases. Therefore, two or more consecutive English letter sequences in each line of the English text can be combined, and each combined sequence of two or more consecutive English letter sequences forms an English letter phrase. In this way, the corresponding Chinese phrase can be obtained by transforming the English letter phrase.

[0130] In one example, the English text is "as wer sdf zxcv sdfs", and the consecutive English letter sequences "zxcv" and "sdfs" can be combined to obtain the English letter phrase "zxcv sdfs".

[0131] S205: The plurality of English letter phrases and the plurality of English letter sequences found are identified as a plurality of candidate English key phrases.

[0132] In practice, multiple English letter phrases obtained by combination, as well as multiple English letter sequences found previously, can be identified as candidate English key phrases. By adopting this method, as many candidate English key phrases as possible can be listed, thus avoiding the omission of a certain English key phrase when extracting multiple English key phrases from English text.

[0133] S206: Extract English key phrases from the plurality of candidate English key phrases.

[0134] In practice, after obtaining multiple candidate English key phrases, we can use the relatively mature English key phrase extraction algorithm to extract multiple English key phrases from the multiple candidate English key phrases.

[0135] S207: Based on the English-Chinese mapping table, convert each English key phrase into a Chinese key phrase.

[0136] In practice, after extracting multiple English key phrases from the English text, the corresponding Chinese key phrases are found in a pre-established Chinese-English mapping table. This completes the entire process of extracting Chinese key phrases from the Chinese text.

[0137] In one possible implementation, extracting English key phrases from the plurality of candidate English key phrases in step S206 may include the following steps:

[0138] Step a: Determine the popularity, aggregation, and information content of each candidate English keyword phrase.

[0139] In practice, a key phrase should meet three criteria: popularity, aggregation, and information content. Therefore, when extracting multiple English key phrases from multiple candidate English key phrases, these three criteria can be used to evaluate each candidate English key phrase, thus obtaining a higher accuracy rate of English key phrases.

[0140] Step b: Score each candidate English keyword phrase based on its popularity, aggregation, and information content.

[0141] In practice, the popularity, aggregation degree, and information content of each candidate key phrase can be calculated separately. The popularity, aggregation degree, and information content of each candidate key phrase can be weighted and summed. The weighted sum is used as the score for each candidate English key phrase. Then, multiple English key phrases can be selected from multiple candidate key phrases based on the scores of each candidate English key phrase.

[0142] Step c: Determine a preset number of English key phrases from the plurality of candidate English key phrases, wherein the score of each of the preset number of English key phrases is higher than the score of each candidate English key phrase other than the plurality of candidate English key phrases.

[0143] In practice, each candidate English key phrase can be ranked from high to low based on its score, thus obtaining a score ranking list. A predetermined number of candidate English key phrases at the top of the ranking list can be selected as multiple English key phrases. This method of scoring candidate English key phrases can more accurately identify multiple English key phrases.

[0144] In one possible implementation, the popularity of each candidate English keyword phrase is determined according to the following steps:

[0145] A first ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the first ratio corresponding to each candidate English key phrase is determined as a numerical value of the popularity of each candidate English key phrase.

[0146] In practice, popularity is an important indicator for evaluating a candidate English key phrase. If the candidate English key phrase appears frequently in English text, it indicates that the candidate key phrase is popular.

[0147] It should be noted that a preset frequency threshold can be set in advance, and the popularity calculation can only be performed on candidate English key phrases that appear more or less frequently in English text than the preset frequency threshold. In this way, some candidate English key phrases that obviously do not have the characteristics of English key phrases can be excluded, which can reduce the amount of calculation.

[0148] In one possible implementation, the degree of aggregation of each candidate English keyword phrase is determined according to the following steps:

[0149] The ratio between the first probability of each candidate English key phrase appearing in the English text and the product of the second probability of each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appearing in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the numerical value of the degree of aggregation of each candidate English key phrase.

[0150] In practice, aggregation degree is an important indicator for evaluating a candidate English key phrase. It is used to evaluate the correlation between each English letter sequence in at least two consecutive English letter sequences in an English key phrase. Aggregation degree is usually measured using the pointwise mutual information (PMI) indicator.

[0151] In one example, if the candidate English keyword phrase is "zzcc ssds" (cinema), then the candidate English keyword phrase is composed of the English letter sequence "zzcc" (movie) and the English letter sequence "ssds" (cinema). The formula for calculating the aggregation degree of the candidate English keyword phrase is: p(f,e) is the first probability of the candidate English key phrase appearing in the English text, p(f) is the probability of the English letter sequence “zzcc” appearing in the English text, and p(e) is the probability of the English letter sequence “ssds” appearing in the English text. If p(f,e)>p(f)×p(e), it indicates that the candidate English key phrase has a high degree of aggregation.

[0152] In one possible implementation, the first probability is determined according to the following steps:

[0153] A second ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the second ratio corresponding to each candidate English key phrase is determined as the first probability of each candidate English key phrase.

[0154] In practice, the probability of each candidate key phrase appearing in the English text is determined by the ratio between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text.

[0155] In one possible implementation, the second probability is determined according to the following steps:

[0156] The ratio between the number of times each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the second probability of each English letter sequence.

[0157] In practice, the probability of each English letter sequence appearing in the English text among at least two consecutive English letter sequences that constitute each candidate English key phrase is determined by the ratio between the number of times each English letter sequence appears in the English text and the total number of English letter sequences contained in the English text.

[0158] In one example, if the candidate English keyword phrase is "zzcc ssds", the probability of the letter sequence "zzcc" appearing in the English text within this candidate keyword phrase is determined by the ratio between the number of times the letter sequence "zzcc" appears in the English text (A) and the total number of letter sequences in the English text (M). In other words, the probability of the letter sequence "zzcc" appearing in the English text is...

[0159] In one possible implementation, the information content of each candidate English keyword phrase is determined according to the following steps:

[0160] The English text is segmented into multiple short English texts; each short English text includes a series of consecutive English letter sequences representing a semantic meaning; the ratio between the total number of short English texts contained in the English text and the number of short English texts containing each candidate English key phrase is determined, and the ratio corresponding to each candidate English key phrase is determined as the information content of each candidate English key phrase.

[0161] In practice, English text can be segmented into multiple short English texts using punctuation marks. This makes it easier to count the total number of short English texts contained in the original text, as well as the number of short English texts containing each candidate English key phrase. Based on the above statistics, the information content of each candidate English key phrase can be determined.

[0162] It should be noted that information content is an important indicator for evaluating a candidate English key phrase. If the information content of a candidate English key phrase is large, it means that the candidate key phrase contains a lot of content. It can be used as an important indicator to distinguish the short English text containing the candidate English key phrase from other short English texts.

[0163] Here, the amount of information can be measured using the Inverse Document Frequency (IDF) metric.

[0164] In this embodiment, the acquired Chinese text is segmented to obtain multiple Chinese words. A pre-defined Chinese-English mapping table is used to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared to existing methods for extracting Chinese key phrases from Chinese text, this application converts the Chinese text into English text using pre-defined rules and employs a mature English key phrase extraction algorithm to extract key phrases, thereby converting them into Chinese key phrases. This improves the accuracy and efficiency of Chinese key phrase extraction.

[0165] Example 3

[0166] Based on the same application concept, this application also provides a text processing device corresponding to the text processing methods provided in Embodiment 1 and Embodiment 2 in Embodiment 3. Since the principle of the device in this application for solving the problem is similar to the text processing methods in Embodiment 1 and Embodiment 2 of this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0167] See also Figure 3 The diagram shown is one of the functional block diagrams of a text processing device 300 provided in Embodiment 3 of this application. See also... Figure 4 The diagram shown is a second functional block diagram of a text processing device 300 provided in Embodiment 3 of this application. See also... Figure 5 The diagram shown is a structural schematic of the extraction module 340 in a text processing device 300 provided in Embodiment 3 of this application.

[0168] like Figure 3 He Ru Figure 4 As shown, the text processing device 300 includes:

[0169] The processing module 310 is used to perform word segmentation on the acquired Chinese text to obtain multiple Chinese words;

[0170] The lookup module 320 is used to find the English letter sequence corresponding to each Chinese word in a preset Chinese-English mapping table;

[0171] The conversion module 330 is used to convert the Chinese text into corresponding English text based on the multiple English letter sequences found.

[0172] Extraction module 340 is used to extract multiple key English phrases from the English text;

[0173] The conversion module 330 is also used to convert each English key phrase into a Chinese key phrase according to the Chinese-English mapping table.

[0174] In this embodiment, the acquired Chinese text is segmented to obtain multiple Chinese words. A pre-defined Chinese-English mapping table is used to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared to existing methods for extracting Chinese key phrases from Chinese text, this application converts the Chinese text into English text using pre-defined rules and employs a mature English key phrase extraction algorithm to extract key phrases, thereby converting them into Chinese key phrases. This improves the accuracy and efficiency of Chinese key phrase extraction.

[0175] In one possible implementation, such as Figure 4 As shown, the text processing device 300 further includes:

[0176] The acquisition module 350 is used to acquire all Chinese words in the Chinese word database and assign a number to each Chinese word.

[0177] The module 360 ​​is used to determine the English letter sequence corresponding to each Chinese word based on the number corresponding to each Chinese word.

[0178] Module 370 is used to establish the Chinese-English mapping table according to the correspondence between each Chinese word, its corresponding number, and the English letter sequence.

[0179] In one possible implementation, Figure 4 As shown, the determining module 360 ​​is specifically used to determine the English letter sequence corresponding to each Chinese word according to the following steps:

[0180] Divide the number corresponding to each Chinese word by a preset value, and determine the quotient and remainder in each division result;

[0181] Determine the English letter sequence corresponding to each Chinese word based on the quotient and remainder of each Chinese word.

[0182] In one possible implementation, such as Figure 3 and Figure 4As shown, the extraction module 340 is specifically used to extract multiple English key phrases according to the following steps:

[0183] By combining at least two consecutive sequences of English letters in the English text, multiple English letter phrases can be identified;

[0184] The multiple English letter phrases and the multiple English letter sequences found are identified as multiple candidate English key phrases;

[0185] Extract English key phrases from the plurality of candidate English key phrases.

[0186] In one possible implementation, such as Figure 5 The diagram shown is a structural schematic of the extraction module 340 in a text processing device 300 according to Embodiment 3 of this application. Further, the extraction module 340 includes:

[0187] The first determining unit 342 is used to determine the popularity, aggregation degree and information content of each candidate English key phrase;

[0188] Scoring unit 344 is used to score each candidate English key phrase based on its popularity, aggregation, and information content.

[0189] The second determining unit 346 is used to determine a preset number of English key phrases from the plurality of candidate English key phrases, wherein the score of each preset number of English key phrases is higher than the score of each candidate English key phrase other than the plurality of candidate English key phrases.

[0190] In one possible implementation, such as Figure 5 As shown, the first determining unit 342 is specifically used to determine the popularity of each candidate English keyword phrase according to the following steps:

[0191] A first ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the ratio corresponding to each candidate English key phrase is determined as a numerical value of the popularity of each candidate English key phrase.

[0192] In one possible implementation, such as Figure 5 As shown, the first determining unit 342 is specifically used to determine the aggregation degree of each candidate English key phrase according to the following steps:

[0193] The ratio between the first probability of each candidate English key phrase appearing in the English text and the product of the second probability of each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appearing in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the numerical value of the degree of aggregation of each candidate English key phrase.

[0194] In one possible implementation, such as Figure 5 As shown, the first determining unit 342 is specifically used to determine the first probability according to the following steps:

[0195] A second ratio is determined between the number of times each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text, and the ratio corresponding to each candidate English key phrase is determined as the first probability of each candidate English key phrase.

[0196] In one possible implementation, such as Figure 5 As shown, the first determining unit 342 is specifically used to determine the second probability according to the following steps:

[0197] The ratio between the number of times each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appears in the English text and the total number of English letter sequences contained in the English text is determined, and the ratio corresponding to each candidate English key phrase is determined as the second probability of each English letter sequence.

[0198] In one possible implementation, such as Figure 5 As shown, the first determining unit 342 is specifically used to determine the information content of each candidate English key phrase according to the following steps:

[0199] The English text is divided into multiple short English texts; each short English text includes a series of consecutive English letter sequences that represent a semantic meaning;

[0200] Determine the ratio between the total number of short English texts contained in the English text and the number of short English texts containing each candidate English key phrase, and determine the information content of each candidate English key phrase based on the ratio corresponding to each candidate English key phrase.

[0201] In this embodiment, the acquired Chinese text is segmented to obtain multiple Chinese words. A pre-defined Chinese-English mapping table is used to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared to existing methods for extracting Chinese key phrases from Chinese text, this application converts the Chinese text into English text using pre-defined rules and employs a mature English key phrase extraction algorithm to extract key phrases, thereby converting them into Chinese key phrases. This improves the accuracy and efficiency of Chinese key phrase extraction.

[0202] Example 4

[0203] Based on the same application concept, see [link / reference] Figure 6 The diagram shown is a structural schematic of an electronic device 400 provided in Embodiment 4 of this application, including: a processor 410, a memory 420 and a bus 430. The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 and the memory 420 communicate through the bus 430. When the machine-readable instructions are executed by the processor 410, the steps of the text processing method as described in Embodiment 1 and / or Embodiment 2 are performed.

[0204] Specifically, when the machine-readable instructions are executed by the processor 410, the following processing can be performed:

[0205] The obtained Chinese text is segmented into words to obtain multiple Chinese words;

[0206] Find the English letter sequence corresponding to each Chinese word in the pre-defined Chinese-English mapping table;

[0207] Based on the found multiple English letter sequences, the Chinese text is converted into the corresponding English text;

[0208] Extract several key English phrases from the English text;

[0209] Based on the English-Chinese mapping table, each English key phrase is converted into a Chinese key phrase.

[0210] In this embodiment, the acquired Chinese text is segmented to obtain multiple Chinese words. A pre-defined Chinese-English mapping table is used to find the corresponding English letter sequence for each Chinese word. Based on these sequences, the Chinese text is converted into corresponding English text. Furthermore, multiple English key phrases are extracted from the English text, and each key phrase is converted into a Chinese key phrase according to the Chinese-English mapping table. Compared to existing methods for extracting Chinese key phrases from Chinese text, this application converts the Chinese text into English text using pre-defined rules and employs a mature English key phrase extraction algorithm to extract key phrases, thereby converting them into Chinese key phrases. This improves the accuracy and efficiency of Chinese key phrase extraction.

[0211] Example 5

[0212] Based on the same concept, Embodiment 5 of this application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the text processing methods provided in Embodiment 1 and / or Embodiment 2 above.

[0213] Specifically, the storage medium can be a general-purpose storage medium, such as a portable disk or hard disk. When the computer program on the storage medium is run, it can execute the above-mentioned text processing method, convert Chinese text into English text through preset rules, and use a mature English key phrase extraction algorithm to extract English key phrases from the English text, thereby converting the English key phrases into Chinese key phrases, which can improve the accuracy and efficiency of Chinese key phrase extraction.

[0214] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0215] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0216] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0217] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0218] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A text processing method, characterized in that: The text processing method comprises: Perform word segmentation on the acquired Chinese text to obtain multiple Chinese words; Find the English letter sequence corresponding to each Chinese word in the preset Chinese-English mapping table; According to the found multiple English letter sequences, convert the Chinese text into corresponding English text; Extract multiple English key phrases from the English text, including: Combining at least two consecutive English letter sequences in the English text to determine a plurality of English letter phrases; Determine the multiple English letter phrases and the multiple English letter sequences found as multiple candidate English key phrases; Scoring each candidate English key phrase, wherein the score is related to the popularity, aggregation and information content of each candidate English key phrase, wherein the aggregation is used to evaluate the correlation between each English letter sequence in at least two consecutive English letter sequences in an English key phrase; Extracting English key phrases from the plurality of candidate English key phrases based on the plurality of scores, including: determining a preset number of English key phrases from the plurality of candidate English key phrases, wherein the score of each of the preset number of English key phrases is higher than the score of each of the plurality of candidate English key phrases other than the plurality of English key phrases; According to the Chinese-English mapping table, each English key phrase is converted into a Chinese key phrase.

2. The text processing method according to claim 1, characterized in that: Create the Chinese-English mapping table according to the following steps: Obtain all Chinese words in the Chinese word database and number each Chinese word respectively; Based on the numbers corresponding to each Chinese word, determine the English letter sequence corresponding to each Chinese word; The Chinese-English mapping table is established according to the mutual correspondence between each Chinese word, the number corresponding to each Chinese word and the English letter sequence.

3. The text processing method according to claim 2, characterized in that: The step of determining the English letter sequence corresponding to each Chinese word based on the number corresponding to each Chinese word includes: Divide the serial number corresponding to each Chinese word by a preset value, and determine the quotient and remainder in each division result; According to the quotient and remainder corresponding to each Chinese word, the English letter sequence corresponding to each Chinese word is determined.

4. The text processing method according to claim 1, characterized in that: The popularity of each candidate English keyword phrase is determined according to the following steps: A first ratio between the number of times each candidate English key phrase appears in the English text and the number of all English letter sequences contained in the English text is determined, and the first ratio corresponding to each candidate English key phrase is determined as a popularity value of each candidate English key phrase.

5. The text processing method according to claim 1, characterized in that: The aggregation degree of each candidate English key phrase is determined according to the following steps: Determine the ratio between a first probability of each candidate English key phrase appearing in the English text and the product of a second probability of each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appearing in the English text, and determine the ratio corresponding to each candidate English key phrase as a numerical value of the degree of aggregation of each candidate English key phrase.

6. The text processing method according to claim 5, characterized in that: The first probability is determined according to the following steps: Determine a second ratio between the number of times each candidate English key phrase appears in the English text and the number of all English letter sequences contained in the English text, and determine the second ratio corresponding to each candidate English key phrase as the first probability of each candidate English key phrase.

7. The text processing method according to claim 5, characterized in that: The second probability is determined according to the following steps: Determine the ratio between the number of times each English letter sequence in at least two consecutive English letter sequences constituting each candidate English key phrase appears in the English text and the number of all English letter sequences contained in the English text, and determine the ratio corresponding to each candidate English key phrase as the second probability of each English letter sequence.

8. A text processing device, characterized in that: The text processing device comprises: A processing module is used to perform word segmentation on the acquired Chinese text to obtain multiple Chinese words; A search module is used to search for the English letter sequence corresponding to each Chinese word in a preset Chinese-English mapping table; A conversion module, used for converting the Chinese text into a corresponding English text according to the multiple English letter sequences found; The extraction module is used to extract multiple English key phrases from the English text, including: Combining at least two consecutive English letter sequences in the English text to determine a plurality of English letter phrases; Determine the multiple English letter phrases and the multiple English letter sequences found as multiple candidate English key phrases; Scoring each candidate English key phrase, wherein the score is related to the popularity, aggregation and information content of each candidate English key phrase, wherein the aggregation is used to evaluate the correlation between each English letter sequence in at least two consecutive English letter sequences in an English key phrase; Extracting English key phrases from the plurality of candidate English key phrases based on the plurality of scores, including: determining a preset number of English key phrases from the plurality of candidate English key phrases, wherein the score of each of the preset number of English key phrases is higher than the score of each of the plurality of candidate English key phrases other than the plurality of English key phrases; The conversion module is further used to convert each English key phrase into a Chinese key phrase according to the Chinese-English mapping table.