Search method, device, electronic device and storage medium
Through the fusion of slice-level vector representation of file names and titles and user preference vectors, the problem of file search in the existing technology being unable to meet personalized needs is solved, achieving more accurate file recall and improving user experience.
Patent Information
- Application Number
- CN202311224005.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-20
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-09-20
AI Technical Summary
The existing technology cannot effectively meet the personalized needs of different users in file search, resulting in poor user search experience, especially the inability to accurately reflect user interests and file semantics.
By vectorizing the file name and file title at the slice level, and combining the user preference vector with the feature vector in the search statement to generate a session vector, the target file can be accurately recalled among candidate files to meet personalized search needs.
On the basis of accurately characterizing the semantics of files, it takes into account user preferences and search keywords, thereby improving search accuracy and user experience, and meeting the personalized search needs of different users.
Smart Images

Figure CN117331893B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a search method, device, electronic device and storage medium. Background Art
[0002] At present, some servers (such as cloud disks) allow users to upload their own files for storage, backup and synchronization sharing, so that they can access and manage these files anytime and anywhere. For users, searching for files is a rigid operation in daily work, which can help users find the required files quickly and accurately, improve work efficiency and enhance user perception experience.
[0003] In the related art, the files required by the user are recalled from various files based on the similarity between the search statement input by the user and the files stored in the server. However, the method of recalling files based only on the similarity between the search statement and the files may not meet the personalized search needs of different users, thereby reducing the user's search experience. Summary of the invention
[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the first purpose of the present disclosure is to propose a search method, which vectorizes the candidate files at a slice level based on the file type of the candidate files and takes into account the file name and file title, and combines the session vector obtained by fusing the preference vector of the target object and the feature vector of the search keyword in the search statement, to determine at least one target file from multiple candidate files. This method achieves accurate characterization of the semantics of the candidate files while taking into account the user's preferences and search keywords, accurately recalling the files required by the user from each candidate file, meeting the personalized search needs of different users and improving the user's search experience.
[0006] The second objective of the present disclosure is to provide a search device.
[0007] A third objective of the present disclosure is to provide an electronic device.
[0008] A fourth object of the present disclosure is to provide a non-transitory computer-readable storage medium storing computer instructions.
[0009] A fifth object of the present disclosure is to provide a computer program product.
[0010] To achieve the above-mentioned purpose, the first aspect of the present disclosure proposes a search method, including: in response to receiving a file search request sent by a client, for any candidate file among multiple candidate files associated with the client, obtaining the file name and file title of any candidate file, and processing the text information of any candidate file according to the file type of the candidate file to obtain a text slice set; generating a first slice vector set according to the text slice set, the file name and the file title; obtaining a preference vector of a target object logging in to the client and a feature vector of a search keyword in a search statement in the search request, and fusing the preference vector with the feature vector to obtain a session vector; determining at least one target file from each of the candidate files according to a first similarity between the session vector and each slice vector in the first slice vector set of each of the candidate files, and sending each of the target files to the client.
[0011] To achieve the above-mentioned purpose, the second aspect embodiment of the present disclosure proposes a search device, including: a first processing module, used to respond to receiving a file search request sent by a client, obtain the file name and file title of any candidate file among multiple candidate files associated with the client, and process the text information of any candidate file according to the file type of the candidate file to obtain a text slice set; a generation module, used to generate a first slice vector set according to the text slice set, the file name and the file title; a fusion module, used to obtain a preference vector of a target object logging in to the client and a feature vector of a search keyword in a search statement in the search request, and fuse the preference vector with the feature vector to obtain a session vector; a determination module, used to determine at least one target file from each of the candidate files according to the first similarity between the session vector and each slice vector in the first slice vector set of each of the candidate files, and send each of the target files to the client.
[0012] To achieve the above-mentioned purpose, the third aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the search method as described in the above-mentioned first aspect embodiment.
[0013] To achieve the above objectives, the fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to enable a computer to execute the search method as described in the first aspect of the present disclosure.
[0014] To achieve the above-mentioned purpose, a fifth aspect of the present disclosure provides a computer program product. When an instruction processor in the computer program product executes, the search method described in the first aspect of the present disclosure is executed.
[0015] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0017] Figure 1 A flowchart of a search method provided by an embodiment of the present disclosure;
[0018] Figure 2 A flowchart of another search method provided by an embodiment of the present disclosure;
[0019] Figure 3 A flowchart of another search method provided by an embodiment of the present disclosure;
[0020] Figure 4 A flowchart of another search method provided by an embodiment of the present disclosure;
[0021] Figure 5 A flowchart of another search method provided by an embodiment of the present disclosure;
[0022] Figure 6 A schematic diagram of a process for generating a file slice corpus provided by an embodiment of the present disclosure;
[0023] Figure 7 A schematic diagram of uploading a user file personalized search recommendation record to a blockchain provided by an embodiment of the present disclosure;
[0024] Figure 8 A schematic diagram of the structure of a search device provided by an embodiment of the present disclosure;
[0025] Fig. 9 It is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0027] The server (e.g., cloud disk) contains various forms of text files, image files, audio files, and video files, and the formats are different. The traditional personalized file search methods are mainly the following:
[0028] (1) Search for files based on the user's search statement;
[0029] (2) Recommend relevant files based on the user’s social network information, such as friends and groups;
[0030] (3) Perform preprocessing operations such as word segmentation on the document text, use the Word2Vec classic word vector model to obtain the word vector expression, perform weighted summation to obtain the document vector expression, and perform search and recommendation based on vector similarity;
[0031] Although the above solution (1) is simple and easy to implement, it cannot reflect the user's interests; solution (2) requires users to actively maintain their social network information, and it is easy to limit the scope of file search, affecting the diversity of file recommendations; in solution (3), Word2Vec has insufficient understanding of complex semantic relationships and contextual information, has limited accuracy, and mainly focuses on the single-modal field of text, and tends to ignore the deep semantic information of long text files.
[0032] In view of the above problems, the present disclosure proposes a search method, device, electronic device and storage medium.
[0033] The following describes the search method, device, electronic device, and storage medium according to the embodiments of the present disclosure with reference to the accompanying drawings.
[0034] Figure 1 A flowchart of a search method provided by an embodiment of the present disclosure.
[0035] like Figure 1 As shown, the search method may include the following steps:
[0036] Step 101, in response to receiving a file search request sent by a client, obtain the file name and file title of any candidate file among multiple candidate files associated with the client, and process the text information of any candidate file according to the file type of any candidate file to obtain a text slice set.
[0037] As an example, files uploaded by the client, files transferred by the client, etc. may be used as multiple candidate files associated with the client.
[0038] It can be understood that the multiple candidate files associated with the client may include multiple file types. For example, the file types of the multiple candidate files associated with the client may include text, pictures, audio, etc. Therefore, in order to accurately characterize the file semantics, the file name and file title of any candidate file can be obtained, and the text information of any candidate file can be extracted based on the file type of any candidate file, and the text information of any candidate file can be segmented based on the length information of the text information to obtain a text slice set corresponding to the text information of any candidate file, wherein the text slice set includes multiple text slices.
[0039] It should be noted that since the multiple candidate files associated with the client may include multiple file types, the candidate files of some file types (such as pictures) may not include file titles. Therefore, for the candidate files that include file titles in the candidate files, the file titles of the candidate files can be directly extracted. For the candidate files that do not include file titles in the candidate files, the text information of the candidate files can be first obtained, and the file titles of the candidate files can be extracted from the text information of the candidate files.
[0040] Step 102: Generate a first slice vector set according to the text slice set, the file name and the file title.
[0041] In order to further improve the accuracy of characterizing file semantics, each text slice in the text slice set of any candidate file, the file name and file title of any candidate file can be vectorized to obtain the first slice vector set, file name vector and file title vector of any candidate file. Then, the initial slice vector set, file name vector and file title vector of any candidate file are fused to obtain the first slice vector set of any candidate file.
[0042] Step 103: Obtain a preference vector of the target object logging into the client and a feature vector of the search keyword in the search statement, and perform weighted fusion on the preference vector and the feature vector to obtain a session vector.
[0043] In order to meet the personalized search needs of users, in addition to accurately representing the semantics of the file, searches can also be performed in combination with the target object preferences and search keywords of the logged-in client.
[0044] Among them, the preference vector of the target object logging into the client can be obtained based on the behavior sequence of the target object towards multiple candidate files within a set time period, the feature vector of the search keywords in the search statement can be obtained by vectorizing the search keywords in the search statement, and the preference vector of the target object logging into the client can be used to indicate the target object's preference degree for each candidate file.
[0045] Step 104 : Determine at least one target file from each candidate file according to the session vector and the first similarity between each slice vector in the first slice vector set of each candidate file, and send each target file to the client.
[0046] As an example, the first similarity between the session vector and each slice vector in the first slice vector set of each candidate file can be calculated, and based on the first similarity corresponding to each slice vector in the second slice vector set of each candidate file, at least one target file is determined from each candidate file, and each target file is sent to the client.
[0047] As another example, in order to reduce the complexity of calculation, for any candidate file, feature dimension reduction is performed on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set, and based on the multiple slice vectors in the first slice vector of the candidate file, feature dimension reduction is performed on the session vector to obtain a session vector after dimension reduction processing, and based on the second similarity between each slice vector in the second slice vector set of any candidate file and the session vector after dimension reduction processing, the first similarity corresponding to each slice vector in the second slice vector set of any candidate file is determined, and based on the first similarity corresponding to each slice vector in the second slice vector set of each candidate file, at least one target file is determined from each candidate file, and each target file is sent to the client.
[0048] In summary, in response to receiving a file search request sent by a client, for any candidate file among multiple candidate files associated with the client, the file name and file title of any candidate file are obtained, and according to the file type of any candidate file, the text information of any candidate file is processed to obtain a text slice set; according to the text slice set, the file name and the file title, a first slice vector set is generated; the preference vector of the target object logged in to the client and the feature vector of the search keyword in the search statement in the search request are obtained, and the preference vector is merged with the feature vector to obtain a session vector; according to the session vector and each slice vector in the first slice vector set of each candidate file The first similarity between the quantities is determined, at least one target file is determined from each candidate file, and each target file is sent to the client. Thus, based on the file type of the candidate file and taking into account the file name and the file title, the candidate file is vectorized at the slice level. At the same time, the session vector obtained by fusion of the preference vector of the target object and the feature vector of the search keyword in the search statement is combined to determine at least one target file from multiple candidate files. This achieves accurate characterization of the semantics of the candidate file while taking into account the user's preferences and search keywords, accurately recalling the files required by the user from each candidate file, meeting the personalized search needs of different users, and improving the user's search experience.
[0049] In order to clearly illustrate how in the above embodiment, at least one target file is determined from each candidate file based on the session vector and the first similarity between each slice vector in the first slice vector set of each candidate file, and each target file is sent to the client, the present disclosure proposes another search method.
[0050] Figure 2 A flowchart of another search method provided by an embodiment of the present disclosure.
[0051] like Figure 2 As shown, the search method may include the following steps:
[0052] Step 201, in response to receiving a file search request sent by a client, obtain the file name and file title of any candidate file among multiple candidate files associated with the client, and process the text information of any candidate file according to the file type of any candidate file to obtain a text slice set.
[0053] Step 202: Generate a first slice vector set according to the text slice set, the file name and the file title.
[0054] Step 203: Obtain a preference vector of the target object logging into the client and a feature vector of the search keyword in the search statement in the search request, and fuse the preference vector with the feature vector to obtain a session vector.
[0055] Step 204, for any candidate file, perform feature dimensionality reduction on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set, and perform feature dimensionality reduction on the session vector based on the multiple slice vectors in the first slice vector of the candidate file to obtain a session vector after dimensionality reduction processing.
[0056] In order to reduce computational complexity, as an example, feature dimension reduction may be performed on multiple slice vectors and session vectors in the first slice vector of any candidate file to obtain a second slice vector set and a session vector after dimension reduction.
[0057] As an example, a trained feature dimensionality reduction model may be used to perform feature dimensionality reduction on multiple slice vectors and session vectors in the first slice vector of any candidate file to obtain a second slice vector set and a reduced-dimensional session vector of any candidate file.
[0058] As another example, multiple slice vectors in the first slice vector of any candidate file are clustered to obtain multiple vector clusters corresponding to any candidate file; and sampling is performed according to the ratio of the number of vector clusters corresponding to any candidate file to a set sampling number to obtain a sample vector set of any candidate file, and based on the sample vector set of any candidate file, multiple slice vectors in the first slice vector of any candidate file are reduced in dimension to obtain a second slice vector set of any candidate file.
[0059] Among them, according to the sample vector set of any candidate file, multiple slice vectors in the second slice vector of any candidate file are reduced in dimension to obtain the third slice vector set of any candidate file, which can be achieved by the following steps: according to the number of sample vectors in the sample vector set of any candidate file, the sample mean vector of the sample vector set of any candidate file is determined; according to the sample mean vector corresponding to any candidate file, each sample vector in the sample vector set of any candidate file is updated to obtain an updated sample vector set; the covariance matrix of the updated sample vector set corresponding to any candidate file is determined; according to the covariance matrix and sample mean vector corresponding to any candidate file, multiple slice vectors in the second slice vector set are reduced in feature dimension to obtain a third slice vector set.
[0060] That is to say, assuming that the total number of clusters after slice clustering is K, the number of all slice vectors in cluster k is N cluster,k , the number of sample set slices that need to be extracted is N sample , then the number of randomly sampled vectors in cluster k is N sample,k for in, Indicates rounding up, randomly selected slices are formed into a sample set vector X, and the number of samples is updated to N sample =ΣN sample,k , let the i-th vector in the sample vector set X be x i (1≤i≤N sample ), then the sample mean vector is For all vectors in the sample vector set X, the mean value is removed, that is, Q = (x1-v mean ,x2-v mean ,...x Nample -v mean ), calculate the covariance matrix QQ T , and perform eigenvalue decomposition on it, extract the eigenvectors corresponding to the largest first M eigenvalues to construct the eigenvector matrix P, and perform feature dimensionality reduction processing on the slice vector based on the sample mean vector and the eigenvector matrix, which can be specifically expressed as: Among them, v d,c represents each slice vector in the first slice vector set, Indicates vd,c Corresponding to the second slice vector.
[0061] At the same time, the feature dimension reduction of the session vector can be performed based on the sample vector set of any candidate file to obtain the session vector after dimension reduction. As an example, the difference vector between the session vector and the sample mean vector of any candidate file is obtained; the session vector after dimension reduction is obtained based on the product of the difference vector of any candidate file and the covariance matrix. For example, the session vector is represented as v ue , the conversation vector of any candidate file after dimension reduction Among them, P represents the covariance matrix corresponding to any candidate file, v mean Represents the sample mean vector of any candidate file.
[0062] Step 205 : Determine the first similarity corresponding to each slice vector in the first slice vector set of the candidate file according to the second similarity between each slice vector in the second slice vector set and the session vector after the dimensionality reduction process.
[0063] Further, the second similarity between each slice vector in the second slice vector set of any candidate file and the conversation vector after dimensionality reduction processing is calculated, and the first similarity corresponding to each slice vector in the first slice vector set of any candidate file is determined according to the second similarity between each slice vector in the second slice vector set of any candidate file and the conversation vector after dimensionality reduction processing. For example, the second similarity between each slice vector in the second slice vector set of any candidate file and the conversation vector after dimensionality reduction processing can be used as the first similarity corresponding to each slice vector in the first slice vector set of any candidate file. For another example, the second similarity between each slice vector in the second slice vector set of any candidate file and the conversation vector after dimensionality reduction processing can be multiplied by a corresponding set coefficient, and the product of the second similarity between each slice vector in the second slice vector set of any candidate file and the conversation vector after dimensionality reduction processing and the corresponding set coefficient can be used as the first similarity corresponding to each slice vector in the first slice vector set of any candidate file.
[0064] Step 206: Determine at least one fourth slice vector from a plurality of slice vectors in the second slice vector set of the candidate file according to the first similarity corresponding to each slice vector in the first slice vector set of the candidate file.
[0065] As an example, at least one fourth slice vector having a first similarity greater than a set similarity threshold may be determined from a plurality of slice vectors in the second slice vector set of any candidate file.
[0066] Step 207: fuse the fourth slice vectors corresponding to the candidate file to obtain the file vector of the candidate file.
[0067] Furthermore, at least one fourth slice vector corresponding to any candidate file is fused to perform vectorized expression on the arbitrary candidate file, that is, to generate a file vector of the arbitrary candidate file.
[0068] Step 208 : determining a target file from each candidate file according to the third similarity between the file vector and the session vector of each candidate file, and sending each target file to the client.
[0069] As an example, the heat value of the candidate file and the characteristic value of the social group to which the target object belongs are obtained, and the third similarity is weighted according to the heat value of the candidate file and the characteristic value of the social group to which the target object belongs to obtain a fourth similarity; the candidate files are sorted according to the fourth similarity of each candidate file to obtain a candidate file sequence; from the candidate file sequence, a target file sequence is determined, and the target file sequence is sent to the client, wherein the target file sequence includes at least one target file. For example, multiple candidate files are sorted from large to small according to the fourth similarity corresponding to each candidate file, and a list of files within a preset number with higher similarity is returned as the target file sequence, and the target file sequence is sent to the client.
[0070] Among them, it should be noted that since some servers (such as cloud disks) have certain social attributes, such as circle functions, specific group file sharing functions, etc., the importance of files in different groups is not the same for users. Generally, the closer the relationship, the higher the priority of the corresponding files of the groups; the heat value of any candidate file can be determined according to the number of views, collections, shares, downloads or comments on the candidate file, and the heat value of the candidate file may be positively correlated with the number of views, collections, shares, downloads or comments on the candidate file. For example, the higher the number of views of the candidate file, the higher the heat value of the candidate file; the higher the number of collections of any candidate file, the higher the heat value of the candidate file; the more times the candidate file is shared, the higher the heat value of the candidate file; the more times the candidate file is downloaded, the higher the heat value of the candidate file.
[0071] In an embodiment of the present disclosure, when a target file sequence is sent to a client, summary information corresponding to each file in the target file sequence can also be sent to the client. As an example, according to the second similarity corresponding to each fourth vector of any target file in the target file sequence, multiple fourth slice vectors of any target file are sorted to obtain a slice vector sequence corresponding to any target file; from a text slice set corresponding to any target file, a text slice sequence corresponding to the slice vector sequence of any target file is obtained; each text slice in the text slice sequence corresponding to any target file is spliced to obtain a spliced text; according to the spliced text corresponding to any target file and the search keyword, a prompt word is constructed, and according to the prompt word corresponding to any target file, a summary of any target file is extracted to obtain summary information of any target file; the target file sequence and the summary information corresponding to each target file in the target file sequence are sent to the client to display each target file in the target file sequence and the summary corresponding to each target file.
[0072] For example, the target file d in the target file sequence is taken as an example, and the multiple fourth vectors of the target file d are The second similarity ρ corresponding to each fourth vector of any target file d,c Sort the corresponding multiple fourth vectors to obtain the slice vector sequence (c1, c2, ... c T ), According to the file slicing rules, the slice vector sequence (c1, c2, ...c T ) to obtain a concatenated text; construct prompt words according to the concatenated text and search keywords corresponding to any target file, for example, extract keywords from the concatenated text, use the keywords extracted from the concatenated text and the search keywords as prompt words, or use each word segment and search keyword in the concatenated text as prompt words; then, use a semantic model to search for similar content according to the prompt words, and extract a summary.
[0073] To facilitate users to check operation records, search recommendation records can be uploaded to the blockchain for evidence traceability, and the original operation records are stored in a centralized database.
[0074] In summary, for any candidate file, feature dimensionality reduction is performed on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set, and feature dimensionality reduction is performed on the session vector according to the multiple slice vectors in the first slice vector of the candidate file to obtain a session vector after dimensionality reduction processing; according to the second similarity between each slice vector in the second slice vector set and the session vector after dimensionality reduction processing, the first similarity corresponding to each slice vector in the first slice vector set of the candidate file is determined; according to the first similarity corresponding to each slice vector in the first slice vector set of the candidate file, at least one is determined from the multiple slice vectors in the second slice vector set of the candidate file. a fourth slice vector; fusing the fourth slice vectors corresponding to the candidate files to obtain the file vector of the candidate file; determining the target file from each candidate file according to the third similarity between the file vector of each candidate file and the session vector, and sending each target file to the client, thereby using the second slice vector set of any candidate file obtained by dimensionality reduction processing and the session vector after dimensionality reduction processing to determine the first similarity corresponding to each slice vector in the second slice vector set of any candidate file, and determining the target file from multiple candidate files according to the first similarity corresponding to each slice vector in the second slice vector set of any candidate file, thereby reducing the complexity of determining each target file from multiple candidate files.
[0075] In order to clearly explain how to obtain the preference vector of the target object logging into the client and the keyword vector of the search keyword in the search statement in the above embodiment, the present disclosure proposes another search method.
[0076] Figure 3 A flowchart of another search method provided by an embodiment of the present disclosure.
[0077] like Figure 3 As shown, the search method may include the following steps:
[0078] Step 301, in response to receiving a file search request sent by a client, obtain the file name and file title of any candidate file among multiple candidate files associated with the client, and process the text information of any candidate file according to the file type of any candidate file to obtain a text slice set.
[0079] Step 302: Generate a first slice vector set according to the text slice set, the file name and the file title.
[0080] Step 303: Obtain a behavior sequence of a target object that logs into the client on multiple candidate files within a set period of time.
[0081] For example, extract the user's usage behavior sequence (b1, b2, ... b J ), the operation time sequence and file index sequence corresponding to the usage behavior sequence are (t1, t2, ...t J ) and (r1,r2,...,r J ), where J is the total number of operation behavior records.
[0082] Step 304: Determine the preference vector of the target object according to the behavior sequence.
[0083] As an example, the behavior sequence is weighted according to the characteristic value of the social group to which the target object belongs to obtain the preference vector of the target object. For example, it can be expressed as the following formula:
[0084]
[0085] Where f1(b j ,t j ) represents the time decay weight function of user behavior, f2(b j ) represents the user behavior weight function. For example, the weights of interest preferences expressed by file browsing, collection, sharing, downloading, and commenting are not the same. Since some servers (such as cloud disks) have certain social attributes, such as circle functions and specific group file sharing functions, the importance of files in different groups is not the same for users. Generally, the files in groups with closer relationships have higher priorities. f3(u id ,r j ) represents user u id and file r j The weight function of the group social characteristics (social group characteristic value) is used. If the file exists in multiple groups of the user, the largest weight is taken. Represents file r j The vector is calculated as follows:
[0086]
[0087] Step 305: extract the search keywords in the search statement, and vectorize the search keywords to obtain a feature vector of the search keywords.
[0088] As an example, the search keywords in the search sentence are extracted, and the extracted search keywords can be vectorized using a semantic model to obtain a feature vector of the search keyword. The semantic model can be a Generative Pre-trained Transformer (GPT) model or a Chat General Language Model (ChatGLM).
[0089] Step 306: weighted fusion of the preference vector and the feature vector to obtain a session vector.
[0090] As an example, the preference vector and the feature vector are weighted and fused to obtain a session vector, which can be specifically expressed as the following formula:
[0091] v ue =w be v be +w se v se ;
[0092] Among them, w be represents the user behavior interest preference weight, w se Indicates the search keyword weight, v be represents the preference vector, v se Feature vector representing the search keyword.
[0093] Step 307 : Determine at least one target file from each candidate file according to the session vector and the first similarity between each slice vector in the first slice vector set of each candidate file, and send each target file to the client.
[0094] In summary, by obtaining the behavior sequence of the target object logged in to the client for the candidate files within a set time period; determining the preference vector of the target object based on the behavior sequence; extracting the search keywords in the search statement, and vectorizing the search keywords to obtain the feature vector of the search keywords, thereby, according to the behavior sequence of the target object for multiple candidate files within the set time period, the preference vector of the target object can be effectively determined, and the search keywords can be vectorized to effectively determine the feature vector of the search keywords, thereby achieving accurate characterization of the semantics of the candidate files while taking into account the user's preferences and search keywords, accurately recalling the files required by the user from each candidate file, meeting the personalized search needs of different users, and improving the user's search experience.
[0095] In order to clearly explain how the text information of any candidate file is processed according to the file type of any candidate file in the above embodiment to obtain a text slice set, the present disclosure proposes another search method.
[0096] Figure 4 A flowchart of another search method provided by an embodiment of the present disclosure.
[0097] like Figure 4 As shown, the search method may include the following steps:
[0098] Step 401 , in response to receiving a file search request sent by a client, for any candidate file among a plurality of candidate files associated with the client, obtain a file name and a file title of any candidate file.
[0099] Step 402: extract text information of any candidate file according to the file type of any candidate file.
[0100] As an example, in response to the file type of any candidate file being a picture, multiple image features are extracted from any candidate file, and any image feature of the multiple image features of any candidate file is converted into corresponding text description information; and the text information of any candidate file is determined according to the text description information corresponding to any image feature of the multiple image features of any candidate file. For example, the text description information corresponding to any image feature of the multiple image features of any candidate file is concatenated to obtain the text information of any candidate file.
[0101] As another example, in response to the file type of any candidate file being audio, extract the audio data in any candidate file; convert the audio data in any candidate file into corresponding text description information; and determine the text information of any candidate file based on the conversion of the audio data in any candidate file into the corresponding text description information. For example, the text description information corresponding to the audio data in any candidate file is used as the text information of any candidate file.
[0102] It should be noted that, in order to meet the personalized permission configuration, when recommending file searches, you can specify specific files for retrieval, such as selecting files belonging to a certain group, files in a specific format, and files within the search permissions, etc. At the same time, you can set to exclude specific files from retrieval in order to meet the personalized permission configuration.
[0103] As an example, according to the search statement in the file search request, a target file album matching the search statement is determined from multiple stored file albums; and the files in the target file album are used as multiple candidate files associated with the client.
[0104] As another example, the file format of the first file to be searched in the search statement is extracted, and multiple first files to be searched matching the file format are obtained from multiple stored files; the multiple first files to be searched are used as multiple candidate files associated with the client.
[0105] As another example, a search permission matching the target object is obtained, and multiple second files to be searched matching the search permission are obtained from multiple stored files; the multiple second files to be searched are used as multiple candidate files associated with the client.
[0106] Step 403 , based on the length information of the text information of any candidate file and the set slice length information, the text information of any candidate file is segmented to obtain a text slice set of any candidate file.
[0107] The text slice set includes multiple text slices.
[0108] In order to maintain a smooth transition of semantic information between adjacent slices, text information may be repeated between adjacent slices, that is, the tail of the previous slice and the head of the next slice are repeated. As an example, the length information of the text information of any candidate file is L d , set the slice length information to L max , the length information L of the text information in any candidate file d Less than or equal to L max , no segmentation is performed. At this time, the text slice set corresponding to the text information of any candidate file only includes one text slice; otherwise, segmentation is performed in a smooth moving and overlapping manner with adjacent slices. The number of text slices in the text slice set corresponding to the text information of any candidate file can be in, Indicates rounding up.
[0109] As another example, the text information of any candidate file may be segmented into paragraphs to obtain a set of text slices for any candidate file. For example, if the text information of any candidate file includes 5 text paragraphs and each paragraph is a text slice, the text slice set of any candidate file may include 5 text slices.
[0110] Step 404: Generate a first slice vector set according to the text slice set, the file name and the file title.
[0111] Step 405 , obtain the preference vector of the target object of the login client and the feature vector of the search keyword in the search statement in the search request, and merge the preference vector with the feature vector to obtain a session vector.
[0112] Step 406: Determine at least one target file from each candidate file based on the session vector and the first similarity between each slice vector in the first slice vector set of each candidate file, and send each target file to the client.
[0113] In summary, the text information of any candidate file is extracted according to the file type of any candidate file; the text information of any candidate file is segmented according to the length information of the text information of any candidate file and the set slice length information to obtain a text slice set of any candidate file; wherein the text slice set includes multiple text slices, thereby, based on the file type of the candidate file, and considering the file name and the file title, the candidate file is vectorized at the slice level, and at the same time, the session vector obtained by fusion of the preference vector of the target object and the feature vector of the search keyword in the search statement is combined, and multiple target files are determined from multiple target files, so that on the basis of accurately representing the semantics of the candidate files, the user's preferences and search keywords are taken into account, and the files required by the user are accurately recalled from each candidate file, which meets the personalized search needs of different users and improves the user's search experience.
[0114] Based on any embodiment of the present disclosure, taking the server as a cloud disk as an example, the implementation process of the present disclosure can be as follows: Figure 5 As shown, it mainly includes the following steps:
[0115] 1. The steps for generating a document slice corpus (text slice collection) can be as follows: Figure 6 As shown, the following steps may be specifically included:
[0116] (1) Text information extraction: Taking file d (1≤d≤D) as an example, first determine the file type. If it is a text file, directly extract the text information; if it is an image file, use the image-to-text semantic analysis model to obtain text information such as scene labels; if it is an audio file, use the audio-to-text semantic analysis model to obtain text information, otherwise it will be considered an invalid file. It should be noted that there are relatively mature large language model technologies or API interface tools for image-to-text and audio-to-text conversion, such as GPT-4, DALL-E, Whisper, etc., which will not be elaborated here.
[0117] (2) Text information preprocessing: cleaning the text information obtained in step 1), including preprocessing operations such as removing stop words;
[0118] (3) Text slice generation: In order to maintain a smooth transition of semantic information between adjacent slices, there is repeated text information between adjacent slices, that is, the tail of the previous slice and the head of the next slice are repeated. Suppose the length of the text information obtained in step 2) is L d , the maximum length of the slice to be segmented is L max, the length of repeated text between adjacent slices is L cp , the segmentation is performed according to the following principle: when the length of the text information is not greater than the maximum length of the slice, that is, L d ≤L max , no segmentation is performed, and the file only has N d = 1 slice, and the slice length is L d On the contrary, the segmentation is carried out in a smooth moving and overlapping manner, and the number of slices is in, Indicates rounding up.
[0119] 2. File Slicing Vectorization
[0120] (1) Name and title vectorization: Extract the name and title of file d (1≤d≤D), and vectorize them through the semantic analysis model to obtain the corresponding vector v file,d and v title,d ;
[0121] (2) Slice content vectorization: Slice corpus (text slice collection) for file segmentation d,c (1≤c≤N d ), and then input the semantic analysis model for vectorization to obtain the corresponding vector v chip,d,c ;
[0122] (3) Weighted fusion of slice vectors: Let the weights corresponding to the file name, title, and slice be w respectively. file,d 、w title,d and w chip,d , then the vector after weighted fusion of slice vectors is:
[0123]
[0124] (4) Slice vector storage: The slice vector obtained in step 3) and its corresponding expected content can be stored in a vector database to facilitate data persistence and subsequent vector retrieval operations.
[0125] 3. File Slice Feature Dimensionality Reduction
[0126] (1) Slice vector clustering: Slice the above file vector v d,c (1≤d≤D, 1≤c≤N d ) Clustering is performed according to preset rules, such as using K-means algorithm;
[0127] (2) Random sampling to form a sample set: Assume that the total number of clusters after slice clustering is K, and the number of all slice vectors in cluster k is N cluster,k , the number of sample set slices that need to be extracted is N sample, then the number of randomly sampled vectors in cluster k is N sample,k for
[0128]
[0129] in, Indicates rounding up, randomly selected slices are formed into a sample set vector X, and the number of samples is updated to N sample =ΣN sample,k ;
[0130] (3) Let the i-th vector in the sample vector set X be x i (1≤i≤N sample ), then the sample mean vector is
[0131]
[0132] (4) De-mean all vectors in the sample vector set X, i.e. Q = (x1-v mean ,x2-v mean ,...x Nample -v mean ), calculate the covariance matrix QQ T , and perform eigenvalue decomposition on it, extract the eigenvectors corresponding to the largest first M eigenvalues to construct the eigenvector matrix P;
[0133] (5) Based on the sample mean vector and the eigenvector matrix, the slice vector is subjected to feature dimensionality reduction processing, which can be specifically expressed as follows:
[0134] 4. Vectorized Expression of User Search Sessions
[0135] (1) User cloud disk historical behavior extraction: Extract the user cloud disk file usage behavior sequence (b1, b2, ... b J ), the corresponding operation time series and file index series are (t1, t2, ...t J ) and (r1,r2,...,r J ), where J is the total number of operation behavior records;
[0136] (2) User interest preference vector expression: Based on the user usage behavior in step 1), the corresponding user interest preference vector expression is weightedly calculated:
[0137]
[0138] Where f1(b j ,t j ) represents the time decay weight function of user behavior, f2(b j) represents the user behavior weight function. For example, the weights of interest preferences expressed by file browsing, collection, sharing, downloading, and commenting are not the same. Since some servers (such as cloud disks) have certain social attributes, such as circle functions and specific group file sharing functions, the importance of files in different groups is not the same for users. Generally, the files in groups with closer relationships have higher priorities. f3(u id ,r j ) represents user u id and file r j The weight function of the group social characteristics (social group characteristic value) is used. If the file exists in multiple groups of the user, the largest weight is taken. The vector representing the file rj is calculated as follows:
[0139]
[0140] (3) Vectorized expression of search keywords: Using the same latent semantic analysis model as in the file slicing vectorization method, the user search keywords are vectorized to obtain the search keyword vector (feature vector) v se ;
[0141] (4) Vectorized expression of user search session: weighted according to the user's historical behavior interest preference vector and search keyword vector (feature vector), that is,
[0142] v ue =w be v be +w se v se ;
[0143] Among them, w be represents the user behavior interest preference weight, w se Indicates the search keyword weight.
[0144] 5. File Slice Similarity Retrieval
[0145] (1) File slice similarity calculation: based on the slice vector after feature dimensionality reduction and user search session vector Calculate the similarity ρ d,c ,Right now
[0146]
[0147] (2) File slicing screening: Preset similarity threshold ρ th , select the file slice that meets the following conditions
[0148]
[0149] 6. File Similarity Retrieval
[0150] (1) File vector expression: preliminary search results based on file slices Weighted fusion to form a vectorized expression of the file Right now
[0151] (2) File similarity calculation: Compare the similarity between the file vector in step 1) and the user search session vector in sequence according to the following formula:
[0152]
[0153] 7. Sorting of file search recommendation list
[0154] (1) Weighted file similarity calculation: Considering the popularity of files and the characteristics of social groups, the file similarity is weighted. Right now
[0155] (2) Returning a file search list: sorting the above file search results from large to small according to weighted similarity, and returning a list of files within a preset number of files with higher similarity as a recommended file list for this search session.
[0156] As a possible implementation of the embodiment of the present disclosure, when returning to the cloud disk to search for a personalized recommended file list, a prompt word can be constructed based on the high-similarity slice content corpus, and a summary can be made with the help of a latent semantic model (such as GPT, ChatGLM, etc.), and the summary content can be presented so that the user can view and confirm the search results.
[0157] (1) Slice index extraction: Taking file d in the personalized recommendation list as an example, extract the slice retrieval result corresponding to the file in the file slice similarity retrieval method. And according to the similarity ρ d,c Sorting, the slice index (slice vector sequence) is (c1, c2, ... c T ),and
[0158] (2) Corpus extraction: According to the file slicing and segmentation rules, the text sequences corresponding to the slice indexes in step 1) are extracted in sequence and spliced together, and the slices are separated by delimiters;
[0159] (3) Semantic model summary: Construct prompt words based on the corpus and search keywords, search for similar content based on the latent semantic model, and extract a summary.
[0160] As a possible implementation method of the embodiment of the present disclosure, when making personalized file search recommendations on a cloud disk, specific files can be specified for retrieval, such as selecting files belonging to a certain group, files in a specific format, etc. At the same time, specific files can be excluded from retrieval to meet the personalized permission configuration.
[0161] As a possible implementation of the embodiment of the present disclosure, in the document slice corpus generation method, segmentation can be performed according to paragraph structure, and there is no need to keep the length of the slice text sequence as equal as possible.
[0162] In order to facilitate users to check operation records, audit, log viewing and other business operations, as a possible implementation method of the embodiment of the present disclosure, Figure 7 As shown, the cloud disk can upload the user's personalized file search recommendation records to the blockchain for evidence traceability, and its original operation records are stored in the centralized database.
[0163] In order to achieve the above Figures 1 to 7 In the illustrated embodiment, the present disclosure provides a search device.
[0164] Figure 8 A schematic diagram of the structure of a search device provided in an embodiment of the present disclosure.
[0165] like Figure 8 As shown, the search device 800 includes: a first processing module 810 , a generation module 820 , a fusion module 830 and a determination module 840 .
[0166] Among them, the first processing module 810 is used to respond to the file search request sent by the client, obtain the file name and file title of any candidate file among multiple candidate files associated with the client, and process the text information of any candidate file according to the file type of any candidate file to obtain a text slice set; the generation module 820 is used to generate a first slice vector set according to the text slice set, the file name and the file title; the fusion module 830 is used to obtain the preference vector of the target object logged in to the client and the feature vector of the search keyword in the search statement in the search request, and fuse the preference vector with the feature vector to obtain a session vector; the determination module 840 is used to determine at least one target file from each candidate file according to the first similarity between the session vector and each slice vector in the first slice vector set of each candidate file, and send each target file to the client.
[0167] As a possible implementation of the embodiment of the present disclosure, the determination module 840 is used to perform feature dimensionality reduction on multiple slice vectors in the first slice vector of any candidate file to obtain a second slice vector set, and perform feature dimensionality reduction on the session vector based on the multiple slice vectors in the first slice vector of the candidate file to obtain a session vector after dimensionality reduction processing; determine the first similarity corresponding to each slice vector in the first slice vector set of the candidate file based on the second similarity between each slice vector in the second slice vector set and the session vector after dimensionality reduction processing; determine at least one fourth slice vector from the multiple slice vectors in the second slice vector set of the candidate file based on the first similarity corresponding to each slice vector in the first slice vector set of the candidate file; fuse the fourth slice vectors corresponding to the candidate file to obtain a file vector of the candidate file; determine the target file from each candidate file based on the third similarity between the file vector and the session vector of each candidate file, and send each target file to the client.
[0168] As a possible implementation method of the embodiment of the present disclosure, the determination module 840 is also used to cluster multiple slice vectors in the first slice vector of any candidate file to obtain multiple vector clusters; according to the ratio of the number of slice vectors in each vector cluster to the set sampling number, sample vectors of the set number of sample vectors are extracted from each vector cluster to generate a sample vector set; according to the sample vector set, feature dimensionality reduction is performed on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set.
[0169] As a possible implementation method of the embodiment of the present disclosure, the determination module 840 is also used to determine the sample mean vector of the sample vector set based on the number of sample vectors in the sample vector set; update each sample vector in the sample vector set based on the sample mean vector to obtain an updated sample vector set; determine the covariance matrix of the updated sample vector set; and perform feature dimensionality reduction on multiple slice vectors in the first slice vector of the candidate file based on the covariance matrix and the sample mean vector to obtain a second slice vector set.
[0170] As a possible implementation method of the embodiment of the present disclosure, the determination module 840 is also used to obtain a difference vector between the session vector and the sample mean vector of the candidate file; and obtain the session vector after dimensionality reduction processing according to the product of the difference vector and the covariance matrix of the candidate file.
[0171] As a possible implementation method of the embodiment of the present disclosure, the determination module 840 is further used to obtain the popularity value of the candidate file and the characteristic value of the social group to which the target object belongs, and weight the third similarity according to the popularity value of the candidate file and the characteristic value of the social group to which the target object belongs to obtain a fourth similarity; sort each of the candidate files according to the fourth similarity of each of the candidate files to obtain a candidate file sequence; determine a target file sequence from the candidate file sequence, and send the target file sequence to the client, wherein the target file sequence includes at least one target file.
[0172] As a possible implementation method of the embodiment of the present disclosure, the determination module 840 is also used to sort each fourth slice vector according to the second similarity corresponding to each fourth vector of any target file in the target file sequence to obtain a slice vector sequence; obtain a text slice sequence corresponding to the slice vector sequence from the text slice set; splice each text slice in the text slice sequence to obtain a spliced text; construct a prompt word according to the spliced text and the search keyword, and extract a summary of any target file according to the prompt word to obtain summary information of any target file; send the target file sequence and the summary information corresponding to each target file in the target file sequence to the client to display each target file in the target file sequence and the summary corresponding to each target file.
[0173] As a possible implementation manner of the embodiment of the present disclosure, the search device 800 further includes: a sending module.
[0174] Among them, the sending module is used to send the target file sequence and the summary information corresponding to each file in the target file sequence to the blockchain, so as to store the target file sequence and the summary information corresponding to each file in the target file sequence.
[0175] As a possible implementation method of the embodiment of the present disclosure, a generation module 820 is used to vectorize each text slice, file name, and file title in the text slice set, respectively, to obtain an initial slice vector set, a file name vector, and a file title vector; and to fuse the initial slice vector set, the file name vector, and the file title vector to obtain a first slice vector set.
[0176] As a possible implementation method of the embodiment of the present disclosure, the fusion module 830 is used to obtain the behavior sequence of the target object logging into the client on the candidate files within a set time period; determine the preference vector of the target object based on the behavior sequence; extract the search keywords in the search statement, and vectorize the search keywords to obtain the feature vector of the search keywords.
[0177] As a possible implementation method of the embodiment of the present disclosure, the first processing module 810 is used to extract text information of any candidate file according to the file type of any candidate file; perform text segmentation on the text information of any candidate file according to the length information of the text information of any candidate file and the set slice length information to obtain a text slice set of any candidate file; wherein the text slice set includes multiple text slices.
[0178] As a possible implementation method of the embodiment of the present disclosure, the first processing module 810 is also used to extract multiple image features from any candidate file in response to the file type of any candidate file being a picture, and convert any image feature of the multiple image features of any candidate file into corresponding text description information; determine the text information of any candidate file based on the text description information corresponding to each of the image features of any candidate file.
[0179] As a possible implementation of the embodiment of the present disclosure, the search device 800 further includes: an extraction module and a conversion module.
[0180] Among them, the extraction module is used to extract the audio data in any candidate file in response to the file type of any candidate file being audio; the conversion module is used to convert the audio data in any candidate file into corresponding text description information; the determination module 840 is used to determine the text information of any candidate file based on the text description information corresponding to the audio data in any candidate file.
[0181] As a possible implementation manner of the embodiment of the present disclosure, the search device 800 further includes: a second processing module.
[0182] Among them, the second processing module is used to determine a target file album that matches the search statement from multiple stored file albums based on the search statement in the file search request; and use the files in the target file album as multiple candidate files associated with the client.
[0183] As a possible implementation manner of the embodiment of the present disclosure, the search device 800 further includes: a third processing module.
[0184] Among them, the third processing module is used to extract the file format of the first file to be searched in the search statement, and obtain multiple first files to be searched that match the file format from multiple stored files; and use the multiple first files to be searched as multiple candidate files associated with the client.
[0185] As a possible implementation manner of the embodiment of the present disclosure, the search device 800 further includes: a fourth processing module.
[0186] Among them, the fourth processing module is used to obtain the search authority matching the target object, and obtain multiple second files to be searched matching the search authority from multiple stored files; and use the multiple second files to be searched as multiple candidate files associated with the client.
[0187] The search device of the embodiment of the present disclosure, in response to receiving a file search request sent by a client, obtains the file name and file title of any candidate file among multiple candidate files associated with the client, and processes the text information of any candidate file according to the file type of the candidate file to obtain a text slice set; generates a first slice vector set according to the text slice set, the file name and the file title; obtains a preference vector of a target object logged in to the client and a feature vector of a search keyword in a search statement in the search request, and fuses the preference vector with the feature vector to obtain a session vector; ... session vector and the first slice vector of each candidate file. The first similarity between each slice vector in the set is used to determine at least one target file from each candidate file, and each target file is sent to the client. Thus, based on the file type of the candidate file, and taking into account the file name and file title, the candidate file is vectorized at the slice level. At the same time, the session vector obtained by fusion of the preference vector of the target object and the feature vector of the search keyword in the search statement is combined to determine at least one target file from multiple candidate files. This achieves accurate characterization of the semantics of the candidate file while taking into account the user's preferences and search keywords, accurately recalling the files required by the user from each candidate file, meeting the personalized search needs of different users, and improving the user's search experience.
[0188] It should be noted that the above explanations of the search method embodiment are also applicable to the search device of this embodiment, and will not be repeated here.
[0189] In an exemplary embodiment, an electronic device is also provided.
[0190] Among them, electronic equipment includes:
[0191] processor;
[0192] a memory for storing processor-executable instructions;
[0193] The processor is configured to execute instructions to implement the search method proposed in any of the aforementioned embodiments.
[0194] As an example, Fig. 9 is a schematic diagram of the structure of an electronic device 900 shown in an exemplary embodiment of the present disclosure, such as Fig. 9 As shown, the electronic device 900 may further include:
[0195] The memory 910 and the processor 920, a bus 930 connecting different components (including the memory 910 and the processor 920), the memory 910 stores a computer program, and when the processor 920 executes the program, the search method described in the embodiment of the present disclosure is implemented.
[0196] Bus 930 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0197] The electronic device 900 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 900, including volatile and non-volatile media, removable and non-removable media.
[0198] The memory 910 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 940 and / or cache memory 950. The server 900 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 960 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 930 via one or more data medium interfaces. The memory 910 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0199] A program / utility 980 having a set (at least one) of program modules 970 may be stored, for example, in the memory 910, such program modules 970 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 970 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0200] The electronic device 900 may also communicate with one or more external devices 990 (e.g., keyboard, pointing device, display 991, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 992. In addition, the electronic device 900 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 993. As shown, the network adapter 993 communicates with other modules of the electronic device 900 through a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0201] The processor 920 executes various functional applications and data processing by running the programs stored in the memory 910 .
[0202] It should be noted that the implementation process and technical principles of the electronic device of this embodiment refer to the aforementioned explanation of the search method of the embodiment of the present disclosure, and will not be repeated here.
[0203] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions, and the above instructions can be executed by a processor of an electronic device to complete the search method proposed in any of the above embodiments. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0204] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the search method proposed in any of the above embodiments is implemented.
[0205] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0206] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A search method, characterized in that: The method comprises: In response to receiving a file search request sent by a client, for any candidate file among a plurality of candidate files associated with the client, obtaining a file name and a file title of the any candidate file, and processing text information of the any candidate file according to a file type of the any candidate file to obtain a text slice set; Generate a first slice vector set according to the text slice set, the file name and the file title; Obtaining a preference vector of a target object logging into the client and a feature vector of a search keyword in a search statement in the file search request, and fusing the preference vector with the feature vector to obtain a session vector; Determine at least one target file from each of the candidate files according to a first similarity between the session vector and each slice vector in a first slice vector set of each of the candidate files, and send each of the target files to the client; The determining at least one target file from each of the candidate files according to the first similarity between the session vector and each slice vector in the first slice vector set of each of the candidate files, and sending each of the target files to the client, comprises: For any of the candidate files, perform feature dimensionality reduction on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set, and perform feature dimensionality reduction on the session vector according to the multiple slice vectors in the first slice vector of the candidate file to obtain a session vector after dimensionality reduction processing; Determine, according to a second similarity between each slice vector in the second slice vector set and the session vector after the dimensionality reduction processing, a first similarity corresponding to each slice vector in the first slice vector set of the candidate file; Determining at least one fourth slice vector from a plurality of slice vectors in the second slice vector set of the candidate file according to the first similarity corresponding to each slice vector in the first slice vector set of the candidate file; Merging the fourth slice vectors corresponding to the candidate file to obtain a file vector of the candidate file; Determine the target file from each of the candidate files according to a third similarity between the file vector of each of the candidate files and the session vector, and send each of the target files to the client; For any of the candidate files, performing feature dimension reduction on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set includes: For any of the candidate files, clustering multiple slice vectors in the first slice vector of the candidate file to obtain multiple vector clusters; Extracting a set number of sample vectors from each of the vector clusters according to a ratio of the number of slice vectors in each of the vector clusters to a set number of sampling vectors, so as to generate a sample vector set; According to the sample vector set, feature dimension reduction is performed on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set.
2. The method according to claim 1, characterized in that The step of performing feature dimension reduction on multiple slice vectors in the first slice vector of the candidate file according to the sample vector set to obtain a second slice vector set includes: Determining a sample mean vector of the sample vector set according to the number of sample vectors in the sample vector set; According to the sample mean vector, each sample vector in the sample vector set is updated to obtain an updated sample vector set; Determining a covariance matrix of the updated sample vector set; According to the covariance matrix and the sample mean vector, feature dimension reduction is performed on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set.
3. The method according to claim 2, characterized in that The performing feature dimension reduction on the session vector according to the plurality of slice vectors in the first slice vector of the candidate file to obtain a session vector after dimension reduction processing includes: Obtaining a difference vector between the session vector and the sample mean vector of the candidate file; The session vector after dimensionality reduction processing is obtained according to the product of the difference vector and the covariance matrix of the candidate file.
4. The method according to claim 1, characterized in that: The step of determining the target file from each of the candidate files according to the third similarity between the file vector of each of the candidate files and the session vector, and sending each of the target files to the client comprises: Obtaining the popularity value of the candidate file and the characteristic value of the social group to which the target object belongs, and weighting the third similarity according to the popularity value of the candidate file and the characteristic value of the social group to which the target object belongs, so as to obtain a fourth similarity; sorting the candidate files according to the fourth similarities of the candidate files to obtain a candidate file sequence; A target file sequence is determined from the candidate file sequence, and the target file sequence is sent to the client, wherein the target file sequence includes the at least one target file.
5. The method according to claim 4, characterized in that The step of determining a target file sequence from the candidate file sequence and sending the target file sequence to the client comprises: sorting the fourth slice vectors of any target file in the target file sequence according to the second similarity corresponding to the fourth vectors of any target file in the target file sequence to obtain a slice vector sequence; Obtaining, from the text slice set, a text slice sequence corresponding to the slice vector sequence; Splicing the text slices in the text slice sequence to obtain a spliced text; Constructing a prompt word according to the concatenated text and the search keyword, and extracting a summary of any target file according to the prompt word to obtain summary information of any target file; The target file sequence and summary information corresponding to each target file in the target file sequence are sent to the client to display each target file in the target file sequence and the summary corresponding to each target file.
6. The method according to claim 5, characterized in that The method further comprises: The target file sequence and summary information corresponding to each file in the target file sequence are sent to the blockchain to store the target file sequence and summary information corresponding to each file in the target file sequence.
7. The method according to claim 1, characterized in that The step of generating a first slice vector set according to the text slice set, the file name and the file title comprises: Respectively vectorize each text slice in the text slice set, the file name, and the file title to obtain an initial slice vector set, a file name vector, and a file title vector; The initial slice vector set, the file name vector and the file title vector are merged to obtain a first slice vector set.
8. The method according to claim 1, characterized in that: The obtaining of the preference vector of the target object logged in to the client and the keyword vector of the search keyword in the search statement includes: Obtaining a behavior sequence of a target object logging into the client on the candidate file within a set time period; Determining a preference vector of the target object according to the behavior sequence; The search keywords in the search statement are extracted, and the search keywords are vectorized to obtain feature vectors of the search keywords.
9. The method according to claim 1, characterized in that: The processing of the text information of any candidate file according to the file type of any candidate file to obtain a text slice set includes: Extracting text information of any candidate file according to the file type of any candidate file; According to the length information of the text information of any candidate file and the set slice length information, the text information of any candidate file is segmented to obtain a text slice set of any candidate file; wherein the text slice set includes multiple text slices.
10. The method according to claim 9, characterized in that The step of extracting text information of any candidate file according to the file type of any candidate file includes: In response to the file type of any candidate file being a picture, extracting multiple image features from the any candidate file, and converting any image feature of the multiple image features of the any candidate file into corresponding text description information; The text information of any candidate file is determined according to the text description information corresponding to each of the image features of any candidate file.
11. The method according to claim 10, characterized in that The method further comprises: In response to the file type of any candidate file being audio, extracting audio data from any candidate file; Convert the audio data in any candidate file into corresponding text description information; The text information of any candidate file is determined according to the text description information corresponding to the audio data in any candidate file.
12. The method according to claim 1, characterized in that Before processing the text information of any candidate file according to the file type of any candidate file to obtain a text slice set, the method further includes: According to the search statement in the file search request, determining a target file album matching the search statement from a plurality of stored file albums; The files in the target file album are used as multiple candidate files associated with the client.
13. The method according to claim 1, characterized in that Before processing the text information of any candidate file according to the file type of any candidate file to obtain a text slice set, the method further includes: Extracting the file format of the first file to be searched in the search statement, and acquiring a plurality of first files to be searched matching the file format from a plurality of stored files; The multiple first files to be searched are used as multiple candidate files associated with the client.
14. The method according to claim 1, characterized in that Before processing the text information of any candidate file according to the file type of any candidate file to obtain a text slice set, the method further includes: Acquire a search permission that matches the target object, and acquire a plurality of second files to be searched that match the search permission from a plurality of stored files; The multiple second files to be searched are used as multiple candidate files associated with the client.
15. A search device, characterized in that: The device comprises: A first processing module is used for, in response to receiving a file search request sent by a client, obtaining a file name and a file title of any candidate file among a plurality of candidate files associated with the client, and processing text information of the any candidate file according to a file type of the candidate file to obtain a text slice set; A generating module, configured to generate a first slice vector set according to the text slice set, the file name and the file title; a fusion module, configured to obtain a preference vector of a target object logging into the client and a feature vector of a search keyword in a search statement in the file search request, and fuse the preference vector with the feature vector to obtain a session vector; a determination module, configured to determine at least one target file from each of the candidate files according to a first similarity between the session vector and each slice vector in a first slice vector set of each of the candidate files, and send each of the target files to the client; The determining module is specifically used for: For any of the candidate files, perform feature dimensionality reduction on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set, and perform feature dimensionality reduction on the session vector according to the multiple slice vectors in the first slice vector of the candidate file to obtain a session vector after dimensionality reduction processing; Determine, according to a second similarity between each slice vector in the second slice vector set and the session vector after the dimensionality reduction processing, a first similarity corresponding to each slice vector in the first slice vector set of the candidate file; Determining at least one fourth slice vector from a plurality of slice vectors in the second slice vector set of the candidate file according to the first similarity corresponding to each slice vector in the first slice vector set of the candidate file; Merging the fourth slice vectors corresponding to the candidate file to obtain a file vector of the candidate file; Determine the target file from each of the candidate files according to a third similarity between the file vector of each of the candidate files and the session vector, and send each of the target files to the client; The determining module is further specifically used for: For any of the candidate files, clustering multiple slice vectors in the first slice vector of the candidate file to obtain multiple vector clusters; Extracting a set number of sample vectors from each of the vector clusters according to a ratio of the number of slice vectors in each of the vector clusters to a set number of sampling vectors, so as to generate a sample vector set; According to the sample vector set, feature dimension reduction is performed on multiple slice vectors in the first slice vector of the candidate file to obtain a second slice vector set.
16. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the search method as described in any one of claims 1-14.
17. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable a computer to execute the search method according to any one of claims 1 to 14.
