Method, device, electronic device and storage medium for determining phonetic letter vector

By obtaining the word vectors of the words to be selected and converting the pinyin, establishing a letter adjacency table, and calculating the target pinyin letter vector, the problem of inaccurate semantic analysis is solved, the accuracy of semantic analysis is improved, and powerful for natural language processing is provided. Input supports.

CN114048751BActive Publication Date: 2024-11-22BEIJING MININGLAMP SOFTWARE SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111315985.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-08
Publication Date
2024-11-22
Estimated Expiration
2041-11-08

Smart Images

  • Figure CN114048751B_ABST
    Figure CN114048751B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for determining a pinyin letter vector, and belongs to the field of deep learning technology. The method includes: obtaining the word vector and converted pinyin of each word to be selected from a database; establishing a letter adjacency table; determining the target word corresponding to the target pinyin letter according to the letter adjacency table; determining the target word vector of the target word, determining the first number of target pinyin letters in the target word according to the letter adjacency table, and determining the second number of converted pinyin letters contained in the converted pinyin of the target word according to the database; determining the target vector of the target pinyin letter according to the target word vector, the first number and the second number. The present application enriches the vector representation based on character or word granularity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of deep learning technology, and in particular to a method, device, electronic device and storage medium for determining a phonetic letter vector. Background Art

[0002] Semantic analysis refers to the use of various machine learning methods to mine and learn deep concepts in texts, images, etc. Currently, semantic analysis generally uses vector representations at the granularity of characters or words, that is, word embedding is based on characters or words. However, it is difficult to fully and accurately analyze semantics by relying solely on embedding.

[0003] There is currently no good solution to the problem of inaccurate semantic analysis. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for determining a pinyin letter vector to solve the problem of inaccurate semantic analysis. The specific technical solution is as follows:

[0005] In a first aspect, a method for determining a phonetic letter vector is provided, the method comprising:

[0006] Obtaining a word vector and a converted pinyin of each word to be selected from a database, wherein the converted pinyin is a sharp pinyin or a round pinyin;

[0007] Establishing a letter adjacency table, wherein the letter adjacency table contains a correspondence between a pinyin letter, a converted pinyin containing the pinyin letter, and a to-be-selected word of the converted pinyin, and the number of the to-be-selected words corresponding to the pinyin letter is at least one;

[0008] Determine a target word corresponding to a target phonetic letter according to the letter adjacency table, wherein the target phonetic letter is any phonetic letter in the letter adjacency table, and the target word includes at least one word;

[0009] Determine a target word vector of the target word, determine a first number of target pinyin letters in the target word according to the letter adjacency table, and determine a second number of converted pinyin letters included in the converted pinyin of the target word according to the database;

[0010] A target vector for the target pinyin letter is determined according to the target word vector, the first number and the second number.

[0011] Optionally, before obtaining the word vector of each word to be selected from the database and converting the pinyin, the method further includes:

[0012] Determining a word vector of a word to be selected according to a text corpus, wherein the text corpus contains a plurality of words to be selected;

[0013] Performing pinyin marking on the words to be selected according to a Chinese dictionary to obtain the initial pinyin of the words to be selected, wherein the Chinese dictionary includes the initial pinyin of each word to be selected;

[0014] Converting the initial pinyin of the word to be selected into a conversion pinyin according to a dictionary of sharp and rounded sounds, wherein the dictionary of sharp and rounded sounds contains the correspondence between sharp characters and sharp sounds and between round characters and rounded sounds;

[0015] The word vector and converted pinyin of the word to be selected are saved in the database.

[0016] Optionally, converting the initial pinyin of the word to be selected into the converted pinyin according to the acute and rounded pronunciation dictionary comprises:

[0017] According to the dictionary of sharp and round sounds, the sharp character is selected from the words to be selected, and the initial pinyin corresponding to the sharp character is converted into a sharp sound;

[0018] Selecting a group character except the sharp character from the words to be selected;

[0019] The initial pinyin of the group character is used as the converted pinyin of the group character.

[0020] Optionally, the step of establishing a letter adjacency list includes:

[0021] Obtaining a specified letter in a preset alphabet, wherein the specified letter is any letter in the preset alphabet;

[0022] Determine the designated conversion pinyin containing the designated letters according to the database;

[0023] Establishing a correspondence between the designated letter, the designated converted pinyin of the designated letter, and the designated word corresponding to the designated converted pinyin;

[0024] According to the corresponding relationship, the letter adjacency table is established according to a preset letter arrangement order.

[0025] Optionally, establishing the letter adjacency table according to the corresponding relationship and in a preset letter arrangement order includes:

[0026] According to the order of arrangement of letters in the English alphabet, the letter adjacency table is established through the correspondence between the designated letters, the designated converted pinyin of the designated letters and the designated words corresponding to the designated converted pinyin.

[0027] Optionally, determining a target word vector of the target word includes:

[0028] Determine the total number of the target words according to the letter adjacency table, wherein the total number is the sum of the word numbers of the words corresponding to the target pinyin letters;

[0029] Determine the total word vector of the target word according to the database, wherein the total word vector is the sum of the word vectors of the words corresponding to the target pinyin letters;

[0030] The quotient of the total word vector and the total number is used as the target word vector of the target word.

[0031] Optionally, determining a target vector of the target phonetic letter according to the target word vector, the first number, and the second number comprises:

[0032] taking a quotient of the first quantity and the second quantity as an intermediate value;

[0033] The product of the target word vector and the intermediate value is used as the target vector for determining the target pinyin letter.

[0034] In a second aspect, a device for determining a phonetic letter vector is provided, the device comprising:

[0035] An acquisition module, used for acquiring a word vector and a converted pinyin of each word to be selected from a database, wherein the converted pinyin is a sharp pinyin or a round pinyin;

[0036] A building module, used for building a letter adjacency list, wherein the letter adjacency list contains the correspondence between the pinyin letters, the converted pinyin containing the pinyin letters, and the words to be selected of the converted pinyin, and the number of the words to be selected corresponding to the pinyin letters is at least one;

[0037] A first determination module is used to determine a target word corresponding to a target pinyin letter according to the letter adjacency table, wherein the target pinyin letter is any pinyin letter in the letter adjacency table, and the target word includes at least one word;

[0038] A second determination module is used to determine a target word vector of the target word, determine a first number of target pinyin letters in the target word according to the letter adjacency table, and determine a second number of converted pinyin letters included in the converted pinyin of the target word according to the database;

[0039] The third determination module is used to determine the target vector of the target pinyin letter according to the target word vector, the first number and the second number.

[0040] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0041] Memory, used to store computer programs;

[0042] The processor is used to implement any of the steps of the method for determining the phonetic letter vector when executing the program stored in the memory.

[0043] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the steps of the method for determining a phonetic letter vector is implemented.

[0044] Beneficial effects of the embodiments of the present application:

[0045] The present application is applied to natural language processing technology in the field of deep learning technology. An embodiment of the present application provides a method for determining a pinyin letter vector, the method comprising: a server obtains a word vector and a converted pinyin of each word to be selected from a database, wherein the converted pinyin is a sharp sound or a round sound, establishes a letter adjacency table, determines a target word corresponding to a target pinyin letter according to the letter adjacency table, determines a target word vector of the target word, determines a first number of target pinyin letters in the target word according to the letter adjacency table, and determines a second number of converted pinyin letters contained in the converted pinyin of the target word according to the database, and determines a target vector of the target pinyin letter according to the target word vector, the first number, and the second number.

[0046] In the present application, the server can obtain the target vector of the target pinyin letter, and use the above method to obtain the letter vector of each pinyin letter, so as to integrate the pronunciation of Chinese characters into the semantic analysis process, and use the letter vectors under the acute and round sounds to enrich the vector representation based on the character or word granularity, providing strong input support for subsequent text representation, text classification, clustering, automatic summarization, information extraction, human-computer dialogue and other applications.

[0047] Of course, implementing any product or method of the present application does not necessarily require achieving all of the above advantages at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application 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.

[0049] Figure 1A schematic diagram of the hardware environment of a method for determining a pinyin letter vector provided in an embodiment of the present application;

[0050] Figure 2 A flow chart of a method for determining a phonetic letter vector provided in an embodiment of the present application;

[0051] Figure 3 A schematic diagram of the structure of a device for determining a phonetic letter vector provided in an embodiment of the present application;

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

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0054] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present application and have no specific meaning. Therefore, "module" and "component" can be used interchangeably.

[0055] In order to solve the problem mentioned in the background technology, according to one aspect of the embodiments of the present application, an embodiment of a method for determining a pinyin letter vector is provided.

[0056] Optionally, in the embodiment of the present application, the above method for determining the pinyin letter vector can be applied to Figure 1 In the hardware environment composed of the terminal 101 and the server 103 shown in FIG. Figure 1 As shown, the server 103 is connected to the terminal 101 via a network, and can be used to provide services for the terminal or a client installed on the terminal. A database 105 can be set on the server or independently of the server to provide data storage services for the server 103. The above-mentioned network includes but is not limited to: a wide area network, a metropolitan area network or a local area network, and the terminal 101 includes but is not limited to a PC, a mobile phone, a tablet computer, etc.

[0057] A method for determining a pinyin letter vector in an embodiment of the present application may be executed by the server 103 to determine a vector of a pinyin letter.

[0058] The following will be combined with a specific implementation method to describe in detail a method for determining a phonetic letter vector provided in an embodiment of the present application. Figure 2 As shown, the specific steps are as follows:

[0059] Step 201: Obtain the word vector and converted pinyin of each word to be selected from the database.

[0060] Among them, the converted pinyin is the jian sound or the tuan sound.

[0061] In an embodiment of the present application, a database contains a plurality of words to be selected, each of which has a corresponding word vector and a converted pinyin, and each converted pinyin is composed of a plurality of converted pinyin letters.

[0062] Each word to be selected has an initial pinyin, and the converted pinyin is a sharp pinyin or a round pinyin, wherein the sharp pinyin is converted from the initial pinyin, and the round pinyin is the initial pinyin other than the sharp pinyin. The server obtains the word vector and the converted pinyin of each word to be selected in the database.

[0063] Exemplarily, the database contains four words to be selected: {sparrow, crucian carp, gather, everything}, and the converted pinyin corresponding to each word to be selected is {mazue, ziyu, zuji, yicie}. In this example, the converted pinyin is a sharp word sound.

[0064] Step 202: Create a letter adjacency list.

[0065] The letter adjacency table contains the correspondence between pinyin letters and the words to be selected containing the pinyin letters and the converted pinyin of the words to be selected, and the number of the words to be selected containing the pinyin letters is at least one.

[0066] In the embodiment of the present application, the preset alphabet includes all pinyin letters, and the server uses any letter in the preset alphabet as a designated letter and then obtains the designated letter. Since the database contains multiple conversion pinyins, each conversion pinyin is composed of multiple conversion pinyin letters, the server can determine the designated conversion pinyin corresponding to each designated letter according to the database, that is, the designated conversion pinyin containing the designated letter.

[0067] The database also stores the converted pinyin of each word to be selected. After the server obtains the designated converted pinyin, it can also obtain the designated word corresponding to the designated converted pinyin according to the database. In this way, the server obtains the designated letter, the designated converted pinyin corresponding to the designated letter, and the designated word corresponding to the designated converted pinyin. The server establishes a corresponding relationship between the designated letter, the designated converted pinyin and the designated word. Since the number of designated converted pinyins containing the designated letter is at least one, the number of designated words corresponding to the designated letter is also at least one.

[0068] The server establishes an alphabet adjacency list according to the correspondence relationship between the specified letter, the specified converted pinyin, and the specified word in the preset alphabetical order. In this way, the alphabet adjacency list contains the correspondence relationship among the pinyin letters, the converted pinyin containing the pinyin letters, and the candidate words of the converted pinyin. Among them, the number of candidate words containing pinyin letters is at least one.

[0069] Among them, the preset alphabetical order can be the alphabetical order in the English alphabet, can also be the alphabetical order in the Chinese dictionary, or can be other orders. This application does not make specific restrictions on the steps of the preset alphabetical order.

[0070] Exemplarily, the alphabet adjacency list is as follows:

[0071] a->sparrow (mazue)

[0072] c->everything (yicie)

[0073] e->sparrow (mazue)->everything (yicie)

[0074] i->crucian carp (ziyu)->gather (zuji)->everything (yicie) ......

[0076] Among them, a, c, e, and i are pinyin letters, mazue is the converted pinyin containing a, and "sparrow" is the candidate word corresponding to mazue;

[0077] yicie is the converted pinyin containing c, and "everything" is the candidate word corresponding to yicie;

[0078] mazue and yicie are the converted pinyin containing e, "sparrow" is the candidate word corresponding to mazue, and "everything" is the candidate word corresponding to yicie;

[0079] ziyu, zuji, and yicie are the converted pinyin containing i, "crucian carp" is the candidate word corresponding to ziyu, "gather" is the candidate word corresponding to zuji, and "everything" is the candidate word corresponding to yicie.

[0080] Step 203: Determine the target word corresponding to the target pinyin letter according to the alphabet adjacency list.

[0081] Among them, the target pinyin letter is any pinyin letter in the alphabet adjacency list, and the target word contains at least one word.

[0082] In the embodiment of the present application, after the server establishes the letter adjacency table, it selects any pinyin letter in the letter adjacency table as the target pinyin letter, and then determines the target word corresponding to the target pinyin letter according to the letter adjacency table. Since the number of words to be selected that contain the pinyin letter in the letter adjacency table is at least one, the target word corresponding to the target pinyin letter includes at least one word.

[0083] For example, if the target pinyin letter is z, then the target words corresponding to z are "sparrow", "carp" and "gather".

[0084] Step 204: Determine a target word vector of the target word, determine a first number of target pinyin letters in the target word according to the letter adjacency table, and determine a second number of converted pinyin letters included in the converted pinyin of the target word according to the database.

[0085] As an optional implementation, determining the target word vector of the target word includes: determining the total number of target words based on a letter adjacency list, wherein the total number is the sum of the word numbers of words corresponding to the target pinyin letters; determining the total word vector of the target word based on a database, wherein the total word vector is the sum of the word vectors of words corresponding to the target pinyin letters; and taking the quotient of the total word vector and the total number as the target word vector of the target word.

[0086] Since the target word corresponding to the target pinyin letter in the letter adjacency table contains at least one word, the server can determine the total number of words contained in the target word. Each candidate word in the database has a word vector, so the server can take the sum of the word vectors of each word in the target word as the total word vector of the target word, and then take the quotient of the total word vector and the total number as the target word vector of the target word, that is, the target word vector is the average value of the word vectors of each word in the target word.

[0087] For example, the target pinyin letter is z, and the target words corresponding to z are "sparrow", "carp", and "gather". The total number of words included in the target word is 3, V 麻雀 The word vector representing “sparrow”, V 鲫鱼 The word vector representing "carp", V 聚集 The target word vector of the target word is: (V 麻雀 +V 鲫鱼 +V 聚集 ) / 3.

[0088] The converted pinyin corresponding to the target word is: mazue, ziyu and zuji. The second number m of the converted pinyin letters (mazueziyuzuji) included in the converted pinyin is 13, and the first number n of the target pinyin letters (z) included in the converted pinyin is 3.

[0089] Step 205: Determine the target vector of the target pinyin letter according to the target word vector, the first quantity and the second quantity.

[0090] In an embodiment of the present application, the server takes the quotient of the first quantity and the second quantity as an intermediate value, which represents the ratio of the first quantity n of the target pinyin letters to the second quantity m of the converted pinyin letters of the target word, that is, the ratio of the target pinyin letters to the converted pinyin letters in the converted pinyin of the target word.

[0091] After the server obtains the target word vector s of the target word, it determines the product of the target word vector and the intermediate value to obtain the target vector of the target pinyin letter.

[0092] In this application, the server obtains the target word vector s of the target word corresponding to the target pinyin letter, and the ratio n / m of the target pinyin letter to the converted pinyin letter in the converted pinyin letter of the target word, and then obtains the target vector V of the target pinyin letter based on s*(n / m).

[0093] For example, the target phonetic letter is z, and the calculation formula of the target vector Vz of the target phonetic letter is: Vz=(V 麻雀 +V 鲫鱼 +V 聚集 ) / 3*(3 / 13).

[0094] In the present application, the server can obtain the target vector of the target pinyin letter, and use the above method to obtain the letter vector of each pinyin letter, so as to integrate the pronunciation of Chinese characters into the semantic analysis process, and use the letter vectors under the acute and round sounds to enrich the vector representation based on the character or word granularity, providing strong input support for subsequent text representation, text classification, clustering, automatic summarization, information extraction, human-computer dialogue and other applications.

[0095] As an optional implementation, before obtaining the word vector and converted pinyin of each word to be selected from the database, the method also includes: determining the word vector of the word to be selected based on a text corpus, wherein the text corpus contains multiple words to be selected; annotating the words to be selected with pinyin according to a Chinese dictionary to obtain the initial pinyin of the words to be selected, wherein the Chinese dictionary includes the initial pinyin of each word to be selected; converting the initial pinyin of the words to be selected into converted pinyin according to a sharp and rounded sound dictionary, wherein the sharp and rounded sound dictionary contains the correspondence between sharp characters and sharp sounds and the correspondence between round characters and rounded sounds; and saving the word vector and converted pinyin of the words to be selected in the database.

[0096] In an embodiment of the present application, a text corpus contains multiple words to be selected, and the server preprocesses the words to be selected, including but not limited to operations such as word segmentation and stop word removal. Preprocessing can improve the efficiency and accuracy of subsequent word vector generation. The server uses a word vector generation scheme to obtain the word vector of the word to be selected after preprocessing, and stores it in the form of <word to be selected, word vector>. Among them, the word vector generation scheme includes but is not limited to embedding models such as word2vec, glove, ELMo and BERT.

[0097] The Chinese dictionary includes the initial pinyin of each word to be selected, and the words to be selected include Chinese characters and words. The server annotates the words to be selected in <word to be selected, word vector> according to the Chinese dictionary, obtains the initial pinyin of the word to be selected, and obtains <word to be selected, initial pinyin, word vector>. The sharp and rounded sound dictionary contains the correspondence between sharp characters and sharp sounds and the correspondence between round characters and rounded sounds. The server converts the initial pinyin of the word to be selected into the converted pinyin according to the sharp and rounded sound dictionary, and obtains <word to be selected, converted pinyin, word vector>. The server saves the word vector and the converted pinyin of the word to be selected in the database.

[0098] As an optional implementation, converting the initial pinyin of the selected word into a converted pinyin according to the sharp and rounded pronunciation dictionary includes: selecting the character "jian" from the selected word according to the sharp and rounded pronunciation dictionary, and converting the initial pinyin corresponding to the character "jian" into a sharp sound; selecting the character "tuan" other than the character "jian" from the selected word; and using the initial pinyin of the character "tuan" as the converted pinyin of the character "tuan".

[0099] In the embodiment of the present application, the dictionary of sharp and round sounds contains the characters jian and tuan, and the server selects the character jian from the words to be selected according to the dictionary of sharp and round sounds, and converts the initial pinyin corresponding to the character jian into the sharp sound. The server selects the character tuan except the character jian from the words to be selected; and uses the initial pinyin of the character tuan as the converted pinyin of the character tuan.

[0100] Exemplarily, the words to be selected are {sparrow, crucian carp, gather, everything}, the initial pinyin corresponding to the words to be selected is {maque, jiyu, juji, yiqie}, and the acute sound corresponding to the initial pinyin is {mazue, ziyu, zuji, yicie}.

[0101] Optionally, an embodiment of the present application also provides a processing flow chart of a method for determining a pinyin letter vector, and the specific steps are as follows.

[0102] Step 1: Determine the word vector of the candidate word based on the text corpus.

[0103] Step 2: Mark the pinyin of the word to be selected according to the Chinese dictionary to obtain the initial pinyin of the word to be selected.

[0104] Step 3: Convert the initial pinyin of the selected word into the converted pinyin according to the acute and round-shaped pronunciation dictionary.

[0105] Step 4: Save the word vector and converted pinyin of the selected word into the database.

[0106] Step 5: Create a letter adjacency list.

[0107] Step 6: Determine the target word corresponding to the target pinyin letter according to the letter adjacency table.

[0108] Step 7: Determine the target word vector s of the target word, determine the first number n of target pinyin letters in the target word according to the letter adjacency table, and determine the second number m of converted pinyin letters contained in the converted pinyin of the target word according to the database.

[0109] Step 8: According to the formula s*n / m, obtain the target vector of the target pinyin letter.

[0110] Based on the same technical concept, the embodiment of the present application also provides a device for determining a pinyin letter vector, such as Figure 3 As shown, the device comprises:

[0111] The acquisition module 301 is used to acquire the word vector and converted pinyin of each word to be selected from the database, wherein the converted pinyin is a sharp pronunciation or a round pronunciation;

[0112] Establishing module 302, for establishing a letter adjacency table, wherein the letter adjacency table contains the correspondence between the pinyin letters, the converted pinyin containing the pinyin letters, and the words to be selected of the converted pinyin, and the number of the words to be selected corresponding to the pinyin letters is at least one;

[0113] A first determination module 303 is used to determine a target word corresponding to a target pinyin letter according to the letter adjacency table, wherein the target pinyin letter is any pinyin letter in the letter adjacency table, and the target word includes at least one word;

[0114] A second determination module 304 is used to determine a target word vector of the target word, determine a first number of target pinyin letters in the target word according to the letter adjacency table, and determine a second number of converted pinyin letters included in the converted pinyin of the target word according to the database;

[0115] The third determination module 305 is used to determine the target vector of the target pinyin letter according to the target word vector, the first quantity and the second quantity.

[0116] Optionally, the device is also used for:

[0117] Determine a word vector of a word to be selected according to a text corpus, wherein the text corpus contains multiple words to be selected;

[0118] Performing pinyin marking on the words to be selected according to the Chinese dictionary to obtain the initial pinyin of the words to be selected, wherein the Chinese dictionary includes the initial pinyin of each word to be selected;

[0119] Converting the initial pinyin of the word to be selected into the conversion pinyin according to the sharp and rounded sound dictionary, wherein the sharp and rounded sound dictionary contains the correspondence between the sharp characters and the sharp sound and the correspondence between the rounded characters and the rounded sound;

[0120] The word vector and converted pinyin of the selected word are saved in the database.

[0121] Optionally, the device is also used for:

[0122] According to the dictionary of sharp and round sounds, the sharp character is selected from the words to be selected, and the initial pinyin corresponding to the sharp character is converted into a sharp sound;

[0123] Select the group character except the sharp character from the words to be selected;

[0124] The initial pinyin of the character "tuan" is used as the converted pinyin of the character "tuan".

[0125] Optionally, the establishment module 302 is used to:

[0126] Get a specified letter in a preset alphabet, where the specified letter is any letter in the preset alphabet;

[0127] Determine the designated conversion pinyin containing the designated letters according to the database;

[0128] Establishing a correspondence between a specified letter, a specified converted pinyin of the specified letter, and a specified word corresponding to the specified converted pinyin;

[0129] According to the corresponding relationship, a letter adjacency table is established according to the preset letter arrangement order.

[0130] Optionally, the establishment module 302 is used to:

[0131] According to the order of letters in the English alphabet, a letter adjacency list is established through the correspondence between the specified letters, the specified converted pinyin of the specified letters, and the specified words corresponding to the specified converted pinyin.

[0132] Optionally, the second determining module 304 is used to:

[0133] Determine the total number of target words according to the letter adjacency list, wherein the total number is the sum of the word numbers of the words corresponding to the target pinyin letters;

[0134] Determine the total word vector of the target word according to the database, wherein the total word vector is the sum of the word vectors of the words corresponding to the target pinyin letters;

[0135] The quotient of the total word vector and the total number is taken as the target word vector of the target word.

[0136] Optionally, the third determining module 305 is used to:

[0137] taking the quotient of the first quantity and the second quantity as an intermediate value;

[0138] The product of the target word vector and the intermediate value is used as the target vector for determining the target pinyin letter.

[0139] According to another aspect of the embodiments of the present application, the present application provides an electronic device, such as Figure 4 As shown, it includes a memory 403, a processor 401, a communication interface 402 and a communication bus 404. The memory 403 stores a computer program that can be run on the processor 401. The memory 403 and the processor 401 communicate through the communication interface 402 and the communication bus 404. When the processor 401 executes the computer program, the steps of the above method are implemented.

[0140] The memory and processor in the above electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.

[0141] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0142] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0143] According to another aspect of the embodiments of the present application, a computer-readable medium having a non-volatile program code executable by a processor is provided.

[0144] Optionally, in an embodiment of the present application, a computer-readable medium is configured to store a program code for the processor to execute the above method:

[0145] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0146] When the embodiments of the present application are specifically implemented, reference may be made to the above-mentioned embodiments, which have corresponding technical effects.

[0147] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0148] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0149] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0150] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

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

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

[0153] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0154] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk. 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 that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, article or device. Without more constraints, an element defined by the phrase "comprising a..." does not exclude the existence of other identical elements in the process, method, article or apparatus comprising the element.

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

Claims

1. A method for determining a phonetic letter vector, characterized in that: The method includes: Obtaining the word vectors and converted pinyins of each candidate word from a database, where the converted pinyin is a sharp pinyin or a round pinyin; Establishing an alphabet adjacency list, where the alphabet adjacency list contains the corresponding relationships among pinyin letters, the converted pinyins containing the pinyin letters, and the candidate words of the converted pinyins, and the number of candidate words corresponding to the pinyin letters is at least one; Determining the target word corresponding to the target pinyin letter according to the alphabet adjacency list, where the target pinyin letter is any pinyin letter in the alphabet adjacency list, and the target word includes at least one word; Determining the target word vector of the target word, determining the first quantity of the target pinyin letter in the target word according to the alphabet adjacency list, and determining the second quantity of the converted pinyin letters included in the converted pinyin of the target word according to the database; Determining the target vector of the target pinyin letter according to the target word vector, the first quantity, and the second quantity.

2. The method according to claim 1, characterized in that Before obtaining the word vectors and converted pinyins of each candidate word from the database, the method further includes: Determining the word vectors of candidate words according to a text corpus, where the text corpus contains multiple candidate words; Performing pinyin annotation on the candidate words according to a Chinese dictionary to obtain the initial pinyins of the candidate words, where the Chinese dictionary includes the initial pinyins of each candidate word; Converting the initial pinyins of the candidate words into converted pinyins according to a sharp-round pinyin dictionary, where the sharp-round pinyin dictionary contains the corresponding relationships between sharp characters and sharp pinyins and between round characters and round pinyins; Saving the word vectors and converted pinyins of the candidate words into the database.

3. The method according to claim 2, characterized in that The converting the initial pinyins of the candidate words into converted pinyins according to the sharp-round pinyin dictionary includes: Selecting sharp characters from the candidate words according to the sharp-round pinyin dictionary and converting the initial pinyins corresponding to the sharp characters into sharp pinyins; Selecting round characters other than the sharp characters from the candidate words; Taking the initial pinyins of the round characters as the converted pinyins of the round characters.

4. The method according to claim 1, wherein The establishing the alphabet adjacency list includes: Obtaining a specified letter in a preset alphabet, where the specified letter is any letter in the preset alphabet; Determining the specified converted pinyin containing the specified letter according to the database; Establishing the corresponding relationship among the specified letter, the specified converted pinyin of the specified letter, and the specified words corresponding to the specified converted pinyin; Establishing the alphabet adjacency list according to the corresponding relationship in the preset alphabet arrangement order.

5. The method according to claim 4, characterized in that The establishing the alphabet adjacency list according to the corresponding relationship in the preset alphabet arrangement order includes: Establishing the alphabet adjacency list according to the letter arrangement order in the English alphabet through the corresponding relationship among the specified letter, the specified converted pinyin of the specified letter, and the specified words corresponding to the specified converted pinyin.

6. The method according to claim 1, characterized in that The determining the target word vector of the target word includes: Determining the total quantity of the target words according to the alphabet adjacency list, where the total quantity is the sum of the word quantities of the words corresponding to the target pinyin letter; Determine the total word vector of the target word according to the database, wherein the total word vector is the sum of the word vectors of the words corresponding to the target pinyin letters; The quotient of the total word vector and the total number is used as the target word vector of the target word.

7. The method according to any one of claims 1 to 6, characterized in that Determining the target vector of the target phonetic letter according to the target word vector, the first number, and the second number includes: taking a quotient of the first quantity and the second quantity as an intermediate value; The product of the target word vector and the intermediate value is used as the target vector for determining the target pinyin letter.

8. A device for determining a phonetic letter vector, characterized in that: The device comprises: An acquisition module is used to acquire the word vector and converted pinyin of each to-be-selected word from a database, wherein the converted pinyin is a sharp pronunciation or a round pronunciation; An establishment module is used to establish a letter adjacency table, wherein the letter adjacency table contains a correspondence between a pinyin letter, a converted pinyin containing the pinyin letter, and a to-be-selected word for the converted pinyin, and the number of to-be-selected words corresponding to the pinyin letter is at least one; A first determining module is configured to determine a target word corresponding to a target phonetic letter according to the letter adjacency table, wherein the target phonetic letter is any phonetic letter in the letter adjacency table, and the target word includes at least one word; a second determining module, configured to determine a target word vector of the target word, determine a first number of target phonetic letters in the target word according to the letter adjacency table, and determine a second number of converted phonetic letters contained in a converted phonetic of the target word according to the database; The third determination module is used to determine the target vector of the target pinyin letter according to the target word vector, the first number and the second number.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory for storing computer programs; A processor, configured to implement the method steps described in any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps according to any one of claims 1 to 7 are implemented.