Semantic search method, device, electronic device, storage medium and product

By structural mapping and entity mapping of natural sentences, calculating semantic similarity, and extracting word relationship models, it solves search problems in large database environments, realizes data discovery and knowledge mining, and provides more accurate search results and data fusion.

CN114691845BActive Publication Date: 2024-10-01BEIJING ACADEMY OF AGRICULTURE & FORESTRY SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210161709.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-22
Publication Date
2024-10-01
Estimated Expiration
2042-02-22

AI Technical Summary

Technical Problem

Existing technologies cannot effectively solve search problems in distributed, diverse, and heterogeneous large database environments. Traditional search methods cannot meet the needs of data sharing and knowledge mining, and lack a unified semantic search model.

Method used

By obtaining natural sentences, performing structural mapping and entity mapping, calculating semantic similarity, extracting word relationship models, realizing semantic search of the database, automatically building semantic units, integrating data semantics, and recommending knowledge result sets.

Benefits of technology

It realizes data discovery and knowledge mining on the big data platform, provides more comprehensive and accurate search results, and enhances business data fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114691845B_ABST
    Figure CN114691845B_ABST
Patent Text Reader

Abstract

The present invention provides a semantic search method, device, electronic device, storage medium and product. The method comprises: obtaining natural sentences; performing structural mapping on the natural sentences according to a semantic structure model to obtain triple instances of the natural sentences; performing entity mapping on the triple instances to obtain entities contained in the natural sentences, performing data relationship indexing on the entities contained in the natural sentences according to the semantic structure model to obtain a set of quadruple instances, wherein the quadruple includes triple instances and data relationship instances; calculating the semantic similarity between the triple instances and the set of quadruple instances of the natural sentences, and obtaining a recommended set of quadruple instances according to the result of the semantic similarity calculation; extracting a word relationship model of the natural sentences according to the data relationship instances contained in the recommended set of quadruple instances, and searching a database according to the word relationship model to obtain a knowledge result set. The present invention combines big data for semantic search, realizes knowledge mining, and satisfies the user's need for data sharing and discovery.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data technology, and in particular to a semantic search method, device, electronic device, storage medium and product. Background Art

[0002] Since the informatization construction, a large amount of data stored in various business databases has been accumulated, and there are hundreds of databases of various types. However, traditional search methods cannot meet the needs of users for data sharing and discovery, and knowledge mining is difficult. At present, various types of semantic search focus on a certain method, and do not provide a complete semantic search model. For example, the semantic search method based on ontology uses the existing platform to describe the domain knowledge base based on RDF triples using ontology, and query in the knowledge base. The limitation of this method is that it does not provide a unified search relationship model for the multi-platform large database environment; for example, the expanded ontology-based document retrieval method (OntDR), semantic retrieval using keyword queries (SPARK) and semantic search that improves the probability of data discovery in metadata databases, etc., focus on semantic mining methods, etc. These methods are also unable to solve the search problem in the distributed, diverse, and heterogeneous large database environment. Summary of the invention

[0003] The present invention provides a semantic search method, device, electronic device, storage medium and product, which are used to solve the defect of difficulty in knowledge mining in the prior art and realize data discovery and knowledge mining.

[0004] The present invention provides a semantic search method, comprising:

[0005] Get natural sentences;

[0006] Performing structural mapping on the natural sentence according to the semantic structure model to obtain a triple instance of the natural sentence;

[0007] Performing entity mapping on the triple instance to obtain entities included in the natural sentence, performing data relationship indexing on the entities included in the natural sentence according to a semantic structure model to obtain a set of quadruple instances of the natural sentence, wherein the quadruple includes a triple instance and a data relationship instance;

[0008] Calculating the semantic similarity between the triple instance of the natural sentence and the set of quadruple instances of the natural sentence, and obtaining a recommended set of quadruple instances of the natural sentence according to the result of the semantic similarity calculation;

[0009] The word relationship model of the natural sentence is extracted according to the data relationship instance included in the four-tuple instance recommendation set, and the database is searched according to the word relationship model of the natural sentence to obtain the knowledge result set of the natural sentence.

[0010] According to a semantic search method provided by the present invention, the semantic structure model includes an entity set, a semantic relationship set, a fact set and a data relationship set.

[0011] According to a semantic search method provided by the present invention, the word relationship model includes: a data object set segmented by data set, a data object set segmented by field, and a data object set segmented by instance content.

[0012] According to a semantic search method provided by the present invention, the data object set segmented by a data set includes a data source library, a database table name where the word is located, a table description and an application program interface service;

[0013] The data object set based on field segmentation includes field semantic keyword group, database table where the word is located, field type, table field name, display field name and mapping relationship;

[0014] The data object set segmented by instance content includes a word set of the content in which the words are located and the relationship between the words.

[0015] According to a semantic search method provided by the present invention, the calculating of the semantic similarity between the triple instance of the natural sentence and the set of quadruple instances of the natural sentence, and obtaining the recommended set of quadruple instances of the natural sentence according to the result of the semantic similarity calculation include:

[0016] Calculating the semantic similarity of the triple instance of the natural sentence and the set of quadruple instances of the natural sentence according to the cosine similarity formula based on the word quantity;

[0017] The four-tuple instances whose semantic similarity calculation results are greater than or equal to the recommended value in the semantic structure search set are used as the four-tuple instance recommendation set of the natural sentence.

[0018] According to a semantic search method provided by the present invention, searching a database according to a word relationship model of the natural sentence to obtain a knowledge result set of the natural sentence includes:

[0019] According to a data set of knowledge existence of the word relationship model of the natural sentence, a knowledge result set of the natural sentence is obtained, and the knowledge result set includes knowledge features of the natural sentence.

[0020] The present invention also provides a semantic search device, comprising a collection module, an instance construction module, a similarity recommendation module and a search module;

[0021] The acquisition module is used to acquire natural sentences;

[0022] The instance construction module is used to perform structural mapping on the natural sentence according to the semantic structure model to obtain a triple instance of the natural sentence;

[0023] The instance construction module is further used to perform entity mapping on the triple instance to obtain the entity contained in the natural sentence, perform data relationship indexing on the entity contained in the natural sentence according to the semantic structure model, and obtain a set of quadruple instances of the natural sentence, wherein the quadruple includes a triple instance and a data relationship instance;

[0024] The similarity recommendation module is used to calculate the semantic similarity between the triple instance of the natural sentence and the quad instance set of the natural sentence, and obtain the recommended set of quad instance of the natural sentence according to the semantic similarity calculation result;

[0025] The search module is used to extract the word relationship model of the natural sentence according to the data relationship instance included in the four-tuple instance recommendation set, search the database according to the word relationship model of the natural sentence, and obtain the knowledge result set of the natural sentence.

[0026] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned semantic search methods are implemented.

[0027] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the semantic search methods described above when executed by a processor.

[0028] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any of the above-mentioned semantic search methods are implemented.

[0029] The semantic search method, device, electronic device, storage medium and product provided by the present invention obtain a knowledge result set of natural language through a semantic structure model based on data index, realize the automatic construction of semantic units, and thus realize the data semantic fusion of big data. Through the introduction of a semantic similarity algorithm, the semantics of the language expression input by the user and the constructed semantic units are calculated, and after the results are sorted, a quadruple instance of the semantic structure model is automatically recommended. The corresponding word relationship model is obtained according to the recommended quadruple instance, and the word relationship model is converted into a database retrieval relationship. The knowledge result set of the natural sentence is obtained from the big data platform, thereby realizing data discovery and knowledge mining. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 is a flowchart of a semantic search method provided by an embodiment of the present invention;

[0032] Figure 2 is a schematic diagram of a word relationship model provided by an embodiment of the present invention;

[0033] Figure 3 is a schematic diagram of the structure of a semantic search device provided by an embodiment of the present invention;

[0034] Figure 4 is a knowledge result output flow chart provided by an embodiment of the present invention;

[0035] Figure 5 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 are within the scope of protection of the present invention.

[0037] Combine the following Figure 1 The semantic search method of the present invention is described, and the method comprises the following steps:

[0038] Step 101: Obtain a natural sentence;

[0039] It should be noted that the natural sentence Any expression in a non-empty domain.

[0040] Step 102: structurally map the natural sentence according to the semantic structure model to obtain a triple instance of the natural sentence;

[0041] It should be noted that the structure mapping refers to the natural language It is expressed in the form of a semantic structure model G, that is, the semantic structure of natural language is interpreted.

[0042] Step 103: perform entity mapping on the triple instance to obtain the entity included in the natural sentence, perform data relationship indexing on the entity included in the natural sentence according to the semantic structure model, and obtain a set of quadruple instances of the natural sentence, wherein the quadruple includes a triple instance and a data relationship instance;

[0043] It should be noted that for the triple instance Perform entity mapping f, obtain entity o, perform data relationship indexing on entity o, obtain all word relationships of entity o, the word relationships satisfy the word relationship model M, and dynamically fill the word relationship model M according to the semantic structure model G to generate a four-tuple instance set g o .

[0044] An index is a structure that sorts the values ​​of one or more columns in structured data. The data index is aimed at extracting all words from the database after word segmentation to realize the specific data structure of "word-knowledge matrix", which allows users to quickly locate the knowledge matrix through words. Its establishment process is "data extraction -> word segmentation / position relationship -> data structured storage".

[0045] Step 104: Calculate the semantic similarity between the triple instance of the natural sentence and the set of quadruple instances of the natural sentence, and obtain a recommended set of quadruple instances of the natural sentence according to the result of the semantic similarity calculation;

[0046] It should be noted that and g o The semantic similarity calculation is performed and when the result is greater than or equal to the recommended value v, the recommended semantic structure R is obtained. in,

[0047] Among them, according to and g o The common triples {entity, relationship, entity} or {entity, attribute, attribute value} are used for similarity calculation. f(Q,o) is based on o, and a series of query terms are generated according to Q to find the corresponding instance set from the four-tuple instance library. o is the object input by the user, and Q is the application model of the discovery process.

[0048] Step 105: extract the word relationship model of the natural sentence according to the data relationship instance included in the four-tuple instance recommendation set, search the database according to the word relationship model of the natural sentence, and obtain the knowledge result set of the natural sentence.

[0049] It should be noted that, according to the acquired semantic structure model instance, the corresponding word relationship model M is obtained according to the data relationship model S, and the database retrieval relationship Q is converted according to the word relationship model, and the knowledge result set of the natural sentence is obtained from the big data platform according to Q.

[0050] The semantic search method of the embodiment of the present invention obtains the semantic structure of natural language through a semantic structure model based on data index, and searches out a set of semantic structures containing entities in natural language, realizes the automatic construction of semantic units, and thus realizes the data semantic fusion of big data. Through the introduction of semantic similarity algorithm, the semantics of the language expression input by the user and the constructed semantic units are calculated, and after sorting the results, a quadruple instance recommendation set is automatically recommended, thereby realizing data discovery and knowledge mining.

[0051] In at least one embodiment of the present invention, the word relationship model includes: a data object set T segmented by data set, a data object set F segmented by field, and a data object set C segmented by instance content. For example, in the database "vegetable and special crop planting area", there is a classification data set typeclass recorded as t1, a leafy vegetable data set yecha recorded as t2, and a melon and vegetable data set guacha recorded as t3. T = {t1, t2, t3}; field model F = {f1, f2, f3}; content C is expressed as C2, C2 = {c1, c2, c3}; then t2 = {"d":"Sowing area of ​​vegetables and special crops","n":"yecha","w":["Leafy vegetables","Leafy vegetables"],"y":"http: / / www.xxx.xxx / BJArcWcfService / getDataValue.aspx"}, field set in t2, take a field and record it as f2, f2 represents example: f2 = {"w":["Spinach","Mu"],"t":"Unique identifier of t2","l":"char","s":"column1831","i"}, t2 data set takes the field content described by f2 as an example, recorded as c2, then c2 = {"w":["..."],"r":"Unique identifier of f2"}.

[0052] It should be noted that the word relationship satisfies the word relationship model M, which is expressed as formula (1):

[0053] M=[T,F,C] (1)

[0054] Where T = {t1, t2…t n}, t is the data object with words as the core after the data set is segmented; F = {f1,f2…f n}, f is the data object with words as the core after field segmentation; C = {c1, c2…c n}, c is the data object with words as the core after the instance content is segmented.

[0055] In at least one embodiment of the present invention, the data object set T segmented by data set includes a data source library, a database table name where the word is located, a table description, and an application program interface service;

[0056] It should be noted that the definition of t in T is as shown in formula (2):

[0057] t=[d,n,w,y] (2)

[0058] Among them, d is the data source library, n is the table name of the database where the word is located, w is the table description, and y is the application programming interface service (API service) for data acquisition.

[0059] The data object set F based on field segmentation includes field semantic keyword group, database table where the word is located, field type, table field name, display field name and mapping relationship;

[0060] It should be noted that the definition of f in F is as shown in formula (3):

[0061] f=[w,t,l,r,s,i] (3)

[0062] Among them, w is the field semantic keyword group, t is the unique identifier of the database table where the word is located, l is the field type, r is the table field name, s is the display field name, and i is the mapping relationship. When the content of the r field is a foreign key, it is used to convert it into specific content.

[0063] Where i is defined as shown in formula (4):

[0064] i=[f s ,f t ,f w ] (4)

[0065] Description: s The name of the field where the mapping content is located, f t The table where the mapping content is located, f w The name of the field where the mapping condition is located.

[0066] The data object set C segmented by instance content includes the word set of the content in which the word is located and the relationship between the words.

[0067] It should be noted that the definition of c in C is as shown in formula (5):

[0068] c=[W,f] (5)

[0069] in, w k is the word set of the content of the word, r is the relationship between w words, and f is defined in formula (3).

[0070] In at least one embodiment of the present invention, the semantic structure model includes an entity set, a semantic relationship set, a fact set, and a data relationship set.

[0071] It should be noted that the logical architecture of the knowledge graph consists of a model layer and a data layer. The model layer is the core of the knowledge graph, and its main content is the data structure of knowledge. The data layer is often represented in the form of a triple G = {E, R, F}.

[0072] In the method of this embodiment, semantics and data relationships are added to the traditional data layer to build a data fusion layer based on semantic indexing, which can enable each database platform to achieve semantic fusion, more comprehensive and accurate search results, and stronger fault tolerance of business data. The data fusion layer based on semantic indexing is represented in the form of a four-tuple G = {E, R, F, K}. The data relationship K reflects the data organization relationship between the data in the data design model when the database is built, and supports data query, statistics, filtering and other analysis when the query is supported by the data relationship.

[0073] Where E represents the entity set {e1,e2,…,e E}; R represents the semantic relationship set {r1, r2,…, r R}, the relationship r is the edge in the knowledge graph, indicating a certain connection between different entities; F represents the fact set {f1,f2,…,f F}, where each fact f is defined as a four-tuple (h, r, t, s) ∈ f, and the basic type of fact f is represented by (entity, relationship, entity, data relationship set) and (entity, attribute, attribute value, data relationship set), etc.; K is the data relationship set {k1, k2, …, k n}, where each k is defined as k = {m, f'}, where m∈M, f' is the Query function used to process the relationship.

[0074] In at least one embodiment of the present invention, searching a database according to the word relationship model of the natural sentence to obtain a knowledge result set of the natural sentence includes:

[0075] According to a data set of knowledge existence of the word relationship model of the natural sentence, a knowledge result set of the natural sentence is obtained, and the knowledge result set includes knowledge features of the natural sentence.

[0076] It should be noted that the knowledge discovery process based on data indexing is the discovery process from structured storage data to knowledge. This process is represented by Q, and the discovery process is represented by the model as shown in formula (6):

[0077] Q=f(S,F,W) (6)

[0078] Among them, S is the extracted knowledge feature, F is the dataset where the knowledge exists, and W is the conditional information

[0079] The user input can be parsed through the M model to quickly construct the S, F, and W elements in Q, obtain the instance q of the Q model, and obtain data through the f” query. f” is the mapping method for obtaining the data set content, which is the process of M model parsing.

[0080] Data indexing can quickly realize information retrieval based on subject words, but does not support information retrieval and knowledge discovery based on semantics. Therefore, the present invention builds a semantic model suitable for retrieval based on data indexing and database construction model, providing support for information retrieval and knowledge discovery based on semantics.

[0081] In at least one embodiment of the present invention, calculating the semantic similarity between the semantic structure of the natural sentence and the semantic structure search set of the natural sentence, and obtaining the recommended semantic structure of the natural sentence according to the semantic similarity calculation result includes:

[0082] Calculating the semantic similarity between the semantic structure of the natural sentence and the semantic structure search set of the natural sentence according to the cosine similarity formula based on the word quantity;

[0083] The semantic structure whose semantic similarity calculation result in the semantic structure search set is greater than or equal to the recommended value is used as the recommended semantic structure of the natural sentence.

[0084] It should be noted that semantic similarity calculation is to map natural language sentences into some formal semantic representation through algorithms. This embodiment constructs vectors in n-dimensional project space for words in the database, measures the cosine similarity by calculating the cosine of the angle between two vectors, and gives the credibility of the semantics of the two sentences in combination with the literal similarity, and recommends the results by presetting the similarity threshold.

[0085] The cosine similarity formula based on the word quantity is expressed as follows:

[0086]

[0087] in, x and y are the word vectors of the two sentences.

[0088] For example, "What should I do if tomato leaves turn yellow?", using the knowledge in the knowledge base, decompose into: entity "tomato", relationship "yellowing", attribute "leaves" and entity "leaves", relationship "what to do", attribute "yellowing". The logical representation is (G1∧G1) If there are common items S that meet the conditions r (data relation set) by calculating s(s∈S r ) with the input sentence, and output s if the semantic similarity reaches the set threshold.

[0089] like Figure 2 The following is a visualization diagram of the word relationship model in this embodiment. Taking "crops" as an example of a subject word, the word relationship model is used to find "crops" based on three directions: T, F, and C. In the example, "crops" only exists in T, that is, only in the table name, so two data sets t0 and t1 are obtained. By decomposing t0 and t1 according to the T model definition, the word relationship model instance based on t0 and t1 is obtained. In actual applications, for user input, such as "the planting area of ​​cabbage in Beijing", first the word is segmented to find the object "cabbage", and then the word relationship model is used to find the data set t where "cabbage" is located, and g is obtained through t. o , and then calculate g o , obtain the qualified g, find the data relation k by decomposing g, find m by decomposing k, build the original query statement according to m, and obtain knowledge from the original database.

[0090] The model was applied to 256 professional databases of Beijing Agricultural Resources Platform to analyze the search recall, precision, semantic accuracy, and grammatical accuracy. The experimental results are given below.

[0091] The knowledge existing in the database is taken as positive samples, and 100 data are taken. The knowledge not existing in the database is taken as negative samples, and 100 data are taken, respectively. The input test is carried out; at the same time, the semantic similarity threshold v is adjusted from high (1≥v≥0.9), medium (1≥v≥0.8), and low (1≥v≥0.6) to test; retrieved is defined as the result found; not retrieved: no result found; accuracy refers to the cumulative average of the ratio of the number of instances of all correct results to the number of all correct result instances in the database; precision refers to the cumulative average of the ratio of the number of correct results found in each case to the total number of results found; recall refers to the ratio of the number of instances of all correct results to the total number of instances; comprehensive evaluation uses the F-Score formula to take recall and precision for evaluation, and the weight parameter is 1; the evaluation results are as follows:

[0092]

[0093] According to the positive example evaluation results, the similarity threshold is 1≥v≥0.9, and the comprehensive evaluation score is high. However, in actual use, from the perspective of semantic recommendation, the query results of the model with a similarity threshold of 1≥v≥0.8 are more in line with user expectations. While ensuring the correct results, semantic recommendation information can also be obtained. The negative column results fully meet the experimental expectations.

[0094] The semantic search device provided by the present invention is described below. The semantic search device described below and the semantic search method described above can be referred to in correspondence with each other. Figure 3The semantic search device of the embodiment of the present invention is shown, including a collection module 301, an example construction module 302, a similarity recommendation module 303 and a search module 304;

[0095] The acquisition module 301 is used to acquire natural sentences;

[0096] The instance construction module 302 is used to perform structural mapping on the natural sentence according to the semantic structure model to obtain a triple instance of the natural sentence;

[0097] The instance construction module 302 is further used to perform entity mapping on the triple instance to obtain the entity included in the natural sentence, perform data relationship indexing on the entity included in the natural sentence according to the semantic structure model, and obtain a set of quadruple instances of the natural sentence, wherein the quadruple includes a triple instance and a data relationship instance;

[0098] The similarity recommendation module 303 is used to calculate the semantic similarity between the triple instance of the natural sentence and the quad instance set of the natural sentence, and obtain the recommended set of quad instance of the natural sentence according to the semantic similarity calculation result;

[0099] The search module 304 is used to extract the word relationship model of the natural sentence according to the data relationship instance included in the four-tuple instance recommendation set, search the database according to the word relationship model of the natural sentence, and obtain the knowledge result set of the natural sentence.

[0100] In at least one embodiment of the present invention, the word relationship model includes: a data object set segmented by data set, a data object set segmented by field, and a data object set segmented by instance content.

[0101] In at least one embodiment of the present invention, the data object set segmented by data set includes a data source library, a database table name where the word is located, a table description, and an application program interface service;

[0102] The data object set based on field segmentation includes field semantic keyword group, database table where the word is located, field type, table field name, display field name and mapping relationship;

[0103] The data object set segmented by instance content includes the word set of the content in which the word is located and the relationship between the words.

[0104] In at least one embodiment of the present invention, the semantic structure model includes an entity set, a semantic relationship set, a fact set, and a data relationship set.

[0105] In at least one embodiment of the present invention, searching a database according to the word relationship model of the natural sentence to obtain a knowledge result set of the natural sentence includes:

[0106] According to a data set of knowledge existence of the word relationship model of the natural sentence, a knowledge result set of the natural sentence is obtained, and the knowledge result set includes knowledge features of the natural sentence.

[0107] In at least one embodiment of the present invention, the similarity recommendation module 303 is further used to calculate the semantic similarity between the semantic structure of the natural sentence and the semantic structure search set of the natural sentence according to the cosine similarity formula based on the word quantity;

[0108] The semantic structure whose semantic similarity calculation result in the semantic structure search set is greater than or equal to the recommended value is used as the recommended semantic structure of the natural sentence.

[0109] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute the semantic search method, which includes:

[0110] Get natural sentences;

[0111] Performing structural mapping on the natural sentence according to the semantic structure model to obtain the semantic structure of the natural sentence;

[0112] Performing entity mapping on the semantic structure to obtain entities included in the natural sentence, and performing data relationship indexing on the entities included in the natural sentence to obtain a word relationship set of the natural sentence;

[0113] Performing structural mapping on the word relationship set of the natural sentence according to the semantic structure model to obtain a semantic structure search set of the natural sentence;

[0114] The semantic similarity between the semantic structure of the natural sentence and the semantic structure search set of the natural sentence is calculated, and the recommended semantic structure of the natural sentence is obtained according to the semantic similarity calculation result.

[0115] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0116] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program may be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the semantic search method provided by the above methods, the method comprising:

[0117] Get natural sentences;

[0118] Performing structural mapping on the natural sentence according to the semantic structure model to obtain the semantic structure of the natural sentence;

[0119] Performing entity mapping on the semantic structure to obtain entities included in the natural sentence, and performing data relationship indexing on the entities included in the natural sentence to obtain a word relationship set of the natural sentence;

[0120] Performing structural mapping on the word relationship set of the natural sentence according to the semantic structure model to obtain a semantic structure search set of the natural sentence;

[0121] The semantic similarity between the semantic structure of the natural sentence and the semantic structure search set of the natural sentence is calculated, and the recommended semantic structure of the natural sentence is obtained according to the semantic similarity calculation result.

[0122] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the semantic search method provided by the above methods, the method comprising:

[0123] Get natural sentences;

[0124] Performing structural mapping on the natural sentence according to the semantic structure model to obtain the semantic structure of the natural sentence;

[0125] Performing entity mapping on the semantic structure to obtain entities included in the natural sentence, and performing data relationship indexing on the entities included in the natural sentence to obtain a word relationship set of the natural sentence;

[0126] Performing structural mapping on the word relationship set of the natural sentence according to the semantic structure model to obtain a semantic structure search set of the natural sentence;

[0127] The semantic similarity between the semantic structure of the natural sentence and the semantic structure search set of the natural sentence is calculated, and the recommended semantic structure of the natural sentence is obtained according to the semantic similarity calculation result.

[0128] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A semantic search method, characterized in that: include: Get natural sentences; Performing structural mapping on the natural sentence according to the semantic structure model to obtain a triple instance of the natural sentence; Performing entity mapping on the triple instance to obtain entities included in the natural sentence, performing data relationship indexing on the entities included in the natural sentence according to a semantic structure model to obtain a set of quadruple instances of the natural sentence, wherein the quadruple includes a triple instance and a data relationship instance; Calculating the semantic similarity between the triple instance of the natural sentence and the set of quadruple instances of the natural sentence, and obtaining a recommended set of quadruple instances of the natural sentence according to the result of the semantic similarity calculation; wherein the semantic similarity calculation is performed according to the triples shared by the triple instance and the set of quadruple instances; The word relationship model of the natural sentence is extracted according to the data relationship instance included in the four-tuple instance recommendation set, and the database is searched according to the word relationship model of the natural sentence to obtain the knowledge result set of the natural sentence.

2. The semantic search method according to claim 1, characterized in that: The semantic structure model includes an entity set, a semantic relationship set, a fact set and a data relationship set.

3. The semantic search method according to claim 1, characterized in that: The word relationship model includes: a data object set segmented by data set, a data object set segmented by field, and a data object set segmented by instance content.

4. The semantic search method according to claim 3, characterized in that: The data object set segmented by the data set includes the data source library, the name of the database table where the word is located, the table description and the application program interface service; The data object set based on field segmentation includes field semantic keyword group, database table where the word is located, field type, table field name, display field name and mapping relationship; The data object set segmented by instance content includes a word set of the content in which the words are located and the relationship between the words.

5. The semantic search method according to any one of claims 1 to 3, characterized in that: The calculating the semantic similarity between the triple instance of the natural sentence and the set of quadruple instances of the natural sentence, and obtaining the recommended set of quadruple instances of the natural sentence according to the result of the semantic similarity calculation, comprises: Calculating the semantic similarity of the triple instance of the natural sentence and the set of quadruple instances of the natural sentence according to the cosine similarity formula based on the word quantity; The four-tuple instances whose semantic similarity calculation results are greater than or equal to the recommended value in the semantic structure search set are used as the four-tuple instance recommendation set of the natural sentence.

6. The semantic search method according to any one of claims 1 to 3, characterized in that: The step of searching a database according to the word relationship model of the natural sentence to obtain a knowledge result set of the natural sentence includes: According to a data set of knowledge existence of the word relationship model of the natural sentence, a knowledge result set of the natural sentence is obtained, and the knowledge result set includes knowledge features of the natural sentence.

7. A semantic search device, characterized in that: It includes acquisition module, instance construction module, similarity recommendation module and search module; The acquisition module is used to acquire natural sentences; The instance construction module is used to perform structural mapping on the natural sentence according to the semantic structure model to obtain a triple instance of the natural sentence; The instance construction module is further used to perform entity mapping on the triple instance to obtain the entity contained in the natural sentence, perform data relationship indexing on the entity contained in the natural sentence according to the semantic structure model, and obtain a set of quadruple instances of the natural sentence, wherein the quadruple includes a triple instance and a data relationship instance; The similarity recommendation module is used to calculate the semantic similarity between the triple instance of the natural sentence and the set of quadruple instances of the natural sentence, and obtain the recommended set of quadruple instances of the natural sentence according to the result of the semantic similarity calculation; wherein the semantic similarity calculation is performed according to the triples shared by the triple instance and the set of quadruple instances; The search module is used to extract the word relationship model of the natural sentence according to the data relationship instance included in the four-tuple instance recommendation set, search the database according to the word relationship model of the natural sentence, and obtain the knowledge result set of the natural sentence.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the semantic search method according to any one of claims 1 to 6 are implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the semantic search method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the semantic search method according to any one of claims 1 to 6 are implemented.