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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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 ...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com