CN116662633A - Search method, model training method, device, electronic equipment and storage medium - Google Patents

Search method, model training method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116662633A
CN116662633A CN202211666281.5A CN202211666281A CN116662633A CN 116662633 A CN116662633 A CN 116662633A CN 202211666281 A CN202211666281 A CN 202211666281A CN 116662633 A CN116662633 A CN 116662633A
Authority
CN
China
Prior art keywords
search
search result
query information
target query
semantic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211666281.5A
Other languages
Chinese (zh)
Inventor
何欣燃
潘秋桐
何伯磊
安叶嵩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu China Co Ltd
Original Assignee
Baidu China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu China Co Ltd filed Critical Baidu China Co Ltd
Priority to CN202211666281.5A priority Critical patent/CN116662633A/en
Publication of CN116662633A publication Critical patent/CN116662633A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9532Query formulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/194Calculation of difference between files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The disclosure relates to the technical field of artificial intelligence, in particular to the field of intelligent search, and specifically relates to a search method, a model training method, a device, electronic equipment and a storage medium. The specific implementation scheme is as follows: acquiring target query information and search text associated with the target query information; vectorizing based on target query information and search text, performing semantic recall to obtain a first candidate set, and sequencing the search text in the first candidate set to obtain a first search result; performing keyword recall based on the target query information and the search text to obtain a second candidate set, and sequencing the search text in the second candidate set to obtain a second search result; and fusing the first search result and the second search result to obtain a third search result. The present disclosure provides semantic search capability and improves ordering accuracy by using semantic recall and keyword recall simultaneously, and fusing results of semantic recall and keyword recall.

Description

Search method, model training method, device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of artificial intelligence, in particular to the field of intelligent search, and specifically relates to a search method, a model training method, a device, electronic equipment and a storage medium.
Background
The traditional AI (artificial intelligence) model has high development cost, long period and slow iteration, and cannot adapt to the business requirements of agile innovation of enterprises. Along with the penetration of the AI technology from a high-frequency main stream scene to a low-frequency long tail scene, the contradiction between scene fragmentation and 'manual workshop' development is increased, challenges are presented to the AI technology, and the industrialization process of the AI is limited.
The ranking model used in the prior art for searching products is used as one of the conventional AI models, and the problems also exist. In addition, the traditional sorting model is light, the sorting accuracy is insufficient, the semantic generalization capability of the model is not strong, and pain points which can not provide semantic recall and have no semantic searching capability exist.
Disclosure of Invention
The present disclosure provides a search method, a model training method, a search device, a model training device, an electronic apparatus, and a storage medium.
According to a first aspect of the present disclosure, there is provided a search method including:
acquiring target query information and search text associated with the target query information;
performing vectorization processing based on the target query information and the search text, performing semantic recall to obtain a first candidate set comprising a plurality of the search texts, and sequencing the plurality of the search texts in the first candidate set to obtain a first search result;
performing keyword recall based on the target query information and the search text to obtain a second candidate set comprising a plurality of search texts, and sorting the plurality of search texts in the second candidate set to obtain a second search result;
and fusing the first search result and the second search result to obtain a third search result.
According to a second aspect of the present disclosure, there is provided a model training method comprising:
taking the internal search log as a training sample to train the basic model;
performing model distillation on the basic model obtained after training to obtain a semantic search model; the semantic search model is applied to the search method according to any one of the technical schemes, and is used for obtaining the first search result based on the target query information and the search text.
According to a third aspect of the present disclosure, there is provided a search apparatus including:
the acquisition module is configured to acquire target query information and search text associated with the target query information;
the semantic search module is configured to perform vectorization processing on the basis of the target query information and the search text, then perform semantic recall to obtain a first candidate set comprising a plurality of the search texts, and sort the plurality of the search texts in the first candidate set to obtain a first search result;
the keyword searching module is configured to recall keywords based on the target query information and the search texts to obtain a second candidate set comprising a plurality of search texts, and order the plurality of search texts in the second candidate set to obtain second search results;
and the fusion module is configured to fuse the first search result and the second search result to obtain a third search result.
According to a fourth aspect of the present disclosure, there is provided a model training apparatus comprising:
the training module is configured to train the basic model by taking the internal search log as a training sample;
the model distillation module is configured to perform model distillation on the basic model obtained after training to obtain a semantic search model; the semantic search model is applied to the search method according to any one of the technical schemes, and is used for obtaining the first search result based on the target query information and the search text.
According to a fifth aspect of the present disclosure, there is provided an electronic device 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 to enable the at least one processor to perform the search method or the model training method of any of the above-described solutions.
According to a sixth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the search method or the model training method of any one of the above-described technical solutions.
According to a seventh aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the search method or the model training method of any of the above technical solutions.
The present disclosure provides a search method, a model training method, a search apparatus, a model training apparatus, an electronic device, and a storage medium, and simultaneously uses semantic recall and keyword recall, and fuses results of the semantic recall and the keyword recall, providing semantic search capability, and improving sorting accuracy.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a schematic diagram of steps of a search method in an embodiment of the present disclosure;
FIG. 2 is a flow diagram of semantic search model recall and ordering in an embodiment of the present disclosure;
FIG. 3 is a flow chart of search result fusion in an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of steps of a model training method in an embodiment of the present disclosure;
FIG. 5 is a functional block diagram of a search apparatus in an embodiment of the present disclosure;
FIG. 6 is a functional block diagram of a semantic search module in an embodiment of the present disclosure;
FIG. 7 is a functional block diagram of a keyword search module in an embodiment of the present disclosure;
FIG. 8 is a functional block diagram of a fusion module in an embodiment of the present disclosure;
FIG. 9 is a functional block diagram of a model training module in an embodiment of the present disclosure;
fig. 10 is a schematic block diagram of an example electronic device in an embodiment of the disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Aiming at the technical problems of lack of semantic searching capability and insufficient ordering accuracy in the prior art, the disclosure provides a searching method, as shown in fig. 1, comprising the following steps:
step S101, obtaining target query information and a search text associated with the target query information. The target query information refers to a query of a user, wherein the query can comprise a query term input by the user and can also comprise portrait data of the user, and the portrait data comprises but is not limited to: basic data such as name, gender, age, etc.; behavior data of the user, such as user purchase, collection, website residence time, etc.; transaction data such as purchase frequency, purchase product price, etc.; and the relationship data such as friends, the number of friends and the like of the user. Search text documents (texts, abbreviated doc) related to the query are queried in an internal search database based on the query of the user.
Step S102, after vectorization processing is carried out on the basis of the target query information and the search texts, semantic recall is carried out to obtain a first candidate set comprising a plurality of search texts, and search texts in the first candidate set are ordered to obtain a first search result. In this embodiment, a semantic search model obtained by fine tuning based on a basic model (also referred to as a big model) is used for semantic recall, the semantic search model includes an ERNIE double-tower model and an ERNIE sorting model, where the ERNIE double-tower model includes a query portion and a doc portion, the query portion and the doc portion are used for vectorizing search texts in a query and internal search database of a user respectively, an HNSW (hierarchical navigable world) algorithm based on a Faiss architecture is further used for semantic vector recall, a doc corresponding to a doc vector with higher semantic similarity recall similarity between the query vector and the doc vector, namely, a first candidate set is calculated, and the doc combined by the first candidate is sorted by using the ERNIE sorting model to obtain a semantic search result, namely, a first search result.
Step S103, carrying out keyword recall based on the target query information and the search texts to obtain a second candidate set comprising a plurality of search texts, and sorting the search texts in the second candidate set to obtain a second search result. The recall part uses a search engine solr to recall keyword term hits, and the ranking part uses a lightGBM (lightgradientboosting machine, a distributed gradient lifting framework based on decision tree algorithm) trained LTR (learning ranking) model to rank. In the keyword recall process, firstly, word segmentation is carried out on the queries to obtain term of each query, then each term in each search text is traversed, and if term of the query is hit in all search text, the search text is recalled. Because the search result of the large model has poor scene effect in the absence of semantics, for example, the query comprises names of people, mailboxes, characters with underlines and special meanings, and the like, the large model is not required to expand semantics at the moment, and the accuracy of recall based on term hit is higher. Therefore, when the large model is used for semantic recall, the LTR model is used for term hit recall as a spam, and the search result of the LTR model can be preferentially used under certain scenes lacking semantics, so that the accuracy of search is ensured while the semantic search function is provided, and the multi-way recall has the advantages of two recall modes, so that the semantic generalization capability can be improved, and the accuracy of model recall can be ensured.
Step S104, fusing the first search result and the second search result to obtain a third search result. The first search result is the result of semantic search, the second search result is the result of keyword search, and although the two search modes are different, the content of the first search result and the second search result usually has a overlapped part, so that the first search result and the second search result need to be fused, filtered, de-duplicated and the like, and then the final search result, namely the third search result, is output. By fusing the first search result and the second search result, the accuracy of the search results can be further improved.
As an optional implementation manner, step S102 performs vectorization processing based on the target query information and the search text, performs semantic recall to obtain a first candidate set including a plurality of search texts, and ranks the search texts in the first candidate set to obtain a first search result, where the step includes:
as shown in fig. 2, in step S201, a target query information query is vectorized to obtain a target query information vector, and a search text doc is vectorized to obtain a plurality of search text vectors. The query and doc are respectively input into the query part and the doc part of the ERNIE double-tower model, and the recall part model is used for learning the similarity of the query and the doc, so that separate modeling is needed, and semantic vectors of the query and the doc are respectively extracted by utilizing the two sub-models.
Step S202, calculating semantic similarity between the target query information vector and each search text vector, and recalling the search text corresponding to the search text vector with the semantic similarity meeting the preset condition as a first candidate set. The semantic similarity meeting the preset condition means that the similarity reaches a set threshold, for example, the threshold is set to be 70%, and doc recall corresponding to doc vectors with the semantic similarity of query vectors reaching more than 70% is performed. In this embodiment, semantic vector recall may be performed by using HNSW algorithm, and the first candidate set may be represented by a sim function, and search text vectors that are most similar to the target query information vector may be found by calculating cosine similarity between the target query information vector and each search text vector.
Step S203, sorting the search texts in the first candidate set based on the semantic similarity, the characteristics of the target query information and the characteristics of the search texts to obtain a first search result. And finally, inputting the semantic similarity sim, the characteristics of the target query information query and the characteristics of the search text doc into an ERNIE sequencing model, performing characteristic crossing (cross) on the query and the doc of the user, and finally predicting and sequencing to finely rank the recalled doc.
As an optional implementation manner, step S103 of performing keyword recall based on the target query information and the search text to obtain a second candidate set including a plurality of search texts, and sorting the plurality of search texts in the second candidate set to obtain a second search result includes: extracting keywords based on the target query information; traversing search texts in a database based on the keywords, and recalling the search texts hit by the keywords as a second candidate set; and sequencing the plurality of search texts in the second candidate set to obtain a second search result. The step also mainly comprises two parts of recall and sorting, wherein the recall part uses a search engine solr to carry out term hit recall, and the sorting part uses an LTR model to carry out fine sorting. When the large model is used for carrying out semantic recall, the LTR model is used for carrying out term hit recall to serve as a spam, and search results of the LTR model can be preferentially used in certain scenes lacking semantics, so that the semantic search function is provided, and meanwhile, the search accuracy is ensured.
As an optional implementation manner, the step S104 of fusing the first search result and the second search result to obtain the third search result includes: step S301, filtering the first search result based on a preset filtering rule; step S302, content deduplication processing is carried out on the first search result and the second search result after filtering processing; step S303, obtaining a third search result based on the first search result and the second search result after the content duplication removal processing.
As shown in fig. 3, the preset filtering rules may include threshold filtering, term filtering, time filtering, and the like. Wherein the threshold filtering comprises: a threshold is set based on the p-r value (model evaluation index) of the large model, for example, the set threshold=0.457 filters the result of the semantic search model, removing the result of low confidence. term filtering includes: because the result of the semantic search model has better effect than term hit in terms of natural language, the result aiming at middle and long query and Chinese result effect are better. However, the result of the semantic search model has poor scene effect in the absence of semantics, such as names, mailboxes and characters with special significance and underlines, so that a query understanding module is added, whether the user query is the name, the mailbox and the Chinese proportion is judged, and the result under the query is subjected to term hit calculation and filtration, so that the query understanding deviation is reduced, and the accuracy of model search is improved. The time filtering includes: the timeliness of the results of the semantic search model in the fusion process is also considered, for example, for high-quality results (score e [0.95,1 ]), filtering can be omitted; for the high-quality results (score E [0.8,0.95 ]), a tolerance of 4 years is given, and the high-quality results with timeliness within 4 years can be not filtered; the score for the common quality result e [0.457,0.8 ]) is a pat of 2 years. The filtering process can filter out partial search results with lower accuracy.
Further, the search results of the semantic search model and the search results of the LTR model have the same content, so that the results of the semantic search model and the LTR model need to be de-duplicated through the unique identification of the document, and the results of the semantic search model are reserved. When the search results of the semantic search model and the search results of the LTR model are fused, the search results of the semantic search are preferentially considered, and the search results of the LTR model can be preferentially used in certain application scenes lacking semantics, so that the accuracy of model search is ensured.
The present disclosure provides a model training method, as shown in fig. 4, comprising:
in step S401, the search log is used as a training sample to train a basic model (foundation model). The basic model is a universal large model which is trained on massive universal data in advance and has multiple basic capabilities, model fine tuning and application adaptation can be carried out by combining multiple vertical industry and business scene requirements, and the constraint of traditional AI capability fragmentation and workshop type development can be eliminated.
Step S402, performing model distillation on the basic model obtained after training to obtain a semantic search model; the semantic search model is applied to the search method in any of the above embodiments, and is used for obtaining the first search result based on the target query information and the search text. The parameters of the model are greatly reduced by a model distillation method, so that the system is convenient to deploy with lower cost.
The present disclosure provides a search apparatus, as shown in fig. 5, including:
the acquisition module 501 is configured to acquire target query information, and search text associated with the target query information. The target query information refers to a query of a user, wherein the query can comprise a query term input by the user and can also comprise portrait data of the user, and the portrait data comprises but is not limited to: basic data such as name, gender, age, etc.; behavior data of the user, such as user purchase, collection, website residence time, etc.; transaction data such as purchase frequency, purchase product price, etc.; and the relationship data such as friends, the number of friends and the like of the user. Search text doc related to the query is queried in the internal search database based on the query of the user.
The semantic search module 502 is configured to perform vectorization processing based on the target query information and the search text, perform semantic recall to obtain a first candidate set, and perform sorting based on the first candidate set to obtain a first search result. In this embodiment, semantic recall is performed by using a semantic search model obtained based on fine tuning of a basic model, the semantic search model includes an ERNIE double-tower model and an ERNIE sorting model, the ERNIE double-tower model includes a query portion and a doc portion, search texts in a query and internal search database of a user are vectorized by using the query portion and the doc portion respectively, semantic vector recall is further performed by using an HNSW algorithm based on a Faiss architecture, doc corresponding to doc vectors with higher semantic similarity recall similarity between the query vector and the doc vector, namely a first candidate set, and semantic search results are obtained by sorting each doc combined by a first candidate by using the ERNIE sorting model, namely a first search result.
The keyword searching module 503 is configured to recall keywords based on the target query information and the search texts to obtain a second candidate set including a plurality of search texts, and order the plurality of search texts in the second candidate set to obtain a second search result. The recall section uses the search engine solr for keyword term hit recall and the sort section uses the LTR model trained by lightGBM for fine-ranking. In the keyword recall process, firstly, word segmentation is carried out on the queries to obtain term of each query, then each term in each search text is traversed, and if term of the query is hit in all search text, the search text is recalled. Because the search result of the large model has poor scene effect in the absence of semantics, for example, the query comprises names of people, mailboxes, characters with underlines and special meanings, and the like, the large model is not required to expand semantics at the moment, and the accuracy of recall based on term hit is higher. Therefore, when the large model is used for semantic recall, the LTR model is used for term hit recall as a spam, and the search result of the LTR model can be preferentially used in certain scenes lacking semantics, so that the semantic search function is provided, the search accuracy is ensured, and the multi-way recall has the advantages of two recall modes.
And the fusion module 504 is configured to fuse the first search result and the second search result to obtain a third search result. The first search result is the result of semantic search, the second search result is the result of keyword search, and although the two search modes are different, the content of the first search result and the second search result usually has a overlapped part, so that the first search result and the second search result need to be fused, filtered, de-duplicated and the like, and then the final search result, namely the third search result, is output. By fusing the first search result and the second search result, the accuracy of the search results can be further improved.
As an alternative embodiment, as shown in fig. 6, the semantic search module 502 includes:
the vectorization processing unit 601 is configured to perform vectorization processing on the target query information query to obtain a target query information vector, and perform vectorization processing on the search text doc to obtain a plurality of search text vectors. The query and doc are respectively input into the query part and the doc part of the ERNIE double-tower model, and the recall part model is used for learning the similarity of the query and the doc, so that separate modeling is needed, and semantic vectors of the query and the doc are respectively extracted by utilizing the two sub-models.
The first recall unit 602 is configured to calculate a semantic similarity between the target query information vector and each search text vector, and recall, as the first candidate set, a search text corresponding to a search text vector whose semantic similarity meets a preset condition. The semantic similarity meeting the preset condition means that the similarity reaches a set threshold, for example, the threshold is set to be 70%, and doc recall corresponding to doc vectors with the semantic similarity of query vectors reaching more than 70% is performed. In this embodiment, semantic vector recall may be performed by using HNSW algorithm, and the first candidate set may be represented by a sim function, and search text vectors that are most similar to the target query information vector may be found by calculating cosine similarity between the target query information vector and each search text vector.
The first ranking unit 603 is configured to rank the search text in the first candidate set based on the semantic similarity, the feature of the target query information and the feature of the search text, so as to obtain a first search result. And finally, inputting the semantic similarity sim, the characteristics of the target query information query and the characteristics of the search text doc into an ERNIE sequencing model, performing characteristic crossing (cross) on the user query and doc, and finally predicting and sequencing to perform fine ranking on the recalled search text.
As an alternative embodiment, as shown in fig. 7, the keyword search module 503 includes: a keyword extraction unit 701 configured to extract keywords based on the target query information; a second recall unit 702 configured to recall, based on the keyword traversing the search text in the database, the search text hit by the keyword as a second candidate set; a second ranking unit 703 is configured to rank the search text in the second candidate set to obtain a second search result. The step also mainly comprises two parts of recall and sorting, wherein the recall part uses a search engine solr to carry out term hit recall, and the sorting part uses an LTR model to carry out fine sorting. When the large model is used for carrying out semantic recall, the LTR model is used for carrying out term hit recall to serve as a spam, and search results of the LTR model can be preferentially used in certain scenes lacking semantics, so that the semantic search function is provided, and meanwhile, the search accuracy is ensured.
As an alternative embodiment, as shown in fig. 8, the fusion module 504 includes: a filtering unit 801 configured to perform filtering processing on the first search result based on a preset filtering rule; a deduplication unit 802 configured to perform content deduplication processing on the filtered first search result and second search result; and an output unit 803 configured to obtain a third search result based on the first search result and the second search result after the content deduplication process.
As shown in fig. 3, the preset filtering rules may include threshold filtering, term filtering, time filtering, and the like. Wherein the threshold filtering comprises: a threshold is set based on the p-r value (model evaluation index) of the large model, for example, the set threshold=0.457 filters the result of the semantic search model, removing the result of low confidence. term filtering includes: because the result of the semantic search model has better effect than term hit in terms of natural language, the result aiming at middle and long query and Chinese result effect are better. However, the result of the semantic search model has poor scene effect in the absence of semantics, such as names, mailboxes and characters with special significance and underlines, so that a query understanding module is added, whether the user query is the name, the mailbox and the Chinese proportion is judged, and the result under the query is subjected to term hit calculation and filtration, so that the query understanding deviation is reduced, and the accuracy of model search is improved. The time filtering includes: the timeliness of the results of the semantic search model in the fusion process is also considered, for example, for high-quality results (score e [0.95,1 ]), filtering can be omitted; for the high-quality results (score E [0.8,0.95 ]), a tolerance of 4 years is given, and the high-quality results with timeliness within 4 years can be not filtered; the score for the common quality result e [0.457,0.8 ]) is a pat of 2 years. The filtering process can filter out partial search results with lower accuracy.
Further, the search results of the semantic search model and the search results of the LTR model have the same content, so that the results of the semantic search model and the LTR model need to be de-duplicated through the unique identification of the document, and the results of the semantic search model are reserved. When the search results of the semantic search model and the search results of the LTR model are fused, the semantic search results are preferentially considered, and the search results of the LTR model can be preferentially used in certain application scenes lacking semantics, so that the accuracy of model search is ensured, the advantages of two recall modes are considered, the semantic generalization capability can be improved, and the accuracy of model recall can be ensured.
The present disclosure also provides a model training apparatus, as shown in fig. 9, including:
the training module 901 is configured to train the base model by using the search log as a training sample. The basic model is a universal large model which is trained on massive universal data in advance and has multiple basic capabilities, model fine tuning and application adaptation can be carried out by combining multiple vertical industry and business scene requirements, and the constraint of traditional AI capability fragmentation and workshop type development can be eliminated.
The model distillation module 902 is configured to perform model distillation on the basic model obtained after training to obtain a semantic search model; the semantic search model is applied to the search method described in any one of the embodiments, and is used for obtaining a first search result based on the target query information and the search text. The parameters of the model are greatly reduced by a model distillation method, so that the system is convenient to deploy with lower cost.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related user personal information all conform to the regulations of related laws and regulations, and the public sequence is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 10 shows a schematic block diagram of an example electronic device 1000 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the apparatus 1000 includes a computing unit 1001 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a Random Access Memory (RAM) 1003. In the RAM1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM1002, and the RAM1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
Various components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and communication unit 1009 such as a network card, modem, wireless communication transceiver, etc. Communication unit 1009 allows device 1000 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks.
The computing unit 1001 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 1001 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the respective methods and processes described above, such as a search method or a model training method. For example, in some embodiments, the search method or model training method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM1002 and/or communication unit 1009. When the computer program is loaded into RAM1003 and executed by computing unit 1001, one or more steps of the search method or model training method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the search method or the model training method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (15)

1. A search method, comprising:
acquiring target query information and search text associated with the target query information;
performing vectorization processing based on the target query information and the search text, performing semantic recall to obtain a first candidate set comprising a plurality of the search texts, and sequencing the plurality of the search texts in the first candidate set to obtain a first search result;
performing keyword recall based on the target query information and the search text to obtain a second candidate set comprising a plurality of search texts, and sorting the plurality of search texts in the second candidate set to obtain a second search result;
and fusing the first search result and the second search result to obtain a third search result.
2. The method of claim 1, wherein the vectorizing based on the target query information and the search text, performing semantic recall to obtain a first candidate set including a plurality of the search text, and ranking the plurality of the search text in the first candidate set to obtain a first search result comprises:
vectorizing the target query information to obtain a target query information vector, and vectorizing the search text to obtain a plurality of search text vectors;
calculating semantic similarity between the target query information vector and each search text vector, and recalling the search text corresponding to the search text vector, the semantic similarity of which meets a preset condition, as the first candidate set;
and sorting the search texts in the first candidate set based on the semantic similarity, the characteristics of the target query information and the characteristics of the search texts to obtain the first search result.
3. The method of claim 1, wherein the keyword recall based on the target query information and the search text to obtain a second candidate set comprising a plurality of the search texts, and the ranking the plurality of the search texts in the second candidate set to obtain a second search result comprises:
extracting keywords based on the target query information;
traversing the search text based on the keyword, recalling the search text hit by the keyword as the second candidate set;
and sequencing the search texts in the second candidate set to obtain the second search result.
4. The method of any of claims 1-3, wherein fusing the first search result and the second search result to obtain a third search result comprises:
filtering the first search result based on a preset filtering rule;
performing content de-duplication processing on the first search result and the second search result after the filtering processing;
and obtaining the third search result based on the first search result and the second search result after the content de-duplication processing.
5. The method of claim 4, wherein the preset filtering rules include at least one of:
filtering the first search result with the confidence coefficient lower than a preset model threshold value based on the preset model threshold value;
judging the category of the target query information, and filtering the first search result corresponding to the target query information, wherein the category is a non-semantic scene;
filtering is based on the timeliness of the first search result.
6. A model training method, comprising:
taking the internal search log as a training sample to train the basic model;
performing model distillation on the basic model obtained after training to obtain a semantic search model; the semantic search model is applied to the search method according to any one of claims 1-5, and is used for obtaining the first search result based on the target query information and the search text.
7. A search apparatus comprising:
the acquisition module is configured to acquire target query information and search text associated with the target query information;
the semantic search module is configured to perform vectorization processing on the basis of the target query information and the search text, then perform semantic recall to obtain a first candidate set comprising a plurality of the search texts, and sort the plurality of the search texts in the first candidate set to obtain a first search result;
the keyword searching module is configured to recall keywords based on the target query information and the search texts to obtain a second candidate set comprising a plurality of search texts, and order the plurality of search texts in the second candidate set to obtain second search results;
and the fusion module is configured to fuse the first search result and the second search result to obtain a third search result.
8. The apparatus of claim 7, wherein the semantic search module comprises:
the vectorization processing unit is configured to vectorize the target query information to obtain a target query information vector, and vectorize the search text to obtain a plurality of search text vectors;
the first recall unit is configured to calculate semantic similarity between the target query information vector and each search text vector, recall the search text corresponding to the search text vector, the semantic similarity of which meets a preset condition, as the first candidate set;
and the first sorting unit is configured to sort the search texts in the first candidate set based on the semantic similarity, the characteristics of the target query information and the characteristics of the search texts, so as to obtain the first search result.
9. The apparatus of claim 7, wherein the keyword search module comprises:
a keyword extraction unit configured to extract keywords based on the target query information;
a second recall unit configured to recall the search text hit by the keyword as the second candidate set based on the keyword traversing the search text;
and the second ranking unit is configured to rank the search texts in the second candidate set to obtain the second search result.
10. The apparatus of any of claims 7-9, wherein the fusion module comprises:
the filtering unit is configured to filter the first search result based on a preset filtering rule;
a deduplication unit configured to perform content deduplication processing on the first search result and the second search result after the filtering processing;
and an output unit configured to obtain the third search result based on the first search result and the second search result after the content deduplication processing.
11. The apparatus of claim 10, wherein the preset filtering rules comprise at least one of:
filtering the first search result with the confidence coefficient lower than a preset model threshold value based on the preset model threshold value;
judging the category of the target query information, and filtering the first search result corresponding to the target query information, wherein the category is a non-semantic scene;
filtering is based on the timeliness of the first search result.
12. A model training apparatus comprising:
the training module is configured to train the basic model by taking the internal search log as a training sample;
the model distillation module is configured to perform model distillation on the basic model obtained after training to obtain a semantic search model; the semantic search model is applied to the search method according to any one of claims 1-5, and is used for obtaining the first search result based on the target query information and the search text.
13. An electronic device, 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 to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-6.
CN202211666281.5A 2022-12-23 2022-12-23 Search method, model training method, device, electronic equipment and storage medium Pending CN116662633A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211666281.5A CN116662633A (en) 2022-12-23 2022-12-23 Search method, model training method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211666281.5A CN116662633A (en) 2022-12-23 2022-12-23 Search method, model training method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116662633A true CN116662633A (en) 2023-08-29

Family

ID=87724823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211666281.5A Pending CN116662633A (en) 2022-12-23 2022-12-23 Search method, model training method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116662633A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117114112A (en) * 2023-10-16 2023-11-24 北京英视睿达科技股份有限公司 Vertical field data integration method, device, equipment and medium based on large model

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117114112A (en) * 2023-10-16 2023-11-24 北京英视睿达科技股份有限公司 Vertical field data integration method, device, equipment and medium based on large model
CN117114112B (en) * 2023-10-16 2024-03-19 北京英视睿达科技股份有限公司 Vertical field data integration method, device, equipment and medium based on large model

Similar Documents

Publication Publication Date Title
WO2021052148A1 (en) Contract sensitive word checking method and apparatus based on artificial intelligence, computer device, and storage medium
CN112579729B (en) Training method and device for document quality evaluation model, electronic equipment and medium
CN113660541A (en) News video abstract generation method and device
CN114880505A (en) Image retrieval method, device and computer program product
CN115248890B (en) User interest portrait generation method and device, electronic equipment and storage medium
CN116662633A (en) Search method, model training method, device, electronic equipment and storage medium
CN113191145B (en) Keyword processing method and device, electronic equipment and medium
CN113609847B (en) Information extraction method, device, electronic equipment and storage medium
CN113408660B (en) Book clustering method, device, equipment and storage medium
CN112506864B (en) File retrieval method, device, electronic equipment and readable storage medium
CN116739626A (en) Commodity data mining processing method and device, electronic equipment and readable medium
CN113704494B (en) Entity retrieval method, device, equipment and storage medium based on knowledge graph
CN112989190B (en) Commodity mounting method and device, electronic equipment and storage medium
CN114329206A (en) Title generation method and device, electronic equipment and computer readable medium
CN112860626A (en) Document sorting method and device and electronic equipment
CN114861062B (en) Information filtering method and device
CN115795023B (en) Document recommendation method, device, equipment and storage medium
CN113377921B (en) Method, device, electronic equipment and medium for matching information
CN112579841B (en) Multi-mode database establishment method, retrieval method and system
CN107122392B (en) Word stock construction method, search requirement identification method and related device
CN116415050A (en) Information searching method, device, electronic equipment and storage medium
CN116166783A (en) Method, device and storage medium for generating similar problems
CN117573800A (en) Paragraph retrieval method, device, equipment and storage medium
CN117493704A (en) User credibility calculation method and device, electronic equipment and medium
CN113377922A (en) Method, apparatus, electronic device, and medium for matching information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
DD01 Delivery of document by public notice
DD01 Delivery of document by public notice

Addressee: BAIDU (CHINA) CO.,LTD.

Document name: Notification of Qualified Procedures