CN114781384A - Intelligent labeling method, device and equipment for named entities and storage medium - Google Patents

Intelligent labeling method, device and equipment for named entities and storage medium Download PDF

Info

Publication number
CN114781384A
CN114781384A CN202210504154.9A CN202210504154A CN114781384A CN 114781384 A CN114781384 A CN 114781384A CN 202210504154 A CN202210504154 A CN 202210504154A CN 114781384 A CN114781384 A CN 114781384A
Authority
CN
China
Prior art keywords
text
labeled
named entity
labeling
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210504154.9A
Other languages
Chinese (zh)
Inventor
何哲宇
朱昱锦
徐亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202210504154.9A priority Critical patent/CN114781384A/en
Publication of CN114781384A publication Critical patent/CN114781384A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • G06F40/295Named entity recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

The invention relates to an artificial intelligence technology, and discloses an intelligent labeling method for named entities, which comprises the following steps: acquiring a pre-labeled text, and translating the pre-labeled text into a multi-language pre-labeled translation text by using a pre-constructed language translation model; respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs; taking a plurality of bilingual associated text pairs as training corpora, training a pre-constructed named entity labeling model by using the training corpora, and obtaining a target named entity labeling model after the training is finished; and acquiring a text to be labeled, and labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result. In addition, the invention also relates to a block chain technology, and the pre-labeled text and the text to be labeled can be stored in the nodes of the block chain. The invention also provides a named entity intelligent labeling device, equipment and a storage medium. The invention can improve the efficiency of labeling the cross-language named entity.

Description

Intelligent labeling method, device and equipment for named entities and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to an intelligent labeling method and device for named entities, electronic equipment and a computer-readable storage medium.
Background
With the development of artificial intelligence technology, the named entity tagging technology based on natural language processing can generally extract key information in multiple application fields.
However, the existing named entity labeling method can only process the named entity labeling in a single language, and the named entity labeling in multiple languages is very easy to realize, so that the named entity labeling in multiple languages cannot be performed. For example, the named entity text to be labeled is based on a labeling task of a certain language, it is not easy to find out a person who understands the labeling task of the language, and it is difficult to label the named entity text in the major field professionally. Therefore, there is a need for a method for labeling a named entity that can implement multiple languages, so as to simplify the labeling process and improve the efficiency of labeling the named entity across languages.
Disclosure of Invention
The invention provides a named entity intelligent labeling method, a device, equipment and a storage medium, and mainly aims to solve the problem of poor efficiency of labeling a cross-language named entity.
In order to achieve the above object, the present invention provides an intelligent labeling method for named entities, which comprises:
acquiring a pre-labeled text, and translating the pre-labeled text into a multi-language pre-labeled translation text by using a pre-constructed language translation model;
respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs;
taking the bilingual associated text pairs as training corpora, and performing training on a pre-constructed named entity labeling model by using the training corpora to obtain a target named entity labeling model after the training is completed;
and acquiring a text to be labeled, and labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result.
Optionally, the translating the pre-labeled text into a multi-language pre-labeled translated text by using a pre-constructed language translation model includes:
recognizing the language category of the pre-labeled text by using the pre-constructed language translation model;
searching words forming the text to be labeled according to the language category;
converting the words into target words of a target language category by using the pre-constructed language translation model;
and constructing a target language category text by using the target words according to the grammar rule of the pre-constructed language translation model to obtain the pre-labeled translation text.
Optionally, the associating, by using the pre-labeled texts, the pre-labeled translated texts of multiple languages respectively to obtain multiple bilingual associated text pairs includes:
respectively inquiring the separation symbols in the pre-labeled text and the pre-labeled translation text, and numbering the separation symbols in sequence;
correspondingly extracting texts with the same number before the separation symbols, and combining the texts into the bilingual associated text pair.
Optionally, the training of the pre-constructed named entity tagging model by using the training corpus is performed, and after the training is completed, a target named entity tagging model is obtained, which includes:
performing vector coding on the training corpus by using a coding layer in the pre-constructed named entity labeling model to obtain training corpus vector coding;
performing feature coding on the corpus vector by using a coder in the pre-constructed named entity labeling model to obtain corpus feature codes;
decoding the corpus feature codes by utilizing an encoder in the pre-constructed named entity labeling model to obtain corpus decoding feature vectors;
outputting an initial labeling result by utilizing an activation function in the pre-constructed named entity labeling model according to the training corpus decoding feature vector;
calculating a loss value of the initial labeling result and the labeling result in the bilingual associated text pair;
if the loss value is larger than a preset threshold value, adjusting parameters in the pre-constructed named entity tagging model, and returning to execute a coding layer in the pre-constructed named entity tagging model to execute vector coding on the corpus to obtain corpus vector coding;
and if the loss value is not greater than the preset threshold value, obtaining the target named entity labeling model.
Optionally, the performing, by using a coding layer in the pre-constructed named entity tagging model, vector coding on the corpus to obtain corpus vector coding includes:
recognizing the text content of the training corpus;
performing bidirectional encoding on the text content to obtain an encoding position vector of the training corpus;
and summarizing the coding position vector by utilizing the coding layer to obtain the training corpus vector code.
Optionally, the labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result includes:
receiving the text to be labeled by using the target named entity labeling model, and identifying the language type of the text to be labeled;
according to the language category, a named entity library which is the same as the language category in the target named entity labeling model is extracted;
and matching the named entities in the named entity library by using the text to be labeled, and executing labeling operation on the successfully matched named entities in the text to be labeled to obtain a labeling result of the named entities.
Optionally, before obtaining the pre-labeled text, the method further includes:
acquiring a text to be processed, and performing text word segmentation processing on the text to be processed to obtain a word segmentation text;
extracting entities in the word segmentation text to obtain an entity word set;
screening out named entities in the entity word set to obtain a named entity set;
and labeling the words in the named entity set in the text to be processed by using a pre-constructed labeling tool to obtain the pre-labeled text.
In order to solve the above problem, the present invention further provides an intelligent naming device for named entities, comprising:
the pre-labeling text processing module is used for acquiring pre-labeling texts and translating the pre-labeling texts into multi-language pre-labeling translation texts by utilizing a pre-constructed language translation model; respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs;
the named entity labeling model training module is used for taking the multiple bilingual associated text pairs as training corpora, utilizing the training corpora to train a pre-constructed named entity labeling model, and obtaining a target named entity labeling model after training is finished;
and the named entity labeling module is used for acquiring a text to be labeled and labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the named entity intelligent tagging method described above.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the named entity intelligent labeling method described above.
According to the embodiment of the invention, the pre-marked text is subjected to language conversion through the pre-established language translation model, so that the precise conversion of the named entity in the pre-marked text can be realized, in addition, the pre-marked translation text subjected to language conversion is subjected to associated combination with the original language pre-marked text, so that the training corpus of the pre-established named entity marking model is established, the recognition rate of the pre-established named entity marking model on the named entity contained in multiple languages can be improved, the marking precision of the named entity is improved, and finally, the marking of the text to be marked is executed through the trained target named entity marking model, so that the marking task of the named entity of the language text can be realized.
Drawings
Fig. 1 is a schematic flowchart of an intelligent naming-entity labeling method according to an embodiment of the present invention;
fig. 2 is a functional block diagram of an intelligent naming device for named entities according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device for implementing the intelligent naming-entity labeling method according to an embodiment of the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides an intelligent naming entity labeling method. The execution subject of the named entity intelligent annotation method includes, but is not limited to, at least one of electronic devices, such as a server, a terminal, and the like, which can be configured to execute the method provided by the embodiments of the present application. In other words, the named entity intelligent labeling method can be executed by software or hardware installed in a terminal device or a server device, and the software can be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of an intelligent naming method for a named entity according to an embodiment of the present invention. In this embodiment, the intelligent naming method for the named entity includes:
s1, obtaining the pre-labeled text, and translating the pre-labeled text into multi-language pre-labeled translation text by utilizing the pre-constructed language translation model.
In the embodiment of the invention, the pre-labeled text refers to a named entity labeled text obtained by performing entity labeling on an obtained initial text by using a professional entity name word in advance in a professional field. The pre-labeled text can be information text files from a plurality of application fields. For example, in the financial application field, the pre-labeled text may be a named entity labeled text obtained by labeling the financial information text with a named entity noun such as profit, and cost in the financial application field in advance.
In the embodiment of the invention, the pre-constructed language translation model is a language conversion tool for converting a text into a multilingual text.
The embodiment of the invention utilizes the pre-constructed language translation model to translate the pre-labeled text into the multi-language pre-labeled translation text, thereby improving the practicability of the pre-labeled text and the named entity in the pre-labeled text in the cross-language application field.
As an embodiment of the present invention, the translating the pre-labeled text into the multi-language pre-labeled translated text by using the pre-constructed language translation model includes: recognizing the language category of the pre-labeled text by using the pre-constructed language translation model; searching words forming the text to be labeled according to the language category; converting the words into target words of a target language category by using the pre-constructed language translation model; and constructing a target language category text by using the target words according to the grammar rule of the pre-constructed language translation model to obtain the pre-labeled translation text.
In the embodiment of the present invention, the language type refers to a type of a language of a character existing in a character form. For example, the Chinese, English, German and Japanese languages.
In the embodiment of the invention, the grammar rule refers to the word arrangement sequence of a single sentence. For example, grammatical rules such as "subject + predicate + object", "subject + verb + table", and the like.
Before the embodiment of the invention acquires the pre-marked text, the method further comprises the following steps: acquiring a text to be processed, and performing text word segmentation processing on the text to be processed to obtain a word segmentation text; extracting entities in the word segmentation text to obtain an entity word set; screening out named entities in the entity word set to obtain a named entity set; and labeling the words in the named entity set in the text to be processed by using a pre-constructed labeling tool to obtain the pre-labeled text.
In the embodiment of the present invention, the entities refer to a set of things that can be distinguished from each other and actually exist. Such as time, address, name, etc. remaining in the text, and the named entity refers to a word whose part of speech is a noun and is identified as a name in an entity. For example, the names of organizations, people, food, and places.
In the embodiment of the present invention, the pre-constructed annotation tool may be annotated by nlp (natural Language processing).
S2, associating the pre-labeled translated texts with multiple languages respectively by using the pre-labeled texts to obtain a plurality of bilingual associated text pairs.
The embodiment of the invention obtains a plurality of bilingual associated text pairs by respectively associating the pre-labeled texts with the multi-language pre-labeled translated texts, can bind two texts with the same meaning, and is convenient for inquiring named entities in the two texts.
As an embodiment of the present invention, the obtaining a plurality of bilingual associated text pairs by associating the pre-labeled texts with the multi-language pre-labeled translated texts respectively includes: respectively inquiring separation symbols in the pre-labeled text and the pre-labeled translation text, and numbering the separation symbols in sequence; correspondingly extracting texts before the separation symbols with the same number, and combining the texts into the bilingual associated text pair.
And S3, taking the bilingual associated text pairs as a training corpus, training a pre-constructed named entity labeling model by using the training corpus, and obtaining a target named entity labeling model after the training is finished.
In the embodiment of the invention, the pre-constructed named entity labeling model is a neural network model adopting a Sequence-to-Sequence architecture, wherein the pre-constructed named entity labeling model comprises an encoding layer, an encoder and a decoder, the encoding layer mainly converts a text into a text vector, the encoder carries out vector encoding on the text vector, and the decoder is used for analyzing the text vector characteristics to realize the accurate identification of the pre-constructed named entity labeling model on a bilingual associated text.
The embodiment of the invention utilizes the training corpus to train the pre-constructed named entity tagging model, and the target named entity tagging model is obtained after the training is finished, so that the recognition rate of the pre-constructed named entity tagging model to the multi-language named entity can be improved.
As an embodiment of the present invention, the training of the pre-constructed named entity tagging model by using the training corpus to obtain the target named entity tagging model after the training is completed includes: performing vector coding on the corpus by using a coding layer in the pre-constructed named entity tagging model to obtain corpus vector coding; performing feature coding on the corpus vector by using a coder in the pre-constructed named entity labeling model to obtain corpus feature codes; decoding the corpus feature codes by utilizing an encoder in the pre-constructed named entity labeling model to obtain corpus decoding feature vectors; outputting an initial labeling result by utilizing an activation function in the pre-constructed named entity labeling model according to the training corpus decoding feature vector; calculating a loss value of the initial labeling result and the labeling result in the bilingual associated text pair; if the loss value is larger than a preset threshold value, adjusting parameters in the pre-constructed named entity tagging model, and returning to execute a coding layer in the pre-constructed named entity tagging model to execute vector coding on the corpus to obtain corpus vector coding; and if the loss value is not greater than the preset threshold value, obtaining the target named entity labeling model.
In the embodiment of the invention, the activation function can adopt a Softmax activation function, the loss value can be calculated by adopting a loss function, and the preset threshold value can be set to be 0.1 or can be set according to the actual application field.
Further, the performing vector coding on the corpus by using a coding layer in the pre-constructed named entity tagging model to obtain corpus vector coding includes: recognizing the text content of the training corpus; performing bidirectional coding on the text content to obtain a coding position vector of the training corpus; and summarizing the coding position vector by utilizing the coding layer to obtain the training corpus vector code.
And S4, obtaining a text to be labeled, labeling the text to be labeled by using the target named entity labeling model, and obtaining a named entity labeling result.
In the embodiment of the invention, the text to be labeled refers to a text file without a named entity label.
In detail, the labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result includes: receiving the text to be labeled by using the target named entity labeling model and identifying the language type of the text to be labeled; according to the language type, a named entity library which is the same as the language type in the target named entity labeling model is extracted; and matching the named entities in the named entity library by using the text to be labeled, and executing labeling operation on the successfully matched named entities in the text to be labeled to obtain a labeling result of the named entities.
According to the embodiment of the invention, through a pre-constructed language translation model, the pre-labeled text is subjected to language conversion, so that the precise conversion of named entities in the pre-labeled text can be realized, in addition, the pre-labeled translation text subjected to language conversion is combined with the original language pre-labeled text in a correlation manner, so that the training corpus of the pre-constructed named entity labeling model is constructed, the recognition rate of the pre-constructed named entity labeling model on the named entities contained in multiple languages can be improved, the labeling precision of the named entities is improved, and finally, the labeling of the text to be labeled is executed through the trained target named entity labeling model, so that the labeling task of the named entities in the multi-language text can be realized.
Fig. 2 is a functional block diagram of an intelligent naming-entity labeling device according to an embodiment of the present invention.
The named entity intelligent labeling device 100 can be installed in electronic equipment. According to the realized functions, the intelligent labeling device 100 for named entities can include a pre-labeling text processing module 101, a named entity labeling model training module 102 and a named entity labeling module 103. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the pre-labeled text processing module 101 is configured to obtain a pre-labeled text, and translate the pre-labeled text into a multi-language pre-labeled translation text by using a pre-established language translation model; respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs;
in the embodiment of the invention, the pre-labeled text refers to a named entity labeled text obtained by performing entity labeling on an obtained initial text by using a professional entity name word in advance in a professional field. Wherein the pre-labeled text can be information text files from a plurality of application fields. For example, in the financial application field, the pre-labeled text may be named entity labeled text obtained by labeling the financial information text with named entity terms such as profit, and cost in the financial application field in advance.
In the embodiment of the invention, the pre-constructed language translation model is a language conversion tool for converting texts into multilingual texts.
The embodiment of the invention utilizes the pre-constructed language translation model to translate the pre-labeled text into the multi-language pre-labeled translation text, thereby improving the practicability of the pre-labeled text and the named entity in the pre-labeled text in the cross-language application field.
As an embodiment of the present invention, the translating the pre-labeled text into the multi-language pre-labeled translated text by using the pre-constructed language translation model includes: recognizing the language type of the pre-labeled text by using the pre-constructed language translation model; searching words forming the text to be labeled according to the language type; converting the words into target words of a target language category by using the pre-constructed language translation model; and constructing a target language category text by using the target words according to the grammar rule of the pre-constructed language translation model to obtain the pre-labeled translation text.
In the embodiment of the present invention, the language type refers to a type of a language of a character in a character form. For example, the Chinese, English, German and Japanese languages.
In the embodiment of the invention, the grammar rule refers to the word arrangement sequence forming a single sentence. For example, grammatical rules such as "subject + predicate + object", "subject + verb + table", and the like.
Before the pre-marked text is obtained, the method of the embodiment of the invention further comprises the following steps: acquiring a text to be processed, and performing text word segmentation processing on the text to be processed to obtain a word segmentation text; extracting entities in the word segmentation text to obtain an entity word set; screening out named entities in the entity word set to obtain a named entity set; and labeling the words in the named entity set in the text to be processed by using a pre-constructed labeling tool to obtain the pre-labeled text.
In the embodiments of the present invention, the entities refer to a set of things that can be distinguished from each other and actually exist. Such as time, address, name, etc., remaining in the text, and the named entity refers to words in the entity whose part of speech is a noun and which are identified as names. For example, the names of organizations, people, food, and places.
In the embodiment of the present invention, the pre-constructed annotation tool may be annotated by nlp (natural Language processing).
The embodiment of the invention obtains a plurality of bilingual associated text pairs by respectively associating the pre-labeled texts with the multi-language pre-labeled translated texts, can bind two texts with the same meaning, and is convenient for inquiring named entities in the two texts.
As an embodiment of the present invention, the associating the pre-labeled texts with the multi-language pre-labeled translated texts to obtain a plurality of bilingual associated text pairs respectively includes: respectively inquiring separation symbols in the pre-labeled text and the pre-labeled translation text, and numbering the separation symbols in sequence; correspondingly extracting texts with the same number before the separation symbols, and combining the texts into the bilingual associated text pair.
The named entity tagging model training module 102 is configured to use the multiple bilingual associated text pairs as a training corpus, perform training on a pre-constructed named entity tagging model by using the training corpus, and obtain a target named entity tagging model after the training is completed;
in the embodiment of the invention, the pre-constructed named entity labeling model is a neural network model adopting a Sequence-to-Sequence architecture, wherein the pre-constructed named entity labeling model comprises an encoding layer, an encoder and a decoder, the encoding layer mainly converts a text into a text vector, the encoder carries out vector encoding on the text vector, and the decoder is used for analyzing the text vector characteristics to realize the accurate identification of the pre-constructed named entity labeling model on a bilingual associated text.
The embodiment of the invention utilizes the training corpus to train the pre-constructed named entity tagging model, and obtains the target named entity tagging model after the training is finished, thereby improving the recognition rate of the pre-constructed named entity tagging model to the multi-language named entity.
As an embodiment of the present invention, the training performed on the pre-constructed named entity tagging model by using the training corpus to obtain the target named entity tagging model after the training is completed includes: performing vector coding on the corpus by using a coding layer in the pre-constructed named entity tagging model to obtain corpus vector coding; performing feature coding on the corpus vector by using a coder in the pre-constructed named entity labeling model to obtain corpus feature codes; decoding the corpus feature codes by utilizing an encoder in the pre-constructed named entity labeling model to obtain corpus decoding feature vectors; outputting an initial labeling result by utilizing an activation function in the pre-constructed named entity labeling model according to the training corpus decoding feature vector; calculating a loss value of the initial labeling result and the labeling result in the bilingual associated text pair; if the loss value is larger than a preset threshold value, adjusting parameters in the pre-constructed named entity tagging model, and returning to execute a coding layer in the pre-constructed named entity tagging model to execute vector coding on the corpus to obtain corpus vector coding; and if the loss value is not greater than the preset threshold value, obtaining the target named entity labeling model.
In the embodiment of the invention, the activation function can adopt a Softmax activation function, the loss value can be calculated by adopting a loss function, and the preset threshold value can be set to be 0.1 or can be set according to the actual application field.
Further, the performing vector coding on the corpus by using a coding layer in the pre-constructed named entity tagging model to obtain corpus vector coding includes: recognizing the text content of the training corpus; performing bidirectional encoding on the text content to obtain an encoding position vector of the training corpus; and summarizing the coding position vector by utilizing the coding layer to obtain the training corpus vector code.
The named entity labeling module 103 is configured to obtain a text to be labeled, label the text to be labeled by using the target named entity labeling model, and obtain a named entity labeling result.
In the embodiment of the invention, the text to be labeled refers to a text file without a named entity label. In detail, the labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result includes: receiving the text to be labeled by using the target named entity labeling model and identifying the language type of the text to be labeled; according to the language type, a named entity library which is the same as the language type in the target named entity labeling model is extracted; and matching the named entities in the named entity library by using the text to be labeled, and executing labeling operation on the successfully matched named entities in the text to be labeled to obtain a labeling result of the named entities.
Fig. 3 is a schematic structural diagram of an electronic device for implementing an intelligent labeling method for a named entity according to an embodiment of the present invention.
The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may further include a computer program, such as a named entity intelligent annotation program, stored in the memory 11 and operable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions of the electronic device and processes data by running or executing programs or modules (for example, executing a named entity intelligent labeling program, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only for storing application software installed in the electronic device and various types of data, such as code of a named entity intelligent annotation program, but also for temporarily storing data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are commonly used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 3 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 3 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The named entity intelligent annotation program stored in the memory 11 of the electronic device 1 is a combination of a plurality of instructions, and when running in the processor 10, can realize that:
acquiring a pre-labeled text, and translating the pre-labeled text into a multi-language pre-labeled translation text by using a pre-constructed language translation model;
respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs;
taking the bilingual associated text pairs as a training corpus, training a pre-constructed named entity labeling model by using the training corpus, and obtaining a target named entity labeling model after training;
and acquiring a text to be labeled, and labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium storing a computer program which, when executed by a processor of an electronic device, implements:
acquiring a pre-labeled text, and translating the pre-labeled text into a multi-language pre-labeled translation text by using a pre-constructed language translation model;
respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs;
taking the bilingual associated text pairs as a training corpus, training a pre-constructed named entity labeling model by using the training corpus, and obtaining a target named entity labeling model after training;
and acquiring a text to be labeled, and labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it will be obvious that the term "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An intelligent labeling method for named entities, which is characterized in that the method comprises the following steps:
acquiring a pre-labeled text, and translating the pre-labeled text into a multi-language pre-labeled translation text by using a pre-constructed language translation model;
respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs;
taking the bilingual associated text pairs as training corpora, and performing training on a pre-constructed named entity labeling model by using the training corpora to obtain a target named entity labeling model after the training is completed;
and acquiring a text to be labeled, and labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result.
2. The intelligent tagging method for named entities of claim 1, wherein said translating said pre-tagged text into multi-lingual pre-tagged translated text using a pre-built language translation model, comprises:
recognizing the language type of the pre-labeled text by using the pre-constructed language translation model;
searching words forming the text to be labeled according to the language category;
converting the words into target words of a target language category by using the pre-constructed language translation model;
and constructing a target language category text by using the target words according to the grammar rule of the pre-constructed language translation model to obtain the pre-labeled translation text.
3. The intelligent tagging method for a named entity recited in claim 1, wherein said associating said pre-tagged text with multiple languages of said pre-tagged translated text to obtain multiple bilingual associated text pairs comprises:
respectively inquiring the separation symbols in the pre-labeled text and the pre-labeled translation text, and numbering the separation symbols in sequence;
correspondingly extracting texts with the same number before the separation symbols, and combining the texts into the bilingual associated text pair.
4. The intelligent labeling method for named entities according to claim 1, wherein the training of the pre-constructed named entity labeling model by using the training corpus to obtain the target named entity labeling model after the training is completed comprises:
performing vector coding on the corpus by using a coding layer in the pre-constructed named entity tagging model to obtain corpus vector coding;
performing feature coding on the corpus vector by using a coder in the pre-constructed named entity labeling model to obtain corpus feature codes;
decoding the corpus feature codes by utilizing an encoder in the pre-constructed named entity labeling model to obtain corpus decoding feature vectors;
outputting an initial labeling result by using an activation function in the pre-constructed named entity labeling model according to the training corpus decoding feature vector;
calculating a loss value of the initial labeling result and the labeling result in the bilingual associated text pair;
if the loss value is larger than a preset threshold value, adjusting parameters in the pre-constructed named entity tagging model, and returning to execute a coding layer in the pre-constructed named entity tagging model to execute vector coding on the corpus to obtain corpus vector coding;
and if the loss value is not greater than the preset threshold value, obtaining the target named entity labeling model.
5. The intelligent labeling method for named entities according to claim 4, wherein said performing vector coding on said corpus by using a coding layer in said pre-constructed named entity labeling model to obtain corpus vector coding comprises:
recognizing the text content of the training corpus;
performing bidirectional encoding on the text content to obtain an encoding position vector of the training corpus;
and summarizing the coding position vector by utilizing the coding layer to obtain the training corpus vector code.
6. The intelligent labeling method for the named entity according to claim 1, wherein the labeling of the text to be labeled with the target named entity labeling model to obtain a named entity labeling result comprises:
receiving the text to be labeled by using the target named entity labeling model, and identifying the language type of the text to be labeled;
according to the language type, a named entity library which is the same as the language type in the target named entity labeling model is extracted;
and matching the named entities in the named entity library by using the text to be labeled, and executing labeling operation on the successfully matched named entities in the text to be labeled to obtain a labeling result of the named entities.
7. The intelligent naming entity tagging method of claim 1, wherein prior to obtaining pre-tagged text, said method further comprises:
acquiring a text to be processed, and performing text word segmentation processing on the text to be processed to obtain a word segmentation text;
extracting entities in the word segmentation text to obtain an entity word set;
screening out named entities in the entity word set to obtain a named entity set;
and performing labeling on the words in the named entity set in the text to be processed by using a pre-constructed labeling tool to obtain the pre-labeled text.
8. An intelligent naming entity annotation apparatus, said apparatus comprising:
the pre-labeled text processing module is used for acquiring a pre-labeled text and translating the pre-labeled text into a multi-language pre-labeled translation text by utilizing a pre-constructed language translation model; respectively associating the multi-language pre-labeled translation texts by using the pre-labeled texts to obtain a plurality of bilingual association text pairs;
the named entity labeling model training module is used for taking the multiple bilingual associated text pairs as training corpora, utilizing the training corpora to train a pre-constructed named entity labeling model, and obtaining a target named entity labeling model after training is finished;
and the named entity labeling module is used for acquiring a text to be labeled and labeling the text to be labeled by using the target named entity labeling model to obtain a named entity labeling result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the intelligent tagging method for named entities as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the intelligent method for naming a entity as claimed in any one of claims 1 to 7.
CN202210504154.9A 2022-05-10 2022-05-10 Intelligent labeling method, device and equipment for named entities and storage medium Pending CN114781384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210504154.9A CN114781384A (en) 2022-05-10 2022-05-10 Intelligent labeling method, device and equipment for named entities and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210504154.9A CN114781384A (en) 2022-05-10 2022-05-10 Intelligent labeling method, device and equipment for named entities and storage medium

Publications (1)

Publication Number Publication Date
CN114781384A true CN114781384A (en) 2022-07-22

Family

ID=82436423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210504154.9A Pending CN114781384A (en) 2022-05-10 2022-05-10 Intelligent labeling method, device and equipment for named entities and storage medium

Country Status (1)

Country Link
CN (1) CN114781384A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116681074A (en) * 2023-08-04 2023-09-01 中科航迈数控软件(深圳)有限公司 Method, device, equipment and storage medium for detecting misoperation of numerical control system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116681074A (en) * 2023-08-04 2023-09-01 中科航迈数控软件(深圳)有限公司 Method, device, equipment and storage medium for detecting misoperation of numerical control system
CN116681074B (en) * 2023-08-04 2024-04-05 中科航迈数控软件(深圳)有限公司 Method, device, equipment and storage medium for detecting misoperation of numerical control system

Similar Documents

Publication Publication Date Title
CN112597312A (en) Text classification method and device, electronic equipment and readable storage medium
CN111144120A (en) Training sentence acquisition method and device, storage medium and electronic equipment
CN113515938B (en) Language model training method, device, equipment and computer readable storage medium
CN113704429A (en) Semi-supervised learning-based intention identification method, device, equipment and medium
CN113821622B (en) Answer retrieval method and device based on artificial intelligence, electronic equipment and medium
CN115238670B (en) Information text extraction method, device, equipment and storage medium
CN111753089A (en) Topic clustering method and device, electronic equipment and storage medium
CN113051356A (en) Open relationship extraction method and device, electronic equipment and storage medium
CN112507663A (en) Text-based judgment question generation method and device, electronic equipment and storage medium
CN113378970A (en) Sentence similarity detection method and device, electronic equipment and storage medium
CN113360654B (en) Text classification method, apparatus, electronic device and readable storage medium
CN114781384A (en) Intelligent labeling method, device and equipment for named entities and storage medium
CN113918031A (en) System and method for Chinese punctuation recovery using sub-character information
CN113254814A (en) Network course video labeling method and device, electronic equipment and medium
CN116468025A (en) Electronic medical record structuring method and device, electronic equipment and storage medium
CN112989043B (en) Reference resolution method, reference resolution device, electronic equipment and readable storage medium
CN114943306A (en) Intention classification method, device, equipment and storage medium
CN115238115A (en) Image retrieval method, device and equipment based on Chinese data and storage medium
CN115146064A (en) Intention recognition model optimization method, device, equipment and storage medium
CN114138243A (en) Function calling method, device, equipment and storage medium based on development platform
CN113850643A (en) Product recommendation method and device, electronic equipment and readable storage medium
CN112364068A (en) Course label generation method, device, equipment and medium
CN112597748A (en) Corpus generation method, apparatus, device and computer readable storage medium
CN115221875B (en) Word weight generation method, device, electronic equipment and storage medium
CN113704478B (en) Text element extraction method, device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination