Text processing method, device, electronic device and readable storage medium

By combining the preset word segmentation model and standard word segmentation results, automatically screening and confirming text word segmentation errors, the problem of low manual analysis after text word segmentation in the existing technology is solved, and the processing efficiency and accuracy are improved.

CN113962216BActive Publication Date: 2024-12-24BEIJING SANKUAI ONLINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111083674.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2024-12-24
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

After the prior art text participle segmentation, the business party has the problem of inefficient efficiency through manual analysis of word segmentation results.

Method used

The text is processed by using a preset word segmentation model, and the candidate text is selected according to the relevant parameters of the word segmentation result. The problem text is filtered out through the standard word segmentation results, and the word segmentation errors are automatically discovered and confirmed, which improves processing efficiency and accuracy.

Benefits of technology

Compared with manual analysis, automatic screening and confirmation of word segmentation errors improves processing efficiency, ensures the accuracy of the finalized problem text, and reduces the frequency of business errors caused by word segmentation errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113962216B_ABST
    Figure CN113962216B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a text processing method, device, electronic device and readable storage medium. In the method, a first text is segmented based on a preset segmentation model to obtain a first segmentation result. A candidate text is selected from the first text according to relevant parameters of the first segmentation result. The segmentation error rate of the candidate text meets the preset requirements, and the segmentation error rate is used to characterize the probability that the first segmentation result has a segmentation error. Then, the standard segmentation result of each candidate text is obtained; according to the standard segmentation result and the first segmentation result, a problem text is selected from the candidate text. Compared with the manual analysis method, in the embodiment of the present invention, the first text with a higher probability of having a segmentation error is automatically screened as a candidate text, and the problem text is automatically determined from the candidate text. That is, after the segmentation, the problem is discovered actively, so the processing efficiency can be improved to a certain extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of network technology, and in particular relates to a text processing method, device, electronic device and readable storage medium. Background Art

[0002] In natural language processing, text is often segmented. The segmentation results obtained through segmentation can be further applied to actual business. The accuracy of segmentation will affect the actual use effect of users in actual business.

[0003] In the existing method, after the word segmentation results are applied to actual business, the business side often uses manual analysis to determine whether there are problems in the word segmentation process. However, this method has low processing efficiency. Summary of the invention

[0004] The present invention provides a text processing method, device, electronic device and readable storage medium to solve the problem of low efficiency in problem discovery.

[0005] In a first aspect, the present invention provides a text processing method, the method comprising:

[0006] Performing word segmentation processing on the first text based on a preset word segmentation model to obtain a first word segmentation result;

[0007] selecting a candidate text from the first text according to relevant parameters of the first word segmentation result; a word segmentation error rate of the candidate text meets a preset requirement, and the word segmentation error rate is used to represent the probability that the first word segmentation result has a word segmentation error;

[0008] Obtaining a standard word segmentation result of the candidate text;

[0009] A question text is selected from the candidate texts according to the standard word segmentation result and the first word segmentation result.

[0010] In a second aspect, the present invention provides a text processing device, the device comprising:

[0011] A first processing module, configured to perform word segmentation processing on the first text based on a preset word segmentation model to obtain a first word segmentation result;

[0012] A first selection module is used to select a candidate text from the first text according to relevant parameters of the first word segmentation result; the word segmentation error rate of the candidate text meets a preset requirement, and the word segmentation error rate is used to represent the probability that the first word segmentation result has a word segmentation error;

[0013] A first acquisition module, used to obtain a standard word segmentation result of the candidate text;

[0014] The second selection module is used to select a question text from the candidate texts according to the standard word segmentation result and the first word segmentation result.

[0015] In a third aspect, the present invention provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above method when executing the program.

[0016] In a fourth aspect, the present invention provides a readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the above method.

[0017] In an embodiment of the present invention, a first text is segmented based on a preset segmentation model to obtain a first segmentation result, and a candidate text is selected from the first text according to relevant parameters of the first segmentation result; the segmentation error rate of the candidate text meets the preset requirements, and the segmentation error rate is used to characterize the probability that the first segmentation result has a segmentation error. Then, the standard segmentation result of each candidate text is obtained; according to the standard segmentation result and the first segmentation result, a problem text is selected from the candidate text. Compared with the manual analysis method, in an embodiment of the present invention, the first text with a higher probability of having a segmentation error is automatically screened as a candidate text, and the problem text is automatically determined from the candidate text. That is, after segmentation, problem discovery is actively performed, so the processing efficiency can be improved to a certain extent.

[0018] At the same time, first screening out suspicious candidate texts, and then further screening out the problem texts from the candidate texts can ensure the accuracy of the final problem texts to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 is a flowchart of a text processing method provided by an embodiment of the present invention;

[0021] Figure 2 It is a result schematic diagram of a unified word segmenter provided by the implementation of the present invention;

[0022] Figure 3 It is a schematic diagram of a framework of text processing provided by an embodiment of the present invention;

[0023] Figure 4is a schematic diagram of an active problem discovery module provided by an embodiment of the present invention;

[0024] Figure 5 is a structural diagram of a model acquisition device provided by an embodiment of the present invention;

[0025] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] Figure 1 is a flowchart of a text processing method provided by an embodiment of the present invention. Figure 1 As shown, the method may include:

[0028] Step 101: Perform word segmentation processing on a first text based on a preset word segmentation model to obtain a first word segmentation result.

[0029] In an embodiment of the present invention, the preset word segmentation model may be a pre-trained model for performing word segmentation on the first text. The preset word segmentation model may be a general word segmentation model, or a domain word segmentation model for performing word segmentation processing on a specific domain, or a combination of a general word segmentation model and a domain word segmentation model, a combination of a general word segmentation model and a domain dictionary model, and the like. Further, the word segmentation result of performing word segmentation processing on the first text is the first word segmentation result. Among them, the word segmentation result may include each word obtained after word segmentation, the first text may be a text that needs to be segmented, the first text in different application scenarios may be different, and the word segmentation result of the first text may be applied to scenarios such as recommendation, search, and intelligent customer service. For example, in a search scenario, the first text may be a search query word entered by a user, and in an intelligent customer service scenario, the first text may be a dialogue sentence entered by a user. The word segmentation result of the first text may be used as a signal for subsequent processing. For example, the word segmentation result obtained in the search scenario may be further applied to an index construction or query word retrieval scenario. For example, the word segmentation results can be segmented again to determine multiple (for example, two) word segmentation granularities, and the word segmentation results of the two word segmentation granularities can be used to build an index or perform query word retrieval. The word segmentation results obtained in the intelligent customer service scenario can be further applied to the link of selecting the response statement of the intelligent customer service.

[0030] Step 102: Select a candidate text from the first text according to relevant parameters of the first word segmentation result; the word segmentation error rate of the candidate text meets preset requirements, and the word segmentation error rate is used to characterize the probability that the first word segmentation result has a word segmentation error.

[0031] In an embodiment of the present invention, the specific types of relevant parameters can be set according to actual needs, as long as it is ensured that the relevant parameters can measure the probability of a segmentation error in the first word segmentation result. For example, if there is an error in the first word segmentation result, the application effect of the first word segmentation result in actual business will be poor. Therefore, parameters that can reflect the application effect can be selected as relevant parameters. If the probability of a segmentation error in the first word segmentation result is high, it can be considered that the preset word segmentation model is likely to make a mistake in the segmentation of the first text. Accordingly, the first text corresponding to the first word segmentation result can be used as a candidate text. Among them, the candidate text is a suspicious text in the first text that may have a segmentation error.

[0032] Step 103: Obtain the standard word segmentation result of the candidate text.

[0033] In an embodiment of the present invention, the standard word segmentation result may be a word segmentation result without word segmentation errors. For example, the standard word segmentation result may be obtained by manually segmenting the candidate text. In a specific implementation, the candidate text may be output to a word segmentation personnel so that the word segmentation personnel may segment the candidate text. Then, the candidate text segmentation result returned by the word segmentation personnel may be received, and the candidate text segmentation result may be determined as the standard word segmentation result.

[0034] Step 104: Select a question text from the candidate texts according to the standard word segmentation result and the first word segmentation result.

[0035] In the embodiment of the present invention, since the standard word segmentation result can represent the word segmentation result without word segmentation errors, and the candidate text is determined to be a text with a high probability of having word segmentation errors, it is possible to combine the standard word segmentation result of the candidate text and the first word segmentation result to determine whether the candidate text really has a segmentation error, that is, to determine whether the candidate text is a problem text. It should be noted that in the embodiment of the present invention, after obtaining the first word segmentation result, the operation of determining the problem text can be periodically performed. The specific execution cycle can be set according to actual needs, and the embodiment of the present invention does not limit this.

[0036] The text processing method provided in the embodiment of the present invention performs word segmentation processing on the first text based on a preset word segmentation model to obtain a first word segmentation result, and selects a candidate text from the first text according to relevant parameters of the first word segmentation result; the word segmentation error rate of the candidate text meets the preset requirements, and the word segmentation error rate is used to characterize the probability that the first word segmentation result has a word segmentation error. Then, the standard word segmentation result of each candidate text is obtained; according to the standard word segmentation result and the first word segmentation result, the problem text is selected from the candidate text. Compared with the manual analysis method, in the embodiment of the present invention, the first text with a higher probability of word segmentation errors is automatically screened as a candidate text, and the problem text is automatically determined from the candidate text. That is, after word segmentation, problem discovery is actively performed, so the processing efficiency can be improved to a certain extent.

[0037] At the same time, first screening out suspicious candidate texts, and then further screening out the problem texts from the candidate texts can ensure the accuracy of the final problem texts to a certain extent.

[0038] Optionally, in one implementation of an embodiment of the present invention, the relevant parameters may include the degree of difference between the first word segmentation result and the reference word segmentation result and / or the relevant index of the first search result recalled based on the first word segmentation result. Among them, the reference word segmentation result is obtained by segmenting the first text through other word segmentation models. Other word segmentation models may be word segmentation models different from the aforementioned preset word segmentation models. Specifically, if there is a word segmentation error in the first word segmentation result, it may affect the relevant index of the first search result recalled based on the first word segmentation result, so that the degree of difference with the reference word segmentation result is large. Therefore, in an embodiment of the present invention, the degree of difference and / or the relevant index can be used as the relevant parameters of the first word segmentation result. That is, the probability that there is a word segmentation error in the first word segmentation result can be measured by the degree of difference between the first word segmentation result and the reference word segmentation result, and / or, by the relevant index of the first search result recalled by the first word segmentation result.

[0039] In the embodiment of the present invention, the difference between the first word segmentation result and the reference word segmentation result, and / or the related index of the first search result recalled based on the first word segmentation result are used as the related parameters of the first word segmentation result. Due to the difference and the related index, the probability of the first word segmentation result having a word segmentation error can be measured more accurately. Therefore, the accuracy of the selected candidate text can be ensured to a certain extent.

[0040] Optionally, in an implementation of the embodiment of the present invention, after the question text is screened out, the following steps may be performed:

[0041] Step S21: context analysis is performed on the question subtext in the question text to determine interference factors; the word segmentation method of the question subtext in the first word segmentation result is different from the word segmentation method in the standard word segmentation result.

[0042] In this step, the first word segmentation result of the question text can be compared with the standard word segmentation result to determine the parts with different word segmentation methods of the two, and then obtain the question subtext. For example, assuming that the question text is "Today is really blue", the first word segmentation result is: today / naive / of / good blue, and the standard word segmentation result is: today / sky / really / good blue. Then the "naive" in the question text can be used as the question subtext. Further, the interference factor can be determined based on the context content that causes the question subtext to be divided incorrectly. Accordingly, the question subtext can be contextually analyzed to determine the context content that causes the division error. For example, when the word "good blue" used to describe the sky appears in the context, the division method of the question subtext in different word segmentation results is different. Therefore, the words used to describe the sky can be used as interference factors of the question subtext. That is, the semantic meaning of the context content that causes the division error can be used as an interference factor.

[0043] Step S22: adding a word segmentation rule to the preset word segmentation model according to the interference factor; the word segmentation rule is used to indicate that when the interference factor and the problem sub-text appear in the second text, the problem sub-text in the second text is segmented according to the word segmentation method in the standard word segmentation result.

[0044] In this step, the second text may be a text that needs to be segmented by a preset segmentation model later. In specific implementation, the segmentation rules may be specified based on interference factors and the segmentation method of the problem sub-text in the standard segmentation results. The segmentation rules may be set as the segmentation conditions of the preset segmentation model. Accordingly, when interference factors and the problem sub-text appear in the second text at the same time, the preset segmentation model may segment the problem sub-text according to the segmentation method in the standard segmentation result, thereby avoiding segmentation errors. Alternatively, the segmentation rules may be added as a configuration file. After the preset segmentation model segments the second text, the problem sub-text in the segmentation result is re-segmented according to the segmentation method in the standard segmentation result to ensure the accuracy of the final result.

[0045] In an embodiment of the present invention, context analysis is performed on the question subtexts in each question text to determine interference factors, and according to the interference factors, word segmentation rules are added to the preset word segmentation model. In this way, by adding word segmentation rules to the preset word segmentation model, optimization can be achieved, so that when the subsequent preset word segmentation model performs word segmentation processing on the text again, the same word segmentation errors can be avoided from recurring, thereby improving the subsequent word segmentation processing effect to a certain extent. And compared to the method of troubleshooting the problem when a business error occurs after being applied to a specific business, the embodiment of the present invention can reduce the frequency of business errors caused by word segmentation errors after the subsequent word segmentation results are applied to a specific business to a certain extent by actively discovering problems. At the same time, since there is no need to adjust the internal parameters of the model, the stability of the optimization can be ensured to a certain extent.

[0046] Optionally, the preset word segmentation model in the embodiment of the present invention may include a general word segmentation model and a domain word segmentation model in different fields. Among them, the preset word segmentation model can be used as a core word segmentation module, and the core word segmentation module can be obtained based on the core word segmentation data. The core word segmentation module can also use a model based on a dictionary method and a model based on a serialization annotation method, for example, a hidden Markov model (HMM) and a conditional random field (CRF) model, which is not limited in the embodiment of the present invention. Specifically, when selecting a preset word segmentation model, it can be selected based on the overall application scenario, taking into account the word segmentation efficiency and the new word discovery ability that can be supported. For example, the core word segmentation module can directly use general domain word segmentation data, or it can formulate a suitable word segmentation standard according to the actual situation, and then perform manual data annotation according to the word segmentation standard as the core word segmentation data, and train to obtain the core word segmentation model. Further, the domain word segmentation model can constitute a domain intervention module, which is used to intervene in the output of the core word segmentation module so that the final word segmentation result conforms to the characteristics of a specific field. Since the core word segmentation module already has good general word segmentation capabilities, the domain word segmentation model can be a model with a scale smaller than the preset scale, that is, the domain word segmentation model can use an efficient, simple and small model to reduce the required data scale. For example, the output of the core word segmentation module and the manually annotated domain data can be used as training data for the domain word segmentation model, thereby reducing the workload of manual annotation. At the same time, the use of the domain word segmentation model does not require manual cleaning, which can reduce operation and maintenance costs.

[0047] It should be noted that, in another implementation, a domain dictionary may be used to intervene in the results of the core word segmentation module, wherein the domain dictionary may be obtained by mining or manual operation and maintenance, which is not limited in the embodiment of the present invention. For example, the core word segmentation module and the domain intervention module may form a unified word segmenter. Figure 2is a schematic diagram of the result of a unified word segmenter provided by the implementation of the present invention, such as Figure 2 As shown, the unified word segmenter may include a core word segmentation module and a domain dictionary / domain word segmentation model obtained based on domain data of n domains.

[0048] Furthermore, the process of obtaining the first word segmentation result may be: using the first text as the input of the general word segmentation model to obtain an intermediate word segmentation result; inputting the intermediate word segmentation result into the domain word segmentation model of the domain to which the first text belongs to obtain the first word segmentation result. That is, multi-domain word segmentation processing can be implemented in the embodiment of the present invention. Since multi-domain word segmentation involves many domains, the probability of word segmentation errors is high. In the embodiment of the present invention, by performing active problem discovery in a multi-domain word segmentation scenario, the word segmentation effect of multi-domain word segmentation can be improved to a certain extent.

[0049] At the same time, due to the presence of a large number of proper nouns and unregistered words in specific fields (for example, new words that have not appeared in business names, dish names, place names, etc.). It is often difficult for general word segmentation methods to obtain ideal word segmentation results in specific fields, and the single granularity word segmentation results provided by the general word segmentation system cannot meet the specific application requirements in different fields. Therefore, the multi-field word segmentation processing method provided in the embodiment of the present invention can meet the word segmentation processing requirements in multiple fields. And the method of establishing a specific field word segmentation system for each field will result in a large cost. The method of combining a general word segmentation model with a field word segmentation model of different fields in the embodiment of the present invention can reduce costs to a certain extent.

[0050] Optionally, in another implementation of the embodiment of the present invention, after the question text is screened out, the following steps can be performed: Step S31, the question text and the standard word segmentation result of the question text are used as an optimized sample pair, and the optimized sample pair is used to continue training the preset word segmentation model to obtain the optimized preset word segmentation model. The specific training method can be selected based on actual needs. For example, the gradient descent method can be selected to implement training. By continuing training, the internal parameters of the model can be optimized, the model's ability to segment the question text can be improved, and the accuracy of subsequent word segmentation can be improved.

[0051] In the embodiment of the present invention, the question text and the standard word segmentation result of the question text are used as optimization sample pairs, and the preset word segmentation model is further trained using more targeted optimization sample pairs. In this way, optimization can be achieved by continuing to train the preset word segmentation model, and at the same time, the same word segmentation errors can be avoided when the subsequent preset word segmentation model performs word segmentation processing on the text again, thereby improving the subsequent processing effect to a certain extent.

[0052] Optionally, the operation of selecting a candidate text from the first text according to the relevant parameters of the first word segmentation result may specifically include:

[0053] Step S41: based on the relevant parameters of the first word segmentation result, detect whether the first text meets the preset conditions; the preset conditions include that the relevant indicators are abnormal and / or the degree of difference meets the preset difference conditions; the other word segmentation models include the adjacent field word segmentation model corresponding to the first text or the general field word segmentation model of the corresponding field.

[0054] In this step, when the relevant index of the first search result is significantly different from the relevant index of the search result recalled when there is no segmentation error, it can be confirmed that the relevant index is abnormal. Furthermore, the greater the degree of difference, the greater the difference between the first segmentation result and the reference segmentation result. The preset difference condition can be set according to actual needs, and the preset difference condition can be the degree of difference that can be tolerated when there is no segmentation error.

[0055] Furthermore, the field to which the first text belongs can be pre-set. For example, the field to which the first text belongs can be the field of food, the field of science and technology, and so on. The general field word segmentation model of the field to which the first text belongs can be pre-trained. For example, since the mature open source general field word segmenter has a good word segmentation effect in the corresponding field, the open source general field word segmenter can be directly used as the general field word segmentation model. The adjacent field word segmentation model corresponding to the first text can be a word segmentation model applicable to the adjacent field to which the first text belongs. The field data (i.e., training data) word segmentation models used in different fields may be different, and the field data and word segmentation models used in similar fields have similarities. In one way, the first text can be segmented based on the adjacent field word segmentation model to obtain a reference word segmentation result to achieve mutual verification between fields. In another way, the first text can be segmented based on the general field word segmentation model to obtain a reference word segmentation result.

[0056] Step S42: If the first text satisfies at least one of the preset conditions, the first text is determined as the candidate text; and the word segmentation error rate of the first text that satisfies at least one of the preset conditions meets the preset requirement.

[0057] In this step, if the first text meets at least one preset condition, it can be considered that the word segmentation error rate of the first text meets the preset requirement, and the first text has a high probability of word segmentation errors, and the first text can be used as a candidate text.

[0058] In an embodiment of the present invention, based on relevant parameters of the first word segmentation result, it is detected whether the first text meets preset conditions; the preset conditions include that the relevant indicators are abnormal and / or the degree of difference meets the preset difference conditions; other word segmentation models include adjacent field word segmentation models corresponding to the first text or general field word segmentation models of the corresponding field. If the first text meets at least one preset condition, the first text is determined as a candidate text; the word segmentation error rate of the first text that meets at least one preset condition meets the preset requirements. In an embodiment of the present invention, different detection methods represented by different preset conditions are used to represent whether the word segmentation error rate of the first text meets the preset requirements by whether the first text meets the preset conditions, so that the operation of screening candidate texts can be achieved only by detecting whether the preset conditions are met, thereby ensuring the screening efficiency to a certain extent.

[0059] Optionally, in the case where the preset situation is that the degree of difference satisfies a preset difference condition, the operation of detecting whether the first text satisfies the preset situation may specifically include:

[0060] Step S51: Determine the difference in the number of words between the first word segmentation result and the reference word segmentation result, and determine the difference in length between words in the same position in the first word segmentation result and the reference word segmentation result.

[0061] In this step, the number of words included in the first word segmentation result and the number of words included in the reference word segmentation result can be counted respectively. Then, the difference between the two word numbers is calculated to obtain the word number difference. Furthermore, the length of the words at the specified position in the first word segmentation result and the length of the words at the specified position in the reference word segmentation result can be counted respectively. Then, the difference between the two lengths is calculated to obtain the length difference. Among them, the specified position can be pre-set according to actual needs. For example, the specified position can be the beginning position, the end position, the middle position, etc. in the word segmentation result. The length of a word can be the number of characters contained in the word.

[0062] Step S52: If the difference in the number of words is greater than a first preset difference threshold and / or the difference in length is greater than a second preset difference threshold, it is determined that the first text meets the preset condition.

[0063] If the word segmentation methods for the candidate text are closer, the number of words contained in the first word segmentation result and the length of the words in the same position will be closer to the reference word segmentation result. On the contrary, if the difference in the number of words and the difference in length between the two are larger, it means that the word segmentation methods are very different, and to a certain extent, it can be explained that there may be word segmentation errors in the first word segmentation result.

[0064] Further, when the difference in the number of words is greater than the first preset difference threshold and / or the difference in length is greater than the second preset difference threshold, that is, when the difference in the number of words and the difference in length are too large, it can be determined that the first text meets the preset condition. Otherwise, it can be determined that the first text does not meet the preset condition. The specific values ​​of the first preset difference threshold and the second preset difference threshold can be set according to actual needs.

[0065] In an embodiment of the present invention, the difference in the number of words between the first word segmentation result and the reference word segmentation result and the difference in length between words in the same position are determined; the difference in the number of words and the difference in length are used to characterize the degree of difference. If the difference in the number of words is greater than a first preset difference threshold and / or the difference in length is greater than a second preset difference threshold, it is determined that the first text meets the preset condition. Since the difference in the number of words and the difference in length between words in the same position can more accurately characterize the degree of difference, the method of determining whether the first text meets the preset condition based on the difference in the number of words and the difference in length in an embodiment of the present invention can ensure the accuracy of detection to a certain extent.

[0066] Optionally, the relevant indicators in the embodiment of the present invention may include the number of search results, the click rate of the virtual items represented by the search results, and the order rate. In the case where the preset situation is that the relevant indicators are abnormal, the above-mentioned operation of detecting whether the first text meets the preset situation may include:

[0067] Step S61: When the number of search results of the first word segmentation result is less than a preset number threshold, and / or the click-through rate is greater than a preset click-through rate threshold and the purchase rate is less than a preset purchase rate threshold, determine that the first text meets the preset conditions.

[0068] In an embodiment of the present invention, each first search result recalled based on the first word segmentation result can represent a virtual item. For example, the virtual item can be take-out food, electronic products, clothes and accessories, etc. In the case of a word segmentation error, for example, the query word itself is segmented incorrectly, or the local text segmentation error in which the query word appears in the target document may cause the number of search results of the first search result recalled based on the first word segmentation result to be too low, or even unable to be recalled to the first search result, that is, the number of search results may be 0. Alternatively, in the case of a word segmentation error, the virtual item represented by the search result may not match the meaning of the word in the word segmentation result, and then the click rate of the virtual item represented by the search result is too high but the order rate is too low. Accordingly, it can be determined that the first text meets the preset situation when the number of search results of the first word segmentation result is less than the preset number threshold, that is, the number of search results recalled is too low, and / or the click rate is greater than the preset click rate threshold and the purchase rate is less than the preset purchase rate threshold, that is, the click rate is too high but the order rate is too low. Otherwise, it can be determined that the first text does not meet the preset situation. Among them, specific values ​​of the preset quantity threshold, the preset click rate threshold, and the preset purchase rate threshold can be set according to actual needs.

[0069] In the embodiment of the present invention, when the number of search results of the first word segmentation result is less than a preset number threshold, and / or the click-through rate is greater than a preset click-through rate threshold and the purchase rate is less than a preset purchase rate threshold, it is determined that the first text meets the preset condition. Since the size relationship between the number of search results and the preset number threshold, the size relationship between the click-through rate and the preset click-through rate threshold, and the size relationship between the purchase rate and the preset purchase rate threshold can more accurately characterize whether there is an abnormality. Therefore, the method of determining whether the first text meets the preset condition based on the number of search results, the click-through rate, and the purchase rate in the embodiment of the present invention can ensure the accuracy of the detection to a certain extent.

[0070] Optionally, the embodiment of the present invention may further perform the following steps after the step of selecting a candidate text from the first text according to the relevant parameters of the first word segmentation result:

[0071] Step S71, determining the risk level of each candidate text; the more the number of the preset conditions satisfied is, the higher the risk level is; when the number of the preset conditions satisfied is the same, the risk level of the candidate text with abnormalities in the relevant indicators is greater than the risk level of the candidate text with no abnormalities in the relevant indicators.

[0072] In this step, since abnormalities in related indicators often affect the actual use of users, the risk is relatively high. Therefore, when the number of preset conditions satisfied is the same, a higher risk level can be set for candidate texts with abnormalities in related indicators, so that such candidate texts can be given priority in subsequent processing. Furthermore, if a candidate text is determined to have possible word segmentation errors in multiple ways at the same time, it can be explained to a certain extent that the probability of the candidate text having word segmentation errors is relatively high, and a higher risk level can be set for a candidate text that satisfies a greater number of preset conditions.

[0073] Accordingly, the above operation of obtaining the standard word segmentation results of the candidate texts may specifically include: obtaining the standard word segmentation results of the top N candidate texts with the highest risk levels; the standard word segmentation results are obtained by manual annotation.

[0074] In an embodiment of the present invention, the candidate texts can be sorted in descending order of risk to obtain a candidate text sequence. For example, a preset sorting algorithm can be used to sort the candidate texts. Then, the standard segmentation results of the first N candidate texts in the candidate text sequence are obtained. Among them, the specific value of N can be set according to the available processing resources and processing time. For example, if the available processing resources and processing time are higher, a larger N can be set. Further, the first N candidate texts can be output to the segmentation personnel so that the segmentation personnel can perform segmentation marking on the first N candidate texts. Then, the segmentation results of the first N candidate texts returned by the segmentation personnel can be received to obtain the standard segmentation results. Further, the remaining candidate texts can also be processed when the subsequent processing resources are more sufficient.

[0075] It should be noted that in the embodiment of the present invention, when processing resources are less, candidate texts with lower risk levels can be discarded to reduce the processing volume. For example, candidate texts whose difference between the first word segmentation result and the reference word segmentation result obtained based on the adjacent field word segmentation model meets the preset difference condition are determined as low-risk candidate texts, and the low-risk candidate texts are discarded.

[0076] In the embodiment of the present invention, by determining the risk level, integrating according to the risk level, further narrowing the scope of candidate texts to be processed, and only processing the top N candidate texts, it is possible to concentrate processing resources and time to prioritize the high-risk parts and improve the problem handling effect. At the same time, in the embodiment of the present invention, by filtering out texts with consistent word segmentation results, that is, texts with a low probability of word segmentation errors and stable word segmentation effects, and screening out the top N candidate texts with a higher risk level for processing, the workload of obtaining standard word segmentation results can be reduced to a certain extent, and the problem handling can be achieved at a lower labor cost.

[0077] Optionally, in the embodiment of the present invention, the operation of selecting the problem text from the candidate text according to the standard word segmentation result and the first word segmentation result may specifically include: detecting whether the standard word segmentation result is the same as the first word segmentation result; if the standard word segmentation result is not the same as the first word segmentation result, determining the candidate text as the problem text. Specifically, the words contained in the standard word segmentation result may be compared with the words in the same position in the first word segmentation result to see if they are inconsistent. If they are inconsistent, it can be determined that the standard word segmentation result is not the same as the first word segmentation result, and then the candidate text may be determined as the problem text. In the embodiment of the present invention, the candidate text is determined as the problem text only when the standard word segmentation result is not the same as the first word segmentation result, and then the misjudged candidate text may be eliminated, and only the candidate text with word segmentation errors may be retained as the candidate text, thereby ensuring the accuracy of the problem text to a certain extent. It should be noted that in the embodiment of the present invention, the non-problem text in the candidate text may also be determined as the optimized text; and the adjacent domain word segmentation model and the general domain word segmentor may be optimized using the optimized text. Specifically, the optimized text can be used to continue training the adjacent domain word segmentation model and the general domain word segmenter to achieve optimization. In this way, by reversely optimizing the adjacent domain word segmentation model and the general domain word segmenter, the accuracy of the judgment in the problem discovery process can be improved to a certain extent, thereby reducing the misjudgment in the subsequent problem discovery process.

[0078] Optionally, in the embodiment of the present invention, after optimizing the preset word segmentation model, for example, after adding word segmentation rules to the preset word segmentation model according to interference factors, the question text is segmented based on the preset word segmentation model to obtain a second word segmentation result. The second word segmentation result is used to perform an online search to obtain a second search result recalled based on the second word segmentation result. When there is no abnormality in the relevant indicators of the second search result, the optimization success information is output.

[0079] During specific implementation, the randomly selected question text can be used as the input of the preset word segmentation model, and the output of the preset word segmentation model can be used as the second word segmentation result. Then, the second word segmentation result can be used as a search term or an index term of a virtual item for online search to obtain a second search result. Furthermore, if there is no abnormality in the relevant indicators of the second search result, it means that the optimization operation for the preset word segmentation model is successful, and then the optimization success information can be output. The optimization success information can be text information, voice information, and the like. In an embodiment of the present invention, after optimizing the preset word segmentation model, the word segmentation result obtained by the optimized model processing is fed back to the business in the specific field for online effect verification, and when the optimization is verified to be successful, the optimization success information is output. In this way, users can easily obtain the results of the optimization operation.

[0080] Figure 3 is a schematic diagram of a text processing framework provided by an embodiment of the present invention, such as Figure 3 As shown, the framework may include an active problem discovery module and a unified word segmenter. Among them, the "multi-channel candidate text screening module" in the active problem discovery part can be used to select candidate texts based on the above-mentioned related steps, the "candidate text integration module" can be used to determine the top N candidate texts with the highest risk based on the above-mentioned related steps, and the "manual verification module" can generate standard word segmentation results through manual word segmentation result annotation to determine the final problem text. Determine whether the optimization is successful through the business online effect verification operation.

[0081] Further, Figure 4 is a schematic diagram of an active problem discovery module provided by an embodiment of the present invention, such as Figure 4 As shown, the multi-channel candidate text screening module may include a candidate text screening module based on business data, a candidate text screening module based on mutual verification between fields, and a candidate text screening module based on universal word segmentation. The multi-channel candidate text screening module can screen and obtain candidate text combinations based on these modules, and further, these candidate text sets can be integrated based on the candidate text integration module, for example, these candidate text sets are summarized into the same set. Among them, the candidate text screening module based on business data can be used to detect whether there is an abnormality in the relevant indicators of the first search result based on the first text recall, and the first text is determined as a candidate text in the case of an abnormality. The first text can be used to determine whether the difference between the reference word segmentation result and the first word segmentation result obtained based on the adjacent field word segmentation model meets the preset difference condition, and the first text is determined as a candidate text in the case of meeting the preset difference condition. The candidate text screening module based on universal word segmentation can be used to determine whether the difference between the reference word segmentation result and the first word segmentation result obtained based on the universal field word segmentation model meets the preset difference condition, and the first text is determined as a candidate text in the case of meeting the preset difference condition.

[0082] In the embodiment of the present invention, in the case of multi-domain word segmentation, problem discovery is actively carried out, problem texts with word segmentation errors are screened from large-scale data, and targeted optimization is performed, thereby improving the problem discovery effect and reducing the problem discovery cost while achieving multi-domain word segmentation to a certain extent. In addition, the functions of each module in the embodiment of the present invention can be flexibly adjusted according to actual needs, for example, the domain intervention module and the candidate text screening module can be used for more complex and changeable actual scenarios.

[0083] Figure 5 2 is a structural diagram of a text processing device provided by an embodiment of the present invention. The device 20 may include:

[0084] The first processing module 201 is used to perform word segmentation processing on the first text based on a preset word segmentation model to obtain a first word segmentation result;

[0085] A first selection module 202 is used to select a candidate text from the first text according to relevant parameters of the first word segmentation result; the word segmentation error rate of the candidate text meets a preset requirement, and the word segmentation error rate is used to represent the probability that the first word segmentation result has a word segmentation error;

[0086] A first acquisition module 203 is used to acquire a standard word segmentation result of the candidate text;

[0087] The second selection module 204 is used to select a question text from the candidate texts according to the standard word segmentation result and the first word segmentation result.

[0088] Optionally, the relevant parameters include the degree of difference between the first word segmentation result and a reference word segmentation result, and / or relevant indicators of the first search result recalled based on the first word segmentation result; the reference word segmentation result is obtained by segmenting the first text through other word segmentation models.

[0089] Optionally, the device 20 further includes:

[0090] A first determination module is used to perform context analysis on a question subtext in the question text to determine interference factors; the word segmentation method of the question subtext in the first word segmentation result is different from the word segmentation method in the standard word segmentation result;

[0091] An adding module is used to add segmentation rules to the preset segmentation model according to the interference factors; the segmentation rules are used to indicate that when the interference factors and the problem sub-text appear in the second text, the problem sub-text in the second text is segmented according to the segmentation method in the standard segmentation result.

[0092] Optionally, the first selection module 202 is specifically configured to:

[0093] Based on the relevant parameters of the first word segmentation result, detecting whether the first text meets the preset conditions; the preset conditions include that the relevant indicators are abnormal and / or the difference degree meets the preset difference condition; the other word segmentation models include the adjacent field word segmentation model corresponding to the first text or the general field word segmentation model of the corresponding field;

[0094] If the first text satisfies at least one of the preset conditions, the first text is determined as the candidate text; and the word segmentation error rate of the first text that satisfies at least one of the preset conditions meets the preset requirement.

[0095] Optionally, when the preset situation is that the difference degree satisfies a preset difference condition, the first selection module 202 is further specifically configured to:

[0096] Determine a difference in the number of words between the first word segmentation result and the reference word segmentation result, and determine a difference in length between words at the same position in the first word segmentation result and the reference word segmentation result; the difference in the number of words and the difference in length are used to characterize the degree of difference;

[0097] If the word quantity difference is greater than a first preset difference threshold and / or the length difference is greater than a second preset difference threshold, it is determined that the first text meets the preset condition.

[0098] Optionally, the relevant indicators include the number of search results, the click rate and the order rate of the virtual items represented by the search results; when the preset situation is that the relevant indicators are abnormal, the first selection module 202 is further specifically used to:

[0099] When the number of search results of the first word segmentation result is less than a preset number threshold, and / or the click-through rate is greater than a preset click-through rate threshold and the purchase rate is less than a preset purchase rate threshold, it is determined that the first text meets the preset conditions.

[0100] Optionally, the device 20 further includes:

[0101] The second determination module is used to determine the risk level of each candidate text; the more preset conditions that are satisfied, the higher the risk level; when the number of preset conditions satisfied is the same, the risk level of the candidate text with abnormalities in the relevant indicators is greater than that of the candidate text with no abnormalities in the relevant indicators;

[0102] The first acquisition module 203 is specifically used to: obtain standard word segmentation results of the top N candidate texts with the highest risk levels; the standard word segmentation results are obtained through manual annotation.

[0103] Optionally, the device 20 further includes:

[0104] A second processing module, configured to perform word segmentation processing on the question text based on the preset word segmentation model to obtain a second word segmentation result;

[0105] A second acquisition module, configured to perform an online search using the second word segmentation result to obtain a second search result recalled based on the second word segmentation result;

[0106] The output module is used to output optimization success information when there is no abnormality in the relevant indicators of the second search result.

[0107] Optionally, the second selection module 204 is specifically configured to:

[0108] Detecting whether the standard word segmentation result is the same as the first word segmentation result;

[0109] If the standard word segmentation result is different from the first word segmentation result, the candidate text is determined as the question text.

[0110] Optionally, the preset word segmentation model includes a general word segmentation model and domain word segmentation models of different fields.

[0111] The text processing device provided in the embodiment of the present invention performs word segmentation processing on the first text based on a preset word segmentation model to obtain a first word segmentation result, and selects a candidate text from the first text according to relevant parameters of the first word segmentation result; the word segmentation error rate of the candidate text meets the preset requirements, and the word segmentation error rate is used to characterize the probability that the first word segmentation result has a word segmentation error. Then, the standard word segmentation result of each candidate text is obtained; according to the standard word segmentation result and the first word segmentation result, the problem text is selected from the candidate text. Compared with the manual analysis method, in the embodiment of the present invention, the first text with a higher probability of word segmentation errors is automatically screened as a candidate text, and the problem text is automatically determined from the candidate text. That is, after word segmentation, problem discovery is actively performed, so the processing efficiency can be improved to a certain extent.

[0112] At the same time, first screening out suspicious candidate texts, and then further screening out the problem texts from the candidate texts can ensure the accuracy of the final problem texts to a certain extent.

[0113] The present invention also provides an electronic device, see Figure 6 , including: a processor 301, a memory 302, and a computer program 3021 stored in the memory and executable on the processor, wherein the processor implements the method of the aforementioned embodiment when executing the program.

[0114] The present invention also provides a readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the method of the aforementioned embodiment.

[0115] As for the device 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.

[0116] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0117] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0118] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0119] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0120] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the present invention. The present invention may also be implemented as a device or apparatus program for executing part or all of the methods described herein. Such a program for implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0121] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0123] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

[0124] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A text processing method, characterized in that: The method comprises: Performing word segmentation processing on the first text based on a preset word segmentation model to obtain a first word segmentation result; selecting a candidate text from the first text according to relevant parameters of the first word segmentation result; a word segmentation error rate of the candidate text meets a preset requirement, and the word segmentation error rate is used to represent the probability that the first word segmentation result has a word segmentation error; Obtaining a standard word segmentation result of the candidate text; Selecting a question text from the candidate texts according to the standard word segmentation result and the first word segmentation result; The relevant parameters include the degree of difference between the first word segmentation result and the reference word segmentation result, and / or the relevant index of the first search result recalled based on the first word segmentation result; the reference word segmentation result is obtained by segmenting the first text through other word segmentation models; the standard word segmentation result is obtained by manual annotation.

2. The method according to claim 1, characterized in that The method further comprises: Performing context analysis on the question subtext in the question text to determine interference factors; the word segmentation method of the question subtext in the first word segmentation result is different from the word segmentation method in the standard word segmentation result; According to the interference factors, a segmentation rule is added to the preset segmentation model; the segmentation rule is used to indicate that when the interference factors and the problem sub-text appear in the second text, the problem sub-text in the second text is segmented according to the segmentation method in the standard segmentation result.

3. The method according to claim 1, characterized in that The selecting a candidate text from the first text according to the relevant parameters of the first word segmentation result includes: Based on the relevant parameters of the first word segmentation result, detecting whether the first text meets the preset conditions; the preset conditions include that the relevant indicators are abnormal and / or the difference degree meets the preset difference condition; the other word segmentation models include the adjacent field word segmentation model corresponding to the first text or the general field word segmentation model of the corresponding field; If the first text satisfies at least one of the preset conditions, determining the first text as the candidate text; The word segmentation error rate of the first text that meets at least one of the preset conditions meets the preset requirement.

4. The method according to claim 3, characterized in that In the case where the preset condition is that the degree of difference satisfies a preset difference condition, the detecting whether the first text satisfies the preset condition includes: Determine a difference in the number of words between the first word segmentation result and the reference word segmentation result, and determine a difference in length between words at the same position in the first word segmentation result and the reference word segmentation result; the difference in the number of words and the difference in length are used to characterize the degree of difference; If the word quantity difference is greater than a first preset difference threshold and / or the length difference is greater than a second preset difference threshold, it is determined that the first text meets the preset condition.

5. The method according to claim 3, characterized in that: The relevant indicators include the number of search results, the click rate and the purchase rate of the virtual items represented by the search results; when the preset situation is that the relevant indicators are abnormal, the detecting whether the first text meets the preset situation includes: When the number of search results of the first word segmentation result is less than a preset number threshold, and / or the click-through rate is greater than a preset click-through rate threshold and the purchase rate is less than a preset purchase rate threshold, it is determined that the first text meets the preset conditions.

6. The method according to claim 1, characterized in that After selecting a candidate text from the first text according to the relevant parameters of the first word segmentation result, the method further includes: Determine the risk level of each candidate text; the more preset conditions that are satisfied, the higher the risk level; when the number of preset conditions that are satisfied is the same, the risk level of the candidate text with abnormalities in the relevant parameters is greater than that of the candidate text with no abnormalities in the relevant parameters; The obtaining of the standard word segmentation results of the candidate texts includes: obtaining the standard word segmentation results of the top N candidate texts with the highest risk levels.

7. The method according to claim 2, characterized in that After adding the word segmentation rules to the preset word segmentation model according to the interference factors, the method further includes: Performing word segmentation processing on the question text based on the preset word segmentation model to obtain a second word segmentation result; Performing an online search using the second word segmentation result to obtain a second search result recalled based on the second word segmentation result; When there is no abnormality in the relevant index of the second search result, optimization success information is output.

8. The method according to claim 1, characterized in that The step of selecting a question text from the candidate texts according to the standard word segmentation result and the first word segmentation result includes: Detecting whether the standard word segmentation result is the same as the first word segmentation result; If the standard word segmentation result is different from the first word segmentation result, the candidate text is determined as the question text.

9. The method according to any one of claims 1 to 8, characterized in that: The preset word segmentation model includes a general word segmentation model and domain word segmentation models of different fields.

10. A text processing device, characterized in that: The device comprises: A first processing module, configured to perform word segmentation processing on the first text based on a preset word segmentation model to obtain a first word segmentation result; A first selection module is used to select a candidate text from the first text according to relevant parameters of the first word segmentation result; the word segmentation error rate of the candidate text meets a preset requirement, and the word segmentation error rate is used to represent the probability that the first word segmentation result has a word segmentation error; A first acquisition module, used to obtain a standard word segmentation result of the candidate text; A second selection module is used to select a question text from the candidate texts according to the standard word segmentation result and the first word segmentation result; the relevant parameters include the degree of difference between the first word segmentation result and the reference word segmentation result, and / or the relevant index of the first search result recalled based on the first word segmentation result; the reference word segmentation result is obtained by segmenting the first text by other word segmentation models; the standard word segmentation result is obtained by manual annotation.

11. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements one or more of the methods described in claims 1-9 when executing the program.

12. A readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute one or more of the methods described in claims 1-9.

Citation Information

Patent Citations

  • Similarity calculation method and device based on word characteristics, equipment and storage medium

    CN111259126A

  • Text detection and correction method based on Pinyin similarity and language model

    CN112232055A