Text processing method, device and system

By combining candidate words and words to be recognized in text classification to query the target word vector, the problem of low text classification accuracy caused by default word vector replacement is solved and the accuracy of text classification is improved.

CN112559732BActive Publication Date: 2024-08-27ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910911916.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-25
Publication Date
2024-08-27
Estimated Expiration
2039-09-25

AI Technical Summary

Technical Problem

In the text classification process, the existing technology uses default word vectors to replace unqueried word vectors, resulting in low text classification accuracy.

Method used

By obtaining the words to be recognized in the text to be processed, when detecting word vectors that do not exist in the preset vector table, the combination of the candidate word and the word to be recognized is obtained from the text, and the preset vector table is queried to obtain the target word vector, which is used in the text Classification processing.

Benefits of technology

It improves the accuracy of text classification, avoids the problem of information loss caused by default word vector replacement, and enhances the ability to classify text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112559732B
    Figure CN112559732B
Patent Text Reader

Abstract

The present application discloses a text processing method, device and system. The method includes: obtaining a word to be recognized in the text to be processed; when it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; combining the candidate word with the word to be recognized to obtain a combined word; querying the target word vector corresponding to the combined word from the preset vector table, and classifying the text to be processed based on the target word vector. The present application solves the technical problem that the related technology uses the default word vector as the word vector of all words whose word vectors cannot be found in the word vector table when classifying the text, resulting in low text classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of science and technology, people are getting more and more information. In order to enable people to obtain more valuable information from a large amount of information, it is usually necessary to classify the information. Among them, text classification is usually required for text information.

[0003] In the process of text classification, especially Chinese text classification, deep learning models are usually used for text classification. Each word in the sentence corresponding to the text can be represented by a K-dimensional vector, and the sentence can be represented as an N*K matrix as the input of the deep learning model, where N is the number of words in the sentence.

[0004] In addition, word vectors are usually obtained through training with data in the corpus. For words that have mutated homophones, for example, the word "angry" mutated into "raising the flag", "rising", etc., the corresponding K-dimensional vector cannot be found in the table corresponding to the word vector. In the prior art, a default vector is usually used to replace the vector of the word. However, unifying the vectors of all words that cannot find vectors as default vectors will undoubtedly lose important information in the text, leading to inaccurate text classification. For example, in the scenario of classifying comments in online shopping, for the text "I am angry", some e-commerce companies mutate "angry" into "raising the flag", and the word vector corresponding to "raising the flag" does not exist in the table corresponding to the word vector. At this time, the default vector is used instead. In the process of classifying the text "I am angry", since the word vector corresponding to "raising the flag" cannot be found in the table corresponding to the word vector, the system cannot accurately identify the text, resulting in incorrect comment classification.

[0005] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0006] The embodiments of the present application provide a text processing method, device and system to at least solve the technical problem that, when classifying text, the related art uses the default word vector as the word vector for all words whose word vectors cannot be found in the word vector table, resulting in low text classification accuracy.

[0007] According to one aspect of an embodiment of the present application, a text processing method is provided, including: obtaining a word to be recognized in a text to be processed; when it is detected that there is no word vector corresponding to the word to be recognized in a preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; combining the candidate word with the word to be recognized to obtain a combined word; querying a target word vector corresponding to the combined word from the preset vector table, and classifying the text to be processed based on the target word vector.

[0008] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: obtaining a word to be recognized in a text to be processed; obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; obtaining a target word vector from a preset vector table based on the candidate word and the word to be recognized; and performing classification processing on the text to be processed based on the target word vector.

[0009] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: obtaining a word to be recognized in a text to be processed; when it is detected that there is no word vector corresponding to the word to be recognized in a preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; combining the candidate word with the word to be recognized to obtain a combined word; querying a target word vector corresponding to the combined word from the preset vector table, and determining recommended information based on the target word vector.

[0010] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: obtaining a word to be recognized in a text to be processed; obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; obtaining a target word vector from a preset vector table based on the candidate word and the word to be recognized; and determining recommended information based on the target word vector.

[0011] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: obtaining a word to be recognized in a text to be processed; when it is detected that the word to be recognized does not exist in a preset vector table, obtaining the context of the word to be recognized in the text to be processed; based on the context of the word to be recognized in the text to be processed, querying a replacement word corresponding to the word to be recognized from a preset vector table; replacing the word to be recognized with the replacement word, and performing classification processing based on the replaced text to be processed.

[0012] According to another aspect of an embodiment of the present application, a text processing method is also provided, including: obtaining a word to be recognized in a text to be processed; when it is detected that the word to be recognized does not exist in a preset vector table, obtaining the context of the word to be recognized in the text to be processed; based on the context of the word to be recognized in the text to be processed, querying a replacement word corresponding to the word to be recognized from a preset vector table; replacing the word to be recognized with the replacement word, and determining recommended information based on the replaced text to be processed.

[0013] According to another aspect of an embodiment of the present application, a text processing device is also provided, including: a first acquisition module, used to acquire a word to be recognized in a text to be processed; a second acquisition module, used to acquire a candidate word associated with the position of the word to be recognized from the text to be processed when it is detected that there is no word vector corresponding to the word to be recognized in a preset vector table; a combination module, used to combine the candidate word with the word to be recognized to obtain a combined word; and a processing module, used to query a target word vector corresponding to the combined word from the preset vector table, and classify the text to be processed based on the target word vector.

[0014] According to another aspect of an embodiment of the present application, a text processing system is also provided, including: an input unit for inputting a text to be processed; a processing unit for obtaining a word to be recognized from the text to be processed, and when it is detected that there is no word vector corresponding to the word to be recognized in a preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed, and then combining the candidate word with the word to be recognized to obtain a combined word, and querying a target word vector corresponding to the combined word from the preset vector table, and finally classifying the text to be processed based on the target word vector; an output unit for outputting the processing result of the classification processing of the text to be processed by the processing unit.

[0015] According to another aspect of an embodiment of the present application, a storage medium is further provided, the storage medium including a stored program, wherein when the program is running, a device where the storage medium is located is controlled to execute a text processing method.

[0016] According to another aspect of an embodiment of the present application, a processor is further provided, the processor being used to run a program, wherein the text processing method is executed when the program is run.

[0017] In an embodiment of the present application, a method of querying the word vector of a combination of words to be recognized is adopted. When the word to be recognized in the text to be processed is obtained and it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table, a candidate word associated with the position of the word to be recognized is obtained from the text to be processed, and then the candidate word is combined with the word to be recognized to obtain a combination word. Finally, a target word vector corresponding to the combination word is queried from the preset vector table, and the text to be processed is classified based on the target word vector.

[0018] In the above process, when the word vector corresponding to the word to be recognized does not exist in the preset vector table, the word vector corresponding to the combined word corresponding to the word to be recognized is queried in the preset vector table, and the association between the words in the text is fully utilized. The word vector corresponding to the combined word is used to classify the text, avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, compensating for the impact of reducing the accuracy of text classification caused by inaccurate word segmentation, achieving the purpose of text classification, and thus realizing the technical effect of improving the accuracy of text classification, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying text, resulting in low text classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0020] Figure 1 is a schematic diagram of a computing device for implementing a text processing method according to an embodiment of the present application;

[0021] Figure 2 is a flowchart of a text processing method according to an embodiment of the present application;

[0022] Figure 3 is a flowchart of an optional text processing method according to an embodiment of the present application;

[0023] Figure 4 is a schematic diagram of an optional comment interface according to an embodiment of the present application;

[0024] Figure 5 is a schematic diagram of an optional comment interface according to an embodiment of the present application;

[0025] Figure 6 is an optional word segmentation schematic diagram according to an embodiment of the present application;

[0026] Figure 7 is an optional word segmentation schematic diagram according to an embodiment of the present application;

[0027] Figure 8 is an optional commodity recommendation schematic diagram according to an embodiment of the present application;

[0028] Fig. 9 is a flowchart of a text processing method according to an embodiment of the present application;

[0029] Fig.10is a schematic diagram of a text processing device according to an embodiment of the present application;

[0030] Fig.11 is a structural block diagram of a computing device according to an embodiment of the present application;

[0031] Fig.12 is a flowchart of a text processing method according to an embodiment of the present application;

[0032] Fig.13 is a flowchart of a text processing method according to an embodiment of the present application;

[0033] Fig.14 is a flowchart of a text processing method according to an embodiment of the present application;

[0034] Fig.15 is an optional commodity recommendation schematic diagram according to an embodiment of the present application; and

[0035] Fig.16 It is a flowchart of a text processing method according to an embodiment of the present application. DETAILED DESCRIPTION

[0036] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0037] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0038] Example 1

[0039] According to an embodiment of the present application, a text processing method embodiment is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0040] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computing device or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computing device (or mobile device) for implementing a text processing method. Figure 1 As shown, the computing device 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (BUS bus) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0041] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computing device 10 (or mobile device). As involved in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0042] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the text processing method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned text processing method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computing device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0043] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computing device 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0044] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of computing device 10 (or mobile device).

[0045] It should be noted that, in some optional embodiments, the above Figure 1 The computer device (or mobile device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the above-described computer device (or mobile device).

[0046] Under the above operating environment, this application provides Figure 2 The text processing method shown. Figure 2 is a flowchart of a text processing method according to Embodiment 1 of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0047] Step S202, obtaining the words to be recognized in the text to be processed.

[0048] In step 202, the text processing system can obtain the text to be processed and obtain the words to be recognized from the text to be processed, wherein the text to be processed can be text actively input by the user to the text processing system, or can be text read by the text processing system from a preset position. Preferably, in the present application, the text to be processed is Chinese text. For example, in the e-commerce field, in the scenario of classifying product reviews, the text processing system can obtain the reviews of a certain product of a certain merchant on the e-commerce platform, wherein the product reviews are usually in text form, and the text processing system can classify the product reviews, for example, in Figure 4 In the schematic diagram of the comment interface shown, comments such as user 11's "the logistics is too fast" and user 14's "the logistics is very fast, I received it the next day" are classified as the "fast logistics" attribute of the e-commerce platform. Figure 5 In the comment interface diagram shown, only comments related to logistics are displayed.

[0049] In an optional embodiment, after obtaining the text to be processed, the text processing system preprocesses the text to be processed to obtain the processed text to be processed, then performs word segmentation on the processed text to be processed to obtain multiple word segments, and finally determines the word to be recognized from the multiple word segments. Wherein, in the process of preprocessing the text to be processed, the text processing system mainly removes noise information of the text to be processed, and the noise information includes but is not limited to invalid characters, HTML tags, etc. At the same time, the text processing system also performs format conversion on the text to be processed, converting it into a format that can be processed by the text processing system. After preprocessing the text to be processed, the text processing system can use the existing word segmentation algorithm to perform word segmentation on the preprocessed text to be processed to obtain the word to be recognized, wherein the word to be recognized is any word in the text to be processed, for example, Figure 6 The word segmentation diagram shown can be used to segment "logistics is too fast" to obtain words such as "logistics", "too", "fast", and ". The word to be recognized can be any one of "logistics", "too", "fast", and ".

[0050] Optionally, the text processing system can determine the words to be recognized according to the word segmentation order. For example, in the text to be processed "Logistics is too fast", "logistics" is first used as the word to be recognized. After the word vector corresponding to the word to be recognized is determined, "too" is used as the word to be recognized to determine its corresponding word vector.

[0051] Step S204, when it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, a candidate word associated with the position of the word to be recognized is obtained from the text to be processed.

[0052] In step S204, the preset vector table is a vector table obtained through pre-training, and the preset vector table stores word vectors corresponding to the words. It should be noted that since the preset vector table is obtained through pre-training, it is impossible for the preset vector table to store word vectors corresponding to all words. For example, the preset vector table stores the word vector corresponding to "eating", but does not store the word vector corresponding to "pool rice".

[0053] In addition, in step S204, the position of the word to be recognized is the position of the word to be recognized in the text to be processed, wherein the position includes one of the following: the beginning of a sentence of the text to be processed, the middle of a sentence of the text to be processed, and the end of a sentence of the text to be processed. The candidate words associated with the position of the word to be recognized are words in the text to be processed, wherein the position of the word to be recognized is different, and the position of the candidate words is also different. For example, when the word to be recognized is the beginning of a sentence of the text to be processed, the candidate word is the word after the position of the word to be recognized; when the word to be recognized is in the middle of a sentence of the text to be processed, the candidate word is the word after or before the position of the word to be recognized; when the word to be recognized is at the end of a sentence of the text to be processed, the candidate word is the word before the position of the word to be recognized. In addition, when the text to be processed is Chinese, the number of words contained in the candidate word is an integer greater than or equal to 1. For example, the number of words contained in the candidate word can be 1, 2, or 3.

[0054] Step S206, combining the candidate word with the word to be recognized to obtain a combined word.

[0055] In step S206, the text processing system may combine the candidate words and the words to be recognized according to their positional relationship in the text to be processed to obtain a combined word, for example, Figure 7 As shown, in the text to be processed "logistics is too fast", the word to be recognized is "too", the candidate word is "fast", and the word to be recognized is before the candidate word, so the combined word is "too fast".

[0056] Step S208, querying the target word vector corresponding to the combined word from the preset vector table, and classifying the text to be processed based on the target word vector.

[0057] In step S208, after obtaining the combined word, the target vector corresponding to the combined word is queried from the preset vector table, wherein, in the case of finding the target word vector corresponding to the homophone of the combined word from the preset vector table, the word vector of the candidate word corresponding to the combined word is set to empty. For example, in the text to be processed "logistics is too fast", the word to be identified as "too" is combined with the candidate word "quickly" to obtain the combined word "too fast". The text processing system queries the target word vector corresponding to "too fast" in the preset vector table, and classifies the text to be processed based on the target word vector. Since the candidate word "quickly" has been combined with the word to be identified as "too", the text processing system does not need to determine the word vector of the candidate word "quickly", so when performing text classification, the word vector corresponding to the candidate word "quickly" is set to empty.

[0058] Optionally, the text processing system can use text classification algorithms such as Text-CNN, Word2Vec, Keras, RNN, NLP, etc. to classify the text to be processed, where the text classification algorithm used by the text processing system is not limited to the algorithm provided in this application, and other algorithms that can perform text classification can also be applied in this application.

[0059] Based on the scheme defined in the above steps S202 to S208, it can be learned that by querying the word vector of the combination word of the word to be recognized, after the word to be recognized in the text to be processed is obtained and it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table, the candidate word associated with the position of the word to be recognized is obtained from the text to be processed, and then the candidate word is combined with the word to be recognized to obtain the combination word, and finally the target word vector corresponding to the combination word is queried from the preset vector table, and the text to be processed is classified based on the target word vector.

[0060] It is easy to notice that when the word vector corresponding to the word to be recognized does not exist in the preset vector table, the word vector corresponding to the combined word corresponding to the word to be recognized is queried in the preset vector table, which makes full use of the association between the words in the text, and uses the word vector corresponding to the combined word to classify the text, avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, compensating for the impact of reducing the accuracy of text classification caused by inaccurate word segmentation, achieving the purpose of classifying the text, and thus realizing the technical effect of improving the accuracy of text classification, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying the text, resulting in low text classification accuracy.

[0061] In an optional embodiment, Figure 3 A flowchart of an optional text processing method is shown, such as Figure 3 As shown, after obtaining the text to be processed, the text processing system first removes invalid characters in the text to be processed, and then performs word segmentation processing on the preprocessed text to be processed to obtain multiple word segments, and then determines the word to be recognized from the multiple word segments. Further, the text processing system detects whether there is a word vector corresponding to the word to be recognized in the preset vector table, wherein, when it is detected that there is a word vector corresponding to the word to be recognized in the preset vector table, the text to be processed is classified based on the word vector corresponding to the word to be recognized. When it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, the word vector corresponding to the combined word is queried.

[0062] Optionally, the text processing system first determines the position of the word to be recognized in the text to be processed, and then determines a first number of words located before the position and / or a first number of words located after the position from the text to be processed as first candidate words, and combines the first candidate words with the word to be recognized to obtain a first combination word. The first number is preferably 2.

[0063] Specifically, the text processing system first detects the position of the word to be recognized in the text to be processed. If the word to be recognized is at the beginning of a sentence in the text to be processed, the text processing system will use the two words after the word to be recognized as candidate words. For example, in the text to be processed "Logistics is too fast", the word to be recognized is "logistics" at the beginning of the sentence. At this time, the text processing system will use the two words "too" and "fast" as candidate words and combine them with the word to be recognized.

[0064] If the word to be recognized is in a sentence of the text to be processed, the text processing system will use the two words after the word to be recognized, or the two words before the word to be recognized as candidate words, wherein the text processing system can determine whether to select the first number of words before the word to be recognized as candidate words, or to select the first number of words after the word to be recognized as candidate words based on the part of speech and / or semantics of the word to be recognized. For example, in the text to be processed "logistics is too fast", the word to be recognized is "too" located in the sentence, and the text processing system detects that "too" is an adverb, and therefore, selects the words "fast" and "le" after the word to be recognized as candidate words.

[0065] In addition, when the word to be recognized is in a sentence of the text to be processed, the processing system can also detect the number of words before or after the word to be recognized to determine whether to select the words before or after the word to be recognized as candidate words. For example, in the text to be processed "Logistics is too fast", the word to be recognized is "too" and is located in the sentence. The text processing system detects that there is only one word before "too" and there are two words after "too", then the text processing system selects the words "fast" and "le" after the word to be recognized as candidate words.

[0066] There is also an alternative embodiment. When the number of words before and after the word to be recognized is less than the first quantity, the text processing system can simultaneously use the words before and after the position of the word to be recognized as candidate words.

[0067] If the word to be recognized is at the end of the sentence in the text to be processed, the text processing system takes the 2 words before the word to be recognized as candidate words. For example, in the text to be processed "The logistics is too fast", the word to be recognized is "了" and it is at the end of the sentence. At this time, the text processing system takes the two words "太" and "迅速" as candidate words and combines them with the word to be recognized.

[0068] It should be noted that when it is detected that there is a first target word vector corresponding to a homophone of the first combined word in the preset vector table, the text processing system performs classification processing on the text to be processed based on the first target word vector. Among them, when it is detected that there are multiple first target word vectors corresponding to the homophones of the first combined word in the preset vector table, the text processing system obtains the word frequency of each first target word vector based on the corpus and determines the first target word vector with the highest word frequency as the target word vector corresponding to the homophone of the first combined word.

[0069] Optionally, as Figure 3 shown, when it is detected that there are multiple word vectors matching the homophones of the first combined word in the preset vector table, the word vector corresponding to the word with the highest usage frequency is selected, and the word vector of the candidate word corresponding to this word is set to be empty. For example, Figure 4 the text corresponding to the comment of user 12 in

[0070] Furthermore, as Figure 3 shown, when it is detected that there is no first target word vector corresponding to the homophone of the first combined word in the preset vector table, the text processing system determines the second quantity of words before the position and / or the second quantity of words after the position in the text to be processed as the second candidate words, where the first quantity is greater than the second quantity. For example, in Figure 3Among them, the first quantity is 2 and the second quantity is 1. Then, the text processing system combines the second candidate word with the word to be recognized to obtain a second combined word, and queries the second target word vector corresponding to the homophone of the second combined word from a preset vector table, and classifies the text to be processed based on the second target word vector. For example, in Figure 4 a user 13's comment is "The logistics is very fast, the price is very reasonable, good review!", the word to be recognized is "reasonable", the first combined word is "the price is very reasonable", and the text processing system does not detect the word vector corresponding to the homophone of the first combined word in the preset vector table, then the text processing system continues to detect the word vector corresponding to "very reasonable" in the preset vector table, that is, detecting the word vector corresponding to the homophone of the second combined word.

[0071] It should be noted that the method for determining the second candidate word is the same as the method for determining the first candidate word, and will not be elaborated here.

[0072] Optionally, as Figure 3 shown, when it is detected that there is a second target word vector corresponding to the homophone of the second combined word in the preset vector table, the text processing system classifies the text to be processed based on the second target word vector. Among them, when it is detected that there are multiple second target word vectors corresponding to the homophone of the second combined word in the preset vector table, the text processing system obtains the word frequency of each second target word vector based on the corpus, and then determines the second target word vector with the highest word frequency as the target word vector corresponding to the homophone of the second combined word. It should be noted that this process is the same as the process for determining the target word vector corresponding to the homophone of the first combined word, and will not be elaborated here either.

[0073] In addition, in Figure 3 when it is detected that there is no second target word vector corresponding to the homophone of the second combined word in the preset vector table, the text processing system determines the default target word vector as the target word vector of the word to be recognized, and classifies the text to be processed based on the default target word vector, where the default target word vector is the word vector of a word with the same or similar pinyin as the word to be recognized. Specifically, the text processing system obtains the pinyin corresponding to the word to be recognized, then determines the word with the same or similar pinyin as the word to be recognized according to the pinyin, and finally determines the word vector of the word with the same or similar pinyin as the word to be recognized as the target word vector of the word to be recognized. For example, the word with the same or similar pinyin as the word to be recognized "hao ci" is "hao chi", and there is also a corresponding word vector for "hao chi" in the preset vector library, then the word vector corresponding to the word to be recognized "hao ci" is defaulted to the word vector corresponding to "hao chi".

[0074] In the case where it is detected that there is no second target word vector corresponding to the homophone of the second combined word in the preset vector table, if it is detected that there are multiple word vectors of words with the same or similar pinyin as the word to be recognized in the preset vector table, the text processing system obtains the word frequency of each word vector based on the corpus, and then determines the word vector with the highest word frequency as the default target word vector corresponding to the word to be recognized. For example, the words with the same or similar pinyin as the word to be recognized "好此" include "好吃", "好词", "好迟", "皓齿", "好次", etc. Among them, the word frequency of "好吃" is the highest, so the word vector corresponding to "好吃" is used as the default target vector of "好此".

[0075] It should be noted that this embodiment mainly illustrates the application of the text processing method in e-commerce reviews. In addition, the text processing method provided by this application can also be applied in commodity recommendation, risk control fields, etc. For example, Figure 8 shows a schematic diagram corresponding to the commodity recommendation scenario. The user enters the text to be processed "夏季女装联谊群" in the search box of the e-commerce platform, which is equivalent to inputting the text to be processed into the text processing system (as shown by the dashed box in Figure 8 ). After receiving the text to be processed, the text processing system performs word segmentation on the text to be processed to obtain multiple words to be recognized, and then retrieves the words to be recognized. First, it detects whether it can query the target word vector corresponding to the word to be recognized from the preset vector table. If the target word vector can be queried, the text processing system feeds back the target word vector to the e-commerce platform (as shown by the feedback retrieval result in Figure 8 ). The e-commerce platform searches for commodities related to the target word vector based on the target word vector and recommends the commodities to the user. For example, if the text to be processed entered by the user in the input box of Figure 8 is "夏季女装连衣裙", after the text processing system performs word segmentation on "夏季女装连衣裙", it obtains the word to be recognized "连衣裙", and can query the word vector corresponding to "连衣裙" from the preset vector table. Then the text processing system pushes the word vector corresponding to "连衣裙" to the e-commerce platform, so that the e-commerce platform can push commodities related to "连衣裙" to the user.

[0076] In addition, if the word vector corresponding to the word to be recognized cannot be queried from the preset vector table, the text processing system determines the candidate word corresponding to the word to be recognized based on the preset database, then combines the word to be recognized with the candidate word to obtain a combined word, and finally queries the word vector corresponding to the combined word from the preset vector table and feeds back the retrieval result to the e-commerce platform. Still taking Figure 8For example, the user enters the text to be processed "Summer Women's Clothing Social Group" into the text input box. After the text processing system performs word segmentation on "Summer Women's Clothing Social Group", it obtains the word to be recognized "social group", but the word vector corresponding to "social group" is not found in the preset vector table. At this time, the text processing system selects candidate words from multiple words to be recognized based on the preset database. For example, for the word to be recognized "social group", "women's clothing" is used as a candidate word, and "women's clothing" is combined with "social group" to obtain a combined word. The preset vector table can be used to determine that the target word vector corresponding to the combined word "women's clothing social group" is the word vector corresponding to "women's dress". At this time, the e-commerce platform obtains products related to women's dresses based on the word vector corresponding to "women's dress" and recommends them to users.

[0077] Optionally, the preset database may be a database storing candidate word selection rules. After detecting that there is no word vector corresponding to the word to be recognized in the preset vector table, the text processing system may query the position of the candidate word in the text to be processed from the preset database based on the attributes of the word to be recognized (for example, the position of the word to be recognized in the text to be processed, the part of speech of the word to be recognized, etc.). At this time, the text processing system can determine the candidate words in the text to be processed based on the position of the candidate words in the text to be processed queried from the preset database.

[0078] It should be noted that the candidate word selection rules can be set by the managers of the e-commerce platform. For example, the following candidate word selection rules can be stored in the preset database: if the position of the word to be recognized in the text to be processed is at the end of the sentence, and the part of speech is a noun, the word before the word to be recognized is used as a candidate word, that is, the position of the candidate word is the word before the word to be recognized; if the position of the word to be recognized in the text to be processed is in the middle of the sentence, and the part of speech is an adjective, then the word after the word to be recognized is used as a candidate word, that is, the position of the candidate word is the word after the word to be recognized; if the position of the word to be recognized in the text to be processed is in the middle of the sentence, and the part of speech is an adjective, then the word after the word to be recognized is used as a candidate word, that is, the position of the candidate word is the word after the word to be recognized; if the position of the word to be recognized in the text to be processed is in the middle of the sentence, and the part of speech is an adjective, then the word after the word to be recognized is used as a candidate word, that is, the position of the candidate word is the word after the word to be recognized; if the position of the word to be recognized in the text to be processed is in the middle of the sentence, and the part of speech is a noun, then the word before the word to be recognized is used as a candidate word, that is, the position of the candidate word is the word before the word to be recognized.

[0079] In addition, it should be noted that the above-mentioned candidate word selection rules are only examples. In practical applications, they are not limited to the above-mentioned candidate word selection rules, and other candidate word selection rules may also be used. They are not specifically limited in this application.

[0080] From the above content, it can be seen that the present application makes full use of the information of each word in the text. First, a first number (for example, 3) of word combinations are selected to find word vectors, and then a second number (for example, 2) of word combinations are considered. Finally, a single word is considered to find a word vector. This order can make up for the impact of inaccurate word segmentation to a certain extent. After using this solution, the correct word vector can be found after homophones are mutated, thereby avoiding the problem of more text information loss caused by the use of a unified default word vector in the prior art, thereby ensuring the correctness of text classification.

[0081] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0082] Through the description of the above implementation methods, those skilled in the art can clearly understand that the text processing method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0083] Example 2

[0084] According to an embodiment of the present application, a text processing method is also provided, such as Fig. 9 As shown, the method includes:

[0085] Step S402, obtaining the words to be recognized in the text to be processed.

[0086] In step S402, the text processing system can obtain the text to be processed and obtain the words to be recognized from the text to be processed, wherein the text to be processed can be the text actively input by the user to the text processing system, or it can be the text read by the text processing system from a preset position. Preferably, in the present application, the text to be processed is Chinese text.

[0087] In an optional embodiment, after obtaining the text to be processed, the text processing system preprocesses the text to be processed to obtain the processed text to be processed, then performs word segmentation on the processed text to be processed to obtain multiple word segments, and finally determines the word to be recognized from the multiple word segments.

[0088] Step S404: obtaining candidate words associated with the position of the word to be recognized from the text to be processed.

[0089] In an optional embodiment, in step S404, after obtaining the word to be recognized, the text processing system directly determines the candidate word according to the position of the word to be recognized in the text to be processed, wherein the position of the word to be recognized is the position of the word to be recognized in the text to be processed, and the position includes one of the following: the beginning of a sentence in the text to be processed, the middle of a sentence in the text to be processed, and the end of a sentence in the text to be processed. The candidate word associated with the position of the word to be recognized is a word in the text to be processed, wherein the position of the word to be recognized is different, and the position of the candidate word is also different.

[0090] In another optional embodiment, before obtaining candidate words associated with the position of the word to be recognized from the text to be processed, the text processing system first detects whether there is a word vector corresponding to the word to be recognized in a preset vector table. If it is detected that there is a word vector corresponding to the word to be recognized in the preset vector table, the text to be processed is classified based on the word vector corresponding to the word to be recognized; if it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, the candidate words associated with the position of the word to be recognized are obtained from the text to be processed.

[0091] Step S406, obtaining a target word vector from a preset vector table according to the candidate words and the words to be recognized.

[0092] In step S406, the text processing system can combine the candidate words and the words to be recognized according to their positional relationship in the text to be processed to obtain a combined word, and then query the target vector corresponding to the combined word from the preset vector table. When the target word vector corresponding to the combined word is queried from the preset vector table, the word vector of the candidate word corresponding to the combined word is set to empty.

[0093] Step S408: classify the text to be processed based on the target word vector.

[0094] In step S408, the text processing system can use text classification algorithms such as Text-CNN, Word2Vec, Keras, RNN, NLP, etc. to classify the text to be processed. Among them, the text classification algorithm used by the text processing system is not limited to the algorithm provided in this application, and other algorithms that can perform text classification can also be applied in this application.

[0095] Based on the scheme defined in the above steps S402 to S408, it can be known that by querying the word vector of the combination word of the word to be recognized, after obtaining the word to be recognized in the text to be processed, the candidate words associated with the position of the word to be recognized are obtained from the text to be processed, and then the target word vector is obtained from the preset vector table based on the candidate words and the word to be recognized, and finally the text to be processed is classified based on the target word vector.

[0096] It is easy to notice that by searching the preset vector table for the word vector corresponding to the combined word corresponding to the word to be identified, the association between the words in the text is fully utilized, and the word vector corresponding to the combined word is used to classify the text, thereby avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, and compensating for the impact of reducing the accuracy of text classification caused by inaccurate word segmentation, achieving the purpose of classifying the text, thereby realizing the technical effect of improving the accuracy of text classification, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying the text, resulting in low text classification accuracy.

[0097] In an optional embodiment, the text processing system can obtain the target word vector from the preset vector table based on the pinyin of the candidate words and the word to be recognized, wherein the similarity between the pinyin of the target word vector and the pinyin of the word to be recognized reaches a preset similarity. Optionally, the text processing system can use the word vector in the preset vector table whose pinyin similarity is greater than the preset similarity and whose pinyin similarity is the largest as the above-mentioned target word vector. Preferably, the text processing system can also use the word vector in the preset vector table that has the same pinyin as the word to be recognized as the target word vector.

[0098] In the process of obtaining the target word vector from the preset vector table according to the candidate words and the word to be recognized, the text processing system first determines the position of the word to be recognized in the text to be processed, and determines the first number of words located before the position and / or the first number of words located after the position from the text to be processed as the first candidate word, and then combines the first candidate word with the word to be recognized to obtain the first combination word. If it is detected that there is a first target word vector corresponding to a homophone of the first combination word in the preset vector table, the text to be processed is classified based on the first target word vector, wherein, when it is detected that there are multiple first target word vectors corresponding to the homophone of the first combination word in the preset vector table, the word frequency of each first target word vector is obtained based on the corpus, and the first target word vector with the highest word frequency is determined as the target word vector corresponding to the homophone of the first combination word.

[0099] In addition, when it is detected that there is no first target word vector corresponding to the homophone of the first combination word in the preset vector table, a second number of words located before the position and / or a second number of words located after the position are determined from the text to be processed as second candidate words, wherein the first number is greater than the second number. Then the second candidate word is combined with the word to be recognized to obtain a second combination word, and a second target word vector corresponding to the homophone of the second combination word is queried from the preset vector table, and the text to be processed is classified based on the second target word vector.

[0100] Among them, when it is detected that there is a second target word vector corresponding to the homonym of the second combination word in the preset vector table, the processed text is classified based on the second target word vector; if there are multiple second target word vectors corresponding to the homonym of the second combination word in the preset vector table, the word frequency of each second target word vector is obtained based on the corpus, and the second target word vector with the highest word frequency is determined as the target word vector corresponding to the homonym of the second combination word.

[0101] In the case where it is detected that there is no second target word vector corresponding to the homophone of the second combination word in the preset vector table, a default target word vector is determined as the target word vector of the word to be recognized, and the text to be processed is classified based on the default target word vector, wherein the default target word vector is the word vector of a word with the same or similar pinyin as the word to be recognized. If it is detected that there are multiple word vectors of words with the same or similar pinyin as the word to be recognized in the preset vector table, the word frequency of each word vector is obtained based on the corpus, and the word vector with the highest word frequency is determined as the default target word vector corresponding to the word to be recognized.

[0102] Example 3

[0103] According to an embodiment of the present application, a text processing method is also provided, such as Fig.12 As shown, the method includes:

[0104] Step S1202, obtaining the words to be recognized in the text to be processed.

[0105] In step 1202, the text processing system can obtain the text to be processed and obtain the words to be recognized from the text to be processed, wherein the text to be processed can be text actively input by the user to the text processing system, or can be text read by the text processing system from a preset position. Preferably, in the present application, the text to be processed is Chinese text. For example, in a product recommendation scenario, the text processing system can obtain the text to be processed from the search words or search statements entered by the user in the e-commerce platform, for example, Figure 8 In the schematic diagram shown, the user enters "Summer Women's Clothing Gathering Group" in the input box of the e-commerce platform, and the text processing system can obtain the text to be processed "Summer Women's Clothing Gathering Group".

[0106] After obtaining the text to be processed, the text processing system preprocesses the text to be processed to obtain the processed text to be processed, and then performs word segmentation processing on the processed text to be processed to obtain multiple word segments, and finally determines the word to be recognized from the multiple word segments. Among them, in the process of preprocessing the text to be processed, the text processing system mainly removes the noise information of the text to be processed, and the noise information includes but is not limited to invalid characters, HTML tags, etc. At the same time, the text processing system also performs format conversion on the text to be processed, and converts it into a format that can be processed by the text processing system. After preprocessing the text to be processed, the text processing system can use the existing word segmentation algorithm to perform word segmentation processing on the preprocessed text to be processed to obtain the word to be recognized. For example, the word segmentation processing of "Summer Women's Clothing Social Group" can obtain words such as "Summer", "Women's Clothing", "Social Group", etc., wherein the word to be recognized can be any one of "Summer", "Women's Clothing", "Social Group", and "Group".

[0107] Optionally, the text processing system may determine the word to be recognized based on the part of speech of the word and / or the position of the word in the text to be processed, for example, the noun located in the center is regarded as the word to be recognized; for another example, the noun after the first adjective is regarded as the word to be recognized.

[0108] Step S1204, when it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, a candidate word associated with the position of the word to be recognized is obtained from the text to be processed.

[0109] In step S1204, the preset vector table is a vector table obtained through pre-training, and the preset vector table stores word vectors corresponding to the words. It should be noted that since the preset vector table is obtained through pre-training, it is impossible for the preset vector table to store word vectors corresponding to all words. For example, the preset vector table stores the word vector corresponding to "eating", but does not store the word vector corresponding to "pool rice".

[0110] In addition, the position of the word to be recognized is the position of the word to be recognized in the text to be processed, wherein the position includes one of the following: the beginning of a sentence in the text to be processed, the middle of a sentence in the text to be processed, and the end of a sentence in the text to be processed. The candidate words associated with the position of the word to be recognized are words in the text to be processed, wherein the position of the word to be recognized is different, and the position of the candidate words is also different. For example, when the word to be recognized is the beginning of a sentence in the text to be processed, the candidate words are words after the position of the word to be recognized.

[0111] Step S1206, combining the candidate word with the word to be recognized to obtain a combined word.

[0112] For example, the text to be processed is "Summer Women's Social Group". For example, the word to be identified is "social group", and the candidate word is "women's clothing". Then, the combined word is "women's clothing social group". After the combined word is obtained, the word vector corresponding to the combined word "women's clothing social group" is searched from the preset vector table, that is, step S1208 is executed.

[0113] Step S1208, querying the target word vector corresponding to the combined word from the preset vector table, and determining the recommended information based on the target word vector.

[0114] In step S1208, after obtaining the combined word, the target vector corresponding to the combined word is queried from the preset vector table, wherein, in the case where the target word vector corresponding to the homophone of the combined word is queried from the preset vector table, the word vector of the candidate word corresponding to the combined word is set to empty. For example, in the text to be processed "Summer Women's Clothing Social Group", the word to be identified as "women's clothing" and the candidate word as "socialization" are combined to obtain the combined word "women's clothing socialization". The text processing system queries the target word vector corresponding to "women's clothing socialization" in the preset vector table, and determines the recommended information based on the target word vector. Since the candidate word "women's clothing" has been combined with the word to be identified as "socialization", the text processing system does not need to determine the word vector of the candidate word "women's clothing", so when performing text classification, the word vector corresponding to the candidate word "women's clothing" is set to empty.

[0115] It should be noted that in step S1208, the recommendation information may be information for recommending a product, and the recommendation information may be identification information corresponding to the product. For example, after analyzing and processing the text to be processed "Summer Women's Wear Social Group", it can be determined that the user is searching for products related to women's dresses. The e-commerce platform then obtains the identification corresponding to the women's dresses, obtains the product information corresponding to the recommendation information, and pushes the product information. Figure 8 As shown, product information related to women's dresses (eg, pictures, styles, prices, etc.) is displayed in the user display interface.

[0116] Based on the scheme defined in the above steps S1202 to S1208, it can be learned that by querying the word vector of the combination word of the word to be recognized, after the word to be recognized in the text to be processed is obtained and it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table, the candidate word associated with the position of the word to be recognized is obtained from the text to be processed, and then the candidate word is combined with the word to be recognized to obtain the combination word, and finally the target word vector corresponding to the combination word is queried from the preset vector table, and the recommended information is determined.

[0117] It is easy to notice that when the word vector corresponding to the word to be recognized does not exist in the preset vector table, the word vector corresponding to the combined word corresponding to the word to be recognized is queried in the preset vector table, which makes full use of the association between the words in the text, and uses the word vector corresponding to the combined word to classify the text, thereby avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, and compensating for the impact of inaccurate word segmentation on reducing the accuracy of information push, thereby achieving the technical effect of accurately pushing messages, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying the text, thereby reducing the accuracy of information push.

[0118] It should be noted that the text processing method provided in this embodiment is different from the application scenario of Embodiment 1, but other contents are the same. The relevant contents have been described in Embodiment 1 and will not be repeated here.

[0119] Example 4

[0120] According to an embodiment of the present application, a text processing method is also provided, such as Fig.13 As shown, the method includes:

[0121] Step S1302, obtaining the words to be recognized in the text to be processed.

[0122] In step S1302, the text processing system can obtain the text to be processed and obtain the words to be recognized from the text to be processed, wherein the text to be processed can be the text actively input by the user into the text processing system, or it can be the text read by the text processing system from a preset position. Preferably, in the present application, the text to be processed is Chinese text.

[0123] In an optional embodiment, after obtaining the text to be processed, the text processing system pre-processes the text to be processed to obtain the processed text to be processed, then performs word segmentation on the processed text to be processed to obtain multiple word segments, and finally determines the word to be recognized from the multiple word segments. The text processing system can determine the word to be recognized from the multiple word segments according to the position and / or part of speech of each word segment in the text to be processed.

[0124] Step S1304, obtaining candidate words associated with the position of the word to be recognized from the text to be processed.

[0125] In an optional embodiment, after obtaining the word to be recognized, the text processing system directly determines the candidate word according to the position of the word to be recognized in the text to be processed, wherein the position of the word to be recognized is the position of the word to be recognized in the text to be processed, and the position includes one of the following: the beginning of a sentence in the text to be processed, the middle of a sentence in the text to be processed, and the end of a sentence in the text to be processed. The candidate word associated with the position of the word to be recognized is a word in the text to be processed, wherein the position of the word to be recognized is different, and the position of the candidate word is also different.

[0126] In another optional embodiment, before obtaining candidate words associated with the position of the word to be recognized from the text to be processed, the text processing system first detects whether there is a word vector corresponding to the word to be recognized in a preset vector table. If it is detected that there is a word vector corresponding to the word to be recognized in the preset vector table, the text to be processed is classified based on the word vector corresponding to the word to be recognized; if it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, the candidate words associated with the position of the word to be recognized are obtained from the text to be processed.

[0127] Step S1306, obtaining a target word vector from a preset vector table according to the candidate words and the words to be recognized.

[0128] In step S1306, the text processing system can combine the candidate words and the words to be recognized according to their positional relationship in the text to be processed to obtain a combined word, and then query the target vector corresponding to the combined word from the preset vector table. When the target word vector corresponding to the combined word is queried from the preset vector table, the word vector of the candidate word corresponding to the combined word is set to empty.

[0129] Step S1308: determine recommended information based on the target word vector.

[0130] It should be noted that in step S1308, the recommendation information may be information for recommending a product, and the recommendation information may be identification information corresponding to the product. For example, after analyzing and processing the text to be processed "Summer Women's Wear Social Group", it can be determined that the user is searching for products related to women's dresses. The e-commerce platform then obtains the identification corresponding to the women's dresses, obtains the product information corresponding to the recommendation information, and pushes the product information. Figure 8 As shown, product information related to women's dresses (eg, pictures, styles, prices, etc.) is displayed in the user display interface.

[0131] Based on the scheme defined in the above steps S1302 to S1308, it can be known that by querying the word vector of the combination word of the word to be recognized, after obtaining the word to be recognized in the text to be processed, the candidate words associated with the position of the word to be recognized are obtained from the text to be processed, and then the target word vector is obtained from the preset vector table based on the candidate words and the word to be recognized, and finally the recommendation information is determined based on the target word vector.

[0132] It is easy to notice that when the word vector corresponding to the word to be recognized does not exist in the preset vector table, the word vector corresponding to the combined word corresponding to the word to be recognized is queried in the preset vector table, which makes full use of the association between the words in the text, and uses the word vector corresponding to the combined word to classify the text, thereby avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, and compensating for the impact of inaccurate word segmentation on reducing the accuracy of information push, thereby achieving the technical effect of accurately pushing messages, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying the text, thereby reducing the accuracy of information push.

[0133] It should be noted that the text processing method provided in this embodiment is different from the application scenario of Embodiment 2, but other contents are the same. The relevant contents have been described in Embodiment 2 and will not be repeated here.

[0134] Example 5

[0135] According to an embodiment of the present application, a text processing method is also provided, such as Fig.14 As shown, the method includes:

[0136] Step S1402, obtaining the words to be recognized in the text to be processed.

[0137] In step 1402, the text processing system can obtain the text to be processed and obtain the words to be recognized from the text to be processed, wherein the text to be processed can be text actively input by the user to the text processing system, or can be text read by the text processing system from a preset position. Preferably, in the present application, the text to be processed is Chinese text. For example, in a product recommendation scenario, the text processing system can obtain the text to be processed from the search words or search statements entered by the user in the e-commerce platform, for example, Fig.15 In the schematic diagram shown, the user enters "Summer Women's Clothing Gathering Group" in the input box of the e-commerce platform, and the text processing system can obtain the text to be processed "Summer Women's Clothing Gathering Group".

[0138] After obtaining the text to be processed, the text processing system preprocesses the text to be processed to obtain the processed text to be processed, and then performs word segmentation processing on the processed text to be processed to obtain multiple word segments, and finally determines the word to be recognized from the multiple word segments. Among them, in the process of preprocessing the text to be processed, the text processing system mainly removes the noise information of the text to be processed, and the noise information includes but is not limited to invalid characters, HTML tags, etc. At the same time, the text processing system also performs format conversion on the text to be processed, and converts it into a format that can be processed by the text processing system. After preprocessing the text to be processed, the text processing system can use the existing word segmentation algorithm to perform word segmentation processing on the preprocessed text to be processed to obtain the word to be recognized. For example, the word segmentation processing of "Summer Women's Clothing Social Group" can obtain words such as "Summer", "Women's Clothing", "Social Group", etc., wherein the word to be recognized can be any one of "Summer", "Women's Clothing", "Social Group", and "Group".

[0139] Optionally, the text processing system may determine the word to be recognized based on the part of speech of the word and / or the position of the word in the text to be processed, for example, the noun located in the center is regarded as the word to be recognized; for another example, the noun after the first adjective is regarded as the word to be recognized.

[0140] In an optional embodiment, if Fig.15 As shown in the schematic diagram, when the user enters "Summer Women's Wear Social Group" in the input box, the text processing system (such as Fig.15 ), receiving the text to be processed, and performing word segmentation on the text to be processed to obtain multiple words to be recognized, and then searching the words to be recognized, first checking whether the target word vector corresponding to the word to be recognized can be queried from the preset vector table (such as Fig.15 In the search 1), if the target word vector can be found, the text processing system will query the product information corresponding to the target word vector from the product database (such as Fig.15 3) and recommend products to users. For example, if a user Fig.15 The text to be processed entered in the input box is "summer women's dress", then the text processing system performs word segmentation on "summer women's dress" and obtains the word to be recognized for "dress", and can query the word vector corresponding to "dress" from the preset vector table. The text processing system pushes the word vector corresponding to "dress" to the e-commerce platform, so that the e-commerce platform can push products related to "dress" to users.

[0141] Step S1404, when it is detected that the word to be recognized does not exist in the preset vector table, the context of the word to be recognized in the text to be processed is obtained.

[0142] It should be noted that the context of the word to be identified in the text to be processed can be a word associated with the position of the word to be identified in the text to be processed. Specifically, the text processing system first determines the position of the word to be identified in the text to be processed, and then determines the context of the word to be identified in the text to be processed based on the position. For example, for the text to be processed "Summer Women's Clothing Social Group", the word to be identified is "social group", and the context of the word to be identified "social group" at least includes "women's clothing" and "group".

[0143] In an optional embodiment, after determining the position of the word to be recognized in the text to be processed, the text processing system highlights the word to be recognized in the text input box to prompt the user that the word may be entered incorrectly, for example, the color of the word to be recognized is set to a different color from other segmented words, or the font of the word to be recognized is enlarged or bolded, etc. In addition, after determining the word to be recognized, the text processing system detects whether the target word vector corresponding to the word to be recognized can be queried from the preset vector table. If it cannot be found, the text processing system generates a first prompt message and pushes the first prompt message to the user. The first prompt message is used to prompt the user that the word to be recognized entered may be wrong, and asks the user to confirm whether to modify the word to be recognized.

[0144] It should be noted that highlighting the words to be recognized and prompting the user when the target word vector corresponding to the word to be recognized cannot be found in the preset vector table can make the user notice the wrong words entered in the text and modify the wrong words, thereby ensuring that the e-commerce platform can push products that meet the user's search requirements.

[0145] Step S1406: Based on the context of the word to be recognized in the text to be processed, a replacement word corresponding to the word to be recognized is searched from a candidate word database.

[0146] After obtaining the context of the word to be recognized through step S1404, the word to be recognized is combined with the context of the word to be recognized to obtain a combined word, and then a phrase with the same semantics as the combined word is queried from the candidate word database, and the replacement word corresponding to the word to be recognized is determined by comparing the phrase with the combined word. For example, for the word to be recognized "socialization", its corresponding context is "women's clothing" and "group", and the combined word obtained by combining the word to be recognized with the corresponding context is "women's clothing socialization group". Then, based on the semantics corresponding to "women's clothing socialization group", the text processing system queries the phrase "women's clothing dress" from the candidate word database, and by comparing the combined word "women's clothing socialization group" with the phrase "women's clothing dress", it can be determined that the replacement word corresponding to the word to be recognized is "dress" (such as Fig.15 position-based replacement term search in ).

[0147] It should be noted that, in the process of determining the replacement word corresponding to the word to be recognized, the context of the word to be recognized in the text to be processed is used, and the specific meaning of the word to be recognized in the text to be processed is considered, so that the true meaning expressed by the combined word obtained by combining the word to be recognized with the corresponding context can be accurately determined, and then the word that the word to be recognized should correspond to under this meaning can be inferred. It can be seen that the accuracy of text processing can be improved through step S1406.

[0148] Step S1408: Use a replacement word to replace the word to be recognized, and perform classification processing based on the replaced text to be processed.

[0149] In an optional embodiment, when multiple replacement words are found, the text processing system can obtain the frequency of each replacement word based on the corpus, and then use the replacement word with the highest frequency to replace the word to be recognized. Further, after replacing the word to be recognized with the replacement word, the text processing system searches for the corresponding target word vector (such as ) from the preset vector table based on the replaced text to be processed. Fig.15 2), if it can be found, then the corresponding product information is found from the product database based on the target word vector (i.e. Fig.15 3) and recommend products to users.

[0150] Optionally, before using the replacement word to replace the word to be recognized, the text processing system also generates a second prompt information, wherein the second prompt information is used to prompt the user whether to replace the word to be recognized with the replacement word. It should be noted that in actual applications, the vocabulary in the text input by the user may be a relatively new vocabulary, and the target word vector corresponding to the new vocabulary has not yet been stored in the preset vector table. Therefore, if the replacement word is directly replaced with the word to be recognized at this time, the product searched by the text processing system based on the replacement word may not meet the user's search requirements. However, the present application first prompts the user whether to replace the word to be recognized before using the replacement word to replace the word to be recognized, which can effectively avoid the occurrence of the above-mentioned problems and thus improve the user experience.

[0151] Furthermore, when replacing words to be recognized, the text processing system can also push the number of words to be replaced and the replaced words to be recognized to the user, so that the user knows which words are entered incorrectly, and the user can avoid entering incorrect words next time.

[0152] It should be noted that, in actual applications, the word vectors corresponding to some new popular words may not be stored in the preset vector table. Therefore, it is impossible to query the word vectors corresponding to these new popular words from the preset vector table. The present application can avoid the above problem by updating the preset vector table. Specifically, after receiving the instruction of the user not to replace the word to be recognized according to the second prompt information feedback, the text processing system determines the target word vector corresponding to the word to be recognized through the Internet, and stores the word to be recognized and the target word vector corresponding to the word to be recognized in the preset vector table to realize the update of the preset vector table.

[0153] In addition, this embodiment can be applied to Fig.15 The product push scenario shown in the figure can also be applied to the text classification scenario. For example, for the product review "this is so good" (i.e., the text to be processed), after the above steps S1402 to S1406, the replacement word corresponding to the word to be recognized "good" can be obtained as "delicious", and then the replaced text to be processed is determined to be "this is so delicious", and then the text processing system can query the text database ( Fig.15 (not shown) to determine the text category corresponding to the text to be processed. For example, it can be determined that the comment attribute of the replaced text to be processed "This is so delicious" is a good comment, so the text to be processed "This is so delicious" is classified as a good comment.

[0154] Based on the scheme defined in the above steps S1402 to S1408, it can be learned that by querying the word vector of the combination word of the word to be recognized, after obtaining the word to be recognized in the text to be processed and detecting that the word to be recognized does not exist in the preset vector table, the context of the word to be recognized in the text to be processed is obtained, and then based on the context of the word to be recognized in the text to be processed, the replacement word corresponding to the word to be recognized is queried from the candidate word database, and finally the word to be recognized is replaced with the replacement word, and classification processing is performed based on the replaced text to be processed.

[0155] It is easy to notice that when the word vector corresponding to the word to be recognized does not exist in the preset vector table, the word vector corresponding to the combined word corresponding to the word to be recognized is queried in the preset vector table, which makes full use of the association between the words in the text, and uses the word vector corresponding to the combined word to classify the text, avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, compensating for the impact of reducing the accuracy of text classification caused by inaccurate word segmentation, achieving the purpose of classifying the text, and thus realizing the technical effect of improving the accuracy of text classification, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying the text, resulting in low text classification accuracy.

[0156] Example 6

[0157] According to an embodiment of the present application, a text processing method is also provided, such as Fig.16 As shown, the method includes:

[0158] Step S1602, obtaining the words to be recognized in the text to be processed.

[0159] In step 1602, the text processing system can obtain the text to be processed and obtain the words to be recognized from the text to be processed, wherein the text to be processed can be text actively input by the user to the text processing system, or can be text read by the text processing system from a preset position. Preferably, in the present application, the text to be processed is Chinese text. For example, in a product recommendation scenario, the text processing system can obtain the text to be processed from the search words or search statements entered by the user in the e-commerce platform, for example, Fig.15 In the schematic diagram shown, the user enters "Summer Women's Clothing Gathering Group" in the input box of the e-commerce platform, and the text processing system can obtain the text to be processed "Summer Women's Clothing Gathering Group".

[0160] After obtaining the text to be processed, the text processing system preprocesses the text to be processed to obtain the processed text to be processed, and then performs word segmentation processing on the processed text to be processed to obtain multiple word segments, and finally determines the word to be recognized from the multiple word segments. Among them, in the process of preprocessing the text to be processed, the text processing system mainly removes the noise information of the text to be processed, and the noise information includes but is not limited to invalid characters, HTML tags, etc. At the same time, the text processing system also performs format conversion on the text to be processed, and converts it into a format that can be processed by the text processing system. After preprocessing the text to be processed, the text processing system can use the existing word segmentation algorithm to perform word segmentation processing on the preprocessed text to be processed to obtain the word to be recognized. For example, the word segmentation processing of "Summer Women's Clothing Social Group" can obtain words such as "Summer", "Women's Clothing", "Social Group", etc., wherein the word to be recognized can be any one of "Summer", "Women's Clothing", "Social Group", and "Group".

[0161] Optionally, the text processing system may determine the word to be recognized based on the part of speech of the word and / or the position of the word in the text to be processed, for example, the noun located in the center is regarded as the word to be recognized; for another example, the noun after the first adjective is regarded as the word to be recognized.

[0162] In an optional embodiment, if Fig.15 As shown in the schematic diagram, when the user enters "Summer Women's Wear Social Group" in the input box, the text processing system (such as Fig.15), receiving the text to be processed, and performing word segmentation on the text to be processed to obtain multiple words to be recognized, and then searching the words to be recognized, first checking whether the target word vector corresponding to the word to be recognized can be queried from the preset vector table (such as Fig.15 In the search 1), if the target word vector can be found, the text processing system will query the product information corresponding to the target word vector from the product database (such as Fig.15 3) and recommend products to users. For example, if a user Fig.15 The text to be processed entered in the input box is "summer women's dress", then the text processing system performs word segmentation on "summer women's dress" and obtains the word to be recognized for "dress", and can query the word vector corresponding to "dress" from the preset vector table. The text processing system pushes the word vector corresponding to "dress" to the e-commerce platform, so that the e-commerce platform can push products related to "dress" to users.

[0163] Step S1604, when it is detected that the word to be recognized does not exist in the preset vector table, the context of the word to be recognized in the text to be processed is obtained.

[0164] It should be noted that the context of the word to be identified in the text to be processed can be a word associated with the position of the word to be identified in the text to be processed. Specifically, the text processing system first determines the position of the word to be identified in the text to be processed, and then determines the context of the word to be identified in the text to be processed based on the position. For example, for the text to be processed "Summer Women's Clothing Social Group", the word to be identified is "social group", and the context of the word to be identified "social group" at least includes "women's clothing" and "group".

[0165] In an optional embodiment, after determining the position of the word to be recognized in the text to be processed, the text processing system highlights the word to be recognized in the text input box to prompt the user that the word may be entered incorrectly, for example, the color of the word to be recognized is set to a different color from other segmented words, or the font of the word to be recognized is enlarged or bolded, etc. In addition, after determining the word to be recognized, the text processing system detects whether the target word vector corresponding to the word to be recognized can be queried from the preset vector table. If it cannot be found, the text processing system generates a first prompt message and pushes the first prompt message to the user. The first prompt message is used to prompt the user that the word to be recognized entered may be wrong, and asks the user to confirm whether to modify the word to be recognized.

[0166] It should be noted that highlighting the words to be recognized and prompting the user when the target word vector corresponding to the word to be recognized cannot be found in the preset vector table can make the user notice the wrong words entered in the text and modify the wrong words, thereby ensuring that the e-commerce platform can push products that meet the user's search requirements.

[0167] Step S1606: Based on the context of the word to be recognized in the text to be processed, a replacement word corresponding to the word to be recognized is searched from a candidate word database.

[0168] After obtaining the context of the word to be recognized through step S1604, the word to be recognized and the context of the word to be recognized are combined to obtain a combined word, and then a phrase with the same semantics as the combined word is queried from the candidate word database, and the replacement word corresponding to the word to be recognized is determined by comparing the phrase with the combined word. For example, for the word to be recognized "socialization", its corresponding context is "women's clothing" and "group", and the combined word obtained by combining the word to be recognized with the corresponding context is "women's clothing socialization group". Then, based on the semantics corresponding to "women's clothing socialization group", the text processing system queries the phrase "women's clothing dress" from the candidate word database, and by comparing the combined word "women's clothing socialization group" with the phrase "women's clothing dress", it can be determined that the replacement word corresponding to the word to be recognized is "dress" (such as Fig.15 position-based replacement term search in ).

[0169] It should be noted that, in the process of determining the replacement word corresponding to the word to be recognized, the context of the word to be recognized in the text to be processed is used, and the specific meaning of the word to be recognized in the text to be processed is considered, so that the true meaning expressed by the combined word obtained by combining the word to be recognized with the corresponding context can be accurately determined, and then the word that the word to be recognized should correspond to under this meaning can be inferred. It can be seen that the accuracy of text processing can be improved through step S1406.

[0170] Step S1608: Use a replacement word to replace the word to be recognized, and determine recommended information based on the replaced text to be processed.

[0171] In an optional embodiment, when multiple replacement words are found, the text processing system can obtain the frequency of each replacement word based on the corpus, and then use the replacement word with the highest frequency to replace the word to be recognized. Further, after replacing the word to be recognized with the replacement word, the text processing system searches for the corresponding target word vector (such as ) from the preset vector table based on the replaced text to be processed. Fig.15 2), if it can be found, then the corresponding product information is found from the product database based on the target word vector (i.e. Fig.15 3) and recommend products to users.

[0172] Optionally, before using the replacement word to replace the word to be recognized, the text processing system also generates a second prompt information, wherein the second prompt information is used to prompt the user whether to replace the word to be recognized with the replacement word. It should be noted that in actual applications, the vocabulary in the text input by the user may be a relatively new vocabulary, and the target word vector corresponding to the new vocabulary has not yet been stored in the preset vector table. Therefore, if the replacement word is directly replaced with the word to be recognized at this time, the product searched by the text processing system based on the replacement word may not meet the user's search requirements. However, the present application first prompts the user whether to replace the word to be recognized before using the replacement word to replace the word to be recognized, which can effectively avoid the occurrence of the above-mentioned problems and thus improve the user experience.

[0173] Furthermore, when replacing words to be recognized, the text processing system can also push the number of words to be replaced and the replaced words to be recognized to the user, so that the user knows which words are entered incorrectly, and the user can avoid entering incorrect words next time.

[0174] It should be noted that, in actual applications, the word vectors corresponding to some new popular words may not be stored in the preset vector table. Therefore, it is impossible to query the word vectors corresponding to these new popular words from the preset vector table. The present application can avoid the above problem by updating the preset vector table. Specifically, after receiving the instruction of the user not to replace the word to be recognized according to the second prompt information feedback, the text processing system determines the target word vector corresponding to the word to be recognized through the Internet, and stores the word to be recognized and the target word vector corresponding to the word to be recognized in the preset vector table to realize the update of the preset vector table.

[0175] Based on the scheme defined in the above steps S1602 to S1608, it can be learned that by querying the word vector of the combination word of the word to be recognized, after obtaining the word to be recognized in the text to be processed and detecting that the word to be recognized does not exist in the preset vector table, the context of the word to be recognized in the text to be processed is obtained, and then based on the context of the word to be recognized in the text to be processed, the replacement word corresponding to the word to be recognized is queried from the candidate word database, and finally the word to be recognized is replaced with the replacement word, and the recommended information is determined based on the replaced text to be processed.

[0176] It is easy to notice that when the word vector corresponding to the word to be recognized does not exist in the preset vector table, the word vector corresponding to the combined word corresponding to the word to be recognized is queried in the preset vector table, which makes full use of the association between the words in the text, and uses the word vector corresponding to the combined word to classify the text, thereby avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, and compensating for the impact of inaccurate word segmentation on reducing the accuracy of information push, thereby achieving the technical effect of accurately pushing messages, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying the text, thereby reducing the accuracy of information push.

[0177] It should be noted that the text processing method provided in this embodiment is different from the application scenario of Embodiment 5, but the other contents are the same. The relevant contents have been explained in Embodiment 5 and will not be repeated here.

[0178] Example 7

[0179] According to an embodiment of the present application, a text processing device for implementing the above text processing method is also provided. Fig.10 As shown, the device 50 includes: a first acquisition module 501 , a second acquisition module 503 , a combination module 505 and a processing module 507 .

[0180] Among them, the first acquisition module 501 is used to obtain the word to be recognized in the text to be processed; the second acquisition module 503 is used to obtain the candidate word associated with the position of the word to be recognized from the text to be processed when it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table; the combination module 505 is used to combine the candidate word with the word to be recognized to obtain a combined word; the processing module 507 is used to query the target word vector corresponding to the combined word from the preset vector table, and classify the text to be processed based on the target word vector.

[0181] It should be noted that the first acquisition module 501, the second acquisition module 503, the combination module 505 and the processing module 507 correspond to steps S202 to S206 in Example 1, and the four modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned embodiment 1. It should be noted that the above-mentioned modules as part of the apparatus can be run in the computing device 10 provided in the embodiment 1.

[0182] In an optional embodiment, the second acquisition module includes: a first determination module and a second determination module. The first determination module is used to determine the position of the word to be recognized in the text to be processed, wherein the position includes one of the following: the beginning of a sentence of the text to be processed, the middle of a sentence of the text to be processed, and the end of a sentence of the text to be processed; the second determination module is used to determine the first number of words located before the position and / or the first number of words located after the position from the text to be processed as the first candidate word; the combination module includes: a first combination module, which is used to combine the first candidate word with the word to be recognized to obtain a first combination word.

[0183] In an optional embodiment, the processing module includes: a first processing module. The first processing module is used to classify the text to be processed based on the first target word vector when detecting that there is a first target word vector corresponding to a homophone of the first combination word in the preset vector table.

[0184] In an optional embodiment, the text processing device further includes: a third acquisition module and a third determination module. The third acquisition module is used to acquire the word frequency of each first target word vector based on the corpus when it is detected that there are multiple first target word vectors corresponding to the homophones of the first combination word in the preset vector table; the third determination module is used to determine the first target word vector with the highest word frequency as the target word vector corresponding to the homophone of the first combination word.

[0185] In an optional embodiment, the text processing device further includes: a fourth determination module, a second combination module, and a second processing module. The fourth determination module is used to determine the second number of words before the position and / or the second number of words after the position from the text to be processed as the second candidate words when it is detected that the first target word vector corresponding to the homophone of the first combination word does not exist in the preset vector table; the second combination module is used to combine the second candidate words with the word to be identified to obtain the second combination word, wherein the first number is greater than the second number; the second processing module is used to query the second target word vector corresponding to the homophone of the second combination word from the preset vector table, and classify the text to be processed based on the second target word vector.

[0186] In an optional embodiment, the second processing module includes: a third processing module and a fifth determination module. The third processing module is used to classify the text to be processed based on the second target word vector when it is detected that there is a second target word vector corresponding to the homophone of the second combination word in the preset vector table; the fifth determination module is used to determine the default target word vector as the target word vector of the word to be recognized when it is detected that there is no second target word vector corresponding to the homophone of the second combination word in the preset vector table, and classify the text to be processed based on the default target word vector, wherein the default target word vector is the word vector of the word with the same or similar pinyin as the word to be recognized.

[0187] In an optional embodiment, the text processing device further includes: a fourth acquisition module and a sixth determination module. The fourth acquisition module is used to acquire the word frequency of each second target word vector based on the corpus when it is detected that there are multiple second target word vectors corresponding to the homophones of the second combination word in the preset vector table; the sixth determination module is used to determine the second target word vector with the highest word frequency as the target word vector corresponding to the homophone of the second combination word.

[0188] In an optional embodiment, the text processing device also includes: a fourth processing module, which is used to classify the text to be processed based on the word vector corresponding to the word to be recognized when it is detected that there is a word vector corresponding to the word to be recognized in the preset vector table.

[0189] In an optional embodiment, the text processing device further includes: a fifth acquisition module and a seventh determination module. The fifth acquisition module is used to acquire the word frequency of each word vector based on the corpus when it is detected that there are multiple word vectors with the same or similar pinyin as the word to be recognized in the preset vector table; the seventh determination module is used to determine the word vector with the highest word frequency as the default target word vector corresponding to the word to be recognized.

[0190] In an optional embodiment, the text processing device further includes: a fifth processing module. The fifth processing module is configured to set the word vector of the candidate word corresponding to the combination word to empty when a target word vector corresponding to the combination word is found from the preset vector table.

[0191] In an optional embodiment, the first acquisition module includes: a sixth processing module, a word segmentation module and an eighth determination module. The sixth processing module is used to pre-process the text to be processed to obtain the processed text to be processed; the word segmentation module is used to perform word segmentation processing on the processed text to be processed to obtain multiple word segments; the eighth determination module is used to determine the word to be recognized from the multiple word segments.

[0192] Example 8

[0193] According to an embodiment of the present application, a text processing system for implementing the above-mentioned text processing method is also provided, and the system includes: an input unit, a processing unit, and an output unit.

[0194] Among them, the input unit is used to input the text to be processed; the processing unit is used to obtain the word to be recognized from the text to be processed, and when it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table, obtain the candidate word associated with the position of the word to be recognized from the text to be processed, and then combine the candidate word with the word to be recognized to obtain a combined word, and query the target word vector corresponding to the combined word from the preset vector table, and finally classify the text to be processed based on the target word vector; the output unit is used to output the processing result of the classification processing of the text to be processed by the processing unit.

[0195] From the above, it can be seen that the method of querying the word vector of the combination word of the word to be recognized is adopted. When the word to be recognized in the text to be processed is obtained, and when it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table, the candidate word associated with the position of the word to be recognized is obtained from the text to be processed, and then the candidate word is combined with the word to be recognized to obtain the combination word, and finally the target word vector corresponding to the combination word is queried from the preset vector table, and the text to be processed is classified based on the target word vector.

[0196] It is easy to notice that when the word vector corresponding to the word to be recognized does not exist in the preset vector table, the word vector corresponding to the combined word corresponding to the word to be recognized is queried in the preset vector table, which makes full use of the association between the words in the text, and uses the word vector corresponding to the combined word to classify the text, avoiding the problem of text information loss caused by using a unified default word vector to replace the vector of the word whose word vector cannot be found in the word vector table, compensating for the impact of reducing the accuracy of text classification caused by inaccurate word segmentation, achieving the purpose of text classification, and thus realizing the technical effect of improving the accuracy of text classification, and further solving the technical problem that the related technology uses the default word vector as the word vector of all words whose word vector cannot be found in the word vector table when classifying text, resulting in low text classification accuracy.

[0197] It should be noted that the processing unit in this embodiment can execute the text processing method in Example 1. The relevant content has been explained in Example 1 and will not be repeated here.

[0198] Example 9

[0199] The embodiment of the present application may provide a computing device, which may be any computing device in a computing device group. Optionally, in this embodiment, the computing device may also be replaced by a terminal device such as a mobile terminal.

[0200] Optionally, in this embodiment, the computing device may be located in at least one network device among a plurality of network devices of a computer network.

[0201] In this embodiment, the above-mentioned computing device can execute the program code of the following steps in the text processing method: obtaining the word to be recognized in the text to be processed; when it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; combining the candidate word with the word to be recognized to obtain a combined word; querying the target word vector corresponding to the combined word from the preset vector table, and classifying the text to be processed based on the target word vector.

[0202] Optionally, Fig.11 is a structural block diagram of a computing device according to an embodiment of the present application. Fig.11 As shown, the computing device 10 may include: one or more (only one is shown in the figure) processors 602 , a memory 604 , and a peripheral interface 606 .

[0203] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the text processing method and device in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, realizing the above-mentioned text processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories can be connected to the computing device 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0204] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: obtain the word to be recognized in the text to be processed; when it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, obtain the candidate word associated with the position of the word to be recognized from the text to be processed; combine the candidate word with the word to be recognized to obtain a combined word; query the target word vector corresponding to the combined word from the preset vector table, and classify the text to be processed based on the target word vector.

[0205] Optionally, the processor may also execute the program code of the following steps: determining the position of the word to be recognized in the text to be processed, wherein the position includes one of the following: the beginning of a sentence of the text to be processed, the middle of a sentence of the text to be processed, and the end of a sentence of the text to be processed; determining from the text to be processed a first number of words located before the position and / or a first number of words located after the position as first candidate words; combining the first candidate word with the word to be recognized to obtain a first combined word.

[0206] Optionally, the processor may also execute the following program code: when it is detected that there is a first target word vector corresponding to a homophone of the first combination word in the preset vector table, classify the text to be processed based on the first target word vector.

[0207] Optionally, the processor may also execute the following program code: when it is detected that there are multiple first target word vectors corresponding to the homonyms of the first combination word in the preset vector table, obtaining the word frequency of each first target word vector based on the corpus; and determining the first target word vector with the highest word frequency as the target word vector corresponding to the homonym of the first combination word.

[0208] Optionally, the processor may also execute the following program code: when it is detected that there is no first target word vector corresponding to the homonym of the first combination word in the preset vector table, determine a second number of words located before the position and / or a second number of words located after the position from the text to be processed as second candidate words; combine the second candidate words with the word to be identified to obtain a second combination word, wherein the first number is greater than the second number; query the second target word vector corresponding to the homonym of the second combination word from the preset vector table, and classify the text to be processed based on the second target word vector.

[0209] Optionally, the processor may also execute the following program code: in case it is detected that there is a second target word vector corresponding to a homophone of the second combination word in the preset vector table, classifying the text to be processed based on the second target word vector; in case it is detected that there is no second target word vector corresponding to a homophone of the second combination word in the preset vector table, determining a default target word vector as the target word vector of the word to be recognized, and classifying the text to be processed based on the default target word vector, wherein the default target word vector is a word vector of a word having the same or similar pinyin as the word to be recognized.

[0210] Optionally, the processor may also execute the following program code: when it is detected that there are multiple second target word vectors corresponding to the homophones of the second combination word in the preset vector table, obtaining the word frequency of each second target word vector based on the corpus; and determining the second target word vector with the highest word frequency as the target word vector corresponding to the homophone of the second combination word.

[0211] Optionally, the processor may also execute the following program code: when it is detected that there is a word vector corresponding to the word to be recognized in the preset vector table, classify the text to be processed based on the word vector corresponding to the word to be recognized.

[0212] Optionally, the processor may also execute the following program code: when it is detected that there is no second target word vector corresponding to the homonym of the second combination word in the preset vector table, if it is detected that there are multiple word vectors of words with the same or similar pinyin as the word to be recognized in the preset vector table, then the word frequency of each word vector is obtained based on the corpus; and the word vector with the highest word frequency is determined as the default target word vector corresponding to the word to be recognized.

[0213] Optionally, the processor may also execute the following program code: when a target word vector corresponding to the combined word is found from a preset vector table, the word vector of the candidate word corresponding to the combined word is set to empty.

[0214] Optionally, the processor may also execute program codes of the following steps: preprocessing the text to be processed to obtain processed text to be processed; performing word segmentation on the processed text to be processed to obtain multiple word segments; and determining the word to be recognized from the multiple word segments.

[0215] It can be understood by those skilled in the art that Fig.11 The structure shown is for illustration only, and the computing device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Fig.11 The structure of the electronic device is not limited. For example, the computing device 10 may also include Fig.11 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Fig.11 Different configurations are shown.

[0216] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0217] Example 10

[0218] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the text processing method provided in the first embodiment.

[0219] Optionally, in this embodiment, the above storage medium may be located in any one of the computing devices in the computing device group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

[0220] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining a word to be recognized in the text to be processed; when it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; combining the candidate word with the word to be recognized to obtain a combined word; querying a target word vector corresponding to the combined word from the preset vector table, and classifying the text to be processed based on the target word vector.

[0221] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: determining the position of the word to be recognized in the text to be processed, wherein the position includes one of the following: the beginning of a sentence of the text to be processed, the middle of a sentence of the text to be processed, and the end of a sentence of the text to be processed; determining from the text to be processed a first number of words located before the position and / or a first number of words located after the position as first candidate words; combining the first candidate word with the word to be recognized to obtain a first combined word.

[0222] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when it is detected that there is a first target word vector corresponding to a homophone of the first combination word in the preset vector table, classify the processed text based on the first target word vector.

[0223] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when it is detected that there are multiple first target word vectors corresponding to homophones of the first combination word in the preset vector table, obtaining the word frequency of each first target word vector based on the corpus; and determining the first target word vector with the highest word frequency as the target word vector corresponding to the homophone of the first combination word.

[0224] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: in a case where it is detected that there is no first target word vector corresponding to the homonym of the first combination word in the preset vector table, determining a second number of words located before the position and / or a second number of words located after the position from the text to be processed as second candidate words; combining the second candidate words with the word to be identified to obtain a second combination word, wherein the first number is greater than the second number; querying the second target word vector corresponding to the homonym of the second combination word from the preset vector table, and classifying the text to be processed based on the second target word vector.

[0225] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: in a case where it is detected that there is a second target word vector corresponding to a homophone of the second combination word in the preset vector table, classifying the text to be processed based on the second target word vector; in a case where it is detected that there is no second target word vector corresponding to a homophone of the second combination word in the preset vector table, determining a default target word vector as the target word vector of the word to be recognized, and classifying the text to be processed based on the default target word vector, wherein the default target word vector is a word vector of a word having the same or similar pinyin as the word to be recognized.

[0226] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when it is detected that there are multiple second target word vectors corresponding to homophones of the second combination word in the preset vector table, obtaining the word frequency of each second target word vector based on the corpus; and determining the second target word vector with the highest word frequency as the target word vector corresponding to the homophone of the second combination word.

[0227] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when it is detected that there is a word vector corresponding to the word to be recognized in the preset vector table, classify the text to be processed based on the word vector corresponding to the word to be recognized.

[0228] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when it is detected that there is no second target word vector corresponding to the homophone of the second combination word in the preset vector table, if it is detected that there are multiple word vectors of words with the same or similar pinyin as the word to be recognized in the preset vector table, then the word frequency of each word vector is obtained based on the corpus; and the word vector with the highest word frequency is determined as the default target word vector corresponding to the word to be recognized.

[0229] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: when a target word vector corresponding to a combination word is queried from a preset vector table, the word vector of the candidate word corresponding to the combination word is set to empty.

[0230] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: preprocessing the text to be processed to obtain processed text to be processed; performing word segmentation on the processed text to be processed to obtain multiple word segments; and determining the word to be recognized from the multiple word segments.

[0231] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0232] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0233] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

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

[0235] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0236] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0237] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A text processing method, characterized in that: include: Get the words to be recognized in the text to be processed; When it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; Combining the candidate word with the word to be recognized to obtain a combined word; Querying a target word vector corresponding to the combined word from the preset vector table, and classifying the text to be processed based on the target word vector; The method further includes: determining the position of the word to be recognized in the text to be processed; determining a first number of words located before the position and / or a first number of words located after the position from the text to be processed as first candidate words; combining the first candidate word with the word to be recognized to obtain a first combination word; and classifying the text to be processed based on the first target word vector when a first target word vector corresponding to a homophone of the first combination word is detected in the preset vector table; In the case where it is detected that there is no first target word vector corresponding to the homonym of the first combination word in the preset vector table, determine a second number of words located before the position and / or a second number of words located after the position from the text to be processed as second candidate words; combine the second candidate words with the word to be recognized to obtain a second combination word, wherein the first number is greater than the second number; query the second target word vector corresponding to the homonym of the second combination word from the preset vector table, and classify the text to be processed based on the second target word vector.

2. The method according to claim 1, characterized in that The position includes one of the following: the beginning of the sentence of the text to be processed, the middle of the sentence of the text to be processed, and the end of the sentence of the text to be processed.

3. The method according to claim 1, characterized in that The method further comprises: When it is detected that there are a plurality of first target word vectors corresponding to homophones of the first combination word in the preset vector table, obtaining a word frequency of each first target word vector based on a corpus; The first target word vector with the highest word frequency is determined as the target word vector corresponding to the homophone of the first combination word.

4. The method according to claim 1, characterized in that: Querying a second target word vector corresponding to a homophone of the second combination word from the preset vector table, and classifying the text to be processed based on the second target word vector, including: In the case where it is detected that a second target word vector corresponding to a homophone of the second combination word exists in the preset vector table, classifying the text to be processed based on the second target word vector; When it is detected that there is no second target word vector corresponding to the homonym of the second combination word in the preset vector table, a default target word vector is determined as the target word vector of the word to be recognized, and the text to be processed is classified based on the default target word vector, wherein the default target word vector is a word vector of a word having the same or similar pinyin as the word to be recognized.

5. The method according to claim 4, characterized in that The method further comprises: When it is detected that there are a plurality of second target word vectors corresponding to homophones of the second combination word in the preset vector table, obtaining the word frequency of each second target word vector based on a corpus; The second target word vector with the highest word frequency is determined as the target word vector corresponding to the homophone of the second combination word.

6. The method according to claim 1, characterized in that In the case where it is detected that the word vector corresponding to the word to be recognized exists in the preset vector table, the text to be processed is classified based on the word vector corresponding to the word to be recognized.

7. The method according to claim 4, characterized in that The method further comprises: In the case where it is detected that there is no second target word vector corresponding to the homophone of the second combination word in the preset vector table, if it is detected that there are multiple word vectors of words having the same or similar pinyin as the word to be recognized in the preset vector table, then the word frequency of each of the word vectors is obtained based on the corpus; The word vector with the highest word frequency is determined as the default target word vector corresponding to the word to be recognized.

8. The method according to claim 1, characterized in that The method further comprises: When the target word vector corresponding to the combined word is found from the preset vector table, the word vector of the candidate word corresponding to the combined word is set to empty.

9. The method according to claim 1, characterized in that: Get the words to be recognized in the text to be processed, including: Preprocessing the text to be processed to obtain a processed text to be processed; Performing word segmentation processing on the processed text to be processed to obtain multiple word segments; The word to be recognized is determined from the multiple word segments.

10. A text processing method, characterized in that: include: Obtain the words to be recognized in the text to be processed; Acquire candidate words associated with the position of the word to be recognized from the text to be processed; Obtaining a target word vector from a preset vector table according to the candidate words and the word to be recognized; Classify the text to be processed based on the target word vector; The method further includes: determining the position of the word to be recognized in the text to be processed; determining a first number of words located before the position and / or a first number of words located after the position from the text to be processed as first candidate words; obtaining a first target word vector from the preset vector table according to the first candidate word and the word to be recognized; and classifying the text to be processed based on the first target word vector when the first target word vector is detected to exist in the preset vector table; When it is detected that the first target word vector does not exist in the preset vector table, a second number of words located before the position and / or a second number of words located after the position are determined from the text to be processed as second candidate words, wherein the first number is greater than the second number; a second target word vector is obtained from the preset vector table according to the second candidate words and the word to be identified; and the text to be processed is classified based on the second target word vector.

11. The method according to claim 10, characterized in that Obtaining a target word vector from a preset vector table according to the candidate word and the word to be recognized, including: The target word vector is obtained from the preset vector table according to the pinyin of the candidate word and the word to be recognized, wherein the similarity between the pinyin of the target word vector and the pinyin of the word to be recognized reaches a preset similarity.

12. A text processing method, characterized in that: include: Get the words to be recognized in the text to be processed; When it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table, obtaining a candidate word associated with the position of the word to be recognized from the text to be processed; Combining the candidate word with the word to be recognized to obtain a combined word; Querying a target word vector corresponding to the combined word from the preset vector table, and determining recommendation information based on the target word vector; The method further includes: determining the position of the word to be recognized in the text to be processed; determining a first number of words located before the position and / or a first number of words located after the position from the text to be processed as first candidate words; combining the first candidate word with the word to be recognized to obtain a first combination word; and determining the recommendation information based on the first target word vector when a first target word vector corresponding to a homophone of the first combination word is detected in the preset vector table; In the case where it is detected that there is no first target word vector corresponding to the homonym of the first combination word in the preset vector table, determine a second number of words located before the position and / or a second number of words located after the position from the text to be processed as second candidate words; combine the second candidate words with the word to be recognized to obtain a second combination word, wherein the first number is greater than the second number; query the second target word vector corresponding to the homonym of the second combination word from the preset vector table, and determine the recommendation information based on the second target word vector.

13. The method according to claim 12, characterized in that After determining the recommendation information based on the target word vector, the method further includes: Acquire product information corresponding to the recommended information; Push the product information.

14. A text processing method, characterized in that: include: Get the words to be recognized in the text to be processed; Acquire candidate words associated with the position of the word to be recognized from the text to be processed; Obtaining a target word vector from a preset vector table according to the candidate words and the word to be recognized; Determining recommended information based on the target word vector; The method further includes: determining the position of the word to be recognized in the text to be processed; determining a first number of words located before the position and / or a first number of words located after the position from the text to be processed as first candidate words; obtaining a first target word vector from the preset vector table according to the first candidate word and the word to be recognized; and classifying the text to be processed based on the first target word vector when the first target word vector is detected to exist in the preset vector table; In the case where it is detected that the first target word vector does not exist in the preset vector table, a second number of words located before the position and / or a second number of words located after the position are determined from the text to be processed as second candidate words, wherein the first number is greater than the second number; a second target word vector is obtained from the preset vector table according to the second candidate words and the word to be identified; and the recommendation information is determined based on the second target word vector.

15. A text processing method, characterized in that: include: Obtain the words to be recognized in the text to be processed; When it is detected that the word to be recognized does not exist in the preset vector table, obtaining the context of the word to be recognized in the text to be processed; Based on the context of the word to be recognized in the text to be processed, searching a candidate word database for a replacement word corresponding to the word to be recognized; Using the replacement word to replace the word to be recognized, and performing classification processing based on the replaced text to be processed; The method further comprises: determining a first number of words located before the context and / or a first number of words located after the context from the text to be processed as first replacement words; when it is detected that the first replacement word exists in the candidate word database, replacing the word to be recognized with the first replacement word, and performing classification processing based on the replaced text to be processed; When it is detected that the first replacement word does not exist in the candidate word database, a second number of words located before the context and / or a second number of words located after the context are determined from the text to be processed as second replacement words, wherein the first number is greater than the second number; the second replacement word is used to replace the word to be recognized, and classification processing is performed based on the replaced text to be processed.

16. The method according to claim 15, characterized in that Obtaining the context of the word to be recognized in the text to be processed includes: Determine the position of the word to be recognized in the text to be processed; The context of the word to be recognized in the text to be processed is determined according to the position.

17. The method according to claim 15, characterized in that Replacing the to-be-recognized word with the replacement word includes: When multiple replacement words are found, the frequency of each replacement word is obtained based on the corpus; The word to be recognized is replaced by the replacement word with the highest word frequency.

18. A text processing method, characterized in that: include: Obtain the words to be recognized in the text to be processed; When it is detected that the word to be recognized does not exist in the preset vector table, obtaining the context of the word to be recognized in the text to be processed; Based on the context of the word to be recognized in the text to be processed, searching a candidate word database for a replacement word corresponding to the word to be recognized; Using the replacement word to replace the word to be recognized, and determining recommendation information based on the replaced text to be processed; The method further comprises: determining a first number of words located before the context and / or a first number of words located after the context from the text to be processed as first replacement words; in the case of detecting that the first replacement word exists in the candidate word database, replacing the word to be recognized with the first replacement word, and determining the recommendation information based on the text to be processed after the replacement; When it is detected that the first replacement word does not exist in the candidate word database, a second number of words located before the context and / or a second number of words located after the context are determined from the text to be processed as second replacement words, wherein the first number is greater than the second number; the second replacement word is used to replace the word to be recognized, and the recommendation information is determined based on the text to be processed after the replacement.

19. A text processing device, characterized in that: include: A first acquisition module is used to acquire the words to be recognized in the text to be processed; A second acquisition module is used to acquire a candidate word associated with the position of the word to be recognized from the text to be processed when it is detected that the word vector corresponding to the word to be recognized does not exist in the preset vector table; A combining module, used for combining the candidate word with the word to be recognized to obtain a combined word; A processing module, used for querying a target word vector corresponding to the combination word from the preset vector table, and classifying the text to be processed based on the target word vector; The device is further used for: determining the position of the word to be recognized in the text to be processed; determining a first number of words located before the position and / or a first number of words located after the position from the text to be processed as first candidate words; combining the first candidate word with the word to be recognized to obtain a first combination word; and classifying the text to be processed based on the first target word vector when a first target word vector corresponding to a homophone of the first combination word is detected in the preset vector table; In the case where it is detected that there is no first target word vector corresponding to the homonym of the first combination word in the preset vector table, determine a second number of words located before the position and / or a second number of words located after the position from the text to be processed as second candidate words; combine the second candidate words with the word to be recognized to obtain a second combination word, wherein the first number is greater than the second number; query the second target word vector corresponding to the homonym of the second combination word from the preset vector table, and classify the text to be processed based on the second target word vector.

20. A text processing system, characterized in that: include: An input unit, used for inputting text to be processed; A processing unit is used to obtain a word to be recognized from the text to be processed, and when it is detected that there is no word vector corresponding to the word to be recognized in the preset vector table, obtain a candidate word associated with the position of the word to be recognized from the text to be processed, then combine the candidate word with the word to be recognized to obtain a combined word, and query a target word vector corresponding to the combined word from the preset vector table, and finally classify the text to be processed based on the target word vector; An output unit, used for outputting the processing result of the processing unit classifying the text to be processed; The system is further used to: determine the position of the word to be recognized in the text to be processed; determine a first number of words located before the position and / or a first number of words located after the position from the text to be processed as first candidate words; combine the first candidate word with the word to be recognized to obtain a first combination word; and classify the text to be processed based on the first target word vector when a first target word vector corresponding to a homophone of the first combination word is detected in the preset vector table; In the case where it is detected that there is no first target word vector corresponding to the homonym of the first combination word in the preset vector table, determine a second number of words located before the position and / or a second number of words located after the position from the text to be processed as second candidate words; combine the second candidate words with the word to be recognized to obtain a second combination word, wherein the first number is greater than the second number; query the second target word vector corresponding to the homonym of the second combination word from the preset vector table, and classify the text to be processed based on the second target word vector.

21. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the text processing method according to any one of claims 1 to 9.

22. A processor, characterized in that: The processor is used to run a program, wherein the program executes the text processing method according to any one of claims 1 to 9 when running.