Server and knowledge base construction method
By building a server and knowledge base construction method, the problem that existing RAG technology cannot meet the needs of fuzzy query is solved. Through the determination of media label combination and prompt templates, accurate data documents are generated to meet the needs of fuzzy query, and the accuracy and user experience of the query are improved.
Patent Information
- Application Number
- CN202411546043.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-03-04
AI Technical Summary
The knowledge base of existing RAG technology cannot meet the actual fuzzy query needs, especially when querying media-related documents, the information of segmented chunked document is incomplete, making it difficult to meet the needs of fuzzy query needs.
Provide a server and knowledge base construction method, which determines the media label combination and prompt template by obtaining media information and querying category sets, inputs training models to generate data documents, and builds a knowledge base. When building a knowledge base, this method extracts keywords for each query category, determines the media label combination and prompt templates, so that the data documents generated by the training model can accurately summarize and interpret the query data.
The built knowledge base can meet the needs of fuzzy queries. The length of the data document will not be too long, avoiding segmentation of the data document, improving the accuracy of fuzzy queries, and allowing users to have a good user experience when conducting fuzzy queries.
Smart Images

Figure CN119557350A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of database processing, and in particular to a server and a knowledge base construction method. Background Art
[0002] At present, when using the Retrieval-augmented Generation (RAG) technology to perform retrieval queries on documents in a knowledge base, the documents are usually segmented first, and the documents are recalled based on the segments, so as to improve the recall rate of the query.
[0003] However, when performing fuzzy queries, for media-related documents, the information of the segmented documents is incomplete and does not have clear semantic information, making it difficult to meet the needs of fuzzy queries. If the documents are not segmented for querying, there are also problems such as the documents being too long, difficulty in capturing the overall semantic information, and a large deviation from the semantics of the fuzzy query, which cannot meet the needs of fuzzy queries. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a server and a knowledge base construction method for solving the problem that the knowledge base of the current RAG technology cannot meet the actual fuzzy query needs.
[0005] The technical solution of this application is as follows:
[0006] In a first aspect, the present application provides a server, comprising: a memory configured to store instructions; a processor coupled to the memory and configured to: obtain media information and a query category set, the media information comprising multiple media tags and media information content corresponding to the multiple media tags, and the query category set comprising multiple query categories; determine at least one media tag combination of the query category; wherein the media tag combination comprises one or more media tag categories; determine at least one prompt template corresponding to the media tag combination, the prompt template being used to indicate the number of data documents and media tag content corresponding to the query category; input the prompt template into a first preset training model to obtain a data document; wherein the data document is used to characterize the data to be queried corresponding to the prompt template; and construct a knowledge base based on the data document.
[0007] The above technical solution has the following advantages or beneficial effects: when the knowledge base constructed by the present application is applied, for the fuzzy query requirements proposed by the user, since prompt templates have been constructed for the media resource label combinations that can be combined in all categories of fuzzy queries when constructing the knowledge base, the data documents obtained after each prompt template is input into the training model are stored in the knowledge base. Therefore, the data documents in the knowledge base can meet the needs of fuzzy queries, and the length of each data document will not be too long. There is no need to segment the data documents during the fuzzy query process, which improves the accuracy of the fuzzy query and allows users to have a good user experience when performing fuzzy queries.
[0008] In some embodiments, the media tags include: introduction, attributes, roles, actors, titles, covers, and lines; the processor determines at least one media tag combination corresponding to the media tag combination, and is specifically configured to: obtain a tag combination strategy corresponding to the query category, the tag combination strategy is used to indicate at least one media tag among multiple media tags that matches the query category; according to the tag combination strategy, determine at least one media tag that matches the query category from multiple media tags; according to at least one media tag that matches the query category, determine at least one media tag combination of the query category.
[0009] The above technical solution has the following advantages or beneficial effects: when constructing a knowledge base, for each query category, keywords in the query are extracted to determine which media asset tags should be focused on for the query category, and to determine the specific types of media asset tag combinations that the keywords can be combined into.
[0010] In some embodiments, the label combination strategy also includes the number of data documents corresponding to the query category, and the processor determines at least one prompt template corresponding to the media label combination, and is specifically configured to: determine the media information content corresponding to the media label in the media label combination from the media information; determine the prompt template based on the media information content corresponding to the media label in the media label combination and the number of data documents corresponding to the query category.
[0011] The above technical solution has the following advantages or beneficial effects: for each media asset tag combination, a prompt template is determined, which specifically instructs the training model during training on the number of data documents summarizing the query results and the media asset tag content to be queried, so that the data document finally obtained by the training model can accurately summarize and explain the data to be queried to be stored in the knowledge base.
[0012] In some embodiments, the processor constructs a knowledge base based on the data documents, and is specifically configured as follows: storing the data documents in a database; and determining the database that has stored the data documents as the knowledge base.
[0013] The above technical solution has the following advantages or beneficial effects: data documents of all query categories are stored in a database to form a knowledge base for users to perform fuzzy queries.
[0014] In some embodiments, after obtaining the data document, the processor is further configured to: rewrite the data document according to a second preset training model, and the syntactic evaluation index of the rewritten data document is higher than a first preset threshold; wherein the syntactic evaluation index includes at least one of the following: accuracy, recall rate, F1 value, unlabeled dependency, and labeled dependency.
[0015] The above technical solution has the following advantages or beneficial effects: before the data document is stored in the database, the data document is rewritten, which improves the fluency and semantic clarity of the data document, making the query results obtained when the knowledge base is applied easier for users to understand.
[0016] In some embodiments, the processor is further configured to: receive a user query request; in the case where the user query request is a fuzzy query, determine the vector encoding of the user query request and the vector encoding of each data document in the knowledge base; determine as a target data document a data document whose semantic similarity between the vector encoding in the knowledge base and the vector encoding of the user query request is greater than a second preset threshold; and determine a query result of the user query request based on the target data document.
[0017] The above technical solution has the following advantages or beneficial effects: when a user makes a fuzzy query request, the query result can be determined according to the knowledge base.
[0018] In some embodiments, the processor determines the vector encoding of the user query request and the vector encoding of each data document in the knowledge base, and is specifically configured to: vectorize the user query request and each data document in the knowledge base according to the vector encoding calculation model to obtain the vector encoding of the user query request and the vector encoding of each data document in the knowledge base.
[0019] The above technical solution has the following advantages or beneficial effects: the vector code of the user query request and the vector code of each data document are calculated according to the vector calculation model, thereby ensuring the accuracy of the semantic similarity between the two calculated in the subsequent process.
[0020] In some embodiments, the processor determines the query result of the user query request based on the target data document, and is specifically configured to: determine the media information content corresponding to the target data document; input the user query request, the target data document, and the media information content corresponding to the target data document into a third preset training model to obtain the query result of the user query request; the query result is used to display the text information and image information in the media information content corresponding to the user query request.
[0021] The above technical solution has the following advantages or beneficial effects: through the training of the third preset training model, the user query request, the target data document and the media information content corresponding to the target data document can be converted into a query result with high readability and visualization. The query result displays information more intuitively and is easier for users to understand.
[0022] In some embodiments, the processor is further configured to: send the query result to a display device.
[0023] The above technical solution has the following advantages or beneficial effects: it enables the user to see the query results on a display device connected to the server.
[0024] In some embodiments, the type of the first preset training model includes RAG big data model, neural network model, and generative AI big model; the type of the second preset training model includes RAG big data model, neural network model, and generative AI big model; the type of the third preset training model includes RAG big data model, neural network model, and generative AI big model.
[0025] The above technical solution has the following advantages or beneficial effects: by adopting these types of preset models, the trained data documents can better meet the requirements of this application, the rewriting effect of the data documents is better, and the query results are easier for users to understand.
[0026] In a second aspect, the present application provides a display method, comprising:
[0027] Acquire media information and a query category set, wherein the media information includes multiple media tags and media information content corresponding to the multiple media tags, and the query category set includes multiple query categories; determine at least one media tag combination of the query category; wherein the media tag combination includes one or more media tags; determine at least one prompt template corresponding to the media tag combination, the prompt template is used to indicate the number of data documents corresponding to the query category and the media information content corresponding to the media tags in the media tag combination; input the prompt template into a first preset training model to obtain a data document; wherein the data document is used to characterize the data to be queried corresponding to the prompt template; and construct a knowledge base based on the data document.
[0028] In a third aspect, the present invention provides a computer-readable storage medium, comprising: a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform any display method provided in the second aspect.
[0029] In a fourth aspect, the present invention provides a computer program product. When the computer program product is run on a computer, the computer executes any one of the display methods provided in the second aspect.
[0030] It should be noted that the above computer instructions may be stored in whole or in part on a first computer-readable storage medium, wherein the first computer-readable storage medium may be packaged together with the processor of the display device, or may be packaged separately from the processor of the display device, which is not limited in this application.
[0031] The description of the second, third and fourth aspects in this application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third and fourth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0032] In this application, the name of the above display device does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalent technologies.
[0033] These and other aspects of the present application will become more apparent from the following description.
[0034] The technical solution provided by the present application extracts keywords in the query for each query category when constructing the knowledge base to determine which media asset tags should be queried for the query category, and to determine which media asset tag combinations can be combined with keywords; thereafter, a prompt template is determined for each media asset tag combination, and the prompt template specifically instructs the training model to summarize the number of data documents of the query results and the media asset tag content to be queried during training, so that the data document finally obtained by the training model can accurately summarize and explain the data to be queried to be stored in the knowledge base, and finally store the data documents of all query categories in the database to form a knowledge base for users to perform fuzzy queries. In addition, each media asset tag combination has its own corresponding data document, rather than all media asset tag combinations corresponding to one data document, so the length of the data document is shorter, and there is no need to segment the data documents in the knowledge base when performing fuzzy query applications later. In addition, before the data document is stored in the database, the data document will be rewritten to improve the fluency of the data document and the clarity of the semantics, so that the query results obtained when the knowledge base is applied are easier to be understood by users. In this way, when the knowledge base constructed by the present application is applied, for the fuzzy query requirements put forward by the user, since prompt templates have been constructed for the media resource label combinations that can be combined in all categories of fuzzy queries when constructing the knowledge base, the data documents obtained after each prompt template is input into the training model are stored in the knowledge base. Therefore, the data documents in the knowledge base can meet the needs of fuzzy queries, and the length of each data document will not be too long. There is no need to segment the data documents during the fuzzy query process, which improves the accuracy of the fuzzy query and allows users to have a good user experience when performing fuzzy queries. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0036] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0037] Figure 1 A schematic diagram of a scenario of a knowledge base construction method provided in an embodiment of the present application;
[0038] Figure 2 One of the structural schematic diagrams of the display device provided in the embodiment of the present application;
[0039] Figure 3 A second structural schematic diagram of a display device provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of the structure of a server provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of a process for constructing a knowledge base by a server provided in an embodiment of the present application;
[0042] Figure 6 A schematic diagram of the media asset information content provided in the embodiment of the present application;
[0043] Figure 7 A schematic diagram of a prompt template provided in an embodiment of the present application;
[0044] Figure 8 A schematic diagram of a query process performed by a server provided in an embodiment of the present application;
[0045] Fig. 9 A schematic diagram of the query results provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following embodiments do not represent all implementations consistent with the present application. They are only examples of systems and methods consistent with some aspects of the present application as detailed in the claims.
[0047] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0048] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0049] The terms "including" and "having" and any variations thereof are intended to cover but not be exclusive, for example, a product or device comprising a series of components is not necessarily limited to all the components explicitly listed, but may include other components not explicitly listed or inherent to these products or devices. The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or combination of hardware and / or software code that is capable of performing the functions associated with the element.
[0050] In the embodiment of the present application, the display device 200 mentioned generally refers to a device with image display and data processing capabilities. For example, the display device 200 includes but is not limited to a smart TV, a mobile terminal, a computer, a monitor, an advertising screen, a wearable device, a virtual reality device, an augmented reality device, etc.
[0051] Figure 1 This is a schematic diagram of an operation scenario between a display device and a control device provided in some embodiments of the present application. Figure 1 As shown in FIG. 1 , a user can operate the display device 200 through touch operation, the mobile terminal 300 and the control device 100. The control device 100 is used to receive operation instructions input by the user and convert the operation instructions into control instructions that can be recognized and responded to by the display device 200. For example, the control device 100 can be a remote controller, a stylus pen, a handle, etc.
[0052] The mobile terminal 300 can be used as a control device for performing human-computer interaction between the user and the display device 200. The mobile terminal 300 can also be used as a communication device for establishing a communication connection with the display device 200 and performing data interaction. In some embodiments, the mobile terminal 300 can install software applications with the display device 200, and achieve connection and communication through a network communication protocol to achieve the purpose of one-to-one control operation and data communication. The audio and video content displayed on the mobile terminal 300 can also be transmitted to the display device 200 to achieve a synchronous display function.
[0053] In some embodiments, the mobile terminal 300 or other electronic devices may also simulate the functions of the control device 100 by running an application program for controlling the display device 200 .
[0054] like Figure 1 As also shown in FIG. 4 , the display device 200 also communicates data with the server 400 through various communication methods. The display device 200 may be allowed to communicate and connect through a local area network (LAN), a wireless local area network (WLAN), and other networks.
[0055] The server 400 can train the Wensheng graph model using a large amount of character image data. The character image data can be obtained by generalizing the character features of the character image uploaded by the display device 200. The display device 200 can send the user input information to the server 400, and the server 400 can input the user input information into the Wensheng graph model, thereby generating images that meet the user's needs in advertising creation, copywriting, digital human production and promotion, story production, etc.
[0056] The display device 200 may provide a broadcast receiving television function, and may also additionally provide an intelligent network television function with a computer support function, including but not limited to network television, smart television, Internet Protocol television (IPTV), and the like.
[0057] Figure 2 Some embodiments of the present application provide Figure 1 2 is a block diagram of the hardware configuration of the display device 200.
[0058] In some embodiments, the display device 200 may include at least one of a tuner 210, a communication device 220, a detector 230, a device interface 240, a controller 250, a display 260, an audio output device 270, a memory, a power supply, and a user input interface.
[0059] In some embodiments, the detector 230 is used to collect signals of the external environment or external interaction. For example, the detector 230 includes a light receiver, a sensor for collecting the intensity of ambient light; or, the detector 230 includes an image collector, such as a camera, which can be used to collect external environment scenes, user attributes or user interaction gestures; or, the detector 230 includes a sound collector, such as a microphone, etc., for receiving external sounds.
[0060] In some embodiments, the display 260 includes a display function component for presenting a picture, and a driving component for driving an image display. The display 260 is used to receive an image signal output from the controller 250 for display. For example, the display 260 can be used to display video content, image content, and components of a menu control interface and a user control UI interface.
[0061] In some embodiments, the communication device 220 is a component for communicating with an external device or server 400 according to various communication protocol types. The display device 200 may be provided with a plurality of communication devices 220 according to different supported communication modes. For example, when the display device 200 supports wireless network communication, the display device 200 may be provided with a communication device 220 including a WiFi function. When the display device 200 supports Bluetooth connection communication, the display device 200 needs to be provided with a communication device 220 including a Bluetooth function.
[0062] The communication device 220 can enable the display device 200 to communicate with the external device or server 400 by wireless or wired connection. Among them, the wired connection can connect the display device 200 with the external device through components such as data cables and interfaces. The wireless connection can connect the display device 200 with the external device through wireless signals or wireless networks. The display device 200 can establish a connection relationship with the external device directly, or indirectly establish a connection relationship through a gateway, a router, a connection device, etc.
[0063] In some embodiments, the controller 250 may include at least one of a central processing unit, a video processor, an audio processor, a graphics processor, and a power processor, and a first interface to an nth interface for input / output. The controller 250 controls the operation of the display device and responds to the user's operation through various software control programs stored in the memory. The controller 250 controls the overall operation of the display device 200.
[0064] In some embodiments, the controller 250 and the tuner-demodulator 210 may be located in different separate devices, that is, the tuner-demodulator 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0065] In some embodiments, the user may input a user command through a graphical user interface (GUI) displayed on the display 260 , and the user input interface receives the user input command through the graphical user interface (GUI).
[0066] In some embodiments, the audio output device 270 may be a local speaker of the display device 200, or may be an external audio output device of the display device 200. In particular, for the external audio output device of the display device 200, the display device 200 may also be provided with an external audio output terminal, and the audio output device may be connected to the display device 200 through the external audio output terminal to output the sound of the display device 200.
[0067] In some embodiments, the user input interface 280 can be used to receive instructions from the user. For example, the user input interface 280 can receive instructions from the user to select a character image. The user input interface 280 can receive text information input by the user in the user interface. The text information includes character description information and description information for generating a specific image. The user input interface 280 can receive confirmation instructions from the user for controls or images in the user interface. The user input interface 280 can also receive voice instructions input by the user.
[0068] In order to perform user interaction, in some embodiments, the display device 200 may run an operating system. The operating system is a computer program for managing and controlling hardware resources and software resources in the display device 200. The operating system may control the display device to provide a user interface, for example, the operating system may directly control the display device to provide a user interface, or may provide a user interface by running an application program. The operating system also allows the user to interact with the display device 200.
[0069] It should be noted that the above operating system can be a native operating system based on a specific operating platform, or a third-party operating system deeply customized based on a specific operating platform, or an independent operating system specially developed for display devices.
[0070] The operating system can be divided into different modules or layers according to the functions implemented, such as Figure 3 As shown, in some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (Applications) layer (referred to as "application layer"), the application framework layer (Application Framework) layer (referred to as "framework layer"), the system library layer and the kernel layer.
[0071] In some embodiments, the application layer is used to provide services and interfaces for applications so that the display device 200 can run applications and interact with users based on the applications. At least one application can be run in the application layer, and these applications can be window programs, system settings programs, clock programs, etc. that come with the operating system; they can also be applications developed by third-party developers. In specific implementations, the application packages in the application layer are not limited to the above examples.
[0072] In the embodiment of the present application, the application layer may include a Wenshengtu application. The Wenshengtu application may generate a corresponding image according to the text input by the user. The Wenshengtu application may be used to generate advertising creation images, copywriting creation images, digital human production and promotional images, and story production images, etc.
[0073] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications. The application framework layer includes some predefined functions. The application framework layer is equivalent to a processing center that determines the actions that applications in the application layer take. Through the API interface, applications can access system resources and obtain system services during execution.
[0074] like Figure 3As shown, in the embodiment of the present application, the application framework layer includes a view system, managers, content providers, etc., wherein the view system can design and implement the interface and interaction of the application, and the view system includes lists, grids, text boxes, buttons, etc. The manager includes at least one of the following modules: an activity manager for interacting with all activities running in the system; a location manager for providing system services or applications with access to system location services; a package manager for retrieving various information related to the application package currently installed on the device; a notification manager for controlling the display and clearing of notification messages; and a window manager for managing icons, windows, toolbars, wallpapers, and desktop widgets on the user interface.
[0075] In some embodiments, the activity manager is used to manage the life cycle of each application and the usual navigation back function, such as controlling the exit, opening, and back of the application. The window manager is used to manage all window programs, such as obtaining the display screen size, determining whether there is a status bar, locking the screen, capturing the screen, and controlling the display window changes, for example, reducing the display window, shaking the display, distorting the display, etc.
[0076] In some embodiments, the system runtime layer can provide support for the framework layer. When the framework layer is used, the operating system will run the instruction library contained in the system runtime layer, such as the C / C++ instruction library, to implement the functions to be implemented by the framework layer.
[0077] In some embodiments, the kernel layer is a functional layer between the hardware and software of the display device 200. The kernel layer can implement functions such as hardware abstraction, multitasking, and memory management. Figure 3 As shown, the kernel layer may be configured with hardware drivers, and the drivers included in the kernel layer may be at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver, etc.
[0078] It should be noted that the above example is only a simple division of the operating system functions and does not constitute a limitation on the specific operating system form of the display device 200 in the embodiment of the present application. Depending on factors such as the function of the display device and the type of operating system, the number of levels and specific level types contained in the operating system may be expressed in other forms.
[0079] For example, Figure 4 FIG. 4 shows a schematic diagram of the structure of a server. The server may be a specific example of the server 400 in the aforementioned embodiment. Figure 4 As shown, the server includes one or more processors 201, a communication line 202, and at least one communication interface ( Figure 4 The example in which the communication interface 203 and a processor 201 are included is merely exemplary), and a memory 204 may also be included optionally.
[0080] The processor 201 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.
[0081] The communication line 202 may include a pathway for communication between different components.
[0082] The communication interface 203 may be a transceiver module for communicating with other devices or communication networks, such as Ethernet, RAN, wireless local area networks (WLAN), etc. For example, the transceiver module may be a device such as a transceiver or a transceiver. Optionally, the communication interface 203 may also be a transceiver circuit located in the processor 201 to implement signal input and signal output of the processor.
[0083] The memory 204 may be a device with a storage function. For example, it may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processor via the communication line 202. The memory may also be integrated with the processor.
[0084] The memory 204 is used to store computer-executable instructions for executing the solution of the present application, and the execution is controlled by the processor 201. The processor 201 is used to execute the computer-executable instructions stored in the memory 204, thereby implementing the corresponding steps in the video analysis method provided in the embodiment of the present application.
[0085] Alternatively, optionally, in an embodiment of the present application, the processor 201 may also perform processing-related functions in the video analysis method provided in the following embodiments of the present application, and the communication interface 203 is responsible for communicating with other devices (such as operation display devices, scheduling devices) or communication networks, which is not specifically limited in the embodiments of the present application.
[0086] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, which is not specifically limited in the embodiments of the present application.
[0087] In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 in.
[0088] In a specific implementation, as an embodiment, the server may include multiple processors, such as Figure 4The processor 201 and the processor 207 in the embodiment of the present invention are shown in FIG. Each of these processors may be a single-core processor or a multi-core processor. The processors here may include but are not limited to at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., and each computing device may include one or more cores for executing software instructions to perform calculations or processing.
[0089] In a specific implementation, as an embodiment, the server may further include an output device 205 and an input device 206. The output device 205 communicates with the processor 201 and may display information in a variety of ways. For example, the output device 205 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 206 communicates with the processor 201 and may receive user input in a variety of ways. For example, the input device 206 may be a mouse, a keyboard, a touch screen device, or a sensor device.
[0090] The server may be a general-purpose device or a dedicated device. For example, the server may be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, an embedded device, or a computer having Figure 4 The embodiment of the present application does not limit the type of server.
[0091] At present, in the field of media asset search, with the rapid growth of media asset content and the diversification of user search needs, the existing keyword-based search methods have been unable to meet the user's search needs for fuzzy and complex queries. Specifically, the existing keyword-based search methods first segment the user's query and identify entities, use the inverted index to retrieve the media assets containing keywords in the media asset attribute information, and then recommend the most relevant media assets to the user through the ranking model. However, the user's fuzzy and complex query usually does not contain specific entity words, the search intent is unclear, and contains multiple topics or sub-topics, such as "TV series suitable for the whole family", "cartoons suitable for children", "TV series about the nine sons of the Qing Dynasty fighting for the throne", etc. Therefore, the existing keyword-based search methods cannot meet the search needs or can only meet part of the user's search query needs, and cannot meet the needs of multiple topics and multiple keywords at the same time.
[0092] Retrieval-Augmented Generation (RAG) technology, as a method of retrieval-augmented generation, retrieves documents related to the search query from the knowledge base, and then inputs the retrieved documents, query and prompt templates into the large model to generate results. When using RAG technology to retrieve documents in the knowledge base, the documents are usually segmented first, and the documents are recalled based on the segments to improve the recall rate of the query. However, when performing fuzzy queries, for documents related to media resources, the information of the segmented segments is incomplete and does not have clear semantic information, making it difficult to meet the needs of fuzzy queries; if the documents are not segmented for querying, there are also problems such as too long documents, difficulty in capturing the overall semantic information, and large deviations from the semantics of the fuzzy query, which cannot meet the needs of fuzzy queries.
[0093] For example, if a user searches for "TV series similar to Nothing But Thirty", the knowledge base only stores information such as media asset profiles, actors, and attributes. Whether sparse retrieval or vector retrieval is used, only TV series and highlights related to Nothing But Thirty will be retrieved from the knowledge base, but TV series similar to Nothing But Thirty will not be retrieved. Therefore, the knowledge base of RAG technology at this stage cannot meet the actual fuzzy query needs, and a special knowledge base needs to be built for media asset search based on RAG technology.
[0094] In view of the above problems, an embodiment of the present application provides a server that can construct a knowledge base for fuzzy query based on the operation instruction generated by the user triggering the key. In some embodiments, Figure 5 A schematic diagram of a process for a server to construct a knowledge base according to an operation instruction provided in an embodiment of the present application. Figure 5As shown, an embodiment of the present application provides a server, the server comprising: a memory 204 and a processor 201. The memory 204 is configured to store instructions to be executed by the processor; the processor 201 is coupled to the memory 204 and configured to execute the following program steps:
[0095] S501: Acquire media asset information and query category set.
[0096] The media information includes multiple media tags and the media information contents corresponding to the multiple media tags. For example, the media tags in the media information may include: Summary, Tags, Role, Actor, Title, Cover, Lines, etc.
[0097] For example, the media asset information content corresponding to the media asset tag is as follows: Figure 6 As shown. Figure 6 In the example, a piece of media information about the movie "The Lord of the Rings" is displayed, including the media tags of title, introduction, attributes, roles, actors, and cover. Each media tag is followed by the corresponding media information content. For example, the corresponding media information content of the media tag "Title" is "The Lord of the Rings: The Fellowship of the Ring".
[0098] It is understandable that the media information can be obtained in a variety of ways. For example, the media information can be pre-stored in a database of a real device, and the processor obtains it by accessing the database; or, when the server is connected to the network, the server accesses the Internet through a corresponding link to obtain it. The embodiment of the present application does not specifically limit the method for obtaining the media information.
[0099] Exemplarily, the query category set includes multiple query categories. It is understandable that when obtaining the query category set, it is necessary to obtain historical data related to fuzzy queries in advance, extract fuzzy queries from these historical data, and classify them to obtain one or more query categories. In other words, one query category can correspond to multiple historical data of fuzzy queries.
[0100] The query category set can be expressed as C = {c1, c2, ..., c n}, any query category can be used i Indicates that the set includes N query categories.
[0101] Exemplarily, the query categories can be summarized into the following categories:
[0102] (1) Search for TV series related to a certain actor / role. For example: "I want to watch Princess Elsa / I want to watch Zhao XX's drama";
[0103] (2) Search for TV series of a certain theme. For example, "Please recommend a few TV series about the Anti-Japanese War";
[0104] (3) Search for TV series related to a certain plot. For example, "Please recommend a TV series about the nine emperors of the Qing Dynasty fighting for the throne";
[0105] (4) Searches related to scenes. For example: "Please recommend a movie suitable for Valentine's Day / Please recommend a TV series suitable for the whole family to watch together";
[0106] (5) TV series similar to a certain TV series. For example: "Please recommend a TV series similar to Nothing But Thirty."
[0107] The above is an exemplary description of the specific division of query categories. In actual applications, query categories can be further divided according to needs, and are not limited to the five categories in the above examples.
[0108] It is understandable that if Figure 5 As shown, the media asset information and query category set obtained in S501 can be used for the execution of the subsequent processes in S502-S504. For example, the media asset tag combination in S502 is determined for each query category in the query category set; the determination of the prompt template in S503 and the training process of the first preset training model in S504 both require the use of media asset information.
[0109] S502: Determine at least one media asset tag combination of the query category.
[0110] The media asset tag combination includes one or more media asset tag categories. For a query category c in the query category set i , the query category c i The media resource label combination determined is recorded as m i indivual.
[0111] In a possible implementation, when S502 is executed, the processor may specifically determine at least one media asset tag combination corresponding to the query category according to the following S502a-S502c:
[0112] S502a: Obtain a label combination strategy corresponding to the query category.
[0113] The tag combination strategy is used to indicate at least one media asset tag among multiple media asset tags that matches the query category. It should be noted that the tag combination strategy specifically indicates: for a query category, the media asset information to be used for the subsequent generation of the data document in S504 can be used to determine which media asset tag combinations correspond to the query category.
[0114] For example, if the query category is "search for TV dramas related to a certain type of plot", the tag combination strategy may specifically indicate that the acquired media asset tags include: title, introduction, and lines, and combine the title with the introduction, and the title with the lines.
[0115] S502b: Determine at least one media asset tag matching the query category from multiple media asset tags according to the tag combination strategy.
[0116] S502c: Determine at least one media asset tag combination of the query category according to at least one media asset tag matching the query category.
[0117] Exemplarily, the media asset tag combination for determining the query category based on the tag combination strategy can be expressed as: The number of media resource label combinations can be expressed as m i For example, i ={{summary}, {summary, actors / roles}, {tags, cover}}, the number of combinations here is 3, that is, there are 3 media asset tag combinations, namely o1 = {summary}, o2 = {summary, actors / roles}, o3 = {tags, cover}.
[0118] S502b-S502c are described below with reference to specific examples:
[0119] In this example, the query category is "Please recommend a TV series about the nine emperors of the Qing Dynasty fighting for the throne". The data document generated by this query category should extract and summarize the key plots of the media assets, that is, the corresponding media asset tags
[0120] Therefore, the processor determines the media asset tags to be used as title, introduction, and lines according to the tag combination strategy, and the combination is {title, lines} and {title, introduction}, or {title, lines} and {title, summary}. That is, there are two media asset tag combinations corresponding to the query category, namely {title, lines} and {title, summary}.
[0121] It is understandable that whether the content in a specific media resource tag combination is in Chinese or English depends on the actual situation. This application does not make any specific limitation. In the subsequent description, English is used as an example.
[0122] It should be noted that in S502, the present application can extract keywords in the query for each query category to determine which media asset tags should be focused on for the query category, and determine the media asset tag combinations that the keywords can be combined into, so that the query results in the subsequent training process and knowledge base application process are more accurate.
[0123] S503: Determine at least one prompt template corresponding to the media asset tag combination.
[0124] The prompt template is used to indicate the number of data documents corresponding to the query category and the media asset tag content corresponding to the media asset tag in the media asset tag combination.
[0125] For the media asset tag combination determined in S502, the number of prompt templates required to be designed for N query categories can be recorded as Where Np represents the total number of prompt templates corresponding to N query categories, K represents a query category in N query categories, and m i Indicates the number of media asset tag combinations determined under a query category in the query category set.
[0126] In a possible implementation, the label combination strategy also includes the number of data documents corresponding to the query category. That is, the label combination strategy can also indicate the number of data documents finally obtained after training with the preset training model in S504. Based on this, when the processor executes S503, it can specifically include the following S503a-S503b:
[0127] S503a: Determine from the media asset information the media asset information content corresponding to all the media asset tags in the media asset tag combination.
[0128] Combined with the example of S502 in the previous text, the media resource tag combinations determined by the processor are {title, lines} and {title, summary}. At this time, the processor determines the media resource information content corresponding to the three tags of title, lines, and summary from the media resource information, such as "Startling by Each Step", "Prince, Father, Inheritance... (specific lines omitted here)", "Nine Sons of the Qing Dynasty Fight for Succession... (specific plot summary content omitted here)", etc.
[0129] S503b: Determine a prompt template according to the media asset information content corresponding to the media asset tags in the media asset tag combination and the number of data documents corresponding to the query category.
[0130] On the basis of having determined the media asset information contents corresponding to all the media asset tags in the media asset tag combination in S503a, the processor can determine a prompt template in combination with the number of data documents indicated in the tag combination strategy.
[0131] For example, the specific content of the prompt template is as follows: Figure 7 As shown. Figure 7 In addition to the number of data documents corresponding to the query category and the media asset information content corresponding to the media asset tag, the prompt template may also include some specific text to indicate the specific purpose of the prompt template.
[0132] Specifically, when the first preset training model in S504 in the following step is a generative AI large model, the prompt template may include a sentence indicating the purpose of the prompt template, such as "Please analyze the plot summary of the following TV series or movie, and extract the 5 tags that best represent the characteristics of the plot, or you can extract them based on your own knowledge", or add "When generating tags, please consider the theme of the plot, emotional trend, main events, and role relationships, etc." after the media asset tag content. These normative sentences can be in the form of declarative sentences or interrogative sentences, and this application does not make specific restrictions on this.
[0133] In another possible implementation, if the query category includes content indicating the number of data documents, the processor may also determine the prompt template according to the number of data documents included in the query category.
[0134] It should be noted that in this S503, the present application determines a prompt template for each media asset tag combination, and the prompt template specifically instructs the training model during training on the number of data documents summarizing the query results and the type of media asset tag content to query, so that the data document finally obtained by the training model can accurately summarize and explain the query results.
[0135] S504: Input the prompt template into the first preset training model to obtain a data document.
[0136] The data document is used to represent the data to be queried corresponding to the prompt template. The data to be queried is the data used to support fuzzy query in the knowledge base in actual applications.
[0137] It should be noted that, since the prompt template indicates the number of data files to be generated in the end, after the prompt template is input into the first preset training model, the first preset training model generates s j data documents. When the media resource information obtained in S501 includes T TV series (or movies, cartoons), the number of data documents generated by the first preset training model is Among them, Np represents the total number of prompt templates corresponding to N query categories, K represents a query category among N query categories, and s j Indicates the number of data documents that a prompt template requires the first preset training model to generate.
[0138] It should be noted that the data document is a short sentence used to represent the training results. Combined with the examples in S502 and S503 above, after the prompt template in the example is input into the first preset training model, the data document output by the first preset training model may be "The plot of "Startling by Each Step" involves the struggle for the throne between nine princes in the Qing Dynasty" and "Ruoxi and the eighth prince have a love story".
[0139] In one possible implementation, the types of the first preset training model include RAG big data model, neural network model, and generative AI big model.
[0140] It is understandable that since each media asset label combination has its own corresponding data document, rather than all media asset label combinations corresponding to one data document, the length of the data document output by the first preset training model in this S504 is shorter, and there is no need to segment the data documents in the knowledge base when performing fuzzy query applications later.
[0141] S505: Build a knowledge base based on the data documents.
[0142] In a possible implementation, the processor may first store the data document in a database; thereafter, the processor determines the database in which the data document is stored as a knowledge base. Specifically, the processor may store all the data documents output by the first preset training model in S504 into a preset blank database, and after all the data documents are stored, the database is determined as a knowledge base. The database may be a database of the type Faiss, Qdrant, etc.
[0143] It should be noted that the data document output by the first preset training model may have certain problems such as incoherent sentences, unclear semantics, and low degree of colloquialism, which makes it difficult for users to understand.
[0144] Therefore, in a possible implementation, before storing the data document in the database, the processor may also be configured to: rewrite the data document according to the second preset training model, and the syntactic evaluation index of the rewritten data document is higher than the first preset threshold.
[0145] Combined with the examples in S502, S503 and S504 in the previous text, when the output data documents are "The plot of Startling by Each Step includes the struggle for the throne between nine princes in the Qing Dynasty" and "There is a love story between Ruoxi and the Eighth Prince", the processor can input these two data documents into the second preset training model for rewriting, and the rewriting results are "The plot labels of the TV series Startling by Each Step include the struggle for the throne between nine princes in the Qing Dynasty" and "The love and hate between the heroine Ruoxi and the Eighth Prince". Afterwards, the processor calculates the syntactic evaluation index for the rewritten results, and outputs the rewriting results of the two data documents when the syntactic evaluation index is higher than the first preset threshold.
[0146] The syntax evaluation index includes at least one of the following: accuracy, recall, F1 value, unlabeled dependency, and labeled dependency. In practical applications, the parameters of the syntax evaluation index can be selected according to actual needs, and this application does not make specific restrictions on this.
[0147] In one possible implementation, the types of the second preset training model include RAG big data model, neural network model, and generative AI big model.
[0148] Based on the above technical solution, when constructing the knowledge base, the present application extracts the keywords in the query for each query category to determine which media asset tags should be focused on for the query category, and determines which media asset tag combinations can be combined with the keywords; after that, for each media asset tag combination, a prompt template is determined, which specifically instructs the training model to summarize the number of data documents of the query results and the media asset tag content to be queried during training, so that the data document finally obtained by the training model can accurately summarize and explain the data to be queried to be stored in the knowledge base, and finally store the data documents of all query categories in the database to form a knowledge base for users to perform fuzzy queries. In addition, each media asset tag combination has its own corresponding data document, rather than all media asset tag combinations corresponding to one data document, so the length of the data document is shorter, and there is no need to segment the data documents in the knowledge base when performing fuzzy query applications later. In addition, before the data document is stored in the database, the data document will be rewritten to improve the fluency of the data document and the clarity of the semantics, so that the query results obtained when the knowledge base is applied are easier to be understood by users. In this way, when the knowledge base constructed by the present application is applied, for the fuzzy query requirements put forward by the user, since prompt templates have been constructed for the media resource label combinations that can be combined in all categories of fuzzy queries when constructing the knowledge base, the data documents obtained after each prompt template is input into the training model are stored in the knowledge base. Therefore, the data documents in the knowledge base can meet the needs of fuzzy queries, and the length of each data document will not be too long. There is no need to segment the data documents during the fuzzy query process, which improves the accuracy of the fuzzy query and allows users to have a good user experience when performing fuzzy queries.
[0149] In some embodiments, in combination Figure 5 ,like Figure 8 As shown, during the application of the knowledge base, the processor 250 provided in the embodiment of the present application is further configured to execute the following program steps:
[0150] S801: Receive a user query request.
[0151] It can be understood that the user query request here is a query request initiated by the user through the remote control of the server or voice input, and the query request can be a fuzzy query.
[0152] like Figure 8 As shown, the user query request received in S801 can be used for the execution of the subsequent process in S806. For example, the user query request in S806 participates in the process of determining the query result by the third preset training model.
[0153] S802: Determine whether the user query request is a fuzzy query.
[0154] For example, the processor can determine whether the user query request is a fuzzy query by analyzing the query keywords in the user query request or checking the query statement results in the user query request. In specific applications, the determination method of fuzzy query can be determined according to needs, and this application does not make specific limitations.
[0155] If it is determined that the user query request is a fuzzy query, then the subsequent step S803 is executed;
[0156] If it is determined that the user query request is not a fuzzy query, the subsequent step S805 is executed.
[0157] S803: When the user query request is a fuzzy query, determine the vector code of the user query request and the vector code of each data document in the knowledge base.
[0158] In one possible implementation, the processor vectorizes the user query request and each data document in the knowledge base according to the vector coding calculation model to obtain the vector coding of the user query request and the vector coding of each data document in the knowledge base. The types of vector coding calculation models include encoders, or the vector coding calculation model may also use other algorithms or models with vector processing functions, which are not specifically limited in this application. For example, the user query request is vectorized using an encoder to obtain the coding representation emb: [0.1, 0.3, ..., 0.5].
[0159] S804: Determine as a target data document a data document whose semantic similarity between the vector code in the knowledge base and the vector code of the user query request is greater than a second preset threshold.
[0160] It is understandable that the semantic similarity may be calculated by using methods such as Euclidean distance and inner product, or other indicators that can characterize the semantic similarity, which is not specifically limited in this application.
[0161] It should be noted that in practical applications, the second preset threshold can be set according to needs, and this application does not make specific restrictions. For example, when the semantic similarity is calculated using the Euclidean distance, the second preset threshold can be set to 0.4.
[0162] Alternatively, when determining the target data document, the data document in the knowledge base can be selected according to a specific strategy. For example, all data documents are sorted from high to low according to the semantic similarity between them and the vector encoding of the user query request, and the TOP X data documents are selected as the target data documents, and they are combined with the corresponding media information content to form a set rec_doc:{media_id1:doc1, media_id3:doc3,…,media_idk:dock}. It is not difficult to understand that the second preset threshold at this time is the semantic similarity between the vector encoding corresponding to the X+1th data document in the sort and the user query request.
[0163] S805: Extract keywords and match target data documents from the knowledge base according to the keywords.
[0164] It is understandable that when the user query request is not a fuzzy query, the target data document can be directly matched from the knowledge base according to the keywords in the user query request. For example, if the user query request is "search for the TV series Startling by Each Step", the processor extracts the keywords "TV series" and "Startling by Each Step", and can directly match the data document related to Startling by Each Step from the knowledge base, and then generate the query result through the subsequent S806.
[0165] S806: Determine the query result of the user's query request according to the target data document.
[0166] In a possible implementation, when the processor executes S806, the query result of the user query request is determined according to the target data document through the following S806a-S806b:
[0167] S806a: Determine the media asset information content corresponding to the target data document.
[0168] Exemplarily, the content of the media asset information may be determined by using keywords in the target data document. For example, if the target data document includes the specific name of a TV series, the specific content of the media asset information may be obtained based on the name.
[0169] S806b: Input the user query request, the target data document, and the media asset information content corresponding to the target data document into a third preset training model to obtain a query result of the user query request.
[0170] The query result is used to display the text information and image information in the media information content corresponding to the user's query request. Fig. 9 As shown, Fig. 9 It is only shown as an example, and the specific content of the title and recommendation reason is not clearly written.
[0171] In one possible implementation, Figure 8 As shown, in the process of training to obtain the query result, the third preset training model can refer to the prompt template corresponding to the target data document in addition to the user query request, the target data document and the media information content corresponding to the target data document, so as to improve the effect of displaying the information of the query result to be more intuitive and easier for the user to understand. Exemplarily, the types of the third preset training model include RAG big data model, neural network model, and generative AI big model.
[0172] Accordingly, after the processor determines the query result of the user's query request, the processor is further configured to: send the query result to the display device. Then, the display device displays the query result after receiving it, so that the user can view the display result. The display device here can be the display device 200 described in the above embodiment.
[0173] The above introduces the application process of the knowledge base constructed in this application.
[0174] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0175] The embodiment of the present application also provides a chip system, which can be applied to the server 400 in the aforementioned embodiment. The chip system includes at least one processor 2501 and at least one interface circuit 2502. The processor 2501 can be the processor in the above-mentioned server 400. The processor 2501 and the interface circuit 2502 can be interconnected through a line. The processor 2501 can receive and execute computer instructions from the memory of the above-mentioned server 400 through the interface circuit 2502. When the computer instructions are executed by the processor 2501, the server 400 can execute the various steps performed by the server 400 in the above-mentioned embodiment. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiment of the present application.
[0176] Some embodiments of the present application also provide a computer-readable storage medium, which can store a program. When the computer storage medium is configured in a display device or a server, the program may include the program steps involved in the image generation method in the above embodiment when the program is executed. Among them, the computer storage medium may be a disk, an optical disk, a read-only storage memory (English: Read-Only Memory, referred to as ROM) or a random access memory (English: Random Access Memory, referred to as RAM), etc. Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application, rather than to limit it; although the present application is described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that it is still possible to modify the technical solutions recorded in the aforementioned embodiments, or to replace some or all of the technical features therein by equivalent; and these modifications or replacements do not make the essence of the corresponding technical solution deviate from the scope of the technical solution of each embodiment of the present application.
[0177] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A server, characterized in that: include: a memory configured to store instructions executed by the processor; A processor is coupled to the memory and configured to: Acquire media information and a query category set, wherein the media information includes a plurality of media tags and media information contents corresponding to the plurality of media tags, and the query category set includes a plurality of query categories; Determine at least one media asset tag combination of the query category; wherein the media asset tag combination includes one or more of the media asset tags; Determine at least one prompt template corresponding to the media asset tag combination, wherein the prompt template is used to indicate the number of data documents corresponding to the query category and the media asset information content corresponding to the media asset tags in the media asset tag combination; Inputting the prompt template into a first preset training model to obtain a data document; wherein the data document is used to represent the data to be queried corresponding to the prompt template; A knowledge base is constructed according to the data document.
2. The server according to claim 1, characterized in that: The media asset tags include: introduction, attribute, role, actor, title, cover, and lines; the processor determines at least one media asset tag combination of the query category, and is specifically configured as follows: Acquire a tag combination strategy corresponding to the query category, where the tag combination strategy is used to indicate at least one media asset tag that matches the query category among the plurality of media asset tags; Determining at least one media asset tag matching the query category from the plurality of media asset tags according to the tag combination strategy; At least one media asset tag combination of the query category is determined according to at least one media asset tag matching the query category.
3. The server according to claim 2, characterized in that: The tag combination strategy also includes the number of data documents corresponding to the query category, and the processor determines at least one prompt template corresponding to the media asset tag combination, which is specifically configured as follows: Determining the media asset information content corresponding to the media asset tag in the media asset tag combination from the media asset information; The prompt template is determined according to the media asset information content corresponding to the media asset tags in the media asset tag combination and the number of data documents corresponding to the query category.
4. The server according to claim 3, characterized in that: The processor constructs a knowledge base according to the data document, and is specifically configured as follows: Storing the data document in a database; The database that has stored the data documents is determined as the knowledge base.
5. The server according to claim 4, characterized in that: After obtaining the data document, the processor is further configured to: The data document is rewritten according to a second preset training model, and a syntactic evaluation index of the rewritten data document is higher than a first preset threshold; wherein the syntactic evaluation index includes at least one of the following: accuracy, recall rate, F1 value, unlabeled dependency, and labeled dependency.
6. The server according to claim 5, characterized in that: The processor is further configured to: Receive user query requests; In the case where the user query request is a fuzzy query, determining a vector code of the user query request and a vector code of each data document in the knowledge base; Determine a data document whose semantic similarity between the vector code in the knowledge base and the vector code of the user query request is greater than a second preset threshold as a target data document; A query result of the user query request is determined according to the target data document.
7. The server according to claim 6, characterized in that: The processor determines the vector code of the user query request and the vector code of each data document in the knowledge base, and is specifically configured as follows: The user query request and each data document in the knowledge base are vectorized according to a vector coding calculation model to obtain a vector code of the user query request and a vector code of each data document in the knowledge base.
8. The server according to claim 7, characterized in that: The processor determines the query result of the user query request according to the target data document, and is specifically configured to: Determining the media asset information content corresponding to the target data document; Inputting the user query request, the target data document and the media asset information content corresponding to the target data document into a third preset training model to obtain a query result of the user query request; The query result is used to display the text information and image information in the media asset information content corresponding to the user query request.
9. The server according to claim 8, characterized in that: The processor is further configured to: The query result is sent to the display device.
10. The server according to any one of claims 1 to 9, characterized in that: The types of the first preset training model include retrieval enhancement generation RAG big data model, neural network model, and generative artificial intelligence AI big model; The types of the second preset training model include RAG big data model, neural network model, and generative AI big model; The types of the third preset training model include RAG big data model, neural network model, and generative AI big model.
11. A method for constructing a knowledge base, characterized in that: include: Acquire media information and a query category set, wherein the media information includes a plurality of media tags and media information contents corresponding to the plurality of media tags, and the query category set includes a plurality of query categories; Determine at least one media asset tag combination of the query category; wherein the media asset tag combination includes one or more of the media asset tags; Determine at least one prompt template corresponding to the media asset tag combination, wherein the prompt template is used to indicate the number of data documents corresponding to the query category and the media asset information content corresponding to the media asset tags in the media asset tag combination; Inputting the prompt template into a first preset training model to obtain a data document; wherein the data document is used to represent the data to be queried corresponding to the prompt template; A knowledge base is constructed according to the data document.
Citation Information
Cited By
Method and system for completing searching according to fuzzy significance label by using AI large model
CN120386810A