CN114218472B - Intelligent search system based on knowledge graph - Google Patents

Intelligent search system based on knowledge graph

Info

Publication number
CN114218472B
CN114218472B CN202111540151.2A CN202111540151A CN114218472B CN 114218472 B CN114218472 B CN 114218472B CN 202111540151 A CN202111540151 A CN 202111540151A CN 114218472 B CN114218472 B CN 114218472B
Authority
CN
China
Prior art keywords
data
collection
module
graph
triple
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111540151.2A
Other languages
Chinese (zh)
Other versions
CN114218472A (en
Inventor
陈杨
肖创柏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Technology
Original Assignee
Beijing University of Technology
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 Beijing University of Technology filed Critical Beijing University of Technology
Priority to CN202111540151.2A priority Critical patent/CN114218472B/en
Publication of CN114218472A publication Critical patent/CN114218472A/en
Application granted granted Critical
Publication of CN114218472B publication Critical patent/CN114218472B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9532Query formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Animal Behavior & Ethology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了基于知识图谱的智能搜索系统,包括数据管理模块、数据处理模块、自然语言处理服务模块、知识图谱构建模块、信息检索模块;数据管理模块、数据处理模块、自然语言处理服务模块、知识图谱构建模块、信息检索模块并列连接。基于BERT预训练模型实现了以下三个NLP服务,包括三元组抽取、命名实体识别、语义匹配。通过基于python的flask框架。研发出基于特定领域的数据构建知识图谱,提出二次训练三元组抽取模型的方法,减少人工标注训练数据的工作量,实现了针对原始的特定数据集进行尽可能少的人工标注,并训练出针对此数据集的三元组抽取模型;在一定程度上,使得搜索引擎能够理解用户的意图,使企业级搜索引擎更加智能化。

The present invention discloses an intelligent search system based on a knowledge graph, including a data management module, a data processing module, a natural language processing service module, a knowledge graph construction module, and an information retrieval module; the data management module, the data processing module, the natural language processing service module, the knowledge graph construction module, and the information retrieval module are connected in parallel. Based on the BERT pre-training model, the following three NLP services are implemented, including triple extraction, named entity recognition, and semantic matching. Through the python-based flask framework. A knowledge graph based on data from a specific field is developed, and a method for secondary training of a triple extraction model is proposed to reduce the workload of manual annotation of training data, achieve as little manual annotation as possible for the original specific data set, and train a triple extraction model for this data set; to a certain extent, the search engine can understand the user's intention, making the enterprise-level search engine more intelligent.

Description

Intelligent search system based on knowledge graph
Technical Field
The invention relates to an intelligent search system realized based on a knowledge graph aiming at enterprise data, and belongs to the technical field of computers.
Background
Through years of development, the technology of general search engines is continuously developed, for example, the well-known Google, baidu, bing and other search engines are remarkably developed on the basis of the knowledge level. Knowledge graph is a concept proposed by Google corporation in 2012, with the goal of improving search results by describing various entities and concepts in the real world, and the relationships between these entities and concepts. By constructing the knowledge graph, a semantic network is formed, and on the basis, the search engine can understand the intention of the user to a certain extent according to the entity and the relation of the knowledge graph, and find the information really needed by the user. The search based on the knowledge graph supports more accurate and simpler result return, the knowledge search often maps the search statement of the user to a structured query statement, the final positioning target is an entity in a knowledge base, and the entity contains rich relevant information, so that the accurate and simple search result can be conveniently returned to the user as long as the entity in the knowledge base is accurately positioned.
The application of search engine technology is not just a generic search scenario that covers the entire internet data, such as hundred degrees, google, etc., but also a personalized search engine for enterprise-level data. At present, most enterprise-level search engines are still in a stage of comparison, the search engines only process data, build an index library and store the data for enterprise data, users search through keywords and return document data containing the input keywords, the semantics of the user search cannot be understood, the interactivity of the users between the search engines is reduced, the searching accuracy is reduced, and the ever-increasing searching requirements of the users cannot be met. Along with the continuous development of knowledge graph technology and natural language processing technology in recent years, a new development thought is provided for a search engine. Knowledge graph can describe and construct knowledge by graph model, a group of triplet network is formed by extracting and storing entity and relation, knowledge base in a specific field can be constructed to a certain extent, more complex semantic relation between data is provided by the knowledge base in the specific field, therefore, knowledge graph technology is very necessary to be applied to enterprise-level search engine, a certain degree of natural language understanding is realized by searching based on the knowledge base in the specific field, accuracy of search result is enhanced by construction and application of knowledge graph, relevance between result and user input is enhanced, and better search service is provided for data in the specific field.
Disclosure of Invention
The invention aims to provide an intelligent searching system based on a knowledge graph, provides a solution of natural language searching, and aims to design and develop the intelligent searching system for realizing natural language searching based on the knowledge graph aiming at data in a specific enterprise field.
The invention develops an intelligent search system by applying natural language processing technologies such as triplet extraction, named entity recognition, semantic matching and the like and combining a search engine sol and a graph database nebula-graph adopted by the invention and using Java, python, springboot frames and the like.
In order to achieve the above purpose, the technical scheme adopted by the invention is an intelligent searching system based on a knowledge graph, which is divided into five sub-modules from the functional perspective, namely a data management module, a data processing module, a natural language processing service module, a knowledge graph construction module and an information retrieval module, wherein the data management module, the data processing module, the natural language processing service module, the knowledge graph construction module and the information retrieval module are connected in parallel as shown in figure 1. In a natural language processing module, the invention realizes the following three NLP services based on the BERT pre-training model, including triplet extraction (used for constructing a knowledge graph), named entity recognition and semantic matching. And providing service for the system in the form of a web service interface through a python-based flash frame, packaging a returned result, and calling a corresponding interface by the system in a part needing natural language processing to analyze and process the result. In the knowledge graph construction part, a knowledge graph construction method based on data in a specific field is developed, a method for secondarily training a triplet extraction model is provided, the workload of manually marking training data is reduced, the aim of manually marking as few as possible for an original specific data set is achieved, and the triplet extraction model for the data set is trained. In the natural language searching part, semantic searching based on named entity recognition and template matching is realized, and on the basis of the semantic searching, the semantic matching mode between sentences and relational words is put forward, so that an enterprise-level search engine can understand a natural language searching request of a user.
The architecture of the entire system is shown in fig. 2, and five important modules designed in the entire system are labeled. The sol is a search engine, which can be broadly considered as a database in the invention, collection is created through a Java client provided by the sol, each colleciton stores enterprise data in a specific field, the invention stores enterprise data collection called collection to be queried, the data stored in the sol is displayed in json format at an admin interface of the sol, a plurality of documents (doc) are stored in one collection, each document is a piece of data, each piece of data is a document with a plurality of fields (field), and the id field is used as a unique identifier of the data in the collection.
Nebula-graph is a graph database product adopted by the subject, one nebula-graph instance consists of one or more graph spaces (spaces), each graph space is physically isolated, a user can use different graph spaces to store different data sets in the same instance, SPACENAME uniquely identifies one data set, each space corresponds to one collection, stores one kind of entity-relation data, namely stores triad information extracted from data corresponding to the collection, namely knowledge information, and forms a semantic knowledge base corresponding to the collection. For each space, a schema configuration needs to be defined for that space, and the schema for nebula-graph is shown in Table 1.
TABLE 1nebula map space configuration
The invention discloses a data management module, which comprises a software and nebula-graph, wherein some data and basic configuration need to be managed, and in the invention, the creation and deletion of the collection of the software, the addition, deletion and modification of fields of the collection of the software, the creation and deletion of space of the nebula-graph and the like are realized by the data management module. The data management module is used for managing data and basic configuration in the whole system, and mainly realizes the following four functions of software data management, nebula-graph data management, triplet ontology schema configuration management and natural language question template configuration management, and is shown in fig. 3.
The sor data management module is responsible for creating, configuring and deleting the collection of the data set, and configuring, adding and deleting the collection field. The collection is created and deleted, namely, a space creating and deleting method is called in the collection creating and deleting method, the space name and the collection are the same, a data set for a user to search is formed together, the collection is an original data set to be queried, and data stored in the space is an extracted knowledge base corresponding to collection data.
Nebula-graph data management is responsible for realizing space creation and deletion of the graph database nebula-graph, and is responsible for managing schema configuration information of space of nebula-graph, namely creating and deleting labels or point types (tags), creating and deleting edge types (edge types), creating and deleting tag indexes and creating and deleting edge indexes.
The triplet schema configures the management module that the triplet is a subject, a predicate, a head entity, a relation and a tail entity, and the triplet schema is a type of the subject, a predicate and a type of the object. The module is used for constructing a knowledge graph. The invention needs to perform triplet extraction on the collection data to construct the corresponding knowledge graph, and the triplet extraction is realized by calling a web interface provided by a natural language processing service module. The invention is based on bert pre-training language model, the parameters of the model are correspondingly modified through the downstream task, then the training of the triplet extraction character is carried out, and the training needs schema configuration and the training data marked according to the schema configuration. The schema configuration is stored in a data set with a suffix name of "_schema" corresponding to the data set to be searched, and is used for managing the schema, the module is used for adding, modifying and deleting the schema, auditing and remarking the data to be searched and collected according to the schema, and writing the configuration into training data to train a triplet extraction model. Triplet body configuration management is shown in fig. 3.
And (3) natural language question template management, namely, aiming at the well configured schemes of the collection to be queried, acquiring a relation, namely, predicte from each scheme, and according to all the relations (predicte) in the knowledge graph, matching the templates by questions, wherein the template management part is responsible for adding, deleting and modifying the matched templates, and the question templates are stored in the corresponding collection with the suffix of 'template'.
And the data processing module is used for storing data of two parts in total, namely a search engine sol and a graph database nebula-graph.
The module is responsible for storing the data of the two parts, adding, deleting and modifying the data in the collection of the sor, and inserting, deleting and updating the triple entity and the relation in nebula-graph.
The original data needs to be processed to a certain extent before being stored into solrcollection, the module realizes three processing modules of short text filtering, text replacement and segmentation clauses of the data, and finally the processed data is indexed into the collection of the solr. And this part of data processing has the property of being expandable, and the corresponding requirement can be realized by adding a processing module, as shown in fig. 4. The data of the triples corresponding to the collection to be queried is stored in the collection with the suffix of "_extraction", the data of the triples in the collection, namely, the relation and the entity are stored in nebula-graph, and the relation is established between the nodes to form a knowledge graph.
The natural language processing service module is written by python, realizes four functions of triple extraction, named entity identification, semantic matching between sentences and relation words and semantic matching between two sentences, packages the four functions into interfaces respectively, and provides a web service form for springboot items to call through a flash framework. As shown in fig. 5.
The triple extraction module realizes the triple extraction function, firstly trains a triple extraction model, stores the trained model on a server, writes codes, provides web services to the outside through a flash framework, inputs the web services as a short text set List < Stringtext >, outputs the triple corresponding to each short text, including extracted text and triple information corresponding to text, namely subject, subjectType, object, objectType, predicate, and packages the returned result into json format.
The named entity recognition module realizes the named entity recognition function, firstly trains a named entity recognition model, stores the trained model on a server, writes codes, provides a web service interface through a flash framework for springboot items to call, inputs a short text set, returns a named entity, and encapsulates the result into json format.
The semantic matching is divided into two parts, namely semantic matching between sentences and relation words and semantic matching between two sentences, respectively training a model, storing the trained model on a server, writing codes, providing web services through a flash frame, and calling in the natural language searching process. Semantic matching between sentences and relational words aims to obtain an entity with the closest relation to a certain entity from a graph database, and semantic matching between two sentences aims to find a question template which is most relevant to a sentence input by a user so as to perform subsequent searching and detailed description in a natural language searching section. And inputting a List < Stringtext > set, dividing each text into two parts by using a "#", outputting a parameter "prob" to represent a fraction, reflecting the matching degree of the left part and the right part of the "#", setting a threshold in a program, and considering the left part and the right part of the "#", namely the left part and the right part of the "#", as matching if the fraction exceeds the threshold.
Knowledge graph construction module:
the purpose of this module is to triage the solrcollection data and store the extracted entity and relationship data into nebula-graph as a knowledge graph to support natural language searches.
The knowledge graph construction process comprises the following steps:
and 1, performing triplet data annotation on the data in the collection to be queried by the solr.
And 2, training a triplet extraction model.
And 3, calling a triplet extraction interface of the natural language processing service module to extract, and storing the extracted result into a collection corresponding to the solr.
And 4, auditing the extracted triples, namely, the triples stored in the corresponding collection of the sol.
And 5, storing the data after the auditing into a space corresponding to the graph database, and taking the space as a knowledge base corresponding to the collection data.
The information retrieval module is used for retrieving data in a database (solr, nebula-graph) and comprises a common retrieval module and a natural language search module.
The common retrieval module is realized based on keyword matching and a query resolver packaged by a solr.
The natural language search module is a scene of inputting natural language by a user, and needs to convert unstructured natural language query sentences input by the user into structured query sentences (for query sentences of a graph database, nebula-graph is adopted in the invention, unstructured query sentences need to be converted into structured NGQL), query is performed in a corresponding knowledge base (space), the returned query results are entity information, the entity information is used as a part of the results of the user query, and meanwhile, the entity information is searched in a corresponding collection to return a final search result which is used as another part of the user query results, and the two search results jointly form the query results of the user.
Drawings
FIG. 1 is a diagram of an intelligent search system and its sub-modules.
Fig. 2 is a system architecture diagram.
FIG. 3 is a triplet body configuration management diagram.
Fig. 4 is a block diagram of data processing.
Fig. 5 is a natural language processing service block diagram.
FIG. 6 is a diagram of a data management module and its sub-modules.
Fig. 7 is a knowledge graph construction flowchart.
Fig. 8 is a natural language search flow chart.
Detailed Description
In order to further clean the objects, technical solutions and advantages of the embodiments of the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. It will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The intelligent search system comprises a plurality of modules, namely a data management module, a data processing module, a natural language processing service module, a knowledge graph construction module and an information retrieval module. The overall architecture of the system is shown in figure 2.
In the present invention, the entire system architecture is described by the following steps, according to fig. 2.
Step 1 data management
The data management module and its sub-module diagram are shown in fig. 6.
Firstly, creating collections of a software through a software data management module, wherein each collection represents enterprise data in a specific field;
after creating the collection, configuring fields of the collection;
Creating a graph database space corresponding to the collection, and configuring a point type (tag) and an edge type (edge type) corresponding to the space;
configuring a plurality of attributes of tag and edgetype;
establishing a single index and a joint index of the attributes for the tag and the edgetype;
The method comprises the steps of configuring a triplet body ontology (the type, the relation and the type of the object) used by a knowledge graph constructed by the data of the collection to be queried, and storing the triplet body ontologies as a data set with a suffix of "_schema" corresponding to the data set to be queried after the schema is configured;
step 2, data processing
Enterprise data is unstructured data, and before the data is indexed into the collection of the solr, some processing needs to be performed on the data to be indexed according to actual requirements, and then the collection of the solr is indexed. The module realizes three processing modules of short text filtering, text replacement and segmentation clause of the data, and the data processing part can realize corresponding requirements by adding the processing modules aiming at different types of data.
Step 3, knowledge graph construction
The knowledge graph construction process of the system is shown in figure 7. The method comprises the following steps:
1. aiming at collection to be extracted, configuring a triplet schema;
2. training a triplet extraction model through an open source training set;
3. sentence dividing is carried out on the data to be extracted from collection;
4. extracting by calling a triplet of the natural language processing service module, and storing the result into a collection with a suffix of "_extraction";
5. Extracting, cleaning and re-labeling the audit triples, and writing the re-labeled training data aiming at the collection into a training file (the purpose of the audit is to re-label the triples training data aiming at the collection to be queried);
6. training the triplet extraction model again aiming at the collection to be queried, and storing the triplet extraction model to the corresponding collection;
7. audit data (the purpose of this audit is to store in the graph database space);
8. stored in a graph database nebula-graph.
Because the knowledge graph is constructed aiming at the data of a collection to be queried, the data of the collection is often from enterprise clients or the data of a specific field, a model trained by an open-source triplet extraction training data set does not necessarily have a good extraction effect aiming at the data of the specific field, generally, special personnel are required to manually mark the specific data set according to configured triplet schema, the system writes the marked training data into a training set file, invokes extraction service of a natural language processing service module to extract triples, and then checks and stores. Aiming at the situation, the invention adopts a small improvement scheme, namely, two times of training are carried out, the operation of manually marking data is reduced, the efficiency of the whole process is improved, namely, the collection is firstly extracted through an open source data set, the extracted data is not stored in a graph database, is checked and modified, the modified data is written into a training set as training data for carrying out a second time of training, the purpose of the checking and the modification is to re-mark the data of the collection to be checked and to train a model for the data of the collection, the modified data of the triples and corresponding texts are used as re-marked data, the re-marked data is written into a training set file, and a training interface of a natural language processing module is called for training again, so as to obtain the triples extraction model which accords with the data set to be checked.
At this time, the data of the data set to be queried can be extracted again through the model and is audited again, and the aim of the audit is to store the audited data into a space of nebula-graph for the storage of the final triplet data.
Step 4, searching natural language
A natural language search flow chart is shown in fig. 8.
Through the previous description, a knowledge graph for the collection to be queried has been constructed, and natural language search needs to be performed based on the knowledge graph. The query sentence input by the user is unstructured natural language, and the knowledge graph is realized through the graph database nebula-graph, so that the query is required to be performed through the structured query sentence, and the result is returned. In the system, the nature of realizing natural language search is to convert unstructured natural language query sentences of users into structured query sentences based on knowledge maps for query. The conversion of unstructured statements into structured query statements is performed by the following steps.
1. Identifying and acquiring a subject of the text through the named entity;
named entity recognition is the first step in converting unstructured query terms into structured query terms, requiring the acquisition of key entity information, i.e., subjects, of the user input terms.
2. Acquiring a relation prediction through semantic matching;
firstly, constructing a query statement NGQL (NGQL does not specify an edgetype or a relationship) aiming at nebula-graph through the subject obtained in the step 1, wherein the purpose is to obtain all related words (predictes) corresponding to the subject in a graph database;
Combining each relation word with the input sentence of the user to obtain a List < Stringtext > set;
The set is used as a relation semantic matching structure of a parameter call natural language processing service module, each group of relation and query sentences returns a matching score, when the matching score reaches a certain threshold value, the relation is considered to be a relation word capable of reflecting the query sentences input by a user, and the relation word with the highest score is taken as a prediction;
The resulting subjects and predictes are built into a structured query statement NGQL for nebula-grams, which queries the object as a tail entity in the space of nebula-grams, which is part of the returned results.
3. And querying the obtained tail entity in a collection to be queried, which is taken as a query keyword desolr, and taking the tail entity as the other part of the returned result.
In summary, the invention realizes NLP downstream tasks such as triplet extraction, named entity recognition and the like through research and application of bert models, and enables a search engine to understand the intention of a user to a certain extent through application of NLP technology and knowledge graph constructed through enterprise data, namely data in a specific field, thereby realizing natural language search of the user and enabling the enterprise-level search engine to be more intelligent.

Claims (8)

1.基于知识图谱的智能搜索系统,其特征在于:包括数据管理模块、数据处理模块、自然语言处理服务模块、知识图谱构建模块、信息检索模块;数据管理模块、数据处理模块、自然语言处理服务模块、知识图谱构建模块、信息检索模块并列连接;在自然语言处理模块,基于BERT预训练模型实现以下三个NLP服务,包括三元组抽取、命名实体识别、语义匹配;通过基于python的flask框架,以web服务接口的形式对系统提供服务,并封装返回结果,在需要进行自然语言处理的部分对对应的接口进行调用,进行结果的解析和处理;在此基础上进行改进,提出语句与关系词之间的语义匹配的方式,使得企业级搜索引擎能够理解用户的自然语言搜索请求;1. A knowledge graph-based intelligent search system, characterized by comprising a data management module, a data processing module, a natural language processing service module, a knowledge graph construction module, and an information retrieval module; the data management module, data processing module, natural language processing service module, knowledge graph construction module, and information retrieval module are connected in parallel; in the natural language processing module, the following three NLP services are implemented based on the BERT pre-trained model: triple extraction, named entity recognition, and semantic matching; through the Python-based Flask framework, the system is provided with services in the form of a web service interface, and the returned results are encapsulated. In the part where natural language processing is required, the corresponding interface is called to parse and process the results; based on this, improvements are made to propose a semantic matching method between sentences and relational terms, so that the enterprise-level search engine can understand users' natural language search requests; nebula-graph数据管理负责实现图数据库nebula-graph的space创建和删除,负责管理nebula-graph的space的schema配置信息即创建、删除标签或点类型,创建、删除边类型,创建、删除tag索引,创建、删除edge索引;The nebula-graph data management component is responsible for creating and deleting spaces in the nebula-graph graph database. It is also responsible for managing the schema configuration of the nebula-graph space, including creating and deleting labels or vertex types, edge types, tag indexes, and edge indexes. 三元组schema配置管理模块:三元组是subject,predicate,object亦即头实体、关系、尾实体,三元组schema是subject的类型,predicate和object的类型;此模块用于构建知识图谱;基于bert预训练语言模型,通过下游任务对模型的参数进行对应的修改,然后进行三元组抽取人物的训练,训练需要schema配置以及根据schema配置标注的训练数据;schema配置存储在待搜索数据集所对应后缀名为“_schema”的数据集,用于对schema进行管理,此模块作用为添加、修改、删除schema,根据schema对待查询collection的数据进行审核并重新标注,并将配置写入到训练数据以进行三元组抽取模型的训练;Triple schema configuration management module: A triple is composed of subject, predicate, and object, i.e., head entity, relationship, and tail entity. The triple schema is the type of the subject, predicate, and object. This module is used to build knowledge graphs. Based on the BERT pre-trained language model, the model parameters are modified accordingly through downstream tasks, and then triple extraction character training is performed. Training requires schema configuration and training data labeled according to the schema configuration. The schema configuration is stored in the dataset with the suffix "_schema" corresponding to the dataset to be searched and is used to manage the schema. This module is used to add, modify, and delete schemas, review and re-label the data in the query collection according to the schema, and write the configuration to the training data for training the triple extraction model. 自然语言处理服务模块:用python编写,实现三元组抽取、命名实体识别、语句与关系词之间的语义匹配、两个语句之间的语义匹配四个功能,并把它们分别封装成接口,通过flask框架提供web服务的形式供springboot项目调用;Natural Language Processing Service Module: Written in Python, it implements four functions: triple extraction, named entity recognition, semantic matching between sentences and related words, and semantic matching between two sentences. These functions are encapsulated into interfaces and provided as web services through the Flask framework for Spring Boot projects to call. 三元组抽取:此模块实现了三元组抽取功能,首先训练三元组抽取模型,训练好的模型保存在服务器上,并编写代码,通过flask框架对外提供web服务,输入为一个短文本集合List<String text>,输出则为输入的每个短文本对应的三元组,包括抽取的文本text,以及text对应的三元组信息即subject、subjectType、object、objectType、predicate,返回结果封装成json格式;Triple extraction: This module implements the triple extraction function. First, the triple extraction model is trained and saved on the server. The code is written to provide web services through the Flask framework. The input is a short text collection List<String text>. The output is the triple corresponding to each short text input, including the extracted text and the triple information corresponding to the text, namely subject, subjectType, object, objectType, and predicate. The return result is encapsulated in JSON format. 命名实体识别:此模块实现命名实体识别功能,首先训练命名实体识别的模型,训练好的模型在服务器上进行保存,编写代码,通过flask框架提供web服务接口,供springboot项目调用,输入为短文本集合,返回的结果为命名实体,结果封装为json格式;Named Entity Recognition: This module implements the named entity recognition function. First, the named entity recognition model is trained and saved on the server. Then, code is written to provide a web service interface through the Flask framework for the SpringBoot project to call. The input is a short text collection, and the returned result is a named entity, which is encapsulated in JSON format. 语义匹配:此部分分为语句与关系词之间的语义匹配以及两个语句之间的语义匹配两个部分,分别训练模型,将训练好的模型保存在服务器上,编写代码,通过flask框架提供web服务,在自然语言搜索的过程中会进行调用。Semantic matching: This part is divided into two parts: semantic matching between sentences and related words, and semantic matching between two sentences. Models are trained for each part, and the trained models are saved on the server. Code is written and web services are provided through the Flask framework, which will be called during the natural language search process. 2.根据权利要求1所述的基于知识图谱的智能搜索系统,其特征在于:solr是搜索引擎,通过solr提供的Java客户端,进行collection的创建,每一个colleciton存储某个特定领域的企业数据,存储企业数据collection称为待查询collection,存储进solr的数据在solr的admin界面以json格式展示,一个collection里存储多个文档,每一个文档就是一条数据,每一条数据即一个文档有多个字段,其中以id字段作为数据在此collection里的唯一标识;nebula-graph是所采用的图数据库产品,一个nebula-graph实例由一个或多个图空间组成,每个图空间都是物理隔离的,用户在同一个实例中使用不同的图空间存储不同的数据集,spaceName唯一标识一个数据集,每一个space对应于一个collection,存储一类实体-关系数据,即存储从对应collection的数据所抽取的三元组信息即知识信息。2. The intelligent search system based on knowledge graph according to claim 1 is characterized in that: Solr is a search engine, and collections are created through the Java client provided by Solr. Each collection stores enterprise data in a specific field. The collection that stores enterprise data is called a collection to be queried. The data stored in Solr is displayed in JSON format on the admin interface of Solr. A collection stores multiple documents, and each document is a piece of data. Each piece of data, i.e., a document, has multiple fields, wherein the ID field is used as the unique identifier of the data in this collection; Nebula-Graph is the graph database product used, and a Nebula-Graph instance consists of one or more graph spaces, each of which is physically isolated. Users use different graph spaces in the same instance to store different data sets, and SpaceName uniquely identifies a data set. Each space corresponds to a collection, and stores a type of entity-relationship data, i.e., triple information extracted from the data of the corresponding collection, i.e., knowledge information. 3.根据权利要求2所述的基于知识图谱的智能搜索系统,其特征在于:数据管理模块:solr和nebula-graph都有一些数据和基础配置需要被“管理”,solr的collection的创建和删除,solr的collection的字段的添加、删除和修改以及nebula-graph的space的创建和删除,这一部分工作由数据管理模块实现;数据管理模块是对整个系统中数据和基础配置的管理,实现以下四个功能:solr数据管理、nebula-graph数据管理、三元组本体schema配置管理、自然语言问句模板配置管理。3. The intelligent search system based on knowledge graph according to claim 2 is characterized by: data management module: Solr and Nebula-Graph both have some data and basic configurations that need to be "managed", including the creation and deletion of Solr collections, the addition, deletion and modification of fields in Solr collections, and the creation and deletion of Nebula-Graph spaces. This part of the work is implemented by the data management module; the data management module manages the data and basic configurations in the entire system, and realizes the following four functions: Solr data management, Nebula-Graph data management, triple ontology schema configuration management, and natural language question template configuration management. 4.根据权利要求1所述的基于知识图谱的智能搜索系统,其特征在于:solr数据管理模块负责数据集collection的创建、配置、删除,collection字段的配置、添加、删除;collection的创建和删除要对应nebula-graph的一个space的创建和删除,也就是在collection的创建和删除的方法中要调用space的创建和删除方法,space名称和collection相同,两者共同构成供用户搜索的数据集,其中collection是待查询原始数据集,space里存储的数据是collection数据对应的抽取出的知识库。4. The intelligent search system based on knowledge graph according to claim 1 is characterized in that: the solr data management module is responsible for the creation, configuration, and deletion of data set collections, and the configuration, addition, and deletion of collection fields; the creation and deletion of collections correspond to the creation and deletion of a space in the nebula-graph, that is, the creation and deletion methods of the space must be called in the collection creation and deletion methods, the space name is the same as the collection, and the two together constitute the data set for users to search, where the collection is the original data set to be queried, and the data stored in the space is the extracted knowledge base corresponding to the collection data. 5.根据权利要求1所述的基于知识图谱的智能搜索系统,其特征在于:自然语言问句模板管理:针对于待查询collection已经配置好的schema,从每一个schema取得一个关系,也就是predicate,根据知识图谱中所有的关系,问句匹配模板,此模板管理部分负责添加、删除、修改匹配模板,问句模板存储在后缀名为“_template”的对应collection中。5. The knowledge graph-based intelligent search system according to claim 1 is characterized by: natural language question template management: for the schema that has been configured for the collection to be queried, a relationship, namely a predicate, is obtained from each schema. Based on all the relationships in the knowledge graph, a question matching template is generated. This template management part is responsible for adding, deleting, and modifying matching templates. Question templates are stored in the corresponding collection with the suffix "_template". 6.根据权利要求1所述的基于知识图谱的智能搜索系统,其特征在于:数据处理模块:一共有两个部分的数据存储,即搜索引擎solr和图数据库nebula-graph;负责这两个部分数据的存储,负责数据在solr的collection里的添加、删除和修改,负责三元组实体和关系在nebula-graph的插入、删除和更新;6. The knowledge graph-based intelligent search system according to claim 1 is characterized by: a data processing module: comprising two data storage components, the search engine Solr and the graph database Nebula-Graph; responsible for storing these two components, adding, deleting, and modifying data in Solr collections, and inserting, deleting, and updating triple entities and relationships in Nebula-Graph; 原始数据在存储进solr collection之前需要进行一定的处理,此模块实现了数据的短文本过滤、文本替换、分段分句这三个处理模块,最终将处理之后的数据索引进solr的collection;并且这一部分数据处理,具有可扩展的性质,通过添加处理模块实现对应的需求;待查询collection对应的三元组数据存储在后缀名为“_extraction”的collection中,此collection中的三元组数据即关系和实体会存储进nebula-graph中,并且在节点与节点之间通过关系建立联系,形成知识图谱。The raw data needs to be processed before being stored in a Solr collection. This module implements three processing modules: short text filtering, text replacement, and segmentation and sentence segmentation. The processed data is finally indexed into the Solr collection. This part of the data processing is scalable and can be implemented by adding processing modules. The triple data corresponding to the collection to be queried is stored in a collection with the suffix "_extraction". The triple data in this collection, namely the relationships and entities, are stored in the nebula-graph, and connections are established between nodes through relationships to form a knowledge graph. 7.根据权利要求1所述的基于知识图谱的智能搜索系统,其特征在于:知识图谱构建模块,构建过程如下:7. The knowledge graph-based intelligent search system according to claim 1, characterized in that the knowledge graph construction module is constructed as follows: 步骤1:对solr待查询collection里的数据进行三元组数据标注;Step 1: Label the data in the Solr collection to be queried with triples; 步骤2:训练三元组抽取模型;Step 2: Train the triplet extraction model; 步骤3:调用自然语言处理服务模块的三元组抽取接口进行抽取,并将抽取之后的结果存储进solr对应的collection;Step 3: Call the triple extraction interface of the natural language processing service module to extract the triples and store the extracted results in the corresponding collection of Solr; 步骤4:对抽取的三元组即存储进solr对应collection的三元组数据进行审核;Step 4: Review the extracted triples, i.e. the triples stored in the corresponding collection in Solr; 步骤5:将审核之后的数据存储进图数据库对应的space,作为此collection的数据对应的知识库。Step 5: Store the reviewed data into the corresponding space in the graph database as the knowledge base corresponding to the data in this collection. 8.根据权利要求1所述的基于知识图谱的智能搜索系统,其特征在于:信息检索模块,对数据库中的数据进行检索,信息检索模块分为普通检索模块和自然语言搜索模块进行检索。8. The intelligent search system based on knowledge graph according to claim 1 is characterized in that: the information retrieval module searches for data in the database, and the information retrieval module is divided into a general retrieval module and a natural language search module for retrieval.
CN202111540151.2A 2021-12-15 2021-12-15 Intelligent search system based on knowledge graph Active CN114218472B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111540151.2A CN114218472B (en) 2021-12-15 2021-12-15 Intelligent search system based on knowledge graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111540151.2A CN114218472B (en) 2021-12-15 2021-12-15 Intelligent search system based on knowledge graph

Publications (2)

Publication Number Publication Date
CN114218472A CN114218472A (en) 2022-03-22
CN114218472B true CN114218472B (en) 2025-09-09

Family

ID=80702786

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111540151.2A Active CN114218472B (en) 2021-12-15 2021-12-15 Intelligent search system based on knowledge graph

Country Status (1)

Country Link
CN (1) CN114218472B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114911893A (en) * 2022-04-11 2022-08-16 中国软件与技术服务股份有限公司 Method and system for automatically constructing knowledge base based on knowledge graph
CN115081457A (en) * 2022-06-13 2022-09-20 北京哈希泰格信息科技有限公司 Information processing method and system based on artificial intelligence technology
CN115146052A (en) * 2022-07-25 2022-10-04 平安科技(深圳)有限公司 Information retrieval method, device and equipment based on knowledge graph and storage medium
CN115905677B (en) * 2022-09-14 2025-12-30 北京工业大学 An intelligent search system for the medical field
CN116108194A (en) * 2022-11-23 2023-05-12 中国人民解放军国防科技大学 Search engine method, system, storage medium and electronic device based on knowledge map
CN116049148B (en) * 2023-04-03 2023-07-18 中国科学院成都文献情报中心 Construction method of domain meta knowledge engine in meta publishing environment
CN117009616B (en) * 2023-06-21 2025-07-25 中车青岛四方机车车辆股份有限公司 Digital file management method, system, equipment and medium
CN117033653B (en) * 2023-07-26 2026-01-16 浙江大学 Method and device for constructing generated knowledge graph based on code language model
CN116737915B (en) * 2023-08-16 2023-11-21 中移信息系统集成有限公司 Semantic retrieval method, device, equipment and storage medium based on knowledge graph
CN116955674B (en) * 2023-09-20 2024-01-09 杭州悦数科技有限公司 Method and web device for generating graph database statement through LLM
CN117521792B (en) * 2023-11-22 2024-08-20 北京交通大学 Knowledge graph construction method based on man-machine cooperation type information extraction labeling tool
CN118626541B (en) * 2024-08-14 2024-12-06 中共山东省委组织部党员教育中心 Structured data processing system and method under unidirectional network
CN118796984A (en) * 2024-09-14 2024-10-18 浪潮通用软件有限公司 Intelligent financial query method, device, equipment and medium
CN118821733A (en) * 2024-09-19 2024-10-22 合肥天帷信息安全技术有限公司 A secondary training method and related equipment for evaluation report entity extraction model
CN119226908A (en) * 2024-12-02 2024-12-31 山东锋士信息技术有限公司 A system and method for automatically generating water conservancy natural language model training data

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271506A (en) * 2018-11-29 2019-01-25 武汉大学 A kind of construction method of the field of power communication knowledge mapping question answering system based on deep learning
CN112966084A (en) * 2021-03-11 2021-06-15 北京三快在线科技有限公司 Knowledge graph-based answer query method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10073840B2 (en) * 2013-12-20 2018-09-11 Microsoft Technology Licensing, Llc Unsupervised relation detection model training
CN113312489B (en) * 2021-04-13 2023-05-05 武汉烽火众智数字技术有限责任公司 Panoramic retrieval system and method based on NLP and graph database

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109271506A (en) * 2018-11-29 2019-01-25 武汉大学 A kind of construction method of the field of power communication knowledge mapping question answering system based on deep learning
CN112966084A (en) * 2021-03-11 2021-06-15 北京三快在线科技有限公司 Knowledge graph-based answer query method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114218472A (en) 2022-03-22

Similar Documents

Publication Publication Date Title
CN114218472B (en) Intelligent search system based on knowledge graph
CN111753099B (en) Method and system for enhancing relevance of archive entity based on knowledge graph
CN112000725B (en) Ontology fusion preprocessing method for multi-source heterogeneous resources
CN111680173A (en) A CMR Model for Unified Retrieval of Cross-Media Information
US11562592B2 (en) Document retrieval through assertion analysis on entities and document fragments
CN114911951A (en) Knowledge graph construction method for man-machine cooperation assembly task
CN114880483A (en) A metadata knowledge graph construction method, storage medium and system
Abbes et al. MongoDB-based modular ontology building for big data integration
CN115563313A (en) Semantic retrieval system for literature and books based on knowledge graph
CN118551046A (en) Method for enhancing document processing flow based on large language model
CN120144549B (en) Metadata real-time adaptive standardization system for multi-domain data sharing
CN118779439A (en) Question answering method, device, equipment and storage medium based on retrieval enhancement
Zhang et al. Saka: an intelligent platform for semi-automated knowledge graph construction and application
CN119829022A (en) Method for generating front-end prototype based on artificial intelligence technology
CN119166740A (en) Knowledge base construction method, data processing method, device, storage medium and program product
CN111897911B (en) A method and system for unstructured data query based on secondary attribute graph
Song et al. Multi-domain ontology mapping based on semantics
Song et al. Semantic query graph based SPARQL generation from natural language questions
Futia et al. Training neural language models with sparql queries for semi-automatic semantic mapping
CN111831787B (en) Unstructured data information query method and system based on secondary attributes
Kettouch et al. Using semantic similarity for schema matching of semi-structured and linked data
CN119441569A (en) Method and system for acquiring RAG data and generating questions and answers based on encyclopedia websites
Belefqih et al. A novel framework for RDF schema extraction in NoSQL databases using Sentence-BERT
Colombo et al. Llm-assisted construction of the united states legislative graph
Tang et al. Ontology-based semantic retrieval for education management systems

Legal Events

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