Search

CN-122019576-A - Method, apparatus, storage medium and program product for query processing and case query

CN122019576ACN 122019576 ACN122019576 ACN 122019576ACN-122019576-A

Abstract

The application provides a method, equipment, a storage medium and a program product for query processing and case query. The method comprises the steps of introducing a query structuring model and a query structuring sample library, searching a reference sample matched with the target query and the target structuring pattern in the sample library by acquiring the target query to be processed and the target structuring pattern corresponding to the target query, automatically screening the reference sample which has higher correlation with the current target query and the target structuring pattern, inputting the reference sample and the target query into the query structuring model together, structuring the target query according to the target structuring pattern and the reference sample by the query structuring model, obtaining structuring information of the target query, improving the accuracy and quality of the query structuring, and searching in a search library according to the target query and the structuring information to obtain a search result matched with the target query, thereby improving the search accuracy.

Inventors

  • Qing Lizhi
  • LIN JUN
  • Long Dingkun
  • SUN CHANGLONG
  • XIE PENGJUN

Assignees

  • 阿里巴巴(中国)有限公司

Dates

Publication Date
20260512
Application Date
20241111

Claims (17)

  1. 1. A method of query processing, comprising: Acquiring target queries to be processed and target structuring modes corresponding to the target queries; Searching a sample library for a reference sample matched with the target query and the target structured pattern; Inputting the target query, the target structuring mode and the reference sample into a query structuring model, and structuring the target query according to the target structuring mode and the reference sample through the query structuring model to obtain structuring information of the target query; And searching in a search library according to the target query and the structural information to obtain a search result matched with the target query.
  2. 2. The method of claim 1, wherein searching in a sample library for reference samples that match the target query and the target structured schema comprises: calculating the similarity between the target query and the target structuring pattern and the alternative samples in the sample library; And determining a reference sample matched with the target query and the target structured pattern according to the similarity.
  3. 3. The method of claim 2, wherein the candidate samples include query information, structured patterns, and structured results, and wherein the computing the similarity of the target query and the target structured patterns to the candidate samples in the sample library comprises: For any alternative sample in the sample library, calculating a first similarity between query information in the alternative sample and the target query, and calculating a second similarity between a structuring pattern in the alternative sample and the target structuring pattern; And according to the target query and the weight coefficient corresponding to the target structuring pattern, weighting and summing the first similarity and the second similarity to obtain the similarity between the target query and the target structuring pattern and the alternative sample.
  4. 4. The method of claim 3, wherein the weighting and summing the first similarity and the second similarity according to the weight coefficients corresponding to the target query and the target structured schema, before obtaining the similarities of the target query and the target structured schema to the candidate sample, further comprises: and configuring the weight coefficients corresponding to the target query and the target structuring mode according to the current query system.
  5. 5. The method of claim 4, wherein configuring the weight coefficients corresponding to the target query and the target structured schema according to the current query system comprises: If the target structuring mode is fixedly used in the current query system, the weight coefficient corresponding to the target structuring mode is configured to be larger than the weight coefficient corresponding to the target query.
  6. 6. The method as recited in claim 1, further comprising: the sample library is constructed, the sample library comprises at least one alternative sample, and the alternative sample comprises query information, and a structuring mode and a structuring result corresponding to the query information.
  7. 7. The method of claim 6, wherein said constructing said sample library comprises: Collecting query information of various query systems, and acquiring at least one example of alternative samples in the sample library; Generating a structuring mode and a structuring result corresponding to the query information according to the at least one example through a large language model; And generating alternative samples according to the query information, and the structuring mode and the structuring result corresponding to the query information, and constructing a sample library containing the alternative samples.
  8. 8. The method of any of claims 1-7, wherein after obtaining the structured information of the target query, further comprising: Generating new alternative samples according to the target query, the target structuring pattern and the structuring information, and adding the new alternative samples into the sample library.
  9. 9. The method of claim 8, wherein generating new candidate samples from the target query, the target structured schema, and the structured information comprises: Outputting the target query, the target structuring mode and the structuring information through a verification marking interface; Responding to the labeling operation of the target structuring mode and the structuring information in the verification labeling interface, and acquiring the labeled structuring mode and structuring information; And generating a new alternative sample according to the target query and the noted structured mode and structured information.
  10. 10. The method of any of claims 1-7, wherein the inputting the target query, the target structuring schema, and the reference sample into a query structuring model comprises: Inserting the target query and the target structuring pattern into a query slot and a pattern slot in a prompting word respectively, and inserting the reference sample into a history information slot in the prompting word to obtain structuring prompting information; And inputting the structured prompt information into the query structured model.
  11. 11. The method according to any one of claims 1-7, wherein the obtaining the target query to be processed and the target structuring pattern corresponding to the target query comprises: Receiving a target query input in a query interface provided by a query system; obtaining a structured mode configured in the query system as a target structured mode corresponding to the target query; wherein the structured schema used by the different querying systems is different.
  12. 12. A case query method, comprising: acquiring target queries input in a query interface of a legal case query system and target structuring modes configured by the legal case query system; Searching a sample library for a reference sample matched with the target query and the target structured pattern; Inputting the target query, the target structuring mode and the reference sample into a query structuring model, and structuring the target query according to the target structuring mode and the reference sample through the query structuring model to obtain structuring information of the target query; retrieving in a legal case library according to the target query and the structured information to obtain case information matched with the target query; and outputting case information matched with the target query.
  13. 13. The method as recited in claim 12, further comprising: the sample library is constructed, the sample library comprises at least one alternative sample, and the alternative sample comprises query information, and a structuring mode and a structuring result corresponding to the query information.
  14. 14. The method of claim 12 or 13, wherein said inputting the target query, the target structuring pattern, and the reference sample into a query structuring model comprises: Inserting the target query and the target structuring pattern into a query slot and a pattern slot in a prompting word respectively, and inserting the reference sample into a history information slot in the prompting word to obtain structuring prompting information; And inputting the structured prompt information into the query structured model.
  15. 15. A server for a server, which comprises a server and a server, characterized by comprising the following steps: at least one processor, and A memory communicatively coupled to the at least one processor; wherein the server stores instructions executable by the at least one processor to cause the server to perform the method of any of claims 1-14.
  16. 16. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor implement the method of any of claims 1-14.
  17. 17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-14.

Description

Method, apparatus, storage medium and program product for query processing and case query Technical Field The present application relates to computer technology, and in particular, to a method, apparatus, storage medium and program product for query processing and case query. Background With the continuous development of internet technology, the application of query systems, such as legal case search systems, literature search systems, commodity information search systems, etc., is also becoming more and more widespread. The query system can search according to query information (query) input by a user, and quickly find content wanted by the user from massive candidate information. In the current query system, candidate information matched with query information is searched by semantically matching the query information input by a user with the candidate information in a search library. However, the information query relying on semantic matching cannot meet the requirement of strong definition of a user, and the user is required to manually input or check screening conditions to configure a structured mode (schema) to realize the structuring of a query so as to clear the requirement of user retrieval, and the quality of the structured schema configured by the user seriously affects the accuracy of the query. Disclosure of Invention The application provides a method, equipment, a storage medium and a program product for query processing and case query, which are used for solving the problem that in the current query system, a user is required to manually configure a structured schema, and the quality of the structured schema configured by the user seriously affects the accuracy of the query. In a first aspect, the present application provides a query processing method, including: Acquiring target queries to be processed and target structuring modes corresponding to the target queries; Searching a sample library for a reference sample matched with the target query and the target structured pattern; Inputting the target query, the target structuring mode and the reference sample into a query structuring model, and structuring the target query according to the target structuring mode and the reference sample through the query structuring model to obtain structuring information of the target query; And searching in a search library according to the target query and the structural information to obtain a search result matched with the target query. In a second aspect, the present application provides a case query method, including: acquiring target queries input in a query interface of a legal case query system and target structuring modes configured by the legal case query system; Searching a sample library for a reference sample matched with the target query and the target structured pattern; Inputting the target query, the target structuring mode and the reference sample into a query structuring model, and structuring the target query according to the target structuring mode and the reference sample through the query structuring model to obtain structuring information of the target query; retrieving in a legal case library according to the target query and the structured information to obtain case information matched with the target query; and outputting case information matched with the target query. In a third aspect, the present application provides a server comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor for causing the server to perform the method provided in any of the preceding aspects. In a fourth aspect, the present application provides a computer readable storage medium having stored therein computer executable instructions which, when executed by a processor, implement a method as provided in any of the preceding aspects. In a fifth aspect, the application provides a computer program product comprising a computer program which, when executed by a processor, implements a method as provided in any of the preceding aspects. The query processing and case query method, device, storage medium and program product provided by the application introduce a query structuring model to realize user query structuring, provide a query structured sample library, search a reference sample matched with the target query and the target structuring pattern in the sample library by acquiring the target query to be processed and the target structuring pattern corresponding to the target query when query is carried out, automatically screen a reference sample which is more relevant to the current target query and the target structuring pattern, input the reference sample and the target query and the target structuring pattern into the query structuring model together, and carry out structuring on the target query according to the target structuring pattern and the reference sample by the que