Logistics intelligent customer service online question and answer method, device and equipment and storage medium
An intelligent customer service system using natural language processing and deep learning addresses inefficiencies in manual inquiry handling by converting user questions into vectors and providing guiding prompts, enhancing response speed and quality.
Patent Information
- Application Number
- CN202411363027.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2024-12-27
AI Technical Summary
Traditional express delivery customer service relies heavily on manual processing of inquiries, leading to inefficiencies, long response times, and inconsistent service quality due to varying staff capabilities, increasing operational costs and customer dissatisfaction.
An intelligent customer service system utilizing natural language processing and deep learning to convert user questions into vectors, match them with a knowledge base, and provide guiding prompts when no exact match is found, enhancing user experience and efficiency.
The system quickly understands user intentions, retrieves relevant answers, and guides users to rephrase questions, improving customer service efficiency and satisfaction by providing example questions and prompts.
Smart Images

Figure CN119202134A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of logistics technology, and in particular to a logistics intelligent customer service online question and answer method, device, equipment and storage medium. Background Art
[0002] With the rapid development of e-commerce, the express logistics industry is facing huge challenges. Customers now have higher and higher requirements for delivery speed and service quality, hoping that packages can be delivered faster and more safely, and the service must be more thoughtful.
[0003] However, the traditional express delivery customer service method mainly relies on manual processing of customer inquiries and complaints. When the number of inquiries is large, the manual customer service is often too busy to handle it, causing customers to wait a long time for a response. This not only makes customers dissatisfied, but also requires express delivery companies to hire more customer service staff to deal with it, increasing costs. Moreover, because the level of customer service staff is different, the service experience received by customers may also be good or bad, and not uniform.
[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the invention
[0005] The present invention provides a logistics intelligent customer service online question-and-answer method, device, equipment and storage medium, which are used to effectively guide users to rephrase questions by providing example questions and guiding prompts when a matching answer cannot be found directly.
[0006] A first aspect of the present invention provides a logistics intelligent customer service online question and answer method, which includes: receiving user question content, and preprocessing the user question content to obtain preprocessed data; using natural language processing technology and deep learning models to convert the preprocessed data into a user question vector; obtaining an existing question vector in a preset knowledge base, and calculating a similarity evaluation value between the user question vector and the existing question vector; sorting the existing question vectors in descending order according to the similarity evaluation value, and judging whether the highest value of the similarity evaluation value is higher than a preset threshold; if not, selecting at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions, generating guiding prompts according to the example questions, and generating feedback messages according to the example questions and the guiding prompts.
[0007] Optionally, in a first implementation method of the first aspect of the present invention, the receiving of user question content and preprocessing of the user question content to obtain preprocessed data includes: receiving user question content, removing HTML tags, special characters and extra spaces in the user question content to obtain primary processed data; reading a preset stop word list, using a string processing function to remove stop words in the stop word list from the primary processed data to obtain secondary processed data; and standardizing the secondary processed data to obtain preprocessed data.
[0008] Optionally, in a second implementation method of the first aspect of the present invention, the preprocessed data is converted into a user question vector using natural language processing technology and a deep learning model, including: based on the preprocessed data, a vocabulary is constructed using a bag-of-words model; the term frequency TF value and the inverse document frequency IDF value of each word in the vocabulary are calculated, and the TF-IDF value corresponding to each word is calculated based on the TF value and the IDF value, and the TF-IDF values corresponding to all words are integrated to form a feature vector of the user question; the feature vector is input into a question vector conversion model based on a convolutional neural network to obtain the user question vector output by the question vector conversion model.
[0009] Optionally, in a third implementation method of the first aspect of the present invention, the feature vector is input into a problem vector conversion model based on a convolutional neural network to obtain a user problem vector output by the problem vector conversion model, including: adjusting the input layer of a pre-built CNN architecture according to the dimension and type of the feature vector, and adding multiple convolutional layers, pooling layers, activation layers and fully connected layers after the adjusted input layer to construct a CNN initial model; loading the pre-trained CNN model weights into the CNN initial model for fusion to obtain a problem vector conversion model; inputting the feature vector into the problem vector conversion model to obtain the user problem vector output by the problem vector conversion model.
[0010] Optionally, in a fourth implementation manner of the first aspect of the present invention, obtaining an existing question vector in a preset knowledge base and calculating a similarity evaluation value between the user question vector and the existing question vector includes: obtaining an existing question vector in a preset knowledge base, and calculating a first similarity between the user question vector and the existing question vector using a cosine similarity calculation method based on the user question vector and the existing question vector; calculating a second similarity between the user question vector and the existing question vector using a Euclidean distance calculation method based on the user question vector and the existing question vector; calculating a third similarity between the user question vector and the existing question vector using a Manhattan distance calculation method based on the user question vector and the existing question vector; and weighted averaging the first similarity, the second similarity and the third similarity to obtain a similarity evaluation value between the user question vector and the existing question vector.
[0011] Optionally, in a fifth implementation manner of the first aspect of the present invention, the existing problem vectors are sorted in descending order according to the similarity evaluation values, and it is determined whether the highest value of the similarity evaluation values is higher than a preset threshold, including: sorting the existing problem vectors in descending order according to the similarity evaluation values to obtain a sorted list; taking the similarity evaluation value of the existing problem vector ranked first in the sorted list as a comparison value, and comparing the comparison value with a preset threshold; if the comparison value is greater than the preset threshold, it indicates that the highest value of the similarity evaluation value is higher than the preset threshold; otherwise, it indicates that the highest value of the similarity evaluation value is not higher than the preset threshold.
[0012] Optionally, in a sixth implementation manner of the first aspect of the present invention, if not, then selecting at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions, generating guiding prompts based on the example questions, and generating feedback messages based on the example questions and the guiding prompts, including: when the highest value of the similarity evaluation value is not higher than a preset threshold, selecting at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions; analyzing the common points of the example questions, and generating guiding prompts based on the common points of the example questions; calling a preset feedback template, filling the example questions and guiding prompts into the feedback template, and generating a feedback message.
[0013] The second aspect of the present invention provides a logistics intelligent customer service online question and answer device, including: a preprocessing module, used to receive user question content, and preprocess the user question content to obtain preprocessed data; a conversion module, used to use natural language processing technology and deep learning models to convert the preprocessed data into a user question vector; a calculation module, used to obtain an existing question vector in a preset knowledge base, and calculate the similarity evaluation value between the user question vector and the existing question vector; a judgment module, used to sort the existing question vectors in descending order according to the similarity evaluation value, and judge whether the highest value of the similarity evaluation value is higher than a preset threshold; a feedback module, used to select at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions when the highest value of the similarity evaluation value is not higher than the preset threshold, generate guiding prompts according to the example questions, and generate feedback messages according to the example questions and the guiding prompts.
[0014] Optionally, in a first implementation method of the second aspect of the present invention, the preprocessing module includes: a first deletion unit, used to receive user question content, remove HTML tags, special characters and redundant spaces in the user question content, and obtain primary processed data; a second deletion unit, used to read a preset stop word list, and use a string processing function to remove stop words in the stop word list from the primary processed data to obtain secondary processed data; a standardization unit, used to standardize the secondary processed data to obtain preprocessed data.
[0015] Optionally, in a second implementation of the second aspect of the present invention, the conversion module includes: a construction unit, used to construct a vocabulary based on preprocessed data using a bag-of-words model; a first calculation unit, used to calculate the term frequency TF value and the inverse document frequency IDF value of each word in the vocabulary, calculate the TF-IDF value corresponding to each word according to the TF value and the IDF value, and integrate the TF-IDF values corresponding to all words to form a feature vector of the user question; a conversion unit, used to input the feature vector into a question vector conversion model based on a convolutional neural network to obtain the user question vector output by the question vector conversion model.
[0016] Optionally, in a third implementation manner of the second aspect of the present invention, in this embodiment, the calculation module includes: a second calculation unit, used to obtain an existing question vector in a preset knowledge base, and calculate a first similarity between the user question vector and the existing question vector based on the user question vector and the existing question vector using a cosine similarity calculation method; a third calculation unit, used to calculate a second similarity between the user question vector and the existing question vector based on the user question vector and the existing question vector using a Euclidean distance calculation method; a fourth calculation unit, used to calculate a third similarity between the user question vector and the existing question vector based on the user question vector and the existing question vector using a Manhattan distance calculation method; and a fifth calculation unit, used to weighted average the first similarity, the second similarity and the third similarity to obtain a similarity evaluation value between the user question vector and the existing question vector.
[0017] Optionally, in a fourth implementation manner of the second aspect of the present invention, in this embodiment, the judgment module includes: a sorting unit, used to sort the existing problem vectors in descending order according to the similarity evaluation values to obtain a sorted list; a comparison unit, used to take the similarity evaluation value of the existing problem vector ranked first in the sorted list as a comparison value, and compare the comparison value with a preset threshold; a judgment unit, used to determine that the highest value of the similarity evaluation value is higher than the preset threshold when the comparison value is greater than the preset threshold, otherwise, determine that the highest value of the similarity evaluation value is not higher than the preset threshold.
[0018] Optionally, in a fifth implementation manner of the second aspect of the present invention, in this embodiment, the feedback module includes: a selection unit, used to select questions corresponding to at least three existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions when the highest value of the similarity evaluation value is not higher than a preset threshold; a generation unit, used to analyze the commonalities of the example questions and generate guiding prompts based on the commonalities of the example questions; a feedback unit, used to call a preset feedback template, fill the example questions and guiding prompts into the feedback template, and generate a feedback message.
[0019] The third aspect of the present invention provides a logistics intelligent customer service online question and answer device, comprising: a memory and at least one processor, the memory storing computer-readable instructions, the memory and the at least one processor being interconnected through a line; the at least one processor calls the computer-readable instructions in the memory to enable the logistics intelligent customer service online question and answer device to perform each step of the logistics intelligent customer service online question and answer method as described above.
[0020] The fourth aspect of the present invention provides a computer-readable storage medium, which stores computer-readable instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the various steps of the logistics intelligent customer service online question and answer method as described above.
[0021] In the technical solution provided by the present invention, by integrating natural language processing, deep learning and intelligent matching algorithms, it can quickly understand user intentions, automatically retrieve the most relevant answers from a preset knowledge base, and when a matching answer cannot be found directly, effectively guide users to rephrase the questions by providing example questions and guiding prompts, thereby significantly improving user experience and customer service efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A first flow chart of the online question-and-answer method for logistics intelligent customer service provided by an embodiment of the present invention;
[0023] Figure 2 A second flow chart of the online question-and-answer method for logistics intelligent customer service provided by an embodiment of the present invention;
[0024] Figure 3 A third flow chart of the online question-and-answer method for logistics intelligent customer service provided by an embodiment of the present invention;
[0025] Figure 4 A fourth flow chart of the online question-and-answer method for logistics intelligent customer service provided by an embodiment of the present invention;
[0026] Figure 5 A fifth flow chart of the online question-and-answer method for logistics intelligent customer service provided by an embodiment of the present invention;
[0027] Figure 6 A sixth flow chart of the online question-and-answer method for logistics intelligent customer service provided by an embodiment of the present invention;
[0028] Figure 7 A schematic diagram of the structure of a logistics intelligent customer service online question-and-answer device provided in an embodiment of the present invention;
[0029] Figure 8 A schematic diagram of the structure of a logistics intelligent customer service online question and answer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The embodiment of the present invention provides a logistics intelligent customer service online question and answer method, device, equipment and storage medium, which is used to effectively guide users to rephrase questions by providing example questions and guiding prompts when a matching answer cannot be found directly. The method includes: receiving user question content, and preprocessing the user question content to obtain preprocessed data; using natural language processing technology and deep learning models to convert the preprocessed data into a user question vector; obtaining existing question vectors in a preset knowledge base, and calculating the similarity evaluation value between the user question vector and the existing question vector; sorting the existing question vectors in descending order according to the similarity evaluation value, and judging whether the highest value of the similarity evaluation value is higher than a preset threshold; if not, selecting at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions, generating guiding prompts according to the example questions, and generating feedback messages according to the example questions and the guiding prompts.
[0031] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0032] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , a first embodiment of a logistics intelligent customer service online question and answer method in an embodiment of the present invention includes:
[0033] S101, receiving user's question content, and preprocessing the user's question content to obtain preprocessed data.
[0034] It is understandable that the execution subject of the present invention may be a logistics intelligent customer service online question-and-answer device, or a terminal or a server, which is not specifically limited here. The embodiment of the present invention is described by taking the server as the execution subject as an example.
[0035] In this embodiment, the user's question content is received, and the user's question content can be a text question input by the user, or it can be audio data. If it is audio data, the audio data is first converted into text data.
[0036] In this embodiment, the preprocessing of the user's question content includes removing irrelevant characters (such as punctuation marks and special symbols), word segmentation (dividing a sentence into words or phrases), removing stop words (such as high-frequency but meaningless words like "de" and "shi"), word lemmatization or stemming, etc., to improve the efficiency and accuracy of subsequent processing.
[0037] S102. Use natural language processing technology and deep learning models to convert the preprocessed data into a user question vector.
[0038] In this embodiment, through the application of bag-of-words vectorization, TF-IDF weighting, and deep learning models (CNN or RNN), the preprocessed data is converted into a user question vector.
[0039] In this embodiment, natural language processing technology can also be used to perform semantic analysis on the preprocessed text to understand its deep meaning, and then use deep learning models (such as BERT, GPT, etc.) to convert the text into a vector representation in a high-dimensional vector space, that is, the user question vector.
[0040] S103. Obtain the existing question vectors in the preset knowledge base, and calculate the similarity evaluation value between the user question vector and the existing question vectors.
[0041] In this embodiment, various questions about logistics consulting are stored in the knowledge base. These questions are used as existing questions, and their vectors, that is, existing question vectors, are obtained through pre-analysis and processing.
[0042] In this embodiment, methods such as cosine similarity and Euclidean distance can be used to calculate the similarity between the user question vector and each existing question vector to obtain the similarity evaluation value.
[0043] S104. Sort the existing question vectors in descending order according to the similarity evaluation value, and determine whether the highest value of the similarity evaluation value is higher than the preset threshold.
[0044] In this embodiment, the existing question vectors are sorted in descending order according to the similarity evaluation value. Check whether the highest similarity evaluation value after sorting exceeds the preset threshold, and this threshold is used to determine whether there are existing questions that are similar enough.
[0045] S105. If not, then select at least three questions corresponding to the existing question vectors from the sorted existing question vectors in descending order of similarity as example questions, generate guiding prompts based on the example questions, and generate a feedback message based on the example questions and the guiding prompts.
[0046] In this embodiment, if the highest value of the similarity evaluation value is not higher than the preset threshold, it means that there is no existing question that is similar enough to the user's question. At this time, the server will not simply return the prompt message "I haven't learned this question yet. Please ask it in another way.", but will provide some relevant question examples and guiding prompts to help the user better organize and express the question.
[0047] If the highest value of the similarity evaluation value is higher than the preset threshold, it means that there is no existing question that is similar enough to the user's question, then obtain the answer corresponding to the existing question and feedback it to the user.
[0048] The online question-and-answer method of the logistics intelligent customer service provided in this embodiment can quickly understand the user's intention by integrating natural language processing, deep learning, and intelligent matching algorithms, automatically retrieve the most relevant answer from the preset knowledge base, and when a matching answer cannot be directly found, effectively guide the user to rephrase the question by providing example questions and guiding prompts, thus significantly improving the user experience and customer service efficiency.
[0049] Please refer to Figure 2 , the second embodiment of the online question-and-answer method of the logistics intelligent customer service in the embodiment of the present invention includes:
[0050] S201. Receive the user's question content, remove the HTML tags, special characters, and redundant spaces in the user's question content to obtain the primary processed data.
[0051] In this embodiment, a regular expression or other string processing library (such as the re module in Python) is used to match and delete all HTML tags in the text because these tags are redundant for the understanding and analysis of the text content.
[0052] In this embodiment, special characters are also removed using a regular expression or other method to remove non-alphanumeric characters (such as punctuation marks, emojis, etc.) in the text.
[0053] In this embodiment, redundant spaces are removed, that is, consecutive spaces in the text are replaced with a single space to unify the text format for subsequent processing.
[0054] S202. Read the preset stop word list, and use a string processing function to remove the stop words that match the stop word list from the primary processed data to obtain the secondary processed data.
[0055] In this embodiment, the preset stop word list is a text file or list containing common but meaningless words (such as "de", "le", "shi", etc.).
[0056] Use string processing functions (such as Python's split and join methods combined with list comprehensions) to compare each word in the processed data one at a time to the list of stop words, and if the word is in the list, remove it from the text.
[0057] S203, performing standardization processing on the secondary processed data to obtain pre-processed data.
[0058] In this embodiment, the secondary processed data is standardized, that is, the secondary processed data is converted into a unified text format, for example, all words are converted into lowercase to reduce word duplication caused by differences in uppercase and lowercase.
[0059] In this embodiment, by removing irrelevant information (such as HTML tags, special characters, extra spaces and stop words) and standardizing the text, the processed data is made purer, more concise and focused on key information, which helps subsequent natural language processing tasks achieve higher accuracy and efficiency.
[0060] See also Figure 3 A third embodiment of a logistics intelligent customer service online question-and-answer method in an embodiment of the present invention includes:
[0061] S301. Based on the preprocessed data, a vocabulary is constructed using a bag-of-words model.
[0062] In this embodiment, based on the preprocessed data, for each word that appears in the text, a data structure (such as a dictionary, a set or a hash table) is used to count their occurrences. Whenever a word is encountered, it is checked whether it is already in the data structure. If not, it is added to the data structure; if it is, it is ignored. Then, the data structure used in the previous step is traversed, all unique words are extracted, and these unique words are arranged in a certain order (such as alphabetical order, order of first appearance, etc.) to form a list. This list is the final vocabulary, which contains all unique words that appear in the text data.
[0063] S302, calculating the term frequency TF value and the inverse document frequency IDF value of each word in the vocabulary, calculating the TF-IDF value corresponding to each word according to the TF value and the IDF value, and integrating the TF-IDF values corresponding to all words to form a feature vector of the user question;
[0064] In this embodiment, for each word in the vocabulary, its frequency (TF) in each document is calculated, that is, the number of times the word appears in the document divided by the total number of words in the document. For each word in the vocabulary, its general importance in all documents, that is, the IDF value, is calculated, which is obtained by dividing the total number of documents by the number of documents containing the word and then taking the logarithm.
[0065] In this embodiment, the TF value of each word is multiplied by the IDF value to obtain a TF-IDF value, which reflects the importance and uniqueness of the word in a specific document.
[0066] S303: Input the feature vector into a question vector conversion model based on a convolutional neural network to obtain a user question vector output by the question vector conversion model.
[0067] The feature vector is input into a question vector conversion model based on a convolutional neural network to obtain the user question vector output by the question vector conversion model, specifically including: adjusting the input layer of the pre-built CNN architecture according to the dimension and type of the feature vector, and adding multiple convolution layers, pooling layers, activation layers and fully connected layers after the adjusted input layer to build a CNN initial model; loading the pre-trained CNN model weights into the CNN initial model for fusion to obtain a question vector conversion model; inputting the feature vector into the question vector conversion model to obtain the user question vector output by the question vector conversion model.
[0068] In this embodiment, the input layer parameters of the CNN model are adjusted according to the dimension (i.e., the size of the vocabulary) and type (usually numerical) of the feature vectors to ensure that these feature vectors can be received and processed.
[0069] In this embodiment, a pooling layer is inserted after the convolution layer to reduce the number of parameters and the amount of calculation while retaining important features. Activation functions such as ReLU are used to introduce nonlinear factors and enhance the learning ability of the model.
[0070] In this embodiment, the weights of the CNN model pre-trained on a large amount of data are loaded into the initial model. These weights contain rich semantic and contextual information, and by fine-tuning or directly using the pre-trained weights, the initial model can quickly adapt to the current task requirements, that is, the transformation of the user question vector.
[0071] In this embodiment, the bag-of-words model is combined with TF-IDF feature extraction and the efficient learning ability of the convolutional neural network (CNN) model to convert the preprocessed data into a user question vector, which effectively improves the construction quality of the user question vector. The combination of the bag-of-words model and TF-IDF ensures the accurate expression of the importance of vocabulary, and the introduction of the CNN model further captures the complex patterns and deep semantic information in the feature vector through deep learning technology, thereby generating a more discriminative and expressive user question vector.
[0072] See also Figure 4 A fourth embodiment of a logistics intelligent customer service online question-and-answer method in an embodiment of the present invention includes:
[0073] S401, obtaining an existing question vector in a preset knowledge base, and calculating a first similarity between the user question vector and the existing question vector using a cosine similarity calculation method according to the user question vector and the existing question vector.
[0074] In this embodiment, the preset knowledge base is traversed to extract all existing question vectors, where the existing question vectors are the result of converting text questions into numerical vectors through natural language processing techniques (such as word embedding, TF-IDF, BERT, etc.).
[0075] In this embodiment, the cosine similarity formula is used to calculate the cosine value of the angle between the user question vector and each existing question vector. The closer the cosine value is to 1, the closer the directions of the two vectors are, that is, the more similar the question contents are.
[0076] S402: According to the user question vector and the existing question vector, a second similarity between the user question vector and the existing question vector is calculated using a Euclidean distance calculation method.
[0077] In this embodiment, the Euclidean distance formula is applied to calculate the straight-line distance between the user question vector and each existing question vector in the multidimensional space. The smaller the distance, the closer the two vectors are in space, that is, the more similar the question contents are.
[0078] In this embodiment, the distance is converted to similarity (eg, by taking the inverse or applying a certain decay function) so as to be processed uniformly with other similarity metrics.
[0079] S403: According to the user question vector and the existing question vector, a third similarity between the user question vector and the existing question vector is calculated using a Manhattan distance calculation method.
[0080] In this embodiment, the Manhattan distance formula is used to calculate the distance between the user question vector and each existing question vector. Similarly, the calculated distance is converted into a similarity measure.
[0081] As you can understand, Manhattan distance is similar to Euclidean distance, but Manhattan distance considers the sum of absolute differences in each dimension of the vector.
[0082] S404: Take a weighted average of the first similarity, the second similarity and the third similarity to obtain a similarity evaluation value between the user question vector and the existing question vector.
[0083] In this embodiment, a weight is assigned to each similarity measurement method (cosine similarity, converted Euclidean distance similarity, converted Manhattan distance similarity). According to the assigned weight, the similarity calculated by each method is weighted averaged to obtain the final similarity evaluation value between the user question vector and the existing question vector.
[0084] In this embodiment, the similarity between the user question vector and the existing question vector is comprehensively evaluated by comprehensively using three different similarity calculation methods: cosine similarity, Euclidean distance, and Manhattan distance, and performing weighted average. This diversified evaluation strategy effectively improves the accuracy and robustness of similarity calculation, and can more accurately match user questions to similar questions in the preset knowledge base, thereby improving the response quality and efficiency of the question-answering system.
[0085] See also Figure 5 A fifth embodiment of a logistics intelligent customer service online question-and-answer method in an embodiment of the present invention includes:
[0086] S501 , sorting the existing question vectors in descending order according to the similarity evaluation values to obtain a sorted list.
[0087] In this embodiment, the existing question vectors are sorted in descending order according to the similarity evaluation values using a sorting algorithm (such as quick sort, merge sort, etc.). After the sorting is completed, a list of existing question vectors arranged from high to low according to the similarity evaluation values is obtained.
[0088] S502: Use the similarity evaluation value of the existing question vector that is ranked first in the sorted list as a comparison value, and compare the comparison value with a preset threshold.
[0089] In this embodiment, in the sorted list, the first element (ie, the element with the highest similarity evaluation value) is directly accessed, and the similarity evaluation value of the element is extracted as a comparison value for subsequent comparison with a preset threshold.
[0090] S503: If the comparison value is greater than the preset threshold, it means that the highest value of the similarity evaluation value is higher than the preset threshold; otherwise, it means that the highest value of the similarity evaluation value is not higher than the preset threshold.
[0091] In this embodiment, if the comparison value is greater than the preset threshold, it means that the highest similarity evaluation value exceeds the standard set by the system, and it is considered that sufficiently similar questions have been found. If the comparison value is not greater than the preset threshold, it means that the highest similarity evaluation value does not meet the standard required by the system, and the user needs to provide more information.
[0092] In this embodiment, by first sorting the similarity evaluation values in descending order and then comparing the highest similarity evaluation value after sorting with a preset threshold, it is effectively determined whether the similarity between the user question and the questions in the existing question library meets the preset standard.
[0093] See also Figure 6 A sixth embodiment of a logistics intelligent customer service online question-and-answer method in an embodiment of the present invention includes:
[0094] S601: When the highest value of the similarity evaluation value is not higher than a preset threshold, questions corresponding to at least three existing question vectors are selected from the sorted existing question vectors according to the similarity from high to low as example questions.
[0095] In this embodiment, when the highest similarity evaluation value is found to be not higher than the preset threshold, it means that no highly similar question is directly matched. Then, from the sorted existing question vector list, at least three questions corresponding to the existing question vectors are selected as example questions in descending order of similarity.
[0096] S602: Analyze the common points of the example questions, and generate guiding prompts based on the common points of the example questions.
[0097] In this embodiment, the selected sample questions are analyzed in depth to identify the commonalities or similar features between the sample questions. These commonalities may involve the subject, keywords, questioning methods, etc. Then, through analysis, information that can represent the core elements of these sample questions is extracted to provide a basis for the subsequent generation of guiding prompts. Finally, based on the analysis of the commonalities of the sample questions, guiding prompts are generated.
[0098] S603: Call a preset feedback template, fill the sample question and guiding prompt into the feedback template, and generate a feedback message.
[0099] In this embodiment, the preset feedback template is used to construct a feedback message including sample questions and guiding prompts.
[0100] For example, suppose the user asks: "Why is my delivery so slow? Are you delaying it on purpose?"
[0101] After the system converts the above user questions into user question vectors, and calculates the similarity evaluation value between them and the existing question vectors in the preset knowledge base, and the highest value of the similarity evaluation value is not higher than the preset threshold, then three questions corresponding to the existing question vectors are selected from the sorted existing question vectors according to the similarity from high to low as example questions, and the example questions are: "How long does it usually take for your express to arrive?", "How to check the estimated delivery time of a certain express?", "Why has my express not arrived several days later than the expected time?". Then, based on these example questions, the following guiding prompts are generated, such as "We understand your concern about delivery timeliness. In order to better understand your needs and provide assistance, you can try to ask for specific delivery timeliness information, such as using questions like 'How long does it usually take for your express to arrive?' or 'How to check the estimated delivery time of a certain express?'. If you have already checked the estimated delivery time but found that the package is delayed, you can use questions like 'Why has my express not arrived several days later than the expected time?' to further inquire." Finally, the preset feedback template is called, and the example questions and guiding prompts are filled into the feedback template to generate a feedback message.
[0102] In this embodiment, when a high-similarity question cannot be directly matched, example questions with higher similarity are intelligently selected, and guiding prompts and feedback messages are generated accordingly, which effectively guides the user to express the question more clearly or provide additional information, thereby improving the satisfaction and efficiency of question answering.
[0103] The above describes the online question-and-answer method for intelligent customer service in logistics in an embodiment of the present invention. The following describes the device in an embodiment of the present invention. Figure 7 , the implementation method of the online question-and-answer device for logistics intelligent customer service in the embodiment of the present invention includes:
[0104] The preprocessing module 701 is used to receive user question content and preprocess the user question content to obtain preprocessed data;
[0105] A conversion module 702, configured to convert the pre-processed data into a user question vector using natural language processing technology and a deep learning model;
[0106] The calculation module 703 is used to obtain the existing question vector in the preset knowledge base, and calculate the similarity evaluation value between the user question vector and the existing question vector;
[0107] A judgment module 704 is used to sort the existing question vectors in descending order according to the similarity evaluation values, and to judge whether the highest value of the similarity evaluation value is higher than a preset threshold;
[0108] Feedback module 705 is used to select at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions when the highest value of the similarity evaluation value is not higher than the preset threshold, generate guiding prompts according to the example questions, and generate feedback messages according to the example questions and the guiding prompts.
[0109] In this embodiment, the preprocessing module 701 includes: a first deletion unit 7011, which is used to receive user question content, remove HTML tags, special characters and redundant spaces in the user question content, and obtain primary processing data; a second deletion unit 7012, which is used to read a preset stop word list, and use a string processing function to remove stop words in the stop word list from the primary processing data to obtain secondary processing data; a standardization unit 7013, which is used to standardize the secondary processing data to obtain preprocessing data.
[0110] In this embodiment, the conversion module 702 includes: a construction unit 7021, which is used to construct a vocabulary based on preprocessed data using a bag-of-words model; a first calculation unit 7022, which is used to calculate the term frequency TF value and the inverse document frequency IDF value of each word in the vocabulary, and obtain the TF-IDF value corresponding to each word according to the TF value and the IDF value, and integrate the TF-IDF values corresponding to all words to form a feature vector of the user question; a conversion unit 7023, which is used to input the feature vector into a question vector conversion model based on a convolutional neural network to obtain the user question vector output by the question vector conversion model.
[0111] In this embodiment, the calculation module 703 includes: a second calculation unit 7031, which is used to obtain an existing question vector in a preset knowledge base, and calculate the first similarity between the user question vector and the existing question vector by using a cosine similarity calculation method according to the user question vector and the existing question vector; a third calculation unit 7032, which is used to calculate the second similarity between the user question vector and the existing question vector by using a Euclidean distance calculation method according to the user question vector and the existing question vector; a fourth calculation unit 7033, which is used to calculate the third similarity between the user question vector and the existing question vector by using a Manhattan distance calculation method according to the user question vector and the existing question vector; and a fifth calculation unit 7034, which is used to weightedly average the first similarity, the second similarity and the third similarity to obtain a similarity evaluation value between the user question vector and the existing question vector.
[0112] In this embodiment, the judgment module 704 includes: a sorting unit 7041, which is used to sort the existing question vectors in descending order according to the similarity evaluation values to obtain a sorted list; a comparison unit 7042, which is used to take the similarity evaluation value of the existing question vector located in the first position in the sorted list as a comparison value, and compare the comparison value with a preset threshold; a judgment unit 7043, which is used to determine that the highest value of the similarity evaluation value is higher than the preset threshold when the comparison value is greater than the preset threshold, and vice versa, determine that the highest value of the similarity evaluation value is not higher than the preset threshold.
[0113] In this embodiment, the feedback module 705 includes: a selection unit 7051, which is used to select at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions when the highest value of the similarity evaluation value is not higher than the preset threshold value; a generation unit 7052, which is used to analyze the commonalities of the example questions and generate guiding prompts based on the commonalities of the example questions; a feedback unit 7053, which is used to call a preset feedback template, fill the example questions and guiding prompts into the feedback template, and generate a feedback message.
[0114] In this embodiment, by integrating natural language processing, deep learning and intelligent matching algorithms, it can quickly understand user intentions, automatically retrieve the most relevant answers from the preset knowledge base, and when a matching answer cannot be found directly, it can effectively guide users to rephrase the question by providing example questions and guiding prompts, thereby significantly improving user experience and customer service efficiency.
[0115] above Figure 7 The logistics intelligent customer service online question and answer device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The logistics intelligent customer service online question and answer device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0116] Figure 8It is a structural diagram of a logistics intelligent customer service online question-and-answer device provided in an embodiment of the present invention. The device 800 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 810 (for example, one or more processors) and a memory 820, and one or more storage media 830 (for example, one or more massive storage devices) storing application programs 833 or data 832. Among them, the memory 820 and the storage medium 830 can be short-term storage or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), and each module may include a series of instruction operations in the device 800. Furthermore, the processor 810 may be configured to communicate with the storage medium 830 and execute a series of instruction operations in the storage medium on the device 800.
[0117] The device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input and output interfaces 860, and / or one or more operating systems 831, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, etc.
[0118] An embodiment of the present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of the logistics intelligent customer service online question and answer method.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0120] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0121] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A logistics intelligent customer service online question and answer method, characterized in that: The logistics intelligent customer service online question and answer method includes: Receiving user question content, and preprocessing the user question content to obtain preprocessed data; Using natural language processing technology and deep learning models to convert the pre-processed data into user question vectors; Obtaining an existing question vector in a preset knowledge base, and calculating a similarity evaluation value between the user question vector and the existing question vector; Sorting the existing question vectors in descending order according to the similarity evaluation values, and determining whether the highest value of the similarity evaluation value is higher than a preset threshold; If not, questions corresponding to at least three existing question vectors are selected from the sorted existing question vectors according to similarity from high to low as example questions, guiding prompts are generated according to the example questions, and feedback messages are generated according to the example questions and the guiding prompts.
2. The online question-and-answer method for logistics intelligent customer service according to claim 1 is characterized in that: The receiving of user question content and preprocessing the user question content to obtain preprocessed data includes: Receive the user's question content, remove HTML tags, special characters and extra spaces in the user's question content, and obtain processed data; Read the preset stop word list, and use the string processing function to remove the stop words in the stop word list from the first-processed data to obtain the second-processed data; The secondary processed data is standardized to obtain the preprocessed data.
3. The online question-and-answer method for logistics intelligent customer service according to claim 1 is characterized in that: The method of converting the pre-processed data into a user question vector by using natural language processing technology and a deep learning model includes: Based on the preprocessed data, the vocabulary is constructed using the bag-of-words model; Calculate the TF value and the inverse document frequency IDF value of each word in the vocabulary, calculate the TF-IDF value corresponding to each word based on the TF value and IDF value, and integrate the TF-IDF values corresponding to all words to form the feature vector of the user question; The feature vector is input into a question vector conversion model based on a convolutional neural network to obtain a user question vector output by the question vector conversion model.
4. The online question-and-answer method for logistics intelligent customer service according to claim 3 is characterized in that: The step of inputting the feature vector into a question vector conversion model based on a convolutional neural network to obtain a user question vector output by the question vector conversion model includes: According to the dimension and type of the feature vector, the input layer of the pre-built CNN architecture is adjusted, and a plurality of convolutional layers, pooling layers, activation layers, and fully connected layers are added after the adjusted input layer to construct an initial CNN model; Loading the pre-trained CNN model weights into the CNN initial model for fusion to obtain a problem vector conversion model; The feature vector is input into the question vector conversion model to obtain the user question vector output by the question vector conversion model.
5. The online question-and-answer method for logistics intelligent customer service according to claim 1 is characterized in that: The obtaining of existing question vectors in a preset knowledge base and calculating a similarity evaluation value between the user question vector and the existing question vector includes: Obtain an existing question vector in a preset knowledge base, and calculate a first similarity between the user question vector and the existing question vector using a cosine similarity calculation method according to the user question vector and the existing question vector; According to the user question vector and the existing question vector, a second similarity between the user question vector and the existing question vector is calculated by using a Euclidean distance calculation method; A third similarity between the user question vector and the existing question vector is calculated using a Manhattan distance calculation method according to the user question vector and the existing question vector; The first similarity, the second similarity and the third similarity are weighted averaged to obtain a similarity evaluation value between the user question vector and the existing question vector.
6. The online question-and-answer method for logistics intelligent customer service according to claim 1 is characterized in that: The step of sorting the existing question vectors in descending order according to the similarity evaluation values and determining whether the highest value of the similarity evaluation values is higher than a preset threshold value includes: Sorting the existing question vectors in descending order according to the similarity evaluation values to obtain a sorted list; Using the similarity evaluation value of the existing question vector that is first in the sorted list as a comparison value, and comparing the comparison value with a preset threshold; If the comparison value is greater than the preset threshold, it means that the highest value of the similarity evaluation value is higher than the preset threshold, otherwise, it means that the highest value of the similarity evaluation value is not higher than the preset threshold.
7. The online question-and-answer method for logistics intelligent customer service according to claim 1 is characterized in that: If not, then selecting questions corresponding to at least three existing question vectors from the sorted existing question vectors according to similarity from high to low as example questions, generating guiding prompts according to the example questions, and generating feedback messages according to the example questions and the guiding prompts, including: When the highest value of the similarity evaluation value is not higher than the preset threshold, at least three questions corresponding to the existing question vectors are selected from the sorted existing question vectors according to the similarity from high to low as example questions; Analyze the common features of the sample questions and generate guiding prompts based on the common features of the sample questions; Call the preset feedback template, fill the sample questions and guiding prompts into the feedback template, and generate a feedback message.
8. A logistics intelligent customer service online question and answer device, characterized in that: include: A preprocessing module, used for receiving user question content and preprocessing the user question content to obtain preprocessed data; A conversion module, used to convert the pre-processed data into a user question vector using natural language processing technology and a deep learning model; A calculation module, used to obtain an existing question vector in a preset knowledge base, and calculate a similarity evaluation value between the user question vector and the existing question vector; A judgment module, used to sort the existing question vectors in descending order according to the similarity evaluation values, and judge whether the highest value of the similarity evaluation value is higher than a preset threshold; A feedback module is used to select at least three questions corresponding to the existing question vectors from the sorted existing question vectors according to the similarity from high to low as example questions when the highest value of the similarity evaluation value is not higher than a preset threshold, generate guiding prompts according to the example questions, and generate feedback messages according to the example questions and the guiding prompts.
9. A logistics intelligent customer service online question and answer device, characterized in that: comprising a memory and at least one processor, wherein the memory has computer-readable instructions stored therein; The at least one processor calls the computer-readable instructions in the memory to execute the various steps of the logistics intelligent customer service online question and answer method as described in any one of claims 1-7.
10. A computer-readable storage medium having computer-readable instructions stored thereon, characterized in that: When the computer-readable instructions are executed by the processor, the various steps of the logistics intelligent customer service online question-and-answer method as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Method and device for constructing warehouse management intelligent customer service based on local LLM
CN119884326A
A method and device for constructing an intelligent customer service for warehouse management based on a local LLM
CN119884326B
