Maternal and infant product emotion marketing strategy optimization method based on RAG technology
By using RAG technology in maternal and infant product marketing combined with emotion analysis and vectorization processing, the problem of lack of emotion analysis and deep semantic understanding in the existing technology is solved, accurate user emotion matching and personalized optimization are achieved, and the accuracy of marketing strategies and information retrieval efficiency are improved.
Patent Information
- Application Number
- CN202510363611.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The lack of sentiment analysis in existing maternal and infant product marketing makes it difficult to provide marketing solutions that meet users' current psychological needs, and the traditional keyword matching and simple text retrieval algorithms lack deep semantic understanding.
Using a method based on RAG technology, combining sentiment analysis and vectorization processing, the UI interface, data acquisition module, document analysis module, sentiment analysis module, vectorization module, query processing module, RAG generation module, strategy output module and vector knowledge database are deployed to achieve accurate user emotion matching and personalized optimization.
Through sentiment analysis and vectorization processing, it is ensured that the recalled knowledge blocks and input needs are not only related to the content, but also meet the emotional needs of users, which enhances strategy adaptability, improves the accuracy of marketing strategies, and improves information storage and retrieval efficiency.
Smart Images

Figure CN119884492A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to a method for optimizing emotional marketing strategies for maternal and infant products based on RAG technology. Background Art
[0002] Currently, maternal and infant product marketing mainly relies on traditional data analysis, user profiling, and rule-based recommendation algorithms. However, these methods have the following shortcomings: Recommendations based on keyword matching: Many e-commerce companies use keyword-based retrieval methods, which makes it difficult to accurately capture users’ emotional tendencies.
[0003] Marketing strategies lacking sentiment analysis: Traditional recommendation systems usually ignore the user’s emotional state and find it difficult to provide marketing plans that meet the user’s current psychological needs.
[0004] Insufficient accuracy of information recall: In large-scale text libraries, traditional technologies often rely on simple TF-IDF or BM25 algorithms for retrieval relevance, lacking deep semantic understanding capabilities. Summary of the invention
[0005] The purpose of the present invention is to provide a method for optimizing emotional marketing strategies for maternal and infant products based on RAG technology, which solves the technical problem of increasing user emotional precision matching and personalized optimization in maternal and infant product marketing by adopting RAG+emotional analysis.
[0006] To achieve the above object, the present invention adopts the following technical solution: A method for optimizing emotional marketing strategies for maternal and infant products based on RAG technology, comprising the following steps: Step 1: Deploy the UI interface, data collection module, document parsing module, sentiment analysis module, vectorization module, query processing module, RAG generation module, strategy output module and vector knowledge database in the architecture of the front-end, cloud platform and data center; the data collection module periodically captures target data from the Internet or the front-end; Step 2: The document parsing module performs format parsing on the target data, converts the target data into a text in a structured text format, and cleans the text to obtain a standardized text; the standardized text is segmented into several text segments according to semantics or a fixed number of words; Step 3: The sentiment analysis module performs sentiment analysis on each text segment, extracts positive, neutral, and negative sentiment labels, analyzes the sentiment intensity indicated by the sentiment labels, and obtains sentiment analysis results; the sentiment analysis results are attached as metadata to each knowledge block in the vector knowledge database; Step 4: The vectorization module uses the embedding algorithm to vectorize the text fragments and stores the processing results in the vector knowledge database; Step 5: The marketing personnel input the demand through the UI interface, and the query processing module pre-processes the demand to obtain the query text, performs sentiment tendency analysis on the query text to obtain the sentiment tone, and fuses the sentiment tone with the demand to obtain the fused text; the query processing module converts the fused text into a vector, performs a similarity search in the vector knowledge database, and recalls the knowledge blocks that match the maternal and infant products and sentiment information; Step 6: The RAG generation module combines the query text with the recalled knowledge blocks, inputs them into the large language model, and uses the large language model to generate an optimization strategy; Step 7: The strategy output module outputs the optimization strategy to the UI interface and displays it to the sales staff. The sales staff inputs feedback through the UI interface and uses the feedback as a target data to update the vector knowledge database according to the methods of steps 2 to 4.
[0007] Preferably, when executing step 1, the specific deployment locations are as follows: Establish the system architecture of front-end, cloud platform and data center; The front-end, cloud platform and data center communicate with each other via the Internet; Deploy the UI interface on the front end; Deploy multiple microservice modules on the cloud platform, including data collection module, document parsing module, sentiment analysis module, vectorization module, query processing module, RAG generation module and strategy output module; Deploy vector knowledge database in data center.
[0008] Preferably, when executing step 2, the following steps are specifically included: Step 2-1: The target data includes documents in PDF, Word and JSON formats. The document parsing module uses corresponding parsing rules for documents in different formats to extract the document content into plain text; retaining key structures, including paragraphs, titles and punctuation; Step 2-2: Remove noise from the extracted text, and remove extra spaces, special symbols, and garbled formatting; Using regular expressions and text preprocessing algorithms to clean the text obtained in step 2-2, including unifying the encoding, punctuation, and capitalization, to obtain standardized text; Step 2-3: Use a fixed word count or semantics to segment the standardized text into several segments. The specific steps are as follows: Step 2-3-1: Use fixed word count segmentation: Assuming that the standardized text contains N words or characters, the length of each block, that is, the fixed number of words is L, then the formula for calculating the number of blocks is as follows: ; Each text fragment It can be expressed as: ; in, Indicates the number, the value is 1, 2, 3, ..., ; Step 2-3-2: Semantic-based segmentation: Generate vector representation for each sentence , calculate the cosine similarity of adjacent sentences: ; Among them, if , then the sentence With sentence There is a big semantic shift in the sentence With sentence Set the block boundaries between them to get the text fragments , is the set threshold; Step 2-3-3: Output standardized text segments: Use the segmented text segments as the basic units for subsequent sentiment analysis and vectorization, retaining metadata, including the original document ID and location information.
[0009] Preferably, when executing step 3, the following steps are included: Step 3-1: The sentiment analysis module retrieves the text segment obtained in step 2 , for each text segment , using a pre-trained language model to obtain contextual representation ; Step 3-2: Contextual representation of text fragments Establish a sentiment model and calculate the sentiment score: ; in, represents the sentiment vector, is the score of positive emotion, is the score of neutral sentiment, is the score for negative emotions; Step 3-3: According to The three scores are selected and the emotion category corresponding to the maximum probability is selected as the final emotion label , the specific formula is as follows: ; in, ; Emotional intensity The calculation formula is as follows: ; Step 3-4: Use the sentiment analysis results of each text segment as metadata and compare them with the text segment and sentiment vector Stored together in the vector knowledge database; sentiment analysis results include sentiment tags and emotional intensity .
[0010] Preferably, when performing step 3-2, The calculation method for expressing the sentiment vector is as follows: Compute linear transformation : ; in, is the weight matrix, is the bias vector; The Softmax function is used to calculate the probability of each category: ; in, .
[0011] Preferably, when executing step 5, the following steps are specifically included: Step 5-1: Marketing personnel input the requirements in natural language through the UI interface. The query processing module pre-processes the requirements, including removing noise, standardizing punctuation, segmenting words, and removing stop words, to obtain standardized query text. ; Step 5-2: Use the algorithm principles of steps 3-2 and 3-3 to query the text Perform sentiment analysis and obtain sentiment scores , the specific formula is expressed as: ; in represents the positive sentiment score, represents the neutral sentiment score, represents the negative sentiment score; According to the method of calculating the sentiment probability distribution vector, the query text is calculated Emotional tags : ; in, ; Step 5-3: Integrate emotional tone with needs. The specific methods are as follows: The sentiment labels obtained by sentiment analysis Convert to sentiment descriptive text: like , it is described as positive; like , it is described as neutral; like , it is described as negative; The query text Combined with the emotional descriptive text to obtain the fused text : ; Step 5-4: Use the embedding model to fuse the text Convert to vector ; The cosine similarity algorithm is used to search in the vector knowledge database. The cosine similarity algorithm is shown in the following formula: ; in is the knowledge block vector in the vector knowledge database; Sort the results of the cosine similarity algorithm in reverse order, with the largest value in the first place, and recall the first x knowledge blocks, where x is a preset value and is a positive integer; Step 5-5: Return the retrieved knowledge blocks and their corresponding metadata to the RAG generation module.
[0012] The method for optimizing emotional marketing strategies for maternal and infant products based on RAG technology described in the present invention solves the technical problem of increasing accurate matching of user emotions and personalized optimization in the marketing of maternal and infant products by adopting RAG+emotional analysis. The present invention combines sentiment analysis and vectorization processing to ensure that the recalled knowledge blocks are not only related to the input requirements in terms of content, but also meet the emotional needs of users. The vector knowledge database is continuously updated through user feedback to form a closed-loop optimization and enhance the adaptability of the strategy. RAG is combined with a large language model and a knowledge base to improve the accuracy of the marketing strategy. The semantic and fixed word count segmentation methods are adopted to improve the efficiency of information storage and retrieval. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is the main flow chart of the present invention; Figure 2 is a flow chart of step 2 of the present invention; Figure 3 is a flow chart of step 3 of the present invention; Figure 4 It is a flow chart of step 5 of the present invention. DETAILED DESCRIPTION
[0014] Depend on Figure 1-Figure 4 The method for optimizing the emotional marketing strategy of maternal and infant products based on RAG technology includes the following steps: Step 1: Deploy the UI interface, data collection module, document parsing module, sentiment analysis module, vectorization module, query processing module, RAG generation module, strategy output module and vector knowledge database in the architecture of the front-end, cloud platform and data center; the data collection module periodically captures target data from the Internet or the front-end; In this embodiment, the target data specifically refers to documents, comments and discussion data in the field of maternal and infant care.
[0015] When executing step 1, the specific deployment locations are as follows: Establish the system architecture of front-end, cloud platform and data center; The front-end, cloud platform and data center communicate with each other via the Internet; Deploy the UI interface on the front end; Deploy multiple microservice modules on the cloud platform, including data collection module, document parsing module, sentiment analysis module, vectorization module, query processing module, RAG generation module and strategy output module; Deploy vector knowledge database in data center.
[0016] In this embodiment, the data acquisition module runs as an independent microservice on the cloud platform, responsible for periodic / real-time capture and reception of text data in the maternal and child care field; it uses message queues (such as Kafka or RabbitMQ) for data transmission to ensure efficient and stable data transmission.
[0017] The document parsing module is deployed as an independent microservice in a cloud container (such as a Docker container); it is responsible for format conversion and text cleaning of uploaded documents.
[0018] The sentiment analysis module is deployed as an independent microservice in a cloud container. It is responsible for performing sentiment analysis after dividing the text into chunks and generating sentiment tags.
[0019] The vectorization module is deployed as an independent microservice on the cloud platform, uses the model to perform embedding conversion on the text, and runs in the container; The knowledge database is deployed in the enterprise's data center using, for example, FAISS or other lightweight vector databases.
[0020] The query processing module can be deployed on the cloud web server or API gateway backend, providing a RESTful API interface. It mainly processes user input and constructs query context, has high real-time requirements, and can be tightly coupled with the front-end interface. The query processing module works closely with the knowledge base, runs in the cloud environment, and is responsible for vectorizing user queries and retrieving the vector database. The RAG generation module uses third-party LLM APIs (such as OpenAI, etc.) and can be directly called through the API; it is responsible for integrating query and retrieval results and generating marketing strategies through large language models; The strategy output module can be deployed on a cloud web server or application server as part of the front-end system or as an independent back-end service. It is responsible for displaying the generated strategy and collecting user feedback, while transmitting the feedback data back to related modules for subsequent optimization.
[0021] Step 2: The document parsing module performs format parsing on the target data, converts the target data into a text in a structured text format, and cleans the text to obtain a standardized text; the standardized text is segmented into several text segments according to semantics or a fixed number of words; In this embodiment, a dedicated parsing tool or library (such as a PDF parser, an Office document parsing tool) may be used to convert an unstructured document into a structured text.
[0022] When executing step 2, the specific steps include: Step 2-1: The target data includes documents in PDF, Word and JSON formats. The document parsing module uses corresponding parsing rules for documents in different formats to extract the document content into plain text; retaining key structures, including paragraphs, titles and punctuation; Step 2-2: Remove noise from the extracted text, and remove extra spaces, special symbols, and garbled formatting; Using regular expressions and text preprocessing algorithms to clean the text obtained in step 2-2, including unifying the encoding, punctuation, and capitalization, to obtain standardized text; Step 2-3: Segment the standardized text using a fixed word count or based on semantics to obtain a number of segments. In the present embodiment, semantic segmentation is preferred in practical applications, and a fixed word count is used as a backup strategy. If the document is too long and the segments after semantic segmentation are still too long, a fixed word count is used as a supplementary strategy. The specific steps are as follows: Step 2-3-1: Use fixed word count segmentation: Assuming that the standardized text contains N words or characters, the length of each block, that is, the fixed number of words is L, then the formula for calculating the number of blocks is as follows: ; Each text fragment It can be expressed as: ; in, Indicates the number, the value is 1, 2, 3, ..., ; Step 2-3-2: Semantic-based segmentation: Generate vector representation for each sentence , calculate the cosine similarity of adjacent sentences: ; Among them, if , then the sentence With sentence There is a big semantic shift in the sentence With sentence Set the block boundaries between them to get the text fragments , is the set threshold; Step 2-3-3: Output standardized text segments: Use the segmented text segments as the basic units for subsequent sentiment analysis and vectorization, retaining metadata, including the original document ID and location information.
[0023] Step 3: The sentiment analysis module performs sentiment analysis on each text segment, extracts positive, neutral, and negative sentiment labels, analyzes the sentiment intensity indicated by the sentiment labels, and obtains sentiment analysis results; the sentiment analysis results are attached as metadata to each knowledge block in the vector knowledge database; In this embodiment, sentiment analysis is performed on each text segment to extract sentiment labels such as positive, neutral, and negative and sentiment intensity, which are attached as metadata to the knowledge blocks stored subsequently.
[0024] When executing step 3, the following steps are included: Step 3-1: The sentiment analysis module retrieves the text segment obtained in step 2 , for each text segment , using a pre-trained language model to obtain contextual representation ; In this embodiment, a language model such as BERT or RoBERTa can be used to obtain context representation ,The purpose is to use deep neural networks to convert text into high-dimensional vectors,capture semantic features and provide input for sentiment classification.
[0025] Step 3-2: Contextual representation of text fragments Establish a sentiment model and calculate the sentiment score: ; in, represents the sentiment vector, is the score of positive emotion, is the score of neutral sentiment, is the score for negative emotions; The calculation method for expressing the sentiment vector is as follows: Compute linear transformation : ; in, is the weight matrix, is the bias vector; The Softmax function is used to calculate the probability of each category: ; in, .
[0026] In this embodiment, the linear transformation maps the text representation to the sentiment dimension space, and the Softmax function converts the output into a probability distribution, which can ensure that the sum of the three sentiment scores is 1.
[0027] Step 3-3: According to The three scores are selected and the emotion category corresponding to the maximum probability is selected as the final emotion label , the specific formula is as follows: ; in, ; Emotional intensity The calculation formula is as follows: ; Step 3-4: Use the sentiment analysis results of each text segment as metadata and compare them with the text segment and sentiment vector Stored together in the vector knowledge database; sentiment analysis results include sentiment tags and emotional intensity .
[0028] In this embodiment, by comparing the scores of each category, the most suitable emotion category can be selected, and the emotion intensity can be It can reflect the positive and negative tendencies of emotions, making it easier to make decisions based on needs later.
[0029] Step 4: The vectorization module uses the embedding algorithm to vectorize the text fragments and stores the processing results in the vector knowledge database; The algorithm of the embedding model is an existing technology, so it will not be described in detail.
[0030] Step 5: The marketing personnel input the demand through the UI interface, and the query processing module pre-processes the demand to obtain the query text, performs sentiment tendency analysis on the query text to obtain the sentiment tone, and fuses the sentiment tone with the demand to obtain the fused text; the query processing module converts the fused text into a vector, performs a similarity search in the vector knowledge database, and recalls the knowledge blocks that match the maternal and infant products and sentiment information; When executing step 5, the specific steps include: Step 5-1: Marketing personnel input the requirements in natural language through the UI interface. The query processing module pre-processes the requirements, including removing noise, standardizing punctuation, segmenting words, and removing stop words, to obtain standardized query text. ; Step 5-2: Use the algorithm principles of steps 3-2 and 3-3 to query the text Perform sentiment analysis and obtain sentiment scores , the specific formula is expressed as: ; in represents the positive sentiment score, represents the neutral sentiment score, represents the negative sentiment score; According to the method of calculating the sentiment probability distribution vector, the query text is calculated Emotional tags : ; in, ; Step 5-3: Integrate emotional tone with needs. The specific methods are as follows: The sentiment labels obtained by sentiment analysis Convert to sentiment descriptive text: like , it is described as positive; like , it is described as neutral; like , it is described as negative; The query text Combined with the emotional descriptive text to obtain the fused text : ; Step 5-4: Use the embedding model to fuse the text Convert to vector ; The cosine similarity algorithm is used to search in the vector knowledge database. The cosine similarity algorithm is shown in the following formula: ; in is the knowledge block vector in the vector knowledge database; Sort the results of the cosine similarity algorithm in reverse order, with the largest value in the first place, and recall the first x knowledge blocks, where x is a preset value and is a positive integer; Step 5-5: Return the retrieved knowledge blocks and their corresponding metadata to the RAG generation module.
[0031] Step 6: The RAG generation module combines the query text with the recalled knowledge blocks, inputs them into a large language model (such as LLM), and uses the large language model to generate an optimization strategy; In this embodiment, the solution of the open source model (such as OpenAI's API, RAG paper implementation, etc.) can be used to generate the optimization strategy.
[0032] Step 7: The strategy output module outputs the optimization strategy to the UI interface and displays it to the sales staff. The sales staff inputs feedback through the UI interface and uses the feedback as a target data to update the vector knowledge database according to the methods of steps 2 to 4.
[0033] The method for optimizing emotional marketing strategies for maternal and infant products based on RAG technology described in the present invention solves the technical problem of increasing accurate matching of user emotions and personalized optimization in the marketing of maternal and infant products by adopting RAG+emotional analysis. The present invention combines sentiment analysis and vectorization processing to ensure that the recalled knowledge blocks are not only related to the input requirements in terms of content, but also meet the emotional needs of users. The vector knowledge database is continuously updated through user feedback to form a closed-loop optimization and enhance the adaptability of the strategy. RAG is combined with a large language model and a knowledge base to improve the accuracy of the marketing strategy. The semantic and fixed word count segmentation methods are adopted to improve the efficiency of information storage and retrieval.
Claims
1. A method for optimizing emotional marketing strategies for maternal and infant products based on RAG technology, characterized by: The steps include: Step 1: Deploy the UI interface, data collection module, document parsing module, sentiment analysis module, vectorization module, query processing module, RAG generation module, strategy output module and vector knowledge database in the architecture of the front-end, cloud platform and data center; the data collection module periodically captures target data from the Internet or the front-end; Step 2: The document parsing module performs format parsing on the target data, converts the target data into a text in a structured text format, and cleans the text to obtain a standardized text; the standardized text is segmented into several text segments according to semantics or a fixed number of words; Step 3: The sentiment analysis module performs sentiment analysis on each text segment, extracts positive, neutral, and negative sentiment labels, analyzes the sentiment intensity indicated by the sentiment labels, and obtains sentiment analysis results; the sentiment analysis results are attached as metadata to each knowledge block in the vector knowledge database; Step 4: The vectorization module uses the embedding algorithm to vectorize the text fragments and stores the processing results in the vector knowledge database; Step 5: The marketing personnel input the demand through the UI interface, and the query processing module pre-processes the demand to obtain the query text, performs sentiment tendency analysis on the query text to obtain the sentiment tone, and fuses the sentiment tone with the demand to obtain the fused text; the query processing module converts the fused text into a vector, performs a similarity search in the vector knowledge database, and recalls the knowledge blocks that match the maternal and infant products and sentiment information; Step 6: The RAG generation module combines the query text with the recalled knowledge blocks, inputs them into the large language model, and uses the large language model to generate an optimization strategy; Step 7: The strategy output module outputs the optimization strategy to the UI interface and displays it to the sales staff. The sales staff inputs feedback through the UI interface and uses the feedback as a target data to update the vector knowledge database according to the methods of steps 2 to 4.
2. The method for optimizing emotional marketing strategy for maternal and infant products based on RAG technology as claimed in claim 1, characterized in that: When executing step 1, the specific deployment locations are as follows: Establish the system architecture of front-end, cloud platform and data center; The front-end, cloud platform and data center communicate with each other via the Internet; Deploy the UI interface on the front end; Deploy multiple microservice modules on the cloud platform, including data collection module, document parsing module, sentiment analysis module, vectorization module, query processing module, RAG generation module and strategy output module; Deploy vector knowledge database in data center.
3. The method for optimizing emotional marketing strategy of maternal and infant products based on RAG technology as claimed in claim 1, characterized in that: When executing step 2, the specific steps include: Step 2-1: The target data includes documents in PDF, Word and JSON formats. The document parsing module uses corresponding parsing rules for documents in different formats to extract the document content into plain text; retaining key structures, including paragraphs, titles and punctuation; Step 2-2: Remove noise from the extracted text, and remove extra spaces, special symbols, and garbled formatting; Using regular expressions and text preprocessing algorithms to clean the text obtained in step 2-2, including unifying the encoding, punctuation, and capitalization, to obtain standardized text; Step 2-3: Use a fixed word count or semantics to segment the standardized text into several segments. The specific steps are as follows: Step 2-3-1: Use fixed word count segmentation: Assuming that the standardized text contains N words or characters, the length of each block, that is, the fixed number of words is L, then the formula for calculating the number of blocks is as follows: ; Each text fragment It can be expressed as: ; in, Indicates the number, the value is 1, 2, 3, ..., ; Step 2-3-2: Semantic-based segmentation: Generate vector representation for each sentence , calculate the cosine similarity of adjacent sentences: ; Among them, if , then the sentence With sentence There is a big semantic shift in the sentence With sentence Set the block boundaries between them to get the text fragments , is the set threshold; Step 2-3-3: Output standardized text segments: Use the segmented text segments as the basic units for subsequent sentiment analysis and vectorization, retaining metadata, including the original document ID and location information.
4. The method for optimizing emotional marketing strategy for maternal and infant products based on RAG technology as claimed in claim 3, characterized in that: When executing step 3, the following steps are included: Step 3-1: The sentiment analysis module retrieves the text segment obtained in step 2 , for each text segment , using a pre-trained language model to obtain contextual representation ; Step 3-2: Contextual representation of text fragments Establish a sentiment model and calculate the sentiment score: ; in, represents the sentiment vector, is the score of positive emotion, is the score of neutral sentiment, is the score for negative emotions; Step 3-3: According to The three scores are selected and the emotion category corresponding to the maximum probability is selected as the final emotion label , the specific formula is as follows: ; in, ; Emotional intensity The calculation formula is as follows: ; Step 3-4: Use the sentiment analysis results of each text segment as metadata and compare them with the text segment and sentiment vector Stored together in the vector knowledge database; sentiment analysis results include sentiment tags and emotional intensity .
5. The method for optimizing emotional marketing strategy of maternal and infant products based on RAG technology as claimed in claim 4, characterized in that: When executing step 3-2, The calculation method for expressing the sentiment vector is as follows: Compute linear transformation : ; in, is the weight matrix, is the bias vector; The Softmax function is used to calculate the probability of each category: ; in, .
6. The method for optimizing emotional marketing strategy of maternal and infant products based on RAG technology as claimed in claim 4, characterized in that: When executing step 5, the specific steps include: Step 5-1: Marketing personnel input the requirements in natural language through the UI interface, and the query processing module pre-processes the requirements, including removing noise, standardizing punctuation, segmenting words, and removing stop words, to obtain standardized query text ; Step 5-2: Use the algorithm principles of steps 3-2 and 3-3 to query the text Perform sentiment analysis and obtain sentiment scores , the specific formula is expressed as: ; in represents the positive sentiment score, represents the neutral sentiment score, represents the negative sentiment score; According to the method of calculating the sentiment probability distribution vector, the query text is calculated Emotional tags : ; in, ; Step 5-3: Integrate emotional tone with needs. The specific methods are as follows: The sentiment labels obtained by sentiment analysis Convert to sentiment descriptive text: like , it is described as positive; like , it is described as neutral; like , it is described as negative; The query text Combined with the emotional descriptive text to obtain the fused text : ; Step 5-4: Use the embedding model to fuse the text Convert to vector ; The cosine similarity algorithm is used to search in the vector knowledge database. The cosine similarity algorithm is shown in the following formula: ; in is the knowledge block vector in the vector knowledge database; Sort the results of the cosine similarity algorithm in reverse order, with the largest value in the first place, and recall the first x knowledge blocks, where x is a preset value and is a positive integer; Step 5-5: Return the retrieved knowledge blocks and their corresponding metadata to the RAG generation module.
Citation Information
Patent Citations
Man-machine interaction method based on semantic matching, man-machine interaction system based on semantic matching and intelligent story machine
CN108256539A
Text processing method and device, electronic equipment and computer readable storage medium
CN114492375A
Intelligent matching system and method based on natural language model
CN117521652A
Multi-modal multi-scale multi-recall large language model retrieval enhancement generation method
CN118296120A
Text auditing method and system based on big language model debate
CN118378609A