Cross-modal retrieval method and related device

By performing cross-modal search based on content and semantic information in the second modal database, the problem of single search dimension and low efficiency in the existing technology is solved, and richer and more comprehensive search results are achieved.

WO2023168997A9PCT designated stage expired Publication Date: 2024-09-12TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2022/134918
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-03-07
Filing Date
2022-11-29
Publication Date
2024-09-12

AI Technical Summary

Technical Problem

Existing search technology does not support cross-modal search, the search dimension is single, the efficiency is low, and the results are not comprehensive.

Method used

By obtaining the first modal data, searching in the second modal database based on its content information and semantic information, and merging matching data as cross-modal search results, supporting comprehensive search from both content and semantic dimensions.

Benefits of technology

It improves the efficiency of cross-modal search and the diversity and comprehensiveness of results, covering more dimensions of search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2022134918_12092024_PF_FP_ABST
    Figure CN2022134918_12092024_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are a cross-modal retrieval method and a related device. The cross-modal retrieval method comprises: acquiring first modal data; performing retrieval in a second modal database on the basis of content information of the first modal data, so as to obtain a first set, wherein the first set comprises at least one piece of second modal data that matches the content information of the first modal data; performing retrieval in the second modal database on the basis of semantic information of the first modal data, so as to obtain a second set, wherein the second set comprises at least one piece of second modal data that matches the semantic information of the first modal data; and merging the first set and the second set to obtain a cross-modal retrieval result corresponding to the first modal data. By means of the embodiments of the present application, the efficiency of cross-modal retrieval and the diversity and comprehensiveness of cross-modal retrieval results can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

A cross-modal search method and related equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 7, 2022, with application number 2022102220890 and application name “A cross-modal search method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to cross-modal search technology. Background Art

[0003] With the rapid development of internet technology, searching for data using computers has become an indispensable function in people's daily lives, work, and study. However, current search engines generally suffer from issues such as a lack of cross-modal support, a single search dimension, low search efficiency, and incomplete search results.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a cross-modal search method and related devices, which can improve the efficiency of cross-modal search and the diversity and comprehensiveness of cross-modal search results.

[0006] In one aspect, an embodiment of the present application provides a cross-modal search method, which is executed by a computer device and includes:

[0007] Obtaining first modal data;

[0008] Searching the second modality database based on the content information of the first modality data to obtain a first set, where the first set includes at least one second modality data that matches the content information of the first modality data;

[0009] Searching the second modality database based on the semantic information of the first modality data to obtain a second set, where the second set includes at least one second modality data that matches the semantic information of the first modality data;

[0010] The first set and the second set are merged to obtain cross-modal search results corresponding to the first modal data.

[0011] In one aspect, an embodiment of the present application provides another cross-modal search method, which is executed by a computer device and includes:

[0012] Displaying a conversation interface for social conversations;

[0013] In response to viewing the historical session record of the social conversation, displaying a session record details interface, wherein the session record details interface includes the second modality data in the historical session record of the social conversation;

[0014] In response to the first modal data input in the conversation record details interface, a cross-modal search result corresponding to the first modal data is output; the cross-modal search result is obtained using the cross-modal search method of an embodiment of the present application.

[0015] An embodiment of the present application provides a cross-modal search device, including:

[0016] An acquisition module, configured to acquire first modal data;

[0017] a search module configured to search the second modality database based on the content information of the first modality data to obtain a first set, wherein the first set includes at least one second modality data that matches the content information of the first modality data;

[0018] The search module is further configured to search the second modality database based on the semantic information of the first modality data to obtain a second set, wherein the second set includes at least one second modality data that matches the semantic information of the first modality data;

[0019] The merging module is used to merge the first set and the second set to obtain cross-modal search results corresponding to the first modal data.

[0020] On the one hand, an embodiment of the present application provides another cross-modal search device, including:

[0021] A display module, used to display the conversation interface of the social conversation;

[0022] The display module is further configured to display a session record details interface in response to viewing the historical session record of the social session, wherein the session record details interface includes the second modal data in the historical session record of the social session;

[0023] An output module is used to output cross-modal search results corresponding to the first modal data in response to the first modal data input in the conversation record details interface; the cross-modal search results are obtained using the cross-modal search method of an embodiment of the present application.

[0024] On the one hand, an embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the cross-modal search method in the embodiment of the present application.

[0025] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the cross-modal search method in the embodiment of the present application is executed.

[0026] On one hand, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, the cross-modal search method provided in one aspect of the embodiment of the present application is implemented.

[0027] In an embodiment of the present application, based on the content information of the first modal data, second modal data that matches the content information of the first modal data can be searched; based on the semantic information of the first modal data, second modal data that matches the semantic information of the first modal data can be searched; it can be seen that the embodiment of the present application not only supports cross-modal search, but also supports comprehensive search from the two dimensions of content and semantics, which makes the dimensions covered by the search no longer single; in addition, the second modal data searched in the two dimensions are merged as cross-modal search results, and search results of multiple dimensions can be obtained through a single search process, which improves the search efficiency of cross-modal search; in addition, since the cross-modal search results are obtained by merging the search results of the two dimensions, this makes the cross-modal search results more diversified and more comprehensive. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] FIG1 is an architecture diagram of a cross-modal search system provided in an embodiment of the present application;

[0029] FIG2 is a flowchart of a cross-modal search method according to an embodiment of the present application;

[0030] FIG3 is a second flow chart of a cross-modal search method provided in an embodiment of the present application;

[0031] FIG4a is a schematic structural diagram of a first modality processing network in a cross-modal search model provided in an embodiment of the present application;

[0032] FIG4 b is a schematic diagram of the structure of a second modality processing network in a cross-modal search model provided in an embodiment of the present application;

[0033] FIG5 is a schematic diagram of a training cross-modal search model provided in an embodiment of the present application;

[0034] FIG6 is a schematic diagram of an algorithm flow of a cross-modal search provided in an embodiment of the present application;

[0035] FIG7 is a third flow chart of a cross-modal search method provided in an embodiment of the present application;

[0036] FIG8a is a schematic diagram of an operation for viewing historical conversation records provided by an embodiment of the present application;

[0037] FIG8b is a schematic diagram of an operation of a cross-modal search provided by an embodiment of the present application;

[0038] FIG8c is a schematic diagram of an effect of outputting cross-modal search results provided by an embodiment of the present application;

[0039] FIG9 is a schematic structural diagram of a cross-modal search device provided in an embodiment of the present application;

[0040] FIG10 is a schematic diagram of the structure of another cross-modal search device provided in an embodiment of the present application;

[0041] FIG11 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0042] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0043] In order to better understand the solutions of the embodiments of the present application, the relevant terms and concepts that may be involved in the embodiments of the present application are first introduced below.

[0044] Chat Photo Wall: A page that displays all pictures sent and received in each chat in the application (APP).

[0045] Multimodal learning refers to mapping data from two different modalities into the same feature space (e.g., semantic space), so that the data from the two different modalities can be associated based on semantics. Modal data with similar semantics have similar features in the feature space. The two different modalities can be, for example, images and text.

[0046] Based on the above terms and concepts, the architecture of the cross-modal search system provided in the embodiments of the present application will be introduced below in conjunction with the accompanying drawings.

[0047] Please refer to Figure 1, which is a schematic diagram of the architecture of a cross-modal search system provided in an embodiment of the present application. As shown in Figure 1, the architecture diagram may include a database 101 and a cross-modal search device 102. The cross-modal search device 102 can establish a communication connection with the database 101 via a wired or wireless method. The database 101 can be a local database of the cross-modal search device 102, or a cloud database that the cross-modal search device 102 can access. The cross-modal search device 102 can specifically be a computer device such as a server or a terminal.

[0048] In the embodiments of the present application, the server may be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, without limitation. The terminal may be a smartphone, tablet computer, smart wearable device, smart voice interaction device, smart home appliance, personal computer, vehicle-mounted terminal, or other device, without limitation.

[0049] The database 101 may include a second modal database and a second modal feature library associated with the second modal database, and the second modal database is used to store the second modal data and the attribute information of the second modal data. Here, in one embodiment, the attribute information of the second modal data may be information contained in the second modal data itself, for example, the second modal data is an image, and the attribute information may be text in the image. In another embodiment, the attribute information of the second modal data may also be information associated with the second modal data, for example, the second modal data is an image, and the attribute information may be a category label annotated for the image. The second modal feature library is used to store the semantic features of the second modal data, and each semantic feature of the second modal data is provided with a feature index, which can assist in quickly searching for the second modal data from the second modal database.

[0050] The cross-modal search device 102 is used to search for the second modal data based on the first modal data, and then generate cross-modal search results. The specific process is as follows: ① Obtain the first modal data. The first modal data can be any one of text, voice, image, etc. ② Based on the content information and semantic information of the first modal data, search for the second modal data that matches the content information and the second modal data that matches the semantic information from the database 101 (specifically the second modal database). The content information here refers to the content contained in the first modal data itself, and the semantic information refers to the abstract meaning expressed by the first modal data. For example, the first modal data is text, the content information is the characters in the text, and the semantic information is the meaning expressed by the text. If the first modal data is an image, the content information can be the content contained in the image, such as text; the semantic information can be the semantic features extracted from the image. In one embodiment, based on the content information of the first modal data, second modal data that matches the content information can be directly searched from the second modal database. However, based on the semantic information of the first modal data, it is necessary to use the second modal feature library to search for second modal features that match the semantic information of the first modal data. Then, based on the second modal features, the corresponding second modal data is determined in the second modal database as the second modal data that matches the semantic information. ③ These second modal data are combined as cross-modal search results that match the first modal data.

[0051] The cross-modal search device 102 can also be used to output cross-modal search results corresponding to the first modal data based on the input first modal data. The specific process includes: ① displaying a conversation interface of a social conversation; ② displaying a conversation record details interface in response to a viewing operation of a historical conversation record of the social conversation; the conversation record details interface displays second modal data, and the second modal data belongs to the historical conversation record of the social conversation; ③ outputting cross-modal search results corresponding to the first modal data in response to the first modal data entered in the conversation record details interface. Optionally, a search box can be provided in the conversation record details interface for the conversation partner to manually enter the first modal data, or the first modal data can be recommended for the conversation partner to select, thereby quickly triggering the search function to perform a cross-modal search. In one embodiment, a cross-modal search can be performed according to specified search rules. For example, the input text can be searched according to image descriptions or text within images. In this way, the displayed cross-modal search results can be related to the search dimension. For example, the second modal data in the cross-modal search results that matches the content information of the first modal data can be output, or the second modal data in the cross-modal search results that matches the semantic information of the first modal data can be output.

[0052] From the above, we can see that the cross-modal search system supports the following two cross-modal search solutions: one is the general cross-modal search at the technical level, and the other is the cross-modal search in historical session records at the product level. The latter will output cross-modal search results, and the cross-modal search results are obtained by implementing the cross-modal search solution at the technical level. The cross-modal search device that carries these two solutions can be the same computer device or different computer devices; when the cross-modal search devices that carry these two solutions are different computer devices, assuming they are computer device A and computer device B, computer device B receives the input first modal data and sends the first modal data to computer device A. Computer device A searches from the database based on the acquired first modal data to obtain cross-modal search results, and then sends the cross-modal search results to computer device B, and outputs the cross-modal search results in computer device B; when the cross-modal search device that carries these two solutions is the same computer device, assuming it is computer device A, computer device A can automatically identify the input first modal data, search for matching second modal data from the database based on the first modal data, obtain cross-modal retrieval results and output them in computer device A.

[0053] It can be seen that the cross-modal search system provided by the embodiment of the present application can support searching for second modal data that matches the first modal data in the second modal database based on the content information of the first modal data and the semantic information of the first modal data respectively; this is a cross-modal search method, and a comprehensive search is performed from the two dimensions of content and semantics, so that the dimensions covered by the search are no longer single, and all second modal data related to the first modal data can be covered and searched, thereby obtaining search results faster and more accurately; in addition, the second modal data searched in the two dimensions are merged as cross-modal search results, so that search results of multiple dimensions are obtained in one search process, the efficiency of cross-modal search is significantly improved, and very rich and comprehensive search results can be obtained. In addition, the cross-modal search system can also provide a search function based on the historical conversation records of social conversations. This search function searches the second modal data in the historical conversation records and can display all cross-modal search results, or can search according to a specified dimension to display the cross-modal search results of the specified dimension. Due to the technical support of the above-mentioned cross-modal search solution, when the search function is enabled to search the second modal data in the historical conversation records, the freedom and complexity of the first modal data input are effectively improved.

[0054] To better understand the cross-modal search method provided in the embodiments of the present application, the following describes scenarios in which the cross-modal search method can be applied. Specifically, the cross-modal search method of the embodiments of the present application can be applied in Scenario 1 and Scenario 2 as shown below, but is not limited to these application scenarios. Scenario 1 and Scenario 2 are introduced below.

[0055] Scenario 1: The first modal data is text data, and the second modal data is image data, and searches and matches are performed on the image data and text data. In the historical conversation records of social conversations, there are many forms of conversation messages, such as pictures, videos, files, links, music, etc. Searching historical conversation records is a faster way to access the historical conversation messages contained in the historical conversation records. When searching for historical conversation records in the form of pictures or videos, manually entered text or selected recommended text can be used as search text, and then the image data that matches it, including pictures or videos, is output. In addition, when searching for pictures or videos in the system album of a smart terminal, the cross-modal search method of the embodiment of the present application can also be used. Similarly, text can be used as a query input, and the corresponding image data is output by matching the image features in the album, the text information contained in the image, or the associated text description information.

[0056] Scenario 2: The first modal data is audio data, and the second modal data is image data, and searches and matches are performed on the image data and voice data. Taking smartphones as an example, many smartphones are currently equipped with intelligent voice functions, which can control the terminal device to automatically perform corresponding operations through intelligent voice. Faced with a large number of pictures or videos in smartphones, voice queries involve the problem of cross-modal search, that is, recognizing and understanding the voice, mapping the voice and image to the same feature comparison space, so as to match the corresponding pictures. In addition, the voice can be converted into text, and the text can be matched with the image category label, text description information, etc. through comparison to match the corresponding picture or video. Through the cross-modal search method of the embodiment of the present application, voice can be used as a query input, and the image content in the mobile phone album is matched to automatically output the image that matches the voice.

[0057] The specific implementation of the cross-modal search method proposed in the embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0058] Please refer to Figure 2, which is a flowchart of a cross-modal search method provided in an embodiment of the present application. The cross-modal search method can be executed by a computer device (such as the cross-modal search device 102 shown in Figure 1). The cross-modal search method includes but is not limited to the following steps.

[0059] S201: Acquire first modal data.

[0060] Modality can refer to a source or form of information. For example, people have hearing, vision, smell, and touch, and the media of information include voice, video, text, pictures, etc., each of which can be regarded as a modality. In an embodiment of the present application, cross-modal search mainly involves the processing of information media, and modal data can specifically be data in different forms such as images, videos, and audio. The first modal data obtained can be modal data input by the user through a computer device. Optionally, the first modal data can be text data or image data input through auxiliary methods such as a physical keyboard, a virtual keyboard, and cursor selection, or can be audio data recognized by an intelligent voice device, or can be selected from recommended first modal data (such as recommended text).

[0061] S202: Search the second modality database based on the content information of the first modality data to obtain a first set.

[0062] The first set includes at least one second modal data that matches the content information of the first modal data. The content information of the first modal data is data information used to describe the essential content contained in the first modal data. For example, the first modal data is text, and the corresponding content information can be the text characters themselves, or keywords extracted based on the text; for another example, the first modal data is an image, and the corresponding content information can be other modal information or basic features contained in the image, such as any one or more of the geometric shape, texture, color, object category label, text description information, etc. contained in the image. Based on the dimension of the content information of the first modal data, all second modal data that matches the content information of the first modal data can be searched in the second modal database, and the matching second modal data can be added to the first set.

[0063] In one embodiment, the second modal database stores N second modal data and attribute information of each of the N second modal data, where N is a positive integer. The second modal data and the first modal data are data of two different modalities. The second modal data can be any of modal data such as text, image, audio, video, etc. The second modal data stored in the second modal database will be different in different business scenarios. For example, in the historical conversation record search of a social conversation, the second modal data can be an image sent or received in the conversation. The attribute information of the second modal data is information that describes the attributes of the second modal data, which can be associated information identified from the second modal data or generated by other data. The attribute information and the content information of the first modal data can be data in the same record form, for example, both are text description information. The content information of the first modal data can be matched with the attribute information of the second modal data, so that the matching second modal data can be searched in the second modal database to obtain the first set.

[0064] Optionally, the specific implementation method of step S202 includes the following steps S2021 and S2022: S2021. For each second modal data among the N second modal data, determine the matching degree between the content information of the first modal data and the attribute information of the second modal data as the matching degree corresponding to the second modal data; S2022. Add the second modal data whose corresponding matching degree meets the matching conditions to the first set.

[0065] The content information of the first modal data can be matched with the attribute information of each second modal data in the N second modal data in the second modal database to obtain the corresponding matching degree. The matching degree here can indicate whether the content information of the first modal data and the attribute information of the second modal data are similar or consistent. The matching degree between the content information of the first modal data and the attribute information of the second modal data can be measured by the similarity of the modal data (such as text similarity), or abstract semantic similarity, or other methods, which are not limited here. By judging whether the matching degree meets the matching conditions, the second modal data that matches the content information of the first modal data can be searched from the second modal database. The matching condition here can be set as a matching degree greater than or equal to a matching degree threshold, or it can be set as a matching degree arranged in the first y positions, where y is a positive integer. There is no restriction on the specific setting content of the matching condition.

[0066] Optionally, the attribute information includes one or both of first modal description information and category labels. The first modal description information refers to description information recorded in the form of the first modality. For example, if the first modal data is text, then the first modal description information is text description information. For another example, if the first modal data is an image, then the first modal description information is image description information. The first modal description information, as the attribute information of the second modal data, can be matched with the content information of the first modal data. When the content information of the first modal data and the attribute information of the second modality are both recorded in the form of the same modality, it is a match of the same modal information. In this way, by comparing the content information of the first modal data and the first modal description information of the second modal data, it is more convenient to screen out the second modal data that matches the content information of the first modal data. The category label is the information marked for classifying the second modal data. It can be manually marked for the second modal data, or it can be obtained by inputting the second modal data into a classification model for multi-label classification. The category label of the second modal data and the content information of the first modal data can also be matched to search for the second modal data that meets the matching conditions.

[0067] The detailed implementation steps of steps S2021 and S2022 may vary depending on the attribute information. For details, see the following two implementations. For ease of description, any one of the N second modal data is represented as the i-th second modal data, where i is a positive integer and is less than or equal to N.

[0068] In one embodiment, the attribute information includes first modal description information, and the implementation methods corresponding to steps S2021 and S2022 can be: determining the semantic similarity between the content information of the first modal data and the first modal description information of the i-th second modal data as the matching degree corresponding to the i-th second modal data; if the semantic similarity between the content information of the first modal data and the first modal description information of the i-th second modal data is greater than the first similarity threshold, adding the i-th second modal data to the first set.

[0069] Specifically, the degree of match between the content information of the first modal data and the attribute information of the second modal data can adopt the semantic similarity mentioned above. The method for obtaining the semantic similarity can be: extracting the semantic features corresponding to the content information of the first modal data and the semantic features corresponding to the first modal description information of the i-th second modal data, and then determining the similarity between the semantic features corresponding to the content information of the first modal data and the first modal description information of the i-th second modal data, and using it as the semantic similarity. Afterwards, it can be determined whether the i-th second modal data meets the matching condition by judging whether the semantic similarity is greater than the first similarity threshold: if the semantic similarity is greater than the first similarity threshold, it means that the degree of match between the attribute information of the i-th second modal data and the content information of the first modal data meets the matching condition, further indicating that the attribute information of the i-th second modal data matches the content information of the first modal data, and then the i-th second modal data can be added to the first set. Otherwise, the i-th second modal data will not be added to the first set.

[0070] By calculating the semantic similarity between the content information of the first modal data and the first modal description information of the second modal data, we can obtain the consistency of the semantics expressed by the content information of the first modal data and the first modal description information of the second modal data, and then determine whether the second modal data and the first modal data match.

[0071] Exemplarily, the first modal data is text data, the second modal data is image data, the specific content of the first modal data is "blue sky and white clouds", the content information is also the text content, and the first modal description information of the second modal data is text description information for the image content. The text description information is associated with the image and can be text information contained in the image or text description information associated with the image. When the text description content associated with the image is "The sky is so beautiful today", the keyword "sky" can be used as the first modal description information, and then the semantic similarity corresponding to the two texts "sky" and "blue sky and white clouds" can be determined to determine whether the two match, thereby determining whether the corresponding image is an image that matches the text.

[0072] In another embodiment, the attribute information includes a category label, and the implementation methods corresponding to steps S2021 and S2022 may be: determining the similarity between the content information of the first modal data and the category label of the i-th second modal data as the matching degree corresponding to the i-th second modal data; if the similarity between the content information of the first modal data and the category label of the i-th second modal data is greater than the second similarity threshold, adding the i-th second modal data to the first set.

[0073] When the attribute information includes a category label, the above-mentioned matching degree specifically refers to the similarity between the content information of the first modal data and the category label of the i-th second modal data. For example, it can be text similarity. The similarity can represent the degree of consistency between the category label of the second modal data and the content information of the first modal data. When the content information of the first modal data is completely identical to the category label of the i-th second modal data, the i-th second modal data is the second modal data that meets the matching conditions. Alternatively, if the content information of the first modal data is very similar to the category label, the i-th second modal data can also be determined as the second modal data that meets the matching conditions. Whether the i-th second modal data meets the matching condition can be determined specifically by whether the similarity between the content information of the first modal data and the category label of the i-th second modal data is greater than a second similarity threshold: if the similarity is greater than the second similarity threshold, it indicates that the matching degree between the content information of the first modal data and the category label of the i-th second modal data meets the matching condition, further indicating that the category information of the i-th second modal data matches the content information of the first modal data, then the i-th second modal data can be added to the first set; otherwise, the i-th second modal data will not be added to the first set.

[0074] Exemplarily, the first modal data is the search text, the second modal data is the image, the i-th second modal data is the target image, and is divided into two category labels of "person" and "scenery" by the classification model. Then, when the search text input is "person" or "scenery", since the category label and the search text are completely identical, the image can be matched. The similarity used here can specifically be text similarity.

[0075] It's important to note that if you only use category tags to search for images, and the search term must be exactly the same as the category tag to match relevant images, then due to the high search term requirements, limited supported search terms, and a single dimension, it's easy to find no results. However, integrating information from other dimensions to search, specifically searching from both semantics and content, while also lowering the matching criteria, such as including the category tag as a match, can not only improve search efficiency but also reduce the probability of empty search results.

[0076] It should be noted that the above two implementations are applicable to any one of the N second modal data. In this way, after the N second modal data stored in the second modal database are matched with the content information of the first modal data in the above manner, the first set finally obtained can be used as part of the following cross-modal search results.

[0077] S203: Search the second modality database based on the semantic information of the first modality data to obtain a second set.

[0078] The second set includes at least one second modal data that matches the semantic information of the first modal data. The semantic information of the first modal data, as another form of information representation, can specifically refer to the meaning represented by the real-world object corresponding to the first modal data. Semantic information can be used to represent a shallow or deep semantic understanding of the first modal data. The semantic information can be very rich. For example, when the first modal data is text, the same semantics can have many different textual expressions, which is very flexible.

[0079] By searching the second modal database based on the dimension of the semantic information of the first modal data, the semantic information of the second modal data can be matched with the semantic information of the first modal data, and then all the second modal data that match the semantic information of the first modal data can be searched from the second modal database to obtain a second set. Among them, the semantic information can be represented by semantic features, which can be specifically semantic feature vectors. Based on multimodal learning, the semantic features of the first modal data and the semantic features of the second modal data can be extracted respectively, and the semantic features of the two different modal data can be mapped to the same semantic feature space for similarity comparison. Then, the second modal data with similar semantics can be searched based on similar semantic features. The specific implementation method of this step can be found in the introduction of the corresponding embodiment of Figure 3 below, which will not be described in detail here.

[0080] Under the condition that the first modal data is text and the second modal data is an image, this step is a text-to-image search method based on cross-modal features. That is, by extracting the text feature vector of the search term and the image feature vector of the picture respectively, the feature vectors of the two different modalities are compared for similarity in the same semantic feature space, so that images with similar semantics can be directly retrieved across modalities through text descriptions. This can support more and more complex text descriptions and realize the input of free and diverse texts describing images to search for target images.

[0081] S204: Merge the first set and the second set to obtain cross-modal search results corresponding to the first modal data.

[0082] By searching the N second modal data stored in the second modal database according to the above steps, a first set matching the content of the first modal data and a second set matching the semantics of the first modal data can be obtained. By merging the first set and the second set, all second modal data matching the first modal data can be obtained, including second modal data matching the content information of the first modal data and second modal data matching the semantic information of the first modal data, that is, the cross-modal search results corresponding to the first modal data. The cross-modal search results obtained include search results of multiple dimensions, which are diverse and comprehensive search results.

[0083] The cross-modal search solution provided in the embodiment of the present application can search for second modal data that matches the content information of the first modal data in the second modal database based on the content information of the first modal data. Based on the semantic information of the first modal data, second modal data that matches the semantic information of the first modal data can be searched for in the second modal database. This search method is not limited to a certain dimension, but rather performs a comprehensive search from multiple dimensions. This makes the search coverage no longer single, and search results from multiple dimensions can be obtained through a single search, thereby improving the efficiency of cross-modal search. In addition, by merging the second modal data that matches the two dimensions of the first modal data as cross-modal search results, more diverse cross-modal search results can be obtained. The search is based on the content information of the first modal data, specifically based on the matching degree between the content information of the first modal data and the attribute information of the second modal data (which can be the first modal description information or category label). Since the attribute information is more of a description of the content contained in the second modal data, the first modal data can also be not limited to a fixed expression, but supports more diverse and complex expressions.

[0084] Please refer to Figure 3, which is a second flow diagram of a cross-modal search method provided in an embodiment of the present application. This method can be executed by a computer device (e.g., cross-modal search device 102 shown in Figure 1). The cross-modal search method of this embodiment is a detailed introduction to the corresponding implementation of step S203 of Figure 2: searching the second modal database based on the semantic information of the first modal data to obtain the second set.

[0085] The second modal database stores N second modal data. The second modal data is associated with a second modal feature library, which stores semantic features of each of the N second modal data. A specific implementation method for obtaining the second set by searching the second modal database based on the semantic information of the first modal data includes the following steps S301 to S304.

[0086] S301: Acquire semantic features of first modal data.

[0087] In one embodiment, the semantic features of the first modal data can be obtained by processing the cross-modal search model. Specifically, the cross-modal search model includes a first modal processing network. The specific implementation method of this step can be: through the first modal processing network in the cross-modal search model, the first modal data is subjected to feature extraction processing to obtain the semantic features of the first modal data. The first modal processing network is a processing network for the first modal data. For example, when the first modal data is text, the first modal processing network can be a text processing network. The text processing network can be a BERT (Bidirectional Encoder Representation from Transformers, a pre-trained language representation model) model or various variant models related to BERT, or other natural language processing (Natural Language Processing, NLP) models. As shown in Figure 4a, it is a schematic diagram of text encoder processing. Taking text as input, the text encoder can output a text feature vector.

[0088] 302 : Based on the semantic features of the first modal data, search a second modal feature library for a target semantic feature that matches the semantic features of the first modal data.

[0089] Whether the semantic features of the first modal data and the semantic features of the second modal data match can be determined by judging whether the similarity between the semantic features of the two modal data is greater than a similarity threshold. Specifically, the feature similarity between the N semantic features of the second modal data stored in the second modal feature library and the semantic features of the first modal data can be calculated respectively, and the semantic features of the second modal data whose feature similarity is greater than the similarity threshold are determined as the semantic features of the second modal data that match the semantic features of the first modal data, that is, the target semantic features. In the above manner, one or more target semantic features can be found from the second modal feature library.

[0090] Exemplarily, the first modal data is text, the second modal data is an image, the semantic feature corresponding to the first modal data is a text feature vector, and the semantic feature corresponding to the second modal data is an image feature vector. The text feature vector is used to retrieve similar image feature vectors from the image feature library. The specific retrieval method can be to use the text feature vector and the image feature vector to calculate the feature similarity, and use the image feature vector with a feature similarity higher than a threshold as the target image feature vector to match the text feature vector.

[0091] S303: Determine, in a second modality database, second modality data that matches the semantic information of the first modality data according to the target semantic feature.

[0092] Since the second modal feature library is associated with the second modal database, the target semantic feature found in the second modal feature library can be used to determine the second modal data corresponding to the target semantic feature from the second modal database, and then used as the second modal data that matches the semantic information of the first modal data.

[0093] In one embodiment, the second modal feature library and the second modal database are associated through a feature index. The implementation method of step S303 may specifically include the following steps: (1) determining the feature index corresponding to the target semantic feature; (2) based on the feature index corresponding to the target semantic feature, determining the second modal data corresponding to the feature index corresponding to the target semantic feature in the second modal database.

[0094] The semantic features of each second modal data in the second modal feature library are associated with a feature index, and each feature index is unique. There is also an association relationship between the feature index and the second modal data in the second modal database. In this way, the second modal data in the second modal database and the semantic features of the second modal data in the second modal feature library can be associated one-to-one through the feature index. In this way, based on the feature index corresponding to the target semantic feature found, the second modal data corresponding to the feature index can be selected from the second modal database to obtain the second modal data that matches the semantic information of the first modal data.

[0095] S304: Add the second modality data that matches the semantic information of the first modality data to the second set.

[0096] The second modal data determined from the second modal database that matches the semantic information of the first modal data can be added to the second set. All second modal data stored in the second modal database can be processed according to the above steps, and then all second modal data that match the semantic information of the first modal data can be determined, and added one by one to the second set, and the final second set can be used as part of the cross-modal search results.

[0097] The cross-modal search method provided in the embodiment of the present application searches from the dimension of the semantic information of the first modal data, extracts the semantic features corresponding to the first modal data and the second modal data, performs feature comparison processing on the semantic features of the first modal data and the semantic features of the second modal data in the same semantic space, searches for target semantic features that match the semantic features of the first modal data from the second modal feature library, and then determines the second modal data that matches the semantic information of the first modal data from the second modal database based on the found target semantic features, and obtains cross-modal search results. This method is essentially a method of searching based on cross-modal features. Through cross-modal features at the semantic level, search results that match the first modal data can be searched more quickly and accurately, and the diversity of cross-modal search results can be increased to a certain extent.

[0098] From the above, it can be seen that searching in the second modal data based on the semantic information of the first modal data requires the help of the second modal feature library. Next, the method of obtaining the semantic features of the second modal data stored in the second modal feature library is introduced in detail.

[0099] In one embodiment, the cross-modal search model includes a second modality processing network, and the semantic features of the N second modality data stored in the second modality database are obtained by extracting features from the N second modality data using the second modality processing network in the cross-modal search model. The second modality processing network is a processing network for the second modality data and may include multiple networks with different functions. Taking the second modality data as an image as an example, the second modality processing network may specifically be an image processing network.

[0100] Optionally, the second modality processing network includes a feature extraction network, a pooling processing network, and a feature integration network; for ease of description, any one of the N second modality data is represented as the i-th second modality data, i is a positive integer, and i is less than or equal to N, that is, all N second modality data are processed according to the following steps to obtain corresponding semantic features. Based on this, the steps of performing feature extraction processing on the N second modality data respectively through the second modality processing network in the cross-modal search model to obtain the semantic features of the N second modality data can specifically include: extracting the initial features of the i-th second modality data through the feature extraction network in the second modality processing network; pooling the initial features through the pooling processing network in the second modality processing network to obtain the pooled features of the i-th second modality data; integrating the pooled features through the feature integration network to obtain the semantic features of the i-th second modality data.

[0101] Among them, the feature extraction network can be a deep model for image processing, such as a conventional convolutional neural network (CNN) model or a VIT (Vision Transformer) model for feature extraction. The feature extraction network is the backbone network (Backbone) in the second modality processing network, which is mainly used to extract the initial features of the second modality data for use by the subsequent network. The pooling processing network can be used to pool the initial features output by the feature extraction network, specifically global average pooling (GAP). At this time, the pooling processing network can also be called a global average pooling layer. Global average pooling can not only reduce the number of parameters and prevent overfitting, but also integrate global spatial information, making the features of the second modality data more robust. Afterwards, the feature integration network can be called to integrate the pooled features output by the pooling processing network to obtain the semantic features of the i-th second modality data. The feature integration network can specifically be a feature fully connected layer. Since the fully connected layer requires the input object to be one-dimensional, the pooled feature input needs to be flattened into a one-dimensional feature before being processed by the feature integration network, and then the one-dimensional feature is processed by the feature integration network to obtain the semantic features of the second modality data.

[0102] It should be noted that the above method is the principle of processing any one of the N second modal data through a cross-modal search model. That is to say, for each of the N second modal data, the same processing steps can be used to extract the semantic features of the second modal data, and then store them in the second modal feature library.

[0103] In one possible embodiment, the second modality processing network also includes a classification network, and can also: perform classification prediction processing based on the pooled features through the classification network to obtain the category label of the i-th second modality data; and add the category label of the i-th second modality data to the second modality database. The classification network can be a classification fully connected layer. Similar to the feature fully connected layer, the pooled features processed by the classification fully connected layer are also one-dimensional features after flattening. The output of the classification fully connected layer is passed through an activation function (such as a Sigmoid function) to obtain the score of the i-th second modality data belonging to each category, thereby obtaining the corresponding category label. The category labels of the N second modality data in the second modality database can all be obtained by multi-classification processing using the above-mentioned classification network, and the category labels of each second modality data can all be added to the second modality database, so that when processing the first modality data, the second modality data that matches the first modality data can be searched based on the similarity between the category labels of each second modality data and the content information of the first modality data.

[0104] Based on the above description of the second modality processing network, the specific structure of the second modality processing network can be known. Assuming that the second modality data is an image, the second modality processing network is specifically an image encoder, including a feature extraction network, a pooling network, a feature integration network, and a classification network, specifically a backbone network, a global average pooling layer, a feature fully connected layer, and a classification fully connected layer. The second modality database is specifically an image library, and the second modality feature library is specifically an image feature vector retrieval set. The processing flow of the second modality processing network for processing the second modality data is described below in combination with the structure of the image encoder in the cross-modal search model shown in Figure 4b.

[0105] The image encoder in the cross-modal search model shown in Figure 4b specifically includes a backbone network, a global average pooling layer, a classification fully connected layer, and a feature fully connected layer. Assume that the image sent or received by the conversation object in the conversation is XI, and the image XI is input to the image encoder, which can output the multi-label classification result C of the image. I ={c1,c2,…,c n} and the image feature vector f I (or called image feature vector), the specific processing process is as follows: first, the image is used as the input of the image encoder, and the image feature map (i.e., initial features) is obtained through the backbone network of the image encoder (such as CNN or VIT). Then, the image feature map is processed by global average pooling and flattened into a one-dimensional vector. After that, the flattened one-dimensional vector is input to the classification fully connected layer (Cls FC) to output a one-dimensional vector of length C, and the Sigmoid function is used to obtain the scores of each category, thereby obtaining the corresponding category label C I ={c1,c2,…,c n}, at the same time, the one-dimensional vector will also be input into the feature fully connected layer (Feature FC) to output a vector of length d (assuming it is 512), and then after L2 normalization (L2 Normalization) as the feature vector f of the image I The feature vector f of the image I The image feature vector will be stored in the retrieval set (corresponding to the second modality feature library), and the category label of the multi-label classification corresponding to the image can be stored in the second modality database. Finally, according to the image feature vector f I , you can add the corresponding image feature vector index and add it to the image feature vector retrieval set G I In order to assist in quickly searching for the target image from the image library.

[0106] In combination with the first modality processing network in the cross-modal search model shown in FIG4a and the second modality processing network in the cross-modal search model shown in FIG4b, the cross-modal search model is used for search, and the specific processing process of the first modality data is as follows. For ease of description, the first modality data is text, and the first modality processing network corresponds to a text encoder as an example. The output text feature vector and image feature vector are feature vectors mapped to the same semantic feature space and with the same dimension. The processing of the text specifically includes: first, searching the image library based on the content information of the text. Specifically, images with labels that completely match the text query can be queried from the image library, and the matched images are recalled as the image set A; at the same time, the text is input into the text encoder, and the text encoder outputs a vector of length d and obtains the text feature vector f after L2 normalization. T ; Then, use the text feature vector f T Retrieve the set G from the image feature vector I (The image feature vectors included therein are obtained by processing the image by the image encoder shown in FIG4b ) and the corresponding image set B is recalled. The specific retrieval method is to use the text feature vector f T and the image feature vector f in the retrieval set I Calculate feature similarity, that is, S = f T ·f I , images with feature similarity S higher than the threshold θ are retrieved as image set B, and finally image set A and image set B are merged to obtain cross-modal search results.

[0107] In one embodiment, in combination with the above description of the structure and function of the cross-modal search model, the cross-modal search model includes a first modal processing network and a second modal processing network, and the specific training process can be as follows: 1) Obtain a cross-modal training data set, the cross-modal training data set includes multiple groups of cross-modal sample data, each group of cross-modal sample data includes second modal sample data, first modal sample data, and the matching results between the second modal sample data and the first modal sample data; 2) Through the first modal processing network in the cross-modal search model, feature extraction processing is performed on the first modal sample data in the cross-modal sample data to obtain the semantic features of the first modal sample data; and, through the second modal processing network in the cross-modal search model, feature extraction processing is performed on the second modal sample data in the cross-modal sample data to obtain the semantic features of the second modal sample data; 3) According to the cross-modal contrast loss between the semantic features of the first modal sample data and the semantic features of the second modal sample data, the cross-modal search model is iteratively trained to obtain a trained cross-modal search model.

[0108] During the training data preparation phase, a cross-modal training dataset can be obtained from the business data generated by the corresponding scenario. The cross-modal training dataset is a collection of sample data from two different modalities. For the training of the cross-modal search model, each set of cross-modal sample data can be input into the cross-modal search model for processing. For example, if the first modality sample data and the second modality sample data are text and images, respectively, then each set of cross-modal sample data can be an image-text pair, that is, the image and the text description corresponding to the image can constitute an image-text pair. A large number of image-text pairs can constitute a cross-modal training dataset.

[0109] The training process of the cross-modal search model specifically involves mixed training of the first modal processing network and the second modal processing network. K groups of cross-modal sample data can be input simultaneously. Then, the first modal sample data in the i-th group of cross-modal sample data is processed by the first modal processing network to obtain the semantic features of the first modal sample data. Furthermore, the second modal sample data in the i-th group of cross-modal sample data is processed by the second modal processing network to obtain the semantic features of the second modal sample data. Then, a cross-modal contrast loss is calculated based on the semantic features of the two different modal sample data. The cross-modal search model is iteratively trained based on the cross-modal contrast loss, and the model parameters are continuously updated until convergence, thereby obtaining a trained model.

[0110] When the second modality processing network includes a classification processing network, the cross-modal training data set may also include category labels corresponding to the second modality sample data. Specifically, the training process may also include the following: performing classification prediction processing on the second modality sample data in the cross-modal sample data through the second modality processing network in the cross-modal search model to obtain category prediction information of the second modality sample data; determining the classification loss of the second modality sample data based on the category prediction information and the category label; iteratively training the cross-modal search model based on the classification loss and the cross-modal contrast loss to obtain a trained cross-modal search model. Wherein, the category prediction information may include the predicted probability that the second modality sample data belongs to each category, the classification loss may use the cross-entropy loss, and subsequently the classification loss and the cross-modal contrast loss may be combined as the total loss, for example, the classification loss and the cross-modal contrast loss are weightedly summed to obtain the total loss, and then using an optimizer (such as a stochastic gradient descent (SGD) optimizer) to update the model parameters of the cross-modal search model, and continuously repeating the above training process until the model parameters converge to obtain a trained cross-modal search model. In this way, the cross-modal search model can not only be applied to the semantic feature extraction and processing of the first modal data and the second modal data, but also detect the matching degree between the first modal data and the second modal data based on the cross-modal features; the cross-modal search model also has a multi-label classification function, which generates category labels for the second modal data and stores them in the second modal database.

[0111] In order to better understand the principle of the training phase, the following example illustrates the training process of the cross-modal search model, taking the first modal processing network as a text encoder and the second modal processing network as an image encoder as an example. Please refer to Figure 5, which is a schematic diagram of a cross-modal search model training provided by an embodiment of the present application. Assume that the cross-modal training data set includes K groups of image-text pairs (or simply image-text pairs). During training, K groups of image-text pairs are input at the same time, and the image feature vectors are obtained by the image encoder and the text encoder respectively. and text feature vector The image encoder also outputs the predicted probability PI corresponding to the predicted probability of the C categories of the image. InfoNCE loss can then be used to calculate the cross-modal contrast loss between image-text pairs. The specific expression is as follows:

[0112]

[0113] in, represents the i-th image feature vector, Represents the i-th text feature vector. The main idea of ​​cross-modal contrast loss is to maximize the loss of similarity and minimize the loss of difference. Specifically, the image-text pairs can be divided into positive sample pairs and negative sample pairs. The positive sample pairs refer to the image-text pairs where the image and text description match, and the negative sample pairs refer to the image-text pairs where the image and text description do not match. In cross-modal contrast loss, by Represents the similarity between positive sample pairs, Represents the similarity between negative sample pairs, so that the smaller the cross-modal contrast loss, the more matched the first modality sample data and the second modality sample data.

[0114] For the image classification loss L cls It can be calculated using Cross Entropy Loss (CEL), combined with L cls and L infoNCE As the total loss, the SGD optimizer is used to update the model parameters until convergence.

[0115] Based on the introduction of the above embodiment, taking the first modal data as text and the second modal data as an image as an example, the algorithm flow adopted in the cross-modal search scheme is explained. For details, please refer to the algorithm flow chart shown in Figure 6. The image is input into the image encoder for multi-label classification to obtain a category label. When the search text (recorded as query) is completely equivalent to the category label, the relevant image can be matched. In addition, the image encoder can also output an image feature vector, and add the image feature vector and the newly added index to the image feature vector retrieval set. For the search text query, it can be input into the text encoder, output a text feature vector, and then retrieve similar image feature vectors from the image feature vector retrieval set based on the text feature vector, and recall the corresponding image set based on the similar image feature vector. This solution based on cross-modal feature search can support more diverse and complex text descriptions because it does not rely on the fixed category label system of the classification model, but matches through the features of different modal data, thereby increasing the freedom of search term input and finding the target image faster, more accurately and more comprehensively.

[0116] Please refer to Figure 7, which is a third flow diagram of a cross-modal search method provided in an embodiment of the present application. The cross-modal search method can be executed by a computer device (e.g., cross-modal search device 102 shown in Figure 1, which can specifically be a terminal). The cross-modal search method includes, but is not limited to, the following steps.

[0117] S701: Displaying a conversation interface of a social conversation.

[0118] The social conversation here can be a conversation between individuals or a group conversation. In the conversation interface of the social conversation, the conversation objects can send or receive conversation messages, such as images, text, voice, etc. When the conversation message received in the conversation interface includes second modality data, the second modality processing network in the cross-modal search model can be called to process the second modality data, output the category label of the multi-label classification and the semantic features of the second modality data, and then store the category label in the second modality database, and store the semantic features of the second modality data (such as image feature vectors) in the second modality feature library.

[0119] The social conversation interface provides a function for viewing historical conversation records. Specifically, the conversation interface can be used to access the conversation details interface. The conversation details interface includes a viewing entry for historical conversation records. The conversation partner can use this entry to view specific historical conversation records and perform searches. For details, see steps S702 to S703 below.

[0120] S702 : In response to viewing the historical session record of the social session, display a session record details interface.

[0121] The session record details interface includes the second modality data from the social conversation's historical session records. Historical social conversation records can include data in different modalities, such as images, videos, text, and audio. The conversation participants can select different modalities to view data. Viewing historical session records here primarily involves viewing the second modality data. Therefore, the session record details interface displays the second modality data generated in the historical session records.

[0122] It should be noted that if the amount of second modal data is small, the second modal data can be displayed in full in the session record details interface. If the amount of second modal data is large, only part of the second modal data is displayed in the current session record details interface. For example, the second modal data is an image, and the session record details interface is specifically a chat photo wall, in which 12 images of equal size can be displayed. If there are 10 images in the historical session record, they can be displayed in full in the session record details interface. If there are more than 12 images, a maximum of 12 images can be displayed. When viewing other images, it is necessary to perform an operation such as swiping down to display them. Subsequently, the session record details interface can support searching for the second modal data with the first modal data, and outputting the second modal data that matches the first modal data, that is, cross-modal search results.

[0123] Please refer to Figure 8a, which is a schematic diagram of an operation for viewing historical conversation records provided by an embodiment of the present application. As shown in Figure 8a (1), the conversation interface 810 provides an entry for searching historical conversation records, namely "Search for chat content". When this entry is triggered, you can enter the historical conversation record search interface 811 shown in Figure 8a (2). In this historical conversation record search interface, you can select the corresponding search type and display all historical conversation records of the search type. For example, when pictures and videos are selected, the chat photo wall is displayed in the conversation record details interface 812, and the chat photo wall is all pictures and videos displayed by date, specifically as shown in Figure 8a (3), and the conversation record details interface 812 provides a search box 8120 to facilitate searching for pictures or videos.

[0124] In one embodiment, the second modal data in the historical conversation records of a social conversation is stored in a second modal database, and the second modal database stores attribute information of the second modal data. By dividing the second modal data in the historical conversation records and storing it in the second modal database, when initiating a search for the second modal data, the search can be directly conducted in the second modal database rather than in the global historical conversation records, which helps improve the efficiency of searching for the second modal data. At the same time, the second modal database stores the attribute information of the second modal data, and the difference in attribute information can further expand the search dimension.

[0125] The attribute information includes at least one of the following: a category label, first modal description information associated with the second modal data, and first modal description information identified from the second modal data. The category label can be annotation information generated by humans or machines (such as classification models) to classify the second modal data, and the first modal description information is description information about the second modal data, which can be specifically identified from the second modal data, or generated and associated with the second modal data in historical conversation records. For example, the second modal data is an image. When the image in the historical conversation record is an image containing text, the text in the image can be obtained by identifying the image and used as the first modal description information; if the conversation object in the social conversation sends an image and then sends text description information of the image, for example: Look, Park A has changed a lot, then a description of the image can be generated based on the text description information, for example, the keyword "Park A" can be extracted as the first modal description information of the image.

[0126] S703 : In response to the first modal data input in the conversation record details interface, output cross-modal search results corresponding to the first modal data.

[0127] The cross-modal search results are obtained using the cross-modal search method described in the previous embodiment. The output cross-modal search results include all second modal data that matches the first modal data input in the conversation record details interface.

[0128] In one embodiment, the first modal data is text, the second modal data is an image, the session record details interface includes a search box, and the first modal data is obtained by entering in the search box; or, the session record details interface also includes at least one recommended text, and the first modal data is obtained by selecting from at least one recommended text. That is, the first modal data entered in the session record details interface can be manually entered into the search box through an input device (such as a physical / virtual keyboard, an intelligent voice device), or can be selected from the recommended text provided in the session record details interface. Optionally, the selected recommended text can be automatically filled in the search box and the search function can be automatically started. Among them, the recommended text in the session record details interface can be randomly generated, or it can be generated based on the attribute information of the second modal data or the semantic features of the second modal data. With the technical support of the above-mentioned cross-modal search method, the text entered in the search box can be an image description that conforms to intuitive expression. Simply put, taking text-to-image search as an example, when the conversation object searches in the search box, images with category labels matching the text can be queried and searched in the second modality database and recalled. At the same time, the search text can be processed by the text encoder in the cross-modal search model, and the corresponding text feature vector can be output. Similar image feature vectors are retrieved from the image feature vector retrieval set, and the corresponding image set is recalled. Finally, all recalled images are merged and displayed to the conversation object.

[0129] For example, please refer to FIG8b, which is an operational diagram of the cross-modal search provided by an embodiment of the present application. As shown in (1) in FIG8b, the session record details interface provides a search box 8220, and the search prompt in the search box 8220 supports inputting image descriptions or text in the image. The image description is a semantic interpretation of the content contained in the image, and the text in the image belongs to the content information of the image. In addition, automatically generated recommended texts are also displayed in the session record details interface, such as "tickets", "screenshots", etc. in FIG8b. The recommended texts can provide more references and convenient operations. When the query text is entered in the search box 8220 and the search function is triggered, the search result interface can be output, and the pictures matching the query text are displayed in the search result interface. As shown in (2) in FIG8b, the three pictures matching the input query text "food" are displayed in the search result interface 823, which are cross-modal search results.

[0130] In one embodiment, it is also possible to: in response to the selection of the first search rule, output the second modal data in the cross-modal search results that matches the content information of the first modal data; or, in response to the selection of the second search rule, output the second modal data in the cross-modal search results that matches the semantic information of the first modal data.

[0131] The first search rule and the second search rule are rules for searching from different dimensions. Searches can be made according to different dimensions, and all cross-modal search results can be divided and displayed according to different search dimensions. Searching according to the first search rule can obtain and output second modal data that matches the content information of the first modal data. Searching according to the second search rule can obtain and output second modal data that matches the semantic information of the first modal data. In other words, a single search dimension can be specified. For example, when the first modal data is text and the second modal data is an image, you can search by image and by text. Searching by image specifically refers to searching by image description, that is, searching by matching the semantic information of the image. Searching by text specifically refers to searching by text in the image, that is, searching by matching the content information of the image.

[0132] For example, please refer to Figure 8c, which is a schematic diagram of the effect of outputting cross-modal search results provided by an embodiment of the present application. As shown in Figure 8c, all pictures matching the query text are displayed based on the cross-modal search results provided in (2) in Figure 8b, which are obtained after searching according to different search dimensions. When you choose to search by image or by text, different cross-modal search results will be presented, as shown in (1) in Figure 8c and (2) in Figure 8c, respectively. In this search result interface, pictures can be displayed in which the semantic information of the text matches the semantic information of the image, or the content information of the text matches the attribute information of the image (such as the category label of the image). This solution can be applied to a variety of scenarios. In addition to the cross-modal search based on the historical conversation records of social conversations introduced in this embodiment, it can also be applied to other scenarios that support multimedia data search, such as short video search scenarios, without limitation.

[0133] The cross-modal search solution provided in the embodiment of the present application can support cross-modal search scenarios in historical conversation records of social conversations, and can be specifically applied to the scenario of cross-modal search of pictures and texts, that is, by entering search terms in the search box to search for target pictures. Since cross-modal search searches from multiple dimensions of search terms, the search terms do not have to completely match the category labels of the pictures to find the corresponding pictures. Therefore, by entering more intuitive, diverse and complex image descriptions to find target pictures, not only can the freedom of input be improved, but also the probability of searching for the target pictures can be greatly improved, thereby improving the diversity of cross-modal search results. In addition, by providing recommended text (such as recommended search terms), the search efficiency can also be improved to a certain extent.

[0134] Please refer to Figure 9, which is a schematic diagram of the structure of a cross-modal search device provided in an embodiment of the present application. The above-mentioned cross-modal search device can be a computer program (including program code) running on a computer device, for example, the cross-modal search device is an application software; the cross-modal search device can be used to execute the corresponding steps of the method provided in the embodiment of the present application. As shown in Figure 9, the cross-modal search device 900 may include: an acquisition module 901, a search module 902, and a merging module 903.

[0135] An acquisition module 901 is configured to acquire first modal data;

[0136] A search module 902 is configured to search the second modality database based on the content information of the first modality data to obtain a first set, where the first set includes at least one second modality data that matches the content information of the first modality data;

[0137] The search module 902 is further configured to search the second modality database based on the semantic information of the first modality data to obtain a second set, where the second set includes at least one second modality data that matches the semantic information of the first modality data;

[0138] The merging module 903 is configured to merge the first set and the second set to obtain cross-modal search results corresponding to the first modal data.

[0139] In one embodiment, the second modal database stores N second modal data and attribute information of each of the N second modal data, where N is a positive integer; the search module 902 is specifically used to: for each second modal data among the N second modal data, determine the matching degree between the content information of the first modal data and the attribute information of the second modal data, as the matching degree corresponding to the second modal data; and add the second modal data whose corresponding matching degree meets the matching conditions to the first set.

[0140] In one embodiment, the attribute information includes first modal description information; any one of the N second modal data is represented as the i-th second modal data, i is a positive integer, and i is less than or equal to N; the search module 902 is specifically used to: determine the semantic similarity between the content information of the first modal data and the first modal description information of the i-th second modal data, as the matching degree corresponding to the i-th second modal data; if the semantic similarity between the content information of the first modal data and the first modal description information of the i-th second modal data is greater than the first similarity threshold, the i-th second modal data is added to the first set.

[0141] In one embodiment, the attribute information includes a category label; any one of the N second modal data is represented as the i-th second modal data, i is a positive integer, and i is less than or equal to N; the search module 902 is specifically used to: determine the similarity between the content information of the first modal data and the category label of the i-th second modal data, as the matching degree corresponding to the i-th second modal data; if the similarity between the content information of the first modal data and the category label of the i-th second modal data is greater than the second similarity threshold, then add the i-th second modal data to the first set.

[0142] In one embodiment, the second modal database stores N second modal data; the second modal database is associated with a second modal feature library, and the second modal feature library stores the semantic features of N second modal data; the search module 902 is specifically used to: obtain the semantic features of the first modal data; based on the semantic features of the first modal data, search for target semantic features that match the semantic features of the first modal data in the second modal feature library; according to the target semantic features, determine the second modal data that matches the semantic information of the first modal data in the second modal database; and add the second modal data that matches the semantic information of the first modal data to the second set.

[0143] In one embodiment, the second modal feature library and the second modal database are associated through a feature index; the search module 902 is specifically used to: determine the feature index of the target semantic feature; based on the feature index of the target semantic feature, determine the second modal data corresponding to the feature index of the target semantic feature in the second modal database.

[0144] In one embodiment, the semantic features of each of the N second modal data stored in the second modal feature library are obtained by performing feature extraction processing on the N second modal data respectively through the second modal processing network in the cross-modal search model; the cross-modal search model also includes a first modal processing network; the search module 902 is specifically used to: perform feature extraction processing on the first modal data through the first modal processing network in the cross-modal search model to obtain the semantic features of the first modal data.

[0145] In one embodiment, the second modality processing network includes a feature extraction network, a pooling processing network and a feature integration network; any one of the N second modality data is represented as the i-th second modality data, i is a positive integer, and i is less than or equal to N; the search module 902 is specifically used to: extract the initial features of the i-th second modality data through the feature extraction network in the second modality processing network; pool the initial features through the pooling processing network in the second modality processing network to obtain the pooled features of the i-th second modality data; integrate the pooled features through the feature integration network to obtain the semantic features of the i-th second modality data.

[0146] In one embodiment, the second modality processing network also includes a classification network; the search module 902 is specifically used to: perform classification prediction processing based on pooling features through the classification network to obtain the category label of the i-th second modality data; and add the category label of the i-th second modality data to the second modality database.

[0147] In one embodiment, the cross-modal search device also includes a training module 904, which is used to: obtain a cross-modal training data set, the cross-modal training data set includes multiple groups of cross-modal sample data, each group of cross-modal sample data includes second modality sample data, first modality sample data, and matching results between the second modality sample data and the first modality sample data; perform feature extraction processing on the first modality sample data in the cross-modal sample data through the first modality processing network in the cross-modal search model to obtain semantic features of the first modality sample data; and perform feature extraction processing on the second modality sample data in the cross-modal sample data through the second modality processing network in the cross-modal search model to obtain semantic features of the second modality sample data; and iteratively train the cross-modal search model based on the cross-modal contrast loss between the semantic features of the first modality sample data and the semantic features of the second modality sample data to obtain a trained cross-modal search model.

[0148] It is understood that the functions of the various functional modules of the cross-modal search device described in the embodiments of the present application can be specifically implemented according to the methods in the above-mentioned method embodiments. The specific implementation process can refer to the relevant description of the above-mentioned method embodiments and will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated.

[0149] Please refer to Figure 10, which is a schematic diagram of the structure of another cross-modal search device provided in an embodiment of the present application. The above-mentioned cross-modal search device can be a computer program (including program code) running on a computer device, for example, the cross-modal search device is an application software; the cross-modal search device can be used to execute the corresponding steps of the method provided in the embodiment of the present application. As shown in Figure 10, the cross-modal search device 1000 may include: a display module 1001 and an output module 1002.

[0150] Display module 1001, used to display the conversation interface of the social conversation;

[0151] The display module 1001 is further configured to display a session record details interface in response to viewing the historical session record of the social session, where the session record details interface includes the second modal data in the historical session record of the social session;

[0152] Output module 1002 is used to output cross-modal search results corresponding to the first modal data in response to the first modal data input in the conversation record details interface; the cross-modal search results are obtained using the cross-modal search method described in the embodiment of the present application.

[0153] In one embodiment, the second modal data in the historical session records of the social session is stored in a second modal database, and the second modal database stores attribute information of the second modal data, and the attribute information includes at least one of the following: a category label, first modal description information associated with the second modal data, and first modal description information identified from the second modal data.

[0154] In one embodiment, the first modal data is text and the second modal data is an image; the session record details interface includes a search box, and the first modal data is obtained by entering in the search box; or, the session record details interface also includes at least one recommended text, and the first modal data is obtained by selecting from at least one recommended text.

[0155] In one embodiment, the output module 1002 is specifically used to: in response to the selection of the first search rule, output the second modal data in the cross-modal search results that matches the content information of the first modal data; or, in response to the selection of the second search rule, output the second modal data in the cross-modal search results that matches the semantic information of the first modal data.

[0156] It is understood that the functions of the various functional modules of the cross-modal search device described in the embodiments of the present application can be specifically implemented according to the methods in the above-mentioned method embodiments. The specific implementation process can refer to the relevant description of the above-mentioned method embodiments and will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated.

[0157] It should be noted that the cross-modal search device of FIG9 and the cross-modal search device of FIG10 can be deployed in the same computer device or in different computer devices. When deployed in the same computer device, the computer device can automatically search for the second modal data that matches the first modal data from the database based on the input first modal data, obtain the cross-modal search results, and then output the cross-modal search results in the computer device; when deployed in different computer devices, assuming that the cross-modal search device of FIG9 is deployed in computer device A and the cross-modal search device of FIG10 is deployed in computer device B, computer device B is responsible for receiving the input first modal data and sending the first modal data to computer device A, and then computer device A searches the second modal database for the second modal data that matches the first modal data based on the first modal data, obtains the cross-modal search results, and sends the cross-modal search results to computer device B, which displays the cross-modal search results.

[0158] Please refer to Figure 11, which is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The computer device 1100 may include an independent device (such as one or more of a server, a node, a terminal, etc.), or may include components inside an independent device (such as a chip, a software module, or a hardware module, etc.). The computer device 1100 may include at least one processor 1101 and a communication interface 1102. Further optionally, the computer device 1100 may also include at least one memory 1103 and a bus 1104. The processor 1101, the communication interface 1102, and the memory 1103 are connected via a bus 1104.

[0159] Among them, the processor 1101 is a module that performs arithmetic operations and / or logical operations, and can specifically be a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor unit (MPU), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a complex programmable logic device (CPLD), a coprocessor (assisting the central processing unit to complete corresponding processing and applications), a microcontroller unit (MCU), and other processing modules, or a combination of multiple thereof.

[0160] The communication interface 1102 can be used to provide information input or output for at least one processor. And / or, the communication interface 1102 can be used to receive data sent externally and / or send data externally. It can be a wired link interface including an Ethernet cable, etc., or a wireless link interface (Wi-Fi, Bluetooth, general wireless transmission, vehicle-mounted short-range communication technology, other short-range wireless communication technologies, etc.).

[0161] Memory 1103 is used to provide storage space for storing data such as the operating system and computer programs. Memory 1103 can be one or a combination of random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).

[0162] At least one processor 1101 in the computer device 1100 is used to call a computer program stored in at least one memory 1103 to execute the aforementioned cross-modal search method, such as the cross-modal search method described in the embodiments shown in Figures 2, 3 and 7.

[0163] It should be understood that the computer device 1100 described in the embodiments of the present application can execute the description of the cross-modal search method in the corresponding embodiments above, and can also execute the description of the cross-modal search device 900 in the embodiment corresponding to FIG. 9 or the cross-modal search device 1000 in the embodiment corresponding to FIG. 10 , and will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated here.

[0164] In addition, it should be noted that an exemplary embodiment of the present application further provides a storage medium that stores a computer program for the aforementioned cross-modal search method. The computer program includes program instructions. When one or more processors load and execute the program instructions, the description of the cross-modal search method in the embodiment can be implemented. This description will not be repeated here. The description of the beneficial effects of using the same method will also not be repeated here. It is understandable that the program instructions can be deployed on one or multiple computer devices that can communicate with each other for execution.

[0165] The above-mentioned computer-readable storage medium can be the cross-modal search device provided by any of the aforementioned embodiments or the internal storage unit of the above-mentioned computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Furthermore, the computer-readable storage medium can also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.

[0166] In one aspect of the present application, a computer program product or computer program is provided. The computer program product or computer program includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in one aspect of the embodiments of the present application.

[0167] In one aspect of the present application, another computer program product is provided, which includes a computer program or computer instructions, and when the computer program or computer instructions are executed by a processor, the steps of the cross-modal search method provided in the embodiment of the present application are implemented.

[0168] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A cross-modal search method, performed by a computer device, comprising: Acquire first modal data; Searching in a second modality database based on the content information of the first modality data to obtain a first set, wherein the first set includes at least one second modality data matching the content information of the first modality data; Searching the second modality database based on the semantic information of the first modality data to obtain a second set, wherein the second set includes at least one second modality data matching the semantic information of the first modality data; The first set and the second set are merged to obtain cross-modal search results corresponding to the first modal data.

2. The method according to claim 1, wherein the second modality database stores N second modality data and attribute information of each of the N second modality data, where N is a positive integer; The step of searching the content information based on the first modal data in the second modal database to obtain a first set includes: For each second modal data among the N second modal data, determining a matching degree between content information of the first modal data and attribute information of the second modal data as a matching degree corresponding to the second modal data; The corresponding second modality data whose matching degree satisfies the matching condition is added to the first set.

3. The method according to claim 2, wherein the attribute information includes first modal description information; any one of the N second modal data is represented as the i-th second modal data, i is a positive integer, and i is less than or equal to N; The determining, for each of the N second modal data, a degree of matching between the content information of the first modal data and the attribute information of the second modal data as the degree of matching corresponding to the second modal data includes: Determining a semantic similarity between the content information of the first modal data and the first modal description information of the i-th second modal data as a matching degree corresponding to the i-th second modal data; The adding the corresponding second modal data whose matching degree satisfies the matching condition to the first set includes: If the semantic similarity between the content information of the first modal data and the first modal description information of the i-th second modal data is greater than a first similarity threshold, the i-th second modal data is added to the first set.

4. The method according to claim 2, wherein the attribute information comprises a category label; any one of the N second modal data is represented as the i-th second modal data, i is a positive integer, and i is less than or equal to N; The determining, for each of the N second modal data, a degree of matching between the content information of the first modal data and the attribute information of the second modal data as the degree of matching corresponding to the second modal data includes: Determine the similarity between the content information of the first modal data and the category label of the i-th second modal data as the matching degree corresponding to the i-th second modal data; The adding the corresponding second modal data whose matching degree satisfies the matching condition to the first set includes: If the similarity between the content information of the first modal data and the category label of the i-th second modal data is greater than a second similarity threshold, the i-th second modal data is added to the first set.

5. The method according to claim 1, wherein the second modality database stores N second modality data; the second modality database is associated with a second modality feature library, and the second modality feature library stores semantic features of each of the N second modality data; The searching the second modality database based on the semantic information of the first modality data to obtain a second set includes: Acquire semantic features of the first modal data; Based on the semantic features of the first modal data, searching the second modal feature library for a target semantic feature that matches the semantic features of the first modal data; Determining, in the second modality database, second modality data that matches the semantic information of the first modality data according to the target semantic feature; The second modality data matching the semantic information of the first modality data is added to the second set.

6. The method according to claim 5, wherein the second modal feature library and the second modal database are associated through a feature index; The determining, in the second modality database, second modality data matching semantic information of the first modality data according to the target semantic feature includes: Determining a feature index of the target semantic feature; Based on the feature index of the target semantic feature, second modality data corresponding to the feature index of the target semantic feature is determined in the second modality database.

7. The method of claim 5, wherein the semantic features of each of the N second modal data stored in the second modal feature library are obtained by performing feature extraction processing on each of the N second modal data using the second modal processing network in the cross-modal search model; The cross-modal search model also includes a first modality processing network; The acquiring the semantic feature of the first modal data includes: The first modality processing network in the cross-modal search model is used to perform feature extraction processing on the first modality data to obtain semantic features of the first modality data.

8. The method according to claim 7, wherein the second modality processing network comprises a feature extraction network, a pooling processing network and a feature integration network; any one of the N second modality data is represented as the i-th second modality data, i is a positive integer, and i is less than or equal to N; The second modality processing network in the cross-modal search model performs feature extraction processing on the N second modality data respectively to obtain semantic features of the N second modality data, including: Extracting initial features of the i-th second modality data through the feature extraction network in the second modality processing network; Performing pooling processing on the initial features through the pooling processing network in the second modality processing network to obtain the pooling features of the i-th second modality data; The pooled features are integrated through the feature integration network to obtain the semantic features of the i-th second modality data.

9. The method of claim 8, wherein the second modality processing network further comprises a classification network; the method further comprises: By using the classification network, classification prediction processing is performed based on the pooled features to obtain a category label of the i-th second modality data; as well as, Add the category label of the i-th second modality data to the second modality database.

10. The method of claim 7, further comprising: Acquire a cross-modal training data set, wherein the cross-modal training data set includes multiple groups of cross-modal sample data, each group of the cross-modal sample data includes second modality sample data, first modality sample data, and matching results between the second modality sample data and the first modality sample data; Performing feature extraction processing on first modality sample data in the cross-modal sample data through the first modality processing network in the cross-modal search model to obtain semantic features of the first modality sample data; and performing feature extraction processing on second modality sample data in the cross-modal sample data through the second modality processing network in the cross-modal search model to obtain semantic features of the second modality sample data; The cross-modal search model is iteratively trained according to the cross-modal contrast loss between the semantic features of the first modal sample data and the semantic features of the second modal sample data to obtain a trained cross-modal search model.

11. A cross-modal search method, performed by a computer device, comprising: Displaying a conversation interface for social conversations; In response to viewing the historical session record of the social session, displaying a session record details interface, wherein the session record details interface includes the second modal data in the historical session record of the social session; In response to first modal data input in the conversation record details interface, a cross-modal search result corresponding to the first modal data is output; the cross-modal search result is obtained using the cross-modal search method described in any one of claims 1-10.

12. According to the method as claimed in claim 11, the second modal data in the historical session record of the social session is stored in a second modal database, and the second modal database stores attribute information of the second modal data, and the attribute information includes at least one of the following: a category label, first modal description information associated with the second modal data, and first modal description information identified from the second modal data.

13. The method according to claim 11, wherein the first modal data is text, and the second modal data is an image; the conversation record details interface includes a search box, and the first modal data is obtained by inputting in the search box; or, The conversation record details interface also includes at least one recommended text, and the first modal data is obtained by selecting from the at least one recommended text.

14. The method of claim 11, further comprising: In response to selection of the first search rule, outputting second modality data in the cross-modality search results that matches content information of the first modality data; or, In response to selection of a second search rule, second modality data in the cross-modality search results that matches the semantic information of the first modality data is output.

15. A cross-modal search device, comprising: An acquisition module, used for acquiring first modal data; A search module, configured to search in a second modality database based on the content information of the first modality data to obtain a first set, wherein the first set includes at least one second modality data matching the content information of the first modality data; The search module is further configured to search in the second modality database based on the semantic information of the first modality data to obtain a second set, wherein the second set includes at least one second modality data matching the semantic information of the first modality data; A merging module is used to merge the first set and the second set to obtain cross-modal search results corresponding to the first modal data.

16. A cross-modal search device, comprising: A display module, used to display a conversation interface of a social conversation; The display module is further configured to display a session record details interface in response to viewing the historical session record of the social session, wherein the session record details interface includes the second modal data in the historical session record of the social session; An output module, used to respond to the first modal data input in the session record details interface and output the cross-modal search results corresponding to the first modal data; the cross-modal search results are obtained by using the cross-modal search method described in any one of claims 1-10.

17. A computer device comprising: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a network communication function, the memory is used to store program code, and the processor is used to call the program code to execute the cross-modal search method described in any one of claims 1 to 14.

18. A computer-readable storage medium storing a computer program, wherein the computer program comprises program instructions, and when the program instructions are executed by a processor, the cross-modal search method according to any one of claims 1 to 14 is executed.

19. A computer program product, comprising a computer program or computer instructions, wherein the computer program or computer instructions, when executed by a processor, implements the steps of the cross-modal search method according to any one of claims 1 to 14.