Text processing method and device, electronic equipment and storage medium

By segmenting and probabilistically analyzing semantically deficient text, the system automatically determines the semantically restored text, solving the problem of high costs associated with manual semantic restoration and achieving efficient restoration of semantically deficient text.

CN114781399BActive Publication Date: 2026-02-27BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210531617.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2026-02-27
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

The semantic information of semantically deficient text cannot be obtained directly, and manual semantic restoration is costly and requires a high level of expertise.

Method used

By segmenting the text to be processed and determining the preset probability value related to the target text, semantic reconstruction can be performed automatically and efficiently by utilizing the probability of the target text combined with other texts, thus reducing the cost of manual processing.

Benefits of technology

It achieves efficient and automatic restoration of semantically missing text, reduces manual processing costs, and improves the efficiency of semantic restoration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114781399B_ABST
    Figure CN114781399B_ABST
Patent Text Reader

Abstract

The present disclosure provides a text processing method, relates to the technical field of artificial intelligence, and particularly relates to the technical field of natural language processing. The specific implementation scheme is: dividing a to-be-processed text to obtain a text set, wherein the text set comprises at least one subtext; determining at least one preset probability value related to a target text, wherein the target text is a text matched with the subtext, and the preset probability value is used to represent the probability that the target text is combined with other texts; determining a probability value according to the at least one preset probability value, wherein the probability value is used to represent the probability that the target text is a semantic restoration text of the subtext; and determining a semantic restoration text of the to-be-processed text according to the probability value. The present disclosure also provides a text processing device, an electronic device and a storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of artificial intelligence, and in particular, to the technical field of natural language processing. More specifically, the present disclosure provides a text processing method and device, an electronic device, and a storage medium. BACKGROUND

[0002] With the development of artificial intelligence technology, artificial intelligence technology is widely applied to natural language processing and other scenarios. SUMMARY

[0003] The present disclosure provides a text processing method, device, and storage medium.

[0004] According to an aspect of the present disclosure, a text processing method is provided. The method includes: dividing a to-be-processed text to obtain a text set, wherein the text set includes at least one subtext; determining at least one preset probability value related to a target text, wherein the target text is a text matched with the subtext, and the preset probability value is used to represent a probability of the target text being combined with other texts; determining a probability value according to the at least one preset probability value, wherein the probability value is used to represent a probability of the target text being a semantic restoration text of the subtext; and determining a semantic restoration text of the to-be-processed text according to the probability value.

[0005] According to another aspect of the present disclosure, a text processing device is provided. The device includes: a division module configured to divide a to-be-processed text to obtain a text set, wherein the text set includes at least one subtext; a first determination module configured to determine at least one preset probability value related to a target text, wherein the target text is a text matched with the subtext, and the preset probability value is used to represent a probability of the target text being combined with other texts; a second determination module configured to determine a probability value according to the at least one preset probability value, wherein the probability value is used to represent a probability of the target text being a semantic restoration text of the subtext; and a third determination module configured to determine a semantic restoration text of the to-be-processed text according to the probability value.

[0006] According to another aspect of the present disclosure, an electronic device is provided. The device includes at least one processor, and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method provided by the present disclosure.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to enable a computer to perform the method provided by the present disclosure.

[0008] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to this disclosure.

[0009] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0010] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0011] Figure 1 This is an exemplary system architecture diagram of a text processing method and apparatus applicable according to an embodiment of the present disclosure;

[0012] Figure 2 This is a flowchart of a text processing method according to an embodiment of the present disclosure;

[0013] Figure 3 This is a flowchart of a text processing method according to an embodiment of the present disclosure;

[0014] Figure 4 This is a schematic diagram of a text processing method according to an embodiment of the present disclosure;

[0015] Figure 5 This is a block diagram of a text processing apparatus according to an embodiment of the present disclosure; and

[0016] Figure 6 This is a block diagram of an electronic device to which text processing methods can be applied, according to an embodiment of the present disclosure. Detailed Implementation

[0017] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0018] The semantic information of semantically deficient text cannot be directly obtained. During data recording, for the sake of brevity, the original text may be abbreviated or shortened. This results in semantically deficient text, which can also be called semantically default text.

[0019] Semantically deficient text may include, for example, abbreviated text.

[0020] For example, for a Chinese text, each Chinese character constituting the Chinese text can be obtained. According to the first letter of the pinyin of each Chinese character, an abbreviated text of the Chinese text is determined. For example, the Chinese text can be, for example, “patient information”, and the abbreviated text thereof can be, for example, “HZXX”. The word order information of the abbreviated text can represent that the word order of the text is from left to right.

[0021] For another example, for a foreign language text, each word constituting the foreign language text can be obtained. Taking English as an example, according to the first letter of each English word, an abbreviated text of the English text is determined.

[0022] The semantic restoration text of the semantic defect text can be determined by using artificial semantic restoration. For example, the characters of the semantic defect text are sequentially restored by using artificial methods. However, the artificial semantic restoration requires high labor cost. In addition, the personnel performing the semantic restoration need to have high professional level.

[0023] Figure 1 is an exemplary system architecture schematic diagram according to an embodiment of the present disclosure, to which the text processing method and device can be applied.

[0024] It should be noted that, Figure 1 The above-mentioned system architecture is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be applied to other devices, systems, environments or scenarios.

[0025] As Figure 1 shown, the system architecture 100 according to the embodiment can include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used as a medium to provide a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired and / or wireless communication links, etc.

[0026] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers and desktop computers, etc.

[0027] The server 105 can be a server providing various services, such as a background management server (only as an example) providing support for the website browsed by the user using the terminal devices 101, 102, 103. The background management server can analyze and process the received user request and other data, and feed back the processing result (such as a webpage, information or data generated or obtained according to the user request, etc.) to the terminal device.

[0028] It should be noted that the text processing method provided by the embodiments of the present disclosure can be generally executed by the server 105. Accordingly, the text processing apparatus provided by the embodiments of the present disclosure can be generally arranged in the server 105. The text processing method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, 103 and / or the server 105. Accordingly, the text processing apparatus provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the terminal device 101, 102, 103 and / or the server 105.

[0029] Figure 2 is a flowchart of a text processing method according to an embodiment of the present disclosure.

[0030] As shown in Figure 2 , the method 200 can include operation S210 to operation S240.

[0031] In operation S210, the to-be-processed text is divided to obtain a text set.

[0032] In the embodiments of the present disclosure, the to-be-processed text can be, for example, a semantic-deficient text.

[0033] For example, the to-be-processed text can be, for example, “HZXX”.

[0034] For example, the to-be-processed text can be divided one or more times by various manners.

[0035] For example, the text set includes at least one subtext.

[0036] For example, the text set A_1 can include, for example, the subtext “HZ” and the subtext “XX”.

[0037] In operation S220, at least one preset probability value related to the target text is determined.

[0038] For example, the target text is a text matched with the subtext.

[0039] For example, the target text matched with the subtext “HZ” can be, for example, “patient”, “child”, “man” and the like.

[0040] For another example, the target text matched with the subtext “XX” can be, for example, “information”, “message”, “learning” and the like.

[0041] For example, at least one text combination related to the target text can be determined. For example, at least one text combination related to the target text "patient" can include "patient information", "patient message" and "patient learning". For example, at least one text combination related to the target text "information" can include "patient information", "child information" and "man information".

[0042] For another example, each text combination can correspond to a preset probability value, which is used to represent the probability of the target text being combined with other text.

[0043] In an example, the preset probability value corresponding to the text combination "patient information" can represent the probability of the target text "patient" being combined with other text "information".

[0044] In an example, the preset probability value corresponding to the text combination "patient information" can also represent the probability of the target text "information" being combined with other text "patient".

[0045] In operation S230, a probability value is determined according to at least one preset probability value.

[0046] For example, the probability value is used to represent the probability of the target text being a semantic restoration text of a subtext.

[0047] For example, a first sub-probability value can be determined according to at least one preset probability value. The probability value is determined according to the first sub-probability value.

[0048] In an example, among the multiple text combinations related to the target text "patient", the preset probability value corresponding to the text combination "patient information" is PreP_1, the preset probability value corresponding to the text combination "patient message" is PreP_2, and the preset probability value corresponding to the text combination "patient learning" is PreP_3. Taking PreP_1>PreP_2>PreP_3 as an example, the preset probability value corresponding to the text combination "patient information" is the largest. The preset probability value PreP_1 corresponding to the text combination "patient information" can be taken as the first sub-probability value P1_HZ1. According to the first sub-probability value P1_HZ1, the probability value P_HZ1 can be determined. The probability value P_HZ1 can represent the probability of the target text "patient" being a semantic restoration text of the subtext "HZ".

[0049] In another example, in the multiple text combinations corresponding to the target text "information", the preset probability of the text combination "patient information" is PreP_1, the preset probability of the text combination "child information" is PreP_4, and the preset probability of the text combination "man information" is PreP_5. Taking PreP_1>PreP_4>PreP_5 as an example, the preset probability value of the text combination "patient information" is the largest. The preset probability value Pre_P1 of the text combination "patient information" can be taken as the first sub-probability value P1_XX1. According to the first sub-probability value P1_XX1, the probability value P_XX1 can be determined. The probability value P_XX1 can represent the probability of the target text "information" being the semantic restoration text of the subtext "XX".

[0050] In operation S240, the semantic restoration text of the text to be processed is determined according to the probability value.

[0051] For example, for the subtext "HZ", multiple probability values can be determined respectively, and each probability value can represent the probability of a target text being the semantic restoration text of the subtext "HZ". In an example, the probability value P_HZ1, the probability value P_HZ2 and the probability value P_HZ3 can be determined respectively. The probability value P_HZ2 can represent the probability of the target text "child" being the semantic restoration text of the subtext "HZ". The probability value P_HZ3 can represent the probability of the target text "man" being the semantic restoration text of the subtext "HZ". In the multiple probability values, if the probability value P_HZ1 is the largest, it can be determined that the target text "patient" is the semantic restoration text of the subtext "HZ".

[0052] For example, for the subtext "XX", multiple probability values can be determined respectively, and each probability value can represent the probability of a target text being the semantic restoration text of the subtext "XX". In an example, the probability value P_XX1, the probability value P_XX2 and the probability value P_XX3 can be determined respectively. The probability value P_XX2 can represent the probability of the target text "message" being the semantic restoration text of the subtext "XX". The probability value P_XX3 can represent the probability of the target text "learning" being the semantic restoration text of the subtext "XX". In the multiple probability values, if the probability value P_XX1 is the largest, it can be determined that the target text "information" is the semantic restoration text of the subtext "XX".

[0053] For example, according to the semantic restoration text of the subtext "HZ" and the semantic restoration text of the subtext "XX", the semantic restoration text of the text to be processed "HZXX" can be determined. In an example, the semantic restoration text of the text to be processed "HZXX" can be "patient information", for example.

[0054] By the embodiments of the present disclosure, the probability of combining the target text with other texts is utilized, and the missing semantic recovery can be automatically and efficiently performed, and the manual processing cost is effectively reduced.

[0055] Figure 3 is a flowchart of the text processing method according to another embodiment of the present disclosure.

[0056] As shown in Figure 3 the method 320 can include operation S321 to operation S324.

[0057] In operation S321, at least one subtext is matched with a plurality of preset texts to obtain at least one recovered text set.

[0058] For example, the recovered text set includes at least one preset text matched with the subtext.

[0059] For example, the at least one subtext can be from the text set A_1 described above. The at least one subtext may, for example, include the subtext “HZ” and the subtext “XX”.

[0060] For example, the plurality of preset texts may, for example, include “patient”, “child”, “man”, “information”, “message”, “learning”, “example”, and the like.

[0061] For example, the matching can be performed according to the first letter of the pinyin of the preset text.

[0062] For example, the matching of the at least one subtext with the plurality of preset texts to obtain the at least one recovered text set may, for example, include the recovered text set ReA1_1 and the recovered text set ReA1_2. The recovered text set ReA1_1 includes at least one preset text matched with the subtext “HZ”. The recovered text set ReA1_2 includes at least one preset text matched with the subtext “XX”. In one example, the recovered text set ReA1_1 includes “patient”, “child”, “man”. The recovered text set ReA1_2 includes “information”, “message”, “learning”.

[0063] In operation S322, the preset texts between the at least one recovered text set are combined to obtain a plurality of text combinations.

[0064] For example, the text combination corresponds to a preset probability value.

[0065] For example, the preset texts between the recovered text set ReA1_1 and the recovered text set ReA1_2 are combined. For example, the preset text “patient” can be combined with the preset text “information”, the preset text “message”, and the preset text “learning” respectively to obtain the text combination “patient information”, the text combination “patient message”, and the text combination “patient learning”.

[0066] For another example, the plurality of text combinations can include, for example: "patient information", "patient message", "patient learning", "child information", "child message", "child learning", "husband information", "husband message", "husband learning". Each text combination corresponds to a preset probability value.

[0067] In operation S323, a preset text in the recovered text set is determined as a target text.

[0068] For example, a preset text in the recovered text set ReAl_l can be determined as the target text. It can be understood that each preset text in the recovered text set ReAl_l can be determined as the target text in turn.

[0069] In operation S324, at least one preset probability value related to the target text is determined according to the plurality of text combinations.

[0070] For example, the text combinations related to the target text "patient" can include, for example: "patient information", "patient message", "patient learning". According to the preset probability values corresponding to these text combinations, at least one (for example, 3) preset probability values related to the target text "patient" can be determined.

[0071] In some embodiments, the plurality of preset texts are from a preset corpus.

[0072] For example, the preset corpus corresponds to an industry.

[0073] For example, the plurality of preset texts described above are from a preset corpus corresponding to the medical industry.

[0074] For example, different preset corpora can include the same preset text.

[0075] For another example, in the case where the preset texts are from different preset corpora, the preset probability values corresponding to the same text combination can be different. In one example, in the case where the preset texts are from a preset corpus corresponding to the medical industry, the preset probability value corresponding to the text combination "patient information" is greater than the preset probability value corresponding to the text combination "child learning". In the case where the preset texts are from a preset corpus corresponding to the education industry, the preset probability value corresponding to the text combination "patient information" is less than the preset probability value corresponding to the text combination "child learning".

[0076] It can be understood that the preset probability value can be 0.

[0077] In some embodiments, determining the probability value according to the at least one preset probability value comprises: determining a first sub-probability value according to the at least one preset probability value; determining a second sub-probability value according to a word frequency of the target text in a preset corpus; and determining the probability value according to the first sub-probability value and the second sub-probability value.

[0078] For example, the first sub-probability value may, for example, be the first sub-probability value P1_HZ1 described above.

[0079] For example, the preset corpus may further comprise a word frequency of a preset text. According to the word frequency of the preset text, the word frequency of the target text can be determined. The word frequency can represent the frequency of the text. The higher the word frequency, the greater the second sub-probability value can be. It can be understood that according to the word frequency, the second sub-probability value can be determined based on various ways. In one example, the word frequency of the target text "patient" is Fre_1. The word frequency Fre_Sum of all texts in the preset corpus can be used as the divisor, and the word frequency Fre_1 of the target text "patient" can be used as the dividend to perform a division operation. The operation result can be used as the second sub-probability value P2_HZ1. It can be understood that this example is one way of determining the second sub-probability value according to the word frequency, but the present disclosure is not limited thereto, and the second sub-probability value can also be determined according to the word frequency based on other ways.

[0080] In another example, the operation result can also be scaled by using a weight, and the scaling result can be used as the second sub-probability value.

[0081] It can be understood that based on various ways, the probability value can be determined according to the first sub-probability value and the second sub-probability value. Various ways may, for example, include summation, weighted summation, and the like.

[0082] In some embodiments, determining the probability value according to the at least one preset probability value comprises: determining a first sub-probability value according to the at least one preset probability value; determining a third sub-probability value according to a part of speech of the target text; and determining the probability value according to the first sub-probability value and the third sub-probability value.

[0083] For example, the first sub-probability value may, for example, be the first sub-probability value P1_HZ1 described above.

[0084] For example, the part of speech can represent the type of the text, such as noun, verb, adverb, and the like. The type probability value corresponding to the noun is greater than the type probability value corresponding to the adverb. In one example, the correspondence between the part of speech and the type probability value can be preset. The type probability value corresponding to the noun can be PreP_noun. The type probability value corresponding to the adverb can be PreP_adv. For the target text "patient", the part of speech is noun, and the type probability value corresponding to the noun PreP_noun can be used as the third sub-probability value P3_HZ1.

[0085] It can be understood that the probability value can be determined according to the first sub-probability value and the third sub-probability value based on various manners. The various manners include, for example, summation, weighted summation, and the like.

[0086] In some embodiments, the probability value can be determined according to the first sub-probability value, the second sub-probability value, and the third sub-probability value.

[0087] For example, the summation operation can be performed according to the first sub-probability value P1_HZ1, the second sub-probability value P2_HZ1, and the third sub-probability value P3_HZ1 described above, and the probability value P_HZ1 can be obtained.

[0088] According to the embodiments of the present disclosure, the probability value can be determined according to the probability of the target text being combined with other texts, the part-of-speech of the target text, and the word frequency of the target text, which can represent the probability of the target text being the semantic restoration text of the subtext. The efficiency of the semantic restoration can be further improved, and the artificial processing cost can be further reduced.

[0089] In some embodiments, the dividing of the to-be-processed text to obtain the text set includes: dividing the to-be-processed text at least once according to the syntax information of the to-be-processed text to obtain at least one text set.

[0090] For example, taking the to-be-processed text “HZXX” as an example, the syntax information of the to-be-processed text “HZXX” can be obtained. In an example, the syntax information of the to-be-processed text “HZXX” can represent that the syntax order of the to-be-processed text is from left to right. The to-be-processed text can be divided twice to obtain text set A_1 and text set A_2. The text set A_1 can include, for example, subtext “HZ” and subtext “XX”. The text set A_2 can include, for example, subtext “HZX” and subtext “X”.

[0091] It can be understood that, in some embodiments, the syntax information of the to-be-processed text is related to the language of the to-be-processed text. For example, the syntax order of Chinese can be from left to right.

[0092] It can be understood that, in some embodiments, the language of the to-be-processed text can be one of Chinese, English, German, Arabic, and the like. Taking the language of the to-be-processed text as Arabic as an example, the syntax information of the to-be-processed text can represent that the syntax order of the to-be-processed text is from right to left.

[0093] In some embodiments, the target text is multiple, and determining the semantic restoration text of the to-be-processed text according to the probability value includes: determining the semantic restoration text of the subtext from the multiple target texts according to the multiple probability values; and determining the semantic restoration text of the to-be-processed text according to the semantic restoration text of the subtext. The details will be described below in combination with Figure 4 the following.

[0094] Figure 4 is a schematic diagram of a principle of a text processing method according to another embodiment of the present disclosure.

[0095] As shown in FIG. 4A, a text set can be obtained by dividing the text to be processed “HZXX” 401 once. The text set can include a subtext “HZ” 402 and a subtext “XX” 403. Figure 4

[0096] The subtext “HZ” 402 can be matched with a plurality of preset texts in a preset corpus 404 to obtain a recovered text set 405. The recovered text set 405 can include, for example, a plurality of preset texts, and a word frequency and a part of speech of each preset text. For example, the plurality of preset texts in the recovered text set 405 include “patient”, “child”, and “man”. The word frequency of the preset text “patient” is Fre_1. The part of speech of the preset text “patient” is noun. The word frequency of the preset text “child” is Fre_2. The part of speech of the preset text “child” is noun. The word frequency of the preset text “man” is Fre_3. The part of speech of the preset text “man” is noun.

[0097] The subtext “XX” 403 can be matched with a plurality of preset texts in the preset corpus 404 to obtain a recovered text set 406. The recovered text set 406 can include, for example, a plurality of preset texts, and a word frequency and a part of speech of each preset text. For example, the plurality of preset texts in the recovered text set 406 include “information”, “message”, and “learning”. The word frequency of the preset text “information” is Fre_4. The part of speech of the preset text “information” is noun. The word frequency of the preset text “learning” is Fre_5. The part of speech of the preset text “learning” is noun. The word frequency of the preset text “message” is Fre_6. The part of speech of the preset text “message” is noun.

[0098] The preset texts in the recovered text set 405 and the preset texts in the recovered text set 406 can be combined to obtain a plurality of text combinations. The plurality of text combinations can include, for example, “patient information”, “patient message”, “patient learning”, “child information”, “child message”, “child learning”, “man information”, “man message”, “man learning”, and “man information”. Each text combination corresponds to a preset probability value.

[0099] ​For example, each preset text in the recovered text set 405 can be taken as a target text. For example, the text combinations related to the target text "patient" include: "patient information", "patient message", "patient learning". Taking the preset probability values corresponding to these text combinations as the preset probability values related to the target text "patient", at least one preset probability value related to the target text "patient" can be obtained. According to the at least one preset probability value, a probability value can be determined. The probability value can represent the probability that the target text "patient" is the semantic recovered text of the subtext "HZ". The number of target texts from the recovered text set 405 is 3, and a total of 3 probability values can be determined. According to the 3 probability values, the semantic recovered text of the subtext "HZ" 402 can be determined from the multiple target texts from the recovered text set 405. In one example, the semantic recovered text of the subtext "HZ" 402 can be "patient".

[0100] For example, each preset text in the recovered text set 406 can be taken as a target text. For example, the text combinations related to the target text "information" include: "patient information", "child information", "husband information". Taking the preset probability values corresponding to these text combinations as the preset probability values related to the target text "information", at least one preset probability value related to the target text "information" can be obtained. According to the at least one preset probability value, a probability value can be determined. The probability value can represent the probability that the target text "information" is the semantic recovered text of the subtext "XX". The number of target texts from the recovered text set 406 is 3, and a total of 3 probability values can be determined. According to the 3 probability values, the semantic recovered text of the subtext "XX" can be determined from the multiple target texts from the recovered text set 406. In one example, the semantic recovered text of the subtext "XX" 403 can be "information".

[0101] According to the semantic recovered text of the subtext "HZ" 402 and the semantic recovered text of the subtext "XX" 403, the semantic recovered text of the to-be-processed text "HZXX" 401 can be determined. In one example, the semantic recovered text 407 of the to-be-processed text "HZXX" 401 can be "patient information".

[0102] In some embodiments, according to the difference between the semantic recovered text of the to-be-processed text and the label of the to-be-processed text, the number of preset texts in the preset corpus is adjusted.

[0103] For example, the label of the to-be-processed text can be artificially determined.

[0104] For example, the number of preset texts in the preset corpus can be increased to adjust the preset corpus.

[0105] For example, some preset texts in the preset corpus can be deleted to adjust the preset corpus.

[0106] In some embodiments, the preset probability value can also be adjusted according to a difference between the semantic restoration text of the to-be-processed text and the label of the to-be-processed text.

[0107] For example, the preset probability value corresponding to one or more text combinations can be adjusted.

[0108] Figure 5 FIG. 1 is a block diagram of a text processing apparatus according to an embodiment of the present disclosure.

[0109] As shown in FIG. 5, the apparatus 500 can include a division module 510, a first determination module 520, a second determination module 530, and a third determination module 540. Figure 5

[0110] The division module 510 is configured to divide the to-be-processed text to obtain a text set. For example, the text set includes at least one subtext.

[0111] The first determination module 520 is configured to determine at least one preset probability value related to the target text. For example, the target text is a text matched with the subtext, and the preset probability value is used to represent a probability of the target text being combined with other texts.

[0112] The second determination module 530 is configured to determine a probability value according to the at least one preset probability value. For example, the probability value is used to represent a probability of the target text being the semantic restoration text of the subtext.

[0113] The third determination module 540 is configured to determine the semantic restoration text of the to-be-processed text according to the probability value.

[0114] In some embodiments, the first determination module includes: a matching unit configured to match the at least one subtext with a plurality of preset texts to obtain at least one restoration text set, wherein the restoration text set includes at least one preset text matched with the subtext; a combination unit configured to combine the preset texts between the at least one restoration text set to obtain a plurality of text combinations, wherein the text combination corresponds to one preset probability value; a first determination unit configured to determine the preset text in the restoration text set as the target text; and a second determination unit configured to determine the at least one preset probability value related to the target text according to the plurality of text combinations.

[0115] ​In some embodiments, the plurality of preset texts are from a preset corpus, and the second determining module comprises: a third determining unit, configured to determine a first sub-probability value according to the at least one preset probability value; a fourth determining unit, configured to determine a second sub-probability value according to a word frequency of the target text in the preset corpus; and a fifth determining unit, configured to determine the probability value according to the first sub-probability value and the second sub-probability value.

[0116] In some embodiments, the second determining module comprises: a sixth determining unit, configured to determine a first sub-probability value according to the at least one preset probability value; a seventh determining unit, configured to determine a third sub-probability value according to a part of speech of the target text; and an eighth determining unit, configured to determine the probability value according to the first sub-probability value and the third sub-probability value.

[0117] In some embodiments, the dividing module comprises: a dividing unit, configured to divide the to-be-processed text according to syntactic information of the to-be-processed text for at least one time to obtain at least one text set.

[0118] In some embodiments, the target text is a plurality of target texts, and the third determining module comprises: a ninth determining unit, configured to determine a semantic recovery text of a subtext from the plurality of target texts according to the plurality of probability values; and a tenth determining unit, configured to determine the semantic recovery text of the to-be-processed text according to the semantic recovery text of the subtext.

[0119] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in the technical solution comply with relevant laws and regulations and do not violate public order and good customs.

[0120] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium and a computer program product.

[0121] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit the implementations of the present disclosure described and / or claimed in this document.

[0122] As Figure 6As shown, the device 600 includes a computing unit 601 that can perform various appropriate actions and processes in accordance with a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from the storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0123] Various components in the device 600 are connected to the I / O interface 605, including an input unit 606 such as a keyboard, a mouse, etc., an output unit 607 such as various types of displays, speakers, etc., a storage unit 608 such as a magnetic disk, an optical disk, etc., and a communication unit 609 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0124] The computing unit 601 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 601 performs various methods and processes described above, such as the text processing method. For example, in some embodiments, the text processing method can be implemented as a computer software program that is tangibly embodied in a machine-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the text processing method described above can be performed. Alternatively, in other embodiments, the computing unit 601 can be configured to perform the text processing method by any other appropriate means, such as by means of firmware.

[0125] The various embodiments of the systems and techniques described above can be implemented in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a complex programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0126] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, or entirely on a remote machine or server.

[0127] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0128] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0129] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0130] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

[0131] It should be understood that various forms of flow shown above can be used, re-ordered, added to, or deleted from without departing from the spirit of the present disclosure. For example, the steps recited in the present disclosure can be executed in parallel, executed in sequence, or executed in a different order, as long as the desired results of the present disclosure are achieved, and the present disclosure is not limited herein.

[0132] The specific embodiments described above have been shown by way of example, and anyone skilled in the art should understand that various modifications, combinations, sub-combinations, and alternatives can be made to the specific embodiments without departing from the spirit and principles of the present disclosure. Accordingly, the scope of the present disclosure is not intended to be limited to the particular embodiments described above.

Claims

1. A text processing method, comprising: dividing a to-be-processed text according to language sequence information of the to-be-processed text to obtain a plurality of text sets, wherein the text set comprises at least one subtext, the to-be-processed text is in Chinese, the language sequence information of the to-be-processed text is related to the language of the to-be-processed text, and the subtext comprises initial letters of pinyin of a plurality of Chinese characters; matching at least one subtext of each of the plurality of text sets with a plurality of preset texts in a same preset corpus according to initial letters of pinyin of each of the plurality of preset texts to obtain a plurality of recovered text sets, wherein the recovered text set comprises at least one preset text matched with the subtext, and the same preset corpus corresponds to an industry; combining preset texts between the plurality of recovered text sets to obtain a plurality of text combinations, wherein the text combination corresponds to a preset probability value; determining a preset text in the recovered text set as a target text; determining a plurality of preset probability values related to the target text according to preset probability values corresponding to a plurality of text combinations related to the target text, wherein the target text is a text matched with the subtext, and the preset probability value is used to represent a probability of combination of the target text with other texts; determining a first sub-probability value according to a plurality of preset probability values related to the target text; determining a second sub-probability value according to a word frequency of the target text in the same preset corpus; and determining the probability value according to the first sub-probability value and the second sub-probability value, wherein the probability value is used to represent a probability that the target text is a semantic recovered text of the subtext; and determining a semantic recovered text of the to-be-processed text according to the probability value. 2.A text processing method, comprising: dividing a to-be-processed text according to language sequence information of the to-be-processed text to obtain a plurality of text sets, wherein the text set comprises at least one subtext, the to-be-processed text is in Chinese, the language sequence information of the to-be-processed text is related to the language of the to-be-processed text, and the subtext comprises initial letters of pinyin of a plurality of Chinese characters; matching at least one subtext of each of the plurality of text sets with a plurality of preset texts in a same preset corpus according to initial letters of pinyin of each of the plurality of preset texts to obtain a plurality of recovered text sets, wherein the recovered text set comprises at least one preset text matched with the subtext, and the same preset corpus corresponds to an industry; combining preset texts between the plurality of recovered text sets to obtain a plurality of text combinations, wherein the text combination corresponds to a preset probability value; determining a preset text in the recovered text set as a target text; determining a plurality of preset probability values related to the target text according to preset probability values corresponding to a plurality of text combinations related to the target text, wherein the target text is a text matched with the subtext, and the preset probability value is used to represent a probability of combination of the target text with other texts; determine a first sub-probability value according to a plurality of preset probability values related to the target text; determine a third sub-probability value according to a part of speech of the target text; determine the probability value according to the first sub-probability value and the third sub-probability value, the probability value being used to represent a probability that the target text is a semantic restoration text of the sub-text; and determine a semantic restoration text of the to-be-processed text according to the probability value.

3. The method of claim 1 or 2, wherein, The target text is a plurality of, The determining of the semantic restoration text of the to-be-processed text according to the probability value comprises: determining a semantic restoration text of the sub-text from the plurality of target texts according to a plurality of probability values; and determining the semantic restoration text of the to-be-processed text according to the semantic restoration text of the sub-text.

4. A text processing apparatus, comprising: a division unit configured to divide a to-be-processed text according to syntactic information of the to-be-processed text to obtain a plurality of text sets, wherein the text set comprises at least one sub-text, the to-be-processed text is in Chinese, the syntactic information of the to-be-processed text is related to the language of the to-be-processed text, and the sub-text comprises initial letters of pinyin of a plurality of Chinese characters; a matching unit configured to match at least one sub-text of each of the plurality of text sets with a plurality of preset texts in a same preset corpus according to initial letters of pinyin of the plurality of preset texts to obtain a plurality of restoration text sets, wherein the restoration text set comprises at least one preset text matched with the sub-text, and the same preset corpus corresponds to an industry; a combination unit configured to combine the preset texts between the plurality of restoration text sets to obtain a plurality of text combinations, wherein the text combination corresponds to a preset probability value; a first determination unit configured to determine a target text as the preset text in the restoration text set; a second determination unit configured to determine a plurality of preset probability values related to the target text according to preset probability values corresponding to a plurality of text combinations related to the target text, wherein the target text is a text matched with the sub-text, and the preset probability value is used to represent a probability that the target text is combined with other texts; a third determination unit configured to determine a first sub-probability value according to a plurality of preset probability values related to the target text; a fourth determination unit configured to determine a second sub-probability value according to a word frequency of the target text in the preset corpus; a fifth determination unit configured to determine the probability value according to the first sub-probability value and the second sub-probability value, the probability value being used to represent a probability that the target text is a semantic restoration text of the sub-text; and a third determination module configured to determine a semantic restoration text of the to-be-processed text according to the probability value.

5. A text processing apparatus, comprising: The division unit is configured to divide the to-be-processed text multiple times according to language sequence information of the to-be-processed text, to obtain multiple text sets, wherein the text set includes at least one subtext, the to-be-processed text is in Chinese, the language sequence information of the to-be-processed text is related to the language of the to-be-processed text, and the subtext includes initial letters of pinyin of multiple Chinese characters. The matching unit is configured to match at least one subtext of each of the multiple text sets with multiple preset texts in a same preset corpus according to initial letters of pinyin of the multiple preset texts, to obtain multiple recovered text sets, wherein the recovered text set includes at least one preset text matched with the subtext, and the same preset corpus corresponds to an industry. The combination unit is configured to combine the preset texts between the multiple recovered text sets, to obtain multiple text combinations, wherein the text combination corresponds to a preset probability value. The first determination unit is configured to determine the preset text in the recovered text set as a target text. The second determination unit is configured to determine multiple preset probability values related to the target text according to preset probability values corresponding to multiple text combinations related to the target text, wherein the target text is a text matched with the subtext, and the preset probability value is used to represent a probability of combination of the target text with other texts. The sixth determination unit is configured to determine a first sub-probability value according to the at least one preset probability value. The seventh determination unit is configured to determine a third sub-probability value according to a part of speech of the target text. The eighth determination unit is configured to determine the probability value according to the first sub-probability value and the third sub-probability value, wherein the probability value is used to represent a probability of the target text being a semantic recovered text of the subtext. The third determination module is configured to determine a semantic recovered text of the to-be-processed text according to the probability value.

6. The apparatus of claim 4 or 5, wherein, The target text is multiple, The third determination module includes: The ninth determination unit is configured to determine a semantic recovered text of the subtext from the multiple target texts according to multiple probability values. The tenth determination unit is configured to determine a semantic recovered text of the to-be-processed text according to the semantic recovered text of the subtext.

7. An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 3.

8. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1 to 3.

9. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Text entry and conversion of phrase-level abbreviations

    CN112154442A