Character recognition method, device, electronic device and storage medium

By obtaining and processing the target characters of the input characters, and using similarity models and database queries, the problem in the existing technology of being unable to identify the abbreviations and aliases of colleges or disciplines is solved, and accurate determination and flexible identification of colleges and disciplines are achieved.

CN114372460BActive Publication Date: 2024-10-25BEIJING KINGSOFT DIGITAL ENTERTAINMENT CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111493645.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2024-10-25
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

Existing character discrimination methods cannot accurately identify abbreviations, aliases or typos of colleges or disciplines, resulting in the inability to determine whether they are key disciplines and lack of flexibility and accuracy.

Method used

By obtaining the input characters, determine their corresponding target characters, and use the pre-trained similarity model and database query to determine whether the subject is in the key subject list. If not, determine the candidate characters through similarity calculation, and add or delete characters to match Standard name, and then generate the discrimination results.

Benefits of technology

It achieves accurate identification and determination of institutions and disciplines, and is suitable for abbreviations, aliases and standard names of institutions or disciplines, improving the flexibility and accuracy of the method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114372460B_ABST
    Figure CN114372460B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a character discrimination method, device, electronic device and storage medium, the method comprising: obtaining input characters, the input characters comprising a first character and a second character, wherein the first character may be a school, and the second character may be a subject, first determining a target character corresponding to the first character, and if the second character is in a target list corresponding to the target character, generating a discrimination result corresponding to the second character, the discrimination result may be that the subject is a key subject in the school. The method provided by the present disclosure can accurately identify the school and subject represented by the input characters, and judge the subject, that is, it can accurately judge whether the input subject is a key subject of the input school, and when the input characters are the abbreviation or alias of the school or subject, the school or subject can also be accurately identified, the method is relatively flexible and easy to implement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a character recognition method, device, electronic device and storage medium. Background Art

[0002] Currently, users can input colleges and disciplines, and use character recognition methods to determine whether the discipline is a key discipline of the input college. Most of the related character recognition methods use knowledge base vocabulary to judge the input characters by comparing the input characters with the characters in the knowledge base vocabulary.

[0003] However, if the input characters do not exist in the knowledge base vocabulary, the characters cannot be accurately judged and it is not flexible. At the same time, the fixed knowledge base vocabulary can only process standard school or subject major names. When the input characters are the abbreviations, aliases or other related names of schools or subjects, the relevant character judgment methods are not applicable, and the input characters cannot be accurately identified, so they cannot be judged. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a character recognition method, device, electronic device and storage medium, which can accurately recognize input characters and make judgments on the input characters.

[0005] In a first aspect, an embodiment of the present disclosure provides a character recognition method, comprising:

[0006] Get input characters, where the input characters include a first character and a second character;

[0007] Determine a target character corresponding to the first character;

[0008] If the second character is in the target list corresponding to the target character, a determination result corresponding to the second character is generated.

[0009] Optionally, determining a target character corresponding to the first character includes:

[0010] If the number of characters of the first character and the number of characters of the second character are both greater than a first preset threshold, determining whether the first character is in a first preset database; if so, determining a target character corresponding to the first character in the first preset database;

[0011] If not, at least one candidate character is determined in the first preset database, and the target character is determined from the at least one candidate character.

[0012] Optionally, determining at least one candidate character in the first preset database, and determining the target character from the at least one candidate character, includes:

[0013] Determining, in a first preset database, at least one candidate character corresponding to the first character according to a rule of adding a first preset number of characters to the first character;

[0014] Calculating a difference between the number of characters of the first character and the number of characters of at least one candidate character;

[0015] Calculating the similarity between at least one candidate character and the first character using a pre-trained similarity model;

[0016] A target character is determined from at least one candidate character according to the similarity and the difference.

[0017] Optionally, determining at least one candidate character in the first preset database, and determining the target character from the at least one candidate character, includes:

[0018] In the first preset database, at least one candidate character corresponding to the first character is determined according to a rule of deleting a second preset number of characters from the first character.

[0019] Optionally, if the second character is in the target list corresponding to the target character, generating a discrimination result corresponding to the second character includes:

[0020] If the target character is in the second preset database, obtaining a target list corresponding to the target character from the second preset database;

[0021] Determine whether the second character is in the target list; if so, generate a determination result corresponding to the second character.

[0022] Optionally, the method further includes:

[0023] If the second character is not in the target list, then calculating the similarity between the second character and each name in the target list to obtain a similarity score corresponding to each name in the target list;

[0024] If any similarity score is greater than a second preset threshold, it is determined that the second character is in the target list, and a determination result corresponding to the second character is generated.

[0025] Optionally, calculating the similarity between the second character and the characters in the target list to obtain a similarity score corresponding to each name in the target list includes:

[0026] Calculating similarity based on the second character and each name in the target list by using a pre-trained corpus similarity model to obtain a first similarity score corresponding to each name in the target list;

[0027] Calculating similarity based on the second character and each name in the target list by using a pre-trained semantic similarity model to obtain a second similarity score corresponding to each name in the target list;

[0028] Calculating similarity based on the second character and each name in the target list using a pre-trained text similarity model to obtain a third similarity score corresponding to each name in the target list;

[0029] A similarity score corresponding to each name in the target list is obtained according to the first similarity score, the second similarity score and the third similarity score.

[0030] Optionally, the method further includes:

[0031] Obtain a first training sample, the first training sample including a character sample of a first-level subject and a character sample of a second-level subject corresponding to the first-level subject, the character sample of the first-level subject and the character sample of the second-level subject having the same label;

[0032] The constructed semantic similarity model is trained according to the first training sample.

[0033] In a second aspect, an embodiment of the present disclosure provides a character recognition device, comprising:

[0034] An acquisition unit, used for acquiring input characters, where the input characters include a first character and a second character;

[0035] A determination unit, used to determine a target character corresponding to the first character;

[0036] The generating unit is used for generating a discrimination result corresponding to the second character if the second character is in the target list corresponding to the target character.

[0037] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0038] Memory;

[0039] Processor; and

[0040] Computer programs;

[0041] The computer program is stored in the memory and is configured to be executed by the processor to implement the character recognition method as described above.

[0042] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the character recognition method as described above are implemented.

[0043] The embodiment of the present disclosure provides a character discrimination method, device, electronic device and storage medium, the method comprising: obtaining input characters, the input characters comprising a first character and a second character, wherein the first character may be a school name, and the second character may be a subject name, first determining the target character corresponding to the first character, that is, identifying the input school name, the input school name may be the abbreviation or alias of the standard name of the school, thereby determining the target character corresponding to the school, the target character may be the standard name of the school, if the second character is in the target list corresponding to the target character, that is, if the subject is in the key subject list corresponding to the school, then generating a discrimination result corresponding to the second character, the judgment result may be a judgment result that the subject is a key subject in the school. The method provided by the present disclosure can accurately identify the school and subject represented by the input characters, and judge the subject, that is, it can accurately judge whether the input subject is a key subject of the input school, when the input character is the abbreviation or alias of the school or subject, it can also accurately identify the school or subject, the method is relatively flexible and easy to implement. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0046] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;

[0047] Figure 2 A flowchart of a character recognition method provided by an embodiment of the present disclosure;

[0048] Figure 3 A flowchart of a character recognition method provided by an embodiment of the present disclosure;

[0049] Figure 4 A flowchart of a character recognition method provided by an embodiment of the present disclosure;

[0050] Figure 5 A flowchart of a character recognition method provided by an embodiment of the present disclosure;

[0051] Figure 6 A structural schematic diagram of a character recognition device provided by an embodiment of the present disclosure;

[0052] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0053] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0054] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0055] Specifically, currently users can input institutions and disciplines, and the character recognition method can be used to automatically determine whether the discipline is a key discipline of the input institution. The relevant character recognition methods are mostly performed using a knowledge base vocabulary, and the input characters are judged by comparing the input characters with the characters in the knowledge base vocabulary. That is, under normal circumstances, in the relevant character recognition methods, it is necessary to input relatively standard disciplines and institution names to accurately determine whether the discipline is a key discipline of the input institution, and there are many application restrictions. However, for the names of disciplines or institutions that do not exist in the knowledge base vocabulary, it is impossible to accurately determine. For example, when the input characters are the abbreviations, aliases, or names with typos of institutions or disciplines, the relevant character recognition methods are not applicable, and the disciplines or institutions cannot be accurately identified, and thus cannot be judged.

[0056] In view of the above technical problems, the disclosed embodiment provides a character discrimination method, obtains input characters, the input characters include a first character and a second character, and takes the discrimination of key disciplines of a college as an example, the first character can be the name of the college, and the second character can be the name of the discipline, firstly identifies the name of the college, that is, determines the target character corresponding to the first character, after determining the college, obtains the key discipline list pre-established by the college, that is, the target list corresponding to the target character, identifies the second character, and determines whether the second character is in the key discipline list, if so, it can be determined that the discipline represented by the second character is the key discipline of the college represented by the first character, if not, it is determined that the discipline represented by the second character is not the key discipline of the college represented by the first character, and can accurately identify the college and discipline represented by the input characters, and judge the discipline, that is, it can accurately judge whether the input discipline is the key discipline of the input college, when the input character is the abbreviation or alias of the college or discipline, it can also accurately identify the college or discipline, the method is relatively flexible and easy to implement. Specifically, the character discrimination method is described in detail through one or more of the following embodiments.

[0057] Specifically, the character recognition method can be executed by a terminal or a server. Figure 1 , Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present disclosure. The terminal 11 or the server 12 can obtain input characters and make judgments on the input characters.

[0058] Exemplarily, in one application scenario, the server 12 obtains input characters, the input characters include a first character and a second character, and then determines a target character corresponding to the first character. The terminal 11 obtains the target character and the input character from the server 12, and determines the second character in the input characters according to the target character, and generates a determination result. In another application scenario, the server 12 obtains input characters, the input characters include a first character and a second character, and determines a target character corresponding to the first character, and then determines the second character according to the target character, and generates a determination result. In yet another application scenario, the terminal 11 obtains input characters, the input characters include a first character and a second character, and determines a target character corresponding to the first character, and then determines the second character according to the target character, and generates a determination result.

[0059] It is understandable that the character determination method provided by the embodiments of the present disclosure is not limited to the several possible scenarios described above.

[0060] The character recognition method provided by the present disclosure is described below by taking the terminal 11 as an example. It is understandable that the character recognition method is also applicable to the application scenario of the server 12.

[0061] Figure 2 A flow chart of a character recognition method provided by an embodiment of the present disclosure, which is applied to a terminal, specifically includes the following steps: Figure 2 The following steps S210 to S230 are shown:

[0062] S210: Acquire input characters, where the input characters include a first character and a second character.

[0063] It is understandable that the terminal obtains characters input by the user, and the input characters include a first character and a second character. Taking the determination of whether a subject is a key subject in a college as an example, the first character may be a character related to the college, and specifically may be the abbreviation, full name or alias of the standard college name. For example, the standard college name may be Peking University, and the first character may be Peking University or Peking University, where Peking University is the abbreviation of Peking University; the second character may be a character related to the subject, and specifically may be the abbreviation, full name or alias of the standard subject (major) name in the standard college name. For example, the standard subject name is Computer Science and Technology Major, and the second character may be Computer Major, where Computer Major is the abbreviation or alias of Computer Science and Technology Major. It is understandable that the first character and the second character may be characters that have an inclusion relationship, for example, the first character may also be a company name, and the second character may be the name of the company's key project. The specific determination category and scope of the first character and the second character are not limited.

[0064] S220: Determine a target character corresponding to the first character.

[0065] Optionally, determining the target character corresponding to the first character specifically includes: if the number of characters of the first character and the number of characters of the second character are both greater than a first preset threshold, determining whether the first character is in a first preset database; if so, determining the target character corresponding to the first character in the first preset database; if not, determining at least one candidate character in the first preset database, and determining the target character among the at least one candidate character.

[0066] It can be understood that, based on the above S210, after the terminal obtains the first character and the second character input by the user, the terminal can respectively calculate the number of characters included in the first character and the second character. If the first character and the second character input are English names, the number of letters is counted; if the first character and the second character input are Chinese names, the number of words is counted, and it is determined whether the number of characters of the first character and the second character is less than or equal to the first preset threshold; wherein the first preset threshold can be 1, and the first preset threshold can be set according to the scenario in which the character determination method is applied, and is not limited here. For example, the first character entered is "Peking University" and the number of characters is 2, and the second character entered is "Computer Science" and the number of characters is 3, both of which are greater than the first preset threshold value 1. Then the input characters are judged, and it can be further judged whether the first character is in the first preset database. The first preset database can be a pre-established database including a large number of standard school names, that is, it is pre-judged whether the first character entered by the user is the full name or the abbreviation of the standard school name; if the first character is in the first preset database, it means that the first character entered by the user is the full name, and the full name refers to the school name corresponding to the first character in the first preset database. For example, Peking University is stored in the first preset database, and the first character entered is also Peking University, then it means that the first character is in the first preset database, and then the target character corresponding to the first character is determined in the first preset database, and the target character is the standard school name Peking University; if the first character is in the first preset database, it means that the first character is in the first preset database. If a character is not in the first preset database, it means that the first character input by the user may be the abbreviation or alias of a standard school name, that is, there is no standard school name corresponding to the first character in the first preset database. Then, at least one candidate character can be determined in the first preset database based on the first character. The candidate character refers to a school name similar to the first character among a large number of standard school names stored in the first preset database. The number of candidate characters can be pre-set to multiple, and 3 candidate characters similar to the first character can be selected in the first preset database, and the target character can be determined from at least one candidate character. For example, if the first character is Peking University, Peking University, Beijing University of Science and Technology, and Beijing University of Aeronautics and Astronautics can be selected in the first preset database as candidate characters for the first character, and then Peking University can be determined as the target character corresponding to the first character from the above 3 candidate characters. The specific determination method will be shown later.

[0067] It can be understood that if any of the number of characters of the first character and the number of characters of the second character is less than or equal to the first preset threshold, the judgment is terminated, that is, a judgment result can be generated that the input subject (second character) is not a key subject of the input institution (first character).

[0068] S230: If the second character is in the target list corresponding to the target character, generate a determination result corresponding to the second character.

[0069] It can be understood that on the basis of the above S220, after the terminal determines the target character corresponding to the first character, it obtains the target list corresponding to the target character. The target list can be a list of key disciplines in various colleges and universities, and the target list includes the names of each key discipline. Then, it is determined whether the second character is in the target list, that is, it is determined whether the discipline represented by the second character is the key discipline of the college represented by the first character. If so, a judgment result about the second character is generated, and the judgment result can be a positive result, that is, the discipline represented by the second character (input discipline) is the key discipline of the college represented by the first character (input college); if not, a negative judgment result about the second character is generated, that is, the discipline represented by the second character is not the key discipline of the college represented by the first character.

[0070] A character discrimination method provided by an embodiment of the present disclosure obtains input characters, the input characters include a first character and a second character, wherein the first character may be a school name, and the second character may be a subject name, firstly determines the target character corresponding to the first character, that is, determines the standard school name corresponding to the first character, and if the second character is in the target list corresponding to the target character, then generates a discrimination result corresponding to the second character, and the judgment result may be that the subject is a key subject in the school. The method provided by the present disclosure can accurately identify the school and subject represented by the input characters, and judge the subject, that is, it can accurately judge whether the input subject is a key subject of the input school, and when the input character is the abbreviation or alias of the school or subject, it can also accurately identify the school or subject, and the method is relatively flexible and easy to implement.

[0071] Based on the above embodiments, Figure 3 A flow chart of a character recognition method provided by an embodiment of the present disclosure, optionally, determining at least one candidate character in a first preset database, and determining a target character from the at least one candidate character, specifically including: Figure 3 The following steps S2201 to S2204 are shown:

[0072] S2201. Determine, in a first preset database, at least one candidate character corresponding to a first character according to a rule of adding a first preset number of characters to a first character.

[0073] It is understandable that if the terminal determines that the first character is not in the first preset database, that is, the first character entered is not the full name of the institution, then according to the rule of adding a first preset number of characters to the first character, at least one candidate character is selected from the first preset database. The first preset number refers to the maximum number of characters that can be added. The first preset number can be 6, that is, a maximum of 6 characters can be added on the basis of the first character. For example, the first character entered is Peking University, and up to 6 characters can be added on the basis of the first character, that is, a maximum of 6 characters can be added at will, and candidate characters similar to the first character after the characters are added are recalled from the first preset database. Peking University with 2 characters added, Beijing University of Science and Technology with 4 characters added, and Beijing University of Aeronautics and Astronautics with 6 characters added can be recalled as candidate characters corresponding to the first character.

[0074] S2202: Calculate the difference between the number of characters of the first character and the number of characters of at least one candidate character.

[0075] It can be understood that on the basis of the above S2201, the difference between the number of characters of the first character and the number of characters of each determined candidate character is calculated. For example, the number of characters of the first character Peking University is 2, and the number of characters of the candidate character Peking University is 4, and the difference between the two is 2; for example, the number of characters of the candidate character Beijing University of Science and Technology is 6, and the difference between the first character and the first character is 4, and the difference is the number of characters added on the basis of the first character. The calculation method of other candidate characters is the same as above and will not be repeated here.

[0076] S2203: Calculate the similarity between at least one candidate character and the first character using a pre-trained similarity model.

[0077] It is understandable that, based on the above S2201, before determining the characters, the terminal can obtain a large number of abbreviations, aliases or full names corresponding to the colleges and universities as samples, train and construct a similarity model, and the constructed similarity model can be based on a neural network. The similarity model can specifically include a corpus similarity model, a semantic similarity model and a text similarity model. After the similarity model training is completed, each candidate character and the first character of the at least one candidate character determined are input into the similarity model, and the similarity between each candidate character and the first character is calculated.

[0078] S2204: Determine a target character from at least one candidate character according to the similarity and the difference.

[0079] It is understandable that, based on the above S2202 and S2203, according to the similarity between each candidate character and the first character and the difference between the characters between the candidate character and the first character, the final similarity of the candidate character is determined by the method of weighted summation. It is understandable that during the training of the similarity model, the association relationship between the abbreviated name of the institution and the full name or alternative name is increased. For example, the association between Peking University and Beijing University is increased, so that the similarity of Peking University in the candidate characters output by the similarity model is relatively high; the method of weighted summation can be to respectively assign a weight to the similarity and the difference, and the weight of the similarity can be higher than the weight of the difference. For example, there may be a situation where the similarity of any candidate character in the candidate characters is the highest, but the corresponding difference is not the smallest. In this case, based on the method of weighted summation, the candidate character with the highest similarity can be determined as the target character of the first character, which can further improve the accuracy of the recognition result. Subsequently, the candidate characters are sorted according to the final similarity of each candidate character, and the maximum final similarity is determined as the target similarity, and the candidate character corresponding to the target similarity is used as the target character corresponding to the first character, that is, the character most similar to the first character is used as the target character. For example, the similarity model identifies that the similarity of Peking University among the candidate characters is the highest, and the difference between the characters between Peking University and Beijing University is the smallest, so that the final similarity of the candidate character Peking University calculated by the method of weighted summation is the maximum of the similarities corresponding to the three candidate characters. Subsequently, Peking University can be used as the standard institution name most similar to Beijing University, and the candidate character Peking University can be determined as the target character of the first character Beijing University.

[0080] Optionally, determining the target character among at least one candidate character specifically further includes: in the first preset database, determining at least one candidate character corresponding to the first character according to the rule of deleting the second preset number of characters from the first character.

[0081] It is understandable that the target character can also be determined in the following manner: in the first preset database, according to the rule of deleting the second preset number of characters from the first character, at least one candidate character corresponding to the first character is determined, wherein the number of characters of the first character is greater than the second preset number, for example, the second preset number can be 2, and the number of the first character is greater than 2, and at most 2 characters can be deleted from the first character, that is, 2 characters can be deleted from the first character, or 1 character can be deleted from the first character. After the deletion operation is performed on the first character, at least one candidate character corresponding to the deleted first character is recalled in the first preset database, or 3 candidate characters can be recalled in the first preset database, and then the target character corresponding to the first character is determined from the 3 candidate characters. For example, the first character is Sichuan University of Electronic Science and Technology, and Sichuan is the name of the location or region of the university. In this case, Sichuan can be deleted according to the deletion rule (such as deleting the place name in the first character) to obtain the deleted first character Electronic University, and then the candidate characters matching the Electronic University are determined in the first preset database, and the candidate characters will include the University of Electronic Science and Technology of China in Sichuan.

[0082] It is understandable that the above method for determining the target character corresponding to the first character can also be called a school entity linking method, and the school entity linking is used to link the school name input by the user with the standard school name included in the first preset database, so as to determine the standard school name corresponding to the first character. Among them, entity linking specifically maps a string to a corresponding entity in the standard knowledge base.

[0083] The disclosed embodiment provides a character determination method. In the case where the first character is not in the first preset database, that is, the input school may be the abbreviation or alias of the standard school name (full name), at this time, the standard school name corresponding to the first character can be recalled by adding a first preset number of characters or deleting a second preset number of characters on the basis of the first character in the first preset space to determine at least one candidate character corresponding to the first character, and then the similarity between each candidate character and the first character is calculated based on the first character and each candidate character, and the candidate character corresponding to the maximum similarity among the candidate characters is used as the target character corresponding to the first character. When the input character is the abbreviation or alias of the input school, the standard school name corresponding to the input school can also be accurately identified, thereby completing the subsequent determination of key disciplines. The method is relatively flexible and easy to implement.

[0084] Based on the above embodiments, Figure 4 A flow chart of a character recognition method provided by an embodiment of the present disclosure, optionally, if the second character is in the target list corresponding to the target character, a recognition result corresponding to the second character is generated, specifically including the following: Figure 4The following steps S2301 to S2302 are shown:

[0085] S2301: If the target character is in the second preset database, obtain a target list corresponding to the target character from the second preset database.

[0086] It is understandable that if the target character is in the second preset database, that is, the target character has a key subject, then the target list corresponding to the target character is obtained from the second preset database, and the target list is the key subject list of the college represented by the target character. Among them, the first preset database can be understood as a database mainly about colleges and universities, excluding the subjects corresponding to the colleges and universities, and the second preset database can be understood as a database about subjects. Each college will correspond to one or more key subjects, and the college can be understood as the identification of each key subject. For example, there are 5 key subjects included in Peking University in the second preset database. It is understandable that the number of colleges and universities included in the second preset database will be less than or equal to the number of colleges and universities included in the first preset database, that is, there will be a situation where a certain college does not have a key subject.

[0087] S2302: Determine whether the second character is in the target list; if so, generate a determination result corresponding to the second character.

[0088] It can be understood that on the basis of the above S2301, after determining the target list corresponding to the target character in the second preset database, it is judged whether the input second character is in the target list, that is, whether the subject represented by the second character is a key subject. If so, a judgment result is generated that the second character is the key subject of the first character; if not, a judgment result is generated that the second character is not the key subject of the first character.

[0089] Optionally, the above S2302 specifically includes: if the second character is not in the target list, calculating the similarity between the second character and each name in the target list, and obtaining a similarity score corresponding to each name in the target list; if any similarity score is greater than a second preset threshold, determining that the second character is in the target list, and generating a judgment result corresponding to the second character.

[0090] It is understandable that if the second character is not in the target list, the situation may be that the input second character is the abbreviation of the standard subject name, or the second character may be the name of the subject corresponding to different stages of the same institution, etc. The similarity between the second character and all the characters included in the target list is calculated respectively to obtain the similarity score corresponding to each character in the target list, that is, the similarity score between each character in the target list and the second character is calculated. If the similarity score corresponding to any character in the target list is greater than the second preset threshold, it is determined that the second character is in the target list, indicating that the second character is a key subject. At this time, a judgment result corresponding to the second character is generated, and the judgment result is that the second character is a key subject.

[0091] Optionally, the above-mentioned calculation of the similarity between the second character and each name in the target list to obtain a similarity score corresponding to each name in the target list specifically includes: calculating the similarity based on the second character and the characters in the target list by using a pre-trained corpus similarity model to obtain a first similarity score corresponding to each name in the target list; calculating the similarity based on the second character and the characters in the target list by using a pre-trained semantic similarity model to obtain a second similarity score corresponding to each name in the target list; calculating the similarity based on the second character and the characters in the target list by using a pre-trained text similarity model to obtain a third similarity score corresponding to each name in the target list; obtaining the similarity score corresponding to each name in the target list based on the first similarity score, the second similarity score and the third similarity score.

[0092] It is understandable that if the second character is not in the target list, that is, the second character is not the standard key subject name stored in the second preset database, it may be the abbreviation or alias of the standard key subject name. In this case, the similarity between each subject name in the target list and the second character can be calculated respectively through the pre-trained corpus similarity model, semantic similarity model and text similarity model. The specific implementation method is as follows: the similarity between each subject name in the target list and the second character is calculated by the pre-trained corpus similarity model to obtain the first similarity score corresponding to each subject name in the target list. For example, the key subject list corresponding to the college includes 5 key subjects. The similarity between the 5 key subjects and the second character is calculated respectively through the corpus similarity model to obtain the first similarity score corresponding to each of the 5 key subjects. The corpus similarity model can specifically be a model obtained by multiple word vectors trained based on public corpus. The word vector (Word embedding) is to convert words into distributed representations, and the distributed representation is to represent words as a continuous dense vector of a fixed length. The corpus similarity model can be used to obtain the similarity between a large number of subject names involved in daily language (usually nicknames or abbreviations of a subject) and standard subject names. For example, the standard subject name of a subject is computer science and technology, and the usual name is computer. At this time, the trained corpus similarity model can establish a connection between computer subject and computer science and technology, and further determine that the standard subject name of computer subject is computer science and technology. The first similarity score between computer subject and computer science and technology subject calculated by the corpus similarity model is also relatively high.

[0093] Optionally, the method also includes: obtaining a first training sample, the first training sample including a character sample of a first-level subject and a character sample of a second-level subject corresponding to the first-level subject, the character sample of the first-level subject and the character sample of the second-level subject having the same label; and training the constructed semantic similarity model according to the first training sample.

[0094] It is understandable that the similarity between each subject name and the second character in the target list can also be calculated through a pre-trained semantic similarity model to obtain a second similarity score corresponding to each character in the target list; the semantic similarity model can specifically be a model obtained by training a pre-trained model (Bidirectional Encoder Representation from Transformers, BERT) according to manually annotated subject samples using a subject hierarchical training method, and can annotate the same labels for standard subjects and samples similar to standard subjects. Specifically, a first training sample is obtained, and the first training sample includes a character sample of a first-level subject and a character sample of a second-level subject corresponding to the first-level subject. The first-level subject can be understood as a subject corresponding to an undergraduate degree, and the second-level subject can be understood as a subject corresponding to a graduate degree. The character samples of the first-level subject and the character samples of the second-level subject have the same label, that is, the name of the target subject at the undergraduate stage and the name of the target subject at the graduate stage are marked with the same label, and then the constructed semantic similarity model is trained according to the first training sample, so that the semantic training model can accurately identify the names of different subjects at different stages of the same institution. After training, the semantic similarity model can calculate the similarity of different names of the same subject major at different stages in the same institution. For example, based on the same institution, the name of the subject (first-level subject) in the first stage is automation, which can be the undergraduate stage, and the name of the subject (second-level subject) in the second stage is control science and technology, which can be the graduate stage. During training, the semantic similarity model can establish an association between automation and control science and technology to solve the problem of different names of subjects at different stages of the same institution.

[0095] Understandably, the similarity between each subject name and the second character in the target list can also be calculated through a pre-trained text similarity model to obtain a third similarity score corresponding to each subject name in the target list; wherein, the text similarity model can be a model trained based on a statistical method (Term Frequency–Inverse Document Frequency, TF-IDF). TF-IDF is a weighted method used for information retrieval and data mining. TF is term frequency, and IDF is inverse document frequency. It can be used to evaluate the importance of a word to a file set or one of the files in a corpus. The importance of a word is determined based on the number of times the word appears in the file. The inverse text frequency index and term frequency (TF-IDF method) are introduced in the text similarity model, which can solve the problem of too high literal similarity in some disciplines. For example, for the subject of folklore, there may be a subject of ethnology that has a relatively high literal similarity with the subject of folklore. Ethnology and folklore may have only one character different, and the other characters are the same. In this case, in the process of training the text similarity model, the importance of folklore and ethnology can be increased, so that the trained text similarity model can accurately identify the subject names with too high literal similarity.

[0096] It can be understood that the first similarity score, the second similarity score and the third similarity score output by the above three similarity models are weighted averaged to obtain the similarity score corresponding to each subject name in the target list, that is, to accurately obtain the similarity score between each subject name and the second character in the target list. If the similarity score corresponding to any subject name in the target list is greater than the second preset threshold, it is determined that the second character is in the target list, that is, the second character is a key subject.

[0097] It can be understood that the corpus similarity model trained above can accurately identify the subject names involved in daily language, the semantic similarity model trained can accurately identify the subject names of the same institution at different stages, and the text similarity model trained can accurately identify subject names with too high literal similarity. The similarity model constructed from three different angles can recognize the standard names corresponding to the input institutions and subjects to the greatest extent, and the accuracy is relatively high. It can also accurately recognize input characters with typos, abbreviations, and aliases, and has strong feasibility.

[0098] A character discrimination method provided by an embodiment of the present disclosure determines whether a target character is in a second preset database, that is, determines whether there is a key subject in the college represented by the target character. If so, a target list corresponding to the target character is obtained from the second preset database, that is, a list of key subjects corresponding to the college is obtained. Subsequently, it is determined whether the subject represented by the second character is in the target list according to the target list. If so, a determination result is generated that the subject represented by the second character is a key subject of the college represented by the first character. The method can accurately identify the subject represented by the second character and accurately determine whether the subject is a key subject of the college. The method is easy to implement and relatively flexible.

[0099] Based on the above embodiments, Figure 5 A flow chart of a character recognition method provided in an embodiment of the present disclosure is used to illustrate the entire character recognition method, which specifically includes the following steps: Figure 5 Steps S510 to S593 shown:

[0100] S510: Obtain input characters, where the input characters include a first character and a second character.

[0101] It is understandable that the terminal obtains the first character and the second character input by the user. The following description takes the example that the first character is the name of the institution and the second character is the name of the subject.

[0102] S520: Determine whether the number of characters of the first character and the number of characters of the second character are less than or equal to a first preset threshold.

[0103] It can be understood that based on the above S510, it is determined whether the number of characters of the first character and the number of characters of the second character are less than or equal to the first preset threshold, that is, it is determined whether the number of characters of the input school name and subject name is less than or equal to the first preset threshold, where the first preset threshold can be 1; if so, execute S593; if not, execute S530.

[0104] S530: Determine whether the first character is in the first preset database.

[0105] It can be understood that, based on the above S520, if the number of the first character and the second character is greater than the first preset threshold, that is, the number of input characters is greater than 1, it is possible to continue to determine whether the first character is in the first preset database, that is, to determine whether the first character is a standard school name. The first preset database can be a pre-established database including standard school names; if so, execute S540; if not, execute S550.

[0106] S540: Determine a target character corresponding to the first character.

[0107] It can be understood that based on the above S530, if the first character is in the first preset database, the target character corresponding to the first character is determined, that is, the standard school name corresponding to the input school is determined. When the input school is an abbreviation or alias, the standard school name corresponding to the input school is identified and determined, which facilitates subsequent searches to determine the list of key disciplines included in the standard school name, and then executes S570.

[0108] S550: Determine at least one candidate character corresponding to the first character in a first preset database.

[0109] It can be understood that, based on the above S530, if the first character is not in the first preset database, at least one candidate character corresponding to the first character is determined from a large number of standard school names stored in the first preset database, and the candidate character refers to the name of a standard school that has a relatively high similarity to the input school, and then S560 is executed.

[0110] S560: Determine a target character from at least one candidate character.

[0111] It is understandable that, based on the above S550, the target character is determined from at least one candidate character determined above, that is, the standard school name of the input school is finally determined from at least one candidate character with relatively high similarity, and then S570 is executed.

[0112] S570: Determine a target list corresponding to the target character in the second preset database.

[0113] It can be understood that on the basis of the above S560, after determining the target character corresponding to the first character, the target list corresponding to the target character is determined in the second preset database, that is, the key subject list of the standard school name corresponding to the input school is queried and determined in the second preset database. The second preset database is also a pre-established database about key subjects, and then S580 is executed.

[0114] S580: Determine whether the second character is in the target list.

[0115] It can be understood that, based on the above S570, after determining the target list, it is determined whether the second character is in the target list, that is, whether the input subject is in the key subject list; if so, execute S590; if not, execute S591.

[0116] S590. The second character is the key subject of the first character.

[0117] It is understandable that, based on the above S580, if the input subject is in the key subject list, it can be directly determined that the second character is the key subject of the first character, that is, the input subject is the key subject of the input institution, and the determination process ends.

[0118] S591, calculating the similarity between the second character and each name in the target list.

[0119] It is understandable that, based on the above S580, if the input subject is not in the key subject list, it means that the input subject may be the abbreviation or alias of the standard subject name, then the similarity between the second character and each subject name in the target list is calculated, and then S592 is executed.

[0120] S592: Determine whether the similarity is greater than a second preset threshold.

[0121] It can be understood that, based on the above S591, it is determined whether the similarity between each character in the target list and the second character is greater than the second preset threshold; if so, S590 is executed, indicating that the similarity between the input subject and the key subject in the standard name is relatively high, and it may be the abbreviation or alias of the key subject; if not, S593 is executed.

[0122] S593. The subject corresponding to the second character is not a key subject of the institution corresponding to the first character.

[0123] It can be understood that when the input subject is not in the key subject list or the number of the first character and the second character is less than or equal to the first preset threshold, it means that the input subject is not a key subject of the input institution.

[0124] Figure 6 The character recognition device provided by the embodiment of the present disclosure can execute the processing flow provided by the character recognition method embodiment, such as Figure 6 As shown, the device 600 includes:

[0125] An acquiring unit 610 is used to acquire input characters, where the input characters include a first character and a second character;

[0126] A determination unit 620, configured to determine a target character corresponding to the first character;

[0127] The generating unit 630 is configured to generate a determination result corresponding to the second character if the second character is in the target list corresponding to the target character.

[0128] Optionally, the determining unit 620 determines the target character corresponding to the first character, specifically for:

[0129] If the number of characters of the first character and the number of characters of the second character are greater than a first preset threshold, determining whether the first character is in a first preset database; if so, determining a target character corresponding to the first character in the first preset database;

[0130] If not, at least one candidate character is determined in the first preset database, and the target character is determined from the at least one candidate character.

[0131] Optionally, the determining unit 620 determines at least one candidate character in the first preset database, and determines the target character from the at least one candidate character, specifically for:

[0132] Determining, in a first preset database, at least one candidate character corresponding to the first character according to a rule of adding a first preset number of characters to the first character;

[0133] Calculating a difference between the number of characters of the first character and the number of characters of at least one candidate character;

[0134] Calculating the similarity between at least one candidate character and the first character using a pre-trained similarity model;

[0135] A target character is determined from at least one candidate character according to the similarity and the difference.

[0136] Optionally, the determining unit 620 determines at least one candidate character in the first preset database, and determines the target character from the at least one candidate character, specifically for:

[0137] In the first preset database, at least one candidate character corresponding to the first character is determined according to a rule of deleting a second preset number of characters from the first character.

[0138] Optionally, if the second character is in the target list corresponding to the target character, the generating unit 630 generates a discrimination result corresponding to the second character, specifically for:

[0139] If the target character is in the second preset database, obtaining a target list corresponding to the target character from the second preset database;

[0140] Determine whether the second character is in the target list; if so, generate a determination result corresponding to the second character.

[0141] Optionally, the apparatus 600 further includes a computing unit, which is specifically configured to:

[0142] If the second character is not in the target list, calculating the similarity between the second character and each name in the target list to obtain a similarity score corresponding to each name in the target list;

[0143] If any similarity score is greater than a second preset threshold, it is determined that the second character is in the target list, and a determination result corresponding to the second character is generated.

[0144] Optionally, the calculation unit calculates the similarity between the second character and each name in the target list to obtain a similarity score corresponding to each name in the target list, which is specifically used for:

[0145] Calculating similarity based on the second character and the characters in the target list using a pre-trained corpus similarity model to obtain a first similarity score corresponding to each name in the target list;

[0146] Calculating similarity based on the second character and the characters in the target list using a pre-trained semantic similarity model to obtain a second similarity score corresponding to each name in the target list;

[0147] Calculating similarity based on the second character and the characters in the target list using a pre-trained text similarity model to obtain a third similarity score corresponding to each name in the target list;

[0148] A similarity score corresponding to each name in the target list is obtained according to the first similarity score, the second similarity score and the third similarity score.

[0149] Figure 6 The character recognition device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail here.

[0150] Figure 7 The electronic device provided in the embodiment of the present disclosure may be a server or a terminal as described above. The electronic device provided in the embodiment of the present disclosure may execute the processing flow provided in the above embodiment, such as Figure 7 As shown, the electronic device 700 includes: a processor 710, a communication interface 720 and a memory 730; wherein the computer program is stored in the memory 730 and is configured so that the processor 710 executes the above-mentioned character recognition method.

[0151] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the character recognition method described in the above embodiment.

[0152] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the character recognition method as described above is implemented.

[0153] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0154] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A character recognition method, characterized in that: The method comprises: Obtain input characters, where the input characters include a first character and a second character; Determine a target character corresponding to the first character; If the second character is in the target list corresponding to the target character, generating a discrimination result corresponding to the second character; The step of determining the target character corresponding to the first character includes: If the number of characters of the first character and the number of characters of the second character are both greater than a first preset threshold, and the first character is not in the first preset database, then in the first preset database, according to the rule of deleting a second preset number of characters from the first character, at least one candidate character corresponding to the first character is determined, and the target character is determined among the at least one candidate character.

2. The method according to claim 1, characterized in that: The determining a target character corresponding to the first character includes: If the number of characters of the first character and the number of characters of the second character are both greater than a first preset threshold, it is determined whether the first character is in a first preset database; if so, a target character corresponding to the first character is determined in the first preset database.

3. The method according to claim 2, characterized in that The step of determining at least one candidate character in the first preset database and determining a target character from the at least one candidate character comprises: In the first preset database, determining at least one candidate character corresponding to the first character according to a rule of adding a first preset number of characters to the first character; calculating a difference between the number of characters of the first character and the number of characters of the at least one candidate character; Calculating the similarity between the at least one candidate character and the first character by using a pre-trained similarity model; A target character is determined from the at least one candidate character according to the similarity and the difference.

4. The method according to claim 1, characterized in that: If the second character is in the target list corresponding to the target character, generating a determination result corresponding to the second character includes: If the target character is in the second preset database, obtaining a target list corresponding to the target character from the second preset database; Determine whether the second character is in the target list; if so, generate a determination result corresponding to the second character.

5. The method according to claim 4, characterized in that The method further comprises: If the second character is not in the target list, calculating the similarity between the second character and each name in the target list to obtain a similarity score corresponding to each name in the target list; If any of the similarity scores is greater than a second preset threshold, it is determined that the second character is in the target list, and a determination result corresponding to the second character is generated.

6. The method according to claim 5, characterized in that The calculating the similarity between the second character and each name in the target list to obtain a similarity score corresponding to each name in the target list includes: Calculating similarity based on the second character and each name in the target list by using a pre-trained corpus similarity model to obtain a first similarity score corresponding to each name in the target list; Calculating similarity based on the second character and each name in the target list using a pre-trained semantic similarity model to obtain a second similarity score corresponding to each name in the target list; Calculating similarity based on the second character and each name in the target list using a pre-trained text similarity model to obtain a third similarity score corresponding to each name in the target list; A similarity score corresponding to each name in the target list is obtained according to the first similarity score, the second similarity score and the third similarity score.

7. The method according to claim 6, characterized in that The method further comprises: Obtaining a first training sample, the first training sample comprising a character sample of a first-level subject and a character sample of a second-level subject corresponding to the first-level subject, the character sample of the first-level subject and the character sample of the second-level subject having the same label; The constructed semantic similarity model is trained according to the first training sample.

8. A character recognition device, characterized in that: The device comprises: An acquiring unit, used for acquiring input characters, wherein the input characters include a first character and a second character; A determination unit, configured to determine a target character corresponding to the first character; a generating unit, configured to generate a discrimination result corresponding to the second character if the second character is in a target list corresponding to the target character; Wherein, the determining unit is used for: If the number of characters of the first character and the number of characters of the second character are both greater than a first preset threshold, and the first character is not in the first preset database, then in the first preset database, according to the rule of deleting a second preset number of characters from the first character, at least one candidate character corresponding to the first character is determined, and the target character is determined among the at least one candidate character.

9. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the character recognition method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the character recognition method as claimed in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Method, client side and system for inputting handwriting characters and character strings

    CN103019590A

  • Character recognition model training method and character recognition method and device

    CN110610177A

  • Semantic matching method and device

    CN111898643A

  • Handwritten character recognition method and device, computer equipment and storage medium

    CN112215175A

  • Deep knowledge tracking method and system

    CN112818133A