IP Library Granted Patent US 12,373,654
Granted Patent B2
US 12,373,654 · App. 17/199,333 · Granted Jul 29, 2025

Model training method, machine translation method, computer device, and storage medium

Inventors: Zhaopeng Tu (Shenzhen, CN); Jian Li (Shenzhen, CN); Xing Wang (Shenzhen, CN); Longyue Wang (Shenzhen, CN)
Assignee: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
G06F40/44G06F17/16G06F18/2148G06N3/045G06N3/08G06V10/764G06V10/82
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,373,654
App. No.
17/199,333
Granted
Jul 29, 2025
Kind
B2
Abstract

Embodiments of this application disclose a neural network model training method, a machine translation method, a computer device, and a storage medium. The method includes: obtaining a training sample set including a training sample and a standard tag vector corresponding to the training sample; inputting the training sample into a neural network model including a plurality of attention networks to obtain a feature fusion vector; obtaining a predicted tag vector according to the feature fusion vector, and performing adjustment on a model parameter of the neural network model until a convergence condition is met to obtain a target neural network model.

Claims (78)

1. A neural network model training method, comprising:

obtaining a training sample set, the training sample set comprising a training sample and a standard tag vector corresponding to the training sample;

inputting the training sample into a plurality of attention networks of a neural network model, and performing nonlinear transformation on respective output vectors of the plurality of attention networks by using the neural network model;

obtaining a feature fusion vector corresponding to the plurality of attention networks;

obtaining a predicted tag vector outputted by the neural network model according to the feature fusion vector, the predicted tag vector corresponding to the training sample; and

performing iteration adjustment on a model parameter of the neural network model according to a result of a comparison between the predicted tag vector and the standard tag vector corresponding to the training sample; and

in response to the neural network model meeting a convergence condition, identifying a target neural network model,

wherein performing the nonlinear transformation on respective output vectors of the plurality of attention networks comprises:

splicing the respective output vectors of the plurality of attention networks to obtain a first output vector, wherein the first output vector is a vector spliced from the output vectors of the plurality of attention networks;

performing mapping on the first output vector with a first mapping parameter to obtain a second mapped output vector,

performing mapping on the first output vector with a second mapping parameter to obtain a third mapped output vector, the second mapping parameter being different from the first mapping parameter;

performing element-wise multiplication on the second mapped output vector and the third mapped output vector to obtain a fourth vector; and

obtaining the feature fusion vector corresponding to the plurality of attention networks based on the fourth vector.

2. The method according to claim 1 , wherein the obtaining the feature fusion vector corresponding to the plurality of attention networks based on the fourth vector comprises:

performing linear mapping on the fourth vector to obtain the feature fusion vector corresponding to the plurality of attention networks.

3. The method according to claim 1 , wherein the obtaining the feature fusion vector corresponding to the plurality of attention networks based on the fourth vector comprises:

fusing the fourth vector and the first output vector to obtain a fifth vector; and

performing linear mapping on the fifth vector to obtain the feature fusion vector corresponding to the plurality of attention networks.

4. The method according to claim 3 , wherein the fusing the fourth vector and the first output vector to obtain a fifth vector comprises:

sequentially splicing the fourth vector and the first output vector to obtain the fifth vector; or

performing element-wise multiplication on the fourth vector and the first output vector to obtain the fifth vector; or

performing element-wise addition on the fourth vector and the first output vector to obtain the fifth vector.

5. The method according to claim 1 , wherein performing iteration adjustment on a model parameter of the neural network model according to a result of a comparison between the predicted tag vector and the standard tag vector corresponding to the training sample; and in response to the neural network model meeting a convergence condition, identifying a target neural network model comprises:

determining a loss function value according to the result of comparison between the predicted tag vector corresponding to the training sample and the standard tag vector;

performing the iteration adjustment on the model parameter of the neural network model when the loss function value is greater than a target threshold; and

when the loss function value is less than or equal to the target threshold, determining that the current neural network model meets the convergence condition, and identifying the current neural network model as the target neural network model.

6. The method according to claim 1 , wherein the neural network model is a machine translation model and comprises an encoder and a decoder;

the encoder comprising N cascaded first-type network blocks, and each first-type network block comprising one multi-head attention network layer and one feedforward neural network layer that are cascaded; and

the decoder comprising N cascaded second-type network blocks, each second-type network block comprising two multi-head attention network layers and one feedforward neural network layer that are cascaded, and N being a positive integer greater than or equal to 1.

7. The method according to claim 1 , wherein the training sample is at least one of a to-be-translated text, a to-be-translated video, or a to-be-translated audio, and a standard tag corresponding to the training sample is a standard translated text.

8. A machine translation method, comprising:

obtaining to-be-translated content;

obtaining a translation result corresponding to the to-be-translated content by using a machine translation model, the machine translation model being obtained by performing training according to the model training method comprising:

obtaining a training sample set, the training sample set comprising a training sample and a standard tag vector corresponding to the training sample;

inputting the training sample into a plurality of attention networks of the machine translation model, and performing nonlinear transformation on respective output vectors of the plurality of attention networks;

obtaining a feature fusion vector corresponding to the plurality of attention networks;

obtaining a predicted tag vector outputted by the machine translation model according to the feature fusion vector, the predicted tag vector corresponding to the training sample;

performing iteration adjustment on a model parameter of the machine translation model according to a result of a comparison between the predicted tag vector and the standard tag vector corresponding to the training sample; and

in response to the neural network model meeting a convergence condition, identifying the machine translation model; and

displaying the translation result,

wherein performing the nonlinear transformation on respective output vectors of the plurality of attention networks comprises:

splicing the respective output vectors of the plurality of attention networks to obtain a first output vector, wherein the first output vector is a vector spliced from the output vectors of the plurality of attention networks;

performing mapping on the first output vector with a first mapping parameter to obtain a second mapped output vector;

performing mapping on the first output vector with a second mapping parameter to obtain a third mapped output vector, the second mapping parameter being different from the first mapping parameter;

performing element-wise multiplication on the second mapped output vector and the third mapped output vector to obtain a fourth vector; and

obtaining the feature fusion vector corresponding to the plurality of attention networks based on the fourth vector.

9. The method according to claim 8 , wherein the training sample is at least one of a to-be-translated text, a to-be-translated video, or a to-be-translated audio, and a standard tag corresponding to the training sample is a standard translated text.

10. A computer device, comprising a processor and a memory;

the memory being configured to store program code executable by the processor; and

the processor being configured to execute the program code and perform a plurality of operations comprising:

obtaining a training sample set, the training sample set comprising a training sample and a standard tag vector corresponding to the training sample;

inputting the training sample in the training sample set into a plurality of attention networks of a neural network model, and performing nonlinear transformation on respective output vectors of the plurality of attention networks by using the neural network model, to obtain a feature fusion vector corresponding to the plurality of attention networks;

obtaining a predicted tag vector outputted by the neural network model according to the feature fusion vector, the predicted tag vector corresponding to the training sample; and

performing iteration adjustment on a model parameter of the neural network model according to a result of comparison between the predicted tag vector corresponding to the training sample and the standard tag vector;

in response to the neural network model meeting a convergence condition, identifying a target neural network model,

wherein performing the nonlinear transformation on respective output vectors of the plurality of attention networks comprises:

splicing the respective output vectors of the plurality of attention networks to obtain a first output vector, wherein the first output vector is a vector spliced from the output vectors of the plurality of attention networks;

performing mapping on the first output vector with a first mapping parameter to obtain a second mapped output vector,

performing mapping on the first output vector with a second mapping parameter to obtain a third mapped output vector, the second mapping parameter being different from the first mapping parameter;

performing element-wise multiplication on the second mapped output vector and the third mapped output vector to obtain a fourth vector; and

obtaining the feature fusion vector corresponding to the plurality of attention networks based on the fourth vector.

11. The computer device according to claim 10 , wherein the processor is configured to execute the program code and perform a plurality of operations further comprising:

performing linear mapping on the fourth vector to obtain the feature fusion vector corresponding to the plurality of attention networks.

12. The computer device according to claim 10 , wherein the processor is configured to execute the program code and perform a plurality of operations further comprising:

fusing the fourth vector and the first output vector to obtain a fifth vector; and

performing linear mapping on the fifth vector to obtain the feature fusion vector corresponding to the plurality of attention networks.

13. The computer device according to claim 12 , wherein the processor is configured to execute the program code and perform a plurality of operations further comprising:

sequentially splicing the fourth vector and the first output vector to obtain the fifth vector; or

performing element-wise multiplication on the fourth vector and the first output vector to obtain the fifth vector; or

performing element-wise addition on the fourth vector and the first output vector to obtain the fifth vector.

14. The computer device according to claim 10 , wherein the processor is configured to execute the program code and perform a plurality of operations further comprising:

determining a loss function value according to the result of comparison between the predicted tag vector corresponding to the training sample and the standard tag vector;

performing the iteration adjustment on the model parameter of the neural network model when the loss function value is greater than a target threshold; and

when the loss function value is less than or equal to the target threshold, determining that the current neural network model meets the convergence condition, and using the current neural network model as the target neural network model.

15. The computer device according to claim 10 , wherein the neural network model is a machine translation model and comprises an encoder and a decoder;

the encoder comprising N cascaded first-type network blocks, and each first-type network block comprising one multi-head attention network layer and one feedforward neural network layer that are cascaded; and

the decoder comprising N cascaded second-type network blocks, each second-type network block comprising two multi-head attention network layers and one feedforward neural network layer that are cascaded, and N being a positive integer greater than or equal to 1.

16. A non-transitory computer readable storage medium storing computer instructions that, when being executed by a processor, cause the processor to perform the method according to claim 1 .

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 17, 2021
From: TU, ZHAOPENG; LI, JIAN; WANG, XING; WANG, LONGYUE
To: TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED
Reel/Frame 055630/0789 →
Priority Claims (1)
CN 201811436794.0 · Nov 28, 2018 · national
Continuity (2)
Continuation PCTCN2019120975 · Nov 26, 2019
Related Publication 20210201147A1 · Jul 1, 2021
References Cited (32)
US 11775311B2 · Liu · 2023 [cited by examiner]
US 20160314478A1 · Krasnikov · 2016 [cited by examiner]
US 20190251952A1 · Arik · 2019 [cited by examiner]
US 20200104729A1 · Busbridge · 2020 [cited by examiner]
US 20200132491A1 · Zhang · 2020 [cited by examiner]
US 20200342316A1 · Shazeer · 2020 [cited by examiner]
US 20210406483A1 · Suzuki · 2021 [cited by examiner]
CN 106934413A · 2017 [cited by applicant]
CN 107633225A · 2018 [cited by applicant]
CN 108416440A · 2018 [cited by applicant]
CN 109344391A · 2018 [cited by examiner]
CN 110162799A · 2019 [cited by applicant]
Vaswani, Ashish, et al. “Attention Is All You Need.” 2017. (Year: 2017). [cited by examiner]
Xia, Yingce, et al. “Model-Level Dual Learning.” 2018. (Year: 2018). [cited by examiner]
Shen, Tao, et al. “Disan: Directional self-attention network for rnn/cnn-free language understanding.” (Year: 2018). [cited by examiner]
Zhang, Tingting, et al. “Feature-level deeper self-attention network for sequential recommendation.” (Year: 2019). [cited by examiner]
Zhang, Bill. “Google's neural machine translation system: Bridging the gap between human and machine translation.” (Year: 2016). [cited by examiner]
Vaswani, A. “Attention is all you need.” (Year: 2017). [cited by examiner]
Shen, et al. “Disan: Directional self-attention network for rnn/cnn-free language understanding.” (Year: 2018). [cited by examiner]
Fukui, et al. “Multimodal compact bilinear pooling for visual question answering and visual grounding.” (Year: 2016). [cited by examiner]
Kim, et al., “Bilinear attention networks.” (Year: 2018). [cited by examiner]
The Japan Patent Office (JPO) Notification of Reasons for Refusal for Application No. 2021-505689 and Translation Apr. 26, 2022 25 Pages. [cited by applicant]
Ashish Vaswani et al., “Attention Is All You Need,” arXiv:1706.03762v5, Dec. 6, 2017. 15 pages. [cited by applicant]
Makoto Marishita et al., “Improving Neural Machine Translation by Incorporating Hierarchical Subword Features,” The 32nd Annual Conference of the Japanese Society for Artificial Intelligence, Jun. 5, 2018, https://www.i… [cited by applicant]
Aurelien Geron, “Practical machine learning with scikit-learn and TensorFlow,” O'Reilly Japan, First edition, Apr. 26, 2018, p. 268, 381-412. 48 pages. [cited by applicant]
Takeshi Fujita, “Deep Learning with C++,” Mynavi Publishing Co., Ltd., First edition, Jun. 25, 2017. 14 pages. [cited by applicant]
The World Intellectual Property Organization (WIPO) International Search Report for PCT/CN2019/120975 Mar. 4, 2020 5 Pages (including translation). [cited by applicant]
Ashish Vaswani et al., “Attention is All You Need,” In Proceedings of Conference on Neural Information Processing Systems (NIPS 2017), arXiv:1706.0376, Dec.6, 2017. 15 pages. [cited by applicant]
Tao Shen et al., “DiSAN: Directional Self-Attention Network for RNN/CNN free Language Understanding,” In Proceedings of AAAI 2018. 10 pages. [cited by applicant]
Karim Ahmed al., “Weighted Transformer Network for Machine Translation,” In arXiv preprint arXiv:1711.02132, Nov. 6, 2017. 10 pages. [cited by applicant]
Biao Zhang et al., “Shallow Convolutional Neural Network for Implicit Discourse Relation Recognition,” In Proceedings of EMNLP 2015, pp. 2230-2235. 6 pages. [cited by applicant]
Jin-Hwa Kim et al., “Hadamard Product For Low-Rank Bilinear Pooling,” In Proceedings of ICLR 2017, arXiv:1610.04325, Mar. 26, 2017. 14 pages. [cited by applicant]