Data processing method and device, equipment, storage medium and program product
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]通常的计算建模方法存在一些限制
[0017]This application embodiment obtains retrieval data and matching data; performs feature extraction processing on the retrieval data and matching data respectively to obtain a first multi-granularity text feature corresponding to the retrieval data and a second multi-granularity text feature corresponding to the matching data, thus obtaining text features with multiple granularities; performs feature transformation processing on the first multi-granularity text feature and the second multi-granularity text feature respectively to obtain a first feature vector corresponding to the retrieval data and a second feature vector corresponding to the matching data. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector, thus obtaining more representative feature vectors. This processing method can more effectively... Accurately capturing the semantic and text sequence information of the data provides a more reliable foundation for subsequent matching. Interactive processing of the first and second feature vectors yields a semantically relevant vector and a text matching vector. This interactive processing method comprehensively considers the differences between semantics and text sequence, thus more comprehensively evaluating the similarity between the retrieved data and the data to be matched. Vector fusion of the semantically relevant vector and the text matching vector yields a fused vector. This fusion method comprehensively considers the information from different feature vectors, resulting in a more consistent vector representation. Determining the matching result between the retrieved data and the data to be matched based on the fused vector more accurately reflects the similarity between the two. The embodiments of this application can better handle feature interactions and fusions at different granularities, thereby improving the accuracy and relevance of information retrieval.
Smart Images

Figure CN117874162B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a data processing method, apparatus, device, storage medium, and program product. Background Technology
[0002] Modeling result relevance and click probability in search systems is crucial for improving search quality and efficiency. To achieve this, modeling and computation are performed using the textual features of both the search query and the matching documents. In text processing, information at different granularities is typically used to enrich textual expression.
[0003] Conventional computational modeling methods have some limitations. One approach is to simply concatenate features of different granularities before computation, which may result in insufficient interaction between features. Another approach is to perform network learning only between related models at the same granularity, which limits the model's learning and generalization abilities. Summary of the Invention
[0004] This application provides a data processing method, apparatus, device, storage medium, and program product that can better handle feature interactions and fusion between different granularities, thereby improving the accuracy and relevance of information search.
[0005] On one hand, embodiments of this application provide a data processing method, the method comprising:
[0006] The process involves: acquiring retrieval data and matching data; performing feature extraction on the retrieval data and matching data to obtain a first multi-granularity text feature corresponding to the retrieval data and a second multi-granularity text feature corresponding to the matching data; performing feature transformation on the first multi-granularity text feature and the second multi-granularity text feature to obtain a first feature vector corresponding to the retrieval data and a second feature vector corresponding to the matching data, wherein the first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector; performing interactive processing on the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector; performing vector fusion on the semantically related vector and the text matching vector to obtain a fusion vector; and determining the matching result between the retrieval data and the matching data based on the fusion vector.
[0007] On the other hand, embodiments of this application provide a data processing apparatus, the apparatus comprising:
[0008] The acquisition unit is used to acquire the search data and the data to be matched.
[0009] An extraction unit is used to perform feature extraction processing on the retrieved data and the data to be matched, respectively, to obtain a first multi-granularity text feature corresponding to the retrieved data and a second multi-granularity text feature corresponding to the data to be matched;
[0010] The conversion unit is used to perform feature conversion processing on the first multi-granularity text features and the second multi-granularity text features respectively to obtain a first feature vector corresponding to the retrieved data and a second feature vector corresponding to the data to be matched. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector.
[0011] An interaction unit is used to interact with the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector;
[0012] A fusion unit is used to perform vector fusion on the semantically related vector and the text matching vector to obtain a fusion vector;
[0013] The determining unit is used to determine the matching result between the retrieved data and the data to be matched based on the fusion vector.
[0014] On the other hand, embodiments of this application provide a computer device, the computer device including a processor and a memory, the memory storing a computer program, the processor executing the data processing method as described in any of the above embodiments by calling the computer program stored in the memory.
[0015] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program adapted for loading by a processor to execute the data processing method as described in any of the above embodiments.
[0016] On the other hand, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the data processing method as described in any of the above embodiments.
[0017] This application embodiment obtains retrieval data and matching data; performs feature extraction processing on the retrieval data and matching data respectively to obtain a first multi-granularity text feature corresponding to the retrieval data and a second multi-granularity text feature corresponding to the matching data, thus obtaining text features with multiple granularities; performs feature transformation processing on the first multi-granularity text feature and the second multi-granularity text feature respectively to obtain a first feature vector corresponding to the retrieval data and a second feature vector corresponding to the matching data. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector, thus obtaining more representative feature vectors. This processing method can more effectively... Accurately capturing the semantic and text sequence information of the data provides a more reliable foundation for subsequent matching. Interactive processing of the first and second feature vectors yields a semantically relevant vector and a text matching vector. This interactive processing method comprehensively considers the differences between semantics and text sequence, thus more comprehensively evaluating the similarity between the retrieved data and the data to be matched. Vector fusion of the semantically relevant vector and the text matching vector yields a fused vector. This fusion method comprehensively considers the information from different feature vectors, resulting in a more consistent vector representation. Determining the matching result between the retrieved data and the data to be matched based on the fused vector more accurately reflects the similarity between the two. The embodiments of this application can better handle feature interactions and fusions at different granularities, thereby improving the accuracy and relevance of information retrieval. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 A schematic diagram of the modeling structure provided for an embodiment of this application.
[0020] Figure 2 This is another modeling structure intended for the embodiments of this application.
[0021] Figure 3 This is a flowchart illustrating the data processing method provided in an embodiment of this application.
[0022] Figure 4 This is a schematic diagram illustrating an application scenario of the data processing method provided in the embodiments of this application.
[0023] Figure 5 This is a schematic diagram of the structure of the data processing apparatus provided in the embodiments of this application.
[0024] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] This application provides a data processing method, apparatus, device, storage medium, and program product. Specifically, the data processing method of this application can be executed by a computer device, which can be a terminal or a server. The terminal can be a smartphone, tablet, laptop, desktop computer, smart TV, smart speaker, wearable smart device, smart vehicle terminal, etc. The terminal can also include a client, which can be a financial client, browser client, or instant messaging client, etc. The server can 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 communication, middleware services, domain name services, security services, content delivery network services, and big data and artificial intelligence platforms, but is not limited to these.
[0027] The following is a description of some of the terms used in the embodiments of this application:
[0028] Search data (Query): The content entered by the user in the search box. Search data (Query) can be at least one of the following: text data, image data, and video data.
[0029] Data to be matched (Document): An abstract description of searchable content in a search scenario. Data to be matched (Doc) can be at least one of document data, image data, and video data.
[0030] Transformer model: a deep learning model for processing sequential data. Its core features are the use of self-attention mechanism and positional encoding.
[0031] Title: The title of the data (Doc) to be matched.
[0032] Summary: Extracts the core text from the data to be matched (Doc), excluding the title.
[0033] Modeling result relevance and click probability in search systems is crucial for improving search quality and efficiency. To achieve this, modeling and computation are needed using the textual features of both the search query and the matching documents. In text processing, information at different granularities is typically used to enrich textual expression. This information can include character-level words (char), basic segmentation tool words (basic), and multi-gram words, which can be bigrams or triprams. The following example uses a bigram.
[0034] Currently, there are two main types of commonly used computational modeling methods:
[0035] like Figure 1 As shown, the first method is based on the self-flattening of character sequence features, basic word segmentation, and bigram sequence features. These sequence features are concatenated and processed through a deep neural network (Dense tower) to obtain a vector representation of uniform dimension. During the matching phase, multiplication operations are performed between corresponding positions of the query vector and the title vector in the target data (Doc), and between the query vector and the summary vector in the target data (Doc). This product operation can be implemented using Hadamard product (tf.multipy). In this method, there is no direct interaction between the original granular features. Sentence vectors represented by character sequence features, basic word segmentation, and bigram sequence features are directly concatenated and then cross-matched using a Hadamard product (tf.multipy) between the query data and the document data to be matched. The matching results are as follows: title match (q_title match) indicates the degree of matching between the query data and the title vector; summary match (q_summary match) indicates the degree of matching between the query data vector and the summary vector; and text match (text_match) indicates the degree of matching between the query data and the document data to be matched. This method is relatively simple and direct, but it simply concatenates features of different granularities before calculation, which may lead to insufficient interaction between features.
[0036] like Figure 2As shown, the second approach involves using a Transformer model to perform feature interactions and other network learning at the same granularity. This method can be viewed as a local domain matching, lacking cross-domain matching. Although it considers the correlation between different granularities, it may overlook the utilization of some important information, thus hindering the model's generalization ability.
[0037] Therefore, further research and improvements are needed to further improve the relevance of information search and the accuracy of click probability calculation.
[0038] This application provides a data processing method. By performing feature extraction on the retrieved data and the data to be matched, multi-granularity text features can be obtained. Further transformation processing of these multi-granularity text features yields more representative feature vectors. This processing method can more accurately capture the semantic and text sequence information of the data, providing a more reliable foundation for subsequent matching. By interactively processing the first feature vector and the second feature vector, semantically related vectors and text matching vectors can be obtained. This interactive processing method can comprehensively consider the differences between semantics and text sequence, thereby more comprehensively evaluating the similarity between the retrieved data and the data to be matched. By fusing the semantically related vector and the text matching vector, a fused vector can be obtained. This fusion method can comprehensively consider the information of different feature vectors, resulting in a more consistent vector representation. Determining the matching result between the retrieved data and the data to be matched based on the fused vector can more accurately reflect the similarity between the two. This matching method can better handle feature interaction and fusion between different granularities, thereby improving the accuracy and relevance of information search.
[0039] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the priority of the embodiments.
[0040] Please see Figures 3 to 4 , Figure 3 This is a flowchart illustrating the data processing method provided in an embodiment of this application. Figure 4 This is a schematic diagram illustrating an application scenario of the data processing method provided in this application embodiment. The method includes the following steps 110 to 160:
[0041] Step 110: Obtain the search data and the data to be matched.
[0042] In this context, retrieval data (Query) typically consists of user-inputted query information, the purpose of which is to find content related to the query information from the data to be matched. Retrieval data (Query) can take various forms, including but not limited to text data, image data, and video data.
[0043] Text data: This is the most common type of query, where users directly enter keywords or phrases to search.
[0044] Image data: When a user uploads an image as query information, the system needs to understand the image content using image recognition technology and convert it into text information for further processing. For example, optical character recognition (OCR) technology can identify text from an image; semantic recognition can understand the theme and content of the image.
[0045] Video data: When a user uploads a video as query information, the system needs to understand the video content using video processing technology and convert it into text information for further processing. This typically involves more complex computer vision and natural language processing techniques.
[0046] Among them, the data to be matched (Doc) is the information resource that the system needs to search, and its form can be diverse, including but not limited to document data, image data and video data.
[0047] Document data: This typically refers to textual information on the internet, such as a piece of text, an article, or a webpage. Search engines need to build large-scale document databases to search and match based on user queries.
[0048] Image and video data: These two data formats increase the complexity of the search because they require image recognition and video processing techniques to understand the content of images and videos. For example, for image data, it may be necessary to use OCR technology to recognize text in the image, or to understand the subject of the image through semantic recognition; for video data, more complex time-series information needs to be processed to understand the content and semantics of the video.
[0049] Step 120: Perform feature extraction processing on the retrieved data and the data to be matched respectively to obtain the first multi-granularity text features corresponding to the retrieved data and the second multi-granularity text features corresponding to the data to be matched.
[0050] In some embodiments, the step of performing feature extraction processing on the retrieved data and the data to be matched respectively to obtain a first multi-granularity text feature corresponding to the retrieved data and a second multi-granularity text feature corresponding to the data to be matched includes:
[0051] The retrieved data is subjected to feature extraction processing to obtain the first multi-granularity text features corresponding to the retrieved data. The first multi-granularity text features include first character features, first word segmentation features and first tuple features.
[0052] Perform feature extraction processing on the to-be-matched data respectively to obtain the second multi-granularity text feature corresponding to the to-be-matched data, where the second multi-granularity text feature includes a second word segmentation feature and a second multi-tuple feature.
[0053] Among them, the second word segmentation feature may include a second title word segmentation feature and a second summary word segmentation feature, and the second multi-tuple feature may include a second title multi-tuple feature and a second summary multi-tuple feature.
[0054] Step 120 is a key step in text feature extraction. It involves feature extraction of retrieval data and to-be-matched data to obtain their multi-granularity text features. These features can reflect information such as the semantics and structure of the text, providing strong support for subsequent text matching and information retrieval.
[0055] Specifically, in step 120, first perform feature extraction processing on the retrieval data to obtain the first multi-granularity text feature corresponding to the retrieval data. The first multi-granularity text feature includes a first character feature, a first word segmentation feature, and a first multi-tuple feature.
[0056] First character feature: This is the most basic text feature, which is extracted based on each character in the text. For example, corresponding to the retrieval data "immersive food tasting", the following first character features can be obtained: "沉", "浸", "式", "吃", "美", "食".
[0057] First word segmentation feature: Word segmentation is to split continuous text into individual words or phrases. The first word segmentation feature is extracted based on these split words or phrases. For example, corresponding to the retrieval data "immersive food tasting", the following first word segmentation features can be obtained: "immersive", "eat", "delicious food".
[0058] First multi-tuple feature: This is a more advanced text feature, which is extracted based on multiple elements in the text. For example, binary tuples (two words), ternary tuples (three words), etc. can be extracted. For example, corresponding to the retrieval data "immersive food tasting", if binary tuples are extracted, the following first multi-tuple features can be obtained: "immersion", "immersive", "sive eat", "eat delicious", "delicious food". If ternary tuples are extracted, the following first multi-tuple features can be obtained: "immersive", "immersive eat", "eat delicious food".
[0059] As Figure 4 shown, query_char represents the first character feature, query_basic represents the first word segmentation feature, and query_bigram represents the first multi-tuple feature. [[ID= 24]]
[0060] Similarly, feature extraction is performed on the data to be matched to obtain the second multi-granularity text features corresponding to the data to be matched. The second multi-granularity text features include the second word segmentation features and the second tuple features.
[0061] The second word segmentation feature: Similar to the first word segmentation feature, the data to be matched is segmented to obtain the second word segmentation feature. This second word segmentation feature can be further refined into a second title word segmentation feature and a second summary word segmentation feature. The second title word segmentation feature focuses on the title portion of the data to be matched, extracting unique word segmentation information from the title; the second summary word segmentation feature targets the summary or brief description portion of the data to be matched, capturing the word segmentation features of this portion.
[0062] Second tuple features: Similar to the first tuple features, these are also extracted from the data to be matched based on word segmentation results. The second tuple features can be further refined into second title tuple features and second summary tuple features. These respectively delve into the word combinations and association patterns in the title and summary, providing a rich information foundation for subsequent accurate matching.
[0063] like Figure 4 As shown, taking the title part of the data to be matched as an example, title_bigram represents the second title tuple feature, and title_basic represents the second title word segmentation feature.
[0064] For example, the feature extraction process can be further refined. Different processing methods can be applied to different characteristics of the retrieved data and the data to be matched. For image or video data, image recognition or video processing may be performed first to obtain the corresponding text information, and then feature extraction may be performed based on the text information. For document data, preprocessing steps such as word segmentation and part-of-speech tagging may be required first.
[0065] For example, each character feature, each word segmentation feature, and each tuple feature in multi-granular text features can be used as the smallest unit of input to the model, which can be referred to as the element term below.
[0066] Step 130: Perform feature transformation processing on the first multi-granularity text feature and the second multi-granularity text feature respectively to obtain the first feature vector corresponding to the retrieved data and the second feature vector corresponding to the data to be matched. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector.
[0067] In some embodiments, performing feature transformation processing on the first multi-granularity text features and the second multi-granularity text features respectively to obtain a first feature vector corresponding to the retrieved data and a second feature vector corresponding to the data to be matched includes:
[0068] The first multi-granularity text features are subjected to feature transformation processing to obtain a first feature vector corresponding to the retrieved data. The first feature vector includes a first semantic vector and a first text sequence vector.
[0069] The second multi-granularity text features are subjected to feature transformation processing to obtain the second feature vector corresponding to the data to be matched. The second feature vector includes a second semantic vector and a second text sequence vector.
[0070] In some embodiments, the feature transformation processing of the first multi-granularity text features to obtain a first feature vector corresponding to the retrieved data, wherein the first feature vector includes a first semantic vector and a first text sequence vector, including:
[0071] The first multi-granularity text features are subjected to feature transformation processing to generate first sequence information, which includes a first character semantic vector, a first word segmentation semantic vector, a first tuple semantic vector, a first character text sequence vector, a first word segmentation text sequence vector, and a first tuple text sequence vector.
[0072] The first character semantic vector, the first word segmentation semantic vector, and the first tuple semantic vector are concatenated to obtain the first semantic vector.
[0073] The first character text sequence vector, the first word segmentation text sequence vector, and the first tuple text sequence vector are concatenated to obtain the first text sequence vector.
[0074] The first network expression layer can be implemented using a separate transformer layer, which is a non-shared transformer layer.
[0075] For example, inputting the first multi-granularity text features into the first network expression layer yields the first sequence information, which includes the first character semantic vector (query_char_cls, or...). Figure 4 The first segmentation semantic vector (query_basic_cls, or q_char_cls) in the query_basic_cls, or Figure 4 The first tuple semantic vector (query_bigram_cls, or q_basic_cls) in the query_bigram_cls, or Figure 4 The first character text sequence vector (query_char_seq, or q_bigram_cls) in the query_bigram_cls is the first character text sequence vector. Figure 4 The first segmented text sequence vector (query_basic_seq, or q_char_seq) in the first segmented text sequence vector (query_basic_seq, or Figure 4 The q_basic_seq and the first tuple text sequence vector (query_bigram_seq, or Figure 4 (q_bigram_seq in the original text).
[0076] For example, this can be achieved using the following first set of code:
[0077] # Modeling query-related first sequence information using a transformer
[0078] query_char_cls,query_char_seq=
[0079] trans_representation(query_char_embedding_vecs,query_char_mask,
[0080] "query_char")
[0081] query_basic_cls,query_basic_seq=
[0082] trans_representation(query_basic_embedding_vecs,query_basic_mask,"query_basic")
[0083] query_bigram_cls,query_bigram_seq=
[0084] trans_representation(query_bigram_embedding_vecs,query_bigram_mask,"query_bigram")
[0085] Regarding the first set of code above, `trans_representation` is a function that accepts three parameters. The first line of code queries information at the character (char) level.
[0086] `query_char_embedding_vecs` represents the embedding vector of the character-level query sequence. `query_char_mask` represents the mask of the character-level query sequence. `query_char` represents the first character feature. The first line of code returns two values: the first character semantic vector (`query_char_cls`) and the first character text sequence vector (`query_char_seq`).
[0087] The second line of code is similar to the first, but it provides information at the basic query level. `query_basic_embedding_vecs` represents the embedding vector of the query sequence at the basic level. `query_basic_mask` represents the mask of the query sequence at the basic level. `query_basic` represents the first-level segmentation feature. The second line of code returns two values: the first-level segmentation semantic vector (`query_basic_cls`) and the first-level segmentation text sequence vector (`query_basic_seq`).
[0088] The third line of code is similar to the first two lines, but it provides information at the bigram query level. `query_bigram_embedding_vecs` represents the embedding vector of the query sequence at the bigram level. `query_bigram_mask` represents the mask of the query sequence at the bigram level. `query_bigram` represents the first bigram feature. The third line of code returns two values: the first bigram semantic vector (`query_bigram_cls`) and the first bigram text sequence vector (`query_bigram_seq`).
[0089] Overall, this code uses a function `trans_representation` to generate representations of the query sequence at different levels, including character, token, and tuple levels. Each level of representation is passed to the function via its corresponding embedding vector, mask, and label, and the returned semantic vector and text sequence vector are obtained for each element term.
[0090] Then, based on the first network interaction layer, the first character semantic vector, the first word segmentation semantic vector, and the first tuple semantic vector are concatenated to obtain the first concatenated vector. This first concatenated vector is then processed through a deep neural network (Dense tower) with a fully connected layer to obtain the first semantic vector (e.g., ...). Figure 4 (query_for_title in the context of the query_for_title).
[0091] The first character text sequence vector, the first word segmentation text sequence vector, and the first tuple text sequence vector are concatenated (concat) based on the first network interaction layer to obtain the second concatenated vector. Then, the second concatenated vector is processed by a deep neural network (Dense tower) with full connection (Dense) to obtain the first text sequence vector.
[0092] In some embodiments, the feature transformation processing of the second multi-granularity text features to obtain a second feature vector corresponding to the data to be matched, wherein the second feature vector includes a second semantic vector and a second text sequence vector, including:
[0093] The second multi-granularity text features are subjected to feature transformation processing to generate second sequence information. The second sequence information includes a second title word segmentation semantic vector, a second title plural semantic vector, a second summary word segmentation semantic vector, a second summary plural semantic vector, a second title word segmentation text sequence vector, a second title plural text sequence vector, a second summary word segmentation text sequence vector, and a second summary plural text sequence vector.
[0094] The second title semantic vector is obtained by concatenating the second title word segment semantic vector and the second title tuple semantic vector, and the second summary semantic vector is obtained by concatenating the second summary word segment semantic vector and the second summary tuple semantic vector, wherein the second semantic vector is determined by the second title semantic vector and the second summary semantic vector.
[0095] The second title text sequence vector is obtained by concatenating the second title segmented text sequence vector with the second title tuple text sequence vector, and the second summary text sequence vector is obtained by concatenating the second summary segmented text sequence vector with the second summary tuple text sequence vector. The second text sequence vector is determined by the second title text sequence vector and the second summary text sequence vector.
[0096] The second network expression layer can be implemented using a separate transformer layer, which is a non-shared transformer layer.
[0097] For example, inputting the second multi-granularity text features into the second network expression layer yields the second sequence information, which includes the second title segmentation semantic vector (doc_tagtitle_basic_cls, or...). Figure 4The t_basic_cls in the second heading tuple semantic vector (doc_tagtitle_bigram_cls, or Figure 4 t_bigram_cls), second summary word segmentation semantic vector
[0098] (doc_summary_basic_cls), second summary tuple semantic vector
[0099] (doc_summary_bigram_cls), second title segmented text sequence vector (doc_tagtitle_basic_seq, or Figure 4 The t_basic_seq in the second heading tuple text sequence vector (doc_tagtitle_bigram_seq, or Figure 4 The second summary segmented text sequence vector (doc_summary_basic_seq) and the second summary tuple text sequence vector (doc_summary_bigram_seq) are included.
[0100] For example, this can be achieved using the following second set of code:
[0101] # Modeling second-sequence information related to the doc side using a transformer
[0102] doc_summary_basic_cls,doc_summary_basic_seq=
[0103] trans_representation(text_summary_basic_embedding,doc_summary_basic_mask,"doc_summary_basic")
[0104] doc_summary_bigram_cls,doc_summary_bigram_seq=
[0105] trans_representation(text_summary_bigram_embedding,doc_summary_bigram_mask,"doc_summary_bigram")
[0106] doc_tagtitle_basic_cls,doc_tagtitle_basic_seq=
[0107] trans_representation(text_tagtitle_basic_embedding,doc_tagtitle_basic_mask,"doc_tagtitle_basic")
[0108] doc_tagtitle_bigram_cls,doc_tagtitle_bigram_seq=
[0109] trans_representation(text_tagtitle_bigram_embedding,doc_tagtitle_bigram_mask,"doc_tagtitle_bigram")
[0110] The second set of code is similar to the first set, both using the `trans_representation` function to model the query sequence or document sequence. The following is a detailed explanation of the second set of code:
[0111] 1) Modeling at the summary word segmentation level:
[0112] The second summary segmentation semantic vector (doc_summary_basic_cls) and the second summary segmentation text sequence vector (doc_summary_basic_seq) are the two values returned by the function.
[0113] text_summary_basic_embedding can represent a summary word segmentation-level embedding vector.
[0114] doc_summary_basic_mask: can represent a summary word segmentation level mask.
[0115] doc_summary_basic can represent the second summary segmentation feature.
[0116] 2) Modeling at the summary tuple level:
[0117] The second summary tuple semantic vector (doc_summary_bigram_cls) and the second summary tuple text sequence vector (doc_summary_bigram_seq) are the two values returned by the function.
[0118] text_summary_bigram_embedding can represent a summary tuple-level embedding vector.
[0119] doc_summary_bigram_mask: can represent a summary tuple-level mask.
[0120] doc_summary_bigram can represent the features of a second summary tuple.
[0121] 3) Modeling at the title word segmentation level:
[0122] The second title segmentation semantic vector (doc_tagtitle_basic_cls) and the second title segmentation text sequence vector (doc_tagtitle_basic_seq) are the two values returned by the function.
[0123] text_tagtitle_basic_embedding can represent the embedding vector at the title word segmentation level.
[0124] `doc_tagtitle_basic_mask` can represent a mask at the title segmentation level.
[0125] doc_tagtitle_basic can represent the word segmentation features of the second title.
[0126] 4) Modeling at the title tuple level:
[0127] The second heading tuple semantic vector (doc_tagtitle_bigram_cls) and the second heading tuple text sequence vector (doc_tagtitle_bigram_seq) are the two values returned by the function.
[0128] text_tagtitle_bigram_embedding can represent the embedding vector at the title tuple level.
[0129] `doc_tagtitle_bigram_mask` can represent a mask at the title tuple level.
[0130] `doc_tagtitle_bigram` can represent the tuple features of the second heading.
[0131] The second set of code models different levels of sequence information on the data to be matched (Doc), including summary tokenization, summary tuples, title tokenization, and title tuples. Each level of text is processed using the `trans_representation` function, which returns the semantic vector and text sequence vector for each element term.
[0132] Then, based on the second network interaction layer, the semantic vector of the second title segmentation and the semantic vector of the second title tuple are concatenated to obtain the third concatenated vector. This third concatenated vector is then processed through a fully connected deep neural network (Densetower) to obtain the semantic vector of the second title (e.g., ...). Figure 4 The second summary semantic vector is obtained by concatenating the second summary word segment semantic vector and the second summary tuple semantic vector. Then, the fourth concatenated vector is processed by a deep neural network (Dense tower) to obtain the second summary semantic vector. The second semantic vector is determined by the second title semantic vector and the second summary semantic vector.
[0133] The second title text sequence vector is concatenated with the second title tuple text sequence vector using the second network interaction layer to obtain the fifth concatenated vector. Then, the fifth concatenated vector is processed by a deep neural network (Dense tower) through a fully connected (Dense) layer to obtain the second title text sequence vector. Similarly, the second summary text sequence vector is concatenated with the second summary tuple text sequence vector to obtain the sixth concatenated vector. Then, the sixth concatenated vector is processed by a deep neural network (Dense tower) through a fully connected (Dense) layer to obtain the second summary text sequence vector. The second text sequence vector is determined by the second title text sequence vector and the second summary text sequence vector.
[0134] In step 130, the semantic expressions corresponding to all granular text features of the retrieved data (Query) and the semantic expressions corresponding to all granular text features of the title and summary parts of the data to be matched (Doc) can be obtained through the network expression layer. These are then concatenated and processed through a fully connected deep neural network (Dense tower) to obtain the first semantic vector (e.g., Figure 4 The query_for_title in the second title semantic vector (e.g.) Figure 4 The semantic vectors (doc_title_cls) and the second summary semantic vector are used to further enhance the semantic information of the data. In the subsequent matching process, these enhanced semantic vectors can be used to improve the matching accuracy and provide users with results that better meet their needs.
[0135] For example, to generate the first semantic vector (query_for_title) and the second title semantic vector (doc_title_cls), this can be achieved using the following third set of code:
[0136] query_cls_list=[query_basic_cls,query_bigram_cls,query_char_cls]#concat
[0137] doc_title_cls_list=[doc_tagtitle_basic_cls,doc_tagtitle_bigram_cls]#
[0138] concat
[0139] query_for_title=DenseTower(query_cls_list)
[0140] doc_title_cls=DenseTower(doc_title_cls_list)
[0141] Regarding the third set of code mentioned above, the first character semantic vector (query_char_cls), the first word segmentation semantic vector (query_basic_cls), and the first bigram semantic vector (query_bigram_cls) are concatenated to obtain the first concatenated vector (query_cls_list). Then, the first concatenated vector (query_cls_list) is processed through a fully connected deep neural network (Dense tower) to obtain the first semantic vector (query_for_title). The second title word segmentation semantic vector (doc_tagtitle_basic_cls) and the second title bigram semantic vector are then processed.
[0142] (doc_tagtitle_bigram_cls) are concatenated to obtain the third concatenated vector (doc_title_cls_list). Then, the third concatenated vector (doc_title_cls_list) is processed by a deep neural network (Densetower) with a fully connected (Dense) connection to obtain the second title semantic vector (doc_title_cls).
[0143] Step 140: Perform interactive processing on the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector.
[0144] For example, the first feature vector and the second feature vector can be interactively processed based on the network interaction layer to obtain semantically related vectors and text matching vectors.
[0145] In some embodiments, the step of interactively processing the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector includes:
[0146] The absolute value of the difference between the first semantic vector and the second semantic vector is calculated to obtain the semantic relevance vector, which is used to indicate the degree of semantic relevance between the retrieved data and the data to be matched.
[0147] The first text sequence vector and the second text sequence vector are matched to obtain the text matching vector, which is used to indicate the degree of matching between the retrieved data and the data to be matched.
[0148] In some embodiments, performing the absolute difference operation on the first semantic vector and the second semantic vector to obtain the semantically related vector includes:
[0149] Perform the absolute value operation on the difference between the first semantic vector and the second title semantic vector to obtain the title semantic related vector;
[0150] Perform the absolute value operation on the difference between the first semantic vector and the second summary semantic vector to obtain the summary semantic related vector.
[0151] like Figure 4 As shown, when calculating the matching of the title portion of the retrieved data (Query) and the data to be matched (Doc), the absolute value of the difference between the first semantic vector (query_for_title) and the second title semantic vector (doc_title_cls) is calculated to obtain the title semantic relevance vector, which is represented as |query_for_title-doc_title_cls|.
[0152] When calculating the match between the retrieved data (Query) and the summary portion of the data to be matched (Doc), the entire processing logic is similar to... Figure 4 The processing logic shown is similar: the absolute value of the difference between the first semantic vector and the second summary semantic vector is calculated to obtain the summary semantic related vector.
[0153] In some embodiments, the step of matching the first text sequence vector with the second text sequence vector to obtain the text matching vector includes:
[0154] The first text sequence vector and the second title text sequence vector are matched to obtain a title text matching vector, which includes a title word segmentation text matching vector and a title tuple text matching vector.
[0155] The first text sequence vector and the second summary text sequence vector are matched to obtain a summary text matching vector, which includes a summary word segmentation text matching vector and a summary tuple text matching vector.
[0156] In some embodiments, the step of matching the first text sequence vector with the second text sequence vector to obtain the text matching vector includes:
[0157] Generate an element alignment matrix based on the first text sequence vector and the second text sequence vector;
[0158] The element alignment matrix is processed to obtain a numerical matrix;
[0159] The numerical matrix is processed to obtain the label matrix;
[0160] The matching matrix is determined based on the element comparison matrix, the numerical matrix, and the tag matrix;
[0161] The first text sequence vector is weighted and scored according to the first semantic vector to obtain the weight sequence corresponding to the first text sequence vector.
[0162] The weight sequence and the matching matrix are weighted and summed to obtain the text matching vector.
[0163] Specifically, an element alignment matrix is generated based on the first text sequence vector and the second text sequence vector.
[0164] like Figure 4 As shown, when calculating the matching of the title portion of the retrieved data (Query) and the data to be matched (Doc), the term information of each granularity element in the first text sequence vector of the retrieved data (Query) (such as the first character text sequence vector q_char_seq, the first word segmentation text sequence vector q_basic_seq, and the first tuple text sequence vector q_bigram_seq) is combined with the term information of all granularities of the title portion of the data to be matched (Doc) [the second title word segmentation text sequence vector t_basic_seq, the second title tuple text sequence vector t_bigram_seq] and a difference subtraction operation is performed to generate the element-wise comparison matrix corresponding to the title portion. Figure 4 As shown, qi is the i-th term of q_basic_seq on the query side, and it is subtracted from each term of the title part t.
[0165] When calculating the match between the retrieved data (Query) and the summary portion of the data to be matched (Doc), the processing logic and... Figure 4 Similarly, the term information of each granularity element in the first text sequence vector of the retrieval data (e.g., the first character text sequence vector q_char_seq, the first word segmentation text sequence vector q_basic_seq, and the first tuple text sequence vector q_bigram_seq) is combined with the term information of all granularities of the summary part of the data to be matched (Doc) [second summary word segmentation text sequence vector, second summary tuple text sequence vector] and the difference subtraction operation is performed to generate the element comparison matrix corresponding to the summary part.
[0166] The element-wise alignment matrix can then be input into the residual neural network layer for processing to obtain a numerical matrix. For example, this residual neural network layer can be implemented using high-speed neural networks such as HighwayMLP or Highway Networks. This residual neural network layer is used to prevent the network from becoming too deep and to avoid gradient vanishing.
[0167] Then, the numerical matrix is processed to obtain the tag matrix. Specifically, for each qi in the numerical matrix, a maximum value (MAX) operation is performed at the horizontal granularity to obtain a numerical matrix after the MAX operation. For example, num13, num22, num33, and numi1 in the numerical matrix after the MAX operation are the maximum values at the horizontal granularity. One-hot encoding is then performed on the numerical matrix after the MAX operation to obtain the corresponding index subscripts. After traversing and processing, a tag matrix containing all index subscripts is obtained. Here, the maximum value is 1, and other values are 0. The position corresponding to the value 1 is considered to be the most likely matching element (term) position of qi in the title part of the q query.
[0168] Then, based on the element alignment matrix, the numerical matrix, and the tag matrix, the matching matrix is determined. Specifically, the corresponding positions of the numerical matrix and the element alignment matrix are determined based on the tag matrix. Then, the numerical matrix obtained by multiplying the element alignment matrix with the maximum value (MAX) at the corresponding positions yields the matching matrix (q_term_diff). Figure 4 As shown, the resulting matching matrix includes the following elements: q1-t3, q2-t2, q3-t3, qi-t1.
[0169] Then, the first text sequence vector is weighted according to the first semantic vector to obtain the weight sequence corresponding to the first text sequence vector. Specifically, the weights of each term in the first text sequence vector are weighted according to each granularity element in the first semantic vector to obtain the weight sequence corresponding to the first text sequence vector. The specific calculation formula is as follows:
[0170]
[0171] Where, α i,t Represents the weight sequence; cls·term i This represents the granularity elements term in the first semantic vector cls and the first text sequence vector. i The inner product operation is performed by combining the granularity elements of the first semantic vector cls with the granularity elements term of the first text sequence vector. i The summation is obtained by multiplying each element by itself; exp() represents the exponential function; ∑ represents the summation function.
[0172] Then, for the weight sequence α i,t The text matching vector is obtained by performing a weighted summation with the matching matrix (q_term_diff).
[0173] like Figure 4 As shown, for the title part, the title text matching vector is obtained by matching the first text sequence vector with the second title text sequence vector. This title text matching vector includes the title word segmentation text matching vector (query basic hit match) and the title tuple text matching vector (query bigram hit match).
[0174] For the summary section, the first text sequence vector and the second summary text sequence vector are matched to obtain the summary text matching vector, which includes the summary word segmentation text matching vector and the summary tuple text matching vector.
[0175] Step 150: Perform vector fusion on the semantic related vector and the text matching vector to obtain a fused vector.
[0176] In some embodiments, the step of fusing the semantically related vector and the text matching vector to obtain a fused vector includes:
[0177] The title semantic relevance vector and the title text matching vector are fused to obtain the title fusion vector;
[0178] The summary semantic related vector and the summary text matching vector are fused to obtain the summary fused vector.
[0179] For example, a simple concatenation (concat) of semantically related vectors and text matching vectors can be used to achieve vector fusion and obtain a fused vector.
[0180] like Figure 4 As shown, for the title section, the title semantic relevance vector and the title text matching vector are fused to obtain the title fused vector. This can be implemented using the following code:
[0181] query_title_match=concat(|query_for_title-doc_title_cls|,query basichit match,query bigram hit match)
[0182] In the code above, query_title_match represents the title fusion vector.
[0183] |query_for_title-doc_title_cls| represents the semantic relevance vector of the title, query basic hitmatch represents the title word segmentation text matching vector, and query bigram hitmatch represents the title tuple text matching vector.
[0184] For the summary section, the summary semantic related vector and the summary text matching vector are fused to obtain the summary fused vector.
[0185] Step 160: Determine the matching result between the retrieved data and the data to be matched based on the fusion vector.
[0186] After the fusion vector is calculated, it is fed into a subsequent network. This subsequent network, which may be a deep learning network, is used for further processing and computation. Based on the fusion vector, the network outputs a matching result between the retrieved data (Query) and the data to be matched (Doc), which can be represented as text relevance or click probability.
[0187] Text relevance refers to the content similarity or relevance between the retrieved data and the data to be matched.
[0188] Click probability represents the probability that a user clicks on a search result, which depends on the degree of matching between the search data and the data to be matched, as well as the user's interests and preferences.
[0189] It's important to note that the specific implementation of this step may vary depending on the application scenario and requirements. For example, in a text retrieval system, text relevance might be used to measure the similarity between the search results and the query; while in an advertising system, click probability might be used to measure the degree of match between the ad and the user.
[0190] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0191] This application embodiment obtains retrieval data and matching data; performs feature extraction processing on the retrieval data and matching data respectively to obtain a first multi-granularity text feature corresponding to the retrieval data and a second multi-granularity text feature corresponding to the matching data, thus obtaining text features with multiple granularities; performs feature transformation processing on the first multi-granularity text feature and the second multi-granularity text feature respectively to obtain a first feature vector corresponding to the retrieval data and a second feature vector corresponding to the matching data. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector, thus obtaining more representative feature vectors. This processing method can more effectively... Accurately capturing the semantic and text sequence information of the data provides a more reliable foundation for subsequent matching. Interactive processing of the first and second feature vectors yields a semantically relevant vector and a text matching vector. This interactive processing method comprehensively considers the differences between semantics and text sequence, thus more comprehensively evaluating the similarity between the retrieved data and the data to be matched. Vector fusion of the semantically relevant vector and the text matching vector yields a fused vector. This fusion method comprehensively considers the information from different feature vectors, resulting in a more consistent vector representation. Determining the matching result between the retrieved data and the data to be matched based on the fused vector more accurately reflects the similarity between the two. The embodiments of this application can better handle feature interactions and fusions at different granularities, thereby improving the accuracy and relevance of information retrieval.
[0192] To facilitate better implementation of the data processing method of this application embodiment, this application embodiment also provides a data processing apparatus. Please refer to... Figure 5 , Figure 5 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application. The data processing apparatus 200 may include:
[0193] The acquisition unit 210 is used to acquire the search data and the data to be matched;
[0194] Extraction unit 220 is used to perform feature extraction processing on the retrieved data and the data to be matched respectively to obtain the first multi-granularity text feature corresponding to the retrieved data and the second multi-granularity text feature corresponding to the data to be matched.
[0195] The conversion unit 230 is used to perform feature conversion processing on the first multi-granularity text feature and the second multi-granularity text feature respectively to obtain a first feature vector corresponding to the retrieved data and a second feature vector corresponding to the data to be matched. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector.
[0196] The interaction unit 240 is used to interact with the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector.
[0197] The fusion unit 250 is used to perform vector fusion on the semantically related vector and the text matching vector to obtain a fusion vector;
[0198] The determining unit 260 is used to determine the matching result between the retrieved data and the data to be matched based on the fusion vector.
[0199] In some embodiments, the extraction unit 220 may be used to: perform feature extraction processing on the retrieved data to obtain a first multi-granularity text feature corresponding to the retrieved data, wherein the first multi-granularity text feature includes a first character feature, a first word segmentation feature and a first tuple feature; and perform feature extraction processing on the data to be matched to obtain a second multi-granularity text feature corresponding to the data to be matched, wherein the second multi-granularity text feature includes a second word segmentation feature and a second tuple feature.
[0200] In some embodiments, the conversion unit 230 may be used to: perform feature conversion processing on the first multi-granularity text features to obtain a first feature vector corresponding to the retrieved data, wherein the first feature vector includes a first semantic vector and a first text sequence vector; perform feature conversion processing on the second multi-granularity text features to obtain a second feature vector corresponding to the data to be matched, wherein the second feature vector includes a second semantic vector and a second text sequence vector.
[0201] In some embodiments, the conversion unit 230 can be used to: perform feature conversion processing on the first multi-granularity text features to generate first sequence information, the first sequence information including a first character semantic vector, a first word segmentation semantic vector, a first tuple semantic vector, a first character text sequence vector, a first word segmentation text sequence vector, and a first tuple text sequence vector; perform concatenation processing on the first character semantic vector, the first word segmentation semantic vector, and the first tuple semantic vector to obtain the first semantic vector; and perform concatenation processing on the first character text sequence vector, the first word segmentation text sequence vector, and the first tuple text sequence vector to obtain the first text sequence vector.
[0202] In some embodiments, the conversion unit 230 can be used to: perform feature conversion processing on the second multi-granularity text features to generate second sequence information, the second sequence information including a second title segmentation semantic vector, a second title plural semantic vector, a second summary segmentation semantic vector, a second summary plural semantic vector, a second title segmentation text sequence vector, a second title plural text sequence vector, a second summary segmentation text sequence vector, and a second summary plural text sequence vector; perform concatenation processing on the second title segmentation semantic vector and the second title plural semantic vector to obtain a second title semantic vector, and perform concatenation processing on the second summary segmentation semantic vector and the second summary plural semantic vector to obtain a second summary semantic vector, wherein the second semantic vector is determined by the second title semantic vector and the second summary semantic vector; perform concatenation processing on the second title segmentation text sequence vector and the second title plural text sequence vector to obtain a second title text sequence vector, and perform concatenation processing on the second summary segmentation text sequence vector and the second summary plural text sequence vector to obtain a second summary text sequence vector, wherein the second text sequence vector is determined by the second title text sequence vector and the second summary text sequence vector.
[0203] In some embodiments, the interaction unit 240 may be used to: perform an absolute difference operation on the first semantic vector and the second semantic vector to obtain the semantic relevance vector, wherein the semantic relevance vector is used to indicate the degree of semantic relevance between the retrieved data and the data to be matched; and perform matching processing on the first text sequence vector and the second text sequence vector to obtain the text matching vector, wherein the text matching vector is used to indicate the degree of matching between the retrieved data and the data to be matched.
[0204] In some embodiments, when the interaction unit 240 performs matching processing on the first text sequence vector and the second text sequence vector to obtain the text matching vector, it can be used to: generate an element comparison matrix based on the first text sequence vector and the second text sequence vector; process the element comparison matrix to obtain a numerical matrix; process the numerical matrix to obtain a tag matrix; determine a matching matrix based on the element comparison matrix, the numerical matrix, and the tag matrix; assign weight scores to the first text sequence vector based on a first semantic vector to obtain a weight sequence corresponding to the first text sequence vector; and perform weighted summation processing on the weight sequence and the matching matrix to obtain the text matching vector.
[0205] In some embodiments, when the interaction unit 240 performs matching processing on the first text sequence vector and the second text sequence vector to obtain the text matching vector, it can be used to: perform matching processing on the first text sequence vector and the second title text sequence vector to obtain a title text matching vector, wherein the title text matching vector includes a title word segmentation text matching vector and a title tuple text matching vector; and perform matching processing on the first text sequence vector and the second summary text sequence vector to obtain a summary text matching vector, wherein the summary text matching vector includes a summary word segmentation text matching vector and a summary tuple text matching vector.
[0206] In some embodiments, the interaction unit 240 can perform the absolute difference operation between the first semantic vector and the second semantic vector to obtain the semantically related vector, which can be used to: perform the absolute difference operation between the first semantic vector and the second title semantic vector to obtain the title semantically related vector; and perform the absolute difference operation between the first semantic vector and the second summary semantic vector to obtain the summary semantically related vector.
[0207] In some embodiments, the fusion unit 250 may be used to: perform vector fusion on the title semantic related vector and the title text matching vector to obtain a title fusion vector; and perform vector fusion on the summary semantic related vector and the summary text matching vector to obtain a summary fusion vector.
[0208] All of the above technical solutions can be combined in any way to form optional embodiments of this application, and will not be described in detail here.
[0209] It should be understood that the data processing apparatus embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details are omitted here. Specifically, Figure 5 The data processing apparatus shown can execute the above-described data processing method embodiments, and the aforementioned and other operations and / or functions of each unit in the data processing apparatus respectively implement the corresponding processes of the above-described method embodiments. For the sake of brevity, they will not be described in detail here.
[0210] Optionally, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0211] Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device may be a terminal or a server. Figure 6As shown, the computer device 300 may include: a communication interface 301, a memory 302, a processor 303, and a communication bus 304. The communication interface 301, memory 302, and processor 303 communicate with each other via the communication bus 304. The communication interface 301 is used for data communication between the computer device 300 and external devices. The memory 302 can be used to store software programs and modules, and the processor 303 runs the software programs and modules stored in the memory 302, such as the software programs for the corresponding operations in the foregoing method embodiments.
[0212] Optionally, the processor 303 can invoke software programs and modules stored in the memory 302 to perform the following operations:
[0213] The process involves: acquiring retrieval data and matching data; performing feature extraction on the retrieval data and matching data to obtain a first multi-granularity text feature corresponding to the retrieval data and a second multi-granularity text feature corresponding to the matching data; performing feature transformation on the first multi-granularity text feature and the second multi-granularity text feature to obtain a first feature vector corresponding to the retrieval data and a second feature vector corresponding to the matching data, wherein the first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector; performing interactive processing on the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector; performing vector fusion on the semantically related vector and the text matching vector to obtain a fusion vector; and determining the matching result between the retrieval data and the matching data based on the fusion vector.
[0214] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0215] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of computer programs that can be loaded by a processor to execute the steps of any of the data processing methods provided in embodiments of this application. Specific implementations of the above operations can be found in the preceding embodiments and will not be repeated here.
[0216] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0217] Since the computer program stored in the storage medium can execute the steps of any of the data processing methods provided in the embodiments of this application, the beneficial effects that any of the data processing methods provided in the embodiments of this application can achieve can be realized. For details, please refer to the previous embodiments, which will not be repeated here.
[0218] This application also provides a computer program product including 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 corresponding process in any of the data processing methods described in this application. For simplicity, further details are omitted here.
[0219] This application also provides a computer program comprising 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 corresponding process in any of the data processing methods described in this application. For brevity, further details are omitted here.
[0220] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0221] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0222] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0223] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0224] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0225] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0226] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0227] Furthermore, the functional units in the embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a terminal device (which can be a personal computer or a server) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0228] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, The method includes: Retrieve search data and data to be matched; Feature extraction processing is performed on the retrieved data and the data to be matched respectively to obtain the first multi-granularity text features corresponding to the retrieved data and the second multi-granularity text features corresponding to the data to be matched; The first multi-granularity text features and the second multi-granularity text features are respectively subjected to feature transformation processing to obtain a first feature vector corresponding to the retrieved data and a second feature vector corresponding to the data to be matched. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector. The first feature vector and the second feature vector are interactively processed to obtain a semantically related vector and a text matching vector; The semantically related vector and the text matching vector are fused to obtain a fused vector; The matching result between the retrieved data and the data to be matched is determined based on the fusion vector.
2. The data processing method as described in claim 1, characterized in that, The step of performing feature extraction processing on the retrieved data and the data to be matched respectively to obtain the first multi-granularity text features corresponding to the retrieved data and the second multi-granularity text features corresponding to the data to be matched includes: The retrieved data is subjected to feature extraction processing to obtain the first multi-granularity text features corresponding to the retrieved data. The first multi-granularity text features include first character features, first word segmentation features and first tuple features. The data to be matched is subjected to feature extraction processing to obtain the second multi-granularity text features corresponding to the data to be matched. The second multi-granularity text features include the second word segmentation features and the second tuple features.
3. The data processing method as described in claim 2, characterized in that, The step of performing feature transformation processing on the first multi-granularity text features and the second multi-granularity text features respectively to obtain the first feature vector corresponding to the retrieved data and the second feature vector corresponding to the data to be matched includes: The first multi-granularity text features are subjected to feature transformation processing to obtain a first feature vector corresponding to the retrieved data. The first feature vector includes a first semantic vector and a first text sequence vector. The second multi-granularity text features are subjected to feature transformation processing to obtain the second feature vector corresponding to the data to be matched. The second feature vector includes a second semantic vector and a second text sequence vector.
4. The data processing method as described in claim 3, characterized in that, The feature transformation processing of the first multi-granularity text features yields a first feature vector corresponding to the retrieved data. This first feature vector includes a first semantic vector and a first text sequence vector, comprising: The first multi-granularity text features are subjected to feature transformation processing to generate first sequence information, which includes a first character semantic vector, a first word segmentation semantic vector, a first tuple semantic vector, a first character text sequence vector, a first word segmentation text sequence vector, and a first tuple text sequence vector. The first character semantic vector, the first word segmentation semantic vector, and the first tuple semantic vector are concatenated to obtain the first semantic vector. The first character text sequence vector, the first word segmentation text sequence vector, and the first tuple text sequence vector are concatenated to obtain the first text sequence vector.
5. The data processing method as described in claim 3, characterized in that, The feature transformation processing of the second multi-granularity text features yields a second feature vector corresponding to the data to be matched. The second feature vector includes a second semantic vector and a second text sequence vector, comprising: The second multi-granularity text features are subjected to feature transformation processing to generate second sequence information. The second sequence information includes a second title word segmentation semantic vector, a second title plural semantic vector, a second summary word segmentation semantic vector, a second summary plural semantic vector, a second title word segmentation text sequence vector, a second title plural text sequence vector, a second summary word segmentation text sequence vector, and a second summary plural text sequence vector. The second title semantic vector is obtained by concatenating the second title word segment semantic vector and the second title tuple semantic vector, and the second summary semantic vector is obtained by concatenating the second summary word segment semantic vector and the second summary tuple semantic vector, wherein the second semantic vector is determined by the second title semantic vector and the second summary semantic vector. The second title text sequence vector is obtained by concatenating the second title word segment text sequence vector with the second title tuple text sequence vector, and the second summary text sequence vector is obtained by concatenating the second summary word segment text sequence vector with the second summary tuple text sequence vector. The second text sequence vector is determined by the second title text sequence vector and the second summary text sequence vector.
6. The data processing method as described in claim 5, characterized in that, The step of interactively processing the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector includes: The absolute value of the difference between the first semantic vector and the second semantic vector is calculated to obtain the semantic relevance vector, which is used to indicate the degree of semantic relevance between the retrieved data and the data to be matched. The first text sequence vector and the second text sequence vector are matched to obtain the text matching vector, which is used to indicate the degree of matching between the retrieved data and the data to be matched.
7. The data processing method as described in claim 6, characterized in that, The step of matching the first text sequence vector with the second text sequence vector to obtain the text matching vector includes: Generate an element alignment matrix based on the first text sequence vector and the second text sequence vector; The element alignment matrix is processed to obtain a numerical matrix; The numerical matrix is processed to obtain the label matrix; The matching matrix is determined based on the element comparison matrix and the tag matrix; The first text sequence vector is weighted and scored according to the first semantic vector to obtain the weight sequence corresponding to the first text sequence vector. The weight sequence and the matching matrix are weighted and summed to obtain the text matching vector.
8. The data processing method as described in claim 6, characterized in that, The step of matching the first text sequence vector with the second text sequence vector to obtain the text matching vector includes: The first text sequence vector and the second title text sequence vector are matched to obtain a title text matching vector, which includes a title word segmentation text matching vector and a title tuple text matching vector. The first text sequence vector and the second summary text sequence vector are matched to obtain a summary text matching vector, which includes a summary word segmentation text matching vector and a summary tuple text matching vector.
9. The data processing method as described in claim 8, characterized in that, The step of performing the absolute difference operation between the first semantic vector and the second semantic vector to obtain the semantically related vector includes: Perform the absolute value operation on the difference between the first semantic vector and the second title semantic vector to obtain the title semantic related vector; Perform the absolute value operation on the difference between the first semantic vector and the second summary semantic vector to obtain the summary semantic related vector.
10. The data processing method as described in claim 9, characterized in that, The step of fusing the semantically related vector and the text matching vector to obtain a fused vector includes: The title semantic relevance vector and the title text matching vector are fused to obtain the title fusion vector; The summary semantic related vector and the summary text matching vector are fused to obtain the summary fused vector.
11. A data processing apparatus, characterized in that, The device includes: The acquisition unit is used to acquire the search data and the data to be matched. An extraction unit is used to perform feature extraction processing on the retrieved data and the data to be matched, respectively, to obtain a first multi-granularity text feature corresponding to the retrieved data and a second multi-granularity text feature corresponding to the data to be matched; The conversion unit is used to perform feature conversion processing on the first multi-granularity text features and the second multi-granularity text features respectively to obtain a first feature vector corresponding to the retrieved data and a second feature vector corresponding to the data to be matched. The first feature vector includes a first semantic vector and a first text sequence vector, and the second feature vector includes a second semantic vector and a second text sequence vector. An interaction unit is used to interact with the first feature vector and the second feature vector to obtain a semantically related vector and a text matching vector; A fusion unit is used to perform vector fusion on the semantically related vector and the text matching vector to obtain a fusion vector; The determining unit is used to determine the matching result between the retrieved data and the data to be matched based on the fusion vector.
12. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the data processing method according to any one of claims 1-10 by calling the computer program stored in the memory.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted for loading by a processor to perform the data processing method as described in any one of claims 1-10.
14. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data processing method according to any one of claims 1-10.
Citation Information
Patent Citations
Chinese sentence semantic intelligent matching method and device based on multi-granularity fusion model
CN111310438A
Dual-channel semantic positioning multi-granularity attention mutual enhancement video question answering method and system
CN114020891A