Entity relationship identification method and device, equipment, storage medium and product
By preprocessing and entity recognition of unstructured text, building a knowledge graph and applying graph algorithms, the problems of inefficient and insufficient accuracy of complex relationship recognition among unstructured texts are solved, and efficient and accurate relationship recognition is achieved.
Patent Information
- Application Number
- CN202411731310.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-04
AI Technical Summary
In identifying complex relationships between unstructured texts, the prior art has problems of inefficiency and insufficient accuracy.
By obtaining unstructured text data, preprocessing is performed to improve data quality, the preset entity recognition model is used to extract entities from the text, and a knowledge graph is constructed based on the degree of correlation between entities, and finally the preset graph algorithm is used to determine the target correlation between entities.
It significantly improves the efficiency and accuracy of identifying complex relationships between unstructured texts, visually displaying relationships between entities through knowledge graphs, and digging out implicit relationships.
Smart Images

Figure CN119557454A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of knowledge graph technology, and in particular, to a method, device, equipment, storage medium and product for identifying entity relationships. Background Art
[0002] In scientific research, information in papers, documents, and web pages is a very important source of knowledge, and most of this information is unstructured. Reading a large amount of the above information, finding the connections between them, and then extracting knowledge is often the first and key step in finding research directions and solving practical problems.
[0003] However, with the explosive growth of information, both relying on manual reading and using traditional computer processing technology face the problems of low efficiency and insufficient accuracy when identifying complex relationships among unstructured texts. Summary of the invention
[0004] The present invention provides an entity relationship recognition method, device, equipment, storage medium and product to solve the problems of low efficiency and insufficient accuracy when recognizing complex relationships between unstructured texts, whether relying on manual reading or using traditional computer processing technology.
[0005] According to one aspect of the present invention, a method for identifying entity relationships is provided, comprising:
[0006] Obtain unstructured text data;
[0007] Preprocessing the text data to obtain preprocessed text;
[0008] Based on the preprocessed text, a preset entity recognition model is used to obtain multiple entities in the preprocessed text;
[0009] Based on the degree of association between each pair of entities in the plurality of entities, construct a knowledge graph;
[0010] Based on the knowledge graph, a preset graph algorithm is used to determine the target association relationship between entities.
[0011] According to another aspect of the present invention, there is provided a device for identifying entity relationships, comprising:
[0012] A data acquisition module, used to acquire unstructured text data;
[0013] A data processing module, used for preprocessing the text data to obtain preprocessed text;
[0014] An entity determination module, used to obtain multiple entities in the preprocessed text based on the preprocessed text using a preset entity recognition model;
[0015] A graph construction module, used to construct a knowledge graph based on the degree of association between each entity pair in the multiple entities;
[0016] The relationship determination module is used to determine the target association relationship between entities based on the knowledge graph using a preset graph algorithm.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0018] at least one processor; and
[0019] a memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the entity relationship identification method described in any embodiment of the present invention.
[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the entity relationship identification method described in any embodiment of the present invention when executed.
[0022] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the method for identifying entity relationships described in any embodiment of the present invention is implemented.
[0023] The technical solution provided by the embodiment of the present invention obtains unstructured text data; preprocesses the text data to obtain preprocessed text; based on the preprocessed text, uses a preset entity recognition model to obtain multiple entities in the preprocessed text; constructs a knowledge graph based on the degree of association between each entity pair in the multiple entities; based on the knowledge graph, uses a preset graph algorithm to determine the target association relationship between each entity. Through the above technical solution, the obtained unstructured text data is preprocessed, which significantly improves the data quality and lays the foundation for the subsequent improvement of entity recognition accuracy; then, multiple entities are extracted from the preprocessed text using a preset entity recognition model, and a knowledge graph is constructed based on the degree of association between entity pairs, which can not only intuitively display the direct relationship between entities, but also make the implicit relationship between entities more intuitive and easy to analyze. Then, using a preset graph algorithm, the target association relationship between entities in the knowledge graph is mined, which can effectively improve the efficiency and accuracy of identifying complex relationships between unstructured texts.
[0024] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 is a flow chart of a method for identifying entity relationships provided in Embodiment 1 of the present invention;
[0027] Figure 2 is a flow chart of a method for identifying entity relationships provided in Embodiment 2 of the present invention;
[0028] Figure 3 It is a structural diagram of an entity relationship recognition device provided in Embodiment 3 of the present invention;
[0029] Figure 4 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] Embodiment 1
[0033] Figure 1 This is a flow chart of a method for identifying entity relationships provided in the first embodiment of the present invention. This embodiment is applicable to the case of identifying relationships between unstructured texts. The method can be executed by an entity relationship identification device. The entity relationship identification device can be implemented in the form of hardware and / or software. The entity relationship identification device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0034] S110. Obtain unstructured text data.
[0035] In this embodiment, unstructured text data can be understood as information that is not organized into text data that can be predicted or easily analyzed, and generally includes text documents, emails, web page content, and the like.
[0036] Specifically, at least one unstructured text data is obtained, wherein the at least one text data may be all original data obtained from a document image, or may be all original data downloaded from a web page, or may be partly obtained from a document image and the other part may be original data downloaded from a web page.
[0037] S120: Preprocess the text data to obtain preprocessed text.
[0038] Specifically, since text data in reality usually contains noise, diversity and complexity, directly using raw text data for analysis and modeling may lead to inaccurate or unstable results. In order to improve the quality of text data, reduce interference factors in the data, and provide a better foundation for subsequent tasks, the acquired unstructured text data is cleaned, converted and standardized, for example, non-text elements are removed, duplicates are removed, stop words are removed, word segmentation and vectorization are performed, etc., to realize the conversion of unstructured text data into structured text data.
[0039] S130: Based on the preprocessed text, a preset entity recognition model is used to obtain a plurality of entities in the preprocessed text.
[0040] In this embodiment, the preset entity recognition model can be understood as a pre-trained model for identifying entities in text data. This embodiment does not limit the specific preset entity recognition model, for example, it can be a named entity recognition model based on BERT. Among them, the training process of the preset entity recognition model can be: obtaining a training data set, which can be a pre-labeled data set, preprocessing the training data set to obtain a preprocessed training set, inputting the preprocessed training set into the preset entity recognition model to be trained, and using a preset loss function and optimizer to train the preset entity recognition model to be trained to obtain a preset entity recognition model.
[0041] Among them, entities can be understood as objects that can be clearly identified in the text, such as names of people, places, organizations, time and professional terms. Entities are usually used to refer to individuals and concepts in the real world, and are important elements in tasks such as information retrieval, knowledge graph construction and semantic analysis.
[0042] Specifically, the obtained preprocessed text is input into a preset entity recognition model to obtain multiple entities in the preprocessed text.
[0043] S140. Construct a knowledge graph based on the degree of association between each pair of entities in the multiple entities.
[0044] In this embodiment, the degree of association between each entity pair can be understood as an indicator of the strength or importance of the association between two entities in a specific text. In this embodiment, the greater the degree of association, the higher the degree of association between the two entities. The degree of association between entity pairs can be evaluated by the similarity or co-occurrence frequency between entity pairs. The knowledge graph can be understood as a structured semantic knowledge base for storing relationships between entities, which is used to describe concepts in the physical world in symbolic form, and to represent and store knowledge through nodes (entities) and edges (relationships) in the graph.
[0045] Specifically, the degree of association between each pair of entities in multiple entities is calculated, and the obtained degree of association is used to characterize the possible relationship between the entities, and then a knowledge graph is constructed based on the entities and entity relationships.
[0046] S150. Based on the knowledge graph, a preset graph algorithm is used to determine the target association relationship between entities.
[0047] In this embodiment, the preset graph algorithm can be understood as a pre-set algorithm for determining the relationship between entities based on the knowledge graph. The preset graph algorithm can be a neural network model, a clustering algorithm, a PageRank algorithm, or a graph cut algorithm, etc., which is not specifically limited in this embodiment.
[0048] Specifically, a preset graph algorithm is determined, and then the preset graph algorithm is used to mine the deep relationships between entities based on the knowledge graph to determine the target association relationship between the entities.
[0049] The technical solution provided in the first embodiment of the present invention obtains unstructured text data; preprocesses the text data to obtain preprocessed text; based on the preprocessed text, uses a preset entity recognition model to obtain multiple entities in the preprocessed text; constructs a knowledge graph based on the degree of association between each entity pair in the multiple entities; based on the knowledge graph, uses a preset graph algorithm to determine the target association relationship between each entity. Through the above technical solution, the obtained unstructured text data is preprocessed, which significantly improves the data quality and lays the foundation for the subsequent improvement of entity recognition accuracy; then, multiple entities are extracted from the preprocessed text using a preset entity recognition model, and a knowledge graph is constructed based on the degree of association between entity pairs, which can not only intuitively display the direct relationship between entities, but also make the implicit relationship between entities more intuitive and easy to analyze. Then, using a preset graph algorithm, the target association relationship between entities in the knowledge graph is mined, which can effectively improve the efficiency and accuracy of identifying complex relationships between unstructured texts.
[0050] In some embodiments, the preset graph algorithm includes a path analysis algorithm and a pattern recognition algorithm; based on the knowledge graph, the preset graph algorithm is used to determine the target association relationship between entities, including: based on the knowledge graph, the path analysis algorithm is used to determine the first association relationship between entities; based on the knowledge graph and the preset relationship pattern, the pattern recognition algorithm is used to determine the second association relationship between entities; based on the first association relationship and the second association relationship, the target association relationship between the entities is determined. Through the above technical solution, the target association relationship between entities is comprehensively determined, which can more comprehensively reflect the direct and indirect connections between entities and enhance the expression ability and application value of the knowledge graph.
[0051] In this embodiment, the path analysis algorithm is used to determine the optimal path from a starting point to an end point. This embodiment does not limit the specific path analysis algorithm, for example, it can be Dijkstra's algorithm, Bellman-Ford algorithm or Floyd-Warshall algorithm. The pattern recognition algorithm is used to identify patterns or regularities from data. This embodiment does not limit the specific pattern recognition algorithm, for example, it can be a support vector machine (SVM) or an artificial neural network (ANN).
[0052] The preset relationship model can be understood as the possible relationship model between entities defined based on specific domain knowledge, such as "financial products-risks", "transaction behavior-market impact" in the medical field, etc.
[0053] Specifically, based on the knowledge graph, the path analysis algorithm can be used to identify the shortest path between entities, and the shortest path can be used as the first association relationship between entities. Exemplarily, entity A, entity B and entity C are connected in sequence to form the first path from entity A to entity C, and entity A, entity D, entity F and entity C are connected in sequence to form the second path from entity A to entity C. The path analysis algorithm calculates that the first path is shorter than the second path. Therefore, the relationship between entity A and entity C can be determined based on the first path. Further, according to the preset relationship pattern, the pattern recognition algorithm can be used to analyze and learn the preset relationship pattern, and the entity pairs that conform to the preset relationship pattern can be identified and inferred from the knowledge graph, and the implicit association relationship between these entity pairs, that is, the second association relationship, can be determined. Exemplarily, in the financial field, if the knowledge graph contains the relationship between "financial product A-market risk-price fluctuation" and "financial product B-market risk-price fluctuation", the pattern recognition algorithm may find that there is a second association relationship between "financial product A" and "financial product B" by analyzing these relationship patterns. Furthermore, based on the first association relationship and the second association relationship found between the entities, the target association relationship between the entities is determined. Exemplarily, assuming that a first association relationship is found between entity A and entity F, and at the same time, based on the pattern recognition algorithm, a second association relationship is identified between entity A and entity F, then the target association relationship between entity A and entity F includes the first association relationship and the second association relationship.
[0054] Optionally, if only the first association relationship between entities is found, the target association relationship between the entities can be determined based only on the first association relationship; if only the second association relationship between entities is found, the second association relationship can be determined only as the target association relationship between the entities.
[0055] In some embodiments, the degree of association between the entity pairs is determined by calculating the similarity between the entity pairs.
[0056] Specifically, the similarity between two entities is determined by a preset distance algorithm, and then the similarity between the two entities is used as the degree of association between the two entity pairs. The preset distance algorithm can be Euclidean distance, cosine similarity or Manhattan distance, etc. The size of the distance is inversely proportional to the similarity, that is, the greater the distance, the smaller the similarity, and vice versa. Through the above technical solution, the closeness of the relationship between entities can be accurately quantified, thereby providing strong support for the richness and accuracy of the knowledge graph.
[0057] In some embodiments, constructing a knowledge graph based on the degree of association between each entity pair among the multiple entities includes: constructing a knowledge graph based on entity pairs whose degree of association between each entity pair among the multiple entities is greater than a preset threshold.
[0058] In this embodiment, the preset threshold can be understood as a preset value used to screen the degree of association between entity pairs.
[0059] Specifically, the calculated correlation between each entity pair among multiple entities is compared with a preset threshold, and entity pairs greater than the preset threshold are screened out, and a knowledge graph is constructed based on these screened entity pairs. Through the above technical solution, entity pairs with a strong correlation can be identified, ensuring that only entity pairs with a relationship strength exceeding this threshold are included in the knowledge graph construction process, thereby reducing noise and irrelevant information, thereby improving the accuracy and reliability of the knowledge graph.
[0060] Embodiment 2
[0061] Figure 2 It is a flow chart of a method for identifying entity relationships provided in Embodiment 2 of the present invention. This embodiment is optimized and expanded on the basis of the above-mentioned optional embodiments.
[0062] Optionally, obtaining unstructured text data includes: parsing first text information in a document image through an optical character recognition algorithm; obtaining second text information in a web page through an application programming interface, wherein the subject of the text content contained in the web page and the subject of the text content contained in the document image belong to the same field; and determining unstructured text data based on the first text information and the second text information. The above technical solution effectively integrates multi-source unstructured text data, providing a rich information basis for subsequent identification of relationships between unstructured text data.
[0063] Optionally, the text data is preprocessed to obtain preprocessed text, including: using a regularized matching algorithm to remove non-text elements in the text data to obtain first processed text data; performing word segmentation on the first processed text data to obtain second processed text data; and performing vectorization on the second processed text data to obtain preprocessed text. Through the above technical solution, the quality of unstructured text data is effectively improved, and the conversion of unstructured data to structured data is further realized, which lays a solid data foundation for subsequent data processing and analysis.
[0064] like Figure 2 As shown, the method includes:
[0065] S210: Parse first text information in the document image using an optical character recognition algorithm.
[0066] In this embodiment, the optical character recognition (OCR) algorithm is a technology for converting text in an image into computer-editable and searchable text. This embodiment does not limit the specific optical character recognition algorithm. For example, it can be a template matching algorithm or an optical character recognition algorithm based on a neural network. The document image can be understood as a document in the form of an image, which can include but is not limited to PDF files, paper documents, scanned documents, and emails. The first text information can be understood as unprocessed raw text data, which is unstructured text data. Among them, the first text information can be in Chinese and / or English.
[0067] Specifically, OCR is used to perform image preprocessing operations such as denoising and binarization on the input document image, and then the text area in the preprocessed image is divided out by character segmentation technology, and then the text in the text area is recognized to obtain the first text information. It is worth noting that this embodiment does not limit the character segmentation technology, for example, it can be an algorithm based on deep learning or an edge detection algorithm.
[0068] S220: Acquire second text information in a web page through an application programming interface, wherein the subject of the text content contained in the web page and the subject of the text content contained in the document image belong to the same field.
[0069] In this embodiment, the application programming interface (API) is a set of predefined functions, protocols and tools for building software applications. The second text information can be understood as unprocessed raw text data, which is unstructured text data. The second text information can be in Chinese and / or English.
[0070] Among them, the subject of the text content contained in the web page and the subject of the text content contained in the document image belong to the same field. For example, a paper version of an academic paper discusses "the impact of financial technology on traditional banking business" and an article on a news website reports "the impact of financial technology on personal investment behavior". It can be seen that in this example, they belong to the same field of "climate change". Further, the subject of the text content contained in the web page and the subject of the text content contained in the document image can be the same. For example, a paper report details "the release plan and market strategy of the company's new product X". The press release on the company's official website announced "the official release of new product X, and its market strategy". It can be seen that in this example, the topics discussed in the two documents are the same, namely "the release plan and market strategy of new product X". Optionally, the subject of the text content contained in the web page and the subject of the text content contained in the document image can also be different, but they should belong to the same field. For example, in scientific research, exploring the correlation between different topics can also help broaden the user's research ideas and directions.
[0071] Specifically, a web page belonging to the same field as the subject of the text content included in the document image is found through the API, and then the second text information is downloaded from the web page.
[0072] S230: Determine unstructured text data based on the first text information and the second text information.
[0073] Specifically, the acquired first text information and the acquired second text information together constitute unstructured text data.
[0074] S240: Using a regularized matching algorithm to remove non-text elements in the text data to obtain first processed text data.
[0075] In this embodiment, the regularized matching algorithm generally refers to a technique for matching, searching and replacing text that conforms to a specific pattern using regular expressions. When processing text data, the regularized matching algorithm can help remove non-text elements to purify and standardize the text. Non-text elements can be understood as symbols and characters that appear in the text content and do not belong to the category of natural language text.
[0076] Specifically, in order to improve the quality of text data, a regularized matching algorithm is used to remove non-text elements in the text data, thereby obtaining first processed text data.
[0077] S250: Segment the first processed text data to obtain second processed text data.
[0078] Specifically, in order to analyze and process the first processed text data more accurately, the first processed text data is segmented using a preset analysis algorithm. This embodiment does not limit the specific preset analysis algorithm, for example, it may be a HanLP segmentation algorithm or a split function.
[0079] S260: vectorize the second processed text data to obtain preprocessed text.
[0080] Specifically, in order to better capture the semantic information and structural features of the second processed text data, a preset vectorization processing algorithm is used to convert the text data into a numerical form, for example, mapping a word or phrase into a mathematical vector. The preset vectorization processing algorithm may be an algorithm such as TF-IDF or Word2Vec.
[0081] S270: Based on the preprocessed text, a preset entity recognition model is used to obtain multiple entities in the preprocessed text.
[0082] S280, constructing a knowledge graph based on the degree of association between each pair of entities in the multiple entities;
[0083] S290. Based on the knowledge graph, use a preset graph algorithm to determine the target association relationship between entities.
[0084] The technical solution provided in the second embodiment of the present invention, by acquiring and integrating multi-source unstructured text data, provides a rich information basis for the subsequent identification of the relationship between unstructured text data; then removes non-text elements from the integrated unstructured text data, effectively improves the quality of the text data, and realizes the conversion of unstructured data to structured data through word segmentation and vectorization processing, which lays a solid data foundation for subsequent data processing and analysis; then based on the pre-processed text, using a preset entity recognition model, multiple entities in the pre-processed text are obtained, and based on the degree of association between each pair of entities in the multiple entities, a knowledge graph is constructed; based on the knowledge graph, using a preset graph algorithm, the target association relationship between each entity is determined. Effectively improve the efficiency and accuracy of identifying complex relationships between unstructured texts.
[0085] Embodiment 3
[0086] Figure 3 Schematic diagram of a structure of an entity relationship recognition device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device comprises:
[0087] A data acquisition module 31 is used to acquire unstructured text data;
[0088] A data processing module 32, used for preprocessing the text data to obtain preprocessed text;
[0089] An entity determination module 33 is used to obtain multiple entities in the preprocessed text based on the preprocessed text using a preset entity recognition model;
[0090] A graph construction module 34, configured to construct a knowledge graph based on the degree of association between each pair of entities in the plurality of entities;
[0091] The relationship determination module 35 is used to determine the target association relationship between entities based on the knowledge graph using a preset graph algorithm.
[0092] The technical solution provided in the third embodiment of the present invention can effectively improve the efficiency and accuracy of identifying complex relationships between unstructured texts.
[0093] Optionally, the preset graph algorithm includes a path analysis algorithm and a pattern recognition algorithm;
[0094] Optionally, the relationship determination module 35 includes:
[0095] A first relationship determination unit, configured to determine a first association relationship between entities based on the knowledge graph and using the path analysis algorithm;
[0096] A second relationship determination unit, configured to determine a second association relationship between entities based on the knowledge graph and a preset relationship pattern using the pattern recognition algorithm;
[0097] A target relationship determination unit is used to determine a target relationship between the entities based on the first relationship and the second relationship.
[0098] Optionally, the degree of association between the entity pairs is determined by calculating the similarity between the entity pairs.
[0099] Optionally, the graph construction module 34 is specifically used to construct a knowledge graph based on entity pairs among the multiple entities whose correlation degree between each entity pair is greater than a preset threshold.
[0100] Optionally, the data acquisition module 31 includes:
[0101] A first acquisition unit, configured to parse first text information in a document image by using an optical character recognition algorithm;
[0102] A second acquisition unit is used to acquire second text information in a web page through an application programming interface, wherein the subject of the text content contained in the web page and the subject of the text content contained in the document image belong to the same field;
[0103] A data determination unit is used to determine unstructured text data based on the first text information and the second text information.
[0104] Optionally, the data processing module 32 includes:
[0105] A first processing unit, configured to remove non-text elements in the text data using a regularized matching algorithm to obtain first processed text data;
[0106] A second processing unit, configured to perform word segmentation on the first processed text data to obtain second processed text data;
[0107] A data vectorization unit is used to vectorize the second processed text data to obtain preprocessed text.
[0108] The entity relationship recognition device provided in the embodiment of the present invention can execute the entity relationship recognition method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0109] Embodiment 4
[0110] Figure 4 : is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. The electronic device may be an electronic device intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0111] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0112] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0113] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the entity relationship recognition method.
[0114] In some embodiments, the entity relationship recognition method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the entity relationship recognition method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the entity relationship recognition method in any other appropriate manner (e.g., by means of firmware).
[0115] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0116] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0117] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0118] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0119] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0120] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0121] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0122] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
[0123] An embodiment of the present invention further provides a computer program product, including a computer program and / or instructions, which, when executed by a processor, implements a method for identifying entity relationships as provided in any embodiment of the present application.
[0124] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0125] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for identifying entity relationships, characterized in that: include: Obtain unstructured text data; Preprocessing the text data to obtain preprocessed text; Based on the preprocessed text, a preset entity recognition model is used to obtain multiple entities in the preprocessed text; Based on the degree of association between each pair of entities in the plurality of entities, construct a knowledge graph; Based on the knowledge graph, a preset graph algorithm is used to determine the target association relationship between entities.
2. The method according to claim 1, characterized in that The preset graph algorithm includes a path analysis algorithm and a pattern recognition algorithm; Based on the knowledge graph, a preset graph algorithm is used to determine the target association relationship between entities, including: Based on the knowledge graph, using the path analysis algorithm, determining a first association relationship between entities; Based on the knowledge graph and the preset relationship pattern, using the pattern recognition algorithm, determining the second association relationship between the entities; Based on the first association relationship and the second association relationship, a target association relationship between the entities is determined.
3. The method according to claim 1, characterized in that The degree of association between the entity pairs is determined by calculating the similarity between the entity pairs.
4. The method according to claim 1, characterized in that: The step of constructing a knowledge graph based on the degree of association between each pair of entities in the plurality of entities includes: A knowledge graph is constructed based on entity pairs among the multiple entities whose association degree is greater than a preset threshold.
5. The method according to claim 1, characterized in that Obtain unstructured text data, including: parsing first text information in the document image by an optical character recognition algorithm; Acquiring second text information in a webpage through an application programming interface, wherein the subject of the text content contained in the webpage and the subject of the text content contained in the document image belong to the same field; Unstructured text data is determined based on the first text information and the second text information.
6. The method according to claim 1, characterized in that Preprocessing the text data to obtain preprocessed text includes: Using a regularized matching algorithm to remove non-text elements in the text data to obtain first processed text data; Performing word segmentation on the first processed text data to obtain second processed text data; The second processed text data is vectorized to obtain preprocessed text.
7. An entity relationship recognition device, characterized in that: include: A data acquisition module, used to acquire unstructured text data; A data processing module, used for preprocessing the text data to obtain preprocessed text; An entity determination module, used to obtain multiple entities in the preprocessed text based on the preprocessed text using a preset entity recognition model; A graph construction module, used to construct a knowledge graph based on the degree of association between each entity pair in the multiple entities; The relationship determination module is used to determine the target association relationship between entities based on the knowledge graph using a preset graph algorithm.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the entity relationship identification method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for identifying entity relationships as described in any one of claims 1-6 is implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the method for identifying entity relationships according to any one of claims 1 to 6.