A Chinese word vector compression method, system and storage medium

By constructing a mapping table from part-of-speech to encoding length and autoencoder technology, the memory occupation problem of large-scale word vector models on resource-limited devices is solved, efficient word vector compression is achieved, semantic information is maintained, and it is suitable for memory-constrained applications. Limited equipment.

CN114970456BActive Publication Date: 2024-09-24XIAMEN MEIYA PICO INFORMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210582102.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2024-09-24
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

Existing technologies cannot effectively reduce memory usage when compressing large-scale word vector models, making them unsuitable for devices with limited resources. At the same time, a large amount of semantic information will be lost during the dimensionality reduction process, resulting in insufficient compression rates.

Method used

By constructing a mapping table from part-of-speech to encoding length, Chinese part-of-speech information is used to compress word vector features, and an autoencoder is used to obtain discrete coding in the dimensionality reduction stage. The encoding book is learned in the decoding stage to construct word vector features to achieve efficient word vectors. compression.

Benefits of technology

It significantly improves the compression rate of the word vector model, maintains semantic information, is suitable for devices with limited memory, and improves the robustness and application scope of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The present invention proposes an end-to-end large-scale Chinese word vector compression method, including: S1, constructing a mapping table of parts of speech to coding lengths according to the part-of-speech distribution of the original word vector; S2, compressing the original word vector features to generate compressed codes, reconstructing the word vector through the compressed codes and the code book, and obtaining the reconstructed word vector features, wherein the code book is a compressed code matrix. The above scheme uses Chinese parts of speech to retain semantic information, and the compressed codes belonging to the same part of speech share the same code book, thereby realizing the sharing of semantic information between the same parts of speech, while maintaining the semantic analysis performance of the model, further reducing the compressed codes of the large-scale vocabulary, improving the compression rate of the model, and realizing the effective compression of the large-scale Chinese word vector model. The present invention also proposes a corresponding Chinese word vector compression system and storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of natural language processing technology, and specifically relates to a Chinese word vector compression method. Background Art

[0002] Word vector representation methods are widely used in tasks such as machine translation, text classification, and reading comprehension. With the increase of training samples and the deepening of network layers, word vector models can have richer semantic information. Compared with ordinary-scale word vector models, large-scale word vectors can achieve better performance in downstream tasks. However, memory consumption is also increasing. The size of a word vector model may reach more than ten GB or even higher. When faced with such a large-scale word vector model, the memory usage of its vocabulary size cannot be ignored. The number of vocabulary may be hundreds of thousands or even millions. The increasing size of word vector models makes it difficult to apply to small devices with limited memory, such as mobile phones and portable devices.

[0003] In the prior art, the most direct way to compress word vector models is to perform feature dimensionality reduction, transforming the word vector features in high-dimensional space into low-dimensional space for representation. Common methods include principal component analysis (PCA) and linear discriminant analysis (LDA). However, most of the semantic information will inevitably be lost in the process of dimensionality reduction, which will have a great impact on the performance of the model. At the same time, the above methods mainly compress feature vectors, while the compressed encoding of the quantized vocabulary can still reach tens of MB. For large-scale word vectors, the model compression rate of the existing methods is significantly reduced, and the word vector model cannot be fully and effectively compressed, and it is still difficult to apply to resource-constrained devices.

[0004] In addition, even if the feature dimension is reduced, the floating-point vector representation method still consumes a lot of memory. In order to further reduce memory usage, Tissier et al. proposed a binary constrained autoencoder that converts floating-point data into binary vector representation while retaining semantic information. The compression rate of its word vector model can reach 97% within a performance loss of about 2%, realizing the application of conventional word vectors on miniaturized devices. Summary of the invention

[0005] In view of the above problems, this application proposes a Chinese word vector compression method, which includes the following steps:

[0006] S1, construct a mapping table from part of speech to encoding length based on the part of speech distribution of the original word vector;

[0007] S2, compress the original word vector feature to generate a compressed code, reconstruct the word vector through the compressed code and the code book to obtain the reconstructed word vector feature, wherein the code book is a compressed code matrix.

[0008] The above scheme uses Chinese parts of speech to retain semantic information. The compression codes belonging to the same part of speech share the same code book, realizing the sharing of semantic information between the same parts of speech, further reducing the compression coding of large-scale vocabularies, improving the compression rate of the model, and realizing effective compression of large-scale Chinese word vector models.

[0009] Furthermore, S1 specifically includes:

[0010] S11, input the original word vector model Mod and the original word vector vocabulary V;

[0011] S12, obtaining the part of speech of each word w in the original word vector vocabulary;

[0012] S13, counting the part-of-speech categories to obtain a first set P of the part-of-speech categories = {p 1 ,p 2 ,..,p n}, where n is the number of part-of-speech categories;

[0013] S14, calculate the number of words and their proportion m in each part of speech i , and obtain M = {m 1 ,m 2 ,..,m n},in

[0014] S15, re-dividing the parts of speech according to the quantity proportion, and dividing the parts of speech into parts of speech with a quantity proportion less than p c The categories are classified into the same category to obtain the second set of part-of-speech categories Each category The division method is as follows:

[0015]

[0016] where i=1,2,…,n,i * =1,2,…,n * ;

[0017] S16, mapping the second set C to a code length L={l 1 ,l 2 ,..,l n *}, the mapping function is as follows:

[0018]

[0019] Among them lmax =64.

[0020] The above method performs part-of-speech analysis on the original Chinese word vector model, counts the distribution of parts of speech, and designs a coding length mapping method to construct a coding length mapping table. Using Chinese part-of-speech information, words can be directly and efficiently mapped to codes of different lengths, thereby compressing large-scale word table codes and significantly improving the compression rate of the model.

[0021] Preferably, the part of speech in S12 is obtained using a part of speech analyzer in Jieba.

[0022] Preferably, M in S14 is obtained by sorting from high to low according to the proportion of the number of words. This sorting method makes the code length mapped to the part of speech with a larger proportion of the number of words shorter, thereby effectively compressing the code length and reducing the memory usage of the vocabulary encoding.

[0023] Furthermore, S2 specifically includes:

[0024] S21, traverse each word w and feature vector v in the original word vector vocabulary V w , the compressed code of the encoded output layer is obtained through the encoder w and the output vector h of the hidden layer w :

[0025]

[0026]

[0027] Among them, w 1 、w 2 and b 1 , b 2 are the weight matrix and bias term of the hidden layer and the encoding output layer respectively;

[0028] S22, obtain the code book corresponding to the code length The size of the i-th codebook Among them l i is the encoding length, H is the hidden layer size;

[0029] S23, reconstructing the word vector feature of word w according to the compression code and the code book D Define the loss function of the autoencoder:

[0030]

[0031] By optimizing the loss function, the final word vector compression model and reconstructed word vector features are trained.

[0032] The autoencoder proposed in the above method obtains the discrete code of each word vector in the dimensionality reduction stage, learns the code book in the decoding stage, and finally constructs the word vector feature by combining the floating-point basis vectors in the code book through discrete code indexing, which can effectively improve the compression rate of the model. Words with the same part of speech use the same code book and share the common information between parts of speech, which helps to retain the semantic information of the word vector feature and improve the robustness of the model.

[0033] Further, S22 further includes compressing the code o w Through the mask matrix Update to o′ w :

[0034]

[0035] The size of the mask matrix is where l×d l The part is set to 1 and the rest is set to 0.

[0036] By constructing a mask matrix, the variable-length coding representation of the feature vector is realized.

[0037] S22 further includes using Gumbel-Softmax Trick to process the updated compressed code into e i :

[0038] e i =softmax((log(o′ wi )+G i ) / τ)

[0039] G i =-log(-log(U i ))

[0040] Where i represents the i-th bit code, τ is the temperature coefficient, U i ~U(0,1).

[0041] Using Gumbel-Softmax Trick, discrete encoding It is modeled as a discrete multinomial distribution and used to update network parameters.

[0042] Preferably, the size of the hidden layer is H=1024.

[0043] This application further proposes a Chinese word vector compression system, including:

[0044] Chinese part-of-speech analysis module: configured to construct a mapping table from part-of-speech to encoding length based on the part-of-speech distribution of the original word vector;

[0045] Autoencoder module: configured to encode the original word vector feature v w Compression is performed to generate a compression code, and the word vector is reconstructed through the compression code and the code book to obtain the reconstructed word vector feature The code book is a compressed code matrix.

[0046] The present application further proposes a computer-readable storage medium for Chinese word vector compression, on which one or more computer programs are stored, and when the one or more computer programs are executed by a computer processor, any of the above methods is implemented.

[0047] The end-to-end large-scale Chinese word vector compression model proposed in this paper can improve the compression rate of large-scale word vector models, thereby realizing the application of word vector models on portable devices with limited memory, while maintaining the model's semantic analysis performance without sacrificing the performance of various downstream text analysis tasks, thereby expanding the application scope of text analysis models on hardware devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings help to further understand the present application. The elements of the accompanying drawings are not necessarily in proportion to each other. For ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.

[0049] Figure 1 Schematic diagram of a process of compressing a Chinese word vector in one embodiment;

[0050] Figure 2 This is an overall framework diagram of a Chinese word vector compression model in one embodiment;

[0051] Figure 3 This is a flow chart of a Chinese part-of-speech analysis module in one embodiment;

[0052] Figure 4 is a flow chart of an autoencoder module in one embodiment;

[0053] Figure 5 This is a schematic diagram of the structure of a Chinese word vector compression system in one embodiment;

[0054] Figure 6 It is a structural diagram of a computer system of an electronic device suitable for implementing an embodiment of the present application in an embodiment. DETAILED DESCRIPTION

[0055] Information loss during the model compression process is unavoidable. The compression method only retains the most effective key semantic information as much as possible, with the aim of minimizing the semantic difference between the reconstructed word vector features and the original features. The inventors note that the model compression methods in the prior art are mainly designed based on English models, but the methods of extracting effective semantic information in different language structures are not the same. Unlike English, there is naturally some rich semantic information in the Chinese language system, such as radicals, pinyin, parts of speech, etc. To a certain extent, these semantic information contributes to the construction of the semantic features of the model. From this perspective, the present invention proposes a Chinese word vector compression method using part-of-speech information.

[0056] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention.

[0057] Figure 1 : is a flow chart of a Chinese word vector compression method according to an embodiment of the present application, the flow chart includes:

[0058] S1, construct a mapping table from part of speech to encoding length based on the part of speech distribution of the original word vector;

[0059] S2, compress the original word vector feature to generate a compressed code, reconstruct the word vector through the compressed code and the code book to obtain the reconstructed word vector feature, wherein the code book is a compressed code matrix.

[0060] Figure 2 This is an overall framework diagram of the Chinese word vector compression model in one embodiment; the process includes: obtaining the original word vector model, using the part-of-speech analysis module and the autoencoder module to obtain the compressed word vector model.

[0061] Figure 3 This is a flow chart of the Chinese part-of-speech analysis module in an embodiment; the Chinese part-of-speech analysis module performs part-of-speech analysis on the original Chinese word vector model, counts the distribution of the part-of-speech and designs a coding length mapping method to construct a coding length mapping table. The specific implementation process is as follows:

[0062] 1) Input the original word vector model Mod;

[0063] 2) Obtain the part of speech p of each word w in the original word vector vocabulary V through part of speech analysis; in a preferred embodiment, the part of speech can be obtained using the part of speech analyzer in the Jieba tool;

[0064] 3) The set of all part-of-speech categories in the statistical word vector is P = {p 1 ,…,p n}, where n represents the number of part-of-speech categories;

[0065] 4) Calculate the number of words and their proportion m in each part of speech i , we get M = {m 1 ,…,m n}, In a preferred embodiment, the numbers are sorted from high to low according to their percentage;

[0066] 5) Re-divide the parts of speech into n according to the proportion of each part of speech * class, part of speech To avoid too many parts of speech, the proportion of parts of speech is less than p c The categories are grouped into the same category, and each category The division method is as follows:

[0067]

[0068] In a preferred embodiment, p c =0.05;

[0069] 6) Map the part-of-speech classification category C to the encoding length L = {l 1 ,…,l n*}, set the maximum encoding length l max =64, the mapping function is as follows

[0070]

[0071] At this point, the mapping table T from part of speech to code length is completed, as shown in the following table. Words of different part of speech categories have different code lengths, and the larger the proportion of part of speech, the shorter the mapped code length, which can effectively compress the code length and reduce the memory usage of the vocabulary encoding.

[0072] Table 1 Part of speech to encoding length mapping table

[0073]

[0074] Figure 4 This is a flow chart of the autoencoder module in one embodiment. The autoencoder consists of an encoder and a decoder. The encoder first compresses the original word vector features to generate a compressed code, and then the decoder reconstructs the word vector features through the compressed code and the code book. The specific implementation process is as follows:

[0075] 1) Traverse each word w and feature vector v in the original word vector vocabulary V w , the int index vector o can be obtained through the encoder w , that is, the compression coding of the encoding output layer,

[0076]

[0077]

[0078] where h w represents the output vector of the hidden layer. In the experiment, the hidden layer size is set to H = 1024, w 1 、w 2 and b 1 , b 2 They are the weight matrix and bias term of the hidden layer and the encoding output layer respectively.

[0079] 2) According to the part of speech of word w, the encoding length l of the word is obtained from the mapping table T. Since the length of the encoding vector is different, it is necessary to decode the encoding book of different lengths, that is, the compressed encoding matrix, n * The encoding length corresponds to n * This coding book The size of the i-th code book is

[0080]

[0081] In order to realize the variable-length coding representation of the feature vector, it is necessary to construct a mask matrix The matrix size is where l×d l The part of is set to 1, and the rest is set to 0. The discrete code after mask update is

[0082]

[0083] Discrete coding cannot perform gradient calculation, and thus cannot update network parameters. Therefore, Gumbel-SoftmaxTrick is used to model the discrete coding o′ as a discrete multinomial distribution.

[0084]

[0085] Where i represents the i-th bit code, G i =-log(-log(U i )),U i ~U(0,1) to ensure the randomness of the distribution, τ is the temperature coefficient, which is a hyperparameter that controls randomness in the softmax function. The smaller τ is, the closer it is to the discrete one-hot distribution. Here, τ=1 is set.

[0086] 3) e w Input decoder, reconstruct the word vector features of word w through encoding book D

[0087]

[0088] Where E is the maximum length of the compression code;

[0089] The loss function of the autoencoder is defined as

[0090]

[0091] By optimizing the loss function, the final word vector compression model is trained.

[0092] This application further proposes a Chinese word vector compression system. Figure 5 : is a schematic diagram of the structure of a Chinese word vector compression system in one embodiment, including:

[0093] Chinese part-of-speech analysis module 501: configured to construct a mapping table of part-of-speech to encoding length according to the part-of-speech distribution of the original word vector;

[0094] Autoencoder module 502: configured to compress the original word vector features to generate compressed codes, reconstruct the word vectors through the compressed codes and the code book to obtain reconstructed word vector features, and the code book is a compressed code matrix.

[0095] Figure 6 The schematic diagram of the structure of a computer system 600 suitable for implementing the electronic device of the embodiment of the present application is shown. The electronic device is only an example and should not bring any limitation to the function and scope of use of the embodiment of the present application.

[0096] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0097] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0098] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above functions defined in the method of the present application are executed. It should be noted that the computer-readable storage medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device, or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.

[0099] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0100] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0101] On the other hand, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or it may exist independently without being assembled into the electronic device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device: constructs a mapping table of part of speech to coding length according to the part of speech distribution of the original word vector; compresses the original word vector feature to generate a compressed code, reconstructs the word vector through the compressed code and the code book, and obtains the reconstructed word vector feature, wherein the code book is a compressed coding matrix.

[0102] The above embodiment provides an end-to-end large-scale Chinese word vector deep compression encoding model, which effectively improves the compression rate of the model while maintaining the semantic analysis performance of the model.

[0103] Although the contents of the present application are specifically demonstrated and described in conjunction with the preferred embodiments, those skilled in the art should understand that various changes made to the present application in form and detail without departing from the spirit and scope of the present application as defined by the appended claims and without making any creative work are within the scope of protection of the present application.

Claims

1. A Chinese word vector compression method, characterized in that: The following steps are involved: S1, construct a mapping table from part of speech to encoding length based on the part of speech distribution of the original word vector; S2, compressing the original word vector feature to generate a compressed code, reconstructing the word vector through the compressed code and the code book to obtain the reconstructed word vector feature, wherein the code book is a compressed code matrix; S1 specifically includes: S11, input the original word vector model Mod and the original word vector vocabulary V; S12, obtaining the part of speech of each word w in the original word vector vocabulary; S13, counting the part-of-speech categories, and obtaining the first set of the part-of-speech categories P = {p1, p2, .., p n }, where n is the number of part-of-speech categories; S14, calculate the number of words and their proportion m in each part of speech i , we get M = {m1,m2,..,m n },in S15, re-dividing the parts of speech according to the proportion of the quantity, and dividing the parts of speech into parts of speech with a proportion less than p c The categories are classified into the same category to obtain the second set of part-of-speech categories Each category The division method is as follows: Where i = 1, 2, ..., n, i * = 1, 2, …, n * ; S16, mapping the second set C to a coding length The mapping function is as follows: Among them l max is the maximum value of the encoding length, l max =64; S2 specifically includes: S21, traverse each word w in the original word vector vocabulary V and the original word vector feature v w , the compressed code of the encoded output layer is obtained through the encoder w and the output vector h of the hidden layer w : Among them, w1, w2 and b1, b2 are the weight matrix and bias term of the hidden layer and the encoding output layer respectively; S22, obtain the code book corresponding to the code length The size of the i-th codebook Among them l i is the encoding length, H is the size of the hidden layer; S23, reconstructing the word vector feature of word w according to the compression code and the code book D Define the loss function of the autoencoder: By optimizing the loss function, the final word vector compression model is trained and the word vector features of the reconstructed word w are obtained.

2. A Chinese word vector compression method according to claim 1, characterized in that: The part of speech described in S12 is obtained using the part of speech analyzer in Jieba.

3. A Chinese word vector compression method according to claim 1, characterized in that: In S14, M is obtained by sorting the words from high to low according to their proportion in quantity.

4. A Chinese word vector compression method according to claim 1, characterized in that: S22 further package Including, compress the code w Through the mask matrix Updated to o w : The size of the mask matrix is where l×d l The part is set to 1 and the rest is set to 0.

5. A Chinese word vector compression method according to claim 1, characterized in that: S22 further includes using Gumbel-Softmax Trick to process the updated compressed code into e i : G i =-log(-log(U i )) Where i represents the i-th bit code, τ is the temperature coefficient, U i ~U(0,1).

6. A Chinese word vector compression method according to claim 1, characterized in that: The size of the hidden layer is H=1024.

7. A Chinese word vector compression system, characterized in that: include: Chinese part-of-speech analysis module: configured to construct a mapping table of part-of-speech to encoding length according to the part-of-speech distribution of the original word vector; including S11, inputting the original word vector model Mod and the original word vector vocabulary V; S12, obtaining the part-of-speech of each word w in the original word vector vocabulary; S13, counting the part-of-speech categories, and obtaining the first set of the part-of-speech categories P = {p1, p2, .., p n }, where n is the number of part-of-speech categories; S14, calculate the number of words and the proportion of words in each part-of-speech category m i , we get M = {m1,m2,..,m n },in S15, re-dividing the parts of speech according to the proportion of the quantity, and dividing the parts of speech into parts of speech with a proportion less than p c The categories are classified into the same category to obtain the second set of part-of-speech categories Each category The division method is as follows: Where i = 1, 2, ..., n, i * = 1, 2, …, n * ; S16, mapping the second set C to a coding length The mapping function is as follows: Among them l max is the maximum value of the encoding length, l max =64; Autoencoder module: configured to encode the original word vector feature v w Compress and generate a compressed code, reconstruct the word vector through the compressed code and the code book, and obtain the word vector feature of the reconstructed word w The code book is a compressed code matrix; Including S21, traversing each word w in the original word vector vocabulary V and the original word vector feature v w , the compressed code of the encoded output layer is obtained through the encoder w and the output vector h of the hidden layer w : Among them, w1, w2 and b1, b2 are the weight matrix and bias term of the hidden layer and the encoding output layer respectively; S22, obtain the code book corresponding to the code length The size of the i-th codebook Among them l i is the encoding length, H is the size of the hidden layer; S23, reconstructing the word vector feature of word w according to the compression code and the code book D Define the loss function of the autoencoder: By optimizing the loss function, the final word vector compression model is trained and the word vector features of the reconstructed word w are obtained.

8. A computer-readable storage medium for Chinese word vector compression, storing one or more computer programs, characterized in that: When the one or more computer programs are executed by a computer processor, the method according to any one of claims 1 to 6 is implemented.