Hieroglyphic feature-based data processing

A computer-implemented method and a system are proposed. According to the method, in response to receiving a character, a first representation of the character is generated by performing word embedding processing on the character. The first representation is related to context of the character. A second representation of the character is generated by performing convolutional neural network (CNN) processing on the character. The second representation is related to a hieroglyphic feature of the character. A label for the character is determined by performing recurrent neural network (RNN) processing on the first representation and the second representation. The label indicates an attribute of the character related to the context.

BACKGROUND

The present invention relates to data processing, and more specifically, to hieroglyphic feature-based data processing. Natural language processing (NLP) is concerned with the interactions between computers and human languages and, in particular, concerned with programming computers to process large natural language corpora. Challenges in NLP frequently involve natural language understanding, natural language generation, connecting language and machine perception, managing human-computer dialog systems, or some combination thereof. Major evaluations and tasks in NLP include Word segmentation, part-of-speech (POS) tagging, name entity recognition (NER), or the like. However, these tasks are inefficient in Chinese sequence labeling.

SUMMARY

According to one embodiment of the present invention, there is provided a computer-implemented method. According to the method, in response to receiving a character, a first representation of the character is generated by performing word embedding processing on the character. The first representation is related to context of the character. A second representation of the character is generated by performing convolutional neural network (CNN) processing on the character. The second representation is related to a hieroglyphic feature of the character. A label for the character is determined by performing recurrent neural network (RNN) processing on the first representation and the second representation. The label indicates an attribute of the character related to the context.

According to another embodiment of the present invention, there is provided a system. The system includes one or more processors. The one or more processors are configured to, in response to receiving a character, generate a first representation of the character by performing word embedding processing on the character, and generate a second representation of the character by performing CNN processing on the character. The first representation is related to context of the character, and the second representation is related to a hieroglyphic feature of the character. The one or more processors are further configured to determine a label for the character by performing RNN processing on the first representation and the second representation. The label indicates an attribute of the character related to the context.

According to yet another embodiment of the present invention, there is provided a computer program product. The computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a device to cause the device to, in response to receiving a character, generate a first representation of the character by performing word embedding processing on the character, the first representation being related to context of the character, generate a second representation of the character by performing CNN processing on the character, the second representation being related to a hieroglyphic feature of the character, and determine a label for the character by performing RNN processing on the first representation and the second representation, the label indicating an attribute of the character related to the context.

DETAILED DESCRIPTION

Referring now toFIG. 1, in which an exemplary computer system/server12which is applicable to implement the embodiments of the present invention is shown.FIG. 1is also adapted to depict an illustrative example of a portable electronic device such as a communication device which is applicable to implement the embodiments of the present invention. Computer system/server12is only illustrative and is not intended to suggest any limitation as to the scope of use or functionality of embodiments of the invention described herein.

Word segmentation, POS tagging, NER, or the like are the fundamental tasks in NLP. These tasks can be formulated by assigning labels to words of an input sentence. For example, in the case of word segmentation, a character may be assigned a label including NN, RB, VB, JJ or the like, where NN represents noun, RB represents adverb, VB represents verb, and JJ represents adjective.

In Latin language like English, a word is composed of characters, and the morphological information like affixes can be leveraged to enhance the sequence labeling tasks like word segmentation, POS tagging and NER, and CNN has been proved to be an effective approach to extract morphological information from characters of words and encode it into neural representations. However, for hieroglyphic languages like Chinese, Egyptian hieroglyphs, cuneiform or the like, there is no character sequence for a hieroglyphic character.

In order to solve the above and other potential problems, according to implementations of the present disclosure, a new approach for extracting hieroglyphic information from Chinese characters and combining the information with word embedding to enhance sequence labeling tasks is proposed. Although there is no character sequence for a Chinese character, the hieroglyphic features of the Chinese character, for example the stroke or radical, contain rich information about the meaning of that Chinese character, and can be leveraged for improving the performance and efficiency of sequence labeling. Although the following embodiments are directed to Chinese character, those skilled in the art would readily appreciate that these embodiments are merely illustrative. The new approach can also be applied to other types of hieroglyphic characters, such as the Egyptian hieroglyphs described above.

FIG. 2is a schematic diagram of a method200of performing Chinese sequence labeling in accordance with embodiments of the present disclosure. A sequence of Chinese characters may be received and processed using the method200. For example, the sequence of Chinese characters iswhich means “I'm scared”.

The Chinese characters may be mapped to initial character representations according to one-hot encoding. A one-hot vector is a 1×N matrix/vector used to distinguish each word in a vocabulary from every other word in the vocabulary. The vector consists of Os in all cells with the exception of a single1in a cell used uniquely to identify the word. For example, the Chinese characteris mapped to the initial character representation210A (for example, [1, 0, 0, 0, . . . ]), the Chinese characteris mapped to the initial character representation210B (for example, [0, 1, 0, 0, . . . ]), the Chinese characteris mapped to the initial character representation210C (for example, [0, 0, 1, 0, . . . ]), and the Chinese characteris mapped to the initial character representation210D (for example, [0, 0, 0, 1, . . . ]).

The initial character representations210A-210D (collectively referred to as the initial character representation210) may be processed by word embedding processing to generate first representations220A-220D (collectively referred to as the first representation220) of the Chinese characters210A-210D, respectively. The word embedding is the collective name for a set of language modeling and feature learning techniques in NLP where words or phrases from the vocabulary may be mapped to vectors of real numbers. It may involve a mathematical embedding from a space with one dimension per word to a continuous vector space with much lower dimension. In this case, the first representation220may be a vector, and dimension of the vector may be set as required.

The word embedding may be used to quantify and categorize semantic similarities between the words or phrases based on their distributional properties in large samples of language data. Accordingly, the first representations220A-220D may be related to context of the Chinese characters. In particular, the first representations220A-220D may be related to semantic similarities of the Chinese characters. For example, the Chinese characteris mapped to the first representation [0.5, 0.1, 0.4, 1.7, . . . ], the Chinese characteris mapped to the first representation [0.8, 0.3, 1.2, 1.5, . . . ], and the Chinese characteris mapped to the first representation [1, 1, 10, 100, . . . ]. Since the Chinese characterand Chinese characterare semantically similar, the vector distance between the Chinese characterand the Chinese characteris smaller than the vector distance between the Chinese characterand the Chinese character

Additionally, the Chinese characters may be processed by CNN processing to generate second representations230A-230D (collectively referred to as the second representation230). The second representation230may be related to at least one hieroglyphic feature of the Chinese character. In some embodiments, the second representation230may also be a vector, and dimension of the vector may also be set as required.

The CNN processing may be performed on at least one stroke of the Chinese character, and/or on the image of the Chinese character. The second representation230may be the result of the CNN processing on the stroke(s), or the result of the CNN processing on the image, or in combination. For example, the result of the CNN processing on the stroke(s) and the result of the CNN processing on the image may be concatenated to generate the second representation230.

The CNN is a type of feed-forward artificial neural network. The CNN consists of multiple layers of receptive fields. The CNN may include local or global pooling layers, which combine the outputs of neuron clusters. The CNN may also include various combinations of convolutional and fully connected layers. Some example implementations of the CNN processing on the stroke(s) and the image will be described later with reference toFIG. 3andFIG. 4, respectively.

The first representation220and the second representation230of the Chinese character may be input into RNN processing. For example, the first representations220A-220D and the second representations230A-230D may be concatenated, respectively, and input into the RNN processing.

In the case that the second representation230is concatenated by the result of the CNN processing on the stroke(s) and the result of the CNN processing on the image, the first representation220and the concatenated second representation230may be input into the RNN processing. The RNN processing may, for example, adjust the weight of the result of the CNN processing on the stroke(s) and the result of the CNN processing on the image adaptively, so as to improve the accuracy of assigning labels to the Chinese character.

The RNN is a class of artificial neural network where connections between neuron-like units form a directed cycle. As shown, the RNN includes a forward RNN layer and a backward RNN layer. As an example, the forward RNN layer includes four neuron-like units240A-240D forming a directed cycle, and the backward RNN layer also includes four neuron-like units250A-250D forming a directed cycle. This creates an internal state of the network which allows it to exhibit dynamic temporal behavior. The RNN can use its internal memory to process arbitrary sequences of inputs, and output a probability distribution vector. This makes the RNN applicable to NLP tasks such as Word segmentation, POS tagging, NER, or the like.

For example, in the case of POS tagging, the RNN generates probability distribution vectors which represent the probability of the part-of-speech of the Chinese characters. In some embodiments, the RNN may be enhanced with long short-term memory (LSTM), bidirectional long short-term memory (BLSTM), or the like.

For sequence labeling tasks, it is beneficial to consider the correlations between labels in neighborhoods and jointly decode the best chain of labels for a given input sentence. For example, in POS tagging an adjective is more likely to be followed by a noun than a verb. Therefore, label sequence is modeled jointly using a conditional random field (CRF), instead of decoding the label independently. The CRF is a class of statistical modelling method, where it is used for structured prediction. Whereas an ordinary classifier predicts a label for a single sample without regard to “neighboring” samples, the CRF can take context into account.

Accordingly, in some embodiments, the probability distribution vectors generated by the RNN may be optionally input to CRF processing. As an example, the CRF includes four units260A-260D, to improve the performance of determining the labels for the Chinese characters. For example, in the case of word segmentation, the labelsare determined for the Chinese sequencewhere S represents that the Chinese character is classified into a single Chinese character, B represents that the Chinese character is classified into the beginning of a Chinese word, and E represents that the Chinese character is classified into the end of a Chinese word.

In accordance with embodiments of the present disclosure, in comparison with the conventional sequence labeling method, the method200can extract hieroglyphic features from the Chinese words and combining them with word embedding to enhance sequence labeling tasks. As a result, the method200achieves high performance and efficiency in sequence labeling.

FIG. 3is a schematic diagram of a method300of extracting a hieroglyphic feature from at least one stroke representation of a Chinese character in accordance with embodiments of the present disclosure. The following description takes the Chinese characteras an example.

The Chinese charactermay be divided into at least one stroke according to Chinese character encoding mechanisms. The Chinese character encoding mechanisms may include but not limited to the Wubi Chinese character encoding method. In the case of the Wubi method, the Chinese charactermay be divided into three strokesand

The initial stroke representation(s) may be processed by stroke embedding processing to generate stroke representation(s). In some embodiments, in the stroke embedding processing, a lookup table is used to generate the stroke representations. For example, a lookup table with values drawn from a uniform distribution with range [−0.1, 0.1] is randomly initialized to generate vectors representing the initial stroke representations. For example, the initial stroke representation310A is mapped to the stroke representation320B (for example, [0.1, 0.05, −0.07, . . . ]), the initial stroke representation310B is mapped to the stroke representation320C (for example, [0.06, 0.1, 0.06, . . . ]), and the initial stroke representation310C is mapped to the stroke representation320D (for example, [0.02, 0.09, −0.01, . . . ]).

The stroke representation(s) of the Chinese character may be expanded with at least one padding, such that the stroke representations of all Chinese character have equal length. For example, the Chinese charactermay have a length of three. In contrary, the Chinese Charactermay be divided into four strokesandand thus have a length of four. It is assumed that the maximum length is five, in this case, the stroke representations of the Chinese charactermay be expanded with two paddings. The padding may represent a dummy stroke, and may be a predetermined vector, for example an all-zero vector [0, 0, 0, . . . , 0].

The expanded stroke representations, which are the stroke representations320B-320D and the paddings320A and320E, are input into the CNN processing. The expanded stroke representations may be processed by convolution processing to generate convoluted stroke representations. For example, a predetermined number (for example, three) of stroke representations among the expanded stroke representations are averaged to generate the convoluted stroke representations330A-330C (collectively referred to as the convoluted stroke representation330), in which the convoluted stroke representation330A is generated based on the padding320A and the stroke representations320B-320C (for example, the convoluted stroke representation330A is [(0+0.1+0.06)/3, (0+0.05+0.1)/3, (0−0.07+0.06)/3, . . . ]), the convoluted stroke representation330B is generated based on the stroke representations320B-320D (for example, the convoluted stroke representation330B is [(0.1+0.06+0.02)/3, (0.05+0.1+0.09)/3, (−0.07+0.06−0.01)/3, . . . ]), and the convoluted stroke representation330C is generated based on the stroke representations320C-320D and the padding320E (for example, the convoluted stroke representation330C is [(0.06+0.02+0)/3, (0.1+0.09+0)/3, (0.06−0.01+0)/3, . . . ]).

The convoluted stroke representation330may be further processed by sampling processing to extract the hieroglyphic feature of the Chinese character. For example, the convoluted stroke representation330may be max pooled, mean pooled, or the like, to generate the extracted hieroglyphic feature340. In particular, the convoluted stroke representations330A-330C are max pooled to generate the extracted hieroglyphic feature340(for example, [(0.1+0.06+0.02)/3, (0.05+0.1+0.09)/3, (0.06−0.01+0)/3, . . . ]). In some embodiments, the convolution processing and the sampling processing may be repeated for processing the stroke(s) of the Chinese character.

In accordance with embodiments of the present disclosure, the method300can extract hieroglyphic features from the strokes of the Chinese words. The hieroglyphic features facilitate the Chinese sequence labeling tasks to achieve high performance and efficiency.

FIG. 4is a schematic diagram of a method400of extracting a hieroglyphic feature from an image of a Chinese character in accordance with embodiments of the present disclosure. The following description also takes the Chinese characteras an example.

The image410of the Chinese charactermay be processed by the CNN processing to generate the hieroglyphic feature of the Chinese character. The generated hieroglyphic feature may be related to the stroke, structure or any other information that facilitates assigning labels to the Chinese character. In some embodiments, convolution processing, sampling processing and full-connection processing may be processed on the image.

The convolution processing is characterized of sparse connectivity and shared weight. Regarding the sparse connectivity, for a certain pixel in the image, pixels closer to this pixel have greater effect on this pixel. In this case, a convolution operation on small regions of input is introduced to reduce the number of free parameters and improve generalization. In addition, regarding the shared weight, one major advantage of convolutional networks is the use of the shared weight in convolutional layers, which means that the same filter is used for each pixel in the layer. This both reduces memory footprint and improves performance.

In this case, the image may be convoluted with the filters to generate a convoluted result. For example, the image410may be 5 pixels×5 pixels in size, and there may be six filters, each of which is 3 pixels×3 pixels in size. The example of the image410convoluting with one of the six filters is shown below:

[1110001110001110011001100]->[101010101]->[434243234]
This convolution processing is repeated for the other five filters, and a convoluted result420of six channels is generated.

In the sampling processing, the convoluted result420may be sampled to generate the sampled result430. For example, the convoluted result420may be max pooled, mean pooled, or the like, to generate the sampled result430. The example of the convoluted result420being max pooled with a 2×2 filter is shown below.

In some embodiments, the convolution processing and the sampling processing may be repeated for processing the image of the Chinese character. Then, in the full-connection processing, the sampled result430may be fully connected to generate the extracted hieroglyphic feature440of the Chinese character.

In accordance with embodiments of the present disclosure, the method400can extract hieroglyphic features from the images of the Chinese words. The hieroglyphic features facilitate the Chinese sequence labeling tasks to achieve high performance and efficiency.

FIG. 5is a flow chart of the method500of performing Chinese sequence labeling in accordance with embodiments of the present disclosure. The method500may be implemented in the computer system/server12as shown inFIG. 1. The method500is entered at510, where a first representation of a character is generated by performing word embedding processing on the character, in response to receiving the character. The first representation may be related to context of the character.

At520, a second representation of the character is generated by performing CNN processing on the character. The second representation is related to a hieroglyphic feature of the character. At530, a label for the character is determined by performing RNN processing on the first representation and the second representation, to facilitate natural language processing for the character. The label indicates an attribute of the character related to the context. In accordance with embodiments of the present disclosure, the method500can extract hieroglyphic features from the Chinese words to enhance sequence labeling tasks.