Classification method and device for words in Chinese text, equipment and storage medium

By extracting and fusing the multivariate features of Chinese text, including word, structure decomposition, pictogram and pinyin features, the problem of insufficient attention to global semantic information in the existing technology is solved, and the performance of entity extraction is significantly improved.

CN119597918APending Publication Date: 2025-03-11AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411658486.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing Chinese entity extraction model may cause information bias when using a single feature, missing the rich semantic features of Chinese characters, resulting in the model paying too much attention to local words, insufficient attention to global semantic information, and reduced entity extraction performance.

Method used

Multiple characteristics of Chinese text are extracted, including word characteristics, Chinese character structure decomposition characteristics, Chinese character pictogram characteristics and Chinese character pinyin characteristics, and these characteristics are input into a pre-trained neural network model based on self-attention mechanism to be fused to improve recognition performance.

Benefits of technology

Through the fusion of multiple features, computers can more comprehensively understand the rich semantics of Chinese characters, improve the performance of entity extraction, and solve the problem that a single feature model lacks attention to global semantic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597918A_ABST
    Figure CN119597918A_ABST
Patent Text Reader

Abstract

The invention discloses a method, a device and equipment for classifying words in a Chinese text and a storage medium. The method comprises the following steps: acquiring a Chinese text to be recognized; respectively extracting word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text; inputting the character and word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features into a pre-trained neural network model based on a self-attention mechanism, and outputting a classification result of words in the Chinese text; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data marked with word meaning types of words; the classification result is the word meaning type of the word. By utilizing the method, the multivariate information of the Chinese characters is extracted, the features of the Chinese characters are described from different aspects, and then the extracted multivariate features are fused, so that the recognition performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of recognition technology, and in particular to a method, device, equipment and storage medium for classifying words in Chinese text. Background Art

[0002] As the main research task of natural language information extraction, entity extraction provides structured data support for many downstream tasks such as social public opinion monitoring and news topic extraction, which has important research significance. In recent years, with the development of deep learning technology, entity extraction has made a lot of progress. In terms of Chinese entity extraction, Chinese characters have rich word, radical, pictographic and pinyin features.

[0003] The current extraction model using a single feature may cause information bias problems. It lacks the rich semantic features of Chinese characters and may cause the model to pay too much attention to local words and insufficient attention to global semantic information, resulting in reduced entity extraction performance. Summary of the invention

[0004] The embodiments of the present invention provide a method, apparatus, device and storage medium for classifying words in Chinese text, extract multi-dimensional information of Chinese characters, describe the characteristics of Chinese characters from different aspects, and then fuse the extracted multi-dimensional features to improve recognition performance.

[0005] In a first aspect, an embodiment of the present invention provides a method for classifying words in a Chinese text, comprising:

[0006] Get the Chinese text to be recognized;

[0007] Respectively extracting word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text;

[0008] The word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features are input into a pre-trained neural network model based on the self-attention mechanism, and the classification results of the words in the Chinese text are output; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word semantic types marked; and the classification result is the word semantic type of the word.

[0009] In a second aspect, an embodiment of the present invention further provides a device for classifying words in a Chinese text, the device comprising:

[0010] A data acquisition module, used to acquire Chinese text to be recognized;

[0011] A feature extraction module, used to extract word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text respectively;

[0012] A classification module is used to input the word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features into a pre-trained neural network model based on the self-attention mechanism, and output the classification results of the words in the Chinese text; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word semantic types marked; and the classification result is the word semantic type of the word.

[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:

[0014] one or more processors;

[0015] a storage device for storing one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for classifying words in Chinese text provided by the embodiment of the present disclosure.

[0017] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to implement the method for classifying words in Chinese text provided by the embodiments of the present disclosure.

[0018] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the method for classifying words in Chinese text provided by the embodiments of the present disclosure.

[0019] The present invention discloses a method, device, equipment and storage medium for classifying words in Chinese text, the method comprising: obtaining Chinese text to be recognized; extracting the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text respectively; inputting the word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features into a pre-trained neural network model based on a self-attention mechanism, and outputting the classification results of the words in the Chinese text; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word meaning type annotated; the classification result is the word meaning type of the word. Using this method: extracting multivariate information of Chinese characters, describing the features of Chinese characters from different aspects, and then fusing the extracted multivariate features to improve the recognition performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0021] Figure 1 A flow chart of a method for classifying words in Chinese text provided by an embodiment of the present disclosure;

[0022] Figure 2 An example diagram of a Chinese character decomposition convolutional neural network provided in an embodiment of the present disclosure;

[0023] Figure 3 A schematic diagram of the structure of a device for classifying words in Chinese text provided by an embodiment of the present disclosure;

[0024] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0025] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0026] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0027] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0028] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0029] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0030] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0031] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0032] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0033] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0034] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0035] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0036] Embodiment 1

[0037] Figure 1A flowchart of a method for classifying words in Chinese text provided in an embodiment of the present disclosure is applicable to providing a solution to the problem that a single-feature extraction model may cause information bias, lacks the rich semantic features of Chinese characters, and may cause the model to pay too much attention to local words and insufficient attention to global semantic information, resulting in reduced entity extraction performance. The method can be executed by a method for classifying words in Chinese text, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.

[0038] like Figure 1 As shown, a method for classifying words in Chinese text provided by an embodiment of the present disclosure may specifically include the following steps:

[0039] S110: Obtain Chinese text to be recognized.

[0040] In this embodiment, the Chinese text may be content composed of Chinese.

[0041] This step is used to obtain the Chinese text to be recognized.

[0042] S120, extracting word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text respectively.

[0043] In this embodiment, the word feature may be the characters and words in the Chinese text. The Chinese character structure decomposition feature may be the structural decomposition of the characters in the Chinese text according to the radicals. The Chinese character pictographic feature may be the feature of the image matrix formed by the text rendering. The Chinese character pinyin feature may be the unique pinyin feature of the Chinese language.

[0044] Specifically, in this step, the convolutional neural network and word vector algorithm extract the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text.

[0045] On the basis of the above embodiment, before extracting the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text respectively, the method further includes:

[0046] Remove stop words and punctuation marks from Chinese text, and segment the Chinese text according to a preset word list to obtain individual words.

[0047] In this embodiment, the stop words may be words that are set to stop being used. The preset word list may be a preset fixed word list.

[0048] Specifically, stop words and punctuation marks are removed from the Chinese text, and the Chinese text is segmented according to a preset word list to obtain various words.

[0049] Specifically, based on the above embodiment, obtaining the user's service data includes the following steps:

[0050] a1) obtaining a preset Chinese character decomposition data set; the Chinese character decomposition data set includes radical embedding vectors of various decomposition categories of each Chinese character.

[0051] b1) Find the radical embedding vectors corresponding to the Chinese characters in the Chinese text from the Chinese character disassembly dataset.

[0052] c1) Input the radical embedding vector into the pre-trained Chinese character decomposition convolutional neural network and output the Chinese character structure decomposition features.

[0053] Among them, the Chinese character decomposition convolutional neural network includes one-dimensional convolutional neural networks of various scales.

[0054] Figure 2 This is an example diagram of a Chinese character decomposition convolutional neural network provided by the embodiment of the present disclosure. Figure 2 As shown in the figure, a Chinese character disassembly component dataset is obtained, and a Chinese character decomposition dictionary and a Chinese entity recognition dataset are used as the basis to construct a Chinese character multi-class structural decomposition database, and establish relevant indexes. The structural decomposition embedding part performs structural decomposition on each Chinese character in the input original text according to the radicals, and the decomposition process is processed by the Chinese character decomposition dictionary. Since different Chinese characters may produce decomposition methods with inconsistent numbers of types, a unified three-class decomposition method is selected when constructing the data, and the Chinese characters that are decomposed less than three types are replaced by subsequent decomposition in a covering manner. The Chinese character decomposition convolutional neural network is divided into three parts, including a feature vector input layer, which represents the radical embedding vector composed of different ways; the middle part of the model uses a convolutional network for feature extraction, and uses three different scales of one-dimensional convolutional neural networks to perform convolution calculations and pooling operations on the embedded feature vectors, and the radical features of Chinese characters are convoluted using sizes of 1, 2, and 3 respectively; the last feature output layer, by splicing and fusing feature information of different scales and inputting them into the fully connected layer for operation, obtains the Chinese character structural decomposition features extracted after the Chinese characters are decomposed according to the radicals.

[0055] Specifically, based on the above embodiment, extracting the pictographic features of Chinese characters in Chinese text includes the following steps:

[0056] a2) obtaining a preset Chinese character pictographic image set; the Chinese character pictographic image set includes pictographic images of various Chinese characters.

[0057] b2) searching for pictographic images corresponding to the Chinese characters in the Chinese text from the Chinese character pictographic image set.

[0058] c2) Input the pictographic image into the pre-trained pictographic feature convolutional neural network and output the Chinese character pictographic features.

[0059] Among them, the pictographic feature convolutional neural network includes two-dimensional convolutional neural networks of various scales.

[0060] In this embodiment, the Chinese character pictographic image set includes pictographic images of various Chinese characters.

[0061] Specifically, the pictographic feature convolutional neural network is divided into three parts, including a feature vector input layer, which represents the image matrix data formed by text rendering; the middle part of the model uses a convolutional network for feature extraction, and uses two different scales of two-dimensional convolutional neural networks to perform convolution calculations and pooling operations on the feature vectors of the graphics. Specifically, convolution kernels with scales of 5 and 3 are used for calculation to obtain pictographic features at multiple scales. After that, the model splices the feature information of different scales and performs a second layer of convolution, and finally outputs the fully connected layer for calculation to obtain the feature vector extracted from the Chinese character according to the pictographic picture.

[0062] Specifically, based on the above embodiment, extracting the Chinese character pinyin features of the Chinese text includes the following steps:

[0063] a3) Obtaining the mapping relationship between the preset Chinese characters and the pinyin feature vectors.

[0064] b3) Find the pinyin feature vector corresponding to the Chinese character in the Chinese text from the mapping relationship.

[0065] c4) Input the pinyin feature vector into the pre-trained pinyin feature convolutional neural network and output the pinyin features of Chinese characters.

[0066] Among them, the pinyin feature convolutional neural network includes a one-dimensional convolutional neural network with a scale of a set value.

[0067] Specifically, Chinese has a unique pinyin system, with the phenomenon of one word having multiple pronunciations and meanings, as well as homophones with different meanings. The pinyin feature convolutional neural network is mainly divided into two parts, including the mapping of the character encoding of Chinese characters in Chinese text to the pinyin feature vector and the extraction of the pinyin feature vector.

[0068] Specifically, based on the above embodiment, extracting word features of Chinese text includes the following steps:

[0069] a4) Extract character features from Chinese text through convolutional neural network.

[0070] b4) Extract word features from Chinese text through word vector algorithm.

[0071] c4) Using character features and word features as Chinese character word features.

[0072] Among them, the pictographic feature convolutional neural network includes two-dimensional convolutional neural networks of various scales.

[0073] S130, inputting word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features into a pre-trained neural network model based on a self-attention mechanism, and outputting classification results of words in the Chinese text.

[0074] Among them, the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word meaning types marked; the classification result is the word meaning type.

[0075] In this embodiment, the classification result of the words in the Chinese text can be classified according to the meaning of the words. For example, Xiao Ming goes to the Yangtze River Bridge tomorrow, Xiao Ming is a person's name, tomorrow is a time, and the Yangtze River Bridge is a place.

[0076] Specifically, the weight coefficients corresponding to the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features are calculated respectively. The word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features are weighted and summed according to the weight coefficients, and the weighted sum is used as the fusion feature to output the classification results of the words in the Chinese text.

[0077] Specifically, based on the above embodiment, word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features are input into a pre-trained neural network model based on a self-attention mechanism, and outputting the classification results of words in Chinese text includes the following steps:

[0078] a5) Input word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features into the self-attention mechanism module.

[0079] b5) The weight coefficients corresponding to word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features are calculated respectively through the self-attention mechanism module.

[0080] c5) Perform weighted summation on word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features according to the weight coefficient, and use the weighted sum as the fusion feature.

[0081] d5) Input the fused features into the output module and output the classification results of the words in the Chinese text.

[0082] Among them, the neural network of the self-attention mechanism includes a self-attention mechanism module and an output module.

[0083] Specifically, the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features are input into the self-attention mechanism module, and the weight coefficients corresponding to the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features are calculated respectively through the self-attention mechanism module, and the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features are weighted and summed according to the weight coefficients, and the weighted sum is used as the fusion feature.

[0084] Using this method, the method depicts Chinese pictographic characters from multiple aspects, including decomposing the radicals of Chinese characters, encoding the pinyin, and collecting pictographic images, so that the computer can understand the rich semantics of Chinese characters from multiple angles. Compared with the previous single-feature method, the multi-feature fusion method makes full use of the multi-faceted semantic features of Chinese characters, allowing the computer to better distinguish the boundary information in the language, thereby improving the entity extraction effect.

[0085] The present invention discloses a method for classifying words in Chinese text, the method comprising: obtaining Chinese text to be recognized; respectively extracting word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text; inputting the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features into a pre-trained neural network model based on a self-attention mechanism, and outputting the classification results of the words in the Chinese text; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word meaning type annotated; the classification result is the word meaning type. Using this method: extracting multivariate information of Chinese characters, describing the features of Chinese characters from different aspects, and then fusing the extracted multivariate features to improve the recognition performance.

[0086] Figure 3 The present invention also provides a schematic diagram of a method for classifying words in Chinese text. Figure 3 As shown, a data acquisition module 210, a feature extraction module 220 and a classification module 230.

[0087] A data acquisition module 210 is used to acquire Chinese text to be recognized;

[0088] A feature extraction module 220 is used to extract word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text respectively;

[0089] The classification module 230 is used to input the word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features into a pre-trained neural network model based on the self-attention mechanism, and output the classification results of the words in the Chinese text; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word semantic types marked; and the classification result is the word semantic type of the word.

[0090] The technical solution provided by the embodiment of the present disclosure utilizes this method to extract multivariate information of Chinese characters, describe the characteristics of Chinese characters from different aspects, and then fuse the extracted multivariate features to improve recognition performance.

[0091] Furthermore, the feature extraction module 220 may be used to:

[0092] Obtaining a preset Chinese character decomposition data set; the Chinese character decomposition data set includes radical embedding vectors of various decomposition categories of each Chinese character;

[0093] Searching for the radical embedding vector corresponding to the Chinese character of the Chinese text from the Chinese character decomposition data set;

[0094] The radical embedding vector is input into a pre-trained Chinese character decomposition convolutional neural network, and the Chinese character structure decomposition feature is output; the Chinese character decomposition convolutional neural network includes one-dimensional convolutional neural networks of multiple different scales.

[0095] Furthermore, the feature extraction module 220 may also be used for:

[0096] Acquire a preset Chinese character pictographic image set; the Chinese character pictographic image set includes pictographic images of various Chinese characters;

[0097] Searching for the pictographic image corresponding to the Chinese character of the Chinese text from the Chinese character pictographic image set;

[0098] The pictographic image is input into a pre-trained pictographic feature convolutional neural network, and the pictographic features of the Chinese character are output; the pictographic feature convolutional neural network includes two-dimensional convolutional neural networks of multiple different scales.

[0099] Furthermore, the feature extraction module 220 may also be used for:

[0100] Obtaining the mapping relationship between preset Chinese characters and pinyin feature vectors;

[0101] Searching for a pinyin feature vector corresponding to a Chinese character in the Chinese text from the mapping relationship;

[0102] The pinyin feature vector is input into a pre-trained pinyin feature convolutional neural network, and the pinyin feature of the Chinese character is output; the pinyin feature convolutional neural network includes a one-dimensional convolutional neural network with a scale of a set value.

[0103] Furthermore, the feature extraction module 220 may also be used for:

[0104] Extracting character features in the Chinese text through a convolutional neural network;

[0105] Extracting word features in the Chinese text by using a word vector algorithm;

[0106] The character features and the word features are used as the Chinese character word features.

[0107] Furthermore, the classification module 230 may also be used to:

[0108] Inputting the word feature, the Chinese character structure decomposition feature, the Chinese character pictographic feature and the Chinese character pinyin feature into the self-attention mechanism module;

[0109] The weight coefficients corresponding to the word feature, the Chinese character structure decomposition feature, the Chinese character pictographic feature and the Chinese character pinyin feature are calculated respectively by the self-attention mechanism module;

[0110] According to the weight coefficient, weighted sum is performed on the word feature, the Chinese character structure decomposition feature, the Chinese character pictographic feature and the Chinese character pinyin feature, and the weighted sum is used as the fusion feature;

[0111] The fusion features are input into the output module, and the classification results of the words in the Chinese text are output.

[0112] Furthermore, the device can also be used for:

[0113] Before respectively extracting the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text, the method further includes:

[0114] Stop words and punctuation marks of the Chinese text are removed, and the Chinese text is segmented according to a preset word list to obtain words.

[0115] The above device can execute the methods provided by all the above embodiments of the present invention, and has the corresponding functional modules and beneficial effects of executing the above methods. For technical details not described in detail in this embodiment, please refer to the methods provided by all the above embodiments of the present invention.

[0116] Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is given. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0117] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0118] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0119] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as a method for classifying words in Chinese text.

[0120] In some embodiments, the method for classifying words in Chinese text can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for classifying words in Chinese text described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the method for classifying words in Chinese text by any other appropriate means (for example, by means of firmware).

[0121] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0122] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0123] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0124] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0125] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0126] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0127] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0128] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for classifying words in Chinese text, characterized in that: include: Get the Chinese text to be recognized; Respectively extracting word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text; The word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features are input into a pre-trained neural network model based on the self-attention mechanism, and the classification results of the words in the Chinese text are output; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word semantic types marked; and the classification result is the word semantic type of the word.

2. The method according to claim 1, characterized in that Extracting Chinese character structure decomposition features of the Chinese text, including: Obtaining a preset Chinese character decomposition data set; the Chinese character decomposition data set includes radical embedding vectors of various decomposition categories of each Chinese character; Searching for the radical embedding vector corresponding to the Chinese character of the Chinese text from the Chinese character decomposition data set; The radical embedding vector is input into a pre-trained Chinese character decomposition convolutional neural network, and the Chinese character structure decomposition feature is output; the Chinese character decomposition convolutional neural network includes one-dimensional convolutional neural networks of multiple different scales.

3. The method according to claim 1, characterized in that Extracting Chinese character pictographic features of the Chinese text, including: Acquire a preset Chinese character pictographic image set; the Chinese character pictographic image set includes pictographic images of various Chinese characters; Searching for the pictographic image corresponding to the Chinese character of the Chinese text from the Chinese character pictographic image set; The pictographic image is input into a pre-trained pictographic feature convolutional neural network, and the pictographic features of the Chinese character are output; the pictographic feature convolutional neural network includes two-dimensional convolutional neural networks of multiple different scales.

4. The method according to claim 1, characterized in that: Extracting the Chinese character pinyin features of the Chinese text, including: Obtaining the mapping relationship between preset Chinese characters and pinyin feature vectors; Searching for a pinyin feature vector corresponding to a Chinese character in the Chinese text from the mapping relationship; The pinyin feature vector is input into a pre-trained pinyin feature convolutional neural network, and the pinyin feature of the Chinese character is output; the pinyin feature convolutional neural network includes a one-dimensional convolutional neural network with a scale of a set value.

5. The method according to claim 1, characterized in that: Extracting word features of the Chinese text includes: Extracting character features in the Chinese text through a convolutional neural network; Extracting word features in the Chinese text by using a word vector algorithm; The character features and the word features are used as the Chinese character word features.

6. The method according to claim 1, characterized in that The neural network of the self-attention mechanism includes a self-attention mechanism module and an output module; accordingly, the word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features are input into the pre-trained neural network model based on the self-attention mechanism, and the classification results of the words in the Chinese text are output, including: Inputting the word feature, the Chinese character structure decomposition feature, the Chinese character pictographic feature and the Chinese character pinyin feature into the self-attention mechanism module; The weight coefficients corresponding to the word feature, the Chinese character structure decomposition feature, the Chinese character pictographic feature and the Chinese character pinyin feature are calculated respectively by the self-attention mechanism module; According to the weight coefficient, weighted sum is performed on the word feature, the Chinese character structure decomposition feature, the Chinese character pictographic feature and the Chinese character pinyin feature, and the weighted sum is used as the fusion feature; The fusion features are input into the output module, and the classification results of the words in the Chinese text are output.

7. The method according to claim 1, characterized in that: Before respectively extracting the word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text, the method further includes: Stop words and punctuation marks of the Chinese text are removed, and the Chinese text is segmented according to a preset word list to obtain words.

8. A device for classifying words in Chinese text, characterized in that: include: A data acquisition module, used to acquire Chinese text to be recognized; A feature extraction module, used to extract word features, Chinese character structure decomposition features, Chinese character pictographic features and Chinese character pinyin features of the Chinese text respectively; A classification module is used to input the word features, the Chinese character structure decomposition features, the Chinese character pictographic features and the Chinese character pinyin features into a pre-trained neural network model based on the self-attention mechanism, and output the classification results of the words in the Chinese text; wherein the training data set of the neural network based on the self-attention mechanism is Chinese text data with the word meaning type marked; and the classification result is the word meaning type of the word.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method for classifying words in Chinese text according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for classifying words in Chinese text according to any one of claims 1 to 7 when executed.