WO2021151303A1 - Named entity alignment device and apparatus, and electronic device and readable storage medium - Google Patents

Named entity alignment device and apparatus, and electronic device and readable storage medium Download PDF

Info

Publication number
WO2021151303A1
WO2021151303A1 PCT/CN2020/119085 CN2020119085W WO2021151303A1 WO 2021151303 A1 WO2021151303 A1 WO 2021151303A1 CN 2020119085 W CN2020119085 W CN 2020119085W WO 2021151303 A1 WO2021151303 A1 WO 2021151303A1
Authority
WO
WIPO (PCT)
Prior art keywords
named entity
alignment
aligned
standard
vector
Prior art date
Application number
PCT/CN2020/119085
Other languages
French (fr)
Chinese (zh)
Inventor
阮晓雯
邓攀
徐亮
肖京
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021151303A1 publication Critical patent/WO2021151303A1/en

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
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of big data, and in particular to a method, device, electronic device, and readable storage medium for aligning named entities.
  • the inventor realizes that there are currently two main types of named entity alignment methods. One is based on the morphological features of different entities, but some morphological feature alignments lose their semantic features and have low accuracy; the other is based on entities for semantics. Alignment requires a lot of training data for training, but the training data is not easy to obtain, which leads to the low accuracy of this method.
  • a named entity alignment method provided by this application includes:
  • the present application also provides a named entity alignment device, the device includes:
  • the standardization module is used to obtain a named entity to be aligned, and perform standardization processing on the named entity to be aligned to obtain a standard named entity to be aligned;
  • the model training module is used to obtain a test named entity set, sample the test named entity set to obtain a test named entity subset; use each test named entity subset to train a preset neural network model to obtain a named entity alignment Model collection
  • the model alignment module is configured to perform model alignment on the named entity to be aligned according to the named entity alignment model set to obtain an alignment result.
  • This application also provides an electronic device, which includes:
  • Memory storing at least one instruction
  • the processor executes the instructions stored in the memory to implement the following steps:
  • This application also provides a computer-readable storage medium, including a storage data area and a storage program area.
  • the storage data area stores data created according to the use of blockchain nodes
  • the storage program area stores a computer program, which is readable by the computer.
  • At least one instruction is stored in the storage medium, and the at least one instruction is executed by the processor in the electronic device to implement the following steps:
  • FIG. 1 is a schematic flowchart of a named entity alignment method provided by an embodiment of this application
  • FIG. 2 is a schematic diagram of modules of a named entity alignment device provided by an embodiment of this application.
  • FIG. 3 is a schematic diagram of the internal structure of an electronic device for implementing a named entity alignment method provided by an embodiment of the application;
  • This application provides a named entity alignment method.
  • FIG. 1 it is a schematic flowchart of a named entity alignment method provided by an embodiment of this application.
  • the method can be executed by a device, and the device can be implemented by software and/or hardware.
  • the named entity alignment method includes:
  • the named entities are names of persons, organizations, places, and all other entities identified by names, and the named entities to be aligned are named entities that do not use a uniform identification.
  • “Ali Group” and “Alibaba” are different entity identification names, both of which represent the entity “Alibaba Network Technology Co., Ltd.”, then "Ali Group” and “Alibaba” are named entities to be aligned.
  • the named entity to be aligned can be obtained from the Internet.
  • standardization processing is performed on the named entity to be aligned to obtain the standard named entity to be aligned.
  • the standardization process includes: performing unified conversion between simplified and traditional Chinese, unified case conversion, and deletion of special characters on the named entity to be aligned to obtain the standard named entity to be aligned.
  • the special characters refer to meaningless symbols in the named entities to be aligned, such as spaces, brackets, etc.
  • test named entity set is a set of multiple named entities.
  • the data in the test named entity set is less and difficult to obtain, and the test named entity set is sampled to obtain the test named entity subset, which expands the data for subsequent model training.
  • each test named entity in the test named entity subset is converted into a test named entity vector to obtain a test named entity vector subset, the test named entity vector subset is determined as a training set, and the test named entity vector subset is determined as a training set.
  • the test named entity vector subset is labeled to obtain a label set, and the neural network model is trained using the training set and the label set to obtain a named entity alignment model.
  • marking the test named entity vector subset in the embodiment of the present application includes:
  • the standard named entity library is a collection of standard named entities, and the standard named entities are named entities that are officially uniformly identified.
  • test named entity "Alibaba" in the test named entity subset corresponds to the standard named entity "Alibaba Network Technology Co., Ltd.” in the pre-built standard named entity library, then the standard named entity "Alibaba Network Technology” is used
  • the standard named entity vector transformed by "Technology Co., Ltd.” marks the test named entity vector transformed by the test named entity "Alibaba” in the test named entity vector subset.
  • the above-mentioned sampling process can obtain multiple test named entity subsets, and each test named entity subset can train a neural network model to obtain the named entity alignment model, for example:
  • the test named entity set is sampled to obtain 5 test named entity subsets, each test named entity subset is trained with a preset neural network model to obtain a named entity alignment model, and a total of 5 named entity alignment models are obtained.
  • the test named entity subset described in the embodiment of this application has less data, and a too deep neural network will cause the model to be over-fitted and the model effect is poor. Therefore, the neural network model described in the embodiment of this application can be used as a shallow layer. Convolutional neural network is constructed.
  • using the training set and the label set to train the neural network model includes:
  • C Use a preset activation function to calculate the dimension-up data set to obtain a predicted value, and use the predicted value and the label value contained in the label set as the input parameters of the pre-built loss function to calculate the loss value;
  • D Compare the magnitude of the loss value with the preset loss threshold, if the loss value is greater than or equal to the loss threshold, return to A; if the loss value is less than the loss threshold, obtain the named entity alignment model .
  • the training data of each model in the named entity alignment model set can be stored in the blockchain.
  • the standard named entity to be aligned is used to form a pre-built standard named entity library. Alignment, wherein the standard named entity library is a collection of standard named entities, and the standard named entity is a named entity with an official uniform identification.
  • the use of the standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library includes:
  • the embodiment of the present application uses the edit distance method to perform the morphological alignment.
  • the morphological alignment includes:
  • the preset edit distance value is 0.
  • the edit distance refers to at least how many times of processing is required to change one character string into another character string.
  • the standard named entity to be aligned is "Alibaba Network Technology Co., Ltd.”
  • the standard named entity library contains “Alibaba Network Technology Co., Ltd.”, then "Alibaba Network Technology Co., Ltd.” needs 0
  • the second processing can be converted to "Alibaba Network Technology Co., Ltd.”, so the edit distance between the two is 0.
  • performing model alignment on the named entity to be aligned according to the named entity alignment model set includes:
  • each word in the standard named entity to be aligned is converted into a word vector of a predetermined dimension by using an embedding (word embedding) method.
  • converting each standard named entity in the standard named entity library into a standard named entity vector includes:
  • S331 Convert each word in the standard named entity into a word vector of a predetermined dimension
  • S332 Calculate the average value of the word vectors corresponding to all characters in the standard named entity to obtain the standard named entity vector.
  • the similarity calculation analysis processing includes:
  • the embodiment of the present application uses cosine similarity to calculate the similarity value.
  • the similarity value can be calculated by the following formula:
  • x represents the predicted aligned entity vector
  • y represents the standard named entity vector
  • x i represents the i-th vector value of the predicted aligned entity vector
  • y i represents the i-th vector of the standard named entity vector
  • i is a positive integer
  • n represents the vector dimension of the predicted alignment entity vector and the standard named entity vector.
  • using a majority voting mechanism to screen the entities to be aligned in the result set to be aligned includes:
  • the standardized processing of the named entities to be aligned is performed to obtain the standardized named entities to be aligned, and the influence of the aligned named entity format and irrelevant characters is eliminated;
  • the test named entity set is sampled and processed to obtain the test named entity subset ,
  • Use each of the test named entity subsets to train a preset neural network model to obtain a named entity alignment model set, use the multiple test named entity subsets obtained by sampling to train to obtain a named entity alignment model set, and align according to the named entity
  • the model set performs model alignment on the named entities to be aligned, and uses multiple models to perform model alignment respectively, which improves the accuracy of named entity alignment.
  • FIG. 2 it is a functional block diagram of the named entity alignment device of the present application.
  • the named entity alignment apparatus 100 described in this application can be installed in an electronic device.
  • the named entity alignment device may include a standardization module 101, a model training module 102, and a model alignment module 103.
  • the module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the standardization module 101 is configured to obtain a named entity to be aligned, and perform standardization processing on the named entity to be aligned to obtain a standard named entity to be aligned.
  • the named entity is a person's name, an organization name, a place name, and all other entities identified by a name
  • the named entity to be aligned is a named entity that does not use a uniform identification.
  • “Ali Group” and “Alibaba” are different entity identification names, both of which refer to the entity “Alibaba Network Technology Co., Ltd.”, then "Ali Group” and “Alibaba” are named entities to be aligned.
  • the named entity to be aligned can be obtained from the Internet.
  • standardization processing is performed on the named entity to be aligned to obtain the standard named entity to be aligned.
  • the standardization process performed by the standardization module 101 includes: performing unified conversion between simplified and traditional characters, unified case conversion, and deletion of special characters on the named entity to be aligned to obtain the standard named entity to be aligned.
  • the special characters refer to meaningless symbols in the named entities to be aligned, such as spaces, brackets, etc.
  • the model training module 102 is used to obtain a test named entity set, perform sampling processing on the test named entity set to obtain a test named entity subset; use each of the test named entity subsets to train a preset neural network model to obtain Named entity alignment model collection.
  • test named entity set is a set of multiple named entities.
  • the test named entity set in the embodiment of the present application has less data in the test named entity set and is difficult to obtain.
  • the model training module 102 performs sampling processing on the test named entity set to obtain the test named entity subset and expand subsequent models. Training data.
  • the model training module 102 described in this embodiment of the application converts each test named entity in the test named entity subset into a test named entity vector to obtain a test named entity vector subset; the model training module 102 names the test The entity vector subset is determined as the training set; the model training module 102 marks the test named entity vector subset to obtain a label set; the model training module 102 uses the training set and the label set to The neural network model is trained to obtain a named entity alignment model.
  • model training module 102 in the embodiment of the present application uses the following means to mark the subset of test named entity vectors:
  • the standard named entity library is a collection of standard named entities, and the standard named entities are named entities that are officially uniformly identified.
  • the standard named entity vector is used to mark the corresponding test named entity vector in the test named entity vector subset.
  • test named entity "Alibaba" in the test named entity subset corresponds to the standard named entity "Alibaba Network Technology Co., Ltd.” in the pre-built standard named entity library, then the standard named entity "Alibaba Network Technology” is used
  • the standard named entity vector transformed by "Technology Co., Ltd.” marks the test named entity vector transformed by the test named entity "Alibaba” in the test named entity vector subset.
  • the above-mentioned sampling process can obtain multiple test named entity subsets, and each test named entity subset can train a neural network model to obtain the named entity alignment model, for example:
  • the test named entity set is sampled to obtain 5 test named entity subsets, each test named entity subset is trained with a preset neural network model to obtain a named entity alignment model, and a total of 5 named entity alignment models are obtained.
  • the test named entity subset described in the embodiment of this application has less data, and a too deep neural network will cause the model to be over-fitted and the model effect is poor. Therefore, the neural network model described in the embodiment of this application can be used as a shallow layer. Convolutional neural network is constructed.
  • model training module 102 uses the following means to train the neural network model:
  • C Use a preset activation function to calculate the dimension-up data set to obtain a predicted value, and use the predicted value and the label value contained in the label set as input parameters of the pre-built loss function to calculate the loss value;
  • D Compare the magnitude of the loss value with the preset loss threshold, if the loss value is greater than or equal to the loss threshold, return to A; if the loss value is less than the loss threshold, obtain the named entity alignment model .
  • model training module 102 summarizes all the named entity alignment models to obtain the named entity alignment model set.
  • the data used for training of each model in the named entity alignment model set can be stored in a blockchain.
  • the model alignment module 103 is configured to perform model alignment on the named entity to be aligned according to the named entity alignment model set to obtain an alignment result.
  • the model alignment module 103 uses the pre-built standard naming of the standard named entities to be aligned before performing model alignment on the named entities to be aligned according to the named entity alignment model set.
  • the morphological alignment is performed in the entity library, wherein the standard named entity library is a collection of standard named entities, and the standard named entity is a named entity with an official uniform identification.
  • model alignment module 103 uses the following methods to perform morphological alignment in a pre-built standard named entity library:
  • the embodiment of the present application uses the edit distance method to perform the morphological alignment.
  • model alignment module 103 uses the following methods to perform morphing:
  • the preset edit distance value is 0.
  • the edit distance refers to at least how many times of processing is required to change one character string into another character string.
  • the standard named entity to be aligned is "Alibaba Network Technology Co., Ltd.”
  • the standard named entity library contains “Alibaba Network Technology Co., Ltd.”, then "Alibaba Network Technology Co., Ltd.” needs 0
  • the second processing can be converted to "Alibaba Network Technology Co., Ltd.”, so the edit distance between the two is 0.
  • model alignment module 103 uses the following methods to perform model alignment on the named entities to be aligned:
  • an embedding (word embedding) method is used to convert each character in the standard named entity to be aligned into a character vector of a predetermined dimension.
  • each named entity alignment model in the named entity alignment model set to perform alignment processing on the standard to-be-aligned named entity vector to obtain a predicted alignment entity vector
  • the model alignment module 103 uses the following means to convert each standard named entity in the standard named entity library into a standard named entity vector:
  • model alignment module 103 uses the following means to perform similarity calculation analysis processing:
  • the model alignment module 103 uses cosine similarity to calculate the similarity value.
  • model alignment module 103 uses the following formula to calculate the similarity value:
  • x represents the predicted aligned entity vector
  • y represents the standard named entity vector
  • x i represents the i-th vector value of the predicted aligned entity vector
  • y i represents the i-th vector of the standard named entity vector
  • i is a positive integer
  • n represents the vector dimension of the predicted alignment entity vector and the standard named entity vector.
  • the standard named entity vector corresponding to the maximum similarity value in the standard named entity vector library is selected as a target vector, and the standard named entity corresponding to the target vector in the standard named entity library is selected as the result to be aligned ;
  • the majority voting mechanism is used to screen the set of results to be aligned to obtain the alignment result.
  • the model alignment module 103 uses the following methods to screen the result entities to be aligned in the result set to be aligned:
  • the number is greater than one, summarize the similarity value corresponding to each result to be aligned in the result set to be aligned to obtain the similarity set of the result to be aligned, and select the one corresponding to the largest similarity value in the similarity set of the result to be aligned The result to be aligned is used as the alignment result.
  • FIG. 3 it is a schematic diagram of the structure of an electronic device implementing the named entity alignment method of the present application.
  • the electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a named entity alignment program.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1.
  • the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can be used not only to store application software and various types of data installed in the electronic device 1, such as the code of a named entity alignment program, etc., but also to temporarily store data that has been obtained or will be obtained.
  • the processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc.
  • the processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules (for example, named Entity alignment program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • programs or modules for example, named Entity alignment program, etc.
  • the bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc.
  • PCI peripheral component interconnect standard
  • EISA extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or combinations of certain components, or different component arrangements.
  • the electronic device 1 may also include a power source (such as a battery) for supplying power to various components.
  • the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators.
  • the electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface.
  • the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may also include a user interface.
  • the user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)).
  • the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc.
  • the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
  • the named entity alignment program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can realize:
  • the integrated module/unit of the electronic device 1 can be stored in a computer-readable storage medium. It can be non-volatile or volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
  • the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store a block chain node Use the created data, etc.
  • modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
  • the blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biomedical Technology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to big data technology, and disclosed therein is a named entity alignment method, comprising: performing standardization processing on named entities to be aligned to obtain standard named entities to be aligned (S1) performing sampling processing on the named entity test set to obtain named entity test sub-sets (S2); using each named entity test sub-set to train a pre-set neural network models to obtain a named entity alignment model set (S3); on the basis of the named entity alignment model set, performing model alignment on the named entities to be aligned, to obtain an alignment result (S4). The present invention further relates to blockchain technology. The data used for model training can be stored in a blockchain. Further provided are a named entity alignment apparatus, an electronic device and a computer-readable storage medium. The present method is able to improve the accuracy of alignment of named entities.

Description

命名实体对齐方法、装置、电子设备及可读存储介质Named entity alignment method, device, electronic equipment and readable storage medium
本申请要求于2020年6月19日提交中国专利局、申请号为202010564906.1,发明名称为“命名实体对齐方法、装置、电子设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 19, 2020, the application number is 202010564906.1, and the invention title is "Named Entity Alignment Method, Apparatus, Electronic Equipment, and Readable Storage Medium", and its entire contents Incorporated in this application by reference.
技术领域Technical field
本申请涉及大数据领域,尤其涉及一种命名实体对齐的方法、装置、电子设备及可读存储介质。This application relates to the field of big data, and in particular to a method, device, electronic device, and readable storage medium for aligning named entities.
背景技术Background technique
随着大数据时代的来临,如何高效地获取、处理其中的知识是一个重要的研究议题。自然语言处理领域中的命名实体对齐研究旨在将同一概念的不同表述方式进行统一标准化,能够极大的方便用户对知识的理解及应用。With the advent of the era of big data, how to efficiently acquire and process the knowledge in it is an important research topic. The research on named entity alignment in the field of natural language processing aims to unify and standardize different expressions of the same concept, which can greatly facilitate users' understanding and application of knowledge.
发明人意识到,目前命名实体对齐方法主要有两类,一类是基于不同实体间的形态特征进行对齐,但部分形态特征对齐丧失了语义特征,准确率低;另一类是基于实体进行语义对齐,需要大量的训练数据进行训练,但训练数据不易获取导致该方法准确率也不高。The inventor realizes that there are currently two main types of named entity alignment methods. One is based on the morphological features of different entities, but some morphological feature alignments lose their semantic features and have low accuracy; the other is based on entities for semantics. Alignment requires a lot of training data for training, but the training data is not easy to obtain, which leads to the low accuracy of this method.
发明内容Summary of the invention
本申请提供的一种命名实体对齐方法,包括:A named entity alignment method provided by this application includes:
获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;Acquiring a named entity to be aligned, and standardizing the named entity to be aligned to obtain a standard named entity to be aligned;
获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;Acquire a test named entity set, perform sampling processing on the test named entity set, and obtain a test named entity subset;
利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;Use each test named entity subset to train a preset neural network model to obtain a named entity alignment model set;
根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。Perform model alignment on the named entities to be aligned according to the named entity alignment model set to obtain an alignment result.
本申请还提供一种命名实体对齐装置,所述装置包括:The present application also provides a named entity alignment device, the device includes:
标准化模块,用于获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;The standardization module is used to obtain a named entity to be aligned, and perform standardization processing on the named entity to be aligned to obtain a standard named entity to be aligned;
模型训练模块,用于获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;The model training module is used to obtain a test named entity set, sample the test named entity set to obtain a test named entity subset; use each test named entity subset to train a preset neural network model to obtain a named entity alignment Model collection
模型对齐模块,用于根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。The model alignment module is configured to perform model alignment on the named entity to be aligned according to the named entity alignment model set to obtain an alignment result.
本申请还提供一种电子设备,所述电子设备包括:This application also provides an electronic device, which includes:
存储器,存储至少一个指令;及Memory, storing at least one instruction; and
处理器,执行所述存储器中存储的指令以实现如下步骤:The processor executes the instructions stored in the memory to implement the following steps:
获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;Acquiring a named entity to be aligned, and standardizing the named entity to be aligned to obtain a standard named entity to be aligned;
获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;Acquire a test named entity set, perform sampling processing on the test named entity set, and obtain a test named entity subset;
利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;Use each test named entity subset to train a preset neural network model to obtain a named entity alignment model set;
根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。Perform model alignment on the named entities to be aligned according to the named entity alignment model set to obtain an alignment result.
本申请还提供一种计算机可读存储介质,包括存储数据区和存储程序区,存储数据区存储根据区块链节点的使用所创建的数据,存储程序区存储有计算机程序,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下步骤:This application also provides a computer-readable storage medium, including a storage data area and a storage program area. The storage data area stores data created according to the use of blockchain nodes, and the storage program area stores a computer program, which is readable by the computer. At least one instruction is stored in the storage medium, and the at least one instruction is executed by the processor in the electronic device to implement the following steps:
获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;Acquiring a named entity to be aligned, and standardizing the named entity to be aligned to obtain a standard named entity to be aligned;
获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;Acquire a test named entity set, perform sampling processing on the test named entity set, and obtain a test named entity subset;
利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;Use each test named entity subset to train a preset neural network model to obtain a named entity alignment model set;
根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。Perform model alignment on the named entities to be aligned according to the named entity alignment model set to obtain an alignment result.
附图说明Description of the drawings
图1为本申请一实施例提供的命名实体对齐方法的流程示意图;FIG. 1 is a schematic flowchart of a named entity alignment method provided by an embodiment of this application;
图2为本申请一实施例提供的命名实体对齐装置的模块示意图;2 is a schematic diagram of modules of a named entity alignment device provided by an embodiment of this application;
图3为本申请一实施例提供的实现命名实体对齐方法的电子设备的内部结构示意图;3 is a schematic diagram of the internal structure of an electronic device for implementing a named entity alignment method provided by an embodiment of the application;
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请提供一种命名实体对齐方法。参照图1所示,为本申请一实施例提供的命名实体对齐方法的流程示意图。该方法可以由一个装置执行,该装置可以由软件和/或硬件实现。This application provides a named entity alignment method. Referring to FIG. 1, it is a schematic flowchart of a named entity alignment method provided by an embodiment of this application. The method can be executed by a device, and the device can be implemented by software and/or hardware.
在本实施例中,命名实体对齐方法包括:In this embodiment, the named entity alignment method includes:
S1、获取待对齐命名实体,对所述待对齐命名实体进行标准化处理得到标准待对齐命名实体;S1. Obtain a named entity to be aligned, and perform standardization processing on the named entity to be aligned to obtain a standard named entity to be aligned;
本申请实施例中,所述命名实体为人名、机构名、地名以及其他所有以名称为标识的实体,所述待对齐命名实体为未采用统一标识的命名实体。例如:“阿里集团”和“阿里巴巴”是不同的实体标识名称,其都表示“阿里巴巴网络技术有限技术公司”这个实体,那么“阿里集团”和“阿里巴巴”就是待对齐命名实体。所述待对齐命名实体可以从互联网中获取。In the embodiment of the present application, the named entities are names of persons, organizations, places, and all other entities identified by names, and the named entities to be aligned are named entities that do not use a uniform identification. For example: "Ali Group" and "Alibaba" are different entity identification names, both of which represent the entity "Alibaba Network Technology Co., Ltd.", then "Ali Group" and "Alibaba" are named entities to be aligned. The named entity to be aligned can be obtained from the Internet.
进一步地,本申请实施例中对所述待对齐命名实体进行标准化处理得到所述标准待对齐命名实体。Further, in the embodiment of the present application, standardization processing is performed on the named entity to be aligned to obtain the standard named entity to be aligned.
详细地,所述标准化处理包括:对所述待对齐命名实体进行简繁体统一转化、大小写统一转化、特殊字符删除,得到所述标准待对齐命名实体。其中,所述特殊字符是指所述待对齐命名实体中的无意义符号,如空格、括号等。In detail, the standardization process includes: performing unified conversion between simplified and traditional Chinese, unified case conversion, and deletion of special characters on the named entity to be aligned to obtain the standard named entity to be aligned. Wherein, the special characters refer to meaningless symbols in the named entities to be aligned, such as spaces, brackets, etc.
S2、获取测试命名实体集,对所述测试命名实体集进行抽样处理得到测试命名实体子集;S2. Obtain a test named entity set, and perform sampling processing on the test named entity set to obtain a test named entity subset;
本申请实施例中,所述测试命名实体集为多个命名实体的集合。In the embodiment of the present application, the test named entity set is a set of multiple named entities.
较佳地,本申请实施例中所述测试命名实体集中数据较少不易获取,对所述测试命名实体集进行抽样处理得到所述测试命名实体子集,扩充后续模型训练的数据。Preferably, in the embodiment of the present application, the data in the test named entity set is less and difficult to obtain, and the test named entity set is sampled to obtain the test named entity subset, which expands the data for subsequent model training.
S3、利用每一个所述测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;S3. Use each of the test named entity subsets to train a preset neural network model to obtain a named entity alignment model set;
本申请实施例将所述测试命名实体子集中的每个测试命名实体转化为测试命名实体向量,得到测试命名实体向量子集,将所述测试命名实体向量子集确定为训练集,对所述测试命名实体向量子集进行标记,得到标签集,利用所述训练集及所述标签集对所述神经网络模型进行训练,得到命名实体对齐模型。In this embodiment of the application, each test named entity in the test named entity subset is converted into a test named entity vector to obtain a test named entity vector subset, the test named entity vector subset is determined as a training set, and the test named entity vector subset is determined as a training set. The test named entity vector subset is labeled to obtain a label set, and the neural network model is trained using the training set and the label set to obtain a named entity alignment model.
具体的,本申请实施例中对所述测试命名实体向量子集进行标记,包括:Specifically, marking the test named entity vector subset in the embodiment of the present application includes:
S11、将预构建的标准命名实体库中的标准命名实体转化为标准命名实体向量;S11. Convert the standard named entity in the pre-built standard named entity library into a standard named entity vector;
详细地,所述标准命名实体库为标准命名实体的集合,所述标准命名实体为官方统一标识的命名实体。In detail, the standard named entity library is a collection of standard named entities, and the standard named entities are named entities that are officially uniformly identified.
S12、利用所述标准命名实体向量对所述测试命名实体向量子集中对应的测试命名实体向量进行标记。S12. Use the standard named entity vector to mark the test named entity vector corresponding to the test named entity vector subset.
例如:所述测试命名实体子集中的测试命名实体“阿里巴巴”对应预构建的标准命名实体库中的标准命名实体“阿里巴巴网络技术有限技术公司”,那么利用标准命名实体“阿里巴巴网络技术有限技术公司”转化的标准命名实体向量标记所述测试命名实体向量子集中测试命名实体“阿里巴巴”转化的测试命名实体向量。For example: the test named entity "Alibaba" in the test named entity subset corresponds to the standard named entity "Alibaba Network Technology Co., Ltd." in the pre-built standard named entity library, then the standard named entity "Alibaba Network Technology" is used The standard named entity vector transformed by "Technology Co., Ltd." marks the test named entity vector transformed by the test named entity "Alibaba" in the test named entity vector subset.
详细地,本申请实施例中,上述抽样处理可以得到多个测试命名实体子集,每一个测试命名实体子集都可以训练一个所述神经网络模型得到一个所述命名实体对齐模型,例如:对所述测试命名实体集进行抽样得到5个测试命名实体子集,每一个测试命名实体子集训练预设的神经网络模型得到一个命名实体对齐模型,共得到5个命名实体对齐模型。In detail, in the embodiment of the present application, the above-mentioned sampling process can obtain multiple test named entity subsets, and each test named entity subset can train a neural network model to obtain the named entity alignment model, for example: The test named entity set is sampled to obtain 5 test named entity subsets, each test named entity subset is trained with a preset neural network model to obtain a named entity alignment model, and a total of 5 named entity alignment models are obtained.
较佳地,本申请实施例中所述测试命名实体子集中数据较少,过深的神经网络会导致模型过拟合,模型效果差,因此本申请实施例中所述神经网络模型可用浅层卷积神经网络进行构建。Preferably, the test named entity subset described in the embodiment of this application has less data, and a too deep neural network will cause the model to be over-fitted and the model effect is poor. Therefore, the neural network model described in the embodiment of this application can be used as a shallow layer. Convolutional neural network is constructed.
详细地,利用所述训练集及所述标签集对所述神经网络模型进行训练,包括:In detail, using the training set and the label set to train the neural network model includes:
A:根据预设的卷积池化次数,对所述训练集进行卷积池化操作,得到降维数据集;A: Perform a convolution pooling operation on the training set according to the preset number of convolution pooling to obtain a dimensionality reduction data set;
B:根据预设的反卷积次数,对所述降维数据集进行反卷积操作,得到升维数据集;B: Perform a deconvolution operation on the dimensionality reduction data set according to the preset number of deconvolutions to obtain an increase dimensionality data set;
C:利用预设的激活函数对所述升维数据集进行计算,得到预测值,将所述预测值和所述标签集包含的标签值作为预构建的损失函数的输入参数计算得到损失值;C: Use a preset activation function to calculate the dimension-up data set to obtain a predicted value, and use the predicted value and the label value contained in the label set as the input parameters of the pre-built loss function to calculate the loss value;
D:对比所述损失值与预设的损失阈值的大小,若所述损失值大于或等于所述损失阈值,返回A;若所述损失值小于所述损失阈值,得到所述命名实体对齐模型。D: Compare the magnitude of the loss value with the preset loss threshold, if the loss value is greater than or equal to the loss threshold, return to A; if the loss value is less than the loss threshold, obtain the named entity alignment model .
进一步地,汇总所有的所述命名实体对齐模型,得到所述命名实体对齐模型集合。Further, all the named entity alignment models are summarized to obtain the named entity alignment model set.
本申请的另一个实施例中,所述命名实体对齐模型集合中每个模型训练的数 据可存储于区块链中。In another embodiment of the present application, the training data of each model in the named entity alignment model set can be stored in the blockchain.
S4、根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。S4. Perform model alignment on the named entity to be aligned according to the named entity alignment model set to obtain an alignment result.
本申请实施例中,为了提高对齐的效率,在根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐之前,利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,其中,所述标准命名实体库为标准命名实体的集合,所述标准命名实体为官方统一标识的命名实体。In the embodiment of the present application, in order to improve the efficiency of alignment, before performing model alignment on the named entity to be aligned according to the named entity alignment model set, the standard named entity to be aligned is used to form a pre-built standard named entity library. Alignment, wherein the standard named entity library is a collection of standard named entities, and the standard named entity is a named entity with an official uniform identification.
详细地,所述利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,包括:In detail, the use of the standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library includes:
S21、利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果;S21: Use the standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library, and if the morphological alignment is successful, obtain the alignment result;
S22、若所述形态对齐不成功,根据所述命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐。S22: If the morphological alignment is unsuccessful, perform model alignment on the standard named entity to be aligned according to the named entity alignment model set.
较佳地,本申请实施例利用编辑距离法进行所述形态对齐。Preferably, the embodiment of the present application uses the edit distance method to perform the morphological alignment.
详细地,所述形态对齐包括:In detail, the morphological alignment includes:
S211、计算所述标准待对齐命名实体与所述标准命名实体库中每个标准命名实体的编辑距离;S211: Calculate the edit distance between the standard named entity to be aligned and each standard named entity in the standard named entity library;
S212、当在所述编辑距离中存在目标编辑距离等于预设编辑距离值时,确定对齐成功,选取所述目标编辑距离对应的所述标准命名实体作为所述对齐结果。S212: When there is a target edit distance equal to a preset edit distance value in the edit distance, it is determined that the alignment is successful, and the standard named entity corresponding to the target edit distance is selected as the alignment result.
较佳地,所述预设编辑距离值为0。Preferably, the preset edit distance value is 0.
详细地,编辑距离是指至少需要多少次的处理才能将一个字符串变成另一个字符串。例如:所述标准待对齐命名实体为“阿里巴巴网络技术有限技术公司”,所述标准命名实体库中包含“阿里巴巴网络技术有限技术公司”,那么“阿里巴巴网络技术有限技术公司”需要0次处理就可以转换为“阿里巴巴网络技术有限技术公司”,因此两者的编辑距离为0。In detail, the edit distance refers to at least how many times of processing is required to change one character string into another character string. For example: the standard named entity to be aligned is "Alibaba Network Technology Co., Ltd.", and the standard named entity library contains "Alibaba Network Technology Co., Ltd.", then "Alibaba Network Technology Co., Ltd." needs 0 The second processing can be converted to "Alibaba Network Technology Co., Ltd.", so the edit distance between the two is 0.
进一步地,本申请实施例中,根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,包括:Further, in this embodiment of the present application, performing model alignment on the named entity to be aligned according to the named entity alignment model set includes:
S31、将所述标准待对齐命名实体中每个文字转化为预定维度的字向量,计算所述标准待对齐命名实体中所有文字对应的字向量的平均值,得到标准待对齐命名实体向量;S31. Convert each word in the standard to-be-aligned named entity into a word vector of a predetermined dimension, and calculate the average value of the word vectors corresponding to all the words in the standard to-be-aligned named entity to obtain a standard to-be-aligned named entity vector;
较佳的,本申请实施例中,利用embedding(词嵌入)方法将所述标准待对齐命名实体中每个文字转化为预定维度的字向量。Preferably, in the embodiment of the present application, each word in the standard named entity to be aligned is converted into a word vector of a predetermined dimension by using an embedding (word embedding) method.
S32、利用所述命名实体对齐模型集合中的每个命名实体对齐模型对所述标准待对齐命名实体向量进行对齐处理,得到预测对齐实体向量;S32. Use each named entity alignment model in the named entity alignment model set to perform alignment processing on the standard to-be-aligned named entity vector to obtain a predicted alignment entity vector;
S33、将所述标准命名实体库中的每个标准命名实体转化为标准命名实体向量,汇总所有所述标准命名实体向量,得到标准命名实体向量库;S33. Convert each standard named entity in the standard named entity library into a standard named entity vector, and summarize all the standard named entity vectors to obtain a standard named entity vector library;
详细地,本申请实施例中,将所述标准命名实体库中每个标准命名实体转化为标准命名实体向量,包括:In detail, in the embodiment of the present application, converting each standard named entity in the standard named entity library into a standard named entity vector includes:
S331、将所述标准命名实体中每个文字转化为预定维度的字向量;S331: Convert each word in the standard named entity into a word vector of a predetermined dimension;
S332、计算所述标准命名实体中所有文字对应的字向量的平均值得到标准命名实体向量。S332: Calculate the average value of the word vectors corresponding to all characters in the standard named entity to obtain the standard named entity vector.
S34、对所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量进行相似度计算分析处理,得到所述对齐结果。S34. Perform similarity calculation and analysis processing on the predicted alignment entity vector and each standard named entity vector in the standard named entity vector library to obtain the alignment result.
进一步地,本申请实施例中,所述相似度计算分析处理包括:Further, in the embodiment of the present application, the similarity calculation analysis processing includes:
S41、计算所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量的相似度值;S41. Calculate the similarity value between the predicted aligned entity vector and each of the standard named entity vectors in the standard named entity vector library;
较佳地,本申请实施例利用余弦相似度计算所述相似度值。Preferably, the embodiment of the present application uses cosine similarity to calculate the similarity value.
详细地,所述相似度值可用如下公式进行计算:In detail, the similarity value can be calculated by the following formula:
Figure PCTCN2020119085-appb-000001
Figure PCTCN2020119085-appb-000001
其中,x表示所述预测对齐实体向量,y表示所述标准命名实体向量,x i表示所述预测对齐实体向量的第i个向量值,y i表示所述标准命名实体向量的第i个向量值,i为正整数,n表示所述预测对齐实体向量与所述标准命名实体向量的向量维度。 Where x represents the predicted aligned entity vector, y represents the standard named entity vector, x i represents the i-th vector value of the predicted aligned entity vector, and y i represents the i-th vector of the standard named entity vector The value, i is a positive integer, and n represents the vector dimension of the predicted alignment entity vector and the standard named entity vector.
S42、将所有所述相似度值汇总得到相似度集,确定所述相似度集中的最大的相似度值;S42. Summarize all the similarity values to obtain a similarity set, and determine the largest similarity value in the similarity set;
S43、选取所述标准命名实体向量库中所述最大相似度值对应的所述标准命名实体向量作为目标向量,选取所述标准命名实体库中所述目标向量对应的所述标准命名实体作为待对齐结果;S43. Select the standard named entity vector corresponding to the maximum similarity value in the standard named entity vector library as a target vector, and select the standard named entity corresponding to the target vector in the standard named entity library as a target vector. Alignment result
S44、汇总所有的所述待对齐结果,得到所述待对齐结果集合;S44. Summarize all the results to be aligned to obtain the set of results to be aligned;
S45、利用多数投票机制对所述所述待对齐结果集合进行筛选,得到所述对齐结果。S45. Use a majority voting mechanism to screen the set of results to be aligned to obtain the alignment result.
具体的,本申请实施例中,利用多数投票机制对所述待对齐结果集合中的所述待对齐结果实体进行筛选,包括:Specifically, in this embodiment of the present application, using a majority voting mechanism to screen the entities to be aligned in the result set to be aligned includes:
S51、记录所述待对齐结果集合中的每个所述待对齐结果的出现次数;选取出现次数最多的待对齐结果作为备选对齐结果,确定所述备选对齐结果的数量;若所述数量为一,将所述备选对齐结果确定为所述对齐结果。S51. Record the number of occurrences of each result to be aligned in the set of results to be aligned; select the result to be aligned with the most occurrences as the candidate alignment result, and determine the number of the candidate alignment results; if the number is If it is one, the candidate alignment result is determined as the alignment result.
本申请实施例中,例如:所述待对齐结果集合中共有五个所述待对齐结果,其中3个“阿里巴巴”,2个“阿里公司”,那么“阿里巴巴”的次数最多,因此只有一个备选对齐结果“阿里巴巴”,所以所述备选对齐结果的数量为一,所述备选对齐结果“阿里巴巴”为所述对齐结果。In the embodiment of this application, for example, there are five results to be aligned in the set of results to be aligned, of which 3 are "Alibaba" and 2 are "Ali Company", so "Alibaba" has the most number of times, so only There is one candidate alignment result "Alibaba", so the number of the candidate alignment results is one, and the candidate alignment result "Alibaba" is the alignment result.
S52、若所述数量大于一,汇总所述待对齐结果集合中每个待对齐结果对应的相似度值,得到待对齐结果相似度集,选取所述待对齐结果相似度集中最大的相似度值对应的待对齐结果作为对齐结果。S52. If the number is greater than one, summarize the similarity values corresponding to each result to be aligned in the result set to be aligned to obtain a similarity set of results to be aligned, and select the largest similarity value in the similarity set of results to be aligned The corresponding result to be aligned is used as the alignment result.
本申请实施例中,例如:所述待对齐结果集合中共有五个所述待对齐结果,其中2个“阿里巴巴”,2个“阿里公司”,1个“阿里集团”,那么“阿里巴巴”与“阿里公司”的次数最多,因此只有两个备选对齐结果“阿里巴巴”及“阿里公司”,所以所述备选对齐结果的数量为二大于一,选取这五个待对齐结果中对应相似度的对齐结果作为对齐结果。In the embodiment of this application, for example, there are five results to be aligned in the set of results to be aligned, including 2 "Alibaba", 2 "Ali Company", 1 "Ali Group", then "Alibaba" "" and "Ali Company" have the largest number of times, so there are only two candidate alignment results "Alibaba" and "Ali Company", so the number of candidate alignment results is two greater than one, select these five results to be aligned The alignment result corresponding to the similarity is used as the alignment result.
本申请实施例中,对所述待对齐命名实体进行标准化处理得到标准待对齐命名实体,剔除对齐命名实体格式及无关字符的影响;对所述测试命名实体集进行抽样处理得到测试命名实体子集,利用每一个所述测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合,利用抽样得到的的多个测试命名实体子集训练得到命名实体对齐模型集合,根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,利用多个模型分别进行模型对齐,提高了命名实体对齐的准确率。In the embodiment of the application, the standardized processing of the named entities to be aligned is performed to obtain the standardized named entities to be aligned, and the influence of the aligned named entity format and irrelevant characters is eliminated; the test named entity set is sampled and processed to obtain the test named entity subset , Use each of the test named entity subsets to train a preset neural network model to obtain a named entity alignment model set, use the multiple test named entity subsets obtained by sampling to train to obtain a named entity alignment model set, and align according to the named entity The model set performs model alignment on the named entities to be aligned, and uses multiple models to perform model alignment respectively, which improves the accuracy of named entity alignment.
如图2所示,是本申请命名实体对齐装置的功能模块图。As shown in Fig. 2, it is a functional block diagram of the named entity alignment device of the present application.
本申请所述命名实体对齐装置100可以安装于电子设备中。根据实现的功能, 所述命名实体对齐装置可以包括标准化模块101、模型训练模块102、模型对齐模块103。本发所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The named entity alignment apparatus 100 described in this application can be installed in an electronic device. According to the implemented functions, the named entity alignment device may include a standardization module 101, a model training module 102, and a model alignment module 103. The module described in the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述标准化模块101用于获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体。The standardization module 101 is configured to obtain a named entity to be aligned, and perform standardization processing on the named entity to be aligned to obtain a standard named entity to be aligned.
本申请实施例中,所述命名实体为人名、机构名、地名以及其他所有以名称为标识的实体,所述待对齐命名实体为未采用统一标识的命名实体。例如:“阿里集团”和“阿里巴巴”是不同的实体标识名称,其都表示“阿里巴巴网络技术有限技术公司”这个实体,那么“阿里集团”和“阿里巴巴”就是待对齐命名实体。所述待对齐命名实体可以从互联网中获取。In the embodiment of the present application, the named entity is a person's name, an organization name, a place name, and all other entities identified by a name, and the named entity to be aligned is a named entity that does not use a uniform identification. For example: "Ali Group" and "Alibaba" are different entity identification names, both of which refer to the entity "Alibaba Network Technology Co., Ltd.", then "Ali Group" and "Alibaba" are named entities to be aligned. The named entity to be aligned can be obtained from the Internet.
进一步地,本申请实施例中对所述待对齐命名实体进行标准化处理得到所述标准待对齐命名实体。Further, in the embodiment of the present application, standardization processing is performed on the named entity to be aligned to obtain the standard named entity to be aligned.
详细地,所述标准化模块101进行标准化处理包括:对所述待对齐命名实体进行简繁体统一转化、大小写统一转化、特殊字符删除得到所述标准待对齐命名实体。其中,所述特殊字符是指所述待对齐命名实体中的无意义符号,如空格、括号等。In detail, the standardization process performed by the standardization module 101 includes: performing unified conversion between simplified and traditional characters, unified case conversion, and deletion of special characters on the named entity to be aligned to obtain the standard named entity to be aligned. Wherein, the special characters refer to meaningless symbols in the named entities to be aligned, such as spaces, brackets, etc.
所述模型训练模块102用于获取测试命名实体集,对所述测试命名实体集进行抽样处理得到测试命名实体子集;利用每一个所述测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合。The model training module 102 is used to obtain a test named entity set, perform sampling processing on the test named entity set to obtain a test named entity subset; use each of the test named entity subsets to train a preset neural network model to obtain Named entity alignment model collection.
本申请实施例中,所述测试命名实体集为多个命名实体的集合。In the embodiment of the present application, the test named entity set is a set of multiple named entities.
较佳地,本申请实施例中所述测试命名实体集中数据较少不易获取,所述模型训练模块102对所述测试命名实体集进行抽样处理,得到所述测试命名实体子集,扩充后续模型训练的数据。Preferably, the test named entity set in the embodiment of the present application has less data in the test named entity set and is difficult to obtain. The model training module 102 performs sampling processing on the test named entity set to obtain the test named entity subset and expand subsequent models. Training data.
本申请实施例所述模型训练模块102将所述测试命名实体子集中的每个测试命名实体转化为测试命名实体向量,得到测试命名实体向量子集;所述模型训练模块102将所述测试命名实体向量子集确定为训练集;所述模型训练模块102对所述测试命名实体向量子集进行标记,得到标签集;所述模型训练模块102利用所述训练集及所述标签集对所述神经网络模型进行训练,得到命名实体对齐模型。The model training module 102 described in this embodiment of the application converts each test named entity in the test named entity subset into a test named entity vector to obtain a test named entity vector subset; the model training module 102 names the test The entity vector subset is determined as the training set; the model training module 102 marks the test named entity vector subset to obtain a label set; the model training module 102 uses the training set and the label set to The neural network model is trained to obtain a named entity alignment model.
具体的,本申请实施例中所述模型训练模块102利用如下手段对所述测试命名实体向量子集进行标记:Specifically, the model training module 102 in the embodiment of the present application uses the following means to mark the subset of test named entity vectors:
将预构建的标准命名实体库中的标准命名实体转化为标准命名实体向量;Convert the standard named entity in the pre-built standard named entity library into a standard named entity vector;
详细地,所述标准命名实体库为标准命名实体的集合,所述标准命名实体为官方统一标识的命名实体。In detail, the standard named entity library is a collection of standard named entities, and the standard named entities are named entities that are officially uniformly identified.
利用所述标准命名实体向量对所述测试命名实体向量子集中对应的测试命名实体向量进行标记。The standard named entity vector is used to mark the corresponding test named entity vector in the test named entity vector subset.
例如:所述测试命名实体子集中的测试命名实体“阿里巴巴”对应预构建的标准命名实体库中的标准命名实体“阿里巴巴网络技术有限技术公司”,那么利用标准命名实体“阿里巴巴网络技术有限技术公司”转化的标准命名实体向量标记所述测试命名实体向量子集中测试命名实体“阿里巴巴”转化的测试命名实体向量。For example: the test named entity "Alibaba" in the test named entity subset corresponds to the standard named entity "Alibaba Network Technology Co., Ltd." in the pre-built standard named entity library, then the standard named entity "Alibaba Network Technology" is used The standard named entity vector transformed by "Technology Co., Ltd." marks the test named entity vector transformed by the test named entity "Alibaba" in the test named entity vector subset.
详细地,本申请实施例中,上述抽样处理可以得到多个测试命名实体子集,每一个测试命名实体子集都可以训练一个所述神经网络模型得到一个所述命名 实体对齐模型,例如:对所述测试命名实体集进行抽样得到5个测试命名实体子集,每一个测试命名实体子集训练预设的神经网络模型得到一个命名实体对齐模型,共得到5个命名实体对齐模型。In detail, in the embodiment of the present application, the above-mentioned sampling process can obtain multiple test named entity subsets, and each test named entity subset can train a neural network model to obtain the named entity alignment model, for example: The test named entity set is sampled to obtain 5 test named entity subsets, each test named entity subset is trained with a preset neural network model to obtain a named entity alignment model, and a total of 5 named entity alignment models are obtained.
较佳地,本申请实施例中所述测试命名实体子集中数据较少,过深的神经网络会导致模型过拟合,模型效果差,因此本申请实施例中所述神经网络模型可用浅层卷积神经网络进行构建。Preferably, the test named entity subset described in the embodiment of this application has less data, and a too deep neural network will cause the model to be over-fitted and the model effect is poor. Therefore, the neural network model described in the embodiment of this application can be used as a shallow layer. Convolutional neural network is constructed.
详细地,所述模型训练模块102利用如下手段对所述神经网络模型进行训练:In detail, the model training module 102 uses the following means to train the neural network model:
A:根据预设的卷积池化次数,对所述训练集进行卷积池化操作,得到降维数据集;A: Perform a convolution pooling operation on the training set according to the preset number of convolution pooling to obtain a dimensionality reduction data set;
B:根据预设的反卷积次数,对所述降维数据集进行反卷积操作,得到升维数据集;B: Perform a deconvolution operation on the dimensionality reduction data set according to the preset number of deconvolutions to obtain an increase dimensionality data set;
C:利用预设的激活函数对所述升维数据集进行计算,得到预测值,将所述预测值和所述标签集包含的标签值作为预构建的损失函数的输入参数计算得到损失值;C: Use a preset activation function to calculate the dimension-up data set to obtain a predicted value, and use the predicted value and the label value contained in the label set as input parameters of the pre-built loss function to calculate the loss value;
D:对比所述损失值与预设的损失阈值的大小,若所述损失值大于或等于所述损失阈值,返回A;若所述损失值小于所述损失阈值,得到所述命名实体对齐模型。D: Compare the magnitude of the loss value with the preset loss threshold, if the loss value is greater than or equal to the loss threshold, return to A; if the loss value is less than the loss threshold, obtain the named entity alignment model .
进一步地,所述模型训练模块102汇总所有的所述命名实体对齐模型,得到所述命名实体对齐模型集合。Further, the model training module 102 summarizes all the named entity alignment models to obtain the named entity alignment model set.
本申请的另一个实施例中,用于所述命名实体对齐模型集合中每个模型训练的数据可存储于区块链中。In another embodiment of the present application, the data used for training of each model in the named entity alignment model set can be stored in a blockchain.
所述模型对齐模块103用于根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。The model alignment module 103 is configured to perform model alignment on the named entity to be aligned according to the named entity alignment model set to obtain an alignment result.
本申请实施例中,为了提高对齐的效率,在根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐之前所述模型对齐模块103利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,其中,所述标准命名实体库为标准命名实体的集合,所述标准命名实体为官方统一标识的命名实体。In the embodiment of the present application, in order to improve the efficiency of alignment, the model alignment module 103 uses the pre-built standard naming of the standard named entities to be aligned before performing model alignment on the named entities to be aligned according to the named entity alignment model set. The morphological alignment is performed in the entity library, wherein the standard named entity library is a collection of standard named entities, and the standard named entity is a named entity with an official uniform identification.
详细地,所述模型对齐模块103在预构建的标准命名实体库中利用如下手段进行形态对齐:In detail, the model alignment module 103 uses the following methods to perform morphological alignment in a pre-built standard named entity library:
利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果;Use the standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library, and if the morphological alignment is successful, obtain the alignment result;
若所述形态对齐不成功,根据所述命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐。If the morphological alignment is unsuccessful, perform model alignment on the standard named entity to be aligned according to the named entity alignment model set.
较佳地,本申请实施例利用编辑距离法进行所述形态对齐。Preferably, the embodiment of the present application uses the edit distance method to perform the morphological alignment.
详细地,所述模型对齐模块103利用如下手段进行形态:In detail, the model alignment module 103 uses the following methods to perform morphing:
计算所述标准待对齐命名实体与所述标准命名实体库中每个标准命名实体的编辑距离;Calculating the edit distance between the standard named entity to be aligned and each standard named entity in the standard named entity library;
当在所述编辑距离中存在目标编辑距离等于预设编辑距离值时,确定对齐成功,选取所述目标编辑距离对应的所述标准命名实体作为所述对齐结果。When there is a target edit distance equal to a preset edit distance value in the edit distance, it is determined that the alignment is successful, and the standard named entity corresponding to the target edit distance is selected as the alignment result.
较佳地,所述预设编辑距离值为0。Preferably, the preset edit distance value is 0.
详细地,编辑距离是指至少需要多少次的处理才能将一个字符串变成另一个字符串。例如:所述标准待对齐命名实体为“阿里巴巴网络技术有限技术公司”,所述标准命名实体库中包含“阿里巴巴网络技术有限技术公司”,那么“阿里巴巴网络技术有限技术公司”需要0次处理就可以转换为“阿里巴巴网络技术有限 技术公司”,因此两者的编辑距离为0。In detail, the edit distance refers to at least how many times of processing is required to change one character string into another character string. For example: the standard named entity to be aligned is "Alibaba Network Technology Co., Ltd.", and the standard named entity library contains "Alibaba Network Technology Co., Ltd.", then "Alibaba Network Technology Co., Ltd." needs 0 The second processing can be converted to "Alibaba Network Technology Co., Ltd.", so the edit distance between the two is 0.
进一步地,本申请实施例中,所述模型对齐模块103利用如下手段对所述待对齐命名实体进行模型对齐:Further, in the embodiment of the present application, the model alignment module 103 uses the following methods to perform model alignment on the named entities to be aligned:
将所述标准待对齐命名实体中每个文字转化为预定维度的字向量,计算所述标准待对齐命名实体中所有文字对应的字向量的平均值,得到标准待对齐命名实体向量;Convert each word in the standard named entity to be aligned into a word vector of a predetermined dimension, and calculate an average value of the word vectors corresponding to all words in the standard named entity to be aligned to obtain a standard named entity vector to be aligned;
较佳的,本申请实施例中,利用embedding(词嵌入)方法将所述所述标准待对齐命名实体中每个文字转化为预定维度的字向量。Preferably, in the embodiment of the present application, an embedding (word embedding) method is used to convert each character in the standard named entity to be aligned into a character vector of a predetermined dimension.
利用所述命名实体对齐模型集合中的每个命名实体对齐模型对所述标准待对齐命名实体向量进行对齐处理,得到预测对齐实体向量;Using each named entity alignment model in the named entity alignment model set to perform alignment processing on the standard to-be-aligned named entity vector to obtain a predicted alignment entity vector;
将所述标准命名实体库中的每个标准命名实体转化为标准命名实体向量,汇总所有所述标准命名实体向量,得到标准命名实体向量库;Converting each standard named entity in the standard named entity library into a standard named entity vector, and summarizing all the standard named entity vectors to obtain a standard named entity vector library;
详细地,本申请实施例中,所述模型对齐模块103利用如下手段将所述标准命名实体库中每个标准命名实体转化为标准命名实体向量:In detail, in the embodiment of the present application, the model alignment module 103 uses the following means to convert each standard named entity in the standard named entity library into a standard named entity vector:
将所述标准命名实体中每个文字转化为预定维度的字向量;Converting each word in the standard named entity into a word vector of a predetermined dimension;
计算所述标准命名实体中所有文字对应的字向量的平均值得到标准命名实体向量。Calculating the average value of the word vectors corresponding to all characters in the standard named entity to obtain the standard named entity vector.
对所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量进行相似度计算分析处理,得到所述对齐结果。Perform similarity calculation and analysis processing on the predicted aligned entity vector and each standard named entity vector in the standard named entity vector library to obtain the alignment result.
进一步地,本申请实施例中,所述模型对齐模块103利用如下手段进行相似度计算分析处理:Further, in the embodiment of the present application, the model alignment module 103 uses the following means to perform similarity calculation analysis processing:
计算所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量的相似度值;Calculating a similarity value between the predicted aligned entity vector and each of the standard named entity vectors in the standard named entity vector library;
较佳地,本申请实施例所述模型对齐模块103利用余弦相似度计算所述相似度值。Preferably, the model alignment module 103 according to the embodiment of the present application uses cosine similarity to calculate the similarity value.
详细地,所述模型对齐模块103利用如下公式计算相似度值:In detail, the model alignment module 103 uses the following formula to calculate the similarity value:
Figure PCTCN2020119085-appb-000002
Figure PCTCN2020119085-appb-000002
其中,x表示所述预测对齐实体向量,y表示所述标准命名实体向量,x i表示所述预测对齐实体向量的第i个向量值,y i表示所述标准命名实体向量的第i个向量值,i为正整数,n表示所述预测对齐实体向量与所述标准命名实体向量的向量维度。 Where x represents the predicted aligned entity vector, y represents the standard named entity vector, x i represents the i-th vector value of the predicted aligned entity vector, and y i represents the i-th vector of the standard named entity vector The value, i is a positive integer, and n represents the vector dimension of the predicted alignment entity vector and the standard named entity vector.
将所有所述相似度值汇总得到相似度集,确定所述相似度集中的最大的相似度值;Summarize all the similarity values to obtain a similarity set, and determine the largest similarity value in the similarity set;
选取所述标准命名实体向量库中所述最大相似度值对应的所述标准命名实体向量作为目标向量,选取所述标准命名实体库中所述目标向量对应的所述标准命名实体作为待对齐结果;The standard named entity vector corresponding to the maximum similarity value in the standard named entity vector library is selected as a target vector, and the standard named entity corresponding to the target vector in the standard named entity library is selected as the result to be aligned ;
汇总所有的所述待对齐结果,得到所述待对齐结果集合;Summarize all the results to be aligned to obtain the set of results to be aligned;
利用多数投票机制对所述所述待对齐结果集合进行筛选,得到所述对齐结果。The majority voting mechanism is used to screen the set of results to be aligned to obtain the alignment result.
具体的,本申请实施例中,所述模型对齐模块103利用如下手段对所述待对齐结果集合中的所述待对齐结果实体进行筛选:Specifically, in the embodiment of the present application, the model alignment module 103 uses the following methods to screen the result entities to be aligned in the result set to be aligned:
记录所述待对齐结果集合中的每个所述待对齐结果的出现次数;选取出现次数最多的待对齐结果作为备选对齐结果,确定所述备选对齐结果的数量;若所述数量为一,将所述备选对齐结果确定为所述对齐结果。Record the number of occurrences of each result to be aligned in the set of results to be aligned; select the result to be aligned with the most occurrences as the candidate alignment result, and determine the number of the candidate alignment results; if the number is one , Determining the candidate alignment result as the alignment result.
本申请实施例中,例如:所述待对齐结果集合中共有五个所述待对齐结果,其中3个“阿里巴巴”,2个“阿里公司”,那么“阿里巴巴”的次数最多,因此只有一个备选对齐结果“阿里巴巴”,所以所述备选对齐结果的数量为一,所述备选对齐结果“阿里巴巴”为所述对齐结果。In the embodiment of this application, for example, there are five results to be aligned in the set of results to be aligned, of which 3 are "Alibaba" and 2 are "Ali Company", so "Alibaba" has the most number of times, so only There is one candidate alignment result "Alibaba", so the number of the candidate alignment results is one, and the candidate alignment result "Alibaba" is the alignment result.
若所述数量大于一,汇总所述待对齐结果集合中每个待对齐结果对应的相似度值,得到待对齐结果相似度集,选取所述待对齐结果相似度集中最大的相似度值对应的待对齐结果作为对齐结果。If the number is greater than one, summarize the similarity value corresponding to each result to be aligned in the result set to be aligned to obtain the similarity set of the result to be aligned, and select the one corresponding to the largest similarity value in the similarity set of the result to be aligned The result to be aligned is used as the alignment result.
本申请实施例中,例如:所述待对齐结果集合中共有五个所述待对齐结果,其中2个“阿里巴巴”,2个“阿里公司”,1个“阿里集团”,那么“阿里巴巴”与“阿里公司”的次数最多,因此只有两个备选对齐结果“阿里巴巴”及“阿里公司”,所以所述备选对齐结果的数量为二大于一,所述选取这五个所述待对齐结果中对应相似度的对齐结果作为对齐结果。In the embodiment of this application, for example, there are five results to be aligned in the set of results to be aligned, including 2 "Alibaba", 2 "Ali Company", 1 "Ali Group", then "Alibaba" "" and "Ali Company" have the largest number of times, so there are only two candidate alignment results "Alibaba" and "Ali Company", so the number of candidate alignment results is two greater than one, and the five selected The alignment result corresponding to the similarity among the results to be aligned is used as the alignment result.
如图3所示,是本申请实现命名实体对齐方法的电子设备的结构示意图。As shown in FIG. 3, it is a schematic diagram of the structure of an electronic device implementing the named entity alignment method of the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如命名实体对齐程序。The electronic device 1 may include a processor 10, a memory 11, and a bus, and may also include a computer program stored in the memory 11 and running on the processor 10, such as a named entity alignment program.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如命名实体对齐程序的代码等,还可以用于暂时地存储已经得到或者将要得到的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, CD etc. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, for example, a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart media card (SMC), and a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can be used not only to store application software and various types of data installed in the electronic device 1, such as the code of a named entity alignment program, etc., but also to temporarily store data that has been obtained or will be obtained.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如命名实体对齐程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。The processor 10 may be composed of integrated circuits in some embodiments, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits with the same function or different functions, including one or more Combinations of central processing unit (CPU), microprocessor, digital processing chip, graphics processor, and various control chips, etc. The processor 10 is the control unit of the electronic device, which uses various interfaces and lines to connect the various components of the entire electronic device, and runs or executes programs or modules (for example, named Entity alignment program, etc.), and call the data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect standard (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection and communication between the memory 11 and at least one processor 10 and the like.
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure. Components, or combinations of certain components, or different component arrangements.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电 路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, thereby controlling power The device implements functions such as charge management, discharge management, and power consumption management. The power supply may also include any components such as one or more DC or AC power supplies, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The electronic device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may also include a user interface. The user interface may be a display (Display) and an input unit (such as a keyboard (Keyboard)). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, 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, organic light-emitting diode) touch device, etc. Among them, the display can also be appropriately called a display screen or a display unit, which is used to display the information processed in the electronic device 1 and to display a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only for illustrative purposes, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的命名实体对齐程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The named entity alignment program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can realize:
获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;Acquiring a named entity to be aligned, and standardizing the named entity to be aligned to obtain a standard named entity to be aligned;
获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;Acquire a test named entity set, perform sampling processing on the test named entity set, and obtain a test named entity subset;
利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;Use each test named entity subset to train a preset neural network model to obtain a named entity alignment model set;
根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。Perform model alignment on the named entities to be aligned according to the named entity alignment model set to obtain an alignment result.
具体地,所述处理器10对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instructions by the processor 10, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 1, which will not be repeated here.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中,所述计算机可读存储介质可以是非易失性,也可以是易失性。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the integrated module/unit of the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. It can be non-volatile or volatile. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory) .
进一步地,所述计算机可用存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。Further, the computer usable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function, etc.; the storage data area may store a block chain node Use the created data, etc.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed equipment, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能模块的 形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware, or in the form of hardware plus software functional modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。For those skilled in the art, it is obvious that the present application is not limited to the details of the foregoing exemplary embodiments, and the present application can be implemented in other specific forms without departing from the spirit or basic characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of this application is defined by the appended claims rather than the above description, and therefore it is intended to fall into the claims. All changes in the meaning and scope of the equivalent elements of are included in this application. Any reference signs in the claims should not be regarded as limiting the claims involved.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。In addition, it is obvious that the word "including" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claims can also be implemented by one unit or device through software or hardware. The second class words are used to indicate names, and do not indicate any specific order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application and not to limit them. Although the application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the application can be Make modifications or equivalent replacements without departing from the spirit and scope of the technical solution of the present application.

Claims (20)

  1. 一种命名实体对齐方法,其中,所述方法包括:A named entity alignment method, wherein the method includes:
    获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;Acquiring a named entity to be aligned, and standardizing the named entity to be aligned to obtain a standard named entity to be aligned;
    获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;Acquire a test named entity set, perform sampling processing on the test named entity set, and obtain a test named entity subset;
    利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;Use each test named entity subset to train a preset neural network model to obtain a named entity alignment model set;
    根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。Perform model alignment on the named entities to be aligned according to the named entity alignment model set to obtain an alignment result.
  2. 如权利要求1所述的命名实体对齐方法,其中,所述利用每一个所述测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合,包括:The named entity alignment method according to claim 1, wherein said training a preset neural network model using each of said test named entity subsets to obtain a named entity alignment model set comprises:
    将所述测试命名实体子集中的每个测试命名实体转化为测试命名实体向量,得到测试命名实体向量子集;Converting each test named entity in the test named entity subset into a test named entity vector to obtain a test named entity vector subset;
    将所述测试命名实体向量子集确定为训练集;Determining the subset of test named entity vectors as a training set;
    对所述测试命名实体向量子集进行标记,得到标签集;Marking the subset of test named entity vectors to obtain a label set;
    利用所述训练集及所述标签集对所述神经网络模型进行训练,得到命名实体对齐模型;Training the neural network model by using the training set and the label set to obtain a named entity alignment model;
    汇总所有的所述命名实体对齐模型,得到所述命名实体对齐模型集合。Summarize all the named entity alignment models to obtain the named entity alignment model set.
  3. 如权利要求1所述的命名实体对齐方法,其中,所述根据命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐之前,还包括:5. The named entity alignment method according to claim 1, wherein before said performing model alignment on said standard named entity to be aligned according to the named entity alignment model set, the method further comprises:
    利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果;Use the standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library, and if the morphological alignment is successful, obtain the alignment result;
    若所述形态对齐不成功,根据所述命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐。If the morphological alignment is unsuccessful, perform model alignment on the standard named entity to be aligned according to the named entity alignment model set.
  4. 如权利要求3所述的命名实体对齐方法,其中,所述利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果,包括:3. The named entity alignment method according to claim 3, wherein the standard named entity to be aligned is used to perform morphological alignment in a pre-built standard named entity library, and if the morphological alignment is successful, the alignment result is obtained, include:
    计算所述标准待对齐命名实体与所述标准命名实体库中每个标准命名实体的编辑距离;Calculating the edit distance between the standard named entity to be aligned and each standard named entity in the standard named entity library;
    当在所述编辑距离中存在目标编辑距离等于预设编辑距离值时,确定对齐成功,选取所述目标编辑距离对应的标准命名实体作为所述对齐结果。When there is a target edit distance equal to the preset edit distance value in the edit distance, it is determined that the alignment is successful, and a standard named entity corresponding to the target edit distance is selected as the alignment result.
  5. 如权利要求3所述的命名实体对齐方法,其中,所述根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果,包括:5. The named entity alignment method according to claim 3, wherein said performing model alignment on said named entity to be aligned according to a named entity alignment model set to obtain an alignment result comprises:
    将所述标准待对齐命名实体中每个文字转化为预定维度的字向量,计算所述标准待对齐命名实体中所有文字对应的字向量的平均值,得到标准待对齐命名实体向量;Convert each word in the standard named entity to be aligned into a word vector of a predetermined dimension, and calculate an average value of the word vectors corresponding to all words in the standard named entity to be aligned to obtain a standard named entity vector to be aligned;
    利用所述命名实体对齐模型集合中的每个命名实体对齐模型对所述标准待对齐命名实体向量进行对齐处理,得到预测对齐实体向量;Using each named entity alignment model in the named entity alignment model set to perform alignment processing on the standard to-be-aligned named entity vector to obtain a predicted alignment entity vector;
    将所述标准命名实体库中的每个标准命名实体转化为标准命名实体向量,汇总所有所述标准命名实体向量,得到标准命名实体向量库;Converting each standard named entity in the standard named entity library into a standard named entity vector, and summarizing all the standard named entity vectors to obtain a standard named entity vector library;
    对所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量进行相似度计算分析处理,得到所述对齐结果。Perform similarity calculation and analysis processing on the predicted aligned entity vector and each standard named entity vector in the standard named entity vector library to obtain the alignment result.
  6. 如权利要求5所述的命名实体对齐方法,其中,所述对所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量进行相似度计算分析处理,得到对齐结果,包括:The named entity alignment method according to claim 5, wherein the said predicted aligned entity vector and each of the standard named entity vectors in the standard named entity vector library are similarly calculated and analyzed to obtain an alignment result ,include:
    计算所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量的相似度值;Calculating a similarity value between the predicted aligned entity vector and each of the standard named entity vectors in the standard named entity vector library;
    将所有所述相似度值汇总得到相似度集;Summarize all the similarity values to obtain a similarity set;
    确定所述相似度集中的最大相似度值;Determine the maximum similarity value in the similarity set;
    选取所述标准命名实体向量库中所述最大相似度值对应的标准命名实体向量作为目标向量;Selecting the standard named entity vector corresponding to the maximum similarity value in the standard named entity vector library as the target vector;
    选取所述标准命名实体库中所述目标向量对应的标准命名实体作为待对齐结果;Selecting the standard named entity corresponding to the target vector in the standard named entity library as the result to be aligned;
    汇总所有的所述待对齐结果,得到待对齐结果集合;Summarize all the results to be aligned to obtain a set of results to be aligned;
    利用多数投票机制对所述待对齐结果集合进行筛选,得到所述对齐结果。The majority voting mechanism is used to screen the set of results to be aligned to obtain the alignment result.
  7. 如权利要求6所述的命名实体对齐方法,其中,所述利用多数投票机制对所述所述待对齐结果集合进行筛选,得到对齐结果,包括:7. The named entity alignment method according to claim 6, wherein said using a majority voting mechanism to filter said set of results to be aligned to obtain an alignment result comprises:
    记录所述待对齐结果集合中每个待对齐结果的出现次数;Record the number of occurrences of each result to be aligned in the result set to be aligned;
    选取出现次数最多的待对齐结果作为备选对齐结果;Select the result to be aligned with the most occurrences as the candidate alignment result;
    确定所述备选对齐结果的数量;Determining the number of candidate alignment results;
    若所述数量为一,将所述备选对齐结果确定为所述对齐结果;If the number is one, determine the candidate alignment result as the alignment result;
    若所述数量大于一,汇总所述待对齐结果集合中每个待对齐结果对应的相似度值,得到待对齐结果相似度集,选取所述待对齐结果相似度集中最大的相似度值对应的待对齐结果作为对齐结果。If the number is greater than one, summarize the similarity value corresponding to each result to be aligned in the result set to be aligned to obtain the similarity set of the result to be aligned, and select the one corresponding to the largest similarity value in the similarity set of the result to be aligned The result to be aligned is used as the alignment result.
  8. 一种命名实体对齐装置,其中,所述装置包括:A named entity alignment device, wherein the device includes:
    标准化模块,用于获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;The standardization module is used to obtain a named entity to be aligned, and perform standardization processing on the named entity to be aligned to obtain a standard named entity to be aligned;
    模型训练模块,用于获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;The model training module is used to obtain a test named entity set, sample the test named entity set to obtain a test named entity subset; use each test named entity subset to train a preset neural network model to obtain a named entity alignment Model collection
    模型对齐模块,用于根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。The model alignment module is configured to perform model alignment on the named entity to be aligned according to the named entity alignment model set to obtain an alignment result.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device includes:
    至少一个处理器;以及,At least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下步骤:The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the following steps:
    获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;Acquiring a named entity to be aligned, and standardizing the named entity to be aligned to obtain a standard named entity to be aligned;
    获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;Acquire a test named entity set, perform sampling processing on the test named entity set, and obtain a test named entity subset;
    利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;Use each test named entity subset to train a preset neural network model to obtain a named entity alignment model set;
    根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。Perform model alignment on the named entities to be aligned according to the named entity alignment model set to obtain an alignment result.
  10. 如权利要求9所述的电子设备,其中,所述利用每一个所述测试命名实 体子集训练预设的神经网络模型,得到命名实体对齐模型集合,包括:The electronic device according to claim 9, wherein said training a preset neural network model using each subset of said test named entities to obtain a named entity alignment model set comprises:
    将所述测试命名实体子集中的每个测试命名实体转化为测试命名实体向量,得到测试命名实体向量子集;Converting each test named entity in the test named entity subset into a test named entity vector to obtain a test named entity vector subset;
    将所述测试命名实体向量子集确定为训练集;Determining the subset of test named entity vectors as a training set;
    对所述测试命名实体向量子集进行标记,得到标签集;Marking the subset of test named entity vectors to obtain a label set;
    利用所述训练集及所述标签集对所述神经网络模型进行训练,得到命名实体对齐模型;Training the neural network model by using the training set and the label set to obtain a named entity alignment model;
    汇总所有的所述命名实体对齐模型,得到所述命名实体对齐模型集合。Summarize all the named entity alignment models to obtain the named entity alignment model set.
  11. 如权利要求9所述的电子设备,其中,所述根据命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐之前,还包括:9. The electronic device according to claim 9, wherein before the model alignment of the standard named entities to be aligned according to the named entity alignment model set, the method further comprises:
    利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果;Use the standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library, and if the morphological alignment is successful, obtain the alignment result;
    若所述形态对齐不成功,根据所述命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐。If the morphological alignment is unsuccessful, perform model alignment on the standard named entity to be aligned according to the named entity alignment model set.
  12. 如权利要求11所述的电子设备,其中,所述利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果,包括:11. The electronic device according to claim 11, wherein said using said standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library, and if said morphological alignment is successful, obtaining said alignment result comprises:
    计算所述标准待对齐命名实体与所述标准命名实体库中每个标准命名实体的编辑距离;Calculating the edit distance between the standard named entity to be aligned and each standard named entity in the standard named entity library;
    当在所述编辑距离中存在目标编辑距离等于预设编辑距离值时,确定对齐成功,选取所述目标编辑距离对应的标准命名实体作为所述对齐结果。When there is a target edit distance equal to the preset edit distance value in the edit distance, it is determined that the alignment is successful, and a standard named entity corresponding to the target edit distance is selected as the alignment result.
  13. 如权利要求11所述的电子设备,其中,所述根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果,包括:11. The electronic device according to claim 11, wherein said performing model alignment on said to-be-aligned named entity according to a named entity alignment model set to obtain an alignment result comprises:
    将所述标准待对齐命名实体中每个文字转化为预定维度的字向量,计算所述标准待对齐命名实体中所有文字对应的字向量的平均值,得到标准待对齐命名实体向量;Convert each word in the standard named entity to be aligned into a word vector of a predetermined dimension, and calculate an average value of the word vectors corresponding to all words in the standard named entity to be aligned to obtain a standard named entity vector to be aligned;
    利用所述命名实体对齐模型集合中的每个命名实体对齐模型对所述标准待对齐命名实体向量进行对齐处理,得到预测对齐实体向量;Using each named entity alignment model in the named entity alignment model set to perform alignment processing on the standard to-be-aligned named entity vector to obtain a predicted alignment entity vector;
    将所述标准命名实体库中的每个标准命名实体转化为标准命名实体向量,汇总所有所述标准命名实体向量,得到标准命名实体向量库;Converting each standard named entity in the standard named entity library into a standard named entity vector, and summarizing all the standard named entity vectors to obtain a standard named entity vector library;
    对所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量进行相似度计算分析处理,得到所述对齐结果。Perform similarity calculation and analysis processing on the predicted aligned entity vector and each standard named entity vector in the standard named entity vector library to obtain the alignment result.
  14. 如权利要求13所述的电子设备,其中,所述对所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量进行相似度计算分析处理,得到对齐结果,包括:The electronic device according to claim 13, wherein said performing similarity calculation and analysis processing on said predicted aligned entity vector and each of said standard named entity vectors in said standard named entity vector library to obtain an alignment result comprises :
    计算所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量的相似度值;Calculating a similarity value between the predicted aligned entity vector and each of the standard named entity vectors in the standard named entity vector library;
    将所有所述相似度值汇总得到相似度集;Summarize all the similarity values to obtain a similarity set;
    确定所述相似度集中的最大相似度值;Determine the maximum similarity value in the similarity set;
    选取所述标准命名实体向量库中所述最大相似度值对应的标准命名实体向量作为目标向量;Selecting the standard named entity vector corresponding to the maximum similarity value in the standard named entity vector library as the target vector;
    选取所述标准命名实体库中所述目标向量对应的标准命名实体作为待对齐结果;Selecting the standard named entity corresponding to the target vector in the standard named entity library as the result to be aligned;
    汇总所有的所述待对齐结果,得到待对齐结果集合;Summarize all the results to be aligned to obtain a set of results to be aligned;
    利用多数投票机制对所述待对齐结果集合进行筛选,得到所述对齐结果。The majority voting mechanism is used to screen the set of results to be aligned to obtain the alignment result.
  15. 如权利要求14所述的电子设备,其中,所述利用多数投票机制对所述所述待对齐结果集合进行筛选,得到对齐结果,包括:The electronic device according to claim 14, wherein said using a majority voting mechanism to filter said set of results to be aligned to obtain an alignment result comprises:
    记录所述待对齐结果集合中每个待对齐结果的出现次数;Record the number of occurrences of each result to be aligned in the result set to be aligned;
    选取出现次数最多的待对齐结果作为备选对齐结果;Select the result to be aligned with the most occurrences as the candidate alignment result;
    确定所述备选对齐结果的数量;Determining the number of candidate alignment results;
    若所述数量为一,将所述备选对齐结果确定为所述对齐结果;If the number is one, determine the candidate alignment result as the alignment result;
    若所述数量大于一,汇总所述待对齐结果集合中每个待对齐结果对应的相似度值,得到待对齐结果相似度集,选取所述待对齐结果相似度集中最大的相似度值对应的待对齐结果作为对齐结果。If the number is greater than one, summarize the similarity value corresponding to each result to be aligned in the result set to be aligned to obtain the similarity set of the result to be aligned, and select the one corresponding to the largest similarity value in the similarity set of the result to be aligned The result to be aligned is used as the alignment result.
  16. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to implement the following steps:
    获取待对齐命名实体,对所述待对齐命名实体进行标准化处理,得到标准待对齐命名实体;Acquiring a named entity to be aligned, and standardizing the named entity to be aligned to obtain a standard named entity to be aligned;
    获取测试命名实体集,对所述测试命名实体集进行抽样处理,得到测试命名实体子集;Acquire a test named entity set, perform sampling processing on the test named entity set, and obtain a test named entity subset;
    利用每个测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合;Use each test named entity subset to train a preset neural network model to obtain a named entity alignment model set;
    根据所述命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果。Perform model alignment on the named entities to be aligned according to the named entity alignment model set to obtain an alignment result.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述利用每一个所述测试命名实体子集训练预设的神经网络模型,得到命名实体对齐模型集合,包括:15. The computer-readable storage medium of claim 16, wherein said training a preset neural network model using each subset of said test named entities to obtain a named entity alignment model set comprises:
    将所述测试命名实体子集中的每个测试命名实体转化为测试命名实体向量,得到测试命名实体向量子集;Converting each test named entity in the test named entity subset into a test named entity vector to obtain a test named entity vector subset;
    将所述测试命名实体向量子集确定为训练集;Determining the subset of test named entity vectors as a training set;
    对所述测试命名实体向量子集进行标记,得到标签集;Marking the subset of test named entity vectors to obtain a label set;
    利用所述训练集及所述标签集对所述神经网络模型进行训练,得到命名实体对齐模型;Training the neural network model by using the training set and the label set to obtain a named entity alignment model;
    汇总所有的所述命名实体对齐模型,得到所述命名实体对齐模型集合。Summarize all the named entity alignment models to obtain the named entity alignment model set.
  18. 如权利要求16所述的计算机可读存储介质,其中,所述根据命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐之前,还包括:15. The computer-readable storage medium according to claim 16, wherein before the model alignment of the standard named entities to be aligned according to the named entity alignment model set, the method further comprises:
    利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果;Use the standard named entities to be aligned to perform morphological alignment in a pre-built standard named entity library, and if the morphological alignment is successful, obtain the alignment result;
    若所述形态对齐不成功,根据所述命名实体对齐模型集合对所述标准待对齐命名实体进行模型对齐。If the morphological alignment is unsuccessful, perform model alignment on the standard named entity to be aligned according to the named entity alignment model set.
  19. 如权利要求18所述的计算机可读存储介质,其中,所述利用所述标准待对齐命名实体在预构建的标准命名实体库中进行形态对齐,若所述形态对齐成功,得到所述对齐结果,包括:The computer-readable storage medium according to claim 18, wherein the standard named entity to be aligned is used to perform morphological alignment in a pre-built standard named entity library, and if the morphological alignment is successful, the alignment result is obtained ,include:
    计算所述标准待对齐命名实体与所述标准命名实体库中每个标准命名实体的编辑距离;Calculating the edit distance between the standard named entity to be aligned and each standard named entity in the standard named entity library;
    当在所述编辑距离中存在目标编辑距离等于预设编辑距离值时,确定对齐成功,选取所述目标编辑距离对应的标准命名实体作为所述对齐结果。When there is a target edit distance equal to the preset edit distance value in the edit distance, it is determined that the alignment is successful, and a standard named entity corresponding to the target edit distance is selected as the alignment result.
  20. 如权利要求18所述的计算机可读存储介质,其中,所述根据命名实体对齐模型集合对所述待对齐命名实体进行模型对齐,得到对齐结果,包括:18. The computer-readable storage medium according to claim 18, wherein said performing model alignment on said named entity to be aligned according to a named entity alignment model set to obtain an alignment result comprises:
    将所述标准待对齐命名实体中每个文字转化为预定维度的字向量,计算所述标准待对齐命名实体中所有文字对应的字向量的平均值,得到标准待对齐命名实体向量;Convert each word in the standard named entity to be aligned into a word vector of a predetermined dimension, and calculate an average value of the word vectors corresponding to all words in the standard named entity to be aligned to obtain a standard named entity vector to be aligned;
    利用所述命名实体对齐模型集合中的每个命名实体对齐模型对所述标准待对齐命名实体向量进行对齐处理,得到预测对齐实体向量;Using each named entity alignment model in the named entity alignment model set to perform alignment processing on the standard to-be-aligned named entity vector to obtain a predicted alignment entity vector;
    将所述标准命名实体库中的每个标准命名实体转化为标准命名实体向量,汇总所有所述标准命名实体向量,得到标准命名实体向量库;Converting each standard named entity in the standard named entity library into a standard named entity vector, and summarizing all the standard named entity vectors to obtain a standard named entity vector library;
    对所述预测对齐实体向量与所述标准命名实体向量库中每个所述标准命名实体向量进行相似度计算分析处理,得到所述对齐结果。Perform similarity calculation and analysis processing on the predicted aligned entity vector and each standard named entity vector in the standard named entity vector library to obtain the alignment result.
PCT/CN2020/119085 2020-06-19 2020-09-29 Named entity alignment device and apparatus, and electronic device and readable storage medium WO2021151303A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010564906.1 2020-06-19
CN202010564906.1A CN111738005A (en) 2020-06-19 2020-06-19 Named entity alignment method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
WO2021151303A1 true WO2021151303A1 (en) 2021-08-05

Family

ID=72650291

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/119085 WO2021151303A1 (en) 2020-06-19 2020-09-29 Named entity alignment device and apparatus, and electronic device and readable storage medium

Country Status (2)

Country Link
CN (1) CN111738005A (en)
WO (1) WO2021151303A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113536796A (en) * 2021-07-15 2021-10-22 北京明略昭辉科技有限公司 Entity alignment auxiliary method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714977A (en) * 2013-12-17 2015-06-17 日本电气株式会社 Correlating method and device for entities and knowledge base items
CN107480191A (en) * 2017-07-12 2017-12-15 清华大学 A kind of entity alignment model of iteration
US20180144234A1 (en) * 2016-11-20 2018-05-24 Arturo Devesa Sentence Embedding for Sequence-To-Sequence Matching in a Question-Answer System
CN109960810A (en) * 2019-03-28 2019-07-02 科大讯飞(苏州)科技有限公司 A kind of entity alignment schemes and device
CN110598210A (en) * 2019-08-29 2019-12-20 深圳市优必选科技股份有限公司 Entity recognition model training method, entity recognition device, entity recognition equipment and medium
CN110807328A (en) * 2019-10-25 2020-02-18 华南师范大学 Named entity identification method and system oriented to multi-strategy fusion of legal documents

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104714977A (en) * 2013-12-17 2015-06-17 日本电气株式会社 Correlating method and device for entities and knowledge base items
US20180144234A1 (en) * 2016-11-20 2018-05-24 Arturo Devesa Sentence Embedding for Sequence-To-Sequence Matching in a Question-Answer System
CN107480191A (en) * 2017-07-12 2017-12-15 清华大学 A kind of entity alignment model of iteration
CN109960810A (en) * 2019-03-28 2019-07-02 科大讯飞(苏州)科技有限公司 A kind of entity alignment schemes and device
CN110598210A (en) * 2019-08-29 2019-12-20 深圳市优必选科技股份有限公司 Entity recognition model training method, entity recognition device, entity recognition equipment and medium
CN110807328A (en) * 2019-10-25 2020-02-18 华南师范大学 Named entity identification method and system oriented to multi-strategy fusion of legal documents

Also Published As

Publication number Publication date
CN111738005A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
WO2021212682A1 (en) Knowledge extraction method, apparatus, electronic device, and storage medium
WO2022134759A1 (en) Keyword generation method and apparatus, and electronic device and computer storage medium
WO2022121171A1 (en) Similar text matching method and apparatus, and electronic device and computer storage medium
WO2021208703A1 (en) Method and apparatus for question parsing, electronic device, and storage medium
WO2021208696A1 (en) User intention analysis method, apparatus, electronic device, and computer storage medium
WO2022222300A1 (en) Open relationship extraction method and apparatus, electronic device, and storage medium
WO2022222943A1 (en) Department recommendation method and apparatus, electronic device and storage medium
WO2022078308A1 (en) Method and apparatus for generating judgment document abstract, and electronic device and readable storage medium
CN113312461A (en) Intelligent question-answering method, device, equipment and medium based on natural language processing
WO2023159755A1 (en) Fake news detection method and apparatus, device, and storage medium
WO2022134355A1 (en) Keyword prompt-based search method and apparatus, and electronic device and storage medium
WO2022194062A1 (en) Disease label detection method and apparatus, electronic device, and storage medium
CN113704429A (en) Semi-supervised learning-based intention identification method, device, equipment and medium
WO2022222942A1 (en) Method and apparatus for generating question and answer record, electronic device, and storage medium
WO2021189903A1 (en) Audio-based user state identification method and apparatus, and electronic device and storage medium
CN113282854A (en) Data request response method and device, electronic equipment and storage medium
CN113157739B (en) Cross-modal retrieval method and device, electronic equipment and storage medium
CN113434542B (en) Data relationship identification method and device, electronic equipment and storage medium
CN113360654B (en) Text classification method, apparatus, electronic device and readable storage medium
WO2021151303A1 (en) Named entity alignment device and apparatus, and electronic device and readable storage medium
CN116720525A (en) Disease auxiliary analysis method, device, equipment and medium based on inquiry data
CN112364068A (en) Course label generation method, device, equipment and medium
WO2023178979A1 (en) Question labeling method and apparatus, electronic device and storage medium
CN116578696A (en) Text abstract generation method, device, equipment and storage medium
CN116468025A (en) Electronic medical record structuring method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20917187

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20917187

Country of ref document: EP

Kind code of ref document: A1