Knowledge retrieval method and related device

By combining rough arrangement, rearrangement and fine arrangement search strategies, adjusting the relevance of resource knowledge and considering popularity factors, the problem of limited search range in the existing technology is solved, and flexible and efficient knowledge retrieval effects are achieved.

CN119807400APending Publication Date: 2025-04-11IFLYTEK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411760467.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The existing knowledge retrieval methods limit the user's retrieval scope, cannot meet the user's retrieval needs, and it is difficult to retrieve the resource knowledge expected by the user.

Method used

A strategy of combining rough search, rearrangement search and fine search is adopted to determine the correlation between resource knowledge and demand text by obtaining target search requirements text, and adjust the correlation according to resource heat, and finally determine the most relevant resource knowledge using a higher accuracy method.

Benefits of technology

It realizes flexible search without limiting the user's search scope, and can retrieve the most relevant resource knowledge based on user needs, improving the search effect and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807400A_ABST
    Figure CN119807400A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge retrieval method and a related device, and relates to the technical field of knowledge retrieval, and the method comprises the following steps: obtaining a target retrieval demand text, and adopting a first relevancy determination mode to determine the first relevancy between each piece of resource knowledge in a target resource knowledge base and the target retrieval demand text, determining N pieces of resource knowledge most relevant to the target retrieval demand text according to the first relevancy, adjusting the first relevancy according to resource popularity corresponding to the N pieces of resource knowledge, and determining K pieces of resource knowledge most relevant to the target retrieval demand text from the N pieces of resource knowledge according to the adjusted first relevancy, and determining second relevancy between the K pieces of resource knowledge and the target retrieval demand text by adopting a second relevancy determination mode with higher accuracy, and determining a plurality of pieces of resource knowledge most relevant to the target retrieval demand text from the K pieces of resource knowledge according to the second relevancy. The knowledge retrieval method disclosed by the invention has better retrieval effect and user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of knowledge retrieval technology, and in particular to a knowledge retrieval method and related devices. Background Art

[0002] At present, most knowledge retrieval methods are based on given tags, that is, obtaining the retrieval requirements input by users for given tags, and then screening resource knowledge related to the retrieval requirements input by users for specific tags in the resource knowledge base.

[0003] Taking film and television resource knowledge retrieval as an example, given tags such as type, actor, director, etc., the search requirements entered by the user for the given type, actor, director, etc. tags are obtained, and then the film and television resource knowledge related to the search requirements entered by the user for the given tags are filtered in the film and television resource knowledge base.

[0004] However, sometimes users do not only want to search for given tags. The retrieval method based on given tags limits the user's search scope and cannot meet the user's search needs. In addition, the retrieval method based on given tags can only support coarse-grained retrieval needs and it is difficult to retrieve the resource knowledge expected by the user. Summary of the invention

[0005] In view of this, the present application provides a knowledge retrieval method and related devices to solve the problem that the existing knowledge retrieval method limits the user's search scope, cannot meet the user's search needs, and is difficult to retrieve the resource knowledge expected by the user. The technical solution is as follows:

[0006] The first aspect of the present application provides a knowledge retrieval method, comprising:

[0007] Obtaining a target search requirement text, wherein the target search requirement text is a text describing the user's search requirement;

[0008] Adopting a first relevance determination method, determining the first relevance of each resource knowledge in a pre-constructed target resource knowledge base and the target search requirement text, and determining N resource knowledge that are most relevant to the target search requirement text from the target resource knowledge base according to the determined first relevances, wherein each resource knowledge in the target resource knowledge base has a corresponding resource heat;

[0009] According to the resource heats respectively corresponding to the N pieces of resource knowledge, the first relevances of the N pieces of resource knowledge to the target search requirement text are adjusted respectively, and according to the adjusted first relevances, K pieces of resource knowledge most relevant to the target search requirement text are determined from the N pieces of resource knowledge, where K is an integer less than N;

[0010] A second relevance determination method having a higher accuracy rate than the first relevance determination method is adopted to determine the second relevance of the K pieces of resource knowledge to the target retrieval requirement text respectively, and based on the determined second relevances, several pieces of resource knowledge that are most relevant to the target retrieval requirement text are determined from the K pieces of resource knowledge to obtain the retrieval results corresponding to the target retrieval requirement text.

[0011] In a possible implementation, the target resource knowledge base is an unstructured resource knowledge base constructed based on a structured resource knowledge base;

[0012] The structured resource knowledge base includes a plurality of structured resource knowledge, each of which includes a plurality of fields and field information corresponding to the plurality of fields;

[0013] The target resource knowledge base includes a plurality of unstructured resource knowledge, each of which is resource knowledge in a plain text format.

[0014] In a possible implementation, the process of constructing the target resource knowledge base includes:

[0015] Screening a number of fields required for retrieval from the structured resource knowledge base, standardizing the screened fields, determining the standardized fields as attribute names, and obtaining a number of attribute names;

[0016] For each structured resource knowledge in the structured resource knowledge base: extracting attribute values ​​corresponding to the several attribute names respectively from the structured resource knowledge; combining each attribute name and the corresponding attribute value into attribute information, and connecting the obtained several attribute information with a set separator to obtain initial unstructured resource knowledge; processing the initial unstructured resource knowledge into unstructured resource knowledge with a length not exceeding a preset length, to obtain unstructured resource knowledge corresponding to the structured resource knowledge;

[0017] The target resource knowledge base is composed of the unstructured resource knowledge corresponding to each structured resource knowledge in the structured resource knowledge base.

[0018] In a possible implementation, the process of determining the resource popularity corresponding to any piece of resource knowledge in the target resource knowledge base includes:

[0019] Determine the initial popularity of the resource knowledge according to the score of the resource corresponding to the resource knowledge and the popularity of the relevant personnel of the resource corresponding to the resource knowledge;

[0020] Obtaining the interaction heat that can represent the degree of interaction activity between the user and the resource corresponding to the resource knowledge, and obtaining the interaction heat corresponding to the resource knowledge;

[0021] The initial heat corresponding to the piece of resource knowledge is merged with the interactive heat corresponding to the piece of resource knowledge to obtain the resource heat corresponding to the piece of resource knowledge.

[0022] In a possible implementation, adjusting the first relevance of the N pieces of resource knowledge to the target search requirement text according to the resource heats respectively corresponding to the N pieces of resource knowledge includes:

[0023] Determine the heat scores corresponding to the N pieces of resource knowledge respectively according to the heats corresponding to the N pieces of resource knowledge respectively;

[0024] Calculate the standard deviation of the first relevance of the N resource knowledge pieces to the target search requirement text, and determine the heat score weight according to the standard deviation;

[0025] For each of the N pieces of resource knowledge: weight the heat score corresponding to the piece of resource knowledge with the heat score weight to obtain a weighted heat score corresponding to the piece of resource knowledge, and superimpose the weighted heat score corresponding to the piece of resource knowledge on the basis of the first relevance between the piece of resource knowledge and the target retrieval requirement text.

[0026] In a possible implementation, the step of weighting the heat score corresponding to the piece of resource knowledge with the heat score weight to obtain the weighted heat score corresponding to the piece of resource knowledge includes:

[0027] Normalize the heat score corresponding to the resource knowledge to the target interval to obtain the normalized heat score corresponding to the resource knowledge, wherein the minimum value and the maximum value of the target interval are respectively the minimum relevance and the maximum relevance of the first relevances of the N resource knowledge and the target search requirement text;

[0028] The normalized heat score corresponding to the piece of resource knowledge is weighted by the heat score weight to obtain a weighted heat score corresponding to the piece of resource knowledge.

[0029] In a possible implementation, the first relevance determination method is used to determine the first relevance between each resource knowledge in the pre-built target resource knowledge base and the target search requirement text, including:

[0030] Using the rough sorting model obtained by pre-training, determining the first relevance of each resource knowledge in the pre-built target resource knowledge base and the target search requirement text;

[0031] Among them, the coarse-ranking model is trained using training data in a training data set, and each training data in the training data set includes a training retrieval requirement text and a positive sample and a negative sample corresponding to the training retrieval requirement text. The positive sample is resource knowledge that meets the retrieval requirement indicated by the corresponding training retrieval requirement text, and the negative sample is resource knowledge that does not meet the retrieval requirement indicated by the corresponding training retrieval requirement text. The training goal of the coarse-ranking model is to make the correlation between the training retrieval requirement text and the corresponding positive sample greater than the correlation between the training retrieval requirement text and the corresponding negative sample.

[0032] In a possible implementation, the target resource knowledge base includes unstructured resource knowledge corresponding to each structured resource knowledge in the structured resource knowledge base; the training data set includes a plurality of first training data constructed by adopting a first construction method;

[0033] The process of constructing a first type of training data using the first construction method includes:

[0034] Constructing a first training retrieval requirement text according to a pre-constructed retrieval requirement text template and a structured resource knowledge in the structured resource knowledge base;

[0035] Acquire, from the target resource knowledge base, unstructured resource knowledge corresponding to the structured resource knowledge based on which the first training retrieval requirement text is constructed as a positive sample corresponding to the first training retrieval requirement text;

[0036] Selecting unstructured resource knowledge that does not meet the retrieval requirements indicated by the first training retrieval requirement text from the target resource knowledge base as negative samples corresponding to the first training retrieval requirement text;

[0037] A first type of training data is composed of the first training retrieval requirement text and the positive samples and negative samples corresponding to the first training retrieval requirement text.

[0038] In a possible implementation manner, the training data set further includes a plurality of second training data constructed by adopting a second construction method;

[0039] The process of constructing a second type of training data using the second construction method includes:

[0040] Using a large language model, generating a second training retrieval requirement text based on the retrieval requirement text and unstructured resource knowledge in the target resource knowledge base;

[0041] Determining the unstructured resource knowledge based on which the second training retrieval requirement text is generated as a positive sample corresponding to the second training retrieval requirement text;

[0042] Selecting a number of resource knowledge items that are literally related to the second training retrieval requirement text from the target resource knowledge base;

[0043] Selecting resource knowledge that is semantically irrelevant to the second training retrieval requirement text from a plurality of resource knowledge that is literally related to the second training retrieval requirement text as negative samples corresponding to the second training retrieval requirement text;

[0044] A second type of training data is composed of the second training retrieval requirement text and the positive samples and negative samples corresponding to the second training retrieval requirement text.

[0045] In a possible implementation, the adopting a second relevance determination method to determine the second relevance between the K pieces of resource knowledge and the target search requirement text respectively includes:

[0046] Using the pre-trained refined ranking model, determine the second relevance of the K pieces of resource knowledge to the target search requirement text respectively;

[0047] The refined ranking model is trained using a first sample pair and a second sample pair, wherein the first sample pair includes a training retrieval requirement text and a positive sample corresponding to the retrieval requirement text, and the second sample pair includes a training retrieval requirement text and a negative sample corresponding to the training retrieval requirement text, the positive sample is resource knowledge that meets the retrieval requirement indicated by the corresponding training retrieval requirement text, and the negative sample is resource knowledge that does not meet the retrieval requirement indicated by the corresponding training retrieval requirement text, and the training goal of the refined ranking model is to maximize the correlation between the training retrieval requirement text and the corresponding positive sample, and minimize the correlation between the training retrieval requirement text and the corresponding negative sample.

[0048] In a possible implementation, the knowledge retrieval method further includes:

[0049] By using a large language model, a reply language for feeding back to the user is generated according to the target search requirement text and the search results corresponding to the target search requirement text.

[0050] A second aspect of the present application provides a knowledge retrieval device, comprising: a target retrieval requirement text acquisition module, a first knowledge retrieval module, a second knowledge retrieval module and a third knowledge retrieval module;

[0051] The target search requirement text acquisition module is used to acquire the target search requirement text, wherein the target search requirement text is a text describing the user's search requirement;

[0052] The first knowledge retrieval module is used to determine the first relevance between each resource knowledge in the pre-constructed target resource knowledge base and the target retrieval requirement text by adopting a first relevance determination method, and determine the N resource knowledge that are most relevant to the target retrieval requirement text from the target resource knowledge base according to the determined first relevances, wherein each resource knowledge in the target resource knowledge base has a corresponding resource heat;

[0053] The second knowledge retrieval module is used to adjust the first relevance of the N pieces of resource knowledge to the target retrieval requirement text according to the resource popularity corresponding to the N pieces of resource knowledge, and determine the K pieces of resource knowledge that are most relevant to the target retrieval requirement text from the N pieces of resource knowledge according to the adjusted first relevances, where K is an integer less than N;

[0054] The third knowledge retrieval module is used to adopt a second relevance determination method to determine the second relevance of the K pieces of resource knowledge and the target retrieval requirement text, and determine several pieces of resource knowledge that are most relevant to the target retrieval requirement text from the K pieces of resource knowledge based on the determined second relevances, to obtain the retrieval results corresponding to the target retrieval requirement text.

[0055] A third aspect of the present application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0056] The memory is used to store computer programs;

[0057] The processor is used to execute the computer program so that the electronic device can implement the steps of any one of the above-mentioned knowledge retrieval methods.

[0058] A fourth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the steps of any one of the above-mentioned knowledge retrieval methods.

[0059] A fifth aspect of the present application provides a computer program product, comprising computer-readable instructions, which, when executed on an electronic device, enables the electronic device to implement the steps of any one of the above-described knowledge retrieval methods.

[0060] With the help of the above technical scheme, the knowledge retrieval method provided by the present application will not limit the user's search scope, and the user can flexibly give the search requirements. In order to retrieve the resource knowledge expected by the user according to the search requirements given by the user, the knowledge retrieval method provided by the present application adopts a search strategy that combines rough sorting, re-sorting and fine sorting. That is, after obtaining the text describing the user's search requirements, that is, the target search requirement text, the first relevance determination method is first used to determine the first relevance of each resource knowledge in the target resource knowledge base with the target search requirement text, and the N resource knowledge that is most relevant to the target search requirement text is determined based on the determined first relevances (rough sorting), considering that the difference in the relevance of the N resource knowledge to the target search requirement text may not be large At the same time, in order to improve the user experience, a heat-based re-ranking search strategy is introduced, that is, according to the resource heat corresponding to the N resource knowledge, the first relevance of the N resource knowledge and the target search requirement text is adjusted, and the K resource knowledge most relevant to the target search requirement text is determined from the N resource knowledge according to each adjusted first relevance. After obtaining the K resource knowledge, in order to improve the retrieval accuracy, a second relevance determination method with a higher accuracy is further adopted to determine the second relevance of the K resource knowledge and the target search requirement text, and according to each determined second relevance, several resource knowledge most relevant to the target search requirement text are determined from the K resource knowledge (precise ranking retrieval), thereby obtaining the retrieval results corresponding to the target search requirement text. The knowledge retrieval method provided in this application allows users to flexibly give retrieval requirements, and can retrieve the resource knowledge most relevant to the retrieval requirements given by users. It can be seen that the knowledge retrieval method provided in this application has good retrieval effect and user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0062] Figure 1 A schematic diagram of a system architecture involved in this application;

[0063] Figure 2 A schematic diagram of a hardware structure of a terminal provided in an embodiment of the present application;

[0064] Figure 3 A schematic diagram of a hardware structure of a server provided in an embodiment of the present application;

[0065] Figure 4 A schematic diagram of a flow chart of a knowledge retrieval method provided in an embodiment of the present application;

[0066] Figure 5 An example of structured resource knowledge in a structured resource knowledge base provided in an embodiment of the present application;

[0067] Figure 6 An example of unstructured resource knowledge in a target resource knowledge base provided in an embodiment of the present application;

[0068] Figure 7 A flow chart of adjusting the first relevance of the N pieces of resource knowledge to the target search requirement text according to the resource heats respectively corresponding to the N pieces of resource knowledge provided in the embodiment of the present application, and determining the K pieces of resource knowledge most relevant to the target search requirement text from the N pieces of resource knowledge according to the adjusted first relevances;

[0069] Figure 8 A schematic diagram of the structure of a knowledge retrieval device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0070] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0071] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0072] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0073] In one possible implementation, Figure 1 As shown, the system architecture involved in the present application may include a terminal 101 and a server 102, and the terminal 101 may interact with the server 102 via a network (wired network or wireless network). The server 102 may include one or more servers ( Figure 1The terminal 101 can obtain the target search requirement text (the text describing the user's search requirement), and transmit the target search requirement text to the server 102 through the network. The server 102 uses the knowledge retrieval method provided by the present application to retrieve the resource knowledge most relevant to the target search requirement text from the target resource knowledge base to obtain the search result corresponding to the target search requirement text, and transmits the search result corresponding to the target search requirement text to the terminal 101 through the network.

[0074] In another possible implementation, the system architecture involved in the present application may include a terminal. The terminal has strong data processing capabilities. The terminal can obtain a target search requirement text (a text describing the user's search requirement), and use the knowledge retrieval method provided by the present application to retrieve the resource knowledge most relevant to the target search requirement text from the target resource knowledge base to obtain a search result corresponding to the target search requirement text.

[0075] Next, the product form of the above-mentioned terminal is described.

[0076] The above-mentioned terminal can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, a robot, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiments of the present application do not impose any restrictions on this.

[0077] Figure 2 An optional hardware structure diagram of a terminal is shown.

[0078] refer to Figure 2 As shown, the terminal may include a radio frequency unit 210, a memory 220, an input unit 230, a display unit 240, a camera 250 (optional), an audio circuit 260 (optional), a speaker 261 (optional), a microphone 262 (optional), an earphone jack 263 (optional), a processor 270, an external interface 280, a power supply 290 and other components. Those skilled in the art will appreciate that Figure 2 This is merely an example of a terminal and does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown in the figure, or a combination of certain components, or different components.

[0079] The input unit 230 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the terminal. Specifically, the input unit 230 may include a touch screen 231 (optional) and / or other input devices 232. The touch screen 231 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 270, and can receive and execute the command sent by the processor 270; the touch signal at least includes the contact point coordinate information. The touch screen 231 can provide an input interface and an output interface between the terminal and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch screen 231, the input unit 230 can also include other input devices. Specifically, other input devices 232 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

[0080] The display unit 240 may be used to display information input by a user or information provided to a user, various menus of the terminal, an interactive interface, file display, and / or playback of any multimedia file.

[0081] The memory 220 can be used to store instructions and data. The memory 220 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc. The instruction storage area can store software units such as operating systems, applications, and instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; it provides the processor 270 with hardware, software, and data resources including management of computing and processing equipment, and supports control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.

[0082] The processor 270 is the control center of the terminal. It uses various interfaces and lines to connect various parts of the entire terminal. By running or executing instructions stored in the memory 220 and calling data stored in the memory 220, it executes various functions of the terminal and processes data, thereby controlling the terminal as a whole. Optionally, the processor 270 may include one or more processing units; preferably, the processor 270 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 270. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 270 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 220, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.

[0083] Among them, the memory 220 can be used to store software codes related to the knowledge retrieval method, the processor 270 can execute the software codes in the memory 220, and can also schedule other units (such as the above-mentioned input unit 230 and display unit 240) to achieve corresponding functions.

[0084] The radio frequency unit 210 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 270 for processing; in addition, the designed uplink data is sent to the base station. Generally, the radio frequency unit 210 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LowNoiseAmplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 210 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General PacketRadio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0085] In the embodiment of the present application, the radio frequency unit 210 can send data to other devices, and can also receive data sent by other devices. It should be understood that the radio frequency unit 210 is optional, and can be replaced by other communication interfaces, such as a network port.

[0086] The terminal also includes a power supply 290 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 270 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.

[0087] The terminal also includes an external interface 280, which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal to communicate with other devices, or to connect a charger to charge the terminal.

[0088] Although not shown, the terminal may further include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which will not be described in detail here.

[0089] Next, the product form of the above server is described.

[0090] Figure 3 A structural diagram of the above server is provided, such as Figure 3 As shown, the server may include a bus 301, a processor 302, a communication interface 303, and a memory 304. The processor 302, the memory 304, and the communication interface 303 communicate with each other via the bus 301.

[0091] The bus 301 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0092] The processor 302 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0093] The memory 304 may include a volatile memory, such as a random access memory (RAM). The memory 304 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0094] The memory 304 may be used to store software codes related to the knowledge retrieval method. The processor 302 may call the software codes stored in the memory 304 or schedule other units to implement corresponding functions.

[0095] The processors in the above-mentioned terminals and servers (for example, processor 270 and processor 302) may be hardware circuits (such as application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), general-purpose processors, digital signal processors (DSP), microprocessors or microcontrollers, etc.), or combinations of these hardware circuits. For example, the processor may be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0096] Next, the knowledge retrieval method provided by this application is introduced through the following embodiments.

[0097] See also Figure 4 , shows a schematic flow chart of a knowledge retrieval method provided in an embodiment of the present application, the knowledge retrieval method may include:

[0098] Step S401: Obtain target search requirement text.

[0099] The target search requirement text is a text describing the user's search requirement.

[0100] It should be noted that the target search requirement text can be a text describing the search requirement input by the user through text input, or can be a text obtained by voice recognition of the search requirement voice (the content of which is the voice of the search requirement) input by the user through voice input.

[0101] Step S402: adopt the first relevance determination method to determine the first relevance of each resource knowledge in the pre-constructed target resource knowledge base and the target search requirement text, and determine the N resource knowledge most relevant to the target search requirement text from the target resource knowledge base according to the determined first relevances.

[0102] The target resource knowledge base in this embodiment includes resource knowledge corresponding to several resources respectively. The target resource knowledge base can be an unstructured resource knowledge base constructed based on the structured resource knowledge base, wherein the structured resource knowledge base includes structured resource knowledge corresponding to several resources respectively, each structured resource knowledge includes several fields and field information corresponding to several fields respectively, and the target resource knowledge base includes several unstructured resource knowledge, and each unstructured resource knowledge is resource knowledge in plain text format.

[0103] The target resource knowledge base in this embodiment can be a video resource knowledge base (for example, a film and television resource knowledge base that includes film and television resource knowledge corresponding to several film and television resources). Correspondingly, the target retrieval requirement text is a film and television resource knowledge retrieval requirement text. Of course, this embodiment is not limited to this. For example, the target resource knowledge base can also be an audio resource knowledge base (for example, a music resource knowledge base), or a text resource knowledge base (for example, a novel resource knowledge base), etc.

[0104] Step S403: According to the resource heats corresponding to the N pieces of resource knowledge, the first relevance of the N pieces of resource knowledge to the target search requirement text is adjusted respectively, and K pieces of resource knowledge most relevant to the target search requirement text are determined from the N pieces of resource knowledge according to the adjusted first relevances.

[0105] In this embodiment, each piece of resource knowledge in the target resource knowledge base has a corresponding resource heat.

[0106] Considering that the difference in the relevance between the N resource knowledge determined in step S402 and the target search requirement text may not be large, and in order to improve the user experience, after determining the N resource knowledge, the first relevance between the N resource knowledge and the target search requirement text is adjusted according to the resource heat corresponding to the N resource knowledge, and then the K resource knowledge most relevant to the target search requirement text is determined from the N resource knowledge according to each adjusted first relevance (the adjusted first relevance is the relevance taking into account the resource heat), where K is an integer less than N. It should be noted that step S403 can filter out the resource knowledge corresponding to the high resource heat.

[0107] Step S404: adopt the second relevance determination method to determine the second relevance of K pieces of resource knowledge and the target search requirement text respectively, and determine several pieces of resource knowledge that are most relevant to the target search requirement text from the K pieces of resource knowledge according to the determined second relevances, and obtain the search results corresponding to the target search requirement text.

[0108] Among them, the accuracy of the second relevance determination method is higher than the accuracy of the first relevance determination method, that is, for the same text pair, the accuracy of the relevance determined for the text pair using the second relevance determination method is higher than the relevance determined for the text pair using the first relevance determination method.

[0109] After determining K pieces of resource knowledge, a second relevance determination method with higher accuracy is used to determine the second relevance of the K pieces of resource knowledge to the target search requirement text, and then the search results corresponding to the target search requirement text are determined from the K pieces of resource knowledge based on the determined second relevances.

[0110] In one possible implementation, the resource knowledge among K pieces of resource knowledge whose second relevance to the target retrieval requirement text is greater than or equal to a preset relevance threshold can be determined as the retrieval result corresponding to the target retrieval requirement text; in another possible implementation, based on the second relevance of the K pieces of resource knowledge to the target retrieval requirement text, the M pieces of resource knowledge most relevant to the target retrieval requirement text can be determined from the K pieces of resource knowledge as the retrieval result corresponding to the target retrieval requirement text, where M is an integer less than K.

[0111] The knowledge retrieval method provided in the embodiment of the present application will not limit the user's search scope. The user can flexibly give the search requirements. In order to retrieve the resource knowledge expected by the user according to the search requirements given by the user, the knowledge retrieval method provided in the embodiment of the present application adopts a search strategy that combines rough sorting, re-sorting and fine sorting. That is, after obtaining the text describing the user's search requirements, that is, the target search requirement text, the first relevance determination method is first used to determine the first relevance of each resource knowledge in the target resource knowledge base with the target search requirement text, and the N resource knowledge that is most relevant to the target search requirement text is determined based on the determined first relevances (rough sorting). Considering that the difference in the relevance of the N resource knowledge to the target search requirement text may not be large, In order to improve the user experience, a heat-based re-ranking search strategy is introduced, that is, according to the resource heat corresponding to the N resource knowledge, the first relevance of the N resource knowledge and the target search requirement text is adjusted, and the K resource knowledge most relevant to the target search requirement text is determined from the N resource knowledge according to each adjusted first relevance. After obtaining the K resource knowledge, in order to improve the retrieval accuracy, a second relevance determination method with a higher accuracy is further adopted to determine the second relevance of the K resource knowledge and the target search requirement text, and according to each determined second relevance, several resource knowledge most relevant to the target search requirement text are determined from the K resource knowledge (precise ranking retrieval), thereby obtaining the retrieval results corresponding to the target search requirement text. The knowledge retrieval method provided in the embodiment of the present application allows users to flexibly give retrieval requirements, and can retrieve the resource knowledge most relevant to the retrieval requirements given by users. It can be seen that the knowledge retrieval method provided in the embodiment of the present application has good retrieval effect and user experience.

[0112] The above embodiment mentioned that the target resource knowledge base is an unstructured resource knowledge base constructed based on the structured resource knowledge base. In another embodiment of the present application, the process of constructing the target resource knowledge base based on the structured resource knowledge base is introduced.

[0113] The process of constructing a target resource knowledge base based on a structured resource knowledge base may include:

[0114] Step a1: Filter several fields required for retrieval from the structured resource knowledge base, standardize the filtered fields, determine the standardized fields as attribute names, and obtain several attribute names.

[0115] See also Figure 5 , shows an example of structured resource knowledge in a structured resource knowledge base, from which several fields required for retrieval can be filtered out, such as "_id", "name", "description", etc. After filtering out the fields required for retrieval, the filtered fields are standardized, for example, English fields are processed into Chinese.

[0116] Step a2: For each structured resource knowledge in the structured resource knowledge base, execute:

[0117] Step a21, extracting attribute values ​​corresponding to several attribute names from the structured resource knowledge, combining each attribute name and the corresponding attribute value into attribute information, and connecting the obtained attribute information with a set separator to obtain initial unstructured resource knowledge.

[0118] Exemplarily, several attribute names include attribute name 1, attribute name 2, ..., attribute name m. First, attribute value 1 corresponding to attribute name 1, attribute value 2 corresponding to attribute name 2, ..., attribute value m corresponding to attribute name m are extracted from structured resource knowledge. Then, attribute name 1 and the corresponding attribute value 1 are combined into attribute information 1, attribute name 2 and the corresponding attribute value 2 are combined into attribute information 2, ..., attribute name m and the corresponding attribute value m are combined into attribute information m. Then, m attribute information are connected with a set separator (such as "|") to obtain the following unstructured resource knowledge: "attribute name 1: attribute value 1|attribute name 2: attribute value 2|...|attribute name m: attribute value m".

[0119] Step a22: Process the initial unstructured resource knowledge into unstructured resource knowledge whose length does not exceed a preset length, and obtain the unstructured resource knowledge corresponding to the structured resource knowledge.

[0120] If the length of the initial unstructured resource knowledge exceeds the preset length, the initial unstructured resource knowledge may be processed so that its length does not exceed the preset length. For example, longer attribute values ​​may be cut.

[0121] See also Figure 6 , shows an example of an unstructured resource knowledge, where the unstructured resource knowledge is resource knowledge in a plain text format.

[0122] Step a3: The target resource knowledge base is composed of the unstructured resource knowledge corresponding to each structured resource knowledge in the structured resource knowledge base.

[0123] The above embodiment mentioned that each piece of resource knowledge in the target resource knowledge base has a corresponding resource heat. Next, the process of determining the resource heat corresponding to any piece of resource knowledge in the target resource knowledge base is introduced.

[0124] The process of determining the resource popularity corresponding to any resource knowledge in the target resource knowledge base may include: determining the initial popularity corresponding to the resource knowledge according to the score of the resource corresponding to the resource knowledge and the popularity of relevant personnel of the resource corresponding to the resource knowledge; obtaining the interactive popularity that can characterize the interactive activity level between the user and the resource corresponding to the resource knowledge, and obtaining the interactive popularity corresponding to the resource knowledge; fusing the initial popularity corresponding to the resource knowledge with the interactive popularity of the resource knowledge, and obtaining the resource popularity corresponding to the resource knowledge.

[0125] The following takes the target resource knowledge base as a film and television resource knowledge base as an example to illustrate the process of determining the initial popularity corresponding to any resource knowledge in the target resource knowledge base.

[0126] The film and television resource knowledge base includes several pieces of film and television resource knowledge. Each piece of film and television resource knowledge base can include basic information such as the name, type, label, director, actor, etc. of the film and television resource (i.e., film and television work), and can also include information such as the picture address and video address of the film and television resource.

[0127] The initial popularity corresponding to any piece of film and television resource knowledge in the film and television resource knowledge base can be determined based on the score of the film and television resource corresponding to the piece of film and television resource knowledge, the popularity of the director of the film and television resource corresponding to the piece of film and television resource knowledge (the popularity of the director can be determined based on the number of fans of the director on the social platform), and the popularity of the leading actor of the film and television resource corresponding to the piece of resource knowledge (the popularity of the leading actor can be determined based on the number of fans of the leading actor on the social platform).

[0128] Specifically, for any piece of film and television resource knowledge in the film and television resource knowledge base, the score of the film and television resource corresponding to the film and television resource knowledge, the director popularity of the film and television resource corresponding to the film and television resource knowledge, and the starring popularity of the film and television resource corresponding to the film and television resource knowledge can be normalized (for example, normalized to the interval [0,10000]), and then the average of the three normalized values ​​is calculated to obtain the initial popularity corresponding to the film and television resource knowledge. That is, the initial popularity corresponding to any piece of film and television resource knowledge can be expressed as:

[0129] Initial popularity = (norm (rating) + ave (main actor popularity) + aver (director popularity)) / 3 (1)

[0130] Among them, norm (score) represents the normalized value of the score of the film and television resource corresponding to the film and television resource knowledge, ave (starring popularity) represents the normalized value of the starring popularity of the film and television resource corresponding to the film and television resource knowledge, and aver (director popularity) represents the normalized value of the director popularity of the film and television resource corresponding to the film and television resource knowledge.

[0131] For any piece of film and television resource knowledge in the film and television resource knowledge base, in addition to obtaining the initial popularity corresponding to the film and television resource, the interactive popularity corresponding to the film and television resource knowledge can also be obtained. The interactive popularity corresponding to the film and television resource knowledge can represent the degree of interactive activity between users (such as audiences) and the film and television resources corresponding to the film and television resource knowledge. The interactive popularity corresponding to the film and television resource knowledge can be determined based on the number of people who are watching, the number of people who want to watch, the number of people who comment on the film and television resource corresponding to the film and television resource on the video playback platform, and can also be determined based on the playback data on the video playback platform.

[0132] For any piece of film and television resource knowledge in the film and television resource knowledge base, after obtaining the initial heat and interactive heat corresponding to the piece of film and television resource knowledge, the initial heat corresponding to the piece of film and television resource knowledge and the interactive heat corresponding to the piece of film and television resource knowledge can be fused to obtain the resource heat corresponding to the piece of film and television resource knowledge. In a possible implementation, the initial heat corresponding to the piece of film and television resource knowledge and the interactive heat corresponding to the piece of film and television resource knowledge can be fused in the manner shown in the following formula to obtain the resource heat corresponding to the piece of film and television resource knowledge:

[0133] (2)

[0134] Considering that the popularity of film and television resources should show a gradually decreasing trend over time, a cooling value can be multiplied after the initial popularity and the interactive popularity are summed. Optionally, the cooling coefficient in the above formula can be taken as 0.041. It is best to assume that the basic popularity of the film and television resources is 20,000, and the popularity cools to 1 after 20 years. Substituting the two assumed values ​​into formula (2) to calculate 0.041, this embodiment does not limit the cooling coefficient to 0.041, and it can also be other values.

[0135] It should be noted that the method of determining the resource popularity corresponding to other types of resource knowledge is similar to the method of determining the resource popularity corresponding to the film and television resource knowledge described above, and is not described in detail in this embodiment.

[0136] In another embodiment of the present application, the specific implementation process of "Step S402: adopting the first relevance determination method to determine the first relevance of each resource knowledge in the pre-constructed target resource knowledge base and the target retrieval requirement text, and determining the N resource knowledge that are most relevant to the target retrieval requirement text from the target resource knowledge base based on the determined first relevances" in the above embodiment is introduced.

[0137] In a possible implementation, a first relevance determination method is adopted to determine the first relevance between each resource knowledge in a pre-built target resource knowledge base and the target search requirement text, and an implementation process of determining the N resource knowledge that are most relevant to the target search requirement text from the target resource knowledge base according to each determined first relevance may include:

[0138] Step b1: using the rough sorting model obtained by pre-training, determine the first relevance of each resource knowledge in the pre-built target resource knowledge base and the target retrieval requirement text.

[0139] Specifically, the process of using the pre-trained rough sorting model to determine the first relevance of each resource knowledge in the pre-built target resource knowledge base to the target search requirement text may include:

[0140] Step b11: input the target retrieval requirement text into the coarse sorting model to obtain the vector representation of the target retrieval requirement text output by the coarse sorting model.

[0141] The target retrieval requirement text is input into the coarse sorting model, which encodes it and outputs a vector representation of the target retrieval requirement text. Optionally, the coarse sorting model may be a double tower model.

[0142] Step b12: Calculate the correlation between the vector representation of the target retrieval requirement text and the vector representation of each resource knowledge in the target resource knowledge base to obtain a first correlation between the target retrieval requirement text and each resource knowledge in the target resource knowledge base.

[0143] The correlation between the vector representation of the target retrieval requirement text and the vector representation of a piece of resource knowledge is the first correlation between the target retrieval requirement text and the piece of resource knowledge.

[0144] In order to improve the retrieval efficiency, the coarse sorting model can be used in advance to determine the vector representation of each resource knowledge in the target resource knowledge base, and the vector representation of each resource knowledge in the target resource knowledge base is used to form a vector library. When it is necessary to calculate the first correlation between the target retrieval requirement text and the resource knowledge in the target resource knowledge base, the vector representation of the resource knowledge can be directly obtained from the vector library (the representation vectors of the resource knowledge and the resource knowledge can be associated through the resource identifier), and then the correlation between the vector representation of the target retrieval requirement text and the vector representation of the resource knowledge is calculated. Of course, this embodiment is not limited to this, and the coarse sorting model can also be used to determine the vector representation of the resource knowledge when it is necessary to calculate the first correlation between the target retrieval requirement text and the resource knowledge in the target resource knowledge base.

[0145] Step b2: determine the N pieces of resource knowledge in the target resource knowledge base that have the greatest first relevance to the target search requirement text as the N pieces of resource knowledge that are most relevant to the target search requirement text.

[0146] The resource knowledge in the target resource knowledge base can be sorted in order from large to small according to the first relevance, and the first N resource knowledge can be determined as the N resource knowledge most relevant to the target retrieval requirement text. Of course, the resource knowledge in the target resource knowledge base can also be sorted in order from small to large according to the first relevance, and the last N resource knowledge can be determined as the N resource knowledge most relevant to the target retrieval requirement text.

[0147] It should be noted that the above-mentioned rough ranking model is trained using the training data in the training data set. Each training data in the training data set includes a training retrieval requirement text and positive samples and negative samples corresponding to the training retrieval requirement text, wherein the positive sample is the resource knowledge that meets the retrieval requirements indicated by the corresponding training retrieval requirement text, and the negative sample is the resource knowledge that does not meet the retrieval requirements indicated by the corresponding training retrieval requirement text.

[0148] In a possible implementation manner, the training data set includes a plurality of first type training data constructed by adopting a first construction method, and a plurality of second type training data constructed by adopting a second construction method.

[0149] The process of constructing a first type of training data using the first construction method includes:

[0150] Step c1: construct a first training retrieval requirement text according to a pre-constructed retrieval requirement text template and a structured resource knowledge in a structured resource knowledge base.

[0151] It should be noted that the resource knowledge retrieval method provided in this application is applicable to resource retrieval scenarios and also to chat scenarios. For example, for film and television resource retrieval scenarios, the retrieval requirement template can be "I want to watch $$category (movie) $$ starring $$actor$$", and for film and television chat scenarios, the retrieval requirement template can be "$$name$$what story does this $$category$$ tell".

[0152] The search requirement template includes several slots (such as the above-mentioned "$$actor$$", "$$category$$", etc.), and the slots in the search requirement template can be backfilled according to a structured resource knowledge in the structured resource knowledge base to obtain the first training search requirement text.

[0153] Step c2: Acquire, from the target resource knowledge base, unstructured resource knowledge corresponding to the structured resource knowledge based on which the first training retrieval requirement text is constructed as a positive sample corresponding to the first training retrieval requirement text.

[0154] Assuming that step c1 constructs the first training retrieval requirement text based on a pre-constructed retrieval requirement text template and a structured resource knowledge x in the structured resource knowledge base, then step c2 obtains the unstructured resource knowledge x′ corresponding to the structured resource knowledge x from the target resource knowledge base, and uses the unstructured resource knowledge x′ as the positive sample corresponding to the first training retrieval requirement text.

[0155] Step c3: Filter unstructured resource knowledge that does not meet the retrieval requirements indicated by the first training retrieval requirement text from the target resource knowledge base as negative samples corresponding to the first training retrieval requirement text.

[0156] For example, if the first training retrieval requirement text is "I want to watch movie B starring A", then resource knowledge of movie D starring C can be screened from the target resource knowledge base as a negative sample corresponding to the first training retrieval requirement text.

[0157] It should be noted that the number of negative samples corresponding to the first training retrieval requirement text may be one or more.

[0158] Step c4: a first type of training data is formed by the first training retrieval requirement text and the positive samples and negative samples corresponding to the first training retrieval requirement text.

[0159] A plurality of first type training data may be constructed in the manner of steps c1 to c4 above.

[0160] The process of constructing a second type of training data using the second construction method includes:

[0161] Step d1: using a large language model, generating a second training retrieval requirement text based on the retrieval requirement text and unstructured resource knowledge in a target resource knowledge base.

[0162] The retrieval requirement text generation requirement is used to indicate what kind of retrieval requirement text is generated.

[0163] According to the preset instruction prompt template, the retrieval requirement text generation requirements and the unstructured resource knowledge in the target resource knowledge base can be organized into prompt instructions. The prompt instructions are used to instruct the large language model to generate requirements based on the retrieval requirement text and the unstructured resource knowledge to generate the retrieval requirement text. The prompt instructions are input into the large language model, and the large model generates and outputs the retrieval requirement text based on the prompt instructions.

[0164] Step d2: Determine the unstructured resource knowledge based on which the second training retrieval requirement text is generated as a positive sample corresponding to the second training retrieval requirement text.

[0165] Assuming that step d1 generates a second training retrieval requirement text based on the retrieval requirement text generation requirement and the unstructured resource knowledge x′ in the target resource knowledge base, step d2 uses the unstructured resource knowledge x′ as a positive sample corresponding to the second training retrieval requirement text.

[0166] Step d3: Filter several resource knowledge items that are literally related to the second training retrieval requirement text from the target resource knowledge base.

[0167] The BM25 algorithm can be used to screen several resource knowledge items that are literally related to the second training retrieval requirement text from the target resource knowledge base.

[0168] Step d4: select resource knowledge that is semantically irrelevant to the second training retrieval requirement text from a plurality of resource knowledge that is literally relevant to the second training retrieval requirement text as negative samples corresponding to the second training retrieval requirement text.

[0169] The resource knowledge that is literally related to the second training retrieval requirement text is not necessarily truly related to the second training retrieval requirement text. After obtaining several pieces of resource knowledge that are literally related to the second training retrieval requirement text, this embodiment screens out resource knowledge that is semantically irrelevant to the second training retrieval requirement text as negative samples corresponding to the second training retrieval requirement text. The negative sample corresponding to the second training retrieval requirement text may be one or more.

[0170] It should be noted that resource knowledge that is literally related to the second training retrieval requirement text but semantically irrelevant is a difficult sample. Introducing difficult samples can improve the performance of the coarse ranking model.

[0171] Step d5: A second type of training data is formed by the second training retrieval requirement text and the positive samples and negative samples corresponding to the second training retrieval requirement text.

[0172] A plurality of second training data may be constructed in the manner of steps d1 to d5 above.

[0173] The training data set is composed of a plurality of constructed first type training data and a plurality of constructed second type training data.

[0174] It should be noted that this embodiment does not limit the training data set to include multiple first-type training data and multiple second-type training data. The training data set may also only include multiple first-type training data (it only needs to use the first construction method to construct multiple first-type training data), and may also only include multiple second training data (it only needs to use the second construction method to construct multiple second-type training data).

[0175] After obtaining the training data set, the training data in the training data set can be used to train the coarse ranking model. When training the coarse ranking model, the goal is to make the correlation between the training retrieval requirement text and the corresponding positive sample greater than the correlation between the training retrieval requirement text and the corresponding negative sample (if there are multiple negative samples corresponding to the training retrieval requirement text, then make the correlation between the training retrieval requirement text and the corresponding positive sample greater than the correlation between the training retrieval requirement text and each corresponding negative sample). Among them, the correlation between the training retrieval requirement text and the corresponding positive sample is the correlation between the vector representation of the training retrieval requirement text and the vector representation of the positive sample corresponding to the training retrieval requirement text, and the correlation between the training retrieval requirement text and the corresponding negative sample is the correlation between the vector representation of the training retrieval requirement text and the vector representation of the negative sample corresponding to the training retrieval requirement text. The vector representation of the training retrieval requirement text, the vector representation of the positive sample corresponding to the training retrieval requirement text, and the vector representation of the negative sample corresponding to the training retrieval requirement text are all determined using the coarse ranking model.

[0176] In another embodiment of the present application, the implementation process of "Step S403 in the above embodiment: adjusting the first relevance of the N pieces of resource knowledge to the target retrieval requirement text according to the resource heat corresponding to each of the N pieces of resource knowledge, and determining the K pieces of resource knowledge most relevant to the target retrieval requirement text from the N pieces of resource knowledge according to the adjusted first relevance" is introduced.

[0177] like Figure 7 As shown, according to the resource heats respectively corresponding to the N resource knowledge pieces, the first relevances of the N resource knowledge pieces to the target search requirement text are adjusted respectively, and the implementation process of determining the K resource knowledge pieces that are most relevant to the target search requirement text from the N resource knowledge pieces according to the adjusted first relevances may include:

[0178] Step S701: Determine the heat scores corresponding to the N pieces of resource knowledge according to the heats corresponding to the N pieces of resource knowledge.

[0179] In a possible implementation, the heat score P(w j ):

[0180] (3)

[0181] Among them, f(w j ) represents the heat corresponding to the i-th resource knowledge among N resource knowledge.

[0182] Step S702: Calculate the standard deviation of the first relevance of the N resource knowledge pieces to the target search requirement text, and determine the heat score weight according to the standard deviation.

[0183] Calculate the standard deviation σ of the first relevance of N resource knowledge to the target retrieval requirement text, that is, calculate the standard deviation σ of N first relevances. After calculating the standard deviation σ of the N first relevances, the heat score weight can be determined according to the standard deviation σ.

[0184] For example, the resource knowledge is film and television resource knowledge, N is 50, and through statistics, the standard deviation distribution is concentrated in the interval [0.005, 0.015]. The heat score weight f(σ) can be determined as follows:

[0185] (4)

[0186] Step S703: For each of the N pieces of resource knowledge: weight the heat score corresponding to the piece of resource knowledge with the heat score weight to obtain the weighted heat score corresponding to the piece of resource knowledge, and superimpose the weighted heat score corresponding to the piece of resource knowledge on the basis of the first relevance between the piece of resource knowledge and the target retrieval requirement text to obtain the adjusted first relevance.

[0187] When using the heat score weight to weight the heat score corresponding to the resource knowledge, the heat score corresponding to the resource knowledge can be normalized to the target interval first to obtain the normalized heat score corresponding to the resource knowledge, and then the heat score weight is used to weight the normalized heat score corresponding to the resource knowledge to obtain the weighted heat score corresponding to the resource knowledge. Among them, the minimum and maximum values ​​of the target interval are the minimum relevance r of the first relevance of the N resource knowledge and the target search requirement text. min and the maximum correlation r max .

[0188] In a possible implementation, the heat score corresponding to the resource knowledge can be normalized to the target interval [r min , r max ]: First, find the maximum heat score s from the heat scores corresponding to N resource knowledge max and minimum heat score s min , then calculate the coefficient k according to formula (5), and finally normalize the heat score corresponding to the resource knowledge to the target interval [r min , r max ]:

[0189] k=(r max -r min ) / (s max -s min ) (5)

[0190] s′=r min +k(ss min) (6)

[0191] s′=r max +k(ss max ) (7)

[0192] Among them, s represents the heat score corresponding to the resource knowledge, and s′ represents the normalized heat score corresponding to the resource knowledge.

[0193] After obtaining the weighted heat score corresponding to the resource knowledge, the first relevance between the resource knowledge and the target search requirement text is summed with the weighted heat score corresponding to the resource knowledge to obtain the adjusted first relevance:

[0194] Adjusted first relevance = first relevance + heat score weight × normalized heat score (8)

[0195] Step S704: determine the K pieces of resource knowledge with the largest adjusted first relevance to the target search requirement text among the N pieces of resource knowledge as the K pieces of resource knowledge most relevant to the target search requirement text.

[0196] The N pieces of resource knowledge can be sorted in descending order according to the adjusted first relevance, and the first K pieces of resource knowledge can be determined as the K pieces of resource knowledge most relevant to the target retrieval requirement text. Of course, the N pieces of resource knowledge can also be sorted in ascending order according to the adjusted first relevance, and the last K pieces of resource knowledge can be determined as the K pieces of resource knowledge most relevant to the target retrieval requirement text.

[0197] It should be noted that, in the above steps S701 to S704, when the first relevances of the N pieces of resource knowledge to the target retrieval requirement text are not much different, the heat score plays a decisive role; when the first relevances of the N pieces of resource knowledge to the target retrieval requirement text are significantly different, the first relevances of the N pieces of resource knowledge to the target retrieval requirement text play a decisive role.

[0198] In another embodiment of the present application, the specific implementation process of "Step S404: adopting the second relevance determination method to determine the second relevance of K pieces of resource knowledge and the target retrieval requirement text respectively, and determining several pieces of resource knowledge that are most relevant to the target retrieval requirement text from the K pieces of resource knowledge according to the determined second relevances, to obtain the retrieval results corresponding to the target retrieval requirement text" is introduced.

[0199] In a possible implementation, a second relevance determination method is adopted to determine the second relevance of K pieces of resource knowledge to the target search requirement text, and a number of resource knowledge that are most relevant to the target search requirement text are determined from the K pieces of resource knowledge according to the determined second relevances. The implementation process of obtaining the search result corresponding to the target search requirement text may include:

[0200] Step e1: using the pre-trained refined ranking model, determine the second relevance of K pieces of resource knowledge to the target retrieval requirement text.

[0201] For each of the K pieces of resource knowledge, the target retrieval requirement text is spliced ​​with the piece of resource knowledge, and the spliced ​​text is input into the refined sorting model. The refined sorting model cross-encodes the input text and determines the second relevance between the target retrieval requirement text and the piece of resource knowledge based on the cross-coding result.

[0202] The fine ranking model in this embodiment is trained using several first sample pairs and several second sample pairs, wherein the first sample pair includes a training retrieval requirement text and a positive sample corresponding to the retrieval requirement text, and the second sample pair includes a training retrieval requirement text and a negative sample corresponding to the training retrieval requirement text. The positive sample is the resource knowledge that meets the retrieval requirement indicated by the corresponding training retrieval requirement text, and the negative sample is the resource knowledge that does not meet the retrieval requirement indicated by the corresponding training retrieval requirement text. The first sample pair and the second sample pair can be obtained from the above-mentioned training data set (the fine ranking model and the coarse ranking model can be trained based on the same training data set).

[0203] The training objective of the fine ranking model is to maximize the correlation between the training retrieval requirement text and the corresponding positive sample (for example, to make the correlation between the training retrieval requirement text and the corresponding positive sample approach 1), and minimize the correlation between the training retrieval requirement text and the corresponding negative sample (to make the correlation between the training retrieval requirement text and the corresponding negative sample approach 0).

[0204] Step e2: Determine the resource knowledge among the K pieces of resource knowledge whose second relevance to the target search requirement text is greater than a preset relevance threshold as the search result corresponding to the target search requirement text.

[0205] After obtaining the search results corresponding to the target search requirement text, for the chat scenario, the large language model can be used to generate a reply for feedback to the user based on the target search requirement text and the search results corresponding to the target search requirement text, and the generated reply can be fed back to the user. For the resource search scenario, the relevant information of the resources corresponding to each resource knowledge contained in the search results corresponding to the target search requirement text (such as pictures of the resources, playback addresses, etc.) can be obtained and fed back to the user. Of course, the search results corresponding to the target search requirement text can also be directly output.

[0206] The above introduces the knowledge retrieval method provided by the embodiment of the present application, and the device corresponding to the above knowledge retrieval method will be introduced below.

[0207] See also Figure 8 , Figure 8A structural schematic diagram of a knowledge retrieval device provided in an embodiment of the present application, the knowledge retrieval device may include: a target retrieval requirement text acquisition module 801, a first knowledge retrieval module 802, a second knowledge retrieval module 803 and a third knowledge retrieval module 804.

[0208] The target search requirement text acquisition module 801 is used to acquire the target search requirement text, where the target search requirement text is a text describing the user's search requirement.

[0209] The first knowledge retrieval module 802 is used to determine the first relevance of each resource knowledge in the pre-constructed target resource knowledge base and the target retrieval requirement text by adopting the first relevance determination method, and determine the N resource knowledge that are most relevant to the target retrieval requirement text from the target resource knowledge base according to the determined first relevances, wherein each resource knowledge in the target resource knowledge base has a corresponding resource heat.

[0210] The second knowledge retrieval module 803 is used to adjust the first relevance of the N pieces of resource knowledge to the target retrieval requirement text according to the resource popularity corresponding to the N pieces of resource knowledge, and determine the K pieces of resource knowledge that are most relevant to the target retrieval requirement text from the N pieces of resource knowledge according to the adjusted first relevances, where K is an integer less than N.

[0211] The third knowledge retrieval module 804 is used to adopt the second relevance determination method to determine the second relevance of K pieces of resource knowledge and the target retrieval requirement text, and determine several pieces of resource knowledge that are most relevant to the target retrieval requirement text from the K pieces of resource knowledge according to the determined second relevances, to obtain the retrieval results corresponding to the target retrieval requirement text.

[0212] In a possible implementation, the target resource knowledge base is an unstructured resource knowledge base constructed based on a structured resource knowledge base. The structured resource knowledge base includes several pieces of structured resource knowledge, each piece of structured resource knowledge includes several fields and field information corresponding to the several fields. The target resource knowledge base includes several pieces of unstructured resource knowledge, each piece of unstructured resource knowledge is resource knowledge in plain text format.

[0213] In a possible implementation, the knowledge retrieval device provided in the embodiment of the present application may also include: an unstructured resource knowledge base construction module.

[0214] The unstructured resource knowledge base construction module is used to construct the unstructured resource knowledge base according to the structured resource knowledge base to obtain the target resource knowledge base.

[0215] When the unstructured resource knowledge base construction module constructs the unstructured resource knowledge base according to the structured resource knowledge base to obtain the target resource knowledge base, it is specifically used for:

[0216] Screening a number of fields required for retrieval from a structured resource knowledge base, standardizing the screened fields, determining the standardized fields as attribute names, and obtaining a number of attribute names;

[0217] For each structured resource knowledge in the structured resource knowledge base: extract attribute values ​​corresponding to a plurality of attribute names from the structured resource knowledge; combine each attribute name and the corresponding attribute value into attribute information, and connect the obtained plurality of attribute information with a set separator to obtain initial unstructured resource knowledge; process the initial unstructured resource knowledge into unstructured resource knowledge with a length not exceeding a preset length, and obtain the unstructured resource knowledge corresponding to the structured resource knowledge;

[0218] The target resource knowledge base is composed of the unstructured resource knowledge corresponding to each structured resource knowledge in the structured resource knowledge base.

[0219] In a possible implementation, the knowledge retrieval device provided in the embodiment of the present application may further include: a resource heat determination module.

[0220] When determining the resource heat corresponding to any resource knowledge in the target resource knowledge base, the resource heat determination module is specifically used to:

[0221] Determine the initial popularity of the resource knowledge according to the score of the resource corresponding to the resource knowledge and the popularity of the relevant personnel of the resource corresponding to the resource knowledge;

[0222] Obtaining the interaction heat that can represent the degree of interaction activity between the user and the resource corresponding to the resource knowledge, and obtaining the interaction heat corresponding to the resource knowledge;

[0223] The initial heat corresponding to the piece of resource knowledge is merged with the interactive heat corresponding to the piece of resource knowledge to obtain the resource heat corresponding to the piece of resource knowledge.

[0224] In a possible implementation, the second knowledge retrieval module 803 may include: a popularity score determination module, a standard deviation determination module, a popularity score weight determination module, and a relevance adjustment module.

[0225] A heat score determination module is used to determine the heat scores corresponding to the N pieces of resource knowledge according to the heats corresponding to the N pieces of resource knowledge;

[0226] The standard deviation determination module is used to calculate the standard deviation of the first relevance of N resource knowledge items to the target retrieval requirement text.

[0227] The heat score weight determination module is used to determine the heat score weight according to the standard deviation.

[0228] The relevance adjustment module is used to weight the heat score corresponding to each of the N resource knowledge pieces with the heat score weight to obtain the weighted heat score corresponding to the resource knowledge, and superimpose the weighted heat score corresponding to the resource knowledge on the basis of the first relevance between the resource knowledge and the target retrieval requirement text.

[0229] In a possible implementation, when the relevance adjustment module weights the heat score corresponding to the resource knowledge with the heat score weight to obtain the weighted heat score corresponding to the resource knowledge, it is specifically used to:

[0230] Normalize the heat score corresponding to the resource knowledge to the target interval to obtain the normalized heat score corresponding to the resource knowledge, where the minimum and maximum values ​​of the target interval are the minimum and maximum relevances of the first relevances of the N resource knowledge respectively with the target search requirement text;

[0231] The normalized heat score corresponding to the resource knowledge is weighted by the heat score weight to obtain the weighted heat score corresponding to the resource knowledge.

[0232] In a possible implementation, when the first knowledge retrieval module 802 adopts the first relevance determination method to determine the first relevance between each resource knowledge in the pre-built target resource knowledge base and the target retrieval requirement text, it is specifically used to:

[0233] Using the rough sorting model obtained by pre-training, determine the first relevance of each resource knowledge in the pre-built target resource knowledge base and the target retrieval requirement text;

[0234] Among them, the coarse-ranking model is trained using the training data in the training data set. Each training data in the training data set includes a training retrieval requirement text and a positive sample and a negative sample corresponding to the training retrieval requirement text. The positive sample is the resource knowledge that meets the retrieval requirement indicated by the corresponding training retrieval requirement text, and the negative sample is the resource knowledge that does not meet the retrieval requirement indicated by the corresponding training retrieval requirement text. The training goal of the coarse-ranking model is to make the correlation between the training retrieval requirement text and the corresponding positive sample greater than the correlation between the training retrieval requirement text and the corresponding negative sample.

[0235] In a possible implementation, the target resource knowledge base includes unstructured resource knowledge corresponding to each structured resource knowledge in the structured resource knowledge base, and the training data set includes a plurality of first training data constructed by adopting a first construction method.

[0236] The knowledge retrieval device provided in the embodiment of the present application may further include: a first training data construction module for constructing a first type of training data using a first construction method.

[0237] When the first training data construction module constructs a first type of training data in the first construction mode, the first training data construction module is specifically used to:

[0238] Constructing a first training retrieval requirement text according to a pre-constructed retrieval requirement text template and structured resource knowledge in a structured resource knowledge base;

[0239] Acquire, from the target resource knowledge base, unstructured resource knowledge corresponding to the structured resource knowledge based on which the first training retrieval requirement text is constructed as a positive sample corresponding to the first training retrieval requirement text;

[0240] Selecting unstructured resource knowledge that does not meet the retrieval requirements indicated by the first training retrieval requirement text from the target resource knowledge base as negative samples corresponding to the first training retrieval requirement text;

[0241] A first type of training data is composed of a first training retrieval requirement text and positive samples and negative samples corresponding to the first training retrieval requirement text.

[0242] In a possible implementation manner, the training data set also includes a plurality of second training data constructed using a second construction method.

[0243] The knowledge retrieval device provided in the embodiment of the present application may further include: a second training data construction module for constructing a second type of training data using a second construction method.

[0244] When the second training data construction module constructs a second type of training data in the second construction mode, the second training data construction module is specifically used to:

[0245] Using a large language model, generating a second training retrieval requirement text based on the retrieval requirement text and unstructured resource knowledge in a target resource knowledge base;

[0246] Determine the unstructured resource knowledge based on which the second training retrieval requirement text is generated as a positive sample corresponding to the second training retrieval requirement text;

[0247] Selecting a number of resource knowledge items that are literally related to the second training retrieval requirement text from the target resource knowledge base;

[0248] Selecting resource knowledge that is semantically irrelevant to the second training retrieval requirement text from a plurality of resource knowledge that is literally related to the second training retrieval requirement text as negative samples corresponding to the second training retrieval requirement text;

[0249] A second type of training data is composed of the second training retrieval requirement text and the positive samples and negative samples corresponding to the second training retrieval requirement text.

[0250] In a possible implementation, when the third knowledge retrieval module 804 adopts the second relevance determination method to determine the second relevance between the K pieces of resource knowledge and the target retrieval requirement text, it is specifically used to:

[0251] Using the pre-trained refined ranking model, determine the second relevance of K pieces of resource knowledge to the target retrieval requirement text;

[0252] Among them, the fine ranking model is trained by using the first sample pair and the second sample pair, wherein the first sample pair includes the training retrieval requirement text and the positive sample corresponding to the retrieval requirement text, and the second sample pair includes the training retrieval requirement text and the negative sample corresponding to the training retrieval requirement text, the positive sample is the resource knowledge that meets the retrieval requirement indicated by the corresponding training retrieval requirement text, and the negative sample is the resource knowledge that does not meet the retrieval requirement indicated by the corresponding training retrieval requirement text, and the training goal of the fine ranking model is to maximize the correlation between the training retrieval requirement text and the corresponding positive sample, and minimize the correlation between the training retrieval requirement text and the corresponding negative sample.

[0253] In a possible implementation, the knowledge retrieval device provided in the embodiment of the present application may also include: a reply generation module.

[0254] The reply generation module is used to generate a reply for feedback to the user based on the target search requirement text and the search results corresponding to the target search requirement text by using a large language model.

[0255] The knowledge retrieval device provided in the embodiment of the present application will not limit the user's search scope, and the user can flexibly give the search requirements. In order to retrieve the resource knowledge expected by the user according to the search requirements given by the user, the knowledge retrieval device provided in the embodiment of the present application adopts a search strategy that combines rough sorting, re-sorting and fine sorting, that is, after obtaining the text describing the user's search requirements, that is, the target search requirement text, the first relevance determination method is first used to determine the first relevance of each resource knowledge in the target resource knowledge base with the target search requirement text, and the N resource knowledge that is most relevant to the target search requirement text is determined based on the determined first relevances (rough sorting), considering that the difference in the relevance of the N resource knowledge with the target search requirement text may not be large, At the same time, in order to improve the user experience, a heat-based re-ranking search strategy is introduced, that is, according to the resource heat corresponding to the N resource knowledge, the first relevance of the N resource knowledge and the target search requirement text is adjusted, and the K resource knowledge most relevant to the target search requirement text is determined from the N resource knowledge according to each adjusted first relevance. After obtaining the K resource knowledge, in order to improve the retrieval accuracy, a second relevance determination method with a higher accuracy is further adopted to determine the second relevance of the K resource knowledge and the target search requirement text, and according to each determined second relevance, several resource knowledge most relevant to the target search requirement text are determined from the K resource knowledge (precise ranking retrieval), thereby obtaining the retrieval results corresponding to the target search requirement text. The knowledge retrieval device provided in the embodiment of the present application allows users to flexibly give retrieval requirements, and can retrieve the resource knowledge most relevant to the retrieval requirements given by the user. It can be seen that the knowledge retrieval device provided in the embodiment of the present application has a good retrieval effect and user experience.

[0256] An embodiment of the present application also provides an electronic device, which may include: at least one processor, at least one communication interface, at least one memory and at least one communication bus.

[0257] In the embodiment of the present application, the number of the processor, the communication interface, the memory, and the communication bus is at least one, and the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0258] The processor may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application;

[0259] The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0260] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to implement the steps of the knowledge retrieval method provided in the above embodiment.

[0261] An embodiment of the present application also provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the steps of the knowledge retrieval method provided in the above embodiment.

[0262] An embodiment of the present application also provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the steps of the knowledge retrieval method provided in the above embodiment.

[0263] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0264] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0265] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0266] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A knowledge retrieval method, characterized in that: include: Obtaining a target search requirement text, wherein the target search requirement text is a text describing the user's search requirement; Adopting a first relevance determination method, determining the first relevance of each resource knowledge in a pre-constructed target resource knowledge base and the target search requirement text, and determining N resource knowledge that are most relevant to the target search requirement text from the target resource knowledge base according to the determined first relevances, wherein each resource knowledge in the target resource knowledge base has a corresponding resource heat; According to the resource heats respectively corresponding to the N pieces of resource knowledge, the first relevances of the N pieces of resource knowledge to the target search requirement text are adjusted respectively, and according to the adjusted first relevances, K pieces of resource knowledge most relevant to the target search requirement text are determined from the N pieces of resource knowledge, where K is an integer less than N; A second relevance determination method having a higher accuracy rate than the first relevance determination method is adopted to determine the second relevance of the K pieces of resource knowledge to the target retrieval requirement text respectively, and based on the determined second relevances, several pieces of resource knowledge that are most relevant to the target retrieval requirement text are determined from the K pieces of resource knowledge to obtain the retrieval results corresponding to the target retrieval requirement text.

2. The knowledge retrieval method according to claim 1, characterized in that: The target resource knowledge base is an unstructured resource knowledge base constructed based on the structured resource knowledge base; The structured resource knowledge base includes a plurality of structured resource knowledge, each of which includes a plurality of fields and field information corresponding to the plurality of fields; The target resource knowledge base includes a plurality of unstructured resource knowledge, each of which is resource knowledge in a plain text format.

3. The knowledge retrieval method according to claim 2, characterized in that: The process of constructing the target resource knowledge base includes: Screening a number of fields required for retrieval from the structured resource knowledge base, standardizing the screened fields, determining the standardized fields as attribute names, and obtaining a number of attribute names; For each structured resource knowledge in the structured resource knowledge base: extracting attribute values ​​corresponding to the several attribute names respectively from the structured resource knowledge; combining each attribute name and the corresponding attribute value into attribute information, and connecting the obtained several attribute information with a set separator to obtain initial unstructured resource knowledge; processing the initial unstructured resource knowledge into unstructured resource knowledge with a length not exceeding a preset length, to obtain unstructured resource knowledge corresponding to the structured resource knowledge; The target resource knowledge base is composed of the unstructured resource knowledge corresponding to each structured resource knowledge in the structured resource knowledge base.

4. The knowledge retrieval method according to claim 1, characterized in that: The process of determining the resource popularity corresponding to any piece of resource knowledge in the target resource knowledge base includes: Determine the initial popularity of the resource knowledge according to the score of the resource corresponding to the resource knowledge and the popularity of the relevant personnel of the resource corresponding to the resource knowledge; Obtaining the interaction heat that can represent the degree of interaction activity between the user and the resource corresponding to the resource knowledge, and obtaining the interaction heat corresponding to the resource knowledge; The initial heat corresponding to the piece of resource knowledge is merged with the interactive heat corresponding to the piece of resource knowledge to obtain the resource heat corresponding to the piece of resource knowledge.

5. The knowledge retrieval method according to claim 1, characterized in that: The adjusting the first relevance of the N pieces of resource knowledge to the target search requirement text according to the resource heats respectively corresponding to the N pieces of resource knowledge includes: Determine the heat scores corresponding to the N pieces of resource knowledge respectively according to the heats corresponding to the N pieces of resource knowledge respectively; Calculate the standard deviation of the first relevance of the N resource knowledge pieces to the target search requirement text, and determine the heat score weight according to the standard deviation; For each of the N pieces of resource knowledge: weight the heat score corresponding to the piece of resource knowledge with the heat score weight to obtain a weighted heat score corresponding to the piece of resource knowledge, and superimpose the weighted heat score corresponding to the piece of resource knowledge on the basis of the first relevance between the piece of resource knowledge and the target retrieval requirement text.

6. The knowledge retrieval method according to claim 5, characterized in that: The step of weighting the heat score corresponding to the piece of resource knowledge with the heat score weight to obtain a weighted heat score corresponding to the piece of resource knowledge includes: Normalize the heat score corresponding to the resource knowledge to the target interval to obtain the normalized heat score corresponding to the resource knowledge, wherein the minimum value and the maximum value of the target interval are respectively the minimum relevance and the maximum relevance of the first relevances of the N resource knowledge and the target search requirement text; The normalized heat score corresponding to the piece of resource knowledge is weighted by the heat score weight to obtain a weighted heat score corresponding to the piece of resource knowledge.

7. The knowledge retrieval method according to claim 1, characterized in that: The first relevance determination method is adopted to determine the first relevance of each resource knowledge in the pre-built target resource knowledge base and the target search requirement text, including: Using the rough sorting model obtained by pre-training, determining the first relevance of each resource knowledge in the pre-built target resource knowledge base and the target search requirement text; Among them, the coarse-ranking model is trained using training data in a training data set, and each training data in the training data set includes a training retrieval requirement text and a positive sample and a negative sample corresponding to the training retrieval requirement text. The positive sample is resource knowledge that meets the retrieval requirement indicated by the corresponding training retrieval requirement text, and the negative sample is resource knowledge that does not meet the retrieval requirement indicated by the corresponding training retrieval requirement text. The training goal of the coarse-ranking model is to make the correlation between the training retrieval requirement text and the corresponding positive sample greater than the correlation between the training retrieval requirement text and the corresponding negative sample.

8. The knowledge retrieval method according to claim 7, characterized in that: The target resource knowledge base includes unstructured resource knowledge corresponding to each structured resource knowledge in the structured resource knowledge base; the training data set includes a plurality of first training data constructed by adopting a first construction method; The process of constructing a first type of training data using the first construction method includes: Constructing a first training retrieval requirement text according to a pre-constructed retrieval requirement text template and a structured resource knowledge in the structured resource knowledge base; Acquire, from the target resource knowledge base, unstructured resource knowledge corresponding to the structured resource knowledge based on which the first training retrieval requirement text is constructed as a positive sample corresponding to the first training retrieval requirement text; Selecting unstructured resource knowledge that does not meet the retrieval requirements indicated by the first training retrieval requirement text from the target resource knowledge base as negative samples corresponding to the first training retrieval requirement text; A first type of training data is composed of the first training retrieval requirement text and the positive samples and negative samples corresponding to the first training retrieval requirement text.

9. The knowledge retrieval method according to claim 8, characterized in that: The training data set also includes a plurality of second training data constructed using a second construction method; The process of constructing a second type of training data using the second construction method includes: Using a large language model, generating a second training retrieval requirement text based on the retrieval requirement text and unstructured resource knowledge in the target resource knowledge base; Determining the unstructured resource knowledge based on which the second training retrieval requirement text is generated as a positive sample corresponding to the second training retrieval requirement text; Selecting a number of resource knowledge items that are literally related to the second training retrieval requirement text from the target resource knowledge base; Selecting resource knowledge that is semantically irrelevant to the second training retrieval requirement text from a plurality of resource knowledge that is literally related to the second training retrieval requirement text as negative samples corresponding to the second training retrieval requirement text; A second type of training data is composed of the second training retrieval requirement text and the positive samples and negative samples corresponding to the second training retrieval requirement text.

10. The knowledge retrieval method according to claim 1, characterized in that: The adopting the second relevance determination method to determine the second relevance of the K pieces of resource knowledge to the target search requirement text respectively includes: Using the pre-trained refined ranking model, determine the second relevance of the K pieces of resource knowledge to the target search requirement text respectively; The refined ranking model is trained using a first sample pair and a second sample pair, wherein the first sample pair includes a training retrieval requirement text and a positive sample corresponding to the retrieval requirement text, and the second sample pair includes a training retrieval requirement text and a negative sample corresponding to the training retrieval requirement text, the positive sample is resource knowledge that meets the retrieval requirement indicated by the corresponding training retrieval requirement text, and the negative sample is resource knowledge that does not meet the retrieval requirement indicated by the corresponding training retrieval requirement text, and the training goal of the refined ranking model is to maximize the correlation between the training retrieval requirement text and the corresponding positive sample, and minimize the correlation between the training retrieval requirement text and the corresponding negative sample.

11. The knowledge retrieval method according to claim 1, characterized in that: Also includes: By using a large language model, a reply language for feeding back to the user is generated according to the target search requirement text and the search results corresponding to the target search requirement text.

12. A knowledge retrieval device, characterized in that: include: A target retrieval requirement text acquisition module, a first knowledge retrieval module, a second knowledge retrieval module and a third knowledge retrieval module; The target search requirement text acquisition module is used to acquire the target search requirement text, wherein the target search requirement text is a text describing the user's search requirement; The first knowledge retrieval module is used to determine the first relevance between each resource knowledge in the pre-constructed target resource knowledge base and the target retrieval requirement text by adopting a first relevance determination method, and determine the N resource knowledge that are most relevant to the target retrieval requirement text from the target resource knowledge base according to the determined first relevances, wherein each resource knowledge in the target resource knowledge base has a corresponding resource heat; The second knowledge retrieval module is used to adjust the first relevance of the N pieces of resource knowledge to the target retrieval requirement text according to the resource popularity corresponding to the N pieces of resource knowledge, and determine the K pieces of resource knowledge that are most relevant to the target retrieval requirement text from the N pieces of resource knowledge according to the adjusted first relevances, where K is an integer less than N; The third knowledge retrieval module is used to adopt a second relevance determination method to determine the second relevance of the K pieces of resource knowledge and the target retrieval requirement text, and determine several pieces of resource knowledge that are most relevant to the target retrieval requirement text from the K pieces of resource knowledge based on the determined second relevances, to obtain the retrieval results corresponding to the target retrieval requirement text.

13. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the steps of the knowledge retrieval method as described in any one of claims 1 to 11.

14. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the steps of the knowledge retrieval method as described in any one of claims 1 to 11.

15. A computer program product, characterized in that It includes computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the steps of the knowledge retrieval method as described in any one of claims 1 to 11.