Translation model compression method, translation method and related device

A technology of translation model and compression method, which is applied in natural language translation, instrumentation, computing, etc. It can solve problems such as large memory usage, loss of translation quality, unreasonable compression method, etc., and achieve the effect of small impact and reduced occupied space

Pending Publication Date: 2022-06-24
ALIBABA (CHINA) CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] However, the memory resources of this type of terminal equipment are generally limited, and the memory on the terminal equipment is usually shared by the system module, translation module, optical character recognition module, man-machine dialogue module, etc., and th

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Translation model compression method, translation method and related device
  • Translation model compression method, translation method and related device
  • Translation model compression method, translation method and related device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0048] refer to figure 1 As shown, a flowchart of steps of a translation model compression method provided in the embodiment of this specification, the execution subject of the compression method may be a hardware device (for example, a smart phone, a personal computer, a wearable device, a Tablet computer, etc.) or a software device (for example, a client or a combination of software modules integrated on the aforementioned various hardware devices), which is not limited in this specification. The translation model compression method may include the following steps:

[0049]Step 102: Extract a vocabulary vector set from the target translation model obtained by training, wherein the elements of the vocabulary vector in the vocabulary vector set are normally distributed.

[0050] Words Embedding is the matrix value obtained by vectorizing the source word table and the target word table respectively in the translation model. In a trained target translation model, the number of...

Embodiment 2

[0079] refer to figure 2 shown in the figure is a flowchart of steps of a translation method provided in the embodiment of this specification, and the execution subject of the translation method may be a hardware device (for example, a smart phone, a personal computer, a wearable device, a tablet computer) with certain computing and processing capabilities. etc.) or a software device (for example, a client or a combination of software modules integrated on the aforementioned various hardware devices), in fact, the execution body of the translation method may be the same as the execution body of the translation model compression method in Embodiment 1, or It can be different, and this specification does not limit it. The translation method may include the following steps:

[0080] Step 202: Determine the target original text to be translated.

[0081] The target text can be any segment of the same language type as the source text contained in the vocabulary vector in the tar...

Embodiment 3

[0092] The above translation model compression scheme and translation scheme will be described in detail below with a specific example.

[0093] Assuming that the target translation model has been trained, the distribution characteristics of the elements in the vocabulary vector in the target translation model satisfy the following: a normal distribution, clustered around 0; the distribution interval is small, and the distribution is concentrated.

[0094] refer to image 3 As shown, first, the elements in the vocabulary vector are mapped to image 3 In the coordinate system shown, the vocabulary vectors are distributed in an open interval. In actual projects, it will be concentrated between [-0.5, 0.5]. Generally, a more concentrated interval is selected as the quantization interval, which will reduce the loss of quantization accuracy due to data dispersion.

[0095] Usually, the precision of the vocabulary vector after model training is a 32-bit floating point number, and ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

One or more embodiments of the present specification disclose a translation model compression method, a translation method and a related device, the method comprising: extracting a word list vector set from a target translation model, determining a quantization interval based on a normal distribution result mapped by the word list vector set, calculating the number of interval segments to be divided according to the determined quantization precision, dividing the quantization interval into a plurality of quantization interval sections with the same number as the interval sections according to an equal division mode, distributing a unique interval number for each quantization interval section, and respectively dividing high-bit original values corresponding to elements of word list vectors contained in each quantization interval section into a plurality of quantization interval sections, and replacing with a high-bit interval number of the corresponding quantization interval section, and writing a word list vector represented by the interval number into the target translation model. Therefore, compression of the target translation model is realized.

Description

technical field [0001] This document relates to the technical field of artificial intelligence, in particular to a translation model compression method, translation method and related apparatus. Background technique [0002] With the continuous development of machine translation technology, online translation has been widely used. At the same time, with the upgrade of business, there are more and more application scenarios for offline translation. Terminal devices such as scanning pens, translators, and simultaneous interpretation headsets usually use translation functions in no or weak network environments. . [0003] However, the memory resources of such terminal equipment are generally limited, and the memory on the terminal equipment is usually shared by the system module, translation module, optical character recognition module, human-machine dialogue module, etc., and the memory occupies a large amount. [0004] At present, many compression schemes for translation mo...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
IPC IPC(8): G06F40/284G06F40/58
CPCG06F40/58G06F40/284
Inventor 徐浩广
Owner ALIBABA (CHINA) CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products