Text recognition method, device, equipment and storage medium
By obtaining and fusing the character features and word features of text characters and generating word joint features, the problem of low accuracy of naming entity recognition is solved and the accuracy of naming entity recognition is achieved.
Patent Information
- Application Number
- CN202111086778.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-16
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2041-09-16
AI Technical Summary
In the prior art, the accuracy of naming entities is low, and it is difficult to identify specific categories of entities required in actual business, the feature information extraction is limited and the identification standards are inconsistent.
By obtaining the character feature information and word feature information of the target text, performing feature fusion processing, generating word joint feature information, and using word joint features for entity recognition, improving the accuracy of naming entity recognition.
Through entity recognition of word combined with feature information, the accuracy of naming entity recognition is significantly improved and the accuracy and reliability of the recognition results are ensured.
Smart Images

Figure CN114281934B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text recognition method, apparatus, device, and storage medium. Background Art
[0002] Natural Language Processing (NLP) is an important field in computer science and artificial intelligence. Named Entity Recognition (NER) is a branch of NLP that identifies specific words in text.
[0003] There are roughly two types of solutions used in related technologies to perform named entity recognition tasks. One is to recognize text based on large-scale dictionaries or multiple preset templates, and identify words in the text that belong to the preset dictionary or are in special positions; the other is to extract single-word features in the text and perform recognition and prediction in turn to identify specific words in the text.
[0004] However, in related technologies, the extracted feature information is limited, and the recognition standards are inconsistent with actual applications, making it difficult to identify specific categories of entities required in actual business, resulting in a low accuracy rate in named entity recognition. Summary of the Invention
[0005] The embodiments of the present application provide a text recognition method, apparatus, device, and storage medium that can improve the accuracy of named entity recognition.
[0006] According to one aspect of an embodiment of the present application, a text recognition method is provided, the method comprising:
[0007] Get the target text;
[0008] Determining character feature information and word feature information corresponding to text characters in the target text;
[0009] Performing feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character;
[0010] Based on the word joint feature information, entity recognition processing is performed on the target text to obtain a text recognition result corresponding to the target text.
[0011] According to one aspect of an embodiment of the present application, a text recognition device is provided, the device comprising:
[0012] Text acquisition module, used to acquire target text;
[0013] An independent feature determination module, configured to determine character feature information and word feature information corresponding to text characters in the target text;
[0014] a joint feature determination module, configured to perform feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character;
[0015] The entity recognition module is used to perform entity recognition processing on the target text based on the word joint feature information to obtain a text recognition result corresponding to the target text.
[0016] According to one aspect of an embodiment of the present application, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the above-mentioned text recognition method.
[0017] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein the storage medium stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the above-mentioned text recognition method.
[0018] According to one aspect of an embodiment of the present application, a computer program product is provided, comprising at least one instruction, at least one program segment, a code set, or an instruction set, wherein the at least one instruction, the at least one program segment, the code set, or the instruction set is loaded and executed by a processor to implement the above-mentioned text recognition method.
[0019] The technical solutions provided in the embodiments of the present application can bring the following beneficial effects:
[0020] By determining the character features and word features corresponding to the text characters in the target text and fusing the two features, we can determine the word joint features corresponding to the text characters, fully tap the semantic information corresponding to the text characters, improve the accuracy of feature extraction, and then perform entity recognition using the word joint features corresponding to the text characters, which can effectively improve the accuracy of named entity recognition and obtain accurate text recognition results. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0022] Figure 1 is a schematic diagram of an application program operating environment provided by an embodiment of the present application;
[0023] Figure 2 This is the process of the text recognition method provided by an embodiment of the present application Figure 1 ;
[0024] Figure 3 This is the process of the text recognition method provided by an embodiment of the present application Figure 2 ;
[0025] Figure 4 This is the process of the text recognition method provided by an embodiment of the present application Figure 3 ;
[0026] Figure 5 A schematic diagram of determining word joint feature information is exemplarily shown;
[0027] Figure 6 A schematic diagram of the model structure of an entity recognition model is exemplarily shown;
[0028] Figure 7 is a block diagram of a text recognition device provided by one embodiment of the present application;
[0029] Figure 8 This is a structural block diagram of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0030] The text recognition method provided in the embodiments of the present application involves artificial intelligence technology and blockchain technology, which are briefly described below to facilitate understanding by those skilled in the art.
[0031] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0032] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0033] Natural language processing (NLP) is a key area of research in computer science and artificial intelligence. It studies the theories and methods that enable effective communication between humans and computers using natural language. Natural language processing (NLP) integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language we use in everyday life—and is closely linked to the study of linguistics. Natural language processing technologies typically include text processing, semantic understanding, machine translation, robotic question answering, and knowledge graphs.
[0034] Machine learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0035] Deep learning: The concept of deep learning originates from the study of artificial neural networks. A multilayer perceptron with multiple hidden layers is an example of a deep learning architecture. Deep learning discovers distributed feature representations of data by combining lower-level features to form more abstract higher-level representations of attribute categories or features.
[0036] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0037] Please refer to Figure 1 , which shows a schematic diagram of an application program running environment provided by an embodiment of the present application. The application program running environment may include: a terminal 10 and a server 20.
[0038] The terminal 10 may be an electronic device such as a mobile phone, computer, tablet computer, intelligent voice interaction device, smart home appliance, vehicle-mounted terminal, game console, e-book reader, multimedia player, wearable device, PC (Personal Computer), etc. The terminal 10 may have an application client installed therein.
[0039] In the embodiment of the present application, the above-mentioned application can be any application capable of performing text recognition. Typically, the application is a search application. Of course, in addition to search applications, text recognition can also be performed in other types of applications. For example, news applications, social applications, interactive entertainment applications, browser applications, shopping applications, content sharing applications, virtual reality (VR) applications, augmented reality (AR) applications, etc., which are not limited in the embodiment of the present application. Optionally, a client of the above-mentioned application is running in the terminal 10.
[0040] The server 20 is used to provide background services for the client of the application in the terminal 10. For example, the server 20 can be the background server of the above-mentioned application. The server 20 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the server 20 provides background services for applications in multiple terminals 10 at the same time.
[0041] Optionally, the terminal 10 and the server 20 may communicate with each other via a network 30. The terminal 10 and the server 20 may be directly or indirectly connected via wired or wireless communication, which is not limited in this application.
[0042] Before introducing the method embodiments provided in the present application, a brief introduction is first given to the application scenarios, relevant terms or nouns that may be involved in the method embodiments of the present application to facilitate understanding by technical personnel in the field of the present application.
[0043] NER (Named Entity Recognition), also known as proper name recognition, primarily identifies and categorizes proper names, such as names of people and places, in text. Named entity recognition is an essential component of various natural language processing technologies, including information extraction, information retrieval, machine translation, and question-answering systems. In the search domain, identifying entities can provide high-quality features for downstream tasks, significantly improving the user search experience.
[0044] Convolutional Neural Networks (CNNs) are a type of feedforward neural network with a deep structure that incorporates convolutional computations. They are a representative approach to deep learning. CNNs possess representational learning capabilities and can perform shift-invariant classification of input information based on their hierarchical structure. Therefore, they are also known as shift-invariant artificial neural networks (SIANNs).
[0045] Gated Linear Units (GLUs) are a CNN architecture capable of processing time series data in parallel. They leverage CNNs and gating mechanisms to implement the functionality of recurrent neural networks (RNNs). Their advantages include improved performance by strictly preserving information by time sequence position when processing time series data, and accelerated computation through parallel processing.
[0046] CRF (Conditional Random Field) is a commonly used NER machine learning model. A CRF is a discriminative probabilistic model and a type of random field, commonly used to annotate or analyze sequence data, such as natural language text or biological sequences. The CRF model combines the advantages of a discriminative model with the characteristics of a generative model, taking into account the transition probabilities between contextual tags and performing global parameter optimization and decoding in a serialized form. This solves the labeling bias problem that is difficult to avoid in other discriminative models (such as the Maximum Entropy Markov Model).
[0047] Please refer to Figure 2 , which shows the process of the text recognition method provided by an embodiment of the present application Figure 1 This method can be applied to computer equipment, which refers to electronic equipment with data calculation and processing capabilities. For example, the execution subject of each step can be Figure 1 The server 20 in the application running environment is shown. The method may include the following steps (210-240).
[0048] Step 210: Obtain target text.
[0049] The above target text may refer to any text. The above target text is the object to be recognized in the named entity recognition task. The above target text includes words of any entity type, so named entity recognition can be performed on the target text to obtain specific words in the target text.
[0050] In an exemplary embodiment, the above entity types include but are not limited to the person entity type PER (Person), the geographical entity type LOC (Location), the organization entity type ORG (Organization), and the intellectual property entity type IP (Intellectual Property).
[0051] In one example, the above target text is "The UK will implement a certain visa policy, and the Chinese embassy responds". Among them, the single character "UK" belongs to the geographical entity type and represents a place name; the noun "Chinese embassy" belongs to the organization entity type and represents an organization name. In another example, the above target text is "A certain information platform exposes that Quan and Jian are in love". Among them, the noun "a certain information platform" belongs to the intellectual property entity type and represents an IP name; the nouns "Quan" and "Jian" both belong to the person entity type and represent the names of two people respectively.
[0052] In an exemplary embodiment, the above target text includes but is not limited to various forms of text such as the search text input by the user, the text corresponding to the multimedia content, etc.
[0053] Step 220, determine the character feature information and word feature information corresponding to the text characters in the target text.
[0054] The above character feature information refers to the information used to characterize the character features corresponding to the above text characters. The above word feature information refers to the information used to characterize the word features corresponding to the words where the above text characters are located.
[0055] In a possible implementation manner, the word vector corresponding to the text character is used as the above character feature information. Optionally, the above word vector can be determined by the mapping relationship between the sample character and the word vector. For a given character, according to the above mapping relationship, obtain the word vector corresponding to the above given character, and use this word vector as the character feature information corresponding to the given character.
[0056] The mapping relationship between the above character and the word vector and the value of the word vector can be determined by a machine learning model. Optionally, use specific large-scale data to train the word2vec (word vector) model. The word2vec model will train to obtain the word vectors corresponding to all input words and save the mapping from the input word to the word vector.
[0057] In one possible implementation, the word vector corresponding to the word containing the text character is used as the word feature information. Optionally, the word vector can be determined by a mapping relationship between sample words and word vectors. For a given word, according to the mapping relationship, a word vector corresponding to the given word is obtained, and the word vector is used as the word feature information corresponding to each character in the word.
[0058] Optionally, the text is segmented to determine the words in the text. The above words are the segmentation results. The above words can be individual characters or words.
[0059] The correspondence between words and word vectors, as well as the numerical values of the word vectors, can be determined by a machine learning model. Optionally, a word2vec model can be trained using specific large-scale data. The word2vec model will be trained to obtain word vectors corresponding to all input words and store the mapping from input words to word vectors.
[0060] In another possible implementation, part-of-speech analysis is performed on each word to obtain a part-of-speech vector corresponding to each word, and the word vector corresponding to the word where the above text character is located and the part-of-speech vector are used together as word feature information corresponding to the text character.
[0061] In an exemplary embodiment, as Figure 3 As shown, Figure 3 The process of the text recognition method provided by an embodiment of the present application is shown Figure 2 .exist Figure 3 The implementation process of the above step 220 includes the following steps (221-224).
[0062] Step 221: Obtain dictionary mapping information.
[0063] The dictionary mapping information is dictionary information that maps characters or words to corresponding feature vectors. The feature vectors include but are not limited to character vectors and word vectors.
[0064] In an exemplary embodiment, a large-scale sample sentence is used as training data to train the word2vec model and obtain the above-mentioned dictionary mapping information. During the training process, the word2vec model learns the feature representation corresponding to each word in the sample sentence and maps the word to a corresponding feature vector. For example, the target word is represented by other words in the sample sentence except the target word, and the target word is mapped to a corresponding feature vector, which can represent the semantic information between the target word and the other words. For another example, the target word in the sample sentence is used to represent other words in the sample sentence except the target word, and each word in the sample sentence is traversed to obtain the feature vector corresponding to each word in the sample sentence, which can also represent the semantic information between the target word and the other words.
[0065] Optionally, after the word2vec model training is completed, each word in the sample sentence and its corresponding feature vector are obtained as the above-mentioned dictionary mapping information.
[0066] In some application scenarios, the words in the sample sentences may also be embedded to obtain the above-mentioned dictionary mapping information.
[0067] Step 222: Determine character feature information corresponding to the text characters based on the dictionary mapping information.
[0068] For any character in the target text, character feature information corresponding to the text character can be obtained from the dictionary mapping information. Optionally, the character feature information is a word vector corresponding to the text character.
[0069] In one possible implementation, the text characters may be input into a word2vec model to obtain word vectors corresponding to the text characters. Alternatively, the target text may be input into a word2vec model to obtain word vectors corresponding to each text character in the target text.
[0070] In an example, the character feature information corresponding to the text characters in the target text "College students come to apply for jobs" includes: the character vector corresponding to "big", the character vector corresponding to "study", the character vector corresponding to "life", the character vector corresponding to "come", the character vector corresponding to "should", and the character vector corresponding to "employ".
[0071] Step 223: perform word segmentation processing on the target text to obtain a word segmentation result.
[0072] The above-mentioned word segmentation processing refers to the process of dividing the target text into words. The above-mentioned word segmentation results include each word in the target text obtained after the word segmentation processing. In one example, the word segmentation processing is performed on the target text "College students come to apply for a job", and the word segmentation results obtained are "college students", "come", and "apply for a job".
[0073] In addition, the embodiment of the present application does not limit the method of word segmentation processing, and a suitable word segmentation model can be selected according to actual conditions to perform the above-mentioned word segmentation processing.
[0074] Step 224: Determine word feature information corresponding to the text characters based on the word segmentation result and the dictionary mapping information.
[0075] For any word in the target text segmentation result, the word feature information corresponding to the word can be obtained from the dictionary mapping information. Optionally, the above-mentioned word feature information is the word vector corresponding to the text character.
[0076] In an exemplary embodiment, as Figure 4 As shown, Figure 4 The process of the text recognition method provided by an embodiment of the present application is shown Figure 3 .exist Figure 4 In the embodiment, the implementation process of the above step 224 includes the following steps (224a-224d).
[0077] Step 224a: Determine the word vector corresponding to each word in the word segmentation result based on the dictionary mapping information.
[0078] For any word in the word segmentation result of the target text, the word vector corresponding to the word can be obtained from the dictionary mapping information.
[0079] In one possible implementation, the above words can be input into the word2vec model to obtain the word vector corresponding to the word. Alternatively, the word segmentation results can be input into the word2vec model to obtain the word vector corresponding to each word.
[0080] In one example, the word feature information corresponding to the target text "College students come to apply for a job" includes the word vector corresponding to "college students", the word vector corresponding to "come", and the word vector corresponding to "apply for a job". Although "come" is a single word, it can also be associated with a corresponding word vector.
[0081] Step 224b: perform part-of-speech analysis on each word to obtain a part-of-speech vector corresponding to each word.
[0082] The above-mentioned part-of-speech vector represents the part-of-speech feature information corresponding to the word. The above-mentioned part-of-speech feature information may indicate the part of speech corresponding to the word. Optionally, the above-mentioned part of speech includes but is not limited to nouns, transitive verbs, intransitive verbs, and other parts of speech.
[0083] Optionally, the part-of-speech vectors are randomly initialized and can be subsequently optimized during the training of the target entity recognition model. For an introduction to the target entity recognition model, please refer to the following text and will not be discussed in detail here.
[0084] In one example, the words in the word segmentation result of the target text "college students come for an interview" are "college students", "come", and "interview" respectively. After performing word property analysis on each word, the corresponding word property vectors of each word are the word property vector corresponding to "college students", the word property vector corresponding to "come", and the word property vector corresponding to "interview".
[0085] Step 224c, generate the word feature information corresponding to each word according to the word vector and the word property vector.
[0086] In a possible implementation manner, perform fusion processing on the above-mentioned word vector and word property vector to obtain the word feature vector corresponding to each word. The above-mentioned word feature vector can be used as the above-mentioned word feature information to represent the word features corresponding to each word. The above-mentioned fusion processing includes, but is not limited to, processing such as splicing, superposition, and multiplication. The embodiments of the present application do not limit this.
[0087] In the above example, splice the word vector corresponding to "college students" with the word property vector corresponding to "college students" to obtain the word feature vector corresponding to "college students"; splice the word vector corresponding to "come" with the word property vector corresponding to "come" to obtain the word feature vector corresponding to "come"; splice the word vector corresponding to "interview" with the word property vector corresponding to "interview" to obtain the word feature vector corresponding to "interview".
[0088] Step 224d, use the word feature information corresponding to the word where the text character is located as the word feature information corresponding to the text character.
[0089] For any text character in the target text, the word feature information corresponding to the word where the text character is located can be used as the word feature information corresponding to the text character. Optionally, the above-mentioned word feature information is the word feature vector corresponding to the word where the text character is located.
[0090] In the above example, for the character "大" in the target text "college students come for an interview", use the word feature vector corresponding to the word "college students" where it is located as the word feature vector corresponding to the character "大".
[0091] Step 230, perform feature fusion processing on the character feature information and the word feature information to obtain the word-character joint feature information corresponding to the text character.
[0092] The embodiments of the present application perform entity recognition processing in units of characters, and need to obtain the feature information corresponding to the text characters for subsequent entity recognition processing. Performing entity recognition processing in units of characters can effectively avoid the influence caused by word segmentation deviation in the word segmentation result.
[0093] Although there may be segmentation deviations in the segmentation results, the segmentation information is of great significance for the word boundary recognition of named entity recognition. Simply using the character feature information of the characters for entity recognition processing will result in low entity recognition accuracy and poor results. Therefore, in step 230, the word joint feature information corresponding to the text characters is determined as the recognition object for entity recognition processing. The above-mentioned word joint feature information is used to characterize the character features and word features of the text characters as a whole. Compared with the single-dimensional character features and word features, the word joint features can reflect more semantic information, which is conducive to improving the accuracy of entity recognition.
[0094] The feature fusion process is to fuse different feature information. Specifically, different fusion processing methods can be determined according to the representation of the feature information, and the present embodiment does not limit this.
[0095] In a possible implementation, the above-mentioned character feature information is a character feature vector, the word feature information is a word feature vector, and the above-mentioned feature fusion processing includes but is not limited to vector operations such as vector splicing, vector superposition, and vector product.
[0096] In an exemplary embodiment, as Figure 3 As shown, the implementation process of the above step 230 includes the following steps (231-232).
[0097] Step 231 : Perform feature transformation processing on the word feature information to obtain transformed word feature information.
[0098] After the transformation, the feature dimensions of the word feature information and the character feature information are the same.
[0099] In one possible implementation, the above-mentioned feature transformation is performed on the word feature vector corresponding to the text character to obtain a transformed word feature vector. The transformed word feature vector has the same feature dimension as the character feature vector, so that feature fusion processing on the same dimension is performed, making the feature representation of the word joint feature vector more accurate, which is conducive to improving the accuracy of entity recognition.
[0100] In an exemplary embodiment, as Figure 4 As shown, the implementation process of the above step 231 includes the following steps (231a~231b).
[0101] Step 231a: Obtain feature transformation information.
[0102] The feature transformation information is used to adjust the feature dimension of the word feature information.
[0103] In one possible implementation, a feature transformation matrix is used as the feature transformation information. By setting the number of rows and columns of the feature transformation matrix and the value of each element in the matrix, the word feature vector can be mapped to a vector with the same dimension as the character feature vector.
[0104] Step 231b: Based on the feature transformation information, perform feature transformation processing on the word feature information to obtain transformed word feature information.
[0105] In this possible implementation, the above-mentioned word feature vector is multiplied with the above-mentioned feature transformation matrix to obtain the transformed word feature vector, which can ensure the consistency of the feature dimensions of the transformed word feature vector and the character feature vector, and ensure the accuracy of the feature fusion processing.
[0106] Step 232: perform feature fusion processing on the transformed word feature information and the character feature information to obtain word joint feature information corresponding to the text characters.
[0107] In a possible implementation, the transformed word feature vector and the character feature vector are subjected to feature fusion processing, such as concatenation or superposition, to obtain a word joint feature vector corresponding to the text character.
[0108] In one example, if Figure 5 , which exemplifies a schematic diagram for determining word-joint feature information. For the target text "College students come to apply for a job," word segmentation and part-of-speech analysis are performed. Using specific large-scale data, the word2vec model is trained to obtain word vectors 511, part-of-speech vectors 512, and character vectors 540 for each character in the target text "College students come to apply for a job." The word vectors 511 and character vectors have a 256-dimensional dimension.
[0109] Next, word vector 511 is replicated according to the number of characters in the word, and the corresponding 32-dimensional part-of-speech vector 512 is concatenated after word vector 511 to obtain a word feature vector 510 corresponding to each character. Word feature vector 510 is transformed using transformation matrix 520, and word feature vector 510 is multiplied by transformation matrix 520 to convert word feature vector 510 into a transformed word feature vector 530 of the same dimension as word vector 540. Finally, transformed word feature vector 530 is added to word vector 540 to obtain a character-word joint feature vector E for subsequent entity recognition processing.
[0110] Correspondingly, the generation process of the above-mentioned word joint feature vector E can be expressed by the following formula (1):
[0111]
[0112] Among them, E 词 Indicates the word vector corresponding to the word where the character is located, E 词性 Indicates the part-of-speech vector corresponding to the word where the character is located, Represents the splicing operation, M is the transformation matrix, the transformation matrix dimension is 288×256, E 字 represents the character feature vector corresponding to the character, and E represents the word joint feature vector corresponding to the character.
[0113] Step 240 , performing entity recognition processing on the target text based on the word joint feature information to obtain a text recognition result corresponding to the target text.
[0114] The entity recognition process is a process of identifying the entity type corresponding to a text character. The entity type label is used to represent the entity type corresponding to the text character.
[0115] In an exemplary embodiment, the above entity types include but are not limited to a person entity type PER (Person), a geographic entity type LOC (Location), an organization entity type ORG (Organization), and an intellectual property entity type IP (Itellectual Property).
[0116] The text recognition results described above refer to the results of identifying the entity types corresponding to the text characters in the target text. Target words belonging to the target entity types in the target text, included in the text recognition results, can be used as search terms to perform related tasks, as described below.
[0117] In addition, the above-mentioned word joint feature information can not only be used for entity recognition, but also for other text recognition tasks, which is not limited in the embodiments of the present application.
[0118] In an exemplary embodiment, the text recognition result includes the target word in the target text that belongs to the target entity type. Figure 3 As shown, the implementation process of entity recognition in the above step 240 includes the following steps (241-243).
[0119] Step 241 , performing entity recognition processing on the word joint feature information to obtain entity type labels corresponding to the text characters.
[0120] In a possible implementation, the word joint feature vector is input into a target entity recognition model for entity recognition processing, and an entity type label corresponding to the text character is output.
[0121] The target entity recognition model is a machine learning model trained using sample text as training data and entity type labels corresponding to text characters in the sample text as label information. Optionally, the number of sample texts is 300,000.
[0122] Optionally, each character in the sample text is annotated with a label, which serves as the target output for training the target entity recognition model. The target entity recognition model outputs the entity type label corresponding to each character during prediction. The model is updated based on the difference between the output entity type label and the labeled entity type label until the error between the two meets the constraints, resulting in a trained target entity recognition model. The trained target entity recognition model can reconstruct the complete entity and corresponding entity type in the target text according to certain rules.
[0123] Optionally, the present embodiment uses the BIOES sequence annotation mode to annotate the sample text. Here, B (Begin) indicates the entity start character; I (Intermediate) indicates the entity middle character; O (Other) indicates an irrelevant character; E (End) indicates the entity end character; and S (Single) indicates a single entity character.
[0124] Optionally, the target entity recognition model is used to identify characters belonging to the target entity type, and thus the characters belonging to the target entity type in each sample text are marked. In some application scenarios, the target entity types include person entity type PER, geographic entity type LOC, organization entity type ORG, and intellectual property entity type IP. Accordingly, the characters belonging to person entity type PER, geographic entity type LOC, organization entity type ORG, and intellectual property entity type IP are marked in the sample text. For example, the names of people, places, organizations, and IPs in the sample text are marked.
[0125] The above-mentioned BIOES tag needs to be followed by the identifier corresponding to the entity type. Since the target entity recognition model is used to identify characters belonging to the target entity type, the above-mentioned BIOES tag needs to be followed by the identifier corresponding to the target entity type. Here, taking the target entity types of the person entity type PER, geographic entity type LOC, organizational entity type ORG, and intellectual property entity type IP in the above-mentioned application scenario as an example, the corresponding entity type labels include: B-PER, I-PER, E-PER, S-PER, B-LOC, I-LOC, E-LOC, S-LOC, B-ORG, I-ORG, E-ORG, S-ORG, B-IP, I-IP, E-IP, S-IP, and O, a total of 17 entity type labels. Among them, B-PER represents the starting character corresponding to the person entity; I-PER represents the middle character corresponding to the person entity; E-PER represents the ending character corresponding to the person entity; S-PER represents the ending character corresponding to the person entity; O represents an irrelevant character. Other entity type labels can be deduced in the same way and will not be repeated here.
[0126] It should be noted that the embodiment of the present application does not limit the target entity type, and the target entity type can be determined according to actual conditions. The embodiment of the present application also does not limit the sequence labeling method, and a suitable sequence labeling method can be selected according to actual conditions.
[0127] In one example, for the sample text "Team A cuts center Cousins.", "Team A" is the name of an organization and belongs to the organization entity type, while "Cousins" is the name of a person and belongs to the person entity type. Therefore, they can be annotated according to Table 1 below.
[0128] Table 1
[0129] A Team cut Lose middle forward Test X Si B-ORG E-ORG O O O O B-PER I-PER E-PER
[0130] In one possible implementation, the target entity recognition model can be a machine learning model constructed based on CWCNN (Char-Word-Union Gated Stacked Convolutional Neural Networks) and CRF (Conditional Random Field), that is, a CWCNN+CRF model. The CWCNN+CRF model has two layers of stacked gated convolution units, each of which includes a one-dimensional convolution module with a convolution kernel width of 3 and an output control module that simulates a forget gate. The two layers of gated convolution units are then connected to the CRF model for decoding and output, and the entity type labels corresponding to each character are output according to the strategy to reconstruct the various entities in the target text. The stacking of gated convolution units can increase the capacity of the model and improve the representation ability of the model. Gating can improve the efficiency of model training and also increase the capacity of the model. The width of the convolution kernel is a balance between efficiency and performance and can be determined according to actual conditions. By constructing an entity recognition model in the above manner, the model size can be reduced, a lightweight named entity recognition model can be realized, and at the same time, the model capacity can be increased, the accuracy of entity recognition processing can be ensured, and ultimately the efficiency of entity recognition by the target entity recognition model can be improved.
[0131] In an exemplary embodiment, as Figure 4 As shown, the implementation process of the above step 241 includes the following steps (241a~241b).
[0132] Step 241a, performing gated convolution processing on the word joint feature information to obtain intermediate feature information corresponding to the text characters.
[0133] Gated convolution processing refers to the process of convolving the joint feature information of words and controlling the output feature information.
[0134] Optionally, the gated convolution processing is implemented by a gated convolution layer of the target entity recognition model. The word joint feature vector is input into the gated convolution layer of the target entity recognition model for gated convolution processing to obtain an intermediate feature vector corresponding to the text character.
[0135] In an exemplary embodiment, the gated convolution process is divided into two steps: a convolution operation and a gated linear operation. First, a preset convolution kernel is obtained and a convolution operation is performed on the word joint feature information to obtain convolved feature information. Then, a gated linear operation is performed on the convolved feature information to obtain the aforementioned intermediate feature information. Optionally, the convolution operation can be implemented by a convolution unit of the target entity recognition model. Optionally, the gated linear operation can be implemented by a gated linear unit of the target entity recognition model.
[0136] The Gated Linear Unit (GLU) is a convolutional neural network architecture for parallel processing of time series data. It utilizes a CNN and gating mechanism to implement RNN (recurrent neural network) functionality. Its advantages include improved performance by strictly preserving information by time sequence position when processing time series data, and accelerated computation speed through a parallel processing structure.
[0137] Step 241b: perform entity type prediction processing on the intermediate feature information to obtain the entity type label corresponding to the text character.
[0138] In one possible implementation, the entity type prediction process is implemented by a conditional random field decoding layer in the target entity recognition model. The intermediate feature information is input into the conditional random field decoding layer for entity type prediction, and the entity type label corresponding to the text character is output.
[0139] In one example, if Figure 6 As shown, it exemplarily shows a model structure diagram of an entity recognition model. Figure 6 In the example, the word joint feature vector 61 corresponding to the text characters in the target text is input into Figure 6 In the entity recognition model shown, the word joint feature vector 61 is first input to the gated convolution layer of the entity recognition model. Optionally, the gated convolution layer is composed of two stacked gated convolution units 62. The convolution unit in the gated convolution unit 62 performs a convolution operation on the word joint feature vector 61 to obtain convolution data. The gated linear unit in the gated convolution unit 62 then performs a gated linear operation on the convolution data to obtain the intermediate feature vector 63 corresponding to the above-mentioned text character. Finally, the intermediate feature vector 63 corresponding to each text character is input to the conditional random field decoding layer, which outputs the entity type label corresponding to the text character.
[0140] Figure 6 The entity recognition model shown can be expressed by the following formulas (2) to (7).
[0141]
[0142]
[0143]
[0144]
[0145] o=CRF(c2) (6)
[0146] in, Denotes a convolution operation, H is a 1×3 convolution kernel, sigmoid denotes a sigmoid function, and CRF denotes a conditional random field decoding layer. d1 is the intermediate output control variable in the first gated convolution unit, c1 is the output of the first gated convolution unit, d2 is the intermediate output control variable in the second gated convolution unit, c2 is the output of the second gated convolution unit, i.e., the intermediate feature vector mentioned above, and o denotes the output result.
[0147] It should be noted that the above-mentioned target entity recognition model can also adopt other network structures, and the embodiments of the present application are not limited to this. For example, the target entity recognition model is a CRF++ model, a CWLSTM+CRF model, and a Char+BERT+CRF model. Among them, CWLSTM (Char-Word-Union gated stacked Long Short-Term Memory) represents a word union gated stacked long short-term memory neural network model, and BERT (Bidirectional Encoder Representationsfrom Transformers) represents a bidirectional encoding representation model. Table 2 below shows the average AVE (Average) and time consumption of the recognition accuracy of several entity recognition models for the target entity types PER, LOC / ORG / IP.
[0148] Table 2
[0149] CRF++ CWLSTM+CRF CWCNN+CRF Char+BERT+CRF PER 0.6804 0.8015 0.7988 0.8000 LOC 0.7949 0.8388 0.8453 0.8184 ORG 0.5909 0.6242 0.6406 0.6143 IP 0.6716 0.7104 0.7241 0.7016 AVE 0.6845 0.7437 0.7522 0.7336 Time consumed / ms <1 2~3 1~2 35~60
[0150] The table above shows that using CWCNN+CRF as the target entity recognition model outperforms other methods in terms of recognition accuracy and time consumption. It can support a variety of application scenarios and run stably and efficiently.
[0151] Step 242: determine the text characters whose entity type labels in the target text correspond to the target entity type as target characters.
[0152] In one possible implementation, the purpose of entity recognition is to identify words in a text that belong to a target entity type. Therefore, the entity type corresponding to each text character in the target text can be determined by using the entity type label corresponding to each text character, and text characters whose entity type is the target entity type are determined as target characters.
[0153] In one example, entity recognition processing is performed on the target text "Team A waived center Kaosi", and entity type labels corresponding to each text character are obtained. Among them, the entity type label corresponding to the character "A" is B-ORG, indicating that the character "A" is the starting character of an organization entity; the entity type label corresponding to the character "Team" is E-ORG, indicating that the character "Team" is the ending character of an organization entity. The above entity type labels B-ORG and E-ORG are both labels corresponding to the organization entity type, and the organization entity type is the target entity type. Therefore, "A" and "Team" are regarded as target characters belonging to the organization entity type. In addition, the entity type labels corresponding to "Kaosi", "X", and "Si" are B-PER, I-PER, and E-PER respectively, all of which are labels corresponding to the person entity type. Therefore, "Kaosi", "X", and "Si" are regarded as target characters belonging to the person entity type. For the characters "waived", "center" in the target text, the corresponding entity type labels are both O, indicating that they are all irrelevant characters. Therefore, the above "waived", "center" are not the above target characters.
[0154] Step 243, based on the target characters, determine the target words in the target text that belong to the target entity type.
[0155] Determine the target characters belonging to the same entity type as target words.
[0156] In the above example, both "A" and "Team" are target characters belonging to the organization entity type. Therefore, the target word "Team A" belonging to the organization entity type can be determined, and the organization name in the target text is obtained.
[0157] In the above example, "Kaosi", "X", and "Si" are all target characters belonging to the person entity type. Therefore, the target word "Kaosi" belonging to the person entity type can be determined.
[0158] The text recognition method provided by the embodiments of this application can be used as a basic method in search technology and has corresponding applications in all processes such as search term understanding, article content understanding, and search recall ranking. The target words in the target text included in the above text recognition results that belong to the target entity type can be used as search terms, and then relevant tasks can be executed.
[0159] In a possible implementation manner, based on the above target words, recall the multimedia content corresponding to the target words. For example, use the above target words as search terms and perform an operation to recall articles. In the logic of recalling articles by search terms, there are generally channels such as keyword recall and semantic recall. Among them, using the identified target words, that is, the identified entities, as keywords to recall articles with the same entity is an accurate and efficient way to improve recall efficiency and accuracy.
[0160] In one possible implementation, the target account's search intent is determined based on the target terms. These target terms can be used to help identify the search intent of the target user associated with the target account. When a target user searches for a specific person name, they may be searching for related profiles; when searching for an IP address, they may be searching for related videos, applications, download links, and so on. Based on the entity type corresponding to the target terms, this can help predict the user's search intent, improving search efficiency and accuracy.
[0161] In one possible implementation, based on the target word, an entity link corresponding to the target word is determined. Entity linking is a downstream task of entity recognition. After an entity is identified, it is linked to a specific, unique entity through disambiguation. For example, even if the target text is identified as containing the game name "XXX" belonging to an IP entity, entity linking is still needed to determine whether it refers to the game itself or the corresponding video content.
[0162] In one possible implementation, the similarity between the target text and other texts is determined based on the target words. The target words can be used as features for determining text relevance. In search scenarios, there are numerous tasks for determining text relevance, such as the relevance between search terms and article titles, and the relevance between articles. By determining whether entities in two texts are identical or related, the accuracy of relevance determination can be improved. Therefore, entities, as high-level features, are widely used in relevance tasks.
[0163] To sum up, the technical solution provided in the embodiment of the present application can determine the character features and word features corresponding to the text characters in the target text and fuse the two features to determine the word joint features corresponding to the text characters, fully explore the semantic information corresponding to the text characters, improve the accuracy of feature extraction, and then perform entity recognition based on the word joint features corresponding to the text characters, which can effectively improve the accuracy of named entity recognition and obtain accurate text recognition results.
[0164] In addition, the technical solution provided in the embodiment of the present application designs a lightweight word-joint gated stacked convolutional neural network-conditional random field model (CWCNN-CRF) for named entity recognition, and trains the model on large-scale sample texts. The model can output the entity type label corresponding to each text character based on the word-joint features corresponding to the text characters through two layers of stacked gated convolution units and conditional random fields, and then predict the words belonging to the target entity type in the target text, such as the four types of named entities: names of people, places, organizations, and IP names. This not only ensures the accuracy of named entity recognition, but also controls the recognition time. At the same time, the model design allows the business to customize the entity type to be identified, effectively supporting business applications.
[0165] The following are device embodiments of the present application, which can be used to implement the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.
[0166] Please refer to Figure 7 , which shows a block diagram of a text recognition device provided by one embodiment of the present application. The device has the function of implementing the above-mentioned text recognition method, which can be implemented by hardware or by hardware executing corresponding software. The device can be a computer device or can be installed in a computer device. The device 700 can include: a text acquisition module 710, an independent feature determination module 720, a joint feature determination module 730, and an entity recognition module 740.
[0167] A text acquisition module 710 is used to acquire a target text;
[0168] An independent feature determination module 720 is configured to determine character feature information and word feature information corresponding to text characters in the target text;
[0169] A joint feature determination module 730 is configured to perform feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character;
[0170] The entity recognition module 740 is configured to perform entity recognition processing on the target text based on the word joint feature information to obtain a text recognition result corresponding to the target text.
[0171] In an exemplary embodiment, the text recognition result includes target words belonging to a target entity type in the target text, and the entity recognition module 740 includes: a label determination unit, a character determination unit, and a word determination unit.
[0172] The label determination unit is used to perform entity recognition processing on the word joint feature information to obtain the entity type label corresponding to the text character.
[0173] The character determination unit is configured to determine a text character whose entity type label in the target text corresponds to the target entity type as a target character.
[0174] The word determination unit is used to determine the target word belonging to the target entity type in the target text based on the target characters.
[0175] In an exemplary embodiment, the label determination unit includes: a gated convolution subunit and an entity prediction subunit.
[0176] a gated convolution subunit, configured to perform gated convolution processing on the word joint feature information to obtain intermediate feature information corresponding to the text characters, wherein the gated convolution processing refers to the processing of performing convolution on the word joint feature information and controlling the output feature information;
[0177] The entity prediction subunit is used to perform entity type prediction processing on the intermediate feature information to obtain the entity type label corresponding to the text character.
[0178] In an exemplary embodiment, the joint feature determination module 730 includes: a feature transformation unit and a feature fusion unit.
[0179] The feature conversion unit is used to perform feature conversion processing on the word feature information to obtain converted word feature information, where the feature dimension of the converted word feature information is the same as that of the character feature information.
[0180] The feature fusion unit is used to perform feature fusion processing on the transformed word feature information and the character feature information to obtain word joint feature information corresponding to the text character.
[0181] In an exemplary embodiment, the feature transformation unit includes: a transformation information acquisition subunit and a feature transformation subunit.
[0182] The transformation information acquisition subunit is used to obtain feature transformation information, where the feature transformation information is used to adjust the feature dimension of the word feature information.
[0183] The feature conversion subunit is configured to perform the feature conversion processing on the word feature information based on the feature conversion information to obtain the converted word feature information.
[0184] In an exemplary embodiment, the independent feature determination module 720 includes: a dictionary information acquisition unit, a character feature determination unit, a text word segmentation unit, and a word feature determination unit.
[0185] The dictionary information acquisition unit is used to acquire dictionary mapping information.
[0186] A character feature determination unit is configured to determine character feature information corresponding to the text character based on the dictionary mapping information.
[0187] The text segmentation unit is used to perform segmentation processing on the target text to obtain a segmentation result.
[0188] A word feature determination unit is used to determine word feature information corresponding to the text character based on the word segmentation result and the dictionary mapping information.
[0189] In an exemplary embodiment, the word feature determination unit includes: a word vector determination subunit, a part-of-speech vector determination subunit, and a part-of-speech vector determination subunit.
[0190] The word vector determination subunit is used to determine the word vector corresponding to each word in the word segmentation result based on the dictionary mapping information.
[0191] The part-of-speech vector determination subunit is used to perform part-of-speech analysis on each word to obtain a part-of-speech vector corresponding to each word.
[0192] The word feature generating subunit is used to generate word feature information corresponding to each word according to the word vector and the part-of-speech vector.
[0193] The word feature determination subunit is configured to use the word feature information corresponding to the word where the text character is located as the word feature information corresponding to the text character.
[0194] To sum up, the technical solution provided in the embodiment of the present application can determine the character features and word features corresponding to the text characters in the target text and fuse the two features to determine the word joint features corresponding to the text characters, fully explore the semantic information corresponding to the text characters, improve the accuracy of feature extraction, and then perform entity recognition based on the word joint features corresponding to the text characters, which can effectively improve the accuracy of named entity recognition and obtain accurate text recognition results.
[0195] In addition, the technical solution provided in the embodiment of the present application designs a lightweight word-joint gated stacked convolutional neural network-conditional random field model (CWCNN-CRF) for named entity recognition, and trains the model on large-scale sample texts. The model can output the entity type label corresponding to each text character based on the word-joint features corresponding to the text characters through two layers of stacked gated convolution units and conditional random fields, and then predict the words belonging to the target entity type in the target text, such as the four types of named entities: names of people, places, organizations, and IP names. This not only ensures the accuracy of named entity recognition, but also controls the recognition time. At the same time, the model design allows the business to customize the entity type to be identified, effectively supporting business applications.
[0196] It should be noted that the apparatus provided in the above embodiments, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0197] Please refer to Figure 8 , which shows a block diagram of a computer device provided by an embodiment of the present application. The computer device may be a server for executing the above-mentioned text recognition method. Specifically:
[0198] Computer device 800 includes a central processing unit (CPU) 801, a system memory 804 including a random access memory (RAM) 802 and a read-only memory (ROM) 803, and a system bus 805 connecting system memory 804 and CPU 801. Computer device 800 also includes a basic input / output system (I / O system) 806 that facilitates information transfer between various components within the computer, and a mass storage device 807 for storing an operating system 813, application programs 814, and other program modules 815.
[0199] The basic input / output system 806 includes a display 808 for displaying information and an input device 809, such as a mouse and keyboard, for user input. Both the display 808 and the input device 809 are connected to the central processing unit 801 via an input / output controller 810 connected to the system bus 805. The basic input / output system 806 may also include an input / output controller 810 for receiving and processing input from a variety of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 810 also provides output to a display screen, printer, or other types of output devices.
[0200] The mass storage device 807 is connected to the central processing unit 801 via a mass storage controller (not shown) connected to the system bus 805. The mass storage device 807 and its associated computer-readable media provide non-volatile storage for the computer device 800. In other words, the mass storage device 807 may include a computer-readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.
[0201] Without loss of generality, computer-readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, EPROM (Erasable Programmable Read Only Memory), EEPROM (Electrically Erasable Programmable Read Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, tape cassettes, magnetic tape, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above-mentioned ones. The above-mentioned system memory 804 and mass storage device 807 can be collectively referred to as memory.
[0202] According to various embodiments of the present application, the computer device 800 may also be connected to a remote computer on a network such as the Internet for operation. That is, the computer device 800 may be connected to a network 812 via a network interface unit 811 connected to the system bus 805, or the network interface unit 811 may be used to connect to other types of networks or remote computer systems (not shown).
[0203] The memory further includes a computer program, which is stored in the memory and configured to be executed by one or more processors to implement the above text recognition method.
[0204] In an exemplary embodiment, a computer-readable storage medium is also provided, in which at least one instruction, at least one program, a code set or an instruction set is stored. When the at least one instruction, the at least one program, the code set or the instruction set is executed by a processor, the above-mentioned text recognition method is implemented.
[0205] Optionally, the computer-readable storage medium may include: ROM (Read Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or an optical disk, etc. Among them, the random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).
[0206] In an exemplary embodiment, a computer program product or computer program is also provided, which includes at least one instruction, at least one program segment, code set or instruction set, and the above at least one instruction, at least one program segment, code set or instruction set is loaded and executed by a processor to implement the above text recognition method.
[0207] Optionally, the at least one instruction, at least one program, code set, or instruction set is stored in a computer-readable storage medium. A processor of the computer device reads the at least one instruction, at least one program, code set, or instruction set from the computer-readable storage medium and executes the at least one instruction, at least one program, code set, or instruction set, so that the computer device performs the text recognition method.
[0208] It should be understood that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application do not limit this.
[0209] The above description is merely an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A text recognition method, characterized in that: The method comprises: Get the target text; Determining character feature information and word feature information corresponding to text characters in the target text, wherein the character feature information is determined based on dictionary mapping information, the word feature information is obtained by fusing word vectors and part-of-speech vectors of words in the target text, the word vectors are obtained based on the dictionary mapping information, the part-of-speech vectors are obtained by performing part-of-speech analysis on the words, the word feature information corresponding to the text characters is the word feature information of the word in which the text characters are located, and the word feature information corresponding to each character in the same word is consistent; Performing feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character; Based on the word joint feature information, entity recognition processing is performed on the target text to obtain a text recognition result corresponding to the target text.
2. The method according to claim 1, characterized in that The text recognition result includes target words belonging to a target entity type in the target text. The entity recognition processing is performed on the target text based on the word joint feature information to obtain a text recognition result corresponding to the target text, including: Performing entity recognition processing on the word joint feature information to obtain entity type labels corresponding to the text characters; Determine a text character in the target text whose entity type label corresponds to the target entity type as a target character; Based on the target characters, a target word in the target text belonging to the target entity type is determined.
3. The method according to claim 2, characterized in that The performing entity recognition processing on the word joint feature information to obtain the entity type label corresponding to the text character includes: Performing gated convolution processing on the word joint feature information to obtain intermediate feature information corresponding to the text character, wherein the gated convolution processing refers to performing convolution on the word joint feature information and controlling the output feature information; Perform entity type prediction processing on the intermediate feature information to obtain entity type labels corresponding to the text characters.
4. The method according to claim 1, wherein The performing feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character includes: Performing feature transformation processing on the word feature information to obtain transformed word feature information, wherein the transformed word feature information has the same feature dimension as the character feature information; The transformed word feature information and the character feature information are subjected to feature fusion processing to obtain word joint feature information corresponding to the text character.
5. The method according to claim 2, characterized in that The performing feature transformation processing on the word feature information to obtain transformed word feature information includes: Acquiring feature transformation information, where the feature transformation information is used to adjust feature dimensions of the word feature information; Based on the feature transformation information, the feature transformation process is performed on the word feature information to obtain the transformed word feature information.
6. The method according to any one of claims 1 to 5, characterized in that The determining of character feature information and word feature information corresponding to text characters in the target text includes: Get dictionary mapping information; Determining character feature information corresponding to the text character based on the dictionary mapping information; Performing word segmentation processing on the target text to obtain a word segmentation result; Based on the word segmentation result and the dictionary mapping information, word feature information corresponding to the text character is determined.
7. The method according to claim 6, characterized in that The determining, based on the word segmentation result and the dictionary mapping information, word feature information corresponding to the text character includes: Determining the word vector corresponding to each word in the word segmentation result based on the dictionary mapping information; Performing part-of-speech analysis on each word to obtain a part-of-speech vector corresponding to each word; Generating word feature information corresponding to each word according to the word vector and the part-of-speech vector; The word feature information corresponding to the word where the text character is located is used as the word feature information corresponding to the text character.
8. A text recognition device, characterized in that: The device comprises: Text acquisition module, used to acquire target text; an independent feature determination module, configured to determine character feature information and word feature information corresponding to text characters in the target text, wherein the character feature information is determined based on dictionary mapping information, the word feature information is obtained by fusing word vectors and part-of-speech vectors of words in the target text, the word vectors are obtained based on the dictionary mapping information, the part-of-speech vectors are obtained by performing part-of-speech analysis on the words, the word feature information corresponding to the text characters is the word feature information of the word in which the text characters are located, and the word feature information corresponding to each character in the same word is consistent; a joint feature determination module, configured to perform feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character; The entity recognition module is used to perform entity recognition processing on the target text based on the word joint feature information to obtain a text recognition result corresponding to the target text.
9. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, at least one program, the code set, or the instruction set is loaded and executed by the processor to implement a text recognition method, wherein the text recognition method includes: Get the target text; Determining character feature information and word feature information corresponding to text characters in the target text, wherein the character feature information is determined based on dictionary mapping information, the word feature information is obtained by fusing word vectors and part-of-speech vectors of words in the target text, the word vectors are obtained based on the dictionary mapping information, the part-of-speech vectors are obtained by performing part-of-speech analysis on the words, the word feature information corresponding to the text characters is the word feature information of the word in which the text characters are located, and the word feature information corresponding to each character in the same word is consistent; Performing feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character; Based on the word joint feature information, entity recognition processing is performed on the target text to obtain a text recognition result corresponding to the target text.
10. The device according to claim 9, characterized in that The text recognition result includes target words in the target text that belong to the target entity type. Entity recognition processing is performed on the target text to obtain a text recognition result corresponding to the target text, including: Performing entity recognition processing on the word joint feature information to obtain entity type labels corresponding to the text characters; Determine a text character in the target text whose entity type label corresponds to the target entity type as a target character; Based on the target characters, a target word in the target text belonging to the target entity type is determined.
11. The device according to claim 10, characterized in that The performing entity recognition processing on the word joint feature information to obtain the entity type label corresponding to the text character includes: Performing gated convolution processing on the word joint feature information to obtain intermediate feature information corresponding to the text character, wherein the gated convolution processing refers to performing convolution on the word joint feature information and controlling the output feature information; Perform entity type prediction processing on the intermediate feature information to obtain entity type labels corresponding to the text characters.
12. The device according to claim 9, characterized in that The performing feature fusion processing on the character feature information and the word feature information to obtain word joint feature information corresponding to the text character includes: Performing feature transformation processing on the word feature information to obtain transformed word feature information, wherein the transformed word feature information has the same feature dimension as the character feature information; The transformed word feature information and the character feature information are subjected to feature fusion processing to obtain word joint feature information corresponding to the text character.
13. The device according to claim 10, characterized in that The performing feature transformation processing on the word feature information to obtain transformed word feature information includes: Acquiring feature transformation information, where the feature transformation information is used to adjust feature dimensions of the word feature information; Based on the feature transformation information, the feature transformation process is performed on the word feature information to obtain the transformed word feature information.
14. The device according to any one of claims 9 to 13, characterized in that The determining of character feature information and word feature information corresponding to text characters in the target text includes: Get dictionary mapping information; Determining character feature information corresponding to the text character based on the dictionary mapping information; Performing word segmentation processing on the target text to obtain a word segmentation result; Based on the word segmentation result and the dictionary mapping information, word feature information corresponding to the text character is determined.
15. The device according to claim 14, characterized in that The determining, based on the word segmentation result and the dictionary mapping information, word feature information corresponding to the text character includes: Determining the word vector corresponding to each word in the word segmentation result based on the dictionary mapping information; Performing part-of-speech analysis on each word to obtain a part-of-speech vector corresponding to each word; Generating word feature information corresponding to each word according to the word vector and the part-of-speech vector; The word feature information corresponding to the word where the text character is located is used as the word feature information corresponding to the text character.
16. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the text recognition method according to any one of claims 1 to 7.
17. A computer program product, characterized in that The computer program product includes at least one instruction or at least one program segment, and the at least one instruction or at least one program segment is loaded and executed by a processor to implement the text recognition method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Named entity identification method for word fusion based on label guidance
CN112699685A