Nothing Special   »   [go: up one dir, main page]

CN114020806A - Fuzzy query method, device, equipment, medium and product - Google Patents

Fuzzy query method, device, equipment, medium and product Download PDF

Info

Publication number
CN114020806A
CN114020806A CN202111277743.XA CN202111277743A CN114020806A CN 114020806 A CN114020806 A CN 114020806A CN 202111277743 A CN202111277743 A CN 202111277743A CN 114020806 A CN114020806 A CN 114020806A
Authority
CN
China
Prior art keywords
query
fuzzy
semantics
words
range
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.)
Granted
Application number
CN202111277743.XA
Other languages
Chinese (zh)
Other versions
CN114020806B (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.)
CCB Finetech Co Ltd
Original Assignee
CCB Finetech Co Ltd
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 CCB Finetech Co Ltd filed Critical CCB Finetech Co Ltd
Priority to CN202111277743.XA priority Critical patent/CN114020806B/en
Publication of CN114020806A publication Critical patent/CN114020806A/en
Application granted granted Critical
Publication of CN114020806B publication Critical patent/CN114020806B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2468Fuzzy queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/243Natural language query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Fuzzy Systems (AREA)
  • Artificial Intelligence (AREA)
  • Probability & Statistics with Applications (AREA)
  • Automation & Control Theory (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明属于人工智能技术领域,具体提供一种模糊查询方法、装置、设备、介质及产品,该方法包括:获取待识别的模糊查询语句;对待识别的模糊查询语句进行语义识别并将待识别的模糊查询语句拆分为多个具有模糊语义的词语及多个明确语义的词语;确定与各具有模糊语义的词语匹配的预设隶属函数和预设隶属度范围阈值;根据各预设隶属函数和对应的预设隶属度范围阈值确定对应具有模糊语义的词语的局部明确查询范围;根据各局部明确查询范围、与相对量词相邻的明确语义的词语及其他明确语义的词语确定模糊查询语句对应的全局明确查询范围,以进行查询。本发明的模糊查询方法,可以实现包含相对量词在内的模糊查询。

Figure 202111277743

The invention belongs to the technical field of artificial intelligence, and specifically provides a fuzzy query method, device, equipment, medium and product. The method includes: obtaining a fuzzy query statement to be recognized; The fuzzy query sentence is divided into a plurality of words with fuzzy semantics and a plurality of words with clear semantics; determine the preset membership function and the preset membership range threshold matching each word with fuzzy semantics; according to each preset membership function and The corresponding preset membership range threshold determines the local clear query range corresponding to the words with fuzzy semantics; according to each local clear query range, words with clear semantics adjacent to relative quantifiers, and other words with clear semantics to determine the corresponding fuzzy query sentence. Globally explicit query scope for querying. The fuzzy query method of the present invention can realize the fuzzy query including relative quantifiers.

Figure 202111277743

Description

Fuzzy query method, device, equipment, medium and product
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a fuzzy query method, a fuzzy query device, fuzzy query equipment, a fuzzy query medium and a fuzzy query product.
Background
With the arrival of the big data era, the data volume is exponentially increased, and the demand of users on data query is higher and higher. In the past, users perform data query through absolute terms which can clearly indicate specific data. Absolute terms such as 2001 in time, 10 th in sequence, etc. may be used to indicate specific data. The method of absolute word query depends on the degree of understanding of the user about the query content, and if the user does not know about the specific content and only knows about the approximate range, the user can hardly search the desired data.
In order to solve the above problems, the fuzzy query of graph database is the main research direction of data query at present. The fuzzy query pointer has fuzzy meaning words such as 'about', 'nearly', 'almost' and the like which are input by a user, and the fuzzy meaning words comprise a fuzzification operator, a tone operator, a relative quantifier and the like. And determining a more accurate fuzzy range by combining the words with fuzzy meanings with absolute words input by a user, so that the user can select data to be inquired.
However, the current fuzzy query method does not consider the relative quantifier such as "most" and "almost no" representing the proportion of the set, and thus, cannot be applied to the fuzzy query with the relative quantifier.
Disclosure of Invention
The invention provides a fuzzy query method, a device, equipment, a medium and a product, which are used for solving the problem that the existing fuzzy query mode cannot be suitable for fuzzy query with relative quantifier.
The first aspect of the present invention provides a fuzzy query method, including:
acquiring a fuzzy query statement to be identified;
performing semantic recognition on the fuzzy query statement to be recognized and splitting the fuzzy query statement to be recognized into a plurality of terms with fuzzy semantics and a plurality of terms with definite semantics; the semantic-specific words are consistent with entities corresponding to nodes in a graph database; the words with fuzzy semantics comprise relative quantifiers;
determining a preset membership function and a preset membership range threshold value which are matched with each term with the fuzzy semantics;
determining a local definite query range corresponding to the words with fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold;
determining a global explicit query range corresponding to the fuzzy query statement according to each local explicit query range, the explicit semantic terms adjacent to the relative quantifier and other explicit semantic terms;
and querying target data from the graph database according to the global explicit query range.
Further, the method as described above, the other explicit semantic terms include query target entities;
determining a global explicit query range corresponding to the fuzzy query statement according to each local explicit query range, the explicit semantic terms adjacent to the relative quantifier, and the other explicit semantic terms, including:
determining the total number of correlation nodes required for query corresponding to nodes in a graph database matched with a query target entity; wherein the correlation nodes required for query are nodes in the graph database corresponding to the words with definite semantics adjacent to the relative quantifier;
determining the total number of associated nodes required by the query as a local explicit query range of the words with explicit semantics adjacent to the relative quantifier;
determining data contained in nodes in the database corresponding to the other clear semantic terms as local clear query ranges of the other clear semantic terms;
and determining the local explicit query range of each term with fuzzy semantics, the local explicit query range of the term with the fuzzy semantics adjacent to the relative quantifier and the local explicit query range of the term with other explicit semantics as the global explicit query range corresponding to the fuzzy query statement.
Further, the method as described above, the term with fuzzy semantics further includes: a tone operator;
the determining a local explicit query range corresponding to a term with fuzzy semantics according to each preset membership function and a corresponding preset membership range threshold includes:
if the words with the fuzzy semantics are tone operators, determining a preset membership range threshold matched with the tone operators as a first membership range threshold;
determining a first initial query range according to the first membership range threshold and a preset membership function matched with the tone operator;
and performing defuzzification processing on the first initial query range to determine a local explicit query range corresponding to the mood operator.
Further, in the above method, if the term with the fuzzy semantics is a relative quantifier, the determining a local explicit query range corresponding to the term with the fuzzy semantics according to each of the preset membership functions and the corresponding preset membership range threshold includes:
determining a preset membership range threshold matched with the relative quantifier as a second membership range threshold; the preset membership function matched with the relative quantifier is a linear membership function;
determining a second initial query range according to the second membership range threshold and the linear membership function;
and performing defuzzification processing on the second initial query range by adopting a reverse method to determine a local explicit query range corresponding to the relative quantifier.
Further, the method as described above, the term with fuzzy semantics further includes: fuzzification operators;
the determining a local explicit query range corresponding to a term with fuzzy semantics according to each preset membership function and a corresponding preset membership range threshold includes:
if the words with the fuzzy semantics are fuzzification operators, determining a preset membership range threshold matched with the fuzzification operators as a third membership range threshold;
determining matched adjusting parameters and words of definite semantics adjacent to the fuzzification operator in the fuzzy query statement according to a preset membership function matched with the fuzzification operator;
and inputting the adjusting parameters and the clear semantic words adjacent to the fuzzification operator in the fuzzy query statement into a preset membership function matched with the fuzzification operator by taking the third membership range threshold as a boundary condition so as to output a local clear query range corresponding to the fuzzification operator.
Further, in the method as described above, the preset membership function matched with the blurring operator is:
Figure BDA0003330063100000031
wherein x represents a certain value in a local explicit query range corresponding to the fuzzification operator, y represents a term of explicit semantics adjacent to the fuzzification operator, and δ represents an adjustment parameter.
A second aspect of the present invention provides an apparatus for fuzzy query, including:
the acquisition module is used for acquiring the fuzzy query statement to be identified;
the semantic recognition module is used for performing semantic recognition on the fuzzy query statement to be recognized and splitting the fuzzy query statement to be recognized into a plurality of terms with fuzzy semantics and a plurality of terms with definite semantics; the semantic-specific words are consistent with entities corresponding to nodes in a graph database; the words with fuzzy semantics comprise relative quantifiers;
the function determining module is used for determining a preset membership function matched with each term with the fuzzy semantics and a preset membership range threshold;
the local range determining module is used for determining a local definite query range corresponding to the words with the fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold;
a global scope determining module, configured to determine a global explicit query scope corresponding to the fuzzy query statement according to each local explicit query scope, the explicit semantic terms adjacent to the relative quantifier, and the other explicit semantic terms;
and the query module is used for querying the target data from the graph database according to the global explicit query range.
Further, the apparatus as described above, the other semantic-specific terms include query target entities;
the global scope determination module is specifically configured to:
determining the total number of correlation nodes required for query corresponding to nodes in a graph database matched with a query target entity; wherein the correlation nodes required for query are nodes in the graph database corresponding to the words with definite semantics adjacent to the relative quantifier; determining the total number of associated nodes required by the query as a local explicit query range of the words with explicit semantics adjacent to the relative quantifier; determining data contained in nodes in the database corresponding to the other clear semantic terms as local clear query ranges of the other clear semantic terms; and determining the local explicit query range of each term with fuzzy semantics, the local explicit query range of the term with the fuzzy semantics adjacent to the relative quantifier and the local explicit query range of the term with other explicit semantics as the global explicit query range corresponding to the fuzzy query statement.
Further, the apparatus as described above, the term with fuzzy semantics further includes: a tone operator;
the local range determination module is specifically configured to:
if the words with the fuzzy semantics are tone operators, determining a preset membership range threshold matched with the tone operators as a first membership range threshold; determining a first initial query range according to the first membership range threshold and a preset membership function matched with the tone operator; and performing defuzzification processing on the first initial query range to determine a local explicit query range corresponding to the mood operator.
Further, in the apparatus described above, if the term with fuzzy semantics is a relative quantifier, the local range determining module is specifically configured to:
determining a preset membership range threshold matched with the relative quantifier as a second membership range threshold; the preset membership function matched with the relative quantifier is a linear membership function; determining a second initial query range according to the second membership range threshold and the linear membership function; and performing defuzzification processing on the second initial query range by adopting a reverse method to determine a local explicit query range corresponding to the relative quantifier.
Further, the apparatus as described above, the term with fuzzy semantics further includes: fuzzification operators;
the local range determination module is specifically configured to:
if the words with the fuzzy semantics are fuzzification operators, determining a preset membership range threshold matched with the fuzzification operators as a third membership range threshold; determining matched adjusting parameters and words of definite semantics adjacent to the fuzzification operator in the fuzzy query statement according to a preset membership function matched with the fuzzification operator; and inputting the adjusting parameters and the clear semantic words adjacent to the fuzzification operator in the fuzzy query statement into a preset membership function matched with the fuzzification operator by taking the third membership range threshold as a boundary condition so as to output a local clear query range corresponding to the fuzzification operator.
Further, in the apparatus as described above, the preset membership function matched with the blurring operator is:
Figure BDA0003330063100000041
wherein x represents a certain value in a local explicit query range corresponding to the fuzzification operator, y represents a term of explicit semantics adjacent to the fuzzification operator, and δ represents an adjustment parameter.
A third aspect of the present invention provides an electronic device comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the fuzzy query method of any one of the first aspect.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein computer-executable instructions for implementing the fuzzy query method of any one of the first aspects when executed by a processor.
A fifth aspect of the invention provides a computer program product comprising a computer program which, when executed by a processor, implements the fuzzy query method of any one of the first aspects.
The invention provides a fuzzy query method, a device, equipment, a medium and a product, wherein the method comprises the following steps: acquiring a fuzzy query statement to be identified; performing semantic recognition on the fuzzy query statement to be recognized and splitting the fuzzy query statement to be recognized into a plurality of terms with fuzzy semantics and a plurality of terms with definite semantics; the semantic-specific words are consistent with entities corresponding to nodes in a graph database; the words with fuzzy semantics comprise relative quantifiers; determining a preset membership function and a preset membership range threshold value which are matched with each term with the fuzzy semantics; determining a local definite query range corresponding to the words with fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold; determining a global explicit query range corresponding to the fuzzy query statement according to each local explicit query range, the explicit semantic terms adjacent to the relative quantifier and other explicit semantic terms; and querying target data from the graph database according to the global explicit query range. The fuzzy query method of the invention carries out semantic recognition on a fuzzy query sentence to be recognized and splits the fuzzy query sentence into a plurality of words with fuzzy semantics and a plurality of words with definite semantics. And presetting matched membership functions and membership range thresholds aiming at the relative quantifier so as to determine a local explicit query range corresponding to the relative quantifier. And then, determining a global definite query range corresponding to the fuzzy query statement by combining the definite semantic terms adjacent to the relative quantifier, each local definite query range and other definite semantic terms, thereby realizing the fuzzy query containing the relative quantifier.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a diagram of a scenario in which an embodiment of the present invention may be implemented in a fuzzy query method;
FIG. 2 is a flowchart illustrating a fuzzy query method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a fuzzy query method according to a second embodiment of the present invention;
FIG. 4 is a diagram illustrating linear membership functions of a fuzzy query method according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a fuzzy query apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
With the above figures, certain embodiments of the invention have been illustrated and described in more detail below. The drawings and the description are not intended to limit the scope of the inventive concept in any way, but rather to illustrate it by those skilled in the art with reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
For clear understanding of the technical solutions of the present application, first, the related terms related to the technical solutions are explained.
Fuzzy set and membership functions:
by a fuzzy subset a on the domain of discourse U is meant:
Figure BDA0003330063100000062
all have muA(x)∈[0,1]Corresponds to it, whereinA(x) A membership function called fuzzy subset a, or membership degree of x to fuzzy subset a.
I.e. by mapping:
Figure BDA0003330063100000061
a fuzzy subset a of the universe of discourse U is determined.
The membership function is a quantitative description of the fuzzy concept, correctly determines the membership function and is the basis for solving the practical problem by applying the fuzzy set theory. Typical fuzzy distributions are ladder, exponential, normal, linear, power function, sinusoidal, and the like.
Alpha truncation:
membership function mu corresponding to all elements x in universe UA(x) One set in which none of the values of (a) is less than a is called an alpha truncated set of the fuzzy set a.
Where α is the confidence level (threshold). A fuzzy set can be converted into a normal set by using alpha truncation.
Tone operator:
in fuzzy theory, what's in natural language "The terms "comparing", "very", "slightly" etc. are to be regarded as an operator, called the mood operator Hλ. The mood operator limits the fuzzy semantics from the degree, and changes the membership degree of the fuzzy semantics at different levels, for example, the fuzzy semantics 'high' can be expressed as 'very high', 'relatively high', 'high in some point' and the like. The mood operator is a transformation, namely: hλA(X)=[A(X)]λ. When lambda is>When 1, call HλIs a centralized operator. When lambda is<When 1, call HλIs a scatter operator. In general H4Denotes "extremely", H2Denotes "very", H0.75Denotes "comparison", H0.5Indicating a "point".
Words with fuzzy semantics such as "about", "nearly", "almost", etc. are often placed before an exact word or linguistic variable, indicating a fuzzy range, which is called the fuzzification operator.
Degree of conformity of the fuzzy set:
fuzzy queries on fuzzy data can be represented by the degree of conformity of the fuzzy sets. Let A and B be two fuzzy sets on the universe of discourse U, and μAAnd muBRespectively their membership functions. The degree of conformity of a and B defines:
degree of conformity of a ═ u-B ═ max { μ { (u) }A(x),μB(x)}
The coincidence degree of A and B is min [ mu ]A(x),μB(x)}
The degree of conformity of A is 1-muA(x)
For a clearer understanding of the technical solutions of the present application, the prior art solutions are described in detail. When the database is subjected to fuzzy query, the conventional method is to perform fuzzy matching, and the matching needs to be performed in combination with a regular expression and is very limited. Expressions that are ambiguous in natural languages like "relatively high" and "somewhat low" cannot be handled. In order to solve the problem of the fuzzy query, a lot of research is carried out at home and abroad by using a fuzzy mathematical theory.
First, most current research is focused on relational databases, but as the age of big data comes, the amount of data grows exponentially, and the data format starts to move to unstructured data. Relational databases have been difficult to construct, store and process for such enormous amounts of data. The graph database such as the Neo4j graph database does not need to store structured data in a table, but only needs to connect all nodes through relations, store the nodes in the form of a network, and form a large graph through the relations, so that addition and deletion and searching of data nodes and relations are very easy.
However, the current fuzzy query method for the graph database does not consider the relative quantifier such as "most" and "almost no" representing the set proportion, and therefore, the method cannot be applied to the fuzzy query with the relative quantifier.
Therefore, aiming at the problem that the fuzzy query mode in the prior art cannot be suitable for fuzzy query with relative quantifier, the inventor finds that in order to solve the problem, a membership function matched with the relative quantifier can be preset, and after a plurality of researches and trials, the inventor finds that the linear membership function is more suitable for the relative quantifier. Meanwhile, when determining the global explicit query range containing the relative quantifier, the method is different from the fuzzy query method in the prior art.
Specifically, a fuzzy query sentence to be recognized is obtained, and semantic recognition is performed on the fuzzy query sentence to be recognized, so that the fuzzy query sentence to be recognized is split into a plurality of terms with fuzzy semantics and a plurality of terms with definite semantics. Semantic-specific terms are consistent with entities corresponding to nodes in the graph database. Words with fuzzy semantics include relative quantifiers. And then determining a preset membership function and a preset membership range threshold which are matched with each term with fuzzy semantics, and determining a local definite query range corresponding to the term with the fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold. And finally, determining a global definite query range corresponding to the fuzzy query statement according to each local definite query range, the definite semantic terms adjacent to the relative quantifier and other definite semantic terms to query target data, thereby realizing fuzzy query including the relative quantifier.
The inventor proposes a technical scheme of the application based on the creative discovery.
An application scenario of the fuzzy query method provided by the embodiment of the present invention is described below. As shown in fig. 1, 1 is an electronic device, 2 is a terminal device, and 3 is a graph database cluster. The network architecture of the application scenario corresponding to the fuzzy query method provided by the embodiment of the invention comprises the following steps: electronic device 1, terminal device 2 and graph database cluster 3. The database cluster 3 includes a plurality of database databases, such as a database a and a database B … database N, and the terminal device 2 may be an electronic device such as a computer, a server, a mobile phone, etc.
When a user needs to perform a fuzzy query, a fuzzy query sentence, such as an actor including a certain movie in about 1997, can be sent to the electronic device 1 through the terminal device 2. When the electronic device 1 receives the fuzzy query sentence sent by the terminal device 2, performing semantic recognition on the fuzzy query sentence to be recognized, and splitting the fuzzy query sentence to be recognized into a plurality of terms with fuzzy semantics and a plurality of terms with definite semantics. Wherein the semantic-specific terms are consistent with the entities corresponding to the nodes in the graph database. Words with fuzzy semantics include relative quantifiers.
Meanwhile, the electronic device 1 determines a preset membership function and a preset membership range threshold value which are matched with each term with the fuzzy semantics, and determines a local definite query range corresponding to the term with the fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold value. Finally, the electronic device 1 determines a global explicit query range corresponding to the fuzzy query statement according to each local explicit query range, the explicit term adjacent to the relative quantifier, and the other explicit term, so as to query the target data from the map database according to the global explicit query range. Assuming that the target data is located in a graph database a in the graph database cluster 3, the target data will be acquired from the graph database a. After inquiring the target data, the electronic device 1 feeds the target data back to the terminal device 2 for the user to view and process.
The embodiments of the present invention will be described with reference to the accompanying drawings.
Fig. 2 is a schematic flow chart of an fuzzy query method according to a first embodiment of the present invention, and as shown in fig. 2, in this embodiment, an execution subject of the embodiment of the present invention is a fuzzy query apparatus, and the fuzzy query apparatus may be integrated in an electronic device. The fuzzy query method provided by the embodiment includes the following steps:
the graph database stores unstructured data, and based on the directed graph theory, the graph database has three elements:
and (3) node: nodes can define attributes and types for individual records within graph data.
The relationship is as follows: one edge connecting nodes, there is a direction.
The attributes are as follows: also called values of data, where both nodes and relationships may have attributes.
Step S101, acquiring a fuzzy query statement to be identified.
In this embodiment, the fuzzy query sentence is, for example, about 1997 movies, about 40-year-old actors who have played about 5 movies more, and most music is movies composed by a certain music production company. The fuzzy query statement to be recognized may be input by a user through a user terminal, or directly input through an electronic device that may execute a fuzzy query method, which is not limited in this embodiment.
Step S102, performing semantic recognition on the fuzzy query sentence to be recognized, and splitting the fuzzy query sentence to be recognized into a plurality of terms with fuzzy semantics and a plurality of terms with definite semantics. Semantic-specific terms are consistent with entities corresponding to nodes in the graph database. Words with fuzzy semantics include relative quantifiers.
In this embodiment, semantic recognition is performed on the fuzzy query statement to be recognized, so that each term in the fuzzy query statement, for example, a movie in about 1997, can be determined, and a term with fuzzy semantics, a term with explicit semantics, a movie in 1997, can be recognized. If the query sentence is a fuzzy query sentence containing relative terms, such as a film written by a certain music production company for the vast majority of music, the term music with fuzzy semantics and the most significant relative terms, a certain music production company and a film can be identified.
Data are stored in the graph database according to nodes, and words with definite semantics are generally consistent with entities corresponding to the nodes in the graph database, namely, the movies, the music and a certain music production company can be stored as the node data of the graph database.
And step S103, determining preset membership functions and preset membership range thresholds matched with the words with the fuzzy semantics.
In this embodiment, the words with fuzzy semantics are divided into a plurality of types, such as a fuzzification operator, a mood operator, a relative quantifier, and the like, and a matched membership function is preset for each word with fuzzy semantics. If the tone operator can adopt a parabola-type membership function, the fuzzification operator can adopt a similar fuzzy relation function, and the relative quantifier can adopt a linear membership function, etc. Meanwhile, the same words with fuzzy semantics can also adopt different membership functions, and the numerical values of the membership functions can also be different.
The preset membership range threshold is a range for determining a membership for the membership function, and since the value of the membership function is between 0 and 1, when the preset membership range threshold is set to be 0.5, the range of the membership function less than or equal to 0.5 represents an alpha truncated set of the fuzzy set. The local unambiguous query range corresponding to the term with fuzzy semantics can be determined by the alpha intercept.
And step S104, determining a local definite query range corresponding to the words with fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold.
According to each preset membership function and the corresponding preset membership range threshold, an alpha cut set representing the fuzzy set can be determined, and the alpha cut set is assumed to be the range of the membership function less than or equal to 0.5, and the membership function is mumost(x) 2x, it may be determined that x is less than or equal to 0.25 is the determined local unambiguous query range.
Step S105, determining a global definite query range corresponding to the fuzzy query sentence according to each local definite query range, the definite semantic terms adjacent to the relative quantifier and other definite semantic terms.
In this embodiment, after each local explicit query range is determined, the data of the graph database node corresponding to the semantic term can be obtained by the semantic term, so as to determine the data range in the graph database to be queried, that is, the global explicit query range. Meanwhile, when the words with fuzzy semantics contain relative quantifier, the data range may not be stored as nodes in the graph database, and the global explicit query range to be searched may need to acquire partial data from the nodes of the graph database and combine the partial data, so as to obtain the data range in the graph database to be queried. Thus, there is a need to combine explicit terms adjacent to relative quantifiers with other explicit terms to determine a global explicit query scope.
For example, the fuzzy query sentence is a movie with most of actors having experience, the database stores data according to two nodes of the actors and the movie, most of the relative quantifier needs to consider direct association between the actors and the movie, that is, the number of the actors in the movie needs to be considered, but the database does not have the data nodes of the actors in the movie, so that data corresponding to the number of the actors needs to be determined through the two nodes of the actors and the movie, and the global clear query scope is determined.
And step S106, inquiring target data from the graph database according to the global explicit inquiry range.
In this embodiment, after determining the global explicit query scope, for example, in 1990 and 1995, movies with three actors can be queried from the graph database through the global explicit query scope.
The embodiment of the invention provides a fuzzy query method, which comprises the following steps: and acquiring the fuzzy query statement to be identified. And performing semantic recognition on the fuzzy query sentence to be recognized, and splitting the fuzzy query sentence to be recognized into a plurality of words with fuzzy semantics and a plurality of words with definite semantics. Semantic-specific terms are consistent with entities corresponding to nodes in the graph database. Words with fuzzy semantics include relative quantifiers. And determining a preset membership function and a preset membership range threshold value which are matched with each term with fuzzy semantics. And determining a local definite query range corresponding to the words with fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold. And determining a global definite query range corresponding to the fuzzy query statement according to each local definite query range, the definite semantic terms adjacent to the relative quantifier and other definite semantic terms. Target data is queried from a graph database according to a global explicit query scope.
The fuzzy query method of the invention carries out semantic recognition on a fuzzy query sentence to be recognized and splits the fuzzy query sentence into a plurality of words with fuzzy semantics and a plurality of words with definite semantics. And presetting matched membership functions and membership range thresholds aiming at the relative quantifier so as to determine a local explicit query range corresponding to the relative quantifier. Then, the terms with definite semantics adjacent to the relative quantifier, each local definite query range and other terms with definite semantics are combined to determine a global definite query range corresponding to the fuzzy query statement, so that the fuzzy query including the relative quantifier is realized.
Fig. 3 is a schematic flow chart of an fuzzy query method according to a second embodiment of the present invention, and as shown in fig. 3, the fuzzy query method according to this embodiment is further refined based on the fuzzy query method according to the previous embodiment of the present invention. The fuzzy query method provided by the present embodiment includes the following steps.
Step S201, a fuzzy query statement to be identified is acquired.
In this embodiment, the implementation manner of step 201 is similar to that of step 101 in the previous embodiment of the present invention, and is not described in detail here.
Step S202, performing semantic recognition on the fuzzy query sentence to be recognized, and splitting the fuzzy query sentence to be recognized into a plurality of terms with fuzzy semantics and a plurality of terms with definite semantics.
In this embodiment, the implementation manner of step 202 is similar to that of step 102 in the previous embodiment of the present invention, and is not described herein again.
Step S203, determining preset membership functions and preset membership range thresholds matched with the words with fuzzy semantics.
In this embodiment, the implementation manner of step 203 is similar to that of step 103 in the previous embodiment of the present invention, and is not described in detail here.
And S204, determining a local definite query range corresponding to the words with fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold.
In this embodiment, the implementation manner of step 204 is similar to that of step 104 in the previous embodiment of the present invention, and is not described in detail here.
Words with fuzzy semantics may include mood operators, relative quantifiers, obfuscation operators, and the like.
Optionally, in this embodiment, if the word with the fuzzy semantics is a tone operator, determining a preset membership range threshold matched with the tone operator as the first membership range threshold.
And determining a first initial query range according to the first membership range threshold and a preset membership function matched with the tone operator.
And performing defuzzification processing on the first initial query range to determine a local definite query range corresponding to the tone operator.
Meanwhile, if the words with the fuzzy semantics are relative quantifiers, determining a preset membership range threshold matched with the relative quantifiers as a second membership range threshold. The preset membership functions matched with the relative quantifier are linear membership functions.
And determining a second initial query range according to the second membership range threshold and the linear membership function.
And performing defuzzification processing on the second initial query range by adopting a reverse method to determine a local definite query range corresponding to the relative quantifier.
And if the words with the fuzzy semantics are fuzzification operators, determining a preset membership range threshold value matched with the fuzzification operators as a third membership range threshold value.
And determining the matched adjusting parameters and the words with definite semantics adjacent to the fuzzification operator in the fuzzy query statement according to the preset membership functions matched with the fuzzification operator.
And inputting the adjusting parameters and the words with definite semantics adjacent to the fuzzification operator in the fuzzy query statement into a preset membership function matched with the fuzzification operator by taking the third membership range threshold as a boundary condition so as to output a local definite query range corresponding to the fuzzification operator.
Illustratively, a movie with a fuzzy query statement of about 1998 and a vast majority of actors experienced is exemplified.
Semantic recognition of the fuzzy query sentence can determine that the words with fuzzy semantics are "about", "most", "very experienced", and the words with clear semantics are "1998", "actor", "movie".
"about" belongs to the fuzzification operator such as "movie shown in about 1998", where 1998 is a specific value, but adding about fuzzifies this word. For the fuzzification operator of "about," the range of the fuzzification can be adjusted using a similar fuzzy relation function in the membership function. The similar fuzzy relation function is as follows:
Figure BDA0003330063100000121
wherein x represents a certain value in the local explicit query range corresponding to the fuzzification operator, y represents the explicit semantic word adjacent to the fuzzification operator, i.e. 1998, and δ represents the tuning parameter (δ > 0).
Assuming that the membership range threshold here is 0.5, i.e. E (x, y) ≧ 0.5, the specific range calculated is:
Figure BDA0003330063100000122
in this example, assume δ is 10, the queryThe year is about 1998, and the fuzzy query can be converted into a local unambiguous query ranging from 1990 to 2006.
"most" belongs to relative quantifier, for relative linguistic quantifier, a simple linear membership function is used, as shown in fig. 4, with the horizontal axis being proportion and the vertical axis being degree of membership:
Figure BDA0003330063100000123
where x represents a ratio satisfying the condition in the grouping, it is generally considered that the ratio exceeds 5/6 and must be "most" and the degree of membership is set to 1. Selecting a membership range threshold value alpha as 0.9, and defuzzifying by an inverse method, so that the fuzzy condition of 'most' can be converted into a local definite query range: x is more than or equal to 0.8.
"very empirical" is a mood operator, using a parabolic membership function:
Figure BDA0003330063100000131
where x represents the total number of movies the actor has participated in, it is generally considered that if the total number of movies participated in is more than 4, it is certain that "it is empirical", and thus the membership degree is set to 1. The threshold α is chosen to be 16/25, and by defuzzification using the inverse method, the "very empirical" result can be converted into a local unambiguous query range: x is more than or equal to 3.
The local explicit query scope obtained from the above three parts and the final query scope obtained by combining terms with explicit semantics, that is, the global explicit query scope is:
in the year of the epilogue, between 1990 and 2006, the actors now have performed at least three movies, grouped with movies having a percentage equal to or greater than 0.8 that meet the screening criteria.
Since the attribute of the total number of actors is not contained in the database, the attribute is needed to be used in the query. In this embodiment, the graph database is illustrated as Neo4 j. In the Neo4j graph database, since the Cypher statement does not support nested queries like SQL statements, the data of the total number of actors corresponding to a movie can be obtained by using the length statements to obtain the number of associations between the movie and the actors, and then the value of the attribute is added in batches by using the SET statement.
Finally, the required data is queried in the graph database by a global explicit query scope.
So far, by splitting a complex fuzzy query statement and defuzzifying the complex fuzzy query statement based on different membership functions and alpha cut sets, a global definite query range of the fuzzy query statement is obtained. By grouping and aggregating the WITH sentences of the graph database and setting the attribute in SET (Single-SET event) batch, the problem that Cypher sentences in the graph database do not support non-node nested query is solved, and thus the grouping fuzzy query of the Neo4j graph database is realized.
Step S205, determining the total number of the correlation nodes needed for query corresponding to the nodes in the graph database matched with the query target entity. Wherein, other words with clear semantics comprise: and querying the target entity. The required associated nodes for query are nodes in the graph database corresponding to the words with definite semantics adjacent to the relative quantifier.
In this embodiment, the query target entity is an entity that the user wants to query, for example, if the user wants to query bicycles produced in 81 years, the bicycles are the query target entity.
If the fuzzy query statement is a bicycle with the color of green in most bicycle areas, the query target entity is a bicycle, and data are stored in the map database according to the nodes of the bicycles. The total number of the required associated nodes is queried as the bicycle area color.
Step S206, determining the total number of the associated nodes required by the query as a local explicit query range of the words with explicit semantics adjacent to the relative quantifier.
In this embodiment, the relative quantifier represents a proportional relationship, and therefore, the data range to be queried includes a data attribute of the number of association nodes required for querying, which corresponds to the query target entity, and therefore, the total number of association nodes required for querying is determined as a local explicit query range of an explicit term adjacent to the relative quantifier.
Step S207, determining data contained in nodes in the database corresponding to other clear semantic terms as local clear query ranges of other clear semantic terms.
Step S208, determining the local explicit query range of each term with fuzzy semantics, the local explicit query range of the term with explicit semantics adjacent to the relative quantifier and the local explicit query range of the term with other explicit semantics as the global explicit query range corresponding to the fuzzy query statement.
In this embodiment, the global explicit query range is composed of a local explicit query range of terms with fuzzy semantics and a local explicit query range of terms with explicit semantics.
Step S209, query the target data from the graph database according to the global explicit query scope.
In this embodiment, the implementation manner of step 209 is similar to that of step 106 in the previous embodiment of the present invention, and is not described here again.
Fig. 5 is a schematic structural diagram of an fuzzy query apparatus according to a third embodiment of the present invention, as shown in fig. 5, in this embodiment, the fuzzy query apparatus 300 includes:
an obtaining module 301, configured to obtain a fuzzy query statement to be identified.
The semantic recognition module 302 is configured to perform semantic recognition on the to-be-recognized fuzzy query statement and split the to-be-recognized fuzzy query statement into a plurality of words with fuzzy semantics and a plurality of words with explicit semantics. Semantic-specific terms are consistent with entities corresponding to nodes in the graph database. Words with fuzzy semantics include relative quantifiers.
And the function determining module 303 is configured to determine a preset membership function and a preset membership range threshold, where the preset membership function and the preset membership range threshold are matched with each term with the fuzzy semantics.
A local range determining module 304, configured to determine a local explicit query range corresponding to the term with the fuzzy semantics according to each preset membership function and the corresponding preset membership range threshold.
A global scope determining module 305, configured to determine a global explicit query scope corresponding to the fuzzy query statement according to each local explicit query scope, the explicit terms adjacent to the relative quantifier, and other explicit terms.
And the query module 306 is used for querying the target data from the graph database according to the global explicit query range.
The fuzzy query apparatus provided in this embodiment may execute the technical solution of the method embodiment shown in fig. 2, and the implementation principle and technical effect thereof are similar to those of the method embodiment shown in fig. 2, and are not described in detail herein.
The fuzzy query device provided by the invention further refines the fuzzy query device on the basis of the fuzzy query device provided by the previous embodiment.
Optionally, in this embodiment, other terms with definite semantics include the query target entity.
The global scope determination module is specifically configured to:
and determining the total number of the correlation nodes required by the query corresponding to the nodes in the graph database matched with the query target entity. The related nodes required for query are nodes in the graph database corresponding to the words with definite semantics adjacent to the relative quantifier. The total number of associated nodes required for the query is determined as the local unambiguous query range of the terms of unambiguous semantics adjacent to the relative quantifier. And determining data contained in nodes in the database corresponding to other clear semantic terms as local clear query ranges of other clear semantic terms. And determining the local explicit query range of each term with fuzzy semantics, the local explicit query range of the term with the fuzzy semantics adjacent to the relative quantifier and the local explicit query range of the term with other explicit semantics as the global explicit query range corresponding to the fuzzy query statement.
Optionally, in this embodiment, the term with fuzzy semantics further includes: and (5) tone operators.
The local range determination module is specifically configured to:
and if the words with the fuzzy semantics are the tone operators, determining a preset membership range threshold matched with the tone operators as a first membership range threshold. And determining a first initial query range according to the first membership range threshold and a preset membership function matched with the tone operator. And performing defuzzification processing on the first initial query range to determine a local definite query range corresponding to the tone operator.
Optionally, in this embodiment, if the word with the fuzzy semantics is a relative quantifier, the local range determining module is specifically configured to:
and determining the preset membership range threshold matched with the relative quantifier as a second membership range threshold. The preset membership functions matched with the relative quantifier are linear membership functions. And determining a second initial query range according to the second membership range threshold and the linear membership function. And performing defuzzification processing on the second initial query range by adopting a reverse method to determine a local definite query range corresponding to the relative quantifier.
Optionally, in this embodiment, the term with fuzzy semantics further includes: and (5) blurring an operator.
The local range determination module is specifically configured to:
and if the words with the fuzzy semantics are fuzzification operators, determining a preset membership range threshold value matched with the fuzzification operators as a third membership range threshold value. And determining the matched adjusting parameters and the words with definite semantics adjacent to the fuzzification operator in the fuzzy query statement according to the preset membership functions matched with the fuzzification operator. And inputting the adjusting parameters and the words with definite semantics adjacent to the fuzzification operator in the fuzzy query statement into a preset membership function matched with the fuzzification operator by taking the third membership range threshold as a boundary condition so as to output a local definite query range corresponding to the fuzzification operator.
Optionally, in this embodiment, the preset membership function matched with the fuzzification operator is:
Figure BDA0003330063100000151
wherein x represents a certain value in a local explicit query range corresponding to the fuzzification operator, y represents a term of explicit semantics adjacent to the fuzzification operator, and δ represents an adjustment parameter.
The fuzzy query apparatus provided in this embodiment may execute the technical solutions of the method embodiments shown in fig. 2 to fig. 4, and the implementation principles and technical effects thereof are similar to those of the method embodiments shown in fig. 2 to fig. 4, and are not described in detail herein.
The invention also provides an electronic device, a computer readable storage medium and a computer program product according to the embodiments of the invention.
As shown in fig. 6, fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. Electronic devices are intended for various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, blade servers, mainframes, and other appropriate computers. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 6, the electronic apparatus includes: a processor 401, a memory 402. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device.
The memory 402 is a non-transitory computer readable storage medium provided by the present invention. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the fuzzy query method provided by the present invention. The non-transitory computer-readable storage medium of the present invention stores computer instructions for causing a computer to execute the fuzzy query method provided by the present invention.
The memory 402, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the fuzzy query method in the embodiment of the present invention (for example, the obtaining module 301, the semantic identifying module 302, the function determining module 303, the local scope determining module 304, the global scope determining module 305, and the query module 306 shown in fig. 5). The processor 401 executes various functional applications and data processing of the electronic device by running non-transitory software programs, instructions and modules stored in the memory 402, that is, implements the fuzzy query method in the above method embodiments.
Meanwhile, the present embodiment also provides a computer product, and when instructions in the computer product are executed by a processor of the electronic device, the electronic device is enabled to execute the fuzzy query method of the above embodiment.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the embodiments of the invention following, in general, the principles of the embodiments of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the embodiments of the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of embodiments of the invention being indicated by the following claims.
It is to be understood that the embodiments of the present invention are not limited to the precise arrangements described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of embodiments of the invention is limited only by the appended claims.

Claims (10)

1.一种模糊查询方法,其特征在于,包括:1. a fuzzy query method, is characterized in that, comprises: 获取待识别的模糊查询语句;Obtain the fuzzy query statement to be identified; 对所述待识别的模糊查询语句进行语义识别并将所述待识别的模糊查询语句拆分为多个具有模糊语义的词语及多个明确语义的词语;所述明确语义的词语与图数据库中的节点对应的实体一致;所述具有模糊语义的词语包括相对量词;Perform semantic recognition on the fuzzy query statement to be recognized and split the fuzzy query statement to be recognized into a plurality of words with fuzzy semantics and a plurality of words with clear semantics; the words with clear semantics are the same as those in the graph database. The entities corresponding to the nodes are consistent; the words with fuzzy semantics include relative quantifiers; 确定与各所述具有模糊语义的词语匹配的预设隶属函数和预设隶属度范围阈值;determining a preset membership function and a preset membership range threshold matching each of the words with fuzzy semantics; 根据各所述预设隶属函数和对应的预设隶属度范围阈值确定对应具有模糊语义的词语的局部明确查询范围;Determine a local clear query range corresponding to a word with fuzzy semantics according to each of the preset membership functions and the corresponding preset membership range threshold; 根据各所述局部明确查询范围、与所述相对量词相邻的明确语义的词语及其他明确语义的词语确定模糊查询语句对应的全局明确查询范围;Determine the global explicit query scope corresponding to the fuzzy query statement according to each of the local explicit query scopes, words with clear semantics adjacent to the relative quantifiers, and other words with clear semantics; 根据所述全局明确查询范围从图数据库中查询目标数据。The target data is queried from the graph database according to the global explicit query scope. 2.根据权利要求1所述的方法,其特征在于,所述其他明确语义的词语包括:查询目标实体;2. The method according to claim 1, wherein the other words with clear semantics comprise: query target entity; 所述根据各所述局部明确查询范围、与所述相对量词相邻的明确语义的词语及其他明确语义的词语确定模糊查询语句对应的全局明确查询范围,包括:Determining the global explicit query scope corresponding to the fuzzy query statement according to each of the local explicit query scopes, words with explicit semantics adjacent to the relative quantifiers, and other words with explicit semantics includes: 确定查询目标实体匹配的图数据库中的节点所对应的查询所需关联节点的总数量;其中,查询所需关联节点为与所述相对量词相邻的明确语义的词语所对应的图数据库中的节点;Determine the total number of associated nodes required for the query corresponding to the nodes in the graph database matched by the query target entity; wherein, the associated nodes required for the query are those in the graph database corresponding to the words with clear semantics adjacent to the relative quantifiers. node; 将所述查询所需关联节点的总数量确定为与所述相对量词相邻的明确语义的词语的局部明确查询范围;Determining the total number of associated nodes required by the query as the local explicit query range of words with explicit semantics adjacent to the relative quantifier; 将所述其他明确语义的词语对应图数据库中的节点中包含的数据确定为其他明确语义的词语的局部明确查询范围;Determining the data contained in the nodes in the corresponding graph database of the words with other explicit semantics as the local explicit query scope of the words with other explicit semantics; 将各具有模糊语义的词语的局部明确查询范围、与所述相对量词相邻的明确语义的词语的局部明确查询范围和其他明确语义的词语的局部明确查询范围确定为模糊查询语句对应的全局明确查询范围。Determine the local explicit query range of each word with fuzzy semantics, the local explicit query range of words with explicit semantics adjacent to the relative quantifier, and the local explicit query range of other words with explicit semantics as the global explicit query corresponding to the fuzzy query statement. Query scope. 3.根据权利要求2所述的方法,其特征在于,所述具有模糊语义的词语还包括:语气算子;3. The method according to claim 2, wherein the words with fuzzy semantics further comprise: a mood operator; 所述根据各所述预设隶属函数和对应的预设隶属度范围阈值确定对应具有模糊语义的词语的局部明确查询范围,包括:Determining the local clear query range corresponding to words with fuzzy semantics according to each of the preset membership functions and the corresponding preset membership range thresholds, including: 若所述具有模糊语义的词语为语气算子,则将与所述语气算子匹配的预设隶属度范围阈值确定为第一隶属度范围阈值;If the word with fuzzy semantics is a mood operator, determining a preset membership range threshold matching the mood operator as the first membership range threshold; 根据所述第一隶属度范围阈值和与语气算子匹配的预设隶属函数确定第一初始查询范围;determining a first initial query range according to the first membership range threshold and a preset membership function matching the tone operator; 对所述第一初始查询范围进行去模糊化处理,以确定所述语气算子对应的局部明确查询范围。Defuzzification processing is performed on the first initial query scope to determine a local explicit query scope corresponding to the tone operator. 4.根据权利要求3所述的方法,其特征在于,若所述具有模糊语义的词语为相对量词,则所述根据各所述预设隶属函数和对应的预设隶属度范围阈值确定对应具有模糊语义的词语的局部明确查询范围,包括:4. The method according to claim 3, characterized in that, if the words with fuzzy semantics are relative quantifiers, then according to each of the preset membership functions and the corresponding preset membership degree range threshold Local explicit query scope for terms with fuzzy semantics, including: 将与所述相对量词匹配的预设隶属度范围阈值确定为第二隶属度范围阈值;与所述相对量词匹配的预设隶属函数为线性隶属函数;Determining the preset membership range threshold matched with the relative quantifier as the second membership range threshold; the preset membership function matched with the relative quantifier is a linear membership function; 根据所述第二隶属度范围阈值和所述线性隶属函数确定第二初始查询范围;determining a second initial query range according to the second membership range threshold and the linear membership function; 采用反向法对所述第二初始查询范围进行去模糊化处理,以确定所述相对量词对应的局部明确查询范围。The second initial query scope is de-fuzzified by a reverse method to determine a local explicit query scope corresponding to the relative quantifier. 5.根据权利要求4所述的方法,其特征在于,所述具有模糊语义的词语还包括:模糊化算子;5. The method according to claim 4, wherein the words with fuzzy semantics further comprise: a fuzzification operator; 所述根据各所述预设隶属函数和对应的预设隶属度范围阈值确定对应具有模糊语义的词语的局部明确查询范围,包括:Determining the local clear query range corresponding to words with fuzzy semantics according to each of the preset membership functions and the corresponding preset membership range thresholds, including: 若所述具有模糊语义的词语为模糊化算子,则将与所述模糊化算子匹配的预设隶属度范围阈值确定为第三隶属度范围阈值;If the word with fuzzy semantics is a fuzzification operator, determining a preset membership range threshold that matches the fuzzification operator as a third membership range threshold; 根据与所述模糊化算子匹配的预设隶属函数确定匹配的调节参数以及所述模糊查询语句中与所述模糊化算子相邻的明确语义的词语;Determine matching adjustment parameters and words with clear semantics adjacent to the fuzzification operator in the fuzzy query statement according to the preset membership function matched with the fuzzification operator; 以所述第三隶属度范围阈值为边界条件,将所述调节参数、所述模糊查询语句中与所述模糊化算子相邻的明确语义的词语输入与所述模糊化算子匹配的预设隶属函数中,以输出所述模糊化算子对应的局部明确查询范围。Taking the third membership degree range threshold as a boundary condition, the adjustment parameter, the words with clear semantics adjacent to the fuzzification operator in the fuzzy query statement are input to the prediction matching the fuzzification operator. Set the membership function to output the local explicit query range corresponding to the fuzzification operator. 6.根据权利要求5所述的方法,其特征在于,所述与所述模糊化算子匹配的预设隶属函数为:6. The method according to claim 5, wherein the preset membership function matched with the fuzzification operator is:
Figure FDA0003330063090000021
Figure FDA0003330063090000021
其中,x代表模糊化算子对应的局部明确查询范围中的某个值,y代表与模糊化算子相邻的明确语义的词语,δ代表调节参数。Among them, x represents a certain value in the local explicit query range corresponding to the fuzzification operator, y represents a word with clear semantics adjacent to the fuzzification operator, and δ represents an adjustment parameter.
7.一种模糊查询装置,其特征在于,包括:7. A fuzzy query device, characterized in that, comprising: 获取模块,用于获取待识别的模糊查询语句;The acquisition module is used to acquire the fuzzy query statement to be identified; 语义识别模块,用于对所述待识别的模糊查询语句进行语义识别并将所述待识别的模糊查询语句拆分为多个具有模糊语义的词语及多个明确语义的词语;所述明确语义的词语与图数据库中的节点对应的实体一致;所述具有模糊语义的词语包括相对量词;A semantic recognition module is used to perform semantic recognition on the fuzzy query statement to be recognized and split the fuzzy query statement to be recognized into a plurality of words with fuzzy semantics and a plurality of words with clear semantics; the clear semantics The words are consistent with the entities corresponding to the nodes in the graph database; the words with fuzzy semantics include relative quantifiers; 函数确定模块,用于确定与各所述具有模糊语义的词语匹配的预设隶属函数和预设隶属度范围阈值;a function determination module, configured to determine a preset membership function and a preset membership range threshold matching each of the words with fuzzy semantics; 局部范围确定模块,用于根据各所述预设隶属函数和对应的预设隶属度范围阈值确定对应具有模糊语义的词语的局部明确查询范围;a local range determination module, configured to determine a local clear query range corresponding to a word with fuzzy semantics according to each of the preset membership functions and the corresponding preset membership range threshold; 全局范围确定模块,用于根据各所述局部明确查询范围、与所述相对量词相邻的明确语义的词语及其他明确语义的词语确定模糊查询语句对应的全局明确查询范围;a global scope determination module, configured to determine the global explicit query scope corresponding to the fuzzy query statement according to each of the local explicit query scopes, words with clear semantics adjacent to the relative quantifiers, and other words with clear semantics; 查询模块,用于根据所述全局明确查询范围从图数据库中查询目标数据。The query module is configured to query target data from the graph database according to the global explicit query scope. 8.一种电子设备,其特征在于,包括:处理器,以及与所述处理器通信连接的存储器;8. An electronic device, comprising: a processor, and a memory communicatively connected to the processor; 所述存储器存储计算机执行指令;the memory stores computer-executable instructions; 所述处理器执行所述存储器存储的计算机执行指令,以实现如权利要求1至6任一项所述的模糊查询方法。The processor executes the computer-executable instructions stored in the memory to implement the fuzzy query method of any one of claims 1 to 6. 9.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现如权利要求1至6任一项所述的模糊查询方法。9. A computer-readable storage medium, characterized in that, computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement any one of claims 1 to 6 The fuzzy query method described. 10.一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时实现如权利要求1至6任一项所述的模糊查询方法。10. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the fuzzy query method according to any one of claims 1 to 6 is implemented.
CN202111277743.XA 2021-10-29 2021-10-29 Fuzzy query method, device, equipment, medium and product Active CN114020806B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111277743.XA CN114020806B (en) 2021-10-29 2021-10-29 Fuzzy query method, device, equipment, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111277743.XA CN114020806B (en) 2021-10-29 2021-10-29 Fuzzy query method, device, equipment, medium and product

Publications (2)

Publication Number Publication Date
CN114020806A true CN114020806A (en) 2022-02-08
CN114020806B CN114020806B (en) 2024-12-20

Family

ID=80059101

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111277743.XA Active CN114020806B (en) 2021-10-29 2021-10-29 Fuzzy query method, device, equipment, medium and product

Country Status (1)

Country Link
CN (1) CN114020806B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040024755A1 (en) * 2002-08-05 2004-02-05 Rickard John Terrell System and method for indexing non-textual data
CN103020230A (en) * 2012-12-14 2013-04-03 中国科学院声学研究所 Semantic fuzzy matching method
CN103268498A (en) * 2013-04-21 2013-08-28 郑州轻工业学院 A method for semantic understanding of fuzzy images with regions of interest
CN110333992A (en) * 2019-05-31 2019-10-15 平安科技(深圳)有限公司 Service performance analysis method, device, computer equipment and storage medium
CN111651570A (en) * 2020-05-13 2020-09-11 深圳追一科技有限公司 Text sentence processing method and device, electronic equipment and storage medium
CN112559597A (en) * 2020-12-16 2021-03-26 浪潮云信息技术股份公司 Method and device for querying fuzzy condition

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040024755A1 (en) * 2002-08-05 2004-02-05 Rickard John Terrell System and method for indexing non-textual data
CN103020230A (en) * 2012-12-14 2013-04-03 中国科学院声学研究所 Semantic fuzzy matching method
CN103268498A (en) * 2013-04-21 2013-08-28 郑州轻工业学院 A method for semantic understanding of fuzzy images with regions of interest
CN110333992A (en) * 2019-05-31 2019-10-15 平安科技(深圳)有限公司 Service performance analysis method, device, computer equipment and storage medium
CN111651570A (en) * 2020-05-13 2020-09-11 深圳追一科技有限公司 Text sentence processing method and device, electronic equipment and storage medium
CN112559597A (en) * 2020-12-16 2021-03-26 浪潮云信息技术股份公司 Method and device for querying fuzzy condition

Also Published As

Publication number Publication date
CN114020806B (en) 2024-12-20

Similar Documents

Publication Publication Date Title
CN111782965B (en) Intention recommendation method, device, equipment and storage medium
JP5654051B2 (en) Context query
Nabli et al. Efficient cloud service discovery approach based on LDA topic modeling
CN109033314A (en) The Query method in real time and system of extensive knowledge mapping in the case of memory-limited
CN112598128B (en) Model training and online analysis processing method and device
Zhang et al. Reducing uncertainty of schema matching via crowdsourcing with accuracy rates
CN108399213B (en) User-oriented personal file clustering method and system
CN112765282A (en) Data online analysis processing method, device, equipment and storage medium
Liu et al. Enhanced word embedding similarity measures using fuzzy rules for query expansion
JPH11161670A (en) Method, device, and system for information filtering
CN109086376A (en) More querying methods and device based on SPARQL query language
JP2018180789A (en) Query clustering device, method, and program
CN116738065A (en) Enterprise searching method, device, equipment and storage medium
TW202001621A (en) Corpus generating method and apparatus, and human-machine interaction processing method and apparatus
Bernstein et al. Imprecise RDQL: towards generic retrieval in ontologies using similarity joins
CN115934724A (en) Method for constructing database index, retrieval method, device, equipment and medium
CN111666452B (en) Method and apparatus for clustering videos
CN114020806A (en) Fuzzy query method, device, equipment, medium and product
CN109460506B (en) A User Demand-Driven Resource Matching Push Method
Coelho et al. Semantic similarity for mobile application recommendation under scarce user data
CN117874204A (en) Knowledge question-answering method, system, storage medium and computer equipment
CN111324701B (en) Content supplement method, content supplement device, computer equipment and storage medium
Rana et al. An analysis of semantic heterogeneity issues and their countermeasures prevailing in semantic web
Swathi et al. Reformulation of natural language queries on source code base using NLP techniques
Mohotti et al. An efficient ranking-centered density-based document clustering method

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