Named entity recognition model training method and device, electronic equipment and storage medium

By cleaning, analyzing and labeling unlabeled domain data, and using large-scale language models to obtain semantic information and perform entity annotation, the problems of low data labeling efficiency and difficult to guarantee quality in the training of named entity recognition model are solved, and efficient and accurate model training is achieved.

CN119538926AInactive Publication Date: 2025-02-28GUANG DONG MING CHUANG SOFTWARE TECH CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311044845.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-17
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the prior art, the named entity recognition model is inconvenient to train and the entity recognition is inaccurate, which is mainly due to the lack of sufficient labeled data, resulting in low efficiency and difficult to guarantee the quality of the training data.

Method used

By obtaining unlabeled domain data, using a large-scale language model for data cleaning, analysis and labeling, semantic information is obtained and entity labeling is performed, and finally using the labeled data to train the named entity recognition model.

Benefits of technology

It realizes the convenience of no manual labeling of training data, improves the efficiency and accuracy of model training, and ensures the quality of entity recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119538926A_ABST
    Figure CN119538926A_ABST
Patent Text Reader

Abstract

The invention discloses a named entity recognition model training method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining domain data, and carrying out the data cleaning processing of the domain data, and obtaining sample data; obtaining field information of the sample data, and analyzing and processing the sample data to obtain semantic information of each piece of data in the sample data; performing entity labeling on the sample data according to the set entity type, field information and semantic information to obtain labeled sample data; and training the entity naming recognition model according to the labeled sample data, and obtaining a trained named entity recognition model after the training is completed. According to the technical scheme, the data is distilled through the large-scale language model, the unlabeled data is labeled in a specific scene, then the named entity model is trained, manual labeling is not needed, and the training convenience and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of named entity recognition processing, and in particular to a named entity recognition model training method, device, electronic device and storage medium. Background Art

[0002] Named Entity Recognition (NER) is a basic task in natural language processing, which is used to identify entities with specific meanings or strong referentiality in texts, such as names of people, places, institutions, dates and times, or proper nouns. The entity is identified by identifying the boundaries of the target entity and the type of the entity.

[0003] Limited by the inference speed and deployment environment, especially for models deployed on mobile phones, large-scale high-quality training data is needed to optimize the models because of their poor fitting ability. However, in actual operation, specific fields often lack sufficient labeled data. At this time, a lot of time and manpower are needed to label the data. In addition to low efficiency, it is difficult to guarantee the quality of the labeled data, which in turn affects the entity recognition accuracy of the named entity recognition model. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for training a named entity recognition model to solve the technical problems in related technologies of inconvenient entity naming model training and inaccurate entity recognition.

[0005] In a first aspect, an embodiment of the present application provides a method for training a named entity recognition model, comprising:

[0006] Acquire domain data, and perform data cleaning on the domain data to obtain sample data;

[0007] Acquire domain information of the sample data, and analyze and process the sample data to obtain semantic information of each data in the sample data;

[0008] According to the set entity type, the domain information and the semantic information, entity annotating the sample data to obtain annotated sample data;

[0009] The entity naming recognition model is trained according to the labeled sample data, and a trained named entity recognition model is obtained when the training is completed.

[0010] In a second aspect, an embodiment of the present application provides a named entity recognition model training device, comprising:

[0011] A data acquisition module is used to acquire domain data and perform data cleaning on the domain data to obtain sample data;

[0012] A data analysis module, used to obtain domain information of the sample data, and analyze and process the sample data to obtain semantic information of each data in the sample data;

[0013] A data annotation module, used to perform entity annotation on the sample data according to the set entity type, the domain information and the semantic information, to obtain the annotated sample data;

[0014] The model training module is used to train the entity naming recognition model according to the labeled sample data, and obtain the trained named entity recognition model when the training is completed.

[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in any one of the above-mentioned named entity recognition model training methods when executing the computer program.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned named entity recognition model training methods.

[0017] The embodiments of the present application provide a method, device, electronic device and storage medium for training a named entity recognition model. Before training the constructed named entity recognition model, the data used for model training is determined. When determining the data, the unlabeled related data is obtained and annotated, and then the annotated data is used for model training. Specifically, unlabeled domain data is obtained, and the entity type of the entity to be identified is set. Then, the domain data is processed using a large-scale language model, and entity extraction is performed based on the obtained contextual semantic information. The entities in the domain data are obtained and annotated, and finally the named entity recognition model is trained using the annotated domain data. This eliminates the need for manual annotation of the training data, thereby improving the convenience of training. At the same time, when processing unlabeled data, a large-scale language model is used for data distillation, so that the data can be annotated quickly and accurately, and then training is performed based on the annotated data, thereby improving the convenience and accuracy of training. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flowchart of a named entity recognition model training method provided in an embodiment of the present application;

[0019] Figure 2 It is a flowchart of steps for labeling sample data provided in an embodiment of the present application;

[0020] Figure 3 It is a schematic diagram of a block diagram of training a named entity recognition model provided in an embodiment of the present application;

[0021] Figure 4 It is a structural schematic diagram of a named entity recognition model training device provided in an embodiment of the present application;

[0022] Figure 5 is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0023] Figure 6 This is another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0025] 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.

[0026] 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.

[0027] In related technologies, the use of named entity recognition models often requires large-scale labeled data to train them. However, the labeling of large-scale data requires a lot of labor costs, and the accuracy of entity recognition is difficult to guarantee.

[0028] Therefore, how to simply and effectively improve the training convenience and model accuracy of named entity recognition models is an urgent problem that needs to be solved.

[0029] In order to solve the technical problems existing in the related art, the present application embodiment provides a method for training a named entity recognition model. Figure 1 , Figure 1 1 is a flowchart of a method for training a named entity recognition model provided in an embodiment of the present application, the method comprising steps 101 to 104;

[0030] Step 101, obtain domain data, and perform data cleaning on the domain data to obtain sample data.

[0031] In one embodiment, the data used to train the named entity model is unlabeled arbitrary data, and the domain to which the data belongs is not set, that is, when acquiring data, any data can be acquired. After obtaining the basic data for model training, the obtained domain data is cleaned to obtain sample data for subsequent use.

[0032] Among them, when obtaining domain data, data can be collected and obtained through web crawlers, API interfaces, public data sets, and business data accumulation. There is no restriction on the specific field of the domain data, but the amount of data is huge.

[0033] In order to ensure the quality of the data obtained by relevant means, it is necessary to clean it, eliminate duplicate data and invalid data in the field data, improve the quality of the data, and then ensure the accuracy of model training.

[0034] Step 102, obtaining domain information of sample data, and analyzing and processing the sample data to obtain semantic information of each data in the sample data.

[0035] In one embodiment, since the obtained domain data is unlabeled data, after obtaining the sample data, it will be labeled, and then the labeled data will be used as data for subsequent model training. Specifically, after obtaining the sample data, the sample data is subjected to relevant analysis and processing to determine the semantic information of each data in the sample data. At the same time, the domain identifier to which each pre-calibrated data belongs will also be obtained. Among them, the domain identifier of each data can be manually specified and required, and there can be multiple data belonging to the same domain identifier. For example, the domain identifier describing the method of using a drug can be the drug field, and the large upper-level field to which the data belongs is the medical field, that is, the drug field is a lower-level field belonging to the medical field.

[0036] In the actual processing process, the domain to which the domain data belongs is unknown, and the same name may have different entity types or labels corresponding to different fields. For example, the entity type of "apple" in the plant field is "fruit type", but the entity type in the mobile phone technology field is "mobile phone type". Therefore, in order to prepare for the labeling of sample data, it is necessary to accurately obtain the domain information of the sample data. At the same time, in order to further improve the accuracy of entity recognition, the semantic information of the sample data can also be obtained to facilitate further identification and determination of the entity.

[0037] Furthermore, when analyzing and processing the sample data, it includes: determining a domain identifier in the domain included in the domain data, and performing semantic recognition on the sample data using a preset large-scale language model according to the domain identifier to determine the semantic information of each data in the sample data.

[0038] For example, when analyzing and processing sample data, the preset Large Language Model (LLM) is used to process the sample data. Based on the strong semantic reasoning ability of LLM, the information contained in the text can be accurately obtained. By analyzing the sample data, the domain information of each data is determined, and the semantic information of each data is determined based on the domain information. Then, when determining the entity, the entity contained in the text data can be more accurately identified.

[0039] Exemplarily, when determining how to extract entities, corresponding prompts can be constructed, where prompts are prompt information input to LLM to guide LLM to complete the entity recognition task for the received sample data, and prompts can include task background information, definition of entity type, return format of extraction results, etc.

[0040] When performing actual entity recognition, after inputting sample data and prompts, the objects to be processed are:

[0041] "You are a highly intelligent and accurate medical domain Named-entity recognition(NER)system.You take Passage as input and your task is torecognize and extract specific types of medical domain named entities in that given passage and classify into a set of following predefined entity types:["disease,"drug","symptom"].Your output format is only[{'T':type of entity frompredefined entity types,'E':entity in the input text}}form,no other form."

[0042] At this time, LLM predicts the entity based on the prompt information constructed at this time, and returns the result based on the entity recognition result. In order to ensure the uniformity of the results, the format of the feedback prediction results can be unified, such as setting the format of the obtained recognition results to the standard json format.

[0043] Step 103 , entity annotating is performed on the sample data according to the set entity type, domain information and semantic information to obtain annotated sample data.

[0044] In one embodiment, after the sample data is obtained, it will be labeled. During the labeling process, the entity will be identified using LLM and the set entity recognition rules, and the entity labeling will be completed when the entity recognition is completed. The sample data will be identified and labeled in combination with the set entity type, and the labeled sample data will be obtained after completing the relevant processing.

[0045] For example, when performing entity recognition on sample data, due to different fields and different contextual meanings, the types of entities obtained will also be different, such as the "apple" described above. Therefore, when performing entity recognition and data labeling, first determine the entity type currently being recognized, and then obtain the entity in the sample data based on the entity type.

[0046] For entity types, they can be set according to different field requirements. For example, in the medical field, entity types can include: disease type, drug type, and symptoms, etc. In conventional fields, name, address, and number are entity types. Therefore, before performing entity recognition, define and determine the entity type, and then process the sample data according to the obtained domain information and semantic information to determine the entity of each sample data, and then complete the data labeling.

[0047] Furthermore, when labeling sample data, you can refer to Figure 2 , Figure 2 It is a flowchart of the steps of labeling sample data provided in an embodiment of the present application, wherein the steps include steps 201 to 203.

[0048] Step 201, receiving an input entity type, and performing entity recognition on sample data according to the entity type to determine a first entity corresponding to the sample data;

[0049] Step 202, filtering the first entity according to the domain information and semantic information to obtain the second entity corresponding to the sample data;

[0050] Step 203: Entity tagging is performed on the sample data according to the entity type and the second entity to obtain the tagged sample data.

[0051] In one embodiment, when performing entity recognition processing based on domain information and semantic information according to the set entity type, entity recognition is performed on sample data according to the entity type to obtain a first entity corresponding to the sample data, wherein the first entity is a set of all entities contained in the sample data, and then the first entity is screened according to the domain information and semantic information to obtain a second entity, wherein the domains to which all entities in the second entity belong are the same domain, and finally, entity labeling is performed on the sample data according to the entity type and the second entity to obtain labeled sample data.

[0052] In actual processing, sample data can be obtained by cleaning domain data based on multiple fields. Therefore, in order to enable the named entity recognition model obtained by subsequent training to accurately perform entity recognition, the obtained entities are filtered according to the set domain, and entities that do not belong to the domain are eliminated, and finally labeled.

[0053] When performing entity recognition processing on sample data, the entities contained in the sample data can be determined by performing word segmentation processing on the sample data and identifying relevant information such as entity boundaries, which specifically includes: performing entity recognition on the sample data to obtain an entity set of the sample data; and screening entities in the entity set according to entity type to obtain a first entity corresponding to the entity type.

[0054] Exemplarily, when processing sample data, each entity of the sample data is identified and processed to obtain the entities contained in the entire sample data. However, since the obtained entities are not necessarily the currently set entity types, the obtained entities are screened based on the entity type, and entities that do not conform to the entity type are eliminated to obtain the first entity. That is, all entities are screened for the first time at this time.

[0055] Furthermore, after completing the first screening of all entities, since only the types of entities are screened, in order to ensure the differences in domains, the entities will be filtered again, which is the content described in step 202, that is, the first entity is further screened according to the domain information and semantic information. This can be understood as dividing entities based on different domains, or as filtering entities based on domains.

[0056] Next, when obtaining the labeled data, it can include: associating the second entity with the entity type, and obtaining the labeling result of each data based on the set standard format, wherein one entity is associated with one entity type; denoising and normalizing the labeling result to obtain the processed labeling result; associating the normalized labeling result with the sample data to obtain the labeled sample data.

[0057] Data labeling is to identify and record the entities contained in the data for subsequent training processing. Each entity in the second entity corresponds to an entity type, and the two are associated to obtain a labeling result. After completing the labeling of each entity in the sample data, the labeling of the sample data is completed.

[0058] In practical applications, since there will be certain errors and noises when predicting and identifying entities, the obtained labeling results will be further filtered and normalized. Filtering is to remove noise and redundant information, and normalization is to ensure the uniformity of data format and unify multiple expressions of the same test question type. For example, the entity types corresponding to "XXXX Enterprise" and "XXXX Unit" are both "Company". In order to ensure the uniformity of data and facilitate subsequent training, normalization can be performed at this time. After filtering and normalization, labeling is performed.

[0059] When filtering and normalizing, after completing the entity recognition of the sample data, the processing of the obtained result information specifically includes: parsing the marking results to obtain the entity information contained in the marking results, where the entity information includes the entity type and entity name; obtaining the filtering rules for denoising and normalization processing; processing the marking results according to the filtering rules and entity information to obtain the processed marking results.

[0060] Exemplarily, after obtaining the entity recognition results of the sample data, the sample data is filtered and normalized using the set relevant rules, wherein the filtering rules for filtering and normalization can be set accordingly according to actual conditions, such as the filtering rules including: entity length, entity prefix and suffix, and entity general name.

[0061] When processing based on the screening rules, it includes: deleting the first entity in the entity information whose entity length is greater than the length threshold, and deleting the entity information corresponding to the first entity; deleting the second entity in the entity information whose entity prefix and suffix do not belong to the corresponding entity type, and deleting the entity information corresponding to the second entity; performing name standard conversion on different entity names belonging to the same entity in the entity information.

[0062] For example, when processing based on a filter rule, the processing can be as follows:

[0063] 1. Limit the length of the recognition results of the entity type. For example, the recognition result of the "name" type should not exceed 4 Chinese characters. Entities with more than 4 characters will be removed.

[0064] 2. Limit the prefixes and suffixes of the entity type recognition results. For example, the "company" type recognition results must end with suffixes such as "company" and "group", and entities that do not have the set suffixes will be eliminated;

[0065] 3. There may be multiple different expressions for the same type of entity, and these type expressions need to be normalized and mapped to a standard name. For example, type expressions such as "enterprise" and "unit" are mapped to the standard entity type "company".

[0066] Of course, when setting and limiting the screening conditions, one or more limiting conditions can be selected according to the actual situation, and the conditional boundaries of each limiting condition are set according to the actual situation.

[0067] Step 104 , training the entity naming recognition model according to the labeled sample data, and obtaining a trained named entity recognition model when the training is completed.

[0068] In one embodiment, after the sample data is labeled, the constructed named entity recognition model is trained using the labeled sample data, and a trained named entity recognition model is obtained when the training is completed.

[0069] Among them, the named entity recognition model can be constructed based on structures such as conditional random field (CRF), recurrent neural network (RNN) and bidirectional encoder representation from transformers (BERT), without any specific restrictions. Then, during training, it can be determined whether the model training is completed according to relevant convergence conditions, such as the number of training times or loss function.

[0070] Further, refer to Figure 3 , Figure 3 It is a block diagram schematic diagram of training a named entity recognition model provided in an embodiment of the present application.

[0071] Specifically, when training, we first collect and obtain domain data and define entity types. Collecting domain data means obtaining relevant text data from a specific domain. This can be done through web crawlers, API interfaces, public data sets, and business data accumulation, and corresponding entity types are defined (entity types are related to the domain), such as diseases, drugs, symptoms, etc. in the medical field. For the collected domain data, in order to ensure the speed and accuracy of processing, the domain data can be processed such as cleaning and deworming to improve the data quality.

[0072] Then, a prompt is constructed as the input of LLM to guide LLM to complete entity recognition for domain data. The prompts can include task background information, entity type definition, return format of extraction results, etc. At this time, LLM will predict entities based on these prompt information, and after completing entity prediction, it will feedback the corresponding entity recognition results in standard JSON format.

[0073] At the same time, when using LLM to predict entities, the fine-tuned LLM model is used to predict unlabeled specific domain data to generate entity recognition results, where the entity recognition results at least include entity type and entity text. And when the entity recognition results are fed back, the annotation results can be obtained in the standard json format.

[0074] Furthermore, since the entity recognition result may contain errors or noise, further processing may be performed after obtaining the entity recognition result, including filtering and normalization processing, and the processing method may be as follows:

[0075] For example, the length of the recognition results of a specific entity type is limited. For example, the recognition result of the "name" type should not exceed 4 Chinese characters, and the entity recognition results that do not meet the conditions are excluded;

[0076] For another example, the prefix and suffix of the recognition results of a specific entity type are limited. For example, the recognition results of the "company" type must end with suffixes such as "company" or "group". The entity recognition results that do not meet the conditions are excluded;

[0077] For example, LLM may have multiple different expressions for the same type of entity, and these type expressions need to be normalized and mapped to a standard name. For example, type expressions such as "enterprise" and "unit" are mapped to the standard entity type "company".

[0078] Finally, the named entity recognition model is trained using the annotated domain data.

[0079] In summary, the present application discloses a method for training a named entity recognition model. Before training the constructed named entity recognition model, the data used for model training is determined. When determining the data, the unlabeled related data is obtained and annotated, and then the annotated data is used for model training. Specifically, unlabeled domain data is obtained, and the entity type of the entity to be identified is set. Then, the domain data is processed using a large-scale language model, and entity extraction is performed based on the obtained contextual semantic information. The entities in the domain data are obtained and annotated, and finally the named entity recognition model is trained using the annotated domain data. This eliminates the need for manual annotation of the training data, thereby improving the convenience of training. At the same time, when processing unlabeled data, a large-scale language model is used for data distillation, so that the data can be annotated quickly and accurately, and then training is performed based on the annotated data, thereby improving the convenience and accuracy of training.

[0080] According to the method described in the above embodiments, this embodiment will be further described from the perspective of a named entity recognition model training device. The named entity recognition model training device can be implemented as an independent entity or integrated into an electronic device, such as a terminal. The terminal may include a mobile phone, a tablet computer, etc.

[0081] See also Figure 4 , Figure 4 is a structural diagram of a named entity recognition model training device provided in an embodiment of the present application, such as Figure 4 As shown, the named entity recognition model training device 400 provided in the embodiment of the present application includes:

[0082] The data acquisition module 401 is used to acquire domain data and perform data cleaning on the domain data to obtain sample data;

[0083] The data analysis module 402 is used to obtain the domain information of the sample data, and analyze and process the sample data to obtain the semantic information of each data in the sample data;

[0084] The data annotation module 403 is used to perform entity annotation on the sample data according to the set entity type, domain information and semantic information to obtain the annotated sample data;

[0085] The model training module 404 is used to train the entity naming recognition model according to the labeled sample data, and obtain a trained named entity recognition model when the training is completed.

[0086] In one embodiment, the data analysis module 402 is further configured to:

[0087] A domain identifier is determined in the domain included in the domain data, and a preset large-scale language model is used to perform semantic recognition on the sample data according to the domain identifier to determine the semantic information of each data in the sample data.

[0088] In one embodiment, the data annotation module 403 is further used to:

[0089] Receive an input entity type, and perform entity recognition on the sample data according to the entity type to determine a first entity corresponding to the sample data;

[0090] According to the domain information and semantic information, the first entity is screened and filtered to obtain the second entity corresponding to the sample data;

[0091] The sample data is entity labeled according to the entity type and the second entity to obtain labeled sample data.

[0092] In one embodiment, the data annotation module 403 is further used to:

[0093] Perform entity recognition on the sample data to obtain an entity set of the sample data;

[0094] Entities are screened in the entity set according to the entity type to obtain a first entity corresponding to the entity type.

[0095] In one embodiment, the data annotation module 403 is further used to:

[0096] Associating the second entity with the entity type, and obtaining a labeling result of each data based on a set standard format, wherein one entity is associated with one entity type;

[0097] De-noising and normalizing the labeling result to obtain a processed labeling result;

[0098] The normalized labeling result is associated with the sample data to obtain the labeled sample data.

[0099] In one embodiment, the data annotation module 403 is further used to:

[0100] Parsing the marking result to obtain entity information contained in the marking result, wherein the entity information includes entity type and entity name;

[0101] Get the filtering rules for denoising and normalization;

[0102] The marking result is processed according to the screening rules and entity information to obtain a processed marking result.

[0103] In one embodiment, the screening rules include: entity length, entity prefix and suffix, and entity collective name; the data annotation module 403 is also used to:

[0104] Deleting a first entity whose entity length is greater than a length threshold in the entity information, and deleting the entity information corresponding to the first entity;

[0105] Deleting the second entity whose entity prefix and suffix in the entity information do not belong to the corresponding entity type, and deleting the entity information corresponding to the second entity;

[0106] Perform name standard conversion on different entity names belonging to the same entity in entity information.

[0107] During specific implementation, the above modules and / or units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above modules and / or units can refer to the previous method embodiments. The specific beneficial effects that can be achieved can also refer to the beneficial effects in the previous method embodiments, which will not be repeated here.

[0108] Also, see Figure 5 , Figure 5 is a schematic diagram of a structure of an electronic device provided in an embodiment of the present application, and the electronic device may be a mobile terminal such as a smart phone, a tablet computer, or the like. Figure 5 As shown, the electronic device 500 includes a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.

[0109] The processor 501 is the control center of the electronic device 500. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device 500 and processes data by running or loading applications stored in the memory 502 and calling data stored in the memory 502, thereby monitoring the electronic device 500 as a whole.

[0110] In this embodiment, the processor 501 in the electronic device 500 will load the instructions corresponding to the processes of one or more applications into the memory 502 according to the following steps, and the processor 501 will run the application stored in the memory 502, thereby implementing any step in the named entity recognition model training method provided in the above embodiment.

[0111] The electronic device 500 can implement the steps in any embodiment of the named entity recognition model training method provided in the embodiments of the present application, and therefore can achieve the beneficial effects that can be achieved by any named entity recognition model training method provided in the embodiments of the present application. For details, please refer to the previous embodiments and will not be repeated here.

[0112] See also Figure 6 , Figure 6 is another structural schematic diagram of an electronic device provided in an embodiment of the present application, such as Figure 6 As shown, Figure 6 The specific structural block diagram of the electronic device provided in the embodiment of the present application is shown, and the electronic device can be used to implement the named entity recognition model training method provided in the above embodiment. The electronic device 600 can be a mobile terminal such as a smart phone or a laptop computer.

[0113] The RF circuit 610 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 610 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 610 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0114] The memory 620 can be used to store software programs and modules, such as the program instructions / modules corresponding to the named entity recognition model training method in the above-mentioned embodiment. The processor 680 executes various functional applications and trains the named entity recognition model by running the software programs and modules stored in the memory 620.

[0115] The memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 620 may further include a memory remotely arranged relative to the processor 680, and these remote memories may be connected to the electronic device 600 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0116] The input unit 630 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 630 may include a touch-sensitive surface 631 and other input devices 632. The touch-sensitive surface 631, also known as a touch display screen or touchpad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 631), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 631 may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 680, and can receive and execute commands sent by the processor 680. In addition, the touch-sensitive surface 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 631, the input unit 630 may further include other input devices 632. Specifically, the other input devices 632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0117] The display unit 640 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device 600, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 640 may include a display panel 641, and optionally, the display panel 641 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 631 may cover the display panel 641, and when the touch-sensitive surface 631 detects a touch operation on or near it, it is transmitted to the processor 680 to determine the type of the touch event, and then the processor 680 provides corresponding visual output on the display panel 641 according to the type of the touch event. Although in the figure, the touch-sensitive surface 631 and the display panel 641 are implemented as two independent components to implement input and output functions, in some embodiments, the touch-sensitive surface 631 and the display panel 641 can be integrated to implement input and output functions.

[0118] The electronic device 600 may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 641 according to the brightness of the ambient light, and the proximity sensor may generate an interrupt when the flip cover is closed or closed. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can also be configured in the electronic device 600, they will not be repeated here.

[0119] The audio circuit 660, the speaker 661, and the microphone 662 can provide an audio interface between the user and the electronic device 600. The audio circuit 660 can transmit the received audio data to the speaker 661 after converting the received audio data into an electrical signal, which is converted into a sound signal for output by the speaker 661; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 660 and converted into audio data, and then the audio data is processed by the output processor 680 and sent to another terminal through the RF circuit 67, or the audio data is output to the memory 620 for further processing. The audio circuit 660 may also include an earplug jack to provide communication between an external headset and the electronic device 600.

[0120] The electronic device 600 can help the user receive requests, send information, etc. through the transmission module 660 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although the transmission module 670 is shown in the figure, it is understandable that it is not a necessary component of the electronic device 600 and can be omitted as needed without changing the essence of the invention.

[0121] The processor 680 is the control center of the electronic device 600. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 620, and calling data stored in the memory 620, it executes various functions of the electronic device 600 and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 680 may include one or more processing cores; in some embodiments, the processor 680 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 680.

[0122] The electronic device 600 also includes a power supply 690 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 680 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 690 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0123] Although not shown, the electronic device 600 also includes a camera (such as a front camera, a rear camera), a Bluetooth module, etc., which will not be described in detail here. Specifically in this embodiment, the display unit of the electronic device is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be executed by one or more processors to implement any step in the named entity recognition model training method provided in the above embodiment.

[0124] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0125] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, and when the instructions are executed by the processor, any step in the named entity recognition model training method provided in the above embodiments can be implemented.

[0126] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0127] Since the instructions stored in the storage medium can execute the steps in any embodiment of the named entity recognition model training method provided in the embodiments of the present application, the beneficial effects that can be achieved by any named entity recognition model training method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0128] The above is a detailed introduction to a named entity recognition model training method, device, electronic device and storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of ​​the present application. At the same time, for those skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application. Moreover, for those of ordinary skill in the art, without departing from the principles of the present application, several improvements and modifications can be made, and these improvements and modifications are also regarded as the scope of protection of the present application.

Claims

1. A method for training a named entity recognition model, characterized in that: include: Acquire domain data, and perform data cleaning on the domain data to obtain sample data; Acquire domain information of the sample data, and analyze and process the sample data to obtain semantic information of each data in the sample data; According to the set entity type, the domain information and the semantic information, entity annotating the sample data to obtain annotated sample data; The entity naming recognition model is trained according to the labeled sample data, and a trained named entity recognition model is obtained when the training is completed.

2. The method according to claim 1, characterized in that The acquiring of the domain information of the sample data and analyzing and processing the sample data to obtain the semantic information of each data in the sample data includes: A domain identifier is determined in the domain included in the domain data, and semantic recognition is performed on the sample data using a preset large-scale language model according to the domain identifier to determine semantic information of each data in the sample data.

3. The method according to claim 1, characterized in that The step of performing entity labeling on the sample data according to the set entity type, the domain information, and the semantic information to obtain the labeled sample data includes: receiving an input entity type, and performing entity recognition on the sample data according to the entity type to determine a first entity corresponding to the sample data; Filtering the first entity according to the domain information and the semantic information to obtain a second entity corresponding to the sample data; The sample data is entity labeled according to the entity type and the second entity to obtain labeled sample data.

4. The method according to claim 3, characterized in that The performing entity recognition on the sample data according to the entity type to determine a first entity corresponding to the sample data includes: Performing entity recognition on the sample data to obtain an entity set of the sample data; Entities are screened in the entity set according to the entity type to obtain a first entity corresponding to the entity type.

5. The method according to claim 3, characterized in that The performing entity marking on the sample data according to the entity type and the second entity to obtain the marked sample data includes: Associating the second entity with the entity type, and obtaining a marking result of each data based on a set standard format, wherein one entity is associated with one entity type; Performing denoising and normalization processing on the labeling result to obtain a processed labeling result; The normalized labeling result is associated with the sample data to obtain labeled sample data.

6. The method according to claim 5, characterized in that The step of performing denoising and normalization processing on the labeling result to obtain a normalized labeling result includes: Parsing the marking result to obtain entity information contained in the marking result, wherein the entity information includes an entity type and an entity name; Get the filtering rules for denoising and normalization; The marking result is processed according to the screening rule and the entity information to obtain a processed marking result.

7. The method according to claim 6, characterized in that The screening rules include: entity length, entity prefix and suffix, and entity general name; The processing of the marking result according to the screening rule and the entity information includes: Deleting a first entity in the entity information whose entity length is greater than a length threshold, and deleting the entity information corresponding to the first entity; Deleting a second entity whose entity prefix and suffix in the entity information do not belong to a corresponding entity type, and deleting the entity information corresponding to the second entity; Different entity names belonging to the same entity in the entity information are converted to a name standard.

8. A named entity recognition model training device, characterized in that: include: A data acquisition module is used to acquire domain data and perform data cleaning on the domain data to obtain sample data; A data analysis module, used to obtain domain information of the sample data, and analyze and process the sample data to obtain semantic information of each data in the sample data; A data annotation module, used to perform entity annotation on the sample data according to the set entity type, the domain information and the semantic information, to obtain the annotated sample data; The model training module is used to train the entity naming recognition model according to the labeled sample data, and obtain the trained named entity recognition model when the training is completed.

9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the steps in the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the method according to any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Intraoperative demanded instrument identification method and system based on semantic identification

    CN121053991A