A context-bound policy query method, device and electronic equipment

By judging the relevance of user query requests and correcting query keywords in the policy query system, the problem of inaccurate query results in existing technologies has been solved, and more accurate policy query results have been achieved.

CN117033580BActive Publication Date: 2026-02-17QIZHI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310884690.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-17
Publication Date
2026-02-17
Estimated Expiration
2043-07-17

AI Technical Summary

Technical Problem

The existing policy query system cannot provide related answers to multiple consecutive questions, resulting in inaccurate query results.

Method used

By determining the relevance between user query requests, a suitable relevance algorithm is selected based on text length, sentence structure, and part-of-speech count. This process corrects query keywords and optimizes query results by incorporating user account information.

Benefits of technology

It enables correlated answers to multiple consecutive questions, improving the accuracy of policy queries and the matching degree of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117033580B_ABST
    Figure CN117033580B_ABST
Patent Text Reader

Abstract

The application provides a context-based policy query method and device and electronic equipment, which are applied to a server. The method comprises the following steps: in response to a policy query operation of a user equipment, the policy query operation comprises a first query request; determining the sentence correlation degree between the first query request and a second query request, the second query request being a query request sent by the user before the first query request; obtaining the historical keywords of the second query request; modifying the query keywords of the first query request according to the sentence correlation degree and the historical keywords to obtain modified keywords; and obtaining a policy query result in a preset policy database according to the modified keywords and the account information corresponding to the user equipment. By using the above method, the problem that the relevance between multiple continuous questions cannot be answered in the process of policy query is solved, so that the user who performs the policy query cannot obtain more accurate query results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of information retrieval, and in particular to a policy retrieval method, apparatus, and electronic device based on context. Background Technology

[0002] With the increasing number of support policies issued by government departments for enterprises, companies need to search for various policies that meet their application requirements, taking into account their own conditions. When searching for policies, users' questions often revolve around a specific policy theme. The policy search process typically involves the system providing answers based on the user's question and the keywords most closely related to that question.

[0003] However, a single query result often cannot meet the user's questioning needs. During the entire policy query process, it is impossible to ask questions continuously or achieve related answers between multiple consecutive questions, which prevents users from obtaining more accurate query results.

[0004] Currently, there is an urgent need for a policy query method, device, and electronic device that combines context to solve the problems existing in current technology. Summary of the Invention

[0005] This application provides a policy query method, apparatus, and electronic device that combines context to address the problem that, during the policy query process, a single query result often cannot meet the user's questioning needs, and cannot achieve a related answer between multiple consecutive questions, resulting in users not being able to obtain more accurate query results.

[0006] The first aspect of this application provides a policy query method that combines context and is applied in a server. The method includes: responding to a policy query operation of a user device, the policy query operation including a first query request; determining the statement relevance between the first query request and a second query request, wherein the second query request is a query request sent by the user before the first query request; obtaining historical keywords of the second query request; confirming that the second query request and the first query request are related when the statement relevance is greater than or equal to a preset statement relevance threshold; limiting the query scope of the query keywords based on the relationship between the historical keywords and the query keywords to obtain corrected keywords; and obtaining policy query results in a preset policy database based on the corrected keywords and the account information corresponding to the user device.

[0007] This application employs the aforementioned method to determine the correlation between policy query requests based on the phrasing of the current query request and previous user queries. Furthermore, it refines the current query request using historical keywords, achieving correlated answers between multiple consecutive questions and ensuring users receive more accurate results. Simultaneously, after confirming the correlation between policy query requests, it limits the scope of the query keywords based on the relationship between historical keywords and the query keywords, resulting in revised keywords that improve the accuracy of subsequent keyword-based query results.

[0008] Optionally, determining the statement relevance between the first query request and the second query request specifically includes: selecting one or more preset statement relevance algorithms from a plurality of preset statement relevance algorithms based on the text lengths of the first query request and the second query request. These preset statement relevance algorithms include text similarity algorithms, word vector algorithms, syntax analysis algorithms, and context analysis algorithms. Based on the statement structure of the first query request and the second query request, a target relevance algorithm is selected from the plurality of preset statement relevance algorithms. Alternatively, based on the part-of-speech count of the statements in the first query request and the second query request, a target relevance algorithm is selected from the plurality of preset statement relevance algorithms, where the part-of-speech count represents the number of words with different parts of speech appearing in the statement. The target statement relevance algorithm is then used to calculate the statement relevance between the first query request and the second query request to obtain the statement relevance.

[0009] This application employs the above method to select the most suitable target statement relevance algorithm from a variety of preset statement relevance algorithms based on the text length, statement structure, and part-of-speech count between policy query requests. This results in a more accurate calculation of the statement relevance between the first and second query requests.

[0010] Optionally, based on the text length of the second query request and the text length of the first query request, one or more preset statement relevance algorithms are selected from a plurality of preset statement relevance algorithms. Specifically, this includes: when both the text length of the second query request and the text length of the first query request are less than a preset text length, selecting a text similarity algorithm or a syntax analysis algorithm from a plurality of preset statement relevance algorithms; when the text length of the first query request is greater than or equal to the preset text length, selecting a word vector algorithm or a context analysis algorithm from a plurality of preset statement relevance algorithms; and when the text length of the second query request is greater than or equal to the preset text length, selecting a word vector algorithm or a context analysis algorithm from a plurality of preset statement relevance algorithms.

[0011] This application improves the accuracy of statement relevance by adopting the above method and selecting a more suitable statement relevance algorithm based on the text length of the policy query request.

[0012] Optionally, based on the statement structure of the first query request and the statement structure of the second query request, a target relevance algorithm is selected from one or more preset statement relevance algorithms. Specifically, this includes: when one or more preset statement relevance algorithms include a similarity algorithm and a syntax analysis algorithm, determining the statement structure similarity between the statement structure of the second query request and the statement structure of the first query request; when the statement structure similarity is greater than or equal to the preset statement structure similarity, determining the text similarity algorithm as the target relevance algorithm; when the statement structure similarity is less than the preset statement structure similarity, determining the syntax analysis algorithm as the target relevance algorithm.

[0013] Optionally, based on the part-of-speech count of the statements in the first query request and the part-of-speech count of the statements in the second query request, a target relevance algorithm is selected from one or more preset statement relevance algorithms. Specifically, this includes: when one or more preset statement relevance algorithms include a word vector algorithm and a context analysis algorithm, obtaining the part-of-speech count of the statements in the second query request and the part-of-speech count of the statements in the first query request; when the part-of-speech count of the statements in the second query request or the part-of-speech count of the statements in the first query request is greater than or equal to the preset part-of-speech count, determining the context analysis algorithm as the target relevance algorithm.

[0014] Optionally, based on the corrected keywords and the account information corresponding to the user device, policy query results can be obtained from a preset policy database. Specifically, this includes: obtaining preliminary policy query results from the preset policy database based on the corrected keywords; querying the account information corresponding to the user device; correcting the preliminary policy query results based on the account information corresponding to the user device; and obtaining the final policy query results.

[0015] This application uses the above method to obtain preliminary policy query results from a preset policy database based on modified keywords, and then modifies the preliminary policy query results using the user's account information to obtain policy query results that are more closely matched to the user's account information.

[0016] Optionally, when the relevance of the statements is less than the preset relevance threshold, it is confirmed that the second query request and the first query request are not related; the query keywords of the first query request are determined as the correction keywords.

[0017] A second aspect of this application provides a policy query device that combines context. The device includes a judgment unit, an acquisition unit, a statement judgment unit, a keyword modification unit, and a result query unit. The judgment unit is used to respond to a policy query operation of a user device. The policy query operation includes a first query request and a judgment of the statement relevance between the first query request and a second query request, wherein the second query request is a query request sent by the user before the first query request. The acquisition unit is used to acquire historical keywords of the second query request. The statement judgment unit is used to confirm that the second query request and the first query request are related when the statement relevance is greater than or equal to a preset statement relevance threshold. The keyword modification unit is used to limit the query scope of the query keywords based on the relevance between historical keywords and query keywords to obtain modified keywords. The result query unit is used to obtain policy query results in a preset policy database based on the modified keywords and the account information corresponding to the user device.

[0018] Optionally, the judgment unit includes a first judgment module, a second judgment module, a third judgment module, and a relevance calculation module; the first judgment module is used to select one or more preset statement relevance algorithms from multiple preset statement relevance algorithms based on the text length of the first query request and the text length of the second query request, the multiple preset statement relevance algorithms including text similarity algorithm, word vector algorithm, syntax analysis algorithm, and context analysis algorithm; the second judgment module is used to filter out a target relevance algorithm from one or more preset statement relevance algorithms based on the statement structure of the first query request and the statement structure of the second query request; the third judgment module is used to filter out a target relevance algorithm from one or more preset statement relevance algorithms based on the part-of-speech count of the first query request and the part-of-speech count of the second query request, the part-of-speech count being used to represent the number of words of different parts of speech appearing in the statement; the relevance calculation module is used to calculate the statement relevance between the first query request and the second query request using the target statement relevance algorithm to obtain the statement relevance.

[0019] Optionally, the first judgment module includes a first text judgment submodule, a second text judgment submodule, and a third text judgment submodule; the first text judgment submodule is used to select a text similarity algorithm or a syntax analysis algorithm from multiple preset statement relevance algorithms when both the text length of the second query request and the text length of the first query request are less than a preset text length; the second text judgment submodule is used to select a word vector algorithm or a context analysis algorithm from multiple preset statement relevance algorithms when the text length of the first query request is greater than or equal to the preset text length; the third text judgment submodule is used to select a word vector algorithm or a context analysis algorithm from multiple preset statement relevance algorithms when the text length of the second query request is greater than or equal to the preset text length.

[0020] Optionally, the first judgment module includes a first structure judgment submodule, a second structure judgment submodule, and a third structure judgment submodule; the first structure judgment submodule is used to judge the statement structure similarity between the statement structure of the second query request and the statement structure of the first query request when one or more preset statement relevance algorithms include a similarity algorithm and a syntax analysis algorithm; the second structure judgment submodule is used to determine the text similarity algorithm as the target relevance algorithm when the statement structure similarity is greater than or equal to the preset statement structure similarity; the third structure judgment submodule is used to determine the syntax analysis algorithm as the target relevance algorithm when the statement structure similarity is less than the preset statement structure similarity.

[0021] Optionally, the third judgment module includes a first part-of-speech (POS) judgment submodule and a second POS judgment submodule; the first POS judgment submodule is used to obtain the number of POS of the second query request and the number of POS of the first query request when one or more preset sentence relevance algorithms include word vector algorithm and context analysis algorithm; the second POS judgment submodule is used to determine the context analysis algorithm as the target relevance algorithm when the number of POS of the second query request or the number of POS of the first query request is greater than or equal to the preset number of POS of the second query request.

[0022] Optionally, the result query unit includes a preliminary query module and a result correction module; the preliminary query module is used to obtain preliminary policy query results from a preset policy database based on the correction keywords; the result correction module is used to query the account information corresponding to the user device, and correct the preliminary policy query results based on the account information corresponding to the user device to obtain the policy query results.

[0023] A third aspect of this application provides an electronic device, which includes a processor, a memory, a user interface, and a network interface. The memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to cause the electronic device to perform any of the methods described above.

[0024] A fourth aspect of this application provides a computer-readable storage medium storing instructions that, when executed, perform any of the methods described above.

[0025] Compared with related technologies, the beneficial effects of this application are:

[0026] 1. Based on the relevance of the current query request and the query requests sent by the user before the current query request, the degree of correlation between policy query requests is obtained. Furthermore, the current query request is modified based on historical keywords to achieve a related answer between multiple consecutive questions, ensuring that users of policy queries can obtain more accurate query results.

[0027] 2. By considering the text length, sentence structure, and part-of-speech count between policy query requests, the most suitable target sentence relevance algorithm is selected from a variety of preset sentence relevance algorithms, so that a more accurate sentence relevance calculation result is obtained when calculating the sentence relevance between the first query request and the second query request.

[0028] 3. After confirming the correlation between policy query requests, the query scope of the query keywords is limited based on the relationship between historical keywords and query keywords, resulting in corrected keywords, which improves the accuracy of subsequent query results obtained through keywords.

[0029] 4. Based on the corrected keywords, after obtaining preliminary policy query results from the preset policy database, the preliminary policy query results are corrected using the user's account information to obtain policy query results that are more closely matched to the user's account information. Attached Figure Description

[0030] Figure 1 This is a first flowchart illustrating a policy query method that combines context, as provided in an embodiment of this application.

[0031] Figure 2 This is a second flowchart illustrating a policy query method that combines context, as provided in an embodiment of this application.

[0032] Figure 3 This is a third flowchart illustrating a policy query method that combines context, as provided in an embodiment of this application.

[0033] Figure 4 This is a schematic diagram of a policy query device that combines context, as provided in an embodiment of this application.

[0034] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0035] Reference numerals: 41, Judgment unit; 42, Acquisition unit; 43, Statement judgment unit; 44, Keyword modification unit; 45, Result query unit; 500, Electronic device; 501, Processor; 502, Communication bus; 503, User interface; 504, Network interface; 505, Memory. Detailed Implementation

[0036] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0037] In the description of the embodiments of this application, words such as "illustrative," "for example," or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "illustrative," "for example," or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Rather, the use of words such as "illustrative," "for example," or "for example" is intended to present the relevant concepts in a specific manner.

[0038] In the description of the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, B existing alone, or A and B existing simultaneously. Furthermore, unless otherwise stated, the term "multiple" means two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and their variations all mean "including but not limited to," unless otherwise specifically emphasized.

[0039] This application provides a flowchart illustrating a policy query method that combines context, as shown in the embodiments below. Figure 1 As shown, the method includes steps S1-S5.

[0040] S1, responding to a policy query operation on the user device, the policy query operation includes a first query request, determining the statement correlation between the first query request and a second query request, the second query request being a query request sent by the user before the first query request.

[0041] In this embodiment, the user sends a policy query request to the server through a policy query operation. The policy query operation in this embodiment is a single policy query process for the user. During this single policy query process, the user sends multiple query requests to the server, including a first query request and a second query request. The first query request is the most recently sent query request by the user, and the second query request is at least one query request sent by the user before sending the first query request.

[0042] In one possible implementation, such as Figure 2 As shown, determining the statement relevance between the first query request and the second query request specifically includes steps S11-S14.

[0043] S11, based on the text length of the first query request and the text length of the second query request, select one or more preset sentence correlation algorithms from multiple preset sentence correlation algorithms. The multiple preset sentence correlation algorithms include text similarity algorithm, word vector algorithm, syntax analysis algorithm and context analysis algorithm.

[0044] In this embodiment, considering the various differences between the text lengths of the first and second query requests, the algorithm most suitable for the current situation is selected from multiple preset statement relevance algorithms by comparing the text lengths of the first and second query requests to calculate the statement relevance. In this embodiment, the specific implementations of the text similarity algorithm, word vector algorithm, syntax analysis algorithm, and context analysis algorithm can be found in related technologies, and will not be elaborated upon here. Text similarity algorithm: Algorithms such as cosine similarity and Jaccard similarity can be used to calculate the similarity between two statements. The higher the similarity, the higher the semantic relevance between the two statements. Word vector model: Word vector models such as Word2Vec and GloVe can be used to convert two statements into vector representations, and then their similarity can be calculated. Syntax analysis: Natural language processing methods can be used to perform syntactic analysis on two statements and compare their syntactic structure and semantic roles to determine their semantic relevance. Context analysis: The context of two statements can be analyzed, including the surrounding text and topic, to determine their semantic relevance. In the embodiments of this application, by combining the above methods, the semantic relevance between two statements can be determined more accurately.

[0045] In one possible implementation, such as Figure 3 As shown, in step S11, one or more preset statement relevance algorithms are selected from multiple preset statement relevance algorithms based on the text length of the second query request and the text length of the first query request, specifically including S111-S114.

[0046] S111, when the text length of the second query request and the text length of the first query request are both less than the preset text length, select a text similarity algorithm or a syntax analysis algorithm from multiple preset statement correlation algorithms.

[0047] In this embodiment, considering that text similarity algorithms are easy to implement and fast to compute, they are suitable for calculating the similarity of short texts or sentences. However, they cannot handle situations where two sentences have different structures but the same semantics, and their similarity calculation effect is poor for long texts. Syntax analysis algorithms have the advantage of capturing information about grammatical structure and semantic roles, making them suitable for tasks that require understanding sentence structure, such as question-answering systems. However, syntax analysis algorithms have the disadvantage of low efficiency in processing long texts, and the results may contain errors for complex grammatical structures. Therefore, when the text length of both the second query request and the first query request is less than a preset text length, selecting either a text similarity algorithm or a syntax analysis algorithm can better handle the process of calculating the sentence relevance between query requests.

[0048] S112, when the text length of the first query request is greater than or equal to the preset text length, select either the word vector algorithm or the context analysis algorithm from multiple preset statement relevance algorithms.

[0049] S113, when the text length of the second query request is greater than or equal to the preset text length, select either the word vector algorithm or the context analysis algorithm from multiple preset statement relevance algorithms.

[0050] In this embodiment, the word vector algorithm performs well in calculating the similarity of long texts. Meanwhile, the context analysis algorithm has the advantage of considering context and topic information, handling cases of polysemous words, and aiding in understanding the true meaning of the text. Considering two scenarios where there is a significant difference in text length between the first and second query requests: First, the second query request may contain multiple questions raised before the first query request during the current query process, resulting in an excessively long text or multiple related contextual elements. Therefore, when obtaining the sentence relevance between the second and first query requests, considering the aforementioned characteristics of the second query request, choosing either the word vector algorithm or the context analysis algorithm can more accurately obtain the sentence relevance.

[0051] In the second case, when the length of the text in the first query request is greater than or equal to the preset text length, since the word vector algorithm is better at calculating the similarity of long texts, and the text structure and the words contained in the text will be more complex when the length of the first query request is long, the context analysis algorithm can better handle the polysemous words in the first query request.

[0052] S12, based on the statement structure of the first query request and the statement structure of the second query request, select the target relevance algorithm from one or more preset statement relevance algorithms.

[0053] In one possible implementation, based on the statement structure of the first query request and the statement structure of the second query request, a target relevance algorithm is selected from one or more preset statement relevance algorithms, specifically including S121-S123.

[0054] S121, when one or more preset statement correlation algorithms include a similarity algorithm and a syntax analysis algorithm, determine the statement structure similarity between the statement structure of the second query request and the statement structure of the first query request.

[0055] S122, when the sentence structure similarity is greater than or equal to the preset sentence structure similarity, the text similarity algorithm is determined as the target relevance algorithm.

[0056] S123, when the sentence structure similarity is less than the preset sentence structure similarity, the syntax analysis algorithm is determined to be the target relevance algorithm.

[0057] In this embodiment, when one or more preset statement relevance algorithms include a similarity algorithm and a syntax analysis algorithm, the statement relevance is calculated by judging the statement structure similarity between the statement structure of the second query request and the statement structure of the first query request, and selecting a more suitable target relevance algorithm from the similarity algorithm and the syntax analysis algorithm. Specifically, when the statement structure similarity is greater than or equal to the preset statement structure similarity, it indicates that the statement structures of the first query request and the second query request are similar. Since the text similarity algorithm cannot handle the situation where two statements have different structures but the same meaning, the text similarity algorithm can only be determined as the target relevance algorithm when the statement structures of the first query request and the second query request are similar. Conversely, when the statement structure similarity is less than the preset statement structure similarity, since the text similarity algorithm cannot handle the situation where two statements have different structures but the same meaning, the syntax analysis algorithm is determined as the target relevance algorithm.

[0058] S13, based on the part-of-speech count of the statement in the first query request and the part-of-speech count of the statement in the second query request, select the target relevance algorithm from one or more preset statement relevance algorithms. The part-of-speech count is used to represent the number of words with different parts of speech appearing in the statement.

[0059] In one possible implementation, S13 specifically includes steps S131-S132.

[0060] S131, when one or more preset statement relevance algorithms include word vector algorithm and context analysis algorithm, obtain the part-of-speech count of the statement in the second query request and the part-of-speech count of the statement in the first query request.

[0061] S132, when the number of part-of-speech tags of the second query request or the first query request is greater than or equal to the preset number of part-of-speech tags, the context analysis algorithm is determined as the target relevance algorithm.

[0062] Specifically, when one or more preset sentence correlation algorithms include word vector algorithms and context analysis algorithms, the part-of-speech count of the second query request and the part-of-speech count of the first query request are obtained. In this embodiment, the part-of-speech count represents the number of words with different parts of speech appearing in the text of the first query request or the text of the second query request. When the part-of-speech count of the second query request or the part-of-speech count of the first query request is greater than or equal to the preset part-of-speech count, the context analysis algorithm identifies the relationships and meanings between words based on lexical context and syntactic context. Lexical context refers to the meaning and usage of other words in a sentence, paragraph, or article containing a word. Through lexical context analysis, the meaning of a word in a specific context can be determined. Syntactic context focuses on the relationships between words in a sentence. Through syntactic analysis, grammatical components such as subject, predicate, and object can be identified, thereby understanding the meaning of the entire sentence. By employing a context analysis algorithm, a more accurate sentence correlation can be obtained when the part-of-speech count of the query request is large.

[0063] S14, the target statement relevance algorithm is used to calculate the statement relevance between the first query request and the second query request to obtain the statement relevance.

[0064] S2, retrieve the historical keywords of the second query request.

[0065] For example, in this embodiment of the application, historical keywords are obtained by acquiring multiple keywords from the text in the second query request. Text example: Machine learning is an artificial intelligence technology that continuously optimizes models through training data and algorithms, thereby achieving self-learning and continuous improvement. Machine learning has wide applications, such as classification, clustering, regression, and recommender systems. Keywords extracted from the text: machine learning, artificial intelligence technology, training data, algorithm optimization model, self-learning, improvement, classification, clustering, regression, and recommender systems. Here is another text example, with keywords extracted from the text: Text example: Our company recently wants to apply for tax incentives. What conditions need to be met? Keywords extracted from the text: company, tax incentives, conditions, and meet.

[0066] S3, when the statement relevance is greater than or equal to the preset statement relevance threshold, confirm that the second query request is related to the first query request.

[0067] In one possible implementation, when the relevance of the statements is less than a preset relevance threshold, it is determined that the second query request and the first query request are not related. In this case, the query keywords of the first query request are directly determined as the correction keywords.

[0068] S4. Based on the relationship between historical keywords and query keywords, the scope of the query keywords is limited to obtain corrected keywords.

[0069] In this embodiment of the application, the query keywords of the first query request are obtained in advance. For example, the query keywords of the first query request include A1, A2, A3...A n The query keywords of the first query request are modified based on the degree of relevance of the statements. This modification includes further narrowing down some keywords within the query. For example, if the keywords in the text of the second query request include B1, B2, B3…B… m Where B1, B2, and B3 are subordinate keywords of A1, A2, and A3, then replacing A1, A2, and A3 in the query keywords with B1, B2, and B3 will yield the corrected keywords B1, B2, B3, A4...A n The correction methods also include adding some keywords to the query keywords. Regardless of the specific method, the goal is to limit the scope of policy query results when retrieving them from the pre-defined policy database using the query keywords.

[0070] S5: Based on the corrected keywords and the account information corresponding to the user's device, obtain policy query results from the preset policy database.

[0071] In one possible implementation, step S4 includes S51-S52.

[0072] S51. Based on the corrected keywords, obtain preliminary policy query results from the preset policy database.

[0073] S52, query the account information corresponding to the user device, and correct the preliminary policy query results based on the account information corresponding to the user device to obtain the policy query results.

[0074] In this embodiment of the application, the policy database needs to collect and organize relevant policy documents, including laws, regulations, notices, etc., to establish a policy text library, and to annotate and classify the policy texts for subsequent querying and analysis. This application will not go into too much detail here.

[0075] For example, this application uses the account information corresponding to the user device, including the account's geographical location, the name of the policy already obtained, and the name of the example policy application, to further filter the policy query results and obtain the policy query results.

[0076] The beneficial effects that can be achieved by adopting the above method include:

[0077] 1. Based on the relevance of the current query request and the query requests sent by the user before the current query request, the degree of correlation between policy query requests is obtained. Furthermore, the current query request is modified based on historical keywords to achieve a related answer between multiple consecutive questions, ensuring that users of policy queries can obtain more accurate query results.

[0078] 2. By considering the text length, sentence structure, and part-of-speech count between policy query requests, the most suitable target sentence relevance algorithm is selected from a variety of preset sentence relevance algorithms, so that a more accurate sentence relevance calculation result is obtained when calculating the sentence relevance between the first query request and the second query request.

[0079] 3. After confirming the correlation between policy query requests, the query scope of the query keywords is limited based on the relationship between historical keywords and query keywords, resulting in corrected keywords, which improves the accuracy of subsequent query results obtained through keywords.

[0080] 4. Based on the corrected keywords, after obtaining preliminary policy query results from the preset policy database, the preliminary policy query results are corrected using the user's account information to obtain policy query results that are more closely matched to the user's account information.

[0081] This application provides a policy query device that combines context, such as... Figure 4 As shown, the device includes a judgment unit 41, an acquisition unit 42, a statement judgment unit 43, a keyword modification unit 44, and a result query unit 45. The judgment unit 41 is used to respond to a policy query operation of a user device. The policy query operation includes a first query request, and the judgment unit 42 is used to determine the statement relevance between the first query request and a second query request, where the second query request is a query request sent by the user before the first query request. The acquisition unit 42 is used to acquire historical keywords of the second query request. The statement judgment unit 43 is used to confirm that the second query request and the first query request are related when the statement relevance is greater than or equal to a preset statement relevance threshold. The keyword modification unit 44 is used to limit the query scope of the query keywords based on the relevance between historical keywords and query keywords to obtain modified keywords. The result query unit 44 is used to obtain policy query results in a preset policy database based on the modified keywords and the account information corresponding to the user device.

[0082] In one possible implementation, the judgment unit 41 includes a first judgment module, a second judgment module, a third judgment module, and a relevance calculation module; the first judgment module is used to select one or more preset statement relevance algorithms from a plurality of preset statement relevance algorithms based on the text length of the first query request and the text length of the second query request, the plurality of preset statement relevance algorithms including text similarity algorithm, word vector algorithm, syntax analysis algorithm, and context analysis algorithm; the second judgment module is used to filter out a target relevance algorithm from the plurality of preset statement relevance algorithms based on the statement structure of the first query request and the statement structure of the second query request; the third judgment module is used to filter out a target relevance algorithm from the plurality of preset statement relevance algorithms based on the part-of-speech count of the statement in the first query request and the part-of-speech count of the statement in the second query request, the part-of-speech count being used to represent the number of words of different parts of speech appearing in the statement; the relevance calculation module is used to calculate the statement relevance between the first query request and the second query request using the target statement relevance algorithm to obtain the statement relevance.

[0083] In one possible implementation, the first judgment module includes a first text judgment submodule, a second text judgment submodule, and a third text judgment submodule; the first text judgment submodule is used to select a text similarity algorithm or a syntax analysis algorithm from multiple preset statement relevance algorithms when both the text length of the second query request and the text length of the first query request are less than a preset text length; the second text judgment submodule is used to select a word vector algorithm or a context analysis algorithm from multiple preset statement relevance algorithms when the text length of the first query request is greater than or equal to the preset text length; the third text judgment submodule is used to select a word vector algorithm or a context analysis algorithm from multiple preset statement relevance algorithms when the text length of the second query request is greater than or equal to the preset text length.

[0084] In one possible implementation, the first judgment module includes a first structure judgment submodule, a second structure judgment submodule, and a third structure judgment submodule; the first structure judgment submodule is used to judge the statement structure similarity between the statement structure of the second query request and the statement structure of the first query request when one or more preset statement relevance algorithms include a similarity algorithm and a syntax analysis algorithm; the second structure judgment submodule is used to determine the text similarity algorithm as the target relevance algorithm when the statement structure similarity is greater than or equal to the preset statement structure similarity; the third structure judgment submodule is used to determine the syntax analysis algorithm as the target relevance algorithm when the statement structure similarity is less than the preset statement structure similarity.

[0085] In one possible implementation, the third judgment module includes a first part-of-speech (POS) judgment submodule and a second POS judgment submodule; the first POS judgment submodule is used to obtain the POS count of the second query request and the POS count of the first query request when one or more preset statement relevance algorithms include a word vector algorithm and a context analysis algorithm; the second POS judgment submodule is used to determine the context analysis algorithm as the target relevance algorithm when the POS count of the second query request or the POS count of the first query request is greater than or equal to the preset POS count.

[0086] In one possible implementation, the result query unit 45 includes a preliminary query module and a result correction module; the preliminary query module is used to obtain preliminary policy query results from a preset policy database based on the correction keywords; the result correction module is used to query the account information corresponding to the user device, and correct the preliminary policy query results based on the account information corresponding to the user device to obtain the policy query results.

[0087] It should be noted that the above embodiments of the apparatus are only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0088] Please see Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 500 may include: at least one processor 501, at least one network interface 504, user interface 503, memory 505, and at least one communication bus 502.

[0089] The communication bus 502 is used to enable communication between these components.

[0090] The user interface 503 may include a display screen and a camera. Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.

[0091] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0092] The processor 501 may include one or more processing cores. The processor 501 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 505, and by calling data stored in memory 505. Optionally, the processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 501 and may be implemented as a separate chip.

[0093] The memory 505 may include random access memory (RAM) or read-only memory. Optionally, the memory 505 may include a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 505 may also be at least one storage device located remotely from the aforementioned processor 501. Figure 5 As shown, the memory 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for topology identification of a distributed power distribution network.

[0094] exist Figure 5In the electronic device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and to obtain the user input data; while the processor 501 can be used to call the application program stored in the memory 505 which contains the topology identification method of the distributed power distribution network. When executed by one or more processors, the electronic device 500 performs one or more of the methods described in the above embodiments.

[0095] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0096] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0097] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some service interfaces; indirect couplings or communication connections between devices or units may be electrical or other forms.

[0098] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0099] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0100] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0101] The above description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of other embodiments of this disclosure upon considering the specification and the disclosure of practical truths. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure.

Claims

1. A policy query method combining context, characterized in that, When applied to a server, the method includes: In response to a policy query operation on a user device, the policy query operation includes a first query request, determining the statement relevance between the first query request and a second query request, wherein the second query request is a query request sent by the user before the first query request; Retrieve the historical keywords of the second query request; When the statement relevance is greater than or equal to a preset statement relevance threshold, it is confirmed that the second query request is related to the first query request. Based on the relationship between the historical keywords and the query keywords of the first query request, the query scope of the query keywords is limited to obtain the corrected keywords; Based on the corrected keywords and the account information corresponding to the user device, obtain policy query results from the preset policy database; The determination of the statement relevance between the first query request and the second query request includes: Based on the text length of the first query request and the text length of the second query request, one or more of the preset sentence relevance algorithms are selected from a plurality of preset sentence relevance algorithms. The plurality of preset sentence relevance algorithms include text similarity algorithms, word vector algorithms, syntax analysis algorithms and context analysis algorithms. Based on the part-of-speech count of the first query request and the part-of-speech count of the second query request, a target relevance algorithm is selected from a variety of preset statement relevance algorithms. The part-of-speech count is used to represent the number of words with different parts of speech appearing in the statement. The target relevance algorithm is used to calculate the relevance between the statements in the first query request and the second query request to obtain the statement relevance. Specifically, based on the text lengths of the first query request and the second query request, one or more preset statement relevance algorithms are selected from a plurality of preset statement relevance algorithms, including: When the text length of the second query request and the text length of the first query request are both less than the preset text length, the text similarity algorithm or the syntax analysis algorithm is selected from multiple preset statement relevance algorithms. When the text length of the first query request is greater than or equal to the preset text length, the word vector algorithm or the context analysis algorithm is selected from multiple preset statement relevance algorithms; When the text length of the second query request is greater than or equal to the preset text length, the word vector algorithm or the context analysis algorithm is selected from multiple preset statement relevance algorithms; Specifically, based on the part-of-speech count of the statements in the first query request and the part-of-speech count of the statements in the second query request, a target relevance algorithm is selected from a variety of preset statement relevance algorithms, including: When the preset statement relevance algorithms include the word vector algorithm and the context analysis algorithm, obtain the part-of-speech count of the statement in the second query request and the part-of-speech count of the statement in the first query request; When the part-of-speech count of the second query request or the first query request is greater than or equal to the preset part-of-speech count, the context analysis algorithm is determined as the target relevance algorithm.

2. The method according to claim 1, characterized in that, The step of obtaining policy query results from a preset policy database based on the modified keywords and the account information corresponding to the user device specifically includes: Based on the modified keywords, preliminary policy query results are obtained from the preset policy database; The account information corresponding to the user device is queried, and the preliminary policy query result is corrected based on the account information corresponding to the user device to obtain the policy query result.

3. The method according to claim 1, characterized in that, The method further includes: When the relevance of the statement is less than the preset relevance threshold, it is confirmed that the second query request and the first query request are not related. The query keywords of the first query request are determined as the corrected keywords.

4. A policy query device that combines context, characterized in that, The apparatus for performing the policy query method in conjunction with context as described in claim 1 includes a judgment unit, an acquisition unit, a statement judgment unit, a keyword modification unit, and a result query unit. The judgment unit is used to respond to the policy query operation of the user device. The policy query operation includes a first query request and a judgment on the statement correlation between the first query request and a second query request. The second query request is a query request sent by the user before the first query request. The acquisition unit is used to acquire the historical keywords of the second query request; The statement judgment unit is used to confirm that the second query request is related to the first query request when the statement relevance is greater than or equal to a preset statement relevance threshold. The keyword modification unit is used to limit the query scope of the query keywords based on the relationship between the historical keywords and the query keywords, so as to obtain the modified keywords; The result query unit is used to obtain policy query results from a preset policy database based on the corrected keywords and the account information corresponding to the user device.

5. An electronic device, characterized in that, The electronic device includes a processor (501), a user interface (503), a network interface (504), and a memory (505). The memory (505) is used to store instructions. The user interface (503) and the network interface (504) are used to communicate with other devices. The processor (501) is used to execute the instructions stored in the memory (505) to cause the electronic device (500) to perform the method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed, perform the method as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Semanteme recognition and search method and system

    CN102831157A

  • Method and device for determining project function similarity

    CN110888920A

  • Knowledge point query method and device, server, medium and product

    CN113239177A

  • Man-machine interaction method, device and system and medium

    CN116187346A