Word recognition method and device based on similarity

The feature similarity search is performed through the glyph vector index library to identify similar words in the target text, solving the problem of poor word recognition effect in the prior art, achieving high-precision recognition and reducing calculation costs.

CN120146037APending Publication Date: 2025-06-13BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311687931.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In the prior art, when identifying confusing words, similarity recognition methods based on pinyin or strokes are difficult to cover various deformation types, and model-based methods require frequent updates of training samples, resulting in a decrease in recognition effect and increasing costs.

Method used

By obtaining the target text of the target word, using the glyph vector index library to obtain vector features, and perform feature similarity searches to accurately identify similar words of the target word, thereby obtaining confusing words.

Benefits of technology

It improves the recognition quality of confusing words, avoids insufficient coverage types of pinyin or stroke recognition methods, reduces calculation costs, and simplifies the process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146037A_ABST
    Figure CN120146037A_ABST
Patent Text Reader

Abstract

The invention discloses a word recognition method and device based on similarity, and relates to the technical field of big data. The specific implementation mode of the method comprises the steps of obtaining a target character of a target word; obtaining vector features of the target characters based on a font vector index database; performing feature similarity retrieval by adopting the font vector index database on the basis of the vector features of the target characters so as to obtain similar characters of the target characters; and according to the similar words, obtaining confusable words of the target words. According to the embodiment, the features of the character fonts can be more accurately obtained based on visual representation of the character fonts, so that similar characters of the target character can be more accurately obtained, the problem that the coverage types of similar character recognition according to pinyin strokes of the character are few is avoided, and high-precision recognition of confused words is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular, to a method and device for word recognition based on similarity. Background Art

[0002] The expressions of words are rich and diverse, and words including words, phrases, and entire vocabularies are all composed of characters. Whether it is during text input proofreading or when searching for confusing brands that imitate well-known brands, it is necessary to effectively identify the confusing words of a word. Currently, the methods for identifying confusing words mainly include: rewriting the word based on similar-shaped or similar-sounding characters of the text to obtain confusing words; or, obtaining confusing words based on the language embedding representation ability and word extraction ability of a model.

[0003] However, the method of rewriting a word based on similar-shaped or similar-sounding characters of the text mainly relies on the recognition of the similarity of pinyin or strokes, and it is difficult to cover all deformation types of confusing words. Obtaining confusing words based on the language embedding representation ability and word extraction ability of a model requires timely updating of training samples for model iteration. Otherwise, the recognition effect will decline. And timely updating of training samples for model iteration will consume a large amount of costs, and the recognition quality of the obtained model is low. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a method and device for word recognition based on similarity, which can more accurately obtain similar characters of the target text and improve the recognition quality of confusing words.

[0005] To achieve the above object, according to one aspect of the embodiments of the present invention, a method for word recognition based on similarity is provided.

[0006] A method for word recognition based on similarity according to an embodiment of the present invention includes:

[0007] Obtain the target character of the target word;

[0008] Based on the glyph vector index library, obtain the vector feature of the above target character; wherein, the glyph vector index library includes the vector features of each character in the preset character set;

[0009] Based on the vector feature of the above target character, use the above glyph vector index library to perform feature similarity retrieval to obtain the similar characters of the above target character;

[0010] Obtain the confusing words of the above target word according to the above similar characters.

[0011] Optionally, the construction method of the above glyph vector index library includes:

[0012] Obtain the vector features of each character in the preset character set through the feature layer of the glyph vector model, and construct a glyph vector index library.

[0013] Optionally, the method for obtaining the above-mentioned glyph vector model includes:

[0014] Convert the sample characters and the characters in the above-mentioned preset character set into character images;

[0015] Calculate the image similarity between the character images of the above-mentioned sample characters and the character images of the characters in the above-mentioned preset character set respectively;

[0016] Use the characters corresponding to the character images with the above-mentioned image similarity greater than the first preset image similarity threshold as positive samples, and use the characters corresponding to the character images with the above-mentioned image similarity less than the second preset image similarity threshold as negative samples to construct a training sample set;

[0017] Use the above-mentioned training sample set to train the model to be trained to obtain a glyph vector model.

[0018] Optionally, the above-mentioned conversion of the sample characters and the characters in the above-mentioned preset character set into character images includes:

[0019] Convert the sample characters and the characters in the above-mentioned preset character set into images;

[0020] Perform image alignment processing on the above-mentioned images so that the images of the above-mentioned sample characters and the characters in the above-mentioned preset character set all have the same size;

[0021] Perform binarization processing on the images after the image alignment processing is completed to generate character images.

[0022] Optionally, the above-mentioned feature similarity retrieval is performed using the above-mentioned glyph vector index library based on the vector features of the above-mentioned target character to obtain similar characters of the above-mentioned target character, including:

[0023] Obtain the cosine similarity between the vector features of the above-mentioned target character and the vector features of the characters in the above-mentioned glyph vector index library using the above-mentioned glyph vector index library based on the vector features of the above-mentioned target character;

[0024] Based on the cosine similarity, obtain similar characters of the above-mentioned target character.

[0025] Optionally, the above-mentioned obtaining of similar characters of the above-mentioned target character based on the cosine similarity further includes:

[0026] Sort the cosine similarity between the vector features of the above-mentioned target character and the vector features of the characters in the above-mentioned glyph vector index library, and use the characters before the preset rank as the similar characters of the above-mentioned target character.

[0027] Optionally, the above method further includes:

[0028] When the vector feature of the above target character is not in the above glyph vector index library, the feature layer of the above glyph vector model is used to obtain the vector feature of the above target character and add it to the above glyph vector index library.

[0029] Optionally, before converting the sample text and the text in the above preset text set into images, the above method further includes: converting the sample text and the text in the above preset text set into the same font.

[0030] Optionally, the above separately calculating the image similarity between the text image of the above sample text and the text images of the texts in the above preset text set includes:

[0031] Separately calculating the Jaccard similarity between the text image of the above sample text and the text images of the texts in the above preset text set.

[0032] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a similarity-based word recognition device.

[0033] A similarity-based word recognition device according to an embodiment of the present invention includes:

[0034] A first acquisition module, configured to acquire the target character of the target word;

[0035] A second acquisition module, configured to acquire the vector feature of the above target character based on the glyph vector index library; wherein, the glyph vector index library includes the vector features of each text in the preset text set;

[0036] A retrieval module, configured to perform feature similarity retrieval using the above glyph vector index library based on the vector feature of the above target character to obtain similar characters of the above target character;

[0037] A third acquisition module, configured to obtain the confusing words of the above target word according to the above similar characters.

[0038] To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an electronic device for similarity-based word recognition.

[0039] An electronic device for similarity-based word recognition according to an embodiment of the present invention includes: one or more processors; a storage device, configured to store one or more programs, when the one or more programs are executed by the one or more processors, enabling the one or more processors to implement a similarity-based word recognition method according to an embodiment of the present invention.

[0040] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.

[0041] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a similarity-based word recognition method according to an embodiment of the present invention is implemented.

[0042] One embodiment of the above invention has the following advantages or beneficial effects: by comparing the vector features between characters and obtaining the feature similarity between the vector features of the characters, the features of the character shapes can be obtained more accurately based on the visual representation of the character shapes, so as to more accurately obtain similar characters of the target characters, avoiding the problem of few types of similar characters covered by the pinyin strokes of the characters, and thus can identify easily confused words with high precision. At the same time, the vector features of the target characters can be obtained in a relatively short time through the character shape vector index library, and the similar characters of the target characters can be determined, without the need for model calculation every time easily confused words are identified, which reduces the calculation cost and simplifies the process.

[0043] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0045] Figure 1 is a flow chart of a similarity-based word recognition method according to an embodiment of the present invention;

[0046] Figure 2 is a flowchart of a method for obtaining a glyph vector model according to an embodiment of the present invention;

[0047] Figure 3 is a flow chart of a method for converting text into a text image according to an embodiment of the present invention;

[0048] Figure 4 is a schematic diagram of an image of “force” before image alignment processing according to an embodiment of the present invention;

[0049] Figure 5 is a schematic diagram of an image of “ヵ” before image alignment processing according to an embodiment of the present invention;

[0050] Figure 6 is a schematic diagram of an image of “force” after image alignment processing according to an embodiment of the present invention;

[0051] Figure 7 is a schematic diagram of an image of “ヵ” after image alignment processing according to an embodiment of the present invention;

[0052] Figure 8 It is a schematic diagram of the image of "Ke" according to an embodiment of the present invention before image alignment processing;

[0053] Figure 9 It is a schematic diagram of the image of "Hedou" according to an embodiment of the present invention before image alignment processing;

[0054] Figure 10 It is a schematic diagram of the image of "Ke" according to an embodiment of the present invention after image alignment processing;

[0055] Figure 11 It is a schematic diagram of the image of "Hedou" according to an embodiment of the present invention after image alignment processing;

[0056] Figure 12 It is the text image of "Hai" obtained by binarization according to an embodiment of the present invention;

[0057] Figure 13 It is the text image of "Tian" obtained by binarization according to an embodiment of the present invention;

[0058] Figure 14 It is the text image of "Da" obtained by binarization according to an embodiment of the present invention;

[0059] Figure 15 It is a schematic diagram of the main modules of the similarity-based word recognition device according to an embodiment of the present invention;

[0060] Figure 16 It is an exemplary system architecture diagram to which an embodiment of the present invention can be applied;

[0061] Figure 17 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. Detailed implementation manners

[0062] The following makes an explanation of exemplary embodiments of the present invention with reference to the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted below.

[0063] It should be noted that, without conflict, the embodiments of the present invention and the technical features in the embodiments can be combined with each other.

[0064] It should be noted that in the technical solution of the present disclosure, in aspects such as the collection, gathering, updating, analysis, processing, use, transmission, and storage of users' personal information, it complies with the provisions of relevant laws and regulations, is used for legal purposes, and does not violate public order and good customs. Necessary measures are taken for users' personal information to prevent illegal access to users' personal information data, and to safeguard the security of users' personal information, network security, and national security.

[0065] Figure 1 It is a schematic diagram of the main steps of the word recognition method based on similarity according to an embodiment of the present invention.

[0066] As Figure 1 shown, the word recognition method based on similarity according to an embodiment of the present invention mainly includes the following steps:

[0067] Step S101, obtaining the target text of the target word;

[0068] Step S102, obtaining the vector feature of the above target text based on the glyph vector index library; wherein, the glyph vector index library includes the vector features of each text in the preset text set;

[0069] Step S103, performing feature similarity retrieval on the vector feature of the above target text using the above glyph vector index library to obtain the similar characters of the above target text;

[0070] Step S104, obtaining the easily confused words of the above target word according to the above similar characters.

[0071] After obtaining the target word, the number of characters of the above target word is recognized. In response to the number of characters of the above target word being greater than 1, the target word is split, and each obtained text is used as the target text; in response to the number of characters of the above target word being equal to 1, the target word is used as the target text.

[0072] The vector feature of the target text is obtained by using the pre-constructed glyph vector index library. Here, the glyph vector index library includes the vector features of each text in the preset text set.

[0073] According to the vector feature of the target text, the feature similarity calculation function provided by the glyph vector index library is used to identify the feature similarity between the vector feature of the target text and the vector features of other texts, and further obtain the similar characters of the target text.

[0074] In response to the number of the above-mentioned target words being greater than 1, after obtaining the similar words of all the target words, randomly replace the corresponding target words in the above-mentioned target terms with the similar words of each target word to generate a set of confusing terms, call the search API to check on the e-commerce platform to determine whether there are products containing the confusing terms, and verify and manage the products containing the confusing terms.

[0075] In an optional embodiment, the method for constructing the above-mentioned glyph vector index library includes: obtaining the vector features of each word in the preset word set through the feature layer of the glyph vector model, and constructing the glyph vector index library.

[0076] The glyph vector model is trained based on the word images of the sample words and the word images of the words in the preset word set, and is a model for judging whether the words in the preset word set belong to the similar words of the model input word. The output of the feature layer of the above-mentioned glyph vector model is the vector features of the model input word and the words in the preset word set. Therefore, based on the output of the feature layer of the glyph vector model, the vector features of the words in the preset word set can be obtained, so as to construct the glyph vector index library. Among them, the preset word set can be a word set composed of words selected according to actual needs, or a word set including daily high-frequency and commonly used words.

[0077] In an optional embodiment, as Figure 2 shown, the method for obtaining the above-mentioned glyph vector model includes the following steps S201 to S204:

[0078] Step S201, convert the sample words and the words in the above-mentioned preset word set into word images;

[0079] Step S202, calculate the image similarity between the word images of the above-mentioned sample words and the word images of the words in the above-mentioned preset word set respectively;

[0080] Step S203, use the words corresponding to the word images with the above-mentioned image similarity greater than the first preset image similarity threshold as positive samples, and use the words corresponding to the word images with the above-mentioned image similarity less than the second preset image similarity threshold as negative samples to construct a training sample set;

[0081] Step S204, use the above-mentioned training sample set to train the model to be trained to obtain a glyph vector model.

[0082] Convert the sample text and the text in the above-mentioned preset text set into text images. At this time, the text images are images represented as matrices. Calculate the image similarity between the text images of the sample text and the text in the preset text set. Since the image similarity at this time only considers the pixel level, in order to better capture higher-level features such as strokes and contours between texts, use the text images of the sample text and the text in the preset text set and train the model based on their image similarity. As an example, calculating the image similarity between the text images of the sample text and the text in the preset text set can use the Jaccard similarity.

[0083] When constructing the training sample set to select positive and negative samples, the first preset image similarity threshold should be greater than or equal to the second preset image similarity threshold, and the specific value can be determined according to the actual situation. As an example, the first preset image similarity threshold can be selected as 0.6, and the second preset image similarity threshold can be selected as 0.4.

[0084] When using the training sample set to train the model to be trained and obtaining the glyph vector model, in the process, the feature layer of the model outputs the vector features of the training sample set, then calculates the feature similarity between the vector features of the sample text and the vector features of each sample in the positive and negative samples, and then performs the classification task. As an example, the feature similarity can use the cosine similarity.

[0085] In order to better obtain the vector features of the text in the preset text set for use in constructing the glyph vector index library, a metric learning task based on contrastive learning can be used to learn the features of the classification task, and as much as possible increase the cosine similarity of similar samples and reduce the cosine similarity of dissimilar samples to widen the distance between positive and negative samples.

[0086] In an optional embodiment, as Figure 3 shown, the above-mentioned conversion of the sample text and the text in the above-mentioned preset text set into text images includes the following steps S301 to S303:

[0087] Step S301, convert the sample text and the text in the above-mentioned preset text set into images;

[0088] Step S302, perform image alignment processing on the above-mentioned images so that the images of the above-mentioned sample text and the text in the above-mentioned preset text set have the same size;

[0089] Step S303, perform binarization processing on the images after the image alignment processing is completed to generate text images.

[0090] In order to better obtain the visual features of text, before constructing training samples, it is necessary to convert the sample text and the text in the preset text set into text images. First, convert the sample text and the text in the preset text set into the same font to avoid the difference between the vector features of similar characters in different fonts. Then convert the sample text and the text in the preset text set that have been converted into the same font into images, and perform image alignment processing to delete the excess blank space in the image and scale the image to align the text images. As an example, for the characters "力" and "ヵ" in different languages, the former is Chinese characters and the latter is Japanese. After converting the above two characters into images, the above Chinese characters are as follows Figure 4 As shown, the above Japanese Figure 5 As shown, the text sizes in the two images are different. Figure 4 and Figure 5 Remove extra spaces in the Figure 4 and Figure 5 Scale to the same size, remove whitespace and scale Figure 4 like Figure 6 As shown, after removing the blank space and scaling Figure 5 like Figure 7 shown.

[0091] As another example, for the characters "科" and "禾斗" with different numbers of characters, the former is one character, and the image is as follows: Figure 8 As shown, the latter is two words, the image is as follows Figure 9 As shown, Figure 8 and Figure 9 After deleting the blanks in and scaling them to the same size, Figure 10 and Figure 11 shown.

[0092] Then, the image after the image alignment process is binarized to generate a text image represented by a matrix. Further, the image after the image alignment process can be converted into a text image represented by a matrix of 0 and 1 through image = image.point (lambda x: 1 if x> 0 else 0). As an example, the text "海" is converted into a text image represented by a matrix. Figure 12 shown.

[0093] In an optional embodiment, the above-mentioned vector feature based on the above-mentioned target text uses the above-mentioned glyph vector index library to perform feature similarity retrieval to obtain similar characters of the above-mentioned target text, including:

[0094] Based on the vector features of the target text, the above-mentioned glyph vector index library is used to obtain the cosine similarity between the vector features of the target text and the vector features of the text in the above-mentioned glyph vector index library;

[0095] Based on the cosine similarity, obtain the similar characters of the target text.

[0096] The glyph vector index library includes vector features of characters in a preset character set, and the glyph vector index library can provide feature similarity calculation and retrieval functions. After the target character is input into the glyph vector index library, the vector features of the target character can be obtained. Furthermore, through the feature similarity calculation and retrieval functions, the cosine similarity between the target character and the characters in the preset character set can be calculated, and sorted based on the cosine similarity, and the characters ranked before the preset ranking in cosine similarity are output as the similar characters of the target character.

[0097] In an optional embodiment, the method of obtaining similar characters of the target character based on cosine similarity further includes:

[0098] The cosine similarity between the vector features of the target text and the vector features of the text in the glyph vector index library is sorted, and the text before the preset ranking is used as the similar text of the target text.

[0099] Specifically, the preset ranking can be set according to actual conditions.

[0100] In an optional embodiment, the above method further includes:

[0101] When the vector features of the target text are not in the glyph vector index library, the feature layer of the glyph vector model is used to obtain the vector features of the target text and add them to the glyph vector index library.

[0102] When the target text is input into the glyph vector index library and it is displayed that the vector features of the target text are not retrieved in the glyph vector index library, the target text can be used as the input of the glyph vector model to obtain the vector features of the target text output by the feature layer of the glyph vector feature model, and then added to the glyph vector index library to achieve the expansion of the glyph vector index library.

[0103] The following is a detailed description of the word recognition process using a specific embodiment:

[0104] When building the glyph vector model, "天" is used as a sample word, and "大" belongs to the words in the preset word set. "天" and "大" as well as other words in the preset word set are converted into images. After image alignment and binarization, the word image of "天" is obtained as shown in the figure. Figure 13 As shown, the “large” text image is Figure 14 As shown, other characters in the preset character set are not listed here one by one.

[0105] Figure 13 and Figure 14The number of 0s in the matrix intersection is divided by Figure 13 and Figure 14 the number of 0s in the matrix union of, and the calculated Figure 13 and Figure 14 The Jaccard similarity between and is 96%. Therefore, "big" can be used as a positive sample, and the Jaccard similarity between the text image of "day" and the text images of other texts in the preset text set is calculated in turn. Those greater than 0.6 are used as positive samples, and those less than 0.4 are used as negative samples to construct a training sample set.

[0106] The VIT (Vision Transformer) model based on Transformer is used as the model to be trained, and the training sample set is used for training to obtain a glyph vector model.

[0107] The vector features of the texts in the preset text set output by the feature layer of the glyph vector model are obtained to construct a glyph vector index library.

[0108] When querying whether there are confusing brand names for the target brand "day" on the e-commerce platform, the target brand name is used as the target word, and the queried confusing words are used as the confusing brand names.

[0109] The target character - "day" in the target brand name is obtained, and the character "day" is input into the glyph vector index library. The glyph vector index library automatically obtains the vector features of "day", calculates the cosine similarity between its vector features and other text vector features and sorts them. When the preset ranking is set to 4, the glyph vector index library outputs the top four texts with the highest cosine similarity as the similar characters of "day", such as "yao", "fu", "big", "wu".

[0110] "Yao", "fu", "big", and "wu" are respectively used as the confusing brand names of the target brand name "day", and the products on the e-commerce platform are checked, verified and managed.

[0111] According to the technical solution of the embodiment of the present invention, by comparing the vector features between texts and obtaining the feature similarity between the vector features of texts, the features of text glyphs can be more accurately obtained based on the visual representation of text glyphs, so as to more accurately obtain the similar characters of the target text, avoiding the problem that the coverage type of similar characters recognized according to the pinyin and strokes of text is small, solving the problem of poor similarity recognition effect by pinyin and strokes, enhancing the calculation accuracy of similarity, and thus being able to accurately identify confusing words. At the same time, through the pre-constructed glyph vector index library, the vector features of the target text can be obtained in a short time, and the similar characters of the target text can be determined, without the need to go through model calculation every time confusing words are recognized, reducing the calculation cost and simplifying the process.

[0112] By obtaining similar characters of the target text, confusing words can be obtained, avoiding the problem of low recognition quality caused by the inability to recognize confusing words formed by replacing the target characters in the target word with similar characters through language embedding or word extraction, and improving the recognition breadth and accuracy of confusing words.

[0113] The method of using the trained glyph vector model is adopted to automatically obtain the vector features of the characters in the preset character set, and when the vector features of the target character do not exist in the glyph vector index library, the vector features of the above target character can be automatically obtained through the glyph vector model and added to the glyph vector index library. The automated method for obtaining character vector features avoids large-scale manual annotation, saves labor costs, and at the same time realizes the automatic expansion of the glyph vector index library.

[0114] Figure 15 It is a schematic diagram of the main modules of the similarity-based word recognition device according to an embodiment of the present invention.

[0115] Such as Figure 15 shown, the similarity-based word recognition device 1500 according to an embodiment of the present invention includes:

[0116] A first acquisition module 1501, configured to acquire the target characters of the target word;

[0117] A second acquisition module 1502, configured to acquire the vector features of the above target characters based on the glyph vector index library;

[0118] A retrieval module 1503, configured to perform feature similarity retrieval using the above glyph vector index library based on the vector features of the above target characters to obtain similar characters of the above target characters;

[0119] A third acquisition module 1504, configured to obtain confusing words of the above target word according to the above similar characters.

[0120] In an optional embodiment of the present invention, the above device further includes: a glyph vector index library construction module, configured to obtain the vector features of each character in the preset character set through the glyph vector model and construct a glyph vector index library.

[0121] In an alternative embodiment of the present invention, the above-mentioned glyph vector index library construction module further includes: a glyph vector model acquisition sub-module, configured to convert the sample text and the text in the above-mentioned preset text set into text images; calculate the image similarity between the text image of the sample text and the text images of the texts in the above-mentioned preset text set respectively; use the texts corresponding to the text images with the image similarity greater than the first preset image similarity threshold as positive samples, and use the texts corresponding to the text images with the image similarity less than the second preset image similarity threshold as negative samples to construct a training sample set; use the above-mentioned training sample set to train the model to be trained to obtain a glyph vector model.

[0122] In an alternative embodiment of the present invention, the above-mentioned conversion of the sample text and the text in the above-mentioned preset text set into text images includes: converting the sample text and the text in the above-mentioned preset text set into images; performing image alignment processing on the above-mentioned images so that the images of the sample text and the texts in the above-mentioned preset text set have the same size; performing binarization processing on the images after the image alignment processing is completed to generate text images.

[0123] In an alternative embodiment of the present invention, the above-mentioned retrieval module 1503 is further configured to: use the above-mentioned glyph vector index library based on the vector feature of the target text to obtain the cosine similarity between the vector feature of the target text and the vector features of the texts in the above-mentioned glyph vector index library; based on the cosine similarity, obtain the similar characters of the target text.

[0124] In an alternative embodiment of the present invention, the above-mentioned obtaining the similar characters of the target text based on the cosine similarity further includes: sorting the cosine similarities between the vector feature of the target text and the vector features of the texts in the above-mentioned glyph vector index library, and using the texts before the preset ranking as the similar characters of the target text.

[0125] In an alternative embodiment of the present invention, the above-mentioned device further includes: an index library expansion module, configured to, when the vector feature of the target text is not in the above-mentioned glyph vector index library, use the above-mentioned glyph vector model to obtain the vector feature of the target text and add it to the above-mentioned glyph vector index library.

[0126] According to the technical solution of the embodiment of the present invention, by comparing the vector features between texts and obtaining the feature similarity between the vector features of texts, the features of text glyphs can be obtained more accurately based on the visual representation of text glyphs, so as to obtain similar characters of the target text more precisely, avoiding the problem of less coverage types of similar characters recognized according to the pinyin strokes of texts. Therefore, easily confused words can be recognized with high accuracy. At the same time, through the glyph vector index library, the vector features of the target text can be obtained in a short time, and the similar characters of the target text can be determined, without the need for model calculation every time when easily confused words are recognized, reducing the calculation cost and simplifying the process.

[0127] Figure 16 FIG. 1600 shows an exemplary system architecture to which the similarity-based word recognition method or the similarity-based word recognition device according to the embodiments of the present invention can be applied.

[0128] As Figure 16 shown, the system architecture 1600 may include terminal devices 1601, 1602, 1603, a network 1604, and a server 1605. The network 1604 is used to provide a medium for communication links between the terminal devices 1601, 1602, 1603 and the server 1605. The network 1604 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.

[0129] Users can use the terminal devices 1601, 1602, 1603 to interact with the server 1605 through the network 1604 to receive or send data, etc. Various communication client applications may be installed on the terminal devices 1601, 1602, 1603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0130] The terminal devices 1601, 1602, 1603 may be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, and desktop computers, etc.

[0131] The server 1605 may be a server providing various services, such as a background management server that provides the function of obtaining easily confused words for the target words sent by users using the terminal devices 1601, 1602, 1603. The background management server may perform retrieval analysis and other processing on the target characters of the obtained target words, and feedback the processing results (such as easily confused words) to the terminal devices.

[0132] It should be noted that the similarity-based word recognition method provided by the embodiments of the present invention is generally executed by the server 1605. Correspondingly, the similarity-based word recognition device is generally set in the server 1605.

[0133] It should be understood that Figure 16 the numbers of the terminal devices, networks, and servers in [[ ]] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, networks, and servers.

[0134] Reference is made below to [[ ]] Figure 17 which shows a schematic structural diagram of a computer system 1700 of a terminal device suitable for implementing the embodiments of the present invention. Figure 17 The terminal device shown is merely an example and should not impose any limitation on the functions and scope of use of the embodiments of the present invention.

[0135] As [[ ]] Figure 17 shown, the computer system 1700 includes a central processing unit (CPU) 1701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1702 or the program loaded from the storage section 1708 into the random access memory (RAM) 1703. In the RAM 1703, various programs and data required for the operation of the system 1700 are also stored. The CPU 1701, ROM 1702, and RAM 1703 are connected to each other via a bus 1704. The input / output (I / O) first interface 1705 is also connected to the bus 1704.

[0136] The following components are connected to the I / O first interface 1705: an input section 1706 including a keyboard, a mouse, etc.; an output section 1707 including such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 1708 including a hard disk, etc.; and a communication section 1709 including a network first interface card such as a LAN card, a modem, etc. The communication section 1709 performs communication processing via a network such as the Internet. A drive 1710 is also connected to the I / O first interface 1705 as required. A removable medium 1711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1710 as required so that a computer program read from it can be installed into the storage section 1708 as required.

[0137] Specifically, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from the network through the communication section 1709, and / or installed from the removable medium 1711. When the computer program is executed by the central processing unit (CPU) 1701, the above functions defined in the system of the present invention are executed.

[0138] It should be noted that the computer-readable medium shown in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, as well as the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0140] The modules involved in the embodiments of the present invention can be implemented in software or in hardware. The described modules can also be provided in a processor. For example, it can be described as: a processor includes a first acquisition module, a second acquisition module, a retrieval module, and a third acquisition module. Among them, the names of these modules do not constitute a limitation to the module itself in some cases. For example, the first acquisition module can also be described as "the module for acquiring the target text of the target word".

[0141] As another aspect, the present invention also provides a computer-readable medium, which can be included in the device described in the above embodiments; or can exist alone without being assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: acquiring the target text of the target word; acquiring the vector feature of the above target text based on the glyph vector index library; performing feature similarity retrieval using the above glyph vector index library based on the vector feature of the above target text to acquire similar characters of the above target text; and acquiring the confusing words of the above target word according to the above similar characters.

[0142] According to the technical solution of the embodiments of the present invention, by comparing the vector features between characters and acquiring the feature similarity between the vector features of the characters, the features of the character glyphs can be more accurately acquired based on the visual representation of the character glyphs, so as to more precisely acquire the similar characters of the target text, avoiding the problem of less coverage types of similar characters recognized according to the pinyin and strokes of the characters. Therefore, confusing words can be recognized with high precision. At the same time, the vector feature of the target text can be acquired within a short time through the glyph vector index library, and the similar characters of the target text can be determined, without the need for model calculation every time confusing words are recognized, reducing the calculation cost and simplifying the process.

[0143] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for word recognition based on similarity, characterized in that, it includes: Obtain the target text of the target word; Obtain the vector feature of the target text based on the glyph vector index library; wherein, the vector features of each text in the preset text set are included in the glyph vector index library; Perform feature similarity retrieval using the glyph vector index library based on the vector feature of the target text to obtain similar characters of the target text; Obtain the easily confused words of the target word according to the similar characters.

2. The method for word recognition based on similarity according to claim 1, characterized in that, The construction method of the glyph vector index library includes: Obtain the vector features of each text in the preset text set through the feature layer of the glyph vector model, and construct the glyph vector index library.

3. The method for word recognition based on similarity according to claim 2, characterized in that, The acquisition method of the glyph vector model includes: Convert the sample text and the text in the preset text set into text images; Calculate the image similarity between the text image of the sample text and the text images of the texts in the preset text set respectively; Use the texts corresponding to the text images with the image similarity greater than the first preset image similarity threshold as positive samples, and use the texts corresponding to the text images with the image similarity less than the second preset image similarity threshold as negative samples to construct a training sample set; Train the model to be trained using the training sample set to obtain the glyph vector model.

4. The method for word recognition based on similarity according to claim 3, characterized in that, The conversion of the sample text and the text in the preset text set into text images includes: Convert the sample text and the text in the preset text set into images; Perform image alignment processing on the images so that the images of the sample text and the texts in the preset text set all have the same size; Perform binarization processing on the images after the image alignment processing is completed to generate text images.

5. The method for word recognition based on similarity according to claim 1, characterized in that, The performing feature similarity retrieval using the glyph vector index library based on the vector feature of the target text to obtain similar characters of the target text includes: Obtain the cosine similarity between the vector feature of the target text and the vector features of the texts in the glyph vector index library using the glyph vector index library based on the vector feature of the target text; Obtain the similar characters of the target text based on the cosine similarity.

6. The method for word recognition based on similarity according to claim 5, characterized in that, The obtaining of the similar characters of the target text based on the cosine similarity further includes: Sort the cosine similarity between the vector feature of the target text and the vector features of the texts in the glyph vector index library, and use the texts before the preset ranking as the similar characters of the target text.

7. The method for word recognition based on similarity according to claim 2, characterized in that, The method further includes: When the vector feature of the target character is not in the glyph vector index library, the glyph vector model is used to obtain the vector feature of the target character and add it to the glyph vector index library.

8. A similarity-based word recognition device, characterized in that it includes: A first acquisition module for acquiring the target character of the target word; A second acquisition module for acquiring the vector feature of the target character based on the glyph vector index library; wherein, the glyph vector index library includes the vector features of each character in the preset character set; A retrieval module for performing feature similarity retrieval using the glyph vector index library based on the vector feature of the target character to obtain similar characters of the target character; A third acquisition module for obtaining the confusing words of the target word according to the similar characters.

9. An electronic device for similarity-based word recognition, characterized in that it includes: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-7.

10. A computer-readable medium having a computer program stored thereon, characterized in that when the program is executed by a processor, the method according to any one of claims 1-7 is implemented.