IP Library Granted Patent US 10,878,199
Granted Patent B2
US 10,878,199 · App. 16/587,676 · Granted Dec 29, 2020

Word vector processing for foreign languages

Inventors: Shaosheng Cao (Hangzhou, CN); Xiaolong Li (Hangzhou, CN)
Assignee: Advanced New Technologies Co., Ltd.
G06F40/30G06F40/53G06N3/084G06N20/00
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 10,878,199
App. No.
16/587,676
Granted
Dec 29, 2020
Kind
B2
Abstract

A word vector processing method is provided. Word segmentation is performed on a corpus to obtain words, and n-gram strokes corresponding to the words are determined. Each n-gram stroke represents n successive strokes of a corresponding word. Word vectors of the words and stroke vectors of the n-gram strokes are initialized corresponding to the words. After performing the word segmentation, the n-gram strokes are determined, and the word vectors and stroke vectors are determined, training the word vectors and the stroke vectors.

Claims (76)

1. A word vector processing method, comprising:

performing word segmentation on a corpus to obtain words;

determining n-gram strokes corresponding to the words, the n-gram stroke representing n successive strokes of a corresponding word;

initializing word vectors of the words and stroke vectors of the n-gram strokes corresponding to the words; and

after performing the word segmentation, determining the n-gram strokes, and initializing the word vectors and stroke vectors, performing operations comprising:

determining a designated word in the corpus and a context word of the designated word in the corpus,

determining a degree of similarity between the designated word and the context word according to a vector dot product of stroke vectors of n-gram strokes corresponding to the designated word and a word vector of the context word, and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the degree of similarity between the designated word and the context word.

2. The method of claim 1 , wherein determining n-gram strokes corresponding to the words comprises:

determining, according to a result of the word segmentation on the corpus, words occurring at least once in the corpus; and

performing the following operation on each determined word:

determining n-gram strokes corresponding to the word, wherein each n-gram stroke corresponding to the word represents n successive strokes of the word, and n is one positive integer or multiple different positive integers.

3. The method of claim 2 , wherein determining, according to a result of the word segmentation on the corpus, words occurring at least once in the corpus comprises:

determining, according to the result of the word segmentation on the corpus, a word that occurs in the corpus for not less than a set number of times, the set number of times being not less than 1.

4. The method of claim 1 , wherein initializing word vectors of the words and stroke vectors of the n-gram strokes corresponding to the words comprises:

initializing the word vectors of the words and the stroke vectors of the n-gram strokes corresponding to the words in a random initialization manner or in a manner of initializing according to a specified probability distribution, wherein stroke vectors of the same n-gram strokes are also the same.

5. The method of claim 1 , wherein updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the degree of similarity between the designated word and the context word comprises:

selecting one or more words from the words as a negative sample word;

determining a degree of similarity between the designated word and each negative sample word;

determining a loss characterization value corresponding to the designated word according to a designated loss function, the degree of similarity between the designated word and the context word, and the degree of similarity between the designated word and each negative sample word; and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the loss characterization value.

6. The method of claim 5 , wherein updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the loss characterization value comprises:

determining a gradient corresponding to the loss function according to the loss characterization value; and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the gradient.

7. The method of claim 5 , wherein selecting one or more words from the words as a negative sample word comprises:

randomly selecting one or more words from the words as the negative sample word.

8. The method of claim 1 , wherein determining a context word of the designated word in the corpus comprises:

sliding, with the designated word as a center, leftward and/or rightward by a distance of a designated number of words in the corpus, to establish a window; and

determining words excluding the designated word in the window as the context word of the designated word.

9. The method of claim 1 , wherein the words are Chinese words, and the word vectors are word vectors of the Chinese words.

10. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:

performing word segmentation on a corpus to obtain words;

determining n-gram strokes corresponding to the words, the n-gram stroke representing n successive strokes of a corresponding word;

initializing word vectors of the words and stroke vectors of the n-gram strokes corresponding to the words; and

after performing the word segmentation, determining the n-gram strokes, and initializing the word vectors and stroke vectors,

determining a designated word in the corpus and a context word of the designated word in the corpus,

determining a degree of similarity between the designated word and the context word according to a vector dot product of stroke vectors of n-gram strokes corresponding to the designated word and a word vector of the context word, and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the degree of similarity between the designated word and the context word.

11. The non-transitory, computer-readable medium of claim 10 , wherein determining n-gram strokes corresponding to the words comprises:

determining, according to a result of the word segmentation on the corpus, words occurring at least once in the corpus; and

performing the following operation on each determined word:

determining n-gram strokes corresponding to the word, wherein each n-gram stroke corresponding to the word represents n successive strokes of the word, and n is one positive integer or multiple different positive integers.

12. The non-transitory, computer-readable medium of claim 11 , wherein determining, according to a result of the word segmentation on the corpus, words occurring at least once in the corpus comprises:

determining, according to the result of the word segmentation on the corpus, a word that occurs in the corpus for not less than a set number of times, the set number of times being not less than 1.

13. The non-transitory, computer-readable medium of claim 10 , wherein initializing word vectors of the words and stroke vectors of the n-gram strokes corresponding to the words comprises:

initializing the word vectors of the words and the stroke vectors of the n-gram strokes corresponding to the words in a random initialization manner or in a manner of initializing according to a specified probability distribution, wherein stroke vectors of the same n-gram strokes are also the same.

14. A computer-implemented system, comprising:

one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:

performing word segmentation on a corpus to obtain words;

determining n-gram strokes corresponding to the words, the n-gram stroke representing n successive strokes of a corresponding word;

initializing word vectors of the words and stroke vectors of the n-gram strokes corresponding to the words; and

after performing the word segmentation, determining the n-gram strokes, and initializing the word vectors and stroke vectors,

determining a designated word in the corpus and a context word of the designated word in the corpus,

determining a degree of similarity between the designated word and the context word according to a vector dot product of stroke vectors of n-gram strokes corresponding to the designated word and a word vector of the context word, and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the degree of similarity between the designated word and the context word.

15. The computer-implemented system of claim 14 , wherein determining, according to a result of the word segmentation on the corpus, words occurring at least once in the corpus comprises:

determining, according to the result of the word segmentation on the corpus, a word that occurs in the corpus for not less than a set number of times, the set number of times being not less than 1.

16. The computer-implemented system of claim 15 , wherein initializing word vectors of the words and stroke vectors of the n-gram strokes corresponding to the words comprises:

initializing the word vectors of the words and the stroke vectors of the n-gram strokes corresponding to the words in a random initialization manner or in a manner of initializing according to a specified probability distribution, wherein stroke vectors of the same n-gram strokes are also the same.

17. The non-transitory, computer-readable medium of claim 10 , wherein updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the degree of similarity between the designated word and the context word comprises:

selecting one or more words from the words as a negative sample word;

determining a degree of similarity between the designated word and each negative sample word;

determining a loss characterization value corresponding to the designated word according to a designated loss function, the degree of similarity between the designated word and the context word, and the degree of similarity between the designated word and each negative sample word; and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the loss characterization value.

18. The non-transitory, computer-readable medium of claim 17 , wherein updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the loss characterization value comprises:

determining a gradient corresponding to the loss function according to the loss characterization value; and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the gradient.

19. The computer-implemented system of claim 14 , wherein updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the degree of similarity between the designated word and the context word comprises:

selecting one or more words from the words as a negative sample word;

determining a degree of similarity between the designated word and each negative sample word;

determining a loss characterization value corresponding to the designated word according to a designated loss function, the degree of similarity between the designated word and the context word, and the degree of similarity between the designated word and each negative sample word; and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the loss characterization value.

20. The computer-implemented system of claim 19 , wherein updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the loss characterization value comprises:

determining a gradient corresponding to the loss function according to the loss characterization value; and

updating the word vector of the context word and the stroke vectors of the n-gram strokes corresponding to the designated word according to the gradient.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Oct 22, 2019
From: CAO, SHAOSHENG; LI, XIAOLONG
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 050789/0861 →
Priority Claims (1)
CN 2017 1 0045459 · Jan 22, 2017 · national
Continuity (2)
Continuation 15874725 · Jan 18, 2018
Related Publication 20200134262A1 · Apr 30, 2020