Information search method, computer equipment and computer storage medium

By using preset semantic recognition rules and pre-trained semantic recognition models, semantic recognition of search information input by users and generating search conditional statements, solving the problem that existing search functions are difficult to recognize the semantics of search terms, and achieving more efficient and accurate Search for information.

CN119513373APending Publication Date: 2025-02-25KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411573156.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

Existing search functions are difficult to accurately identify the semantics of search terms entered by users, resulting in high search error rates or inability to output accurate results, affecting search efficiency.

Method used

By obtaining preset semantic recognition rules and pre-trained semantic recognition models, semantic recognition information input by the user is semantic recognition, corresponding search condition statements are generated, and these statements are executed for information search.

Benefits of technology

It improves the accuracy and efficiency of semantic recognition of user input search information, and improves the accuracy and search efficiency of information search.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513373A_ABST
    Figure CN119513373A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an information search method, computer equipment and a computer storage medium. The computer equipment obtains a preset semantic recognition rule, the semantic recognition rule is used for representing the corresponding relation between the search information and semantics, a pre-training semantic recognition model is obtained, semantic recognition is conducted on target search information input by a user according to the semantic recognition rule and / or the pre-training semantic recognition model, and the target search information is obtained. And generating a search conditional statement corresponding to the target search information based on the semantic recognition result, executing the search conditional statement and outputting a search result. The semantics corresponding to the search information can be accurately recognized based on the semantic corresponding relation set by the semantic recognition rule, and the search requirement of the user can be accurately recognized for the search information based on the strong language understanding ability of the pre-trained semantic recognition model, so that the accuracy and efficiency of semantic recognition are greatly improved; and thus, the information search accuracy and search efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of information search, and specifically to an information search method, a computer device, and a computer storage medium. Background Art

[0002] Users of the software program use the search function of the software program to search for specific information. For example, an enterprise's human resources management personnel or an enterprise's managers search for talent information by entering a person's characteristic information on the software program. For example, they enter characteristic information such as "employee number / name" to query the corresponding talent information, so as to serve talent management related businesses such as the introduction, review and development of talents.

[0003] However, the search function of the software program is difficult to accurately recognize the semantics of the search terms entered by the user. For example, when the user enters the text "age greater than 30 years old", the search function directly matches the words "age greater than 30 years old" with the information in the database or table, and cannot understand the semantics of the word "greater than 30", resulting in inaccurate semantic recognition and failure to output accurate search results; or, the search term entered by the user is misjudged as matching the wrong field, resulting in the output of wrong search results. Therefore, the existing search function cannot accurately recognize the semantics of the search term, resulting in a high search error rate or no search results, affecting search efficiency. Summary of the invention

[0004] The embodiments of the present application provide an information search method, a computer device, and a computer storage medium, which are used to improve the semantic recognition capability of search information input by a user, and to improve the accuracy and efficiency of information search.

[0005] A first aspect of an embodiment of the present application provides an information search method, comprising:

[0006] Acquire a preset semantic recognition rule, wherein the semantic recognition rule is used to represent the corresponding relationship between the search information and the semantics;

[0007] Obtaining a pre-trained semantic recognition model, wherein the pre-trained semantic recognition model is obtained by training training data using a machine learning algorithm;

[0008] Receive target search information input by a user, perform semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generate a search condition statement corresponding to the target search information based on the semantic recognition result;

[0009] The search condition statement is executed to perform information search, and the search result is output.

[0010] A second aspect of an embodiment of the present application provides a computer device, including:

[0011] A first acquisition unit, used to acquire a preset semantic recognition rule, wherein the semantic recognition rule is used to represent the corresponding relationship between the search information and the semantics;

[0012] A second acquisition unit is used to acquire a pre-trained semantic recognition model, where the pre-trained semantic recognition model is obtained by training the training data using a machine learning algorithm;

[0013] A semantic recognition unit, configured to receive target search information input by a user, perform semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generate a search condition statement corresponding to the target search information based on the semantic recognition result;

[0014] The search unit is used to execute the search condition statement to search for information and output the search result.

[0015] A third aspect of an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.

[0016] A fourth aspect of an embodiment of the present application provides a computer storage medium, in which instructions are stored. When the instructions are executed on a computer, the computer executes the method of the first aspect.

[0017] A fifth aspect of the embodiments of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device executes the method of the first aspect.

[0018] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0019] The computer device obtains preset semantic recognition rules, which are used to express the correspondence between search information and semantics, obtains a pre-trained semantic recognition model, which is obtained by training training data with a machine learning algorithm, performs semantic recognition on the target search information input by the user according to the semantic recognition rules and / or the pre-trained semantic recognition model, generates a search condition statement corresponding to the target search information based on the semantic recognition result, executes the search condition statement and outputs the search result. The semantic correspondence relationship set based on the semantic recognition rules can accurately identify the semantics corresponding to the search information, and the powerful language understanding ability based on the pre-trained semantic recognition model can accurately identify the user's search needs for the search information, greatly improving the accuracy and efficiency of semantic recognition, thereby improving the accuracy and efficiency of information search. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1This is a schematic diagram of the network framework in the embodiment of the present application;

[0021] Figure 2 A flowchart of the information search method in the embodiment of the present application;

[0022] Figure 3 This is another flow chart of the information search method in the embodiment of the present application;

[0023] Figure 4 This is an exemplary schematic diagram of the application architecture of the information search method in the embodiment of the present application;

[0024] Figure 5 This is a schematic diagram of the structure of a computer device in an embodiment of the present application;

[0025] Figure 6 This is another structural diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The embodiments of the present application provide an information search method, a computer device, and a computer storage medium, which are used to improve the semantic recognition capability of search information input by a user, and to improve the accuracy and efficiency of information search.

[0027] See also Figure 1 In the embodiment of the present application, the network framework includes:

[0028] The service server 100 and the terminal cluster; the terminal cluster may include: terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n and other terminal devices.

[0029] The business server 100 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud database, cloud service, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform. The terminal device (including terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n) may be a smart phone, tablet computer, laptop computer, desktop computer, PDA, mobile internet device (MID), wearable device (such as smart watch, smart bracelet, etc.), smart computer, smart car and other smart terminals.

[0030] Among them, the business server 100 can establish a communication connection with each terminal device in the terminal cluster, and a communication connection can also be established between each terminal device in the terminal cluster. In other words, the business server 100 can establish a communication connection with each terminal device in the terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n. For example, a communication connection can be established between the terminal device 200a and the business server 100. A communication connection can be established between the terminal device 200a and the terminal device 200b, and a communication connection can also be established between the terminal device 200a and the terminal device 200c. Among them, the above-mentioned communication connection does not limit the connection method, and can be directly or indirectly connected through a wired communication method, or can be directly or indirectly connected through a wireless communication method, etc., which can be determined according to the actual application scenario, and this application is not limited here.

[0031] It should be understood that Figure 1 Each terminal device in the terminal cluster shown can be installed with an application client. When the application client runs in each terminal device, it can interact with the business server 100 respectively, so that the business server 100 can receive business data from each terminal device (such as financial management data uploaded by the user through the terminal device). Among them, the application client can be an application client with the function of displaying text, images, audio and video, such as a financial management application, an enterprise affairs management application, a browser application, a social application, an instant messaging application, a live broadcast application, a game application, a short video application, a video application, a music application, a shopping application, a novel application, a payment application, etc., which can be determined according to the actual application scenario requirements and is not limited here. Among them, the application client can be an independent client or an embedded sub-client integrated in a client (such as a financial management client, an enterprise affairs management client, etc.), which can be determined according to the actual application scenario and is not limited here.

[0032] In related solutions, the search function of the software program has difficulty in accurately identifying the semantics of the search terms entered by the user. For example, when the user enters the words "age greater than 30 years old", the search function directly matches the words "age greater than 30 years old" with the information in the database or table, and cannot understand the semantics of the word "greater than 30", resulting in inaccurate semantic recognition and failure to output accurate search results; or, the search term entered by the user is misjudged as matching the wrong field. For example, when the user enters "group company", the user expects to match in the "department" field, but the search function misjudged it as matching in the "employment company" field, resulting in the output of incorrect search results. Therefore, the existing search function cannot accurately identify the semantics of the search term, resulting in a high search error rate or no search results, affecting search efficiency.

[0033] In order to solve the above technical problems, an information search method of the embodiment of the present application is proposed. Figure 1 The information search method in the embodiment of the present application is described in the network framework:

[0034] See also Figure 2 In the embodiments of the present application, an information search method includes:

[0035] 201. Obtaining a preset semantic recognition rule, where the semantic recognition rule is used to represent a corresponding relationship between search information and semantics;

[0036] The method of this embodiment can be applied to a computer device, which can be Figure 1 The business server 100 or each terminal device in the network framework shown. The computer device can obtain a preset semantic recognition rule, which is used to represent the correspondence between the search information and the semantics. The search information is information such as text, pictures, etc. input by the user for searching for specific information. For example, the user can enter a search word to search for specific information, or enter a picture to search for information such as goods or services represented by the picture.

[0037] Therefore, the semantics corresponding to the search information entered by the user can be determined in the semantic recognition rule, thereby accurately recognizing the semantics of the search information. For example, the semantic recognition rule sets the semantics corresponding to the search term "group company" as the "department" field. When the search term entered by the user is "group company", the semantic recognition rule can quickly and accurately determine that its semantics represents the "department" field, thereby avoiding misjudgment as other fields and improving the accuracy of semantic recognition.

[0038] 202. Obtain a pre-trained semantic recognition model, where the pre-trained semantic recognition model is obtained by training training data using a machine learning algorithm;

[0039] The computer device may also obtain a pre-trained semantic recognition model, which may be, for example, a semantic recognition model such as a Generative Pre-Trained Transformer (GPT).

[0040] Among them, GPT is a pre-trained language model based on Transformer. It uses an unsupervised method to pre-train on a vast amount of text data and has powerful language understanding and generation capabilities. Moreover, prompt words can be used to enable the GPT model to understand and learn the user's intentions and requirements, so that the GPT model can determine its own semantic understanding ability. Prompt words can provide context and semantic information for the model, helping the model better understand the user's intentions and requirements to generate more accurate outputs, thereby helping the model better understand and process human language. In this way, in this embodiment, by using prompt words, the GPT model can understand the user's intentions and requirements. The prompt words can limit the output range of the GPT model or require the generation of specific types of information, helping the model generate more specific and relevant information, so as to obtain a semantic recognition model that can better identify the user input data, improving the efficiency and accuracy of identifying the user input data.

[0041] Therefore, for text input by the user such as "age greater than 30 years old", by invoking the powerful language understanding ability of the pre-trained semantic recognition model, the user's search needs can be accurately identified, determining that the user needs to search for personnel information with an age greater than 30 years old, greatly improving the accuracy and efficiency of semantic understanding and recognition.

[0042] 203. Receive the target search information input by the user, perform semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generate a search condition statement corresponding to the target search information based on the semantic recognition result;

[0043] When the user inputs the target search information to search for the information they need, the computer device can use the semantic recognition rule and / or the pre-trained semantic recognition model to perform semantic recognition on the target search information input by the user, and generate a search condition statement corresponding to the target search information based on the semantic recognition result. This search condition statement is used to represent the way of the information search operation. For example, this search condition statement can be a Structured Query Language (SQL) statement, or a Domain Specific Language (DSL) statement, or a search condition statement of other query languages.

[0044] For example, when the computer device performs semantic recognition on the search term "group company" input by the user according to the semantic recognition rule and determines that it represents the "department" field, a search condition statement corresponding to this search term can be generated based on this semantic recognition result. An example of the generated search condition statement can be "org_name like '%group company%'", where "org_name" represents the department name.

[0045] 204. Execute the search condition statement to perform information search, and output search results;

[0046] After the search condition statement is generated, the search condition statement can be executed to perform information search, and the search results are output to the user, so that the user can obtain the information that needs to be viewed.

[0047] In this embodiment, the computer device obtains preset semantic recognition rules, which are used to express the correspondence between search information and semantics, obtains a pre-trained semantic recognition model, which is obtained by training training data with a machine learning algorithm, performs semantic recognition on the target search information input by the user according to the semantic recognition rules and / or the pre-trained semantic recognition model, generates a search condition statement corresponding to the target search information based on the semantic recognition result, executes the search condition statement and outputs the search result. The semantic correspondence relationship set based on the semantic recognition rules can accurately identify the semantics corresponding to the search information, and the powerful language understanding ability based on the pre-trained semantic recognition model can accurately identify the user's search needs for the search information, greatly improving the accuracy and efficiency of semantic recognition, thereby improving the accuracy and efficiency of information search.

[0048] The following will be Figure 2 Based on the embodiment shown, the embodiment of the present application is further described in detail. Figure 3 Another embodiment of the information search method in the embodiment of the present application includes:

[0049] 301. Obtain a preset semantic recognition rule, where the semantic recognition rule is used to represent a correspondence between search information and semantics;

[0050] In this embodiment, the semantic recognition rule can represent the corresponding relationship between the search information and the semantics, so the semantics corresponding to the search information input by the user, that is, the semantics represented by the search information, can be determined according to the semantic recognition rule.

[0051] In an optional manner, the semantic recognition rule may include a dynamic semantic recognition rule and a static semantic recognition rule, wherein the dynamic semantic recognition rule is used to indicate the correspondence between the search information and the attribute field; and the static semantic recognition rule is used to indicate the correspondence between the search information and the specified field. The attribute field is a field related to the attribute of the search information, and the specified field is a field that is pre-specified to have a correspondence with the search information.

[0052] For high-frequency search terms, dynamic semantic recognition rules can be created, including name recognition rules, work number recognition rules, and account number recognition rules. For example, when a user enters the search term "12345678", the computer device determines that the attribute of the search term is a work number according to the semantic recognition rules, and then determines that the search term corresponds to the "work number" field. For another example, the computer device can maintain a name table in advance, and the name table can record the names of people within a certain range, such as the names of company employees, or the names of people working in the industry. When the user enters search terms related to names such as "Zhang San" and "Li Si", the name can be matched in the name table. If a match can be made, it is determined that the attribute of the search term entered by the user is a name, and then it is determined that the semantics corresponding to the search term entered by the user is the "name" field.

[0053] For the case where a specific search term corresponds to a specific specified field, a static semantic recognition rule can be established based on this. For example, when a user enters the search term "group company", the computer device can search in the information corresponding to the "department" field. In this case, the search term "group company" can be pre-specified to correspond to the "department" field. Therefore, when the user enters the search term "group company", the computer device determines that the search term corresponds to the "department" field according to the static semantic recognition rule, thereby achieving accurate semantic matching and recognition of the search information according to the user's customized needs.

[0054] 302. Obtain a pre-trained semantic recognition model, where the pre-trained semantic recognition model is obtained by training training data using a machine learning algorithm;

[0055] In an optional implementation of this embodiment, the pre-trained semantic recognition model can be a generative pre-trained transformer GPT model, and the GPT model is obtained by training the training data with a machine learning algorithm. When using the GPT model to perform semantic recognition on search information, the GPT model can first understand the user's intention based on the prompt words. Prompt words refer to the process of designing and optimizing the GPT model to guide GPT to generate specific texts. The core is to guide GPT to understand the user's search needs through prompt words and generate expected outputs. The output quality of the GPT model depends largely on the input prompt words. The accuracy of the GPT model output can be improved by carefully constructed prompt words. GPT prompt words are instructions or questions input by users when interacting with the GPT model, which are used to guide the model to generate specific outputs.

[0056] Therefore, a prompt word can be obtained, which includes role declaration information, part-of-speech mapping relationship, content requirements and format requirements of search condition statements, wherein the role declaration information is used to declare that the GPT model has the ability to understand language and generate search condition statements, and the part-of-speech mapping relationship is used to indicate the attribute field mapped by the search information. Afterwards, the prompt word can be input into the GPT model to enable the GPT model to understand the user's intention, so that the GPT model determines its own language understanding ability and ability to generate search condition statements and the user's intention based on the role declaration information, and determines the generation method of the search condition statement based on the part-of-speech mapping relationship, the content requirements and format requirements of the search condition statement.

[0057] For example, a prompt word may include multiple parts of content such as "role", "part-of-speech mapping relationship", "search content", "instructions", and "output format requirements". Among them, the "role" part declares the role of the GPT model and its language understanding ability and ability to generate search condition statements. The GPT model can then obtain the user's intention based on this, that is, the user requires the GPT model to perform semantic understanding based on the search content input by the user and output the corresponding SQL statement. For example, an exemplary role declaration information may be "You are a part-of-speech recognition and conditional search intelligent robot with professional human resources knowledge, language understanding ability, and database SQL expert, and can generate SQL statement conditions from the search content", or other role declaration information that expresses similar meanings to the above content.

[0058] The "part-of-speech mapping relationship" part is used to indicate the attribute field to which the search information is mapped, for example, it is used to indicate that when the search term "×× University" is entered, the search term can be mapped to the "education experience" field or the "work experience" field. The "search content" part indicates the search information entered by the user.

[0059] The "Description" part is used to indicate the content requirements that the GPT model needs to follow when generating search condition statements, such as requiring the GPT model to generate SQL statements that comply with the SQL99 standard, or specifying condition symbols such as =, LIKE, IN, >, <, etc., or specifying the content that the SQL statement should contain and the expression method of the logical relationship between multiple words, such as connecting multiple words with OR or AND, etc.

[0060] The "Output format requirements" section indicates the format requirements for the GPT model to generate SQL statements. For example, the GPT model can be instructed to generate SQL statements for search information keywords such as "Zhang San" and "30" as "{"result":"fnumber='1234567'AND fname like'%Zhang San%'AND(age>30or company_age<3)"}".

[0061] Therefore, through the above-mentioned prompt words, the GPT model can clarify its own role, language understanding ability and the ability to generate search condition statements based on the role declaration information, and determine the generation method of the search condition statement based on multiple parts of information such as the part-of-speech mapping relationship, the content requirements and format requirements of the search condition statement, so that the GPT model can accurately understand and recognize the search information input by the user, accurately obtain the user's search needs, and improve semantic understanding and recognition capabilities.

[0062] 303. Receive target search information input by a user, perform semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generate a search condition statement corresponding to the target search information based on the semantic recognition result;

[0063] When performing semantic recognition on the target search information input by the user according to semantic recognition rules and / or a pre-trained semantic recognition model, an optional implementation method is to determine whether the target search information represents corresponding semantics according to the semantic recognition rules; if so, generate a search condition statement corresponding to the target search information according to the semantics represented by the target search information; if not, call the pre-trained semantic recognition model to perform semantic recognition on the target search information, and generate a search condition statement corresponding to the target search information based on the semantic recognition results output by the model.

[0064] When the semantic recognition rules include dynamic semantic recognition rules and static semantic recognition rules, it can be determined whether the target search information represents the corresponding attribute field according to the dynamic semantic recognition rules, and / or it can be determined whether the target search information represents the corresponding designated field according to the static semantic recognition rules. If the target search information represents the corresponding attribute field, a search condition statement corresponding to the target search information is generated according to the attribute field represented by the target search information. If the target search information represents the corresponding designated field, a search condition statement corresponding to the target search information is generated according to the designated field represented by the target search information. If the target search information does not represent both the attribute field and the designated field, the pre-trained semantic recognition model is called to perform semantic recognition on the target search information, and a search condition statement corresponding to the target search information is generated based on the semantic recognition result.

[0065] For example, when a user enters a search term, if the attribute field corresponding to the search term representation entered by the user is determined according to the dynamic semantic recognition rule, a search condition statement is generated based on the attribute field of the search term representation. For example, when the user enters the search term "12345678", the "employee number" field can be determined according to the dynamic semantic recognition rule, and the search condition statement "employee_number = 12345678" can be generated based on the "employee number" field it represents; when the user enters the search term "Zhang San", the "name" field can be determined according to the dynamic semantic recognition rule, and the search condition statement "fname like '%Zhang San%'" can be generated based on the "name" field it represents.

[0066] Similarly, if the specified field corresponding to the search term representation entered by the user is determined according to the static semantic recognition rule, a search condition statement is generated based on the specified field of the search term representation. For example, when the user enters the search term "Group Company", the "department" field can be determined according to the static semantic recognition rule, and the search condition statement "org_name like '%Group Company%'" can be generated based on the "department" field it represents.

[0067] It should be noted that it can be to first perform semantic recognition on the search information input by the user according to the dynamic semantic recognition rule. If there is no corresponding semantics, then perform semantic recognition on the search information according to the static semantic recognition rule; or it can be to first perform semantic recognition on the search information input by the user according to the static semantic recognition rule. If there is no corresponding semantics, then perform semantic recognition on the search information according to the dynamic semantic recognition rule. This embodiment does not limit the execution order of the two.

[0068] If the attribute field represented by the search information is determined based on the dynamic semantic recognition rule, or the specified field represented by the search information is determined based on the static semantic recognition rule, then there is no need to call the pre-trained semantic recognition model to perform semantic recognition on the search information, which can reduce the number of calls to the GPT model and save the usage cost of GPT.

[0069] When the semantics represented by the search information input by the user cannot be recognized based on both the dynamic semantic recognition rule and the static semantic recognition rule, at this time, the GPT model can be called to perform semantic recognition on the search information, and the powerful language understanding ability of the GPT model can be used to further recognize the semantics of the search information, improving the success rate and accuracy of semantic recognition.

[0070] In the related solution, the search function of the software program supports the user to input multiple words, and the search function determines the corresponding semantics for each word. Then the multiple words represent multiple fields. However, when there are too many fields, sequentially performing the search operations for each field will consume a large amount of processing resources, and the execution efficiency is low, and the search performance deteriorates.

[0071] In response to this technical problem, in a preferred implementation of the present embodiment, a pre-trained semantic recognition model can be used to uniformly process multiple words. When the target search information input by the user includes multiple words, the pre-trained semantic recognition model can be called to perform semantic recognition on the multiple words. The pre-trained semantic recognition model can determine the logical relationship and / or nested structure between the multiple words, and generate search condition statements corresponding to the multiple words based on the logical relationship and / or nested structure between the multiple words, thereby realizing unified processing of multiple words.

[0072] The logical relationship represents the processing logic between multiple words, such as "AND", "OR" and other relational words that represent the processing logic. The nested structure is used to indicate that part of the structure in a statement is represented in a nested form in the entire statement, and the nested structure is treated as a whole. Usually, brackets "()" can be used to represent the nested structure. For example, in the statement "education_code = '01' AND (age>30or company_age<3)", "age>30or company_age<3" is a nested structure, and when the statement is executed, the nested structure is treated as a whole.

[0073] For example, there are two ways to define the data structure of a search condition statement, one is the JSON structure, and the other is the SQL clause structure. The use of the SQL clause data structure can well express the nested structure in the statement concisely.

[0074] Therefore, when a user inputs multiple words at one time, the computer device can call the pre-trained semantic recognition model only once to uniformly process and semantically recognize the multiple words input by the user at one time. There is no need to call the pre-trained semantic recognition model for each word separately, thereby reducing the number of calls to the model.

[0075] For example, when a user inputs N words, calling the GPT model interface once to semantically recognize N words at the same time is more effective than calling the GPT model N times to recognize them separately. For example, the two words "education level is undergraduate" and "age is less than 30 years old or length of service is less than 3 years" are called twice. The first time, the GPT model is called for "education level is undergraduate" and the returned result "education_code = '01'" is recorded. The second time, the GPT model is called for "age is less than 30 years old or length of service is less than 3 years" and the returned result "age>30or company_age<3" is recorded. The two words are combined according to the "and" relationship "education_code = '01' AND (age>30or company_age<3)". As the number of words entered by the user increases, the time consumption, performance consumption, and resource consumption of this processing method will increase linearly, greatly reducing the processing performance.

[0076] In this embodiment, the GPT model can be called only once, and multiple words input by the user can be semantically recognized and processed at one time, and a search condition statement can be generated based on the logical relationship between the multiple words. For example, the relationship between the multiple words is recognized as "AND", and then the search condition statement "education_code = '01' AND (age>30orcompany_age<3)" is generated at one time. Therefore, only one GPT call is needed to perform semantic recognition on multiple words at the same time, which improves the accuracy and efficiency of semantic recognition, reduces the number of GPT calls, and saves the cost of using GPT.

[0077] 304. Storing the search condition statement;

[0078] In this embodiment, after the search condition statement is generated, the search condition statement can be stored, for example, the search condition statement can be cached, so that when the user enters the same search information, the search condition statement can be directly obtained from the cache and executed without performing semantic recognition again, which can greatly reduce the operation steps and processing resource consumption, while improving the response speed to user search requests and improving user experience.

[0079] 305. Execute the search condition statement to perform information search, and output search results;

[0080] When a search condition statement is generated, the computer device executes the search condition statement to search for information and outputs search results. For example, the searched information may be displayed on an interface for a user to view.

[0081] The computer device can use a preset searcher to search for information. In order for the preset searcher to perform information search, a search condition statement corresponding to a preset query language can be generated based on the semantic recognition results. The preset query language is provided by the preset searcher, so that the search condition statement can be executed by the preset searcher, and then the search condition statement can be executed in the preset searcher to perform information search and output search results.

[0082] For example, the preset search engine can be an Elasticsearch search engine. Elasticsearch (ES for short) is a distributed, scalable, real-time search and data analysis engine. ES is not only full-text search, but also supports structured search, data analysis, complex language processing, geographic location processing, and object association relationship processing. Elasticsearch provides a DSL language based on JSON to define the query language, so that the semantic recognition results can be parsed into DSL statements. DSL statements are concise and easy to use. In ElasticSearch, DSL is used to construct search condition statements to realize the search, filtering, and sorting of data in the index data. For example, the clause "fnumber = '10050419'" returned by the GPT model can be parsed into a DSL statement. For example, the DSL statement obtained by parsing can be expressed as ""fnumber.keyword":{"value":"10050419"}", and the statement is executed in the Elasticsearch search engine to search for information. The searched data can be displayed in the interface for users to view.

[0083] Of course, if other search engines are used, the semantic recognition results can be parsed into search condition statements in other languages; or, if searching in a database, the semantic recognition results can be parsed into SQL statements, and the SQL statements can be executed in the database to search for information, which is not limited here.

[0084] When executing the search condition statement to search for information, the output search results can display the search results obtained from the current information search on the current page of the screen. If the user has a need to turn the page, that is, needs to switch to view the information on the next page, then a page switching instruction to switch the current page to the next page can be input, and the computer device responds to the switching instruction. Since the search information remains unchanged, it means that the search condition statement can still use the search condition statement executed in the last search, so the previously stored search condition statement can be obtained, and the pre-stored search condition statement can be executed to search for information, and the search results obtained from the current information search can be displayed on the next page.

[0085] Due to the limitation of the page display size, when searching, the information of the corresponding data volume is generally searched according to the data volume that can be displayed on the page. For example, if the page can only display 10 items of data, only 10 items of data are searched and displayed when the search results of the current page are displayed, and other data are searched and displayed on the next page when the next page is displayed. Compared with searching and obtaining all data at one time, searching by page can save processing resources, and can also speed up the search and acquisition of data, as well as improve the rendering speed of the page. For example, the user enters the search term "Zhang San", the computer device generates a search condition statement corresponding to the search term, stores the search condition statement, executes the search condition statement and displays the search results of the current page, assuming that the first 10 items of data numbered 01 to 10 are displayed; when a page turning instruction is detected, the search term is still "Zhang San", the pre-stored search condition statement can be obtained and executed, and the next 10 items of data numbered 11 to 20 can be displayed on the next page.

[0086] Therefore, when performing a page search, the search condition statement is cached for execution when the page is turned subsequently, thereby eliminating the need to generate the search condition statement again for the search information entered by the user. This can reduce the number of operation steps and improve the efficiency of information search execution. It also improves the page rendering speed, reduces the number of calls to the GPT model, and reduces the cost of using the GPT model.

[0087] In this embodiment, if the semantic recognition of the target search information input by the user cannot identify the corresponding semantics according to the semantic recognition rules and the pre-trained semantic recognition model, that is, the semantic recognition fails and the search condition statement cannot be generated, then the field information matching the target search information can be retrieved from the full amount of information, that is, full-text search is performed, and the field information matching the target search information is returned, that is, the search results are returned. The full amount of information can be all information within a specific range, such as information of all employees within an enterprise, or information of practitioners in an industry, etc.

[0088] Therefore, through full-text retrieval, it can be ensured that the search information entered by the user matches the corresponding field data as much as possible, thereby improving the success rate of information search.

[0089] Based on the above embodiments and various implementations thereof, the application architecture of the information search method of the present application embodiment is further described in detail by taking the search for talent information as an example. Figure 4In the application architecture shown, its core components include four modules: "GPT semantic recognition", "custom semantic recognition accurator", "parsing conditions" and "retrieval layer". Among them, the front-end module displays the talent search function and receives the characteristic words of talent information input by the user (such as words describing the characteristics of name, age, etc.); in the semantic recognition layer, the characteristic words input by the user can be recognized by the custom dynamic semantic recognition rules first. If there is no corresponding semantics, the recognition based on the custom static semantic recognition rules is then performed, thereby realizing the dual calibration of semantic recognition. If the custom semantic calibration is not performed, then the GPT semantic real-time recognition is entered; the conditional parser can parse the semantic recognition results output by the semantic recognition layer into search condition statements, and the retrieval layer executes the search condition statements and returns the search results; when the GPT semantic recognition is unsuccessful, it automatically switches to full-text search, and finally returns the retrieved talent information list to the interface for display, and the user can view the required information.

[0090] The above describes the information search method in the embodiment of the present application. The following describes the computer device in the embodiment of the present application. Figure 5 In the embodiment of the present application, one embodiment of the computer device includes:

[0091] A first acquisition unit, used to acquire a preset semantic recognition rule, wherein the semantic recognition rule is used to represent the corresponding relationship between the search information and the semantics;

[0092] A second acquisition unit is used to acquire a pre-trained semantic recognition model, where the pre-trained semantic recognition model is obtained by training the training data using a machine learning algorithm;

[0093] A semantic recognition unit, configured to receive target search information input by a user, perform semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generate a search condition statement corresponding to the target search information based on the semantic recognition result;

[0094] The search unit is used to execute the search condition statement to search for information and output the search result.

[0095] In a preferred implementation of this embodiment, the semantic recognition unit is specifically used for:

[0096] Determining whether the target search information represents corresponding semantics according to the semantic recognition rule;

[0097] If yes, generating a search condition statement corresponding to the target search information according to the semantics represented by the target search information;

[0098] If not, the pre-trained semantic recognition model is called to perform semantic recognition on the target search information, and a search condition statement corresponding to the target search information is generated based on the semantic recognition result.

[0099] In a preferred implementation of this embodiment, the semantic recognition rule includes a dynamic semantic recognition rule and a static semantic recognition rule, wherein the dynamic semantic recognition rule is used to represent the corresponding relationship between the search information and the attribute field; the static semantic recognition rule is used to represent the corresponding relationship between the search information and the specified field; wherein the attribute field is a field related to the attribute of the search information, and the specified field is a field that is pre-specified to have a corresponding relationship with the search information;

[0100] The semantic recognition unit is specifically used for:

[0101] Determining whether the target search information represents the corresponding attribute field according to the dynamic semantic recognition rule, and / or determining whether the target search information represents the corresponding designated field according to the static semantic recognition rule;

[0102] If the target search information represents the corresponding attribute field, generating a search condition statement corresponding to the target search information according to the attribute field represented by the target search information;

[0103] If the target search information represents the corresponding designated field, generating a search condition statement corresponding to the target search information according to the designated field represented by the target search information;

[0104] If the target search information does not represent the attribute field and the designated field, the pre-trained semantic recognition model is called to perform semantic recognition on the target search information, and a search condition statement corresponding to the target search information is generated based on the semantic recognition result.

[0105] In a preferred implementation of this embodiment, the target search information includes a plurality of words;

[0106] The semantic recognition unit is specifically used for:

[0107] The pre-trained semantic recognition model is called to perform semantic recognition on the multiple words to determine the logical relationship and / or nested structure between the multiple words, and based on the logical relationship and / or nested structure between the multiple words, search condition statements corresponding to the multiple words are generated.

[0108] In a preferred implementation of this embodiment, the pre-trained semantic recognition model is a generative pre-trained transformer GPT model;

[0109] The second acquisition unit is specifically used for:

[0110] Obtain a GPT model, where the GPT model is obtained by training training data using a machine learning algorithm;

[0111] Obtain prompt words, wherein the prompt words include role declaration information, part-of-speech mapping relationship, and content requirements and format requirements of search condition statements; the role declaration information is used to declare that the GPT model has language understanding capabilities and the ability to generate search condition statements; the part-of-speech mapping relationship is used to indicate the attribute field mapped by the search information;

[0112] The prompt word is input into the GPT model so that the GPT model can understand the intent, so that the GPT model determines its own language understanding ability and ability to generate search condition statements and determine the user's intent based on the role declaration information, and determines the generation method of the search condition statement based on the part-of-speech mapping relationship and the content requirements and format requirements of the search condition statement.

[0113] In a preferred implementation of this embodiment, the semantic recognition unit is specifically used for:

[0114] generating the search condition statement corresponding to a preset query language based on the semantic recognition result, wherein the preset query language is provided by a preset searcher;

[0115] The search unit is specifically used for:

[0116] The search condition statement is executed in the preset searcher to perform information search, and the search result is output.

[0117] In a preferred implementation of this embodiment, the computer device further includes:

[0118] A storage unit, used for storing the search condition statement;

[0119] The search unit is specifically used for:

[0120] Execute the search condition statement to search for information, and display the search results obtained from the current information search on the current page;

[0121] When a page switching instruction input by the user to switch the current page to a next page is received, the pre-stored search condition statement is executed to perform information search, and the search results obtained from the current information search are displayed on the next page.

[0122] In this embodiment, the operations performed by each unit in the computer device are the same as those described above. Figures 2 to 3 The description in the illustrated embodiment is similar and will not be repeated here.

[0123] The computer device in the embodiment of the present application is described below. Figure 6In the embodiment of the present application, one embodiment of the computer device includes:

[0124] The computer device 600 may include one or more central processing units (CPU) 601 and a memory 605 , wherein the memory 605 stores one or more application programs or data.

[0125] The memory 605 may be a volatile storage or a persistent storage. The program stored in the memory 605 may include one or more modules, each of which may include a series of instruction operations in the computer device. Furthermore, the central processing unit 601 may be configured to communicate with the memory 605 and execute a series of instruction operations in the memory 605 on the computer device 600.

[0126] The computer device 600 may also include one or more power supplies 602, one or more wired or wireless network interfaces 603, one or more input and output interfaces 604, and / or one or more operating systems, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0127] The CPU 601 can execute the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment will not be described in detail here.

[0128] The present application also provides a computer storage medium, wherein one embodiment includes: the computer storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment.

[0129] The present application also provides a computer program product, wherein one embodiment includes: when the computer program product is run on a computer device, the computer device executes the aforementioned Figures 2 to 3 The operations performed by the computer device in the illustrated embodiment.

[0130] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0131] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

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

[0133] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0134] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.

Claims

1. An information search method, characterized in that: include: Acquire a preset semantic recognition rule, wherein the semantic recognition rule is used to represent the corresponding relationship between the search information and the semantics; Obtaining a pre-trained semantic recognition model, wherein the pre-trained semantic recognition model is obtained by training training data using a machine learning algorithm; Receive target search information input by a user, perform semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generate a search condition statement corresponding to the target search information based on the semantic recognition result; The search condition statement is executed to perform information search, and the search result is output.

2. The method according to claim 1, characterized in that The performing semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generating a search condition statement corresponding to the target search information based on the semantic recognition result, includes: Determining whether the target search information represents corresponding semantics according to the semantic recognition rule; If yes, generating a search condition statement corresponding to the target search information according to the semantics represented by the target search information; If not, the pre-trained semantic recognition model is called to perform semantic recognition on the target search information, and a search condition statement corresponding to the target search information is generated based on the semantic recognition result.

3. The method according to claim 2, characterized in that The semantic recognition rules include dynamic semantic recognition rules and static semantic recognition rules. The dynamic semantic recognition rules are used to represent the corresponding relationship between the search information and the attribute field; the static semantic recognition rules are used to represent the corresponding relationship between the search information and the specified field; wherein the attribute field is a field related to the attribute of the search information, and the specified field is a field that is pre-specified to have a corresponding relationship with the search information; The step of judging whether the target search information represents corresponding semantics according to the semantic recognition rule includes: Determining whether the target search information represents the corresponding attribute field according to the dynamic semantic recognition rule, and / or determining whether the target search information represents the corresponding designated field according to the static semantic recognition rule; Generating a search condition statement corresponding to the target search information according to the semantics represented by the target search information includes: If the target search information represents the corresponding attribute field, generating a search condition statement corresponding to the target search information according to the attribute field represented by the target search information; If the target search information represents the corresponding designated field, generating a search condition statement corresponding to the target search information according to the designated field represented by the target search information; The calling of the pre-trained semantic recognition model to perform semantic recognition on the target search information, and generating a search condition statement corresponding to the target search information based on the semantic recognition result, includes: If the target search information does not represent the attribute field and the designated field, the pre-trained semantic recognition model is called to perform semantic recognition on the target search information, and a search condition statement corresponding to the target search information is generated based on the semantic recognition result.

4. The method according to claim 2 or 3, characterized in that: The target search information includes a plurality of words; The calling of the pre-trained semantic recognition model to perform semantic recognition on the target search information, and generating a search condition statement corresponding to the target search information based on the semantic recognition result, includes: The pre-trained semantic recognition model is called to perform semantic recognition on the multiple words to determine the logical relationship and / or nested structure between the multiple words, and based on the logical relationship and / or nested structure between the multiple words, search condition statements corresponding to the multiple words are generated.

5. The method according to claim 1, characterized in that: The pre-trained semantic recognition model is a generative pre-trained transformer GPT model; The obtaining of the pre-trained semantic recognition model comprises: Obtain a GPT model, where the GPT model is obtained by training training data using a machine learning algorithm; Obtain prompt words, wherein the prompt words include role declaration information, part-of-speech mapping relationship, and content requirements and format requirements of search condition statements; the role declaration information is used to declare that the GPT model has language understanding capabilities and the ability to generate search condition statements; the part-of-speech mapping relationship is used to indicate the attribute field mapped by the search information; The prompt word is input into the GPT model so that the GPT model can understand the intent, so that the GPT model determines its own language understanding ability and ability to generate search condition statements and determine the user's intent based on the role declaration information, and determines the generation method of the search condition statement based on the part-of-speech mapping relationship and the content requirements and format requirements of the search condition statement.

6. The method according to claim 1, characterized in that The generating of a search condition statement corresponding to the target search information based on the semantic recognition result includes: generating the search condition statement corresponding to a preset query language based on the semantic recognition result, wherein the preset query language is provided by a preset searcher; The executing the search condition statement to search for information and outputting search results includes: The search condition statement is executed in the preset searcher to perform information search, and the search result is output.

7. The method according to any one of claims 1 to 6, characterized in that: After generating the search condition statement corresponding to the target search information based on the semantic recognition result, the method further includes: storing the search condition statement; The executing the search condition statement to search for information and outputting search results includes: Execute the search condition statement to search for information, and display the search results obtained from the current information search on the current page; When a page switching instruction input by the user to switch the current page to a next page is received, the pre-stored search condition statement is executed to perform information search, and the search results obtained from the current information search are displayed on the next page.

8. A computer device, characterized in that: include: A first acquisition unit, used to acquire a preset semantic recognition rule, wherein the semantic recognition rule is used to represent the corresponding relationship between the search information and the semantics; A second acquisition unit is used to acquire a pre-trained semantic recognition model, where the pre-trained semantic recognition model is obtained by training the training data using a machine learning algorithm; A semantic recognition unit, configured to receive target search information input by a user, perform semantic recognition on the target search information according to the semantic recognition rule and / or the pre-trained semantic recognition model, and generate a search condition statement corresponding to the target search information based on the semantic recognition result; The search unit is used to execute the search condition statement to search for information and output the search result.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 7.

11. A computer program product, characterized in that When the computer program product is executed on a computer device, the computer device is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Method and device for realizing semantic search

    CN120541200A