Information conversion method and device, electronic equipment and readable storage medium
By dividing the name into two fields, last name and first name, and matching it with the database, each of them determines the respective alternative pinyin and their scores, the problem of low accuracy in name conversion in the prior art is solved, and higher accuracy and rationality are achieved.
Patent Information
- Application Number
- CN202311734809.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2025-06-17
AI Technical Summary
The prior art has low accuracy when converting names to pinyin, especially when there are polyphonic characters in the combination of last name and name.
By dividing names into last name fields and first name fields, matching them with the first type of database and second type of database, each of which is selected and their scores are determined based on the matching results, and comprehensively consider it to determine the target pinyin.
The accuracy and rationality of name conversion to pinyin are improved, and the accuracy of target pinyin is improved through comprehensive consideration of scores.
Smart Images

Figure CN120163128A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly relates to an information conversion method and device, an electronic device, and a computer-readable storage medium. Background Art
[0002] In scenarios such as employee onboarding registration and users registering personal information in a business system, there may be a need to convert a user's name into the corresponding pinyin. Since the combination of the surname and the given name forms a new word, it may affect the conversion of pinyin. In addition, there may be homophonic characters in the name. If the pinyin conversion is simply based on experience or system default rules, the conversion accuracy is relatively low. Summary of the Invention
[0003] This application provides an information conversion method and device, an electronic device, and a computer-readable storage medium, which can improve the accuracy and rationality of converting a name into pinyin.
[0004] In a first aspect, this application provides an information conversion method, which includes: obtaining a surname field and a given name field of a name to be converted; matching the surname field with a first word in a first type of database, and determining a first alternative pinyin of the surname field and a first score corresponding to the first alternative pinyin according to the matched first word, where the first score is used to represent the accuracy of the first alternative pinyin; matching the given name field with a second word in a second type of database, and determining a second alternative pinyin of the given name field and a second score corresponding to the second alternative pinyin according to the matched second word, where the second score is used to represent the accuracy of the second alternative pinyin; and determining a first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin.
[0005] In a second aspect, this application provides an information conversion device, which includes: an obtaining module, configured to obtain a surname field and a given name field of a name to be converted; a first matching module, configured to match the surname field with a first word in a first type of database, and determine a first alternative pinyin of the surname field and a first score corresponding to the first alternative pinyin according to the matched first word, where the first score is used to represent the accuracy of the first alternative pinyin; a second matching module, configured to match the given name field with a second word in a second type of database, and determine a second alternative pinyin of the given name field and a second score corresponding to the second alternative pinyin according to the matched second word, where the second score is used to represent the accuracy of the second alternative pinyin; and a determining module, configured to determine a first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin.
[0006] In a third aspect, the present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor to enable the at least one processor to execute the above information conversion method.
[0007] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program implements the above information conversion method when executed by a processor / processing core.
[0008] In the embodiments provided by the present application, considering that some Chinese characters may have special pronunciations when used as surnames, the name is divided into a surname field and a given name field for separate conversion; the possible pinyin of the surname field and the corresponding first score of the pinyin are determined through the first words in the first type of database, and the first score can reflect the accuracy of the possible pinyin of the surname field; the possible pinyin of the given name field and the corresponding second score of the pinyin are determined through the second words in the second type of database, and the second score can reflect the accuracy of the possible pinyin of the given name field; finally, the target pinyin to be converted is determined by comprehensively considering the possible pinyin of the surname field, the possible pinyin of the given name field, the first score, and the second score. Since the first score reflects the accuracy of the possible pinyin of the surname field, and the second score reflects the accuracy of the possible pinyin of the given name field, when determining the target pinyin, considering both of them can improve the accuracy and rationality of determining the target pinyin.
[0009] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The drawings are used to provide a further understanding of the present application, and constitute a part of the specification. They are used together with the embodiments of the present application to explain the present application, and do not constitute a limitation to the present application. By describing the detailed exemplary embodiments with reference to the drawings, the above and other features and advantages will become more obvious to those skilled in the art. In the drawings:
[0011] Figure 1 is a flowchart of an information conversion method provided by an embodiment of the present application.
[0012] Figure 2 is a schematic diagram of an information conversion method provided by an embodiment of the present application.
[0013] Figure 3 Schematic diagram of an information conversion method provided by an embodiment of the present application.
[0014] Figure 4 Flow schematic diagram of an information conversion method provided by an embodiment of the present application.
[0015] Figure 5 Block diagram of an information conversion device provided by an embodiment of the present application.
[0016] Figure 6 Block diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0017] To enable those skilled in the art to better understand the technical solutions of the present application, the following makes descriptions on exemplary embodiments of the present application with reference to the accompanying drawings. Various details of the embodiments of the present application are included to assist in 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 application. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following.
[0018] Without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0019] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0020] The terms used herein are only for describing specific embodiments and are not intended to limit the present application. As used herein, the singular forms "a" and "the" are also intended to include the plural forms unless the context clearly indicates otherwise. It will also be understood that when the terms "include" and / or "consist of" are used in this specification, the specified features, wholes, steps, operations, elements, and / or components are present, but one or more other features, wholes, steps, operations, elements, components, and / or their groups are not excluded. "Connection" or "connected" and other similar terms are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
[0021] Unless otherwise defined, the meanings of all terms (including technical and scientific terms) used herein are the same as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be interpreted as having meanings consistent with their meanings in the relevant art and the context of the present application, and will not be interpreted as having idealized or overly formal meanings unless clearly defined herein.
[0022] A Chinese character may have multiple pronunciations, and some Chinese characters have specific pronunciations when used as surnames. When determining the pinyin of a name based on conventional pinyin conversion methods, the error rate is relatively high, and it is impossible to obtain a relatively accurate pinyin of the name. In view of this, embodiments of the present application provide an information conversion method, an apparatus, an electronic device, and a computer-readable storage medium.
[0023] According to the information conversion method of the embodiments of the present application, considering that some Chinese characters may have special pronunciations when used as surnames, the name is divided into a surname field and a name field for separate conversion; the possible pinyin of the surname field and the corresponding first score of the pinyin are determined through the first words in the first type of database, and the first score can reflect the accuracy of the possible pinyin of the surname field; the possible pinyin of the name field and the corresponding second score of the pinyin are determined through the second words in the second type of database, and the second score can reflect the accuracy of the possible pinyin of the name field; finally, the target pinyin to be converted is determined by comprehensively considering the possible pinyin of the surname field, the possible pinyin of the name field, the first score, and the second score. Since the first score reflects the accuracy of the possible pinyin of the surname field, and the second score reflects the accuracy of the possible pinyin of the name field, when determining the target pinyin, considering both of them can improve the accuracy and rationality of determining the target pinyin.
[0024] The information conversion method according to the embodiments of the present application can be executed by an electronic device such as a terminal device or a server. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor calling computer-readable program instructions stored in a memory. The server can be an independent physical server, a server cluster composed of multiple servers, or a cloud server capable of performing cloud computing.
[0025] In a first aspect, embodiments of the present application provide an information conversion method.
[0026] Figure 1 is a flowchart of an information conversion method provided by an embodiment of the present application. Refer to Figure 1 and the method may include the following steps.
[0027] Step S11, obtain the surname field and the name field of the name to be converted.
[0028] In some alternative implementation manners, the name to be converted, that is, the name for which the pinyin is to be determined, includes a surname part and a given name part, corresponding to a surname field and a given name field respectively. Among them, the surname field includes the Chinese character corresponding to the surname, and the given name field includes the Chinese character corresponding to the given name.
[0029] Exemplarily, the surname field and the given name field can be directly obtained respectively, or after obtaining the complete name to be converted first, according to the division rules of the surname and the given name, it can be divided into the surname field and the given name field. The embodiments of the present application do not limit this.
[0030] For example, the preset business system sets a surname field and a given name field for the name. When user Zhang San registers in the preset business system, he needs to enter the Chinese character "Zhang" corresponding to his surname in the surname field, and enter the Chinese character "San" corresponding to his given name in the given name field, thereby clarifying the surname field and the given name field.
[0031] For example, the personnel management system sets a surname field and a given name field for the name. When user Li Si registers his personal information in the personnel management system, he needs to enter the Chinese character "Li" corresponding to his surname in the surname field, and enter the Chinese character "Si" corresponding to his given name in the given name field, thereby clarifying the surname field and the given name field.
[0032] For example, the information management system sets a name field for the name. When user Wang Wu registers an individual account in the information management system, he needs to enter "Wang Wu" in the name field, and the background of the information management system will divide "Wang Wu" into the surname field "Wang" and the given name field "Wu" according to the division rules of the surname and the given name, and update it to the database table in the system background for backup.
[0033] Step S12: Match the surname field with the first words in the first type of database, and determine the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first words.
[0034] In some alternative implementation manners, the first type of database includes multiple first words and the first preset pinyins of the multiple first words.
[0035] In some alternative implementation manners, the first type of database can include multiple first databases, and each first database can include multiple first words and the corresponding first preset pinyins. That is to say, the first type of database can be a collective term for multiple first databases.
[0036] In some alternative implementations, determining the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first Chinese character includes: determining the first alternative pinyin of the surname field according to the first preset pinyin of the matched first Chinese character; determining the first score of the first alternative pinyin according to the number of the first preset pinyin.
[0037] Exemplarily, if the first type of database includes N first databases, then when the surname field matches the first Chinese character in the i-th first database, the first score of the first alternative pinyin is determined according to the number of the first preset pinyin of the first Chinese character in the i-th database, where 1 < i ≤ N and N is an integer greater than 1.
[0038] In some alternative implementations, there is a first preset priority among multiple first databases. When matching the surname field, it can be matched with the first databases one by one based on the first preset priority.
[0039] In some alternative implementations, matching the surname field with the first Chinese characters in the first type of database, and determining the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first Chinese character includes: when there is a first Chinese character in the i-th first database that matches the surname field, determining the first alternative pinyin of the surname field and the first score of the first alternative pinyin according to the first preset pinyin of the matched first Chinese character, where 1 ≤ i < N and N is the total number of the first databases; when the surname field does not match any of the first Chinese characters in the i-th first database, matching the surname field with the first Chinese characters in the (i + 1)-th first database, where the first preset priority of the i-th first database is higher than that of the (i + 1)-th first database and i + 1 ≤ N.
[0040] It can be seen therefrom that starting from the first database with the highest first preset priority, the surname field is matched with the first Chinese characters in this first database. If the match is successful, the first alternative pinyin of the surname field and the first score of the first alternative pinyin are determined according to the first preset pinyin of the matched first Chinese character. Among them, the first score can represent the accuracy of the first alternative pinyin, or can also represent the accuracy and rationality of the first alternative pinyin. Generally, if the first score is higher, it indicates that the accuracy (or rationality) of the first alternative pinyin is higher; otherwise, it indicates that the accuracy (or rationality) of the first alternative pinyin is lower.
[0041] For example, assume that the first total score is S. If the surname field matches the first word in the k-th first database (1 ≤ k ≤ N), and the first preset pinyin of this first word includes py1 and py2, then the first alternative pinyins of the surname field can be determined as py1 and py2, and py1 and py2 correspond to the same first score of S / 2.
[0042] For example, assume that the first total score is S. If it is previously known that the commonly used pinyin corresponding to the surname field includes py1, py2, and py3, and the surname field matches the first word in the k-th first database, and the first preset pinyin of this first word includes py1 and py2, then the first alternative pinyins of the target surname that matches the surname field can be determined as py1, py2, and py3, and the first scores corresponding to py1, py2, and py3 are determined as S1, S2, and S3 respectively, where S1 = S2 = S × 40%, and S3 = S × 20%.
[0043] In some alternative implementation manners, the first type of database may include a preset surname database and a general Chinese character database, and the first preset priority of the preset surname database is higher than the first preset priority of the general Chinese character database. First, compare the surname field with the first word in the preset surname database. If they are the same, it is determined that the first word zc11 matches the surname field successfully, and the first preset pinyin of the first word zc11 is determined as the first alternative pinyin of the surname field. Moreover, the first score of each first alternative pinyin is determined as 1 / N1, where N1 is the number of the first preset pinyins corresponding to the first word zc11 in the preset surname database, and N1 ≥ 1. Further, if no match is found in the preset surname database, then compare the surname field with the first word in the general Chinese character database. If they are the same, it is determined that the first word zc12 matches the surname field successfully, and the first preset pinyin of the first word zc12 is determined as the first alternative pinyin of the surname field. Moreover, the first score of each first alternative pinyin is determined as 1 / N2, where N2 is the number of the first preset pinyins corresponding to the first word zc12 in the general Chinese character database, and N2 ≥ 1.
[0044] Step S13: Match the name field with the second word in the second type of database, and determine the second alternative pinyin of the name field and the second score corresponding to the second alternative pinyin according to the matched second word.
[0045] In some alternative implementation manners, the second type of database may include multiple second databases, and each second database may include multiple second words and multiple second preset pinyins corresponding to the multiple second words.
[0046] In some alternative implementations, there is a second preset priority among multiple second databases; correspondingly, determining the second alternative pinyin of the name field and the second score corresponding to the second alternative pinyin according to the matched second word includes: determining the second alternative pinyin of the name field according to the second preset pinyin of the matched second word; determining the second score of the second alternative pinyin according to the preset scoring coefficient of the second database corresponding to the matched second word, and the preset scoring coefficient is determined according to the priority level of the second database.
[0047] Exemplarily, if the second type of database includes M second databases, then when the name field matches the second word in the j-th second database, determining the second alternative pinyin of the name field according to the second preset pinyin of the second word; and determining the second score of the second alternative pinyin according to the preset scoring coefficient of the j-th second database, where 1 < j ≤ M and M is an integer greater than 1.
[0048] In some alternative implementations, when matching the name field, it can be matched with the second databases one by one based on the second preset priority.
[0049] In some alternative implementations, matching the name field with the second words in the second type of database, and determining the second alternative pinyin of the name field and the second score corresponding to the second alternative pinyin according to the matched second word includes: when there is a second word in the j-th second database that matches the name field, determining the second alternative pinyin of the name field according to the second preset pinyin of the second word; determining the second score of the second alternative pinyin according to the preset scoring coefficient of the j-th second database; when the name field does not match any second word in the j-th second database, matching the name field with the second words in the (j + 1)-th second database. Among them, the second preset priority of the j-th second database is higher than that of the (j + 1)-th second database, and j + 1 ≤ M.
[0050] Exemplarily, the second preset priority can reflect the rationality and accuracy of the second word and its second preset pinyin in the second database as the name pinyin. For example, the second database includes a celebrity database and a preset word database. Among them, the celebrity database includes multiple historical celebrity names (i.e., second words) and corresponding second preset pinyins, and the preset word database includes multiple preset words (i.e., second words) and corresponding second preset pinyins. Based on the celebrity database, determining the pinyin of the name field may be more accurate and reasonable than the preset word database. Therefore, the second preset priority of the celebrity database is set higher than that of the preset word database.
[0051] It should be noted that the above examples illustrate the method for determining the second preset priority. The second preset priority can be determined based on experience, statistical data, and simulation data, and the embodiments of the present application do not limit this.
[0052] In some alternative implementation manners, there is a positive correlation between the preset scoring coefficient and the second preset priority of the second database. The positive correlation between the preset scoring coefficient and the second preset priority of the second database means that if the second preset priority of the second database is higher, the corresponding preset scoring coefficient of the second database is larger, making the obtained second score more accurate and reasonable.
[0053] In some alternative implementation manners, the second type of database may include a celebrity database, a personnel database, and a preset word library. Among them, the celebrity database includes multiple historical celebrity names and corresponding second preset pinyins, the personnel database includes multiple personnel names and corresponding second preset pinyins, the preset word library includes multiple preset words and corresponding second preset pinyins, and the second preset priorities corresponding to the celebrity database, the personnel database, and the preset word library decrease in sequence; the matching process of the name field may include the following: matching the name field with the historical celebrity names in the celebrity database. If there is a historical celebrity name that matches the name field, determine the second alternative pinyin of the name field according to the second preset pinyin of the matched historical celebrity name, and determine the second score of the second alternative pinyin according to the preset scoring coefficient of the celebrity database; in the case that there is no target name in the celebrity database that matches the name field, match the name field with the personnel names in the personnel database. If there is a personnel name that matches the name field, determine the second alternative pinyin of the name field according to the second preset pinyin of the matched personnel name, and determine the second score of the second alternative pinyin according to the preset scoring coefficient of the personnel database; in the case that there is no target name in the personnel database that matches the name field, match the name field with the preset words in the preset word library. If there is a preset word that matches the name field, determine the second alternative pinyin of the name field according to the second preset pinyin of the matched preset word, and determine the second score of the second alternative pinyin according to the preset scoring coefficient of the preset word library.
[0054] For example, assume that the preset scoring coefficients of the celebrity database, the personnel database, and the preset word library are 1.4, 1.3, and 1.2 respectively. If the name field matches the historical celebrity name in the celebrity database, determine the corresponding second score as 1.4. If the name field matches the personnel name in the personnel database, determine the corresponding second score as 1.3. If the name field matches the preset word in the preset word library, determine the corresponding second score as 1.2.
[0055] In some alternative implementations, the method may further include: when the number of Chinese characters corresponding to the name field is multiple and the name field does not match any of the second Chinese words in the second type of database, splitting the name field into multiple single-character fields; determining a third alternative pinyin of the name field and a third score corresponding to the third alternative pinyin according to the single-character fields and the second Chinese words in the second type of database; and determining a second target pinyin of the name to be converted based on the first score, the third score, the first alternative pinyin, and the third alternative pinyin.
[0056] Exemplarily, determining a third alternative pinyin of the name field and a third score corresponding to the third alternative pinyin according to the single-character fields and the second Chinese words in the second type of database includes: matching each single-character field with the second Chinese words in the second type of database to determine a single-character alternative pinyin for each single-character field; determining a third alternative pinyin of the name field according to each single-character alternative pinyin; and determining a third score corresponding to the third alternative pinyin according to at least one of the tone attribute, homophone attribute, and commendatory or derogatory attribute corresponding to the third alternative pinyin.
[0057] It can be seen that when the name field is used as a whole field and no match is found in the second type of database, the name field can be split into single-character fields of individual Chinese characters, and then the single-character fields are matched with the second type of database to determine the single-character alternative pinyin for each single-character field, thereby obtaining the third alternative pinyin of the name field and determining the corresponding third score. Then, based on the first score, the third score, the first alternative pinyin, and the third alternative pinyin, the second target pinyin of the name to be converted can be determined.
[0058] In some alternative implementations, when matching the single-character fields with the second type of database, it is still possible to match them with the corresponding second databases in sequence based on the second preset priority, and then determine the pinyin of the single-character fields (i.e., the single-character alternative pinyin) according to the matching results.
[0059] For example, if the name field is "Ka Xi", when it does not match any of the second Chinese words in the second database with the lowest second preset priority, it can be split into two single-character fields "Ka" and "Xi". Then, for the single-character field "Ka", according to the second preset priority, it is respectively matched with the second databases to determine the single-character alternative pinyin of "Ka". A similar method is used for the single-character field "Xi" to obtain the single-character alternative pinyin of "Xi". After combining the two single-character alternative pinyins, the third alternative pinyin of the name field can be obtained. Then, based on at least one of the tone attribute, homophone attribute, and commendatory or derogatory attribute corresponding to the third alternative pinyin, the third score corresponding to the third alternative pinyin can be determined.
[0060] In some alternative implementations, determining a third score corresponding to a third alternative pinyin according to at least one of the tone attribute, homophone attribute, and commendatory or derogatory attribute corresponding to the third alternative pinyin includes: when the tone attribute corresponding to the third alternative pinyin is a level or oblique tone, determining a first sub-score of the third alternative pinyin according to a preset tone attribute coefficient; when the homophone attribute corresponding to the third alternative pinyin belongs to a homophone word, determining a second sub-score of the third alternative pinyin according to a preset homophone attribute coefficient; when the commendatory or derogatory attribute corresponding to the third alternative pinyin belongs to a derogatory word, determining a third sub-score of the third alternative pinyin according to a preset commendatory or derogatory attribute coefficient; determining the third score of the third alternative pinyin according to at least one of the first sub-score, the second sub-score, and the third sub-score.
[0061] For example, for any third alternative pinyin, if its tone attribute is a level or oblique tone, its first sub-score is determined to be 1.2; if its tone attribute does not belong to the level or oblique tone, its first sub-score is determined to be 1; if its homophone attribute belongs to a homophone word, its second sub-score is determined to be 1.1; if it does not belong to a homophone word, its second sub-score is determined to be 1; if its commendatory or derogatory attribute is a derogatory word, its third sub-score is determined to be 0.8; if it does not belong to a derogatory word, its third sub-score is determined to be 1. Further, by performing an arithmetic average calculation on the above three sub-scores, the third score of the third alternative pinyin can be obtained.
[0062] It should be noted that for the case where a name includes polyphonic characters, it is necessary to combine different pinyins so as to determine the corresponding third score for each combination case, thereby determining the final second target pinyin.
[0063] In some alternative implementations, determining the third alternative pinyin of a name field according to each single-character alternative pinyin includes: when the first single-character field is a polyphonic character, combining the single-character alternative pinyins of the first single-character field with the single-character alternative pinyins of the second single-character field to obtain the third alternative pinyin of the name field; where the multiple single-character fields include the first single-character field, and the second single-character field is the single-character field other than the first single-character field among the multiple single-character fields (the number of the second single-character fields can be one or more).
[0064] Exemplarily, determining the third alternative pinyin of a name field according to the single-character alternative pinyin includes: when at least one of the multiple single-character fields is a polyphonic character, respectively combining the multiple single-character alternative pinyins of the single-character field corresponding to the polyphonic character (i.e., the first single-character field) with the single-character alternative pinyins of the remaining single-character fields (i.e., the second single-character fields) to obtain multiple third alternative pinyins of the name field.
[0065] For example, the name field is "Kaliang", where "Ka" is a polyphonic character. Therefore, it can be determined that "Ka" is the first single-character field and "Liang" is the second single-character field. Further, the alternative pinyins for the single character "Ka" include "kǎ" and "qiǎ". By combining these two alternative pinyins for the single character with the alternative pinyin "liàng" for the single character "Liang", it can be determined that the third alternative pinyins for "Kaliang" include: "kǎliàng" and "qiǎliàng".
[0066] It should be noted that in some alternative implementation manners, if a second Chinese word that exactly matches the name field is found in the second type of database and the corresponding second score is determined, the foregoing second score can still be slightly adjusted by at least one of the tone attribute, homophone attribute, and commendatory or derogatory attribute of the second alternative pinyin to make the second score more accurate and reasonable.
[0067] For example, a second Chinese word that exactly matches the name field is found in the second type of database, and it is determined that the corresponding second alternative pinyins include py1 and py2, which respectively correspond to the second scores S21 and S22. On this basis, the tone attribute of py1 can be determined, and the second score S21 is multiplied by a tone attribute coefficient corresponding to this tone attribute; similarly, the homophone attribute of py1 can be determined, and the second score 21 is multiplied by a homophone attribute coefficient corresponding to this homophone attribute; the commendatory or derogatory attribute of py1 can be determined, and the second score 21 is multiplied by a commendatory or derogatory attribute coefficient corresponding to this commendatory or derogatory attribute. By calculating the arithmetic mean of multiple adjusted second scores, a more accurate and reasonable second score can be obtained. The processing method for the second alternative pinyin py2 is similar to that for py1 and will not be elaborated here.
[0068] In some alternative implementation manners, the preset scoring coefficients corresponding to the second database, such as the tone attribute coefficient, the homophone attribute coefficient, and the commendatory or derogatory attribute coefficient, essentially all belong to weight adjustment coefficients, which are used to adjust the magnitude of the second score according to different situations, so that the second score is more matched with the current situation, obtain a more reasonable and accurate second score, and further obtain a more accurate name pinyin. Exemplarily, the preset scoring coefficients corresponding to multiple second databases are respectively: 1.4, 1.3, 1.2, and the tone attribute coefficient, the homophone attribute coefficient, and the commendatory or derogatory attribute coefficient respectively correspond to 1.2 (meeting the level and oblique tone attribute), 1.1 (being a homophone word), and 1 (being a commendatory word). In the above coefficient settings, the difference between adjacent two coefficients is greater than or equal to 10%. Through this setting, in some cases, when multiple low scoring coefficients are satisfied, the second score is higher than that corresponding to only one high scoring coefficient. For example, 1.2×1.1 = 1.32 > 1.3, indicating that the second score of the second alternative pinyin that simultaneously meets the level and oblique tone attribute and the homophone word attribute (i.e., 1.2×1.1) is greater than the second score of the second alternative pinyin that only meets the second second database (i.e., 1.3).
[0069] Step S14: Determine the first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin.
[0070] Wherein, the first target pinyin is the determined pinyin corresponding to the name to be converted.
[0071] In some alternative implementation manners, determining the first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin includes: combining the first alternative pinyin and the second alternative pinyin to obtain at least one alternative combined pinyin of the name to be converted; determining the total score of the alternative combined pinyin according to the first score and the second score corresponding to the alternative combined pinyin, and the total score of the alternative combined pinyin is used to represent the accuracy of the alternative combined pinyin; determining the first target pinyin of the name to be converted according to the total score of each alternative combined pinyin.
[0072] For example, the surname field of the name to be converted is "He" and the given name field is "Kaliang". It is determined that the first alternative pinyins include: hé, hè, hú, huó, huò, corresponding to the first scores S11, S12, S13, S14, S15 respectively, and the second alternative pinyins include: kǎliàng and qiǎliàng, corresponding to the second scores S21 and S22 respectively. Thus, it can be determined that the alternative combined pinyins include the following ten cases: hékǎliàng, hèkǎliàng, húkǎliàng, huókǎliàng, huòkǎliàng, héqiǎliàng, hèqiǎliàng, húqiǎliàng, huóqiǎliàng, huòqiǎliàng, corresponding to the total scores of: S11×S21, S12×S21, S13×S21, S14×S21, S15×S21, S11×S22, S12×S22, S13×S22, S14×S22, S15×S22. Just select the alternative combined pinyin corresponding to the maximum value from the above ten total scores as the first target pinyin of the name "He Kaliang" to be converted.
[0073] In the embodiment of the present application, considering that some Chinese characters may have special pronunciations when used as surnames, the name is divided into a surname field and a given name field for separate conversion; the possible pinyins of the surname field and the corresponding first scores of the pinyins are determined through the first words in the first type of database, and the first scores can reflect the accuracy of the possible pinyins of the surname field; the possible pinyins of the given name field and the corresponding second scores of the pinyins are determined through the second words in the second type of database, and the second scores can reflect the accuracy of the possible pinyins of the given name field; finally, the target pinyin of the information to be converted is determined by comprehensively considering the possible pinyins of the surname field, the possible pinyins of the given name field, the first scores and the second scores. Since the first scores reflect the accuracy of the possible pinyins of the surname field and the second scores reflect the accuracy of the possible pinyins of the given name field, when determining the target pinyin, considering both of them can improve the accuracy and rationality of determining the target pinyin.
[0074] The following combines Figures 2 - 4 to expand and illustrate the information conversion method of the embodiment of the present application.
[0075] Figure 2 is a schematic diagram of an information conversion method provided for the embodiment of the present application. Refer to Figure 2, first obtain the name to be converted and split it into a surname field and a given name field. For the surname field, match it with multiple first databases in the first type of database (e.g., first database 1, …, first database n, n≥1) to obtain the first alternative pinyin and the corresponding first score for the surname field. For example, obtain p first alternative pinyins and their corresponding first scores, which are: first alternative pinyin 1 and its first score 1, …, first alternative pinyin p and its first score p, p≥1.
[0076] For the given name field, match it with multiple second databases in the second type of database (e.g., second database 1, …, second database m, m≥1) to obtain the second alternative pinyin and the corresponding second score for the given name field. For example, obtain q second alternative pinyins and their corresponding second scores, which are: second alternative pinyin 1 and its second score 1, …, second alternative pinyin q and its second score q, q≥1.
[0077] Furthermore, combine the first alternative pinyin with the second alternative pinyin to obtain at least one alternative combined pinyin for the name to be converted. Then, determine the total score of the alternative combined pinyin according to the first score and the second score corresponding to the alternative combined pinyin, and determine the first target pinyin of the name to be converted as the alternative combined pinyin with the highest total score.
[0078] Figure 3 It is a schematic diagram of an information conversion method provided by an embodiment of this application. Refer to Figure 3 , first obtain the name to be converted and split it into a surname field and a given name field. For the surname field, first match it with a preset surname library to determine whether it can be successfully matched with the preset surname library. If it is successfully matched, the first alternative pinyin and the corresponding first score can be determined; if it is not successfully matched, the surname field can be matched with a general Chinese character library, and the first alternative pinyin and the corresponding first score can be determined according to the matching result.
[0079] For the given name field, first match it with a celebrity database to determine whether it can be successfully matched with the celebrity database. If it is successfully matched, the second alternative pinyin and the corresponding second score can be determined; if it is not successfully matched, the given name field can be matched with a personnel database to determine whether it can be successfully matched with the personnel database. If it is successfully matched, the second alternative pinyin and the corresponding second score can be determined; if it is not successfully matched, the given name field can be matched with a preset word library to determine whether it can be successfully matched with the preset word library. If it is successfully matched, the second alternative pinyin and the corresponding second score can be determined.
[0080] It should be noted that when the name field corresponds to only one Chinese character, the matching result can usually be obtained through the above three second databases. If the matching is still not successful, the second alternative pinyin of the name field can be determined based on the commonly used pronunciation, and a median second score can be set based on experience, statistical data, etc.
[0081] Furthermore, summarize the first alternative pinyin and its first score, the second alternative pinyin and its second score, combine the first alternative pinyin and the second alternative pinyin to obtain at least one alternative combined pinyin of the name to be converted, calculate the product of the first score and the second score corresponding to the alternative combined pinyin, and use this product as the total score of the alternative combined pinyin. Finally, determine the first target pinyin of the name to be converted as the alternative combined pinyin with the highest total score.
[0082] If the name field fails to match with all of the above three second databases and the name field corresponds to multiple Chinese characters, the name field can be split into multiple single-character fields, and the single-character alternative pinyins of each single-character field can be determined. Then, according to the positions of the single-character fields in the name field, the single-character alternative pinyins are combined to obtain the third alternative pinyin of the name field.
[0083] Furthermore, for any one of the third alternative pinyins determined based on the single-character alternative pinyins, perform the following processing procedures: determine the tone attribute of the third alternative pinyin, and determine whether this tone attribute is a level and oblique tone attribute. If it is a level and oblique tone attribute, determine the first tone attribute coefficient corresponding to the level and oblique tone attribute, and determine the first sub-score of the third alternative pinyin based on this first tone attribute coefficient. If it is not a level and oblique tone attribute, determine the second tone attribute coefficient corresponding to the non-level and oblique tone attribute, and determine the first sub-score of the second alternative pinyin regarding the tone attribute based on this second tone attribute coefficient; similarly, determine the homophonic attribute of the third alternative pinyin, and determine whether this homophonic attribute is a homophonic word. If it is a homophonic word, determine the first homophonic attribute coefficient corresponding to the homophonic word, and determine the second sub-score of the third alternative pinyin based on this first homophonic attribute coefficient. If it is not a homophonic word, determine the second homophonic attribute coefficient corresponding to the non-homophonic word, and determine the second sub-score of the third alternative pinyin regarding the homophonic attribute based on this second homophonic attribute coefficient; similarly, determine the commendatory and derogatory attribute of the third alternative pinyin, and determine whether this commendatory and derogatory attribute is a derogatory attribute. If it is a derogatory attribute, determine the first commendatory and derogatory attribute coefficient corresponding to the derogatory attribute, and determine the third sub-score of the third alternative pinyin based on this first commendatory and derogatory attribute coefficient. If it is not a derogatory attribute, determine the second commendatory and derogatory attribute coefficient corresponding to the non-derogatory attribute, and determine the third sub-score of the third alternative pinyin regarding the commendatory and derogatory attribute based on this second commendatory and derogatory attribute coefficient. Finally, based on the sub-scores of the above multiple attribute dimensions, determine the final third score of each third alternative pinyin.
[0084] Further, summarize the first alternative pinyin and its first score, and the third alternative pinyin and its third score. Combine the first alternative pinyin and the third alternative pinyin to obtain at least one alternative combined pinyin of the name to be converted, and calculate the product of the first score and the third score corresponding to the alternative combined pinyin. Take this product as the total score of the alternative combined pinyin. Finally, determine the second target pinyin of the name to be converted as the alternative combined pinyin with the highest total score.
[0085] Figure 4 is a schematic flowchart of an information conversion method provided by an embodiment of the present application. Refer to Figure 4 , this method may include the following steps.
[0086] Step S401, obtain the surname field and the name field of the name to be converted.
[0087] Step S402, for the surname field, based on the order of the first preset priorities in the first database from high to low, sequentially match the surname field with the first words in the first database, and determine the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first words.
[0088] Step S403, for the name field, based on the order of the second preset priorities in the second database from high to low, sequentially match the name field with the second words in the second database. In the case where there is a matched second word, determine the second alternative pinyin of the name field and the second score corresponding to the second alternative pinyin according to the matched second word.
[0089] Among them, step S402 and step S403 can be executed simultaneously, or step S402 can be executed first and then step S403, or step S403 can be executed first and then step S402. The present application does not limit this.
[0090] It should be noted that in step S403, when it is determined that there is a matched second word and the second alternative pinyin and its second score are determined, step S404 is executed; when there is no second word in the second database that matches the name field, it will jump to step S407 to execute subsequent steps.
[0091] Step S404, combine the first alternative pinyin and the second alternative pinyin to obtain at least one alternative combined pinyin of the name to be converted.
[0092] Step S405, determine the total score of the alternative combined pinyin according to the first score and the second score corresponding to the alternative combined pinyin.
[0093] Step S406, determine the first target pinyin of the name to be converted as the alternative combined pinyin with the highest total score.
[0094] After obtaining the first target pinyin, the process can be ended.
[0095] Step S407: When the number of Chinese characters corresponding to the name field is multiple and the name field does not match any of the second Chinese words in the second database with the lowest second preset priority, split the name field into multiple single-character fields.
[0096] Step S408: Based on the order from the highest to the lowest of the second preset priority, match each single-character field with the second Chinese words in at least one second database respectively to determine the single-character alternative pinyin of each single-character field, and determine the third alternative pinyin of the name field according to the single-character alternative pinyin.
[0097] Step S409: Determine the third score corresponding to the third alternative pinyin according to at least one of the tone attribute, homophonic attribute, and commendatory or derogatory attribute corresponding to the third alternative pinyin.
[0098] Step S410: Combine the first alternative pinyin and the third alternative pinyin to obtain at least one alternative combined pinyin of the name to be converted.
[0099] Step S411: Determine the total score of the alternative combined pinyin according to the first score and the third score corresponding to the alternative combined pinyin.
[0100] Step S412: Determine the alternative combined pinyin with the highest total score as the second target pinyin of the name to be converted.
[0101] It can be understood that, without violating the principle logic, the above-mentioned method embodiments mentioned in this application can be combined with each other to form combined embodiments. Due to space limitations, this application will not elaborate further. Those skilled in the art can understand that in the above methods of the specific implementation manner, the specific execution order of each step should be determined according to its function and possible internal logic.
[0102] In a second aspect, an information conversion device is provided in an embodiment of this application.
[0103] Figure 5 It is a block diagram of an information conversion device provided in an embodiment of this application.
[0104] Referring to Figure 5 , an information conversion device 500 is provided in an embodiment of this application. The information conversion device 500 includes:
[0105] An acquisition module 501, configured to acquire the surname field and the name field of the name to be converted.
[0106] The first matching module 502 is configured to match the surname field with the first words in the first type of database, and determine the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first words.
[0107] The second matching module 503 is configured to match the name field with the second words in the second type of database, and determine the second alternative pinyin of the name field and the second score corresponding to the second alternative pinyin according to the matched second words.
[0108] The determination module 504 is configured to determine the first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin.
[0109] In some alternative implementation manners, the first type of database includes multiple first words and the first preset pinyin of the multiple first words; correspondingly, when the first matching module 502 determines the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first words, the following steps are performed:
[0110] Determine the first alternative pinyin of the surname field according to the first preset pinyin of the matched first words;
[0111] Determine the first score of the first alternative pinyin according to the number of the first preset pinyin.
[0112] In some alternative implementation manners, the second type of database includes multiple second databases, and the second database includes multiple second words and the second preset pinyin of the multiple second words; when the second matching module 503 determines the second alternative pinyin of the name field and the second score corresponding to the second alternative pinyin according to the matched second words, the following steps are performed:
[0113] Determine the second alternative pinyin of the name field according to the second preset pinyin of the matched second words;
[0114] Determine the second score of the second alternative pinyin according to the preset scoring coefficient of the second database corresponding to the matched second words, and the preset scoring coefficient is determined according to the priority level of the second database.
[0115] In some alternative implementation manners, the information conversion device 500 is further configured to perform the following steps:
[0116] In the case that the number of Chinese characters corresponding to the name field is multiple and the name field does not match any of the second words in the second type of database, split the name field into multiple single-character fields;
[0117] Determine the third alternative pinyin of the name field and the third score corresponding to the third alternative pinyin according to the single-character fields and the second words in the second type of database;
[0118] Based on the first score, the third score, the first alternative pinyin, and the third alternative pinyin, determine the second target pinyin of the name to be converted.
[0119] In some alternative implementation manners, determining the third alternative pinyin of the name field and the third score corresponding to the third alternative pinyin according to the single-character field and the second Chinese words in the second type of database includes:
[0120] Match each single-character field with the second Chinese words in the second type of database to determine the single-character alternative pinyin of each single-character field;
[0121] Determine the third alternative pinyin of the name field according to each single-character alternative pinyin;
[0122] Determine the third score corresponding to the third alternative pinyin according to at least one of the tone attribute, homophone attribute, and commendatory or derogatory attribute corresponding to the third alternative pinyin.
[0123] In some alternative implementation manners, determining the third alternative pinyin of the name field according to each single-character alternative pinyin includes:
[0124] In the case where the first single-character field is a polyphonic character, combine the single-character alternative pinyin of the first single-character field with the single-character alternative pinyin of the second single-character field to obtain the third alternative pinyin of the name field;
[0125] Among them, the multiple single-character fields include the first single-character field, and the second single-character field is the single-character field other than the first single-character field among the multiple single-character fields.
[0126] In some alternative implementation manners, when the determining module 504 determines the first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin, perform the following steps:
[0127] Combine the first alternative pinyin with the second alternative pinyin to obtain at least one alternative combined pinyin of the name to be converted;
[0128] Determine the total score of the alternative combined pinyin according to the first score and the second score corresponding to the alternative combined pinyin, and the total score of the alternative combined pinyin is used to represent the accuracy of the alternative combined pinyin;
[0129] Determine the first target pinyin of the name to be converted according to the total score of each alternative combined pinyin.
[0130] In the embodiments of the present application, considering that some Chinese characters may have special pronunciations when used as surnames, a name is divided into a surname field and a given name field for separate conversion. Based on the first matching module, the possible pinyin of the surname field and the corresponding first score of the pinyin are determined through the first words in the first type of database. The first score can reflect the accuracy of the possible pinyin of the surname field. Based on the second matching module, the possible pinyin of the given name field and the corresponding second score of the pinyin are determined through the second words in the second type of database. The second score can reflect the accuracy of the possible pinyin of the given name field. Finally, the target pinyin to be converted is determined by the determination module by comprehensively considering the possible pinyin of the surname field, the possible pinyin of the given name field, the first score, and the second score. Since the first score reflects the accuracy of the possible pinyin of the surname field and the second score reflects the accuracy of the possible pinyin of the given name field, when determining the target pinyin, considering both of them can improve the accuracy and rationality of determining the target pinyin.
[0131] In addition, the present application also provides an electronic device and a computer-readable storage medium, both of which can be used to implement any of the information conversion methods provided by the present application. For the corresponding technical solutions and descriptions, please refer to the corresponding records in the method part, which will not be elaborated here.
[0132] Each module in the above information conversion device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0133] Figure 6 It is a block diagram of an electronic device provided by an embodiment of the present application.
[0134] Referring to Figure 6 , an embodiment of the present application provides an electronic device, which includes: at least one processor 601; at least one memory 602, and one or more I / O interfaces 603 connected between the processor 601 and the memory 602; wherein, the memory 602 stores one or more computer programs executable by at least one processor 601, and the one or more computer programs are executed by at least one processor 601 so that at least one processor 601 can execute the above information conversion method.
[0135] Each module in the above electronic device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0136] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor / processing core, the above information conversion method is implemented. The computer-readable storage medium may be a volatile or non-volatile computer-readable storage medium.
[0137] An embodiment of the present application also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above information conversion method.
[0138] Those of ordinary skill in the art can understand that all or some of the steps in the above-disclosed methods, and the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, and appropriate combinations thereof. In the hardware implementation, the division of the functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be executed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable storage medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium).
[0139] As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable program instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cassette, tape, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium typically includes computer-readable program instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.
[0140] The computer-readable program instructions described herein can be downloaded to various computing / processing devices from a computer-readable storage medium or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.
[0141] The computer program instructions for performing the operations of this application can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state-setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions can be executed entirely on the user's computer, partially on the user's computer, executed as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., by using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of this application.
[0142] The computer program product described herein can be implemented specifically in the form of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.
[0143] Aspects of this application are described herein with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.
[0144] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions, when executed by the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in one or more boxes of the flowchart and / or block diagram. These computer-readable program instructions may also be stored in a computer-readable storage medium that causes a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises a manufacture including instructions that implement various aspects of the functions / acts specified in one or more boxes of the flowchart and / or block diagram.
[0145] The computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other devices to produce a computer-implemented process such that the instructions executed on the computer, other programmable data processing apparatus, or other devices implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.
[0146] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a segment of code, or a portion of an instruction, and the module, segment of code, or portion of an instruction may include one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the boxes may occur out of the order noted in the figures. For example, two consecutive boxes may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each box in the block diagrams and / or flowcharts, and combinations of boxes in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or acts, or by a combination of dedicated hardware and computer instructions.
[0147] Example embodiments have been disclosed herein, and although specific terms are employed, they are used in a generic and descriptive sense only and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, the features, characteristics, and / or elements described in connection with a particular embodiment may be used singly or in combination with those described in connection with other embodiments. Accordingly, those skilled in the art will appreciate that various forms and details may be changed without departing from the scope of the present application as set forth by the appended claims.
Claims
1. An information conversion method, characterized in that, Including: Obtain the surname field and the given name field of the name to be converted; Match the surname field with the first words in the first type of database, and determine the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first words, where the first score is used to represent the accuracy of the first alternative pinyin; Match the given name field with the second words in the second type of database, and determine the second alternative pinyin of the given name field and the second score corresponding to the second alternative pinyin according to the matched second words, where the second score is used to represent the accuracy of the second alternative pinyin; Based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin, determine the first target pinyin of the name to be converted.
2. The method according to claim 1, characterized in that, The first type of database includes multiple first words and the first preset pinyin of the multiple first words; The step of determining the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first words includes: Determine the first alternative pinyin of the surname field according to the first preset pinyin of the matched first words; Determine the first score of the first alternative pinyin according to the number of the first preset pinyin.
3. The method according to claim 1, characterized in that, The second type of database includes multiple second databases, and each second database includes multiple second words and the second preset pinyin of the multiple second words; The step of determining the second alternative pinyin of the given name field and the second score corresponding to the second alternative pinyin according to the matched second words includes: Determine the second alternative pinyin of the given name field according to the second preset pinyin of the matched second words; Determine the second score of the second alternative pinyin according to the preset scoring coefficient of the second database corresponding to the matched second words, where the preset scoring coefficient is determined according to the priority level of the second database.
4. The method according to claim 1 or 3, characterized in that, The method further includes: In the case where the number of Chinese characters corresponding to the given name field is multiple and the given name field does not match any of the second words in the second type of database, split the given name field into multiple single-character fields; According to the single-character fields and the second words in the second type of database, determine the third alternative pinyin of the given name field and the third score corresponding to the third alternative pinyin; Based on the first score, the third score, the first alternative pinyin, and the third alternative pinyin, determine the second target pinyin of the name to be converted.
5. The method according to claim 4, characterized in that, The step of determining the third alternative pinyin of the given name field and the third score corresponding to the third alternative pinyin according to the single-character fields and the second words in the second type of database includes: Match each single-character field with the second words in the second type of database to determine the single-character alternative pinyin of each single-character field; Determine the third alternative pinyin of the given name field according to each single-character alternative pinyin; Determine the third score corresponding to the third alternative pinyin according to at least one of the tone attribute, homophone attribute, and commendatory or derogatory attribute corresponding to the third alternative pinyin.
6. The method according to claim 5, characterized in that, Determining the third alternative pinyin of the name field according to each of the single-character alternative pinyins includes: In the case where the first single-character field is a polyphonic character, combining the single-character alternative pinyin of the first single-character field with the single-character alternative pinyin of the second single-character field to obtain the third alternative pinyin of the name field; Wherein, the multiple single-character fields include the first single-character field, and the second single-character field is the single-character field other than the first single-character field among the multiple single-character fields.
7. The method according to claim 1, characterized in that, Determining the first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin includes: Combining the first alternative pinyin with the second alternative pinyin to obtain at least one alternative combined pinyin of the name to be converted; According to the first score and the second score corresponding to the alternative combined pinyin, determining the total score of the alternative combined pinyin, and the total score of the alternative combined pinyin is used to represent the accuracy of the alternative combined pinyin; Determining the first target pinyin of the name to be converted according to the total score of each alternative combined pinyin.
8. An information conversion device, characterized in that, Includes: An acquisition module for acquiring the surname field and the name field of the name to be converted; A first matching module for matching the surname field with the first word in the first type of database, and determining the first alternative pinyin of the surname field and the first score corresponding to the first alternative pinyin according to the matched first word, and the first score is used to represent the accuracy of the first alternative pinyin; A second matching module for matching the name field with the second word in the second type of database, and determining the second alternative pinyin of the name field and the second score corresponding to the second alternative pinyin according to the matched second word, and the second score is used to represent the accuracy of the second alternative pinyin; A determination module for determining the first target pinyin of the name to be converted based on the first score, the second score, the first alternative pinyin, and the second alternative pinyin.
9. An electronic device, characterized in that, Includes: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs executable by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the information conversion method according to any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that, The computer program, when executed by the processor, implements the information conversion method according to any one of claims 1-7.