Text processing method, intelligent question and answer method and related equipment

By extracting text features through a multi-round DBSCAN clustering method and a pre-trained model, and by decreasing the radius parameter to handle clusters with insufficient intra-class similarity, this approach solves the problems of unknown cluster numbers and hyperparameter sensitivity in existing text clustering algorithms, thereby improving clustering accuracy and efficiency.

CN120994830APending Publication Date: 2025-11-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410619551.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing text clustering algorithms require a predefined number of clusters and are sensitive to hyperparameters, resulting in low clustering accuracy and an inability to guarantee that the text similarity within the same cluster category meets the requirements.

Method used

The multi-round DBSCAN clustering method is adopted. By increasing the number of clustering rounds and decreasing the radius parameter, clustering is further processed for clusters with intra-class similarity less than a threshold. Text feature information is extracted using a pre-trained model, and the category to which the text belongs is determined based on the clustering results.

Benefits of technology

This method improves clustering accuracy without pre-determining the number of clusters, solves the hyperparameter sensitivity problem, ensures that the text similarity in clusters meets the threshold requirement, and improves the accuracy and efficiency of clustering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120994830A_ABST
    Figure CN120994830A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a text processing method, an intelligent question and answer method and related equipment, and belongs to the technical field of computers. The text processing method comprises the steps of performing feature extraction on a to-be-processed text to obtain text feature information of the to-be-processed text; performing clustering processing on the text feature information according to the first radius parameter to obtain a first clustering result of the to-be-processed text; and for a first clustering category of which the intra-category similarity is smaller than a threshold value in the first clustering result, clustering processing is performed on the text feature information in the first clustering category by adopting a second radius parameter to obtain an updated clustering result of the to-be-processed text in the first clustering category, and the second radius parameter is smaller than the first radius parameter. The method provided by the embodiment of the invention relates to a natural language processing technology in the field of artificial intelligence, and can also be applied to a pre-training model for implementation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a text processing method, an intelligent question-answering method, a text processing device, an intelligent question-answering device, a computer device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] Clustering after text feature extraction can employ many conventional clustering algorithms. However, each algorithm presents different challenges when applied to text clustering scenarios. For instance, some algorithms require a predefined number of clusters, while the number of categories in some text clustering scenarios cannot be known in advance. Some algorithms are sensitive to hyperparameters, whose settings directly affect the final clustering accuracy. Furthermore, conventional clustering algorithms cannot guarantee that the similarity of text within the same cluster meets the requirements, rendering them unsuitable for some scenarios. Summary of the Invention

[0003] This disclosure provides a text processing method, which includes: extracting features from the text to be processed to obtain text feature information of the text to be processed; performing clustering processing on the text feature information according to a first radius parameter to obtain a first clustering result of the text to be processed; for a first clustering category in the first clustering result with intra-class similarity less than a threshold, performing clustering processing on the text feature information in the first clustering category using a second radius parameter to obtain an updated clustering result of the text to be processed in the first clustering category, wherein the second radius parameter is smaller than the first radius parameter.

[0004] This disclosure provides a text processing method, which includes: extracting features from a question text to obtain question text feature information; performing clustering processing on the question text feature information according to a first radius parameter to obtain a first clustering result of the question text; for a first clustering category in the first clustering result where the intra-cluster similarity is less than a threshold, performing clustering processing on the question text feature information in the first clustering category using a second radius parameter to obtain an updated clustering result of the question text in the first clustering category, wherein the second radius parameter is less than the first radius parameter; and determining the clustering category to which the question text belongs based on the first clustering result and the updated clustering result.

[0005] This disclosure provides an intelligent question-answering method, which includes: receiving a question to be answered; determining the cluster category to which the question to be answered belongs; determining the central question of the cluster category to which the question to be answered belongs; obtaining corrected response information for the central question; and using the corrected response information as the answer content for the question to be answered.

[0006] This disclosure provides a text processing apparatus, comprising: a processing unit configured to extract features from a text to be processed to obtain text feature information of the text to be processed; the processing unit further configured to perform clustering processing on the text feature information according to a first radius parameter to obtain a first clustering result of the text to be processed; the processing unit further configured to, for a first clustering category in the first clustering result with an intra-class similarity less than a threshold, perform clustering processing on the text feature information in the first clustering category using a second radius parameter to obtain an updated clustering result of the text to be processed in the first clustering category, wherein the second radius parameter is smaller than the first radius parameter.

[0007] This disclosure provides a text processing apparatus, comprising: a processing unit configured to extract features from a question text to obtain question text feature information; the processing unit further configured to perform clustering processing on the question text feature information according to a first radius parameter to obtain a first clustering result of the question text; the processing unit further configured to, for a first clustering category in the first clustering result with an intra-cluster similarity less than a threshold, perform clustering processing on the question text feature information in the first clustering category using a second radius parameter to obtain an updated clustering result of the question text in the first clustering category, wherein the second radius parameter is less than the first radius parameter; the processing unit further configured to determine the clustering category to which the question text belongs based on the first clustering result and the updated clustering result.

[0008] This disclosure provides an intelligent question-answering device, comprising: a transceiver unit for receiving a question to be answered; a processing unit for determining the cluster category to which the question to be answered belongs; the processing unit is further configured to determine the central question of the cluster category to which the question to be answered belongs; the processing unit is further configured to obtain corrected response information for the central question; and the processing unit is further configured to use the corrected response information as the answer content for the question to be answered.

[0009] This disclosure provides a computer device including a processor, a memory, and an input / output interface. The processor is connected to both the memory and the input / output interface. The input / output interface is used to receive and output data. The memory is used to store a computer program. The processor is used to invoke the computer program to cause the computer device containing the processor to execute the method in any embodiment of this disclosure.

[0010] This disclosure provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, such that a computer device having the processor performs the methods of any embodiment of this disclosure.

[0011] This disclosure provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various alternative embodiments of this disclosure. Attached Figure Description

[0012] Figure 1 This is a flowchart of a text processing method provided in an embodiment of this disclosure.

[0013] Figure 2 This is a flowchart of another text processing method provided in this embodiment of the disclosure.

[0014] Figure 3 This is a flowchart of another text processing method provided in this disclosure.

[0015] Figure 4 This is a schematic diagram of a model training method provided in an embodiment of this disclosure.

[0016] Figure 5 This is a schematic diagram illustrating feature extraction using the model provided in the embodiments of this disclosure.

[0017] Figure 6 This is a schematic diagram of a clustering method provided in an embodiment of this disclosure.

[0018] Figure 7 This is a flowchart of a clustering method provided in an embodiment of this disclosure.

[0019] Figure 8 This is a schematic diagram of a multi-round clustering method provided in an embodiment of this disclosure.

[0020] Figure 9 This is a schematic diagram illustrating an application scenario of the method provided in this embodiment.

[0021] Figure 10 This is a schematic diagram illustrating another application scenario of the method provided in the embodiments of this disclosure.

[0022] Figure 11 This is a flowchart of an intelligent question-answering method provided in an embodiment of this disclosure.

[0023] Figure 12 This is a schematic diagram of an interaction interface between a user and a robot provided in an embodiment of this disclosure.

[0024] Figure 13 This is a schematic diagram of an interaction interface between a user and a voice assistant provided in an embodiment of this disclosure.

[0025] Figure 14 This is a schematic diagram of a text processing device provided in an embodiment of the present disclosure.

[0026] Figure 15 This is a schematic diagram of another text processing apparatus provided in an embodiment of this disclosure.

[0027] Figure 16 This is a schematic diagram of an intelligent question-and-answer device provided in an embodiment of this disclosure.

[0028] Figure 17 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0029] The technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0030] In this disclosure, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0031] First, some of the terms used in the embodiments of this disclosure will be explained.

[0032] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0033] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, pre-trained model technology, operating / interactive systems, and mechatronics.

[0034] Among them, the pre-training model (PTM), also known as the large model, foundational model, or cornerstone model, refers to a deep neural network (DNN) with a large number of parameters. It is trained on massive amounts of unlabeled data, leveraging the function approximation capabilities of the large-parameter DNN to extract common features from the data. Through fine-tuning, efficient parameter fine-tuning (PEFT), prompt-tuning, and other techniques, it is suitable for downstream tasks in various fields of artificial intelligence. Therefore, pre-trained models can achieve ideal results in scenarios with few or zero samples. Based on the data modalities they process, PTMs can be categorized into language models (e.g., ELMO, Bidirectional Encoder Representations from Transformers (BERT), GPT), visual models (swin-transformer, ViT, V-MOE), speech models (VALL-E), and multimodal models (ViBERT, CLIP, Flamingo, Gato), among others. Multimodal models refer to models that establish feature representations for two or more data modalities. Pre-trained models are crucial tools for outputting Artificial Intelligence Generated Content (AIGC) and can also serve as a universal interface connecting multiple task-specific models.

[0035] Artificial intelligence software technology mainly includes several major areas such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0036] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP deals with natural language, the language people use in daily life, and is closely related to linguistics; it also involves computer science and mathematics. Pre-trained models, a crucial technique for model training in artificial intelligence, evolved from large language models in NLP. After fine-tuning, large language models can be widely applied to downstream tasks. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0037] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, digital twins, virtual humans, robots, AIGC, conversational interaction, smart healthcare, smart customer service, and game AI. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.

[0038] This disclosure relates to the use of machine learning techniques in artificial intelligence to achieve text processing and robot question answering.

[0039] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and pre-trained learning. Pre-trained models are the latest development in deep learning, integrating all of these techniques.

[0040] The methods provided in the embodiments of this disclosure can be executed by any electronic device or computer device with information processing capabilities, such as a terminal and / or a server, and this disclosure does not limit them.

[0041] like Figure 1 As shown, the text processing method provided in this embodiment includes the following steps.

[0042] In S110, feature extraction is performed on the text to be processed to obtain the text feature information of the text to be processed.

[0043] In this embodiment of the disclosure, the text to be processed refers to the text that needs to be clustered to determine its cluster category. The text to be processed can be short sentences, and therefore can also be called short text. Before clustering the text to be processed, the text feature information of the text to be processed can be extracted. For example, the text to be processed can be processed by a trained feature extraction model to obtain the vector representation of the text to be processed, which serves as the text feature information of the text to be processed.

[0044] In an exemplary embodiment, feature extraction of the text to be processed to obtain text feature information includes: processing a first sample text and a second sample text respectively through a pre-trained model and a processing layer to obtain first sample feature information of the first sample text and second sample feature information of the second sample text; obtaining a predicted similarity between the first sample text and the second sample text based on the first sample feature information and the second sample feature information; training the pre-trained model and the processing layer based on the predicted similarity and the true similarity between the first sample text and the second sample text to obtain a feature extraction model including the pre-trained model and the processing layer; and processing the text to be processed through the feature extraction model to obtain the text feature information.

[0045] In this embodiment of the disclosure, sample text refers to text used to train or fine-tune a pre-trained model to obtain a feature extraction model for the text to be processed. The first sample text can be any sample text. The first sample text and the second sample text are a text pair, which are pre-labeled with true similarity. This true similarity represents the similarity between the labeled first sample text and the second sample text. For example, it can represent whether the first sample text and the second sample text are similar, or it can represent a similarity score between the first sample text and the second sample text. The higher the score, the more similar the two are. This disclosure does not limit the way the true similarity is represented.

[0046] In this embodiment, the first sample text is processed through a pre-trained model and a processing layer to obtain the first sample feature information of the first sample text. The second sample text is then processed through the same pre-trained model and processing layer to obtain the second sample feature information of the second sample text. The predicted similarity between the first and second sample texts is then obtained based on the first and second sample feature information. Here, the same pre-trained model and processing layer refer to the same model type, model parameters, processing operations performed by the processing layer, and parameters. The predicted similarity refers to the similarity obtained based on the first and second sample feature information of the first and second sample texts output after processing by the pre-trained model and processing layer, corresponding to the pre-labeled true similarity. A loss function is constructed based on the obtained predicted similarity and the true similarity between the first and second sample texts. The pre-trained model and processing layer are then trained to obtain a feature extraction model including the pre-trained model and processing layer. The text to be processed is then input into this trained feature extraction model for processing, and the feature extraction model outputs the text feature information of the text to be processed. The following describes the process in conjunction with... Figures 3 to 5 Let's illustrate this with examples.

[0047] It is understood that the feature extraction in this embodiment is not limited to the methods given above. For example, any one or more of the following methods may be used: term frequency–inverse document frequency (TF-IDF), related models used to generate word vectors (e.g., word to vector, word2vec), BERT, etc.

[0048] For example, the term frequency features of the text / short text to be processed can be extracted using TF-IDF, and these term frequency features can be used as the text feature information of the text / short text to be processed, thereby performing clustering processing based on these term frequency features. First, all the text / short text data to be processed can be segmented to obtain each word in the text / short text to be processed, and then the term frequency (TF) and inverse document frequency (IDF) can be calculated using the following formulas (1) and (2):

[0049]

[0050]

[0051] Then, calculate the TF-IDF value according to the following formula (3):

[0052] TF-IDF = TF × IDF(3)

[0053] The word frequency of each word in the short text is calculated according to the formula (1) above. The word frequency matrix of the short text is constructed by combining the word frequencies of each word in the short text. The matrix element represents the word frequency of the j-th word in the i-th short text. The word frequency is weighted based on the TF-IDF value. Optionally, the weighted vector obtained in the previous step can be reduced to a low-dimensional vector by principal component analysis (PCA) as text feature information.

[0054] For example, the word2vec method can be used to obtain the vector representation of a short text, which serves as the textual feature information of that short text. Then, based on this vector representation, all short texts can be clustered to obtain the clustering results. Specifically, the word2vec method is used to segment and vectorize each short text, defining the vector dimension m (m is a positive integer greater than or equal to 1) to obtain the vector representation of each short text.

[0055] For example, the vector representation of a short text can be obtained through a BERT pre-trained model as the textual feature information of the short text. Then, all short texts can be clustered based on the vector representation to obtain the clustering result.

[0056] In S120, the text feature information is clustered according to the first radius parameter to obtain the first clustering result of the text to be processed.

[0057] In this embodiment, the radius parameter is a hyperparameter of the clustering method used. For example, assuming a density-based clustering algorithm (e.g., Density-Based Spatial Clustering of Applications with Noise, DBSCAN) is used, the radius parameter can be the maximum radius of the community neighborhood in DBSCAN, hereinafter denoted by e. When textual feature information is represented as data points in a coordinate system, if the distance between data points is less than or equal to the specified e, then these data points will be in the same class (i.e., belong to the same cluster category). That is, the radius parameter is the distance used in DBSCAN to determine whether two data points are similar and belong to the same class. Setting a larger e will produce larger classes (containing more data points), and setting a smaller e will build smaller classes (containing fewer data points). The region within a radius e of a given object is called the e-neighborhood of that object (e.g., a data point). Unlike partitioning and hierarchical clustering methods, DBSCAN defines a cluster as the largest set of density-connected points, enabling the division of regions with sufficiently high density into clusters and the discovery of clusters of arbitrary shapes in noisy spatial databases.

[0058] In an exemplary embodiment, clustering the text feature information according to a first radius parameter to obtain a first clustering result of the text to be processed includes: selecting text feature information with at least a minimum point within its first radius parameter as a first core point to construct a second cluster category; for the first text feature information within the first radius parameter of the first core point, if the text feature information within its first radius parameter has the minimum point, then the first text feature information is used as a second core point to expand the second cluster category; for the first text feature information within the first radius parameter of the first core point, if the text feature information within its first radius parameter does not have the minimum point, then the first text feature information is used as a boundary point of the second cluster category.

[0059] Taking DBSCAN as an example again, it also includes another hyperparameter: the minimum point (minPts). Within a radius of a neighborhood, the neighborhood of the minPt number is considered a class. The initial point (i.e., the data point randomly selected at the beginning) is included in minPts. A lower minPts helps the algorithm build more clusters and more noise or outliers. A higher minPts will ensure more robust clusters, but if the clusters are too large, smaller clusters will be merged into larger clusters.

[0060] In this embodiment of the disclosure, for example, minPts can be set to 2, thereby eliminating sparsity issues (outliers) based on the business scenario to which this embodiment of the disclosure applies. The smaller minPts is, the easier it is to distinguish outliers, while minPts = 1 indicates that a single sample can belong to a class, which has no practical significance.

[0061] In this embodiment of the disclosure, if the number of sample points (e.g., the number of data points) in the neighborhood of a given object e is greater than or equal to MinPts, then the data point is called a core point, or the object is called a core object. The terms first core point, second core point, third core point, etc., are only used to distinguish different core points.

[0062] In an exemplary embodiment, the method provided by this disclosure further includes: determining the central feature information of the first cluster category; obtaining the similarity between the text feature information in the first cluster category and the central feature information of the first cluster category; and if the minimum similarity among the similarities between the text feature information in the first cluster category and the central feature information of the first cluster category is less than the threshold, then determining that the intra-cluster similarity of the first cluster category is less than the threshold.

[0063] In an exemplary embodiment, determining the central feature information of the first cluster category includes: determining the cluster center point of the first cluster category based on the text feature information in the first cluster category; obtaining the similarity between the text feature information in the first cluster category and the cluster center point; and selecting the text feature information with the highest similarity to the cluster center point from the text feature information in the first cluster category as the central feature information of the first cluster category.

[0064] In this embodiment, a multi-round DBSCAN clustering method is employed, with different radius parameters set in each round. The radius parameter decreases as the number of rounds increases. For distinction, the radius parameter set in the previous round (e.g., the first round) is called the first radius parameter, and the radius parameter set in the subsequent round (e.g., the second round) is called the second radius parameter. The first radius parameter is greater than the second radius parameter. In the previous round of clustering, the cluster category to which each data point belongs is determined based on the first radius parameter. The resulting clustering is referred to as the first clustering result for distinction. The first clustering result includes a first cluster category (which can be any cluster category within the first clustering result). For each data point (i.e., the textual feature information of each text to be processed) contained in the first cluster category, the similarity between different data points is calculated. Since these data points belong to the same cluster category, the calculated similarity is called intra-cluster similarity. If the intra-cluster similarity among all data points in the first cluster is greater than the threshold, then the intra-cluster similarity of the first cluster meets the threshold standard, indicating that the similarity among all data points in the first cluster is high, and further clustering iterations for this first cluster are not necessary. If the minimum intra-cluster similarity in the first cluster is less than the threshold, then the intra-cluster similarity of the first cluster does not meet the threshold standard, indicating that at least one data point in the first cluster has insufficient similarity, and further clustering iterations for this first cluster are required. For example, clustering is performed on each data point in the first cluster based on the second radius parameter to obtain the updated clustering result for the first cluster. This iterative process continues until all clusters in the final clustering result meet the threshold standard, at which point the iteration stops, and the clustering result obtained at this point is taken as the final clustering result.

[0065] In some embodiments, when determining whether a first cluster category meets a threshold criterion, the similarity between every two data points in the first cluster category can be calculated, and then it can be determined whether each calculated similarity is greater than the set threshold.

[0066] In other embodiments, when determining whether a first cluster category meets the threshold criterion, the central feature information of the first cluster category can be determined first. This is the text feature information corresponding to the data point that is closest to (most similar to) the cluster center point of the first cluster category. The text to be processed corresponding to this central feature information can be called the central text of the first cluster category. The cluster center point of the first cluster category can be calculated based on all data points in the first cluster category, for example, using the vector mean of all data points in the first cluster category as the cluster center point, but this disclosure is not limited to this. After determining the central feature information of the first cluster category, the similarity between each of the other data points in the first cluster category and the central feature information is calculated. The minimum similarity is compared with the threshold. If the minimum similarity is greater than the threshold, the first cluster category is determined to meet the threshold criterion; otherwise, it is determined not to meet the threshold criterion. In this way, this disclosure not only determines whether a cluster category (including the first cluster category) meets the threshold criterion, but also determines the central feature information and central text of each cluster category. In subsequent processing, this central text can be used to represent all the text to be processed in the corresponding cluster, thereby improving text processing efficiency. Furthermore, since the similarity between all the text to be processed in this cluster and the central text is high, using the central text to represent all the text to be processed in this cluster will not reduce the accuracy of text processing.

[0067] In this embodiment of the disclosure, the value of the threshold can be set according to the time business requirements. For example, if a higher intra-class similarity is desired, a larger threshold can be set; if a lower intra-class similarity is desired, a smaller threshold can be set. This disclosure does not limit the value of the threshold.

[0068] In S130, for the first cluster category whose intra-cluster similarity is less than the threshold in the first clustering result, the text feature information in the first cluster category is clustered using the second radius parameter to obtain the updated clustering result of the text to be processed in the first cluster category, wherein the second radius parameter is less than the first radius parameter.

[0069] In an exemplary embodiment, for a first cluster category whose intra-cluster similarity is less than a threshold in the first clustering result, the text feature information in the first cluster category is clustered using a second radius parameter to obtain the updated clustering result of the text to be processed in the first cluster category. This includes: selecting text feature information with at least a minimum point within its second radius parameter as a third core point from the text feature information of the first cluster category to construct a third cluster category; for the second text feature information within the second radius parameter of the third core point, if it contains the minimum point, then the second text feature information is used as a fourth core point to expand the third cluster category; for the second text feature information within the second radius parameter of the third core point, if it does not contain the minimum point, then the second text feature information is used as a boundary point of the third cluster category.

[0070] The text processing method provided in this disclosure, on the one hand, obtains the number of cluster categories in the final clustering result by decreasing the radius parameter as the number of clustering rounds increases. This eliminates the need to predetermine the number of cluster categories at the beginning of the clustering process, allowing the method to be applied to scenarios where the number of cluster categories cannot be determined beforehand, such as clustering different user question data where the number of categories is unknown in advance. On the other hand, by iteratively decreasing the radius parameter over multiple rounds, the hyperparameter sensitivity problem in clustering processing can be solved, avoiding the reduction in clustering accuracy caused by an initially set fixed radius parameter that is too large or too small, thereby improving the clustering accuracy of the final clustering result.

[0071] The method provided in this disclosure can be applied to clustering problem texts. Figure 2 In this embodiment, the text to be processed is illustrated using question text as an example. Question text refers to text containing questions that need to be answered or responded to. This question text can come from questions directly input into the electronic device in text form, or from questions input in voice form and then converted into text form by the electronic device. It can also come from various sources such as recognized gestures and images, and finally be converted into text form. For example... Figure 2 As shown, the method provided in this disclosure embodiment may include the following steps.

[0072] In S210, feature extraction is performed on the problem text to obtain the problem text feature information.

[0073] For example, the question text can be input into the feature extraction model that has been trained above, and the feature extraction model outputs a vector representation of the question text as its question text feature information, but this disclosure is not limited to this.

[0074] In S220, the feature information of the problem text is clustered according to the first radius parameter to obtain the first clustering result of the problem text.

[0075] In S230, for the first cluster category whose intra-cluster similarity is less than the threshold in the first clustering result, the second radius parameter is used to perform clustering processing on the feature information of the question text in the first cluster category to obtain the updated clustering result of the question text in the first cluster category, wherein the second radius parameter is less than the first radius parameter.

[0076] The processing of S220 and S230 can be referred to the above. Figure 1 In the embodiment, S120 and S130 refer to the clustering process after multiple rounds (two rounds are taken as examples here, but the actual number of iterations is determined by a combination of factors such as the input question text, the set threshold, and the radius parameter set at the beginning) to obtain the final clustering result of all question texts. In the final clustering result, the similarity between question texts in each cluster category is greater than the set threshold, that is, the similarity between question texts in each cluster category is high.

[0077] In S240, based on the first clustering result and the updated clustering result, the cluster category to which the question text belongs is determined.

[0078] After obtaining the final clustering results, it can be determined how many clusters all the question texts were clustered into, and which cluster each question text belongs to. Based on the total number of clusters, each cluster is assigned a unique identifier, and each question text is labeled with a cluster label, that is, the identifier indicates the cluster to which each question text belongs. For example, one or more of the following can be used as cluster labels: numbers, words, letters, symbols, etc. This disclosure does not limit the way cluster labels are expressed.

[0079] In an exemplary embodiment, the method provided by this disclosure further includes: determining the cluster center point of the corresponding cluster category based on the question text feature information in each cluster category; obtaining the similarity between the question text feature information in each cluster category and the cluster center point of the corresponding cluster category; selecting the question text feature information with the highest similarity to the cluster center point of the cluster category as the center feature information of the corresponding cluster category, and taking the question text corresponding to the center feature information as the center question of the corresponding cluster category.

[0080] In an exemplary embodiment, the method provided by this disclosure further includes: obtaining response information corresponding to the central question of each cluster category; obtaining corrected response information of the response information of the central question; and using the corrected response information of the central question as corrected response information of the question text in the corresponding cluster category.

[0081] In this embodiment, after each round of clustering, it can be determined whether each cluster category meets the threshold criteria. During the determination process, the central feature information of each cluster category can be determined, and the question text corresponding to the central feature information is taken as the central question of that cluster category. Since each cluster category in the final clustering result meets the threshold criteria / requirements, the similarity between the question texts in each cluster category is high, and the central question is most similar to the cluster center point of that cluster category. Therefore, the central question can be used to represent all other question texts in that cluster center. When it is necessary to correct, adjust, or optimize the response information of the question corresponding to the question text, only the response information of the central question needs to be corrected. The corrected response information of the central question is used as the corrected response information of all question texts in that cluster category, instead of correcting the response information of each question text one by one. This achieves the correction of the response information of a batch of questions in one correction, improving the efficiency of text processing, while ensuring the accuracy of the correction.

[0082] Figure 3 This is a flowchart of yet another text processing method provided in this disclosure. For example... Figure 3 As shown, the method provided in this disclosure embodiment may include the following steps.

[0083] In S31, obtain the question pair.

[0084] Figure 3 In this embodiment, the text pairs used to train the feature extraction model are used as example question pairs. These question pairs can come from open-source data or from proprietary labeled question pairs. These question pairs or question pair samples are used to train the BERT-CoSENT model to obtain the feature extraction model.

[0085] In S32, the question is input into BERT.

[0086] Figure 3 The example uses BERT as the pre-trained model. Specifically, since the question samples or question texts are generally in sentence form, the Sentence-BERT model, which can extract sentence vectors representing sentence semantics, can be used.

[0087] In S33, BERT is trained using CoSENT to obtain BERT-CoSENT.

[0088] In this embodiment, the BERT pre-trained model can be fine-tuned based on CoSENT (Cosine Sentence). The BERT model after CoSENT fine-tuning is called the BERT-CoSENT model. A sentence vector is a vector that can represent the semantics of the entire sentence.

[0089] CoSENT is an improved sentence vector training scheme based on Sentence-BERT that improves upon CosineRankLoss. Its model structure diagram is as follows. Figure 4 As shown, CosineRankLoss is a loss function used in machine learning tasks that require comparing the similarity between two vectors. It measures the similarity between two vectors based on cosine similarity and optimizes the model based on this similarity.

[0090] In S34, the user questions to be clustered are obtained, and the user questions to be clustered are input into BERT-CoSENT to obtain the user question vector.

[0091] For example, the user question to be clustered can be historical question text from user-bot dialogues, also known as historical question samples. Inputting this user question into the pre-trained BERT-CoSENT model will output a user question vector, which serves as the question text feature information for that user question.

[0092] In S35, the user's question vector is input into DBSCAN.

[0093] Figure 3 The example uses the density-based clustering method DBSCAN as an illustration.

[0094] In S36, DBSCAN is used to perform multi-round clustering on the user question vector to obtain the cluster labels and cluster centers of the user questions.

[0095] After multiple rounds of clustering, the final clustering result can be obtained, which can then determine the cluster category to which each user's question belongs. The cluster label indicates the cluster category to which the user's question belongs, and the cluster center indicates the central question within that cluster category.

[0096] The text processing method provided in this disclosure optimizes the BERT pre-trained model using the CoSENT algorithm, i.e., the BERT fine-tuning model obtained based on the CoSENT training method focuses more on the semantic similarity between sentences, resulting in higher accuracy and better performance in clustering user questions. Furthermore, after obtaining the vector representation of the user question (which can be short text), the user question vector is input as feature information of the question text into an improved multi-round DBSCAN clustering model to obtain the final clustering result, thus completing the entire user question clustering process. This method solves the hyperparameter sensitivity problem in DBSCAN while retaining the advantages of density clustering algorithms, exhibiting good robustness, insensitivity to outliers, and the ability to handle outliers effectively. It can cluster based on arbitrary spatial shapes, making it very suitable for user question clustering and meeting the accuracy requirements of user question clustering scenarios. In addition, the multi-round DBSCAN clustering method provided in this disclosure ensures computational efficiency even with a large number of cluster categories and a large amount of data, thus improving computational efficiency.

[0097] Figure 4 This is a schematic diagram illustrating a model training method provided in an embodiment of this disclosure. For example... Figure 4 As shown, sentences A and B are assumed to be a sentence pair or a set of question pairs, which can be derived from open-source data and proprietary historical data annotations. Sentences A and B are input into the BERT model, and after encoding by the BERT pre-trained model, vectors for each character in the sentences are obtained. Then, a processing layer, such as a pooling layer, is used to average all the character vectors in the sentences, obtaining the sentence vector U for sentence A and the sentence vector V for sentence B, which are used as the first and second sample feature information, respectively. Then, the cosine similarity between sentences A and B is calculated using cosine-sim (UV), serving as the predicted similarity between sentences A and B. Cosine similarity is a measure of the directional similarity between two vectors, with values ​​between -1 and 1. When the two vectors are in the same direction, the cosine similarity is 1; when they are in opposite directions, the cosine similarity is -1; and when they are orthogonal, the cosine similarity is 0.

[0098] In this embodiment of the disclosure, the mean vectors U and V of sentences A and B after average pooling can be used as the initial sentence vectors of the entire sentences A and B and input into the model to optimize the loss function shown in the following formula (4):

[0099]

[0100] Where (i,j) and (k,l) represent two question pairs, sim(i,j) represents the true similarity between the question pairs (i,j) and (k,l) represents the true similarity between the question pairs (k,l). sim(i,j) > sim(k,l) indicates that the true similarity between question pairs (i,j) and (k,l) is greater than the true similarity between question pairs (k,l). The true similarity can be a similarity score between the question pairs in the labeled data. For example, question i and question j have a similarity score of 1, question k and question 1 have a similarity score of 2, and question e and question f have a similarity score of 0. λ is a parameter greater than 0, for example, λ = 20.

[0101] It should be noted that although the above method uses a scoring system to assess the true similarity of samples based on the questions, such as (sentence a, sentence b, score), this disclosure is not limited to this. For example, it can also use "yes / no type (similarity)" and "NLI type ("implication", "neutral", "contradiction")", as long as there is a tiered discrimination. It can be considered that the similarity between two "implication" sentences is greater than the similarity between two "neutral" sentences, and the similarity between two "neutral" sentences is greater than the similarity between two "contradiction" sentences.

[0102] Understandably, although Figure 4 The image shows two BERT models and pooling layers, but in reality, sentence A and sentence B are input to the same BERT model and pooling layer.

[0103] It should be noted that, although Figure 4 The example uses a pooling layer as the processing layer (more specifically, an average pooling layer, which can improve the model's discrimination in the initial stage). However, this disclosure is not limited to this. For example, CLS can also be used, and the output vector of the last layer of the [CLS] character can be used as the sentence vector. Alternatively, the output vector of the last layer of all characters in the sentence can be used, and the maximum value at the corresponding position of all character vectors can be extracted as the sentence vector. Or, the output vector of the last layer of all characters in the sentence can be used, and their mean can be calculated as the sentence vector.

[0104] Figure 5 This is a schematic diagram illustrating feature extraction using the model provided in the embodiments of this disclosure. For example... Figure 5 As shown, after obtaining the trained BERT-CoSENT model, the user question sample set sentences A / B to be clustered are input. Assuming sentences a and b are the question texts to be processed or clustered, after passing through the pre-trained BERT model (highlighted in bold) and the subsequent pooling layer, the sentence vector u of sentence a and the sentence vector v of sentence b are obtained respectively, which serve as the question text feature information of sentences a and b. Figure 5The diagram illustrates the structure of the entire CoSENT model during text matching, calculating the cosine similarity between two sentence vectors u and v. The bolded black boxes represent the vector feature extraction process for each sentence; in this step, only the portion within the bolded black boxes of each sentence needs to be processed to obtain the embedding vector. Figure 5 The two BERTs in the diagram are a single model, and the diagram shows that the two sentences are calculated by this model to obtain different embedding vectors.

[0105] This disclosure employs a more suitable feature extraction method for vector representation of short texts. Based on open-source and proprietary business-annotated question pairs, the CoSENT method is used to readjust the vectorization results of the BERT pre-trained model, making it more suitable for semantic matching scenarios and improving the accuracy of short text clustering such as user questions. The feature extraction method provided in this disclosure allows the BERT pre-trained model to capture certain positional information, resulting in superior semantic expression. It can understand sentences from a semantic perspective, capturing the positional information of individual words within a sentence without missing the semantic information of the entire sentence, rather than just capturing the semantics of individual words in a short text. This makes it more suitable for short text classification scenarios.

[0106] like Figure 6 As shown, solid black circles represent outliers in the data points, and it is assumed that the radius parameter e = 1 unit, the minimum point minPts = 4, hollow circles represent boundary points, and solid gray dots represent core points.

[0107] In this embodiment, minPts has a practical business meaning, representing the minimum number of samples (data points, not the samples used to train the model) that each cluster category can accept. A smaller minPts indicates a greater desire to reduce the omission of long-tail subcategories; a larger minPts indicates a greater desire to capture common large categories and not to focus on subcategories. The setting of minPts should be based on actual business needs.

[0108] In this embodiment of the disclosure, each round of the multi-round DBSCAN, specifically the round using a first radius parameter for clustering, is described below. First, a data point (which may be randomly selected, hence also called a random point) with at least minPts within its radius (e.g., the first radius parameter) is selected. This data point is designated as a core point (e.g., the first core point mentioned above). Then, each data point in the neighborhood of this core point (for distinction, the data points within the first radius parameter of the first core point are referred to as first textual feature information) is evaluated to determine whether it has a data point with minPts (minPts includes the data point itself) within radius e. If a data point satisfies the minPts criterion, it becomes another core point (for distinction, it can be called a second core point), and the cluster expands (here referred to as a second clustering category, where the first and second clustering categories may or may not be the same clustering category). If a data point does not satisfy the minPts criterion, it becomes a boundary point. As the process continues, the algorithm evolves so that core point "a" is a neighbor of "b", and "b" is a neighbor of "c", and so on. When a cluster is surrounded by boundary points—that is, when no other data point can be found within the entire radius of the cluster to serve as a core point for further expansion—the cluster has been completely searched because there are no more data points within the distance. At this point, the second cluster category can be considered to have been completed. Select a new data point (random point) that has not been classified into the second cluster category and repeat the process to identify the next cluster category.

[0109] like Figure 7 As shown, the method provided in this disclosure embodiment may include the following steps.

[0110] In S71, full data is clustered using DBSCAN with parameters: e = 0.08 and minPts = 2.

[0111] The full dataset here could refer to all the question texts to be clustered, assuming a first radius parameter of 0.08 and a minimum point value (minPts) of 2. Specifically, an unprocessed point (i.e., the feature information of the question text) can be extracted from the full dataset. If the extracted point is a core point, all nearby data points within a distance of 0.08 (inclusive) are identified. If a nearby data point contains two or more data points within a distance of 0.08, then the core point and its nearby data points form a cluster. If the extracted point is an edge point / boundary point (not a core point), the current loop is terminated, and the next point is searched. This process is repeated until all points have been processed, yielding the first clustering result.

[0112] In S72, it is determined whether the cosine similarity between each sample in each class and the cluster center sample is greater than a threshold; if it is greater than the threshold, then S75 is executed; otherwise, S73 is executed.

[0113] To meet the requirements of user question clustering scenarios, where only one representative central question is selected for each question group within a single category, optimizing the answer to the sentence corresponding to this central question in that category can achieve the effect of optimizing the sentences for the entire category. This requirement necessitates that the cosine similarity between each sentence in each cluster category and the cluster center sentence (i.e., the central question) reaches a high threshold, ensuring that each sentence in that category can be represented by the central sentence / central question.

[0114] To achieve the above effect, based on DBSCAN clustering, after each clustering cycle, the clustering results (i.e., each cluster category) are checked to see if they meet the requirements. Specifically, the cosine similarity between the central sentence of each category and all sentences in that category is calculated. If the minimum cosine similarity in that cluster category is greater than a threshold, the cluster category is considered to meet the requirements, and iteration stops. Otherwise, a second round of DBSCAN clustering is performed on that cluster category, and the iteration is repeated. Simultaneously, the radius parameter e of DBSCAN decreases with each iteration until all cluster categories meet the threshold requirements.

[0115] Cluster centroids can be the average of all sentence vectors in a cluster. The central sentence is the sentence / question with the highest cosine similarity to the cluster centroid. The central sentence is the point closest to the average of all sentence vectors in the cluster. This method obtains an actual sentence as the central question, rather than just pure coordinates. This is because in business scenarios, an actual natural language sentence can represent the entire category; directly using a hypothetical average as the central sentence lacks practical meaning and cannot be represented as a real natural language sentence.

[0116] In S73, cluster categories that do not meet the threshold criteria are identified.

[0117] In S74, for cluster categories that do not meet the threshold criteria, DBSCAN clustering is performed on each category separately, with parameters: e = e - 0.01, minPts = 2. S72-S74 are repeated until all categories meet the threshold criteria.

[0118] It should be noted that, Figure 7The embodiment uses a fixed step size (0.01) for the radius parameter to decrease in each round as an example, but this disclosure is not limited to this. In other embodiments, a dynamic step size can also be used to reduce the radius parameter in each round of clustering. For example, the reduction value of the radius parameter can be determined based on the difference between the minimum similarity of the cluster categories and the threshold in each round of clustering results. The smaller the difference between the minimum similarity of the data points in the cluster category and the threshold, the smaller the reduction value of the radius parameter, and vice versa. This can speed up the convergence speed and reduce the number of iterations in the early stage of iteration; in the later stage of iteration, it can prevent the radius parameter from being reduced too much, thereby obtaining more accurate clustering results.

[0119] In S75, cluster categories that meet the threshold criteria are determined.

[0120] In S76, cluster categories are aggregated when all classes meet the threshold criteria.

[0121] It should be noted that, Figure 7 The values ​​provided are for illustrative purposes only and are not limited to this disclosure. They can be adjusted according to business needs in actual use.

[0122] The method provided in this disclosure employs an improved multi-round DBSCAN clustering approach. While maintaining computational efficiency, it addresses the problem of not being able to initially define the number of cluster categories, and also resolves the sensitivity issue of DBSCAN parameters, keeping intra-cluster similarity differences within a certain range and ensuring that the similarity between all sentences within a cluster and the cluster center sentence reaches a certain threshold. When the cosine similarity between each sentence in a cluster category and the cluster center sentence reaches a high threshold, each sentence in that category can be represented by the center sentence. Thus, when a user inputs any other sentence in this category, it can be matched with the center sentence. Only one center sentence needs to be configured in the knowledge base to satisfy the matching of all questions under that category.

[0123] Furthermore, since the definition of the radius parameter e directly affects whether outliers will be classified into a category, setting the e value too large will make it impossible to distinguish outliers, while setting the e value too small will cause some non-outliers to be defined as outliers. There is no absolute standard for the e value of different business data, so direct setting cannot find the optimal value. The embodiments of this disclosure continuously lower the e value in each round of clustering, which can better adapt to different business data.

[0124] A schematic diagram of multi-round clustering of samples compressed into a two-dimensional space is shown below. Figure 8 As shown. Step a: Obtain all sample points (here referring to the data points mentioned above).

[0125] Step b: Cluster all the sample points from step a, assuming we get category 1 and category 2.

[0126] In step b, the DBSCAN algorithm is used to perform initial clustering on the sentence set (user question set), setting the initial neighborhood radius e (called the first radius parameter) and the minimum point minPts.

[0127] Step c: Assuming category 2 meets the threshold criteria, clustering is no longer performed. Category 1 does not meet the threshold criteria, so clustering continues to obtain categories 1.1 and 1.2.

[0128] Specifically, for each category, the cluster centroid is calculated (e.g., by averaging the sentence vectors in that category). Then, the cosine similarity between each sentence in that category and the cluster centroid is calculated, and the sentence with the highest cosine similarity to the cluster centroid is selected as the center sentence of that category. The cosine similarity between all other sentences in that category and the center sentence is calculated. If the cosine similarity between any sentence in that category and the center sentence is less than a preset threshold, then that category does not meet the requirements and needs to continue iterating.

[0129] For cluster categories that do not meet the requirements, the radius parameter e of DBSCAN is reduced, for example, it is called the second radius parameter, and a second round of DBSCAN clustering is performed.

[0130] In step d, categories 2 and 1.2 meet the threshold criteria and are not clustered further. Category 1.1 does not meet the threshold criteria, so clustering continues, resulting in categories 1.1.1 and 1.1.2.

[0131] In step e, categories 2, 1.2, 1.1.1, and 1.1.2 all meet the threshold criteria, so no further clustering is performed. This means there are a total of four cluster categories. Output the clustering results that meet the requirements.

[0132] Repeat until all clusters meet the cosine similarity threshold or the maximum number of iterations is reached. Figure 8 The solid black circles represent the data points / sample points corresponding to the cluster center sentences in each cluster category. Step e is the final clustering result.

[0133] It should be noted that although the above examples all use cosine similarity to measure similarity, this disclosure is not limited to this. In other embodiments, other similarity calculation methods or approximate algorithms can be used to calculate similarity.

[0134] The method provided in this disclosure, based on DBSCAN clustering, proposes iterative optimization of the clustering results to ensure that sentences within each cluster are semantically sufficiently similar. The method provided in this disclosure does not require prior knowledge of the number of clusters to be formed. It can also discover clusters of arbitrary shapes. Furthermore, it can identify noise points (outliers).

[0135] The text processing method and intelligent question answering method provided in this disclosure can be applied to various scenarios, such as smart home scenarios and in-vehicle navigation scenarios.

[0136] Figure 9 This is a network interaction architecture diagram of a text processing method and an intelligent question-answering method provided in this disclosure. Figure 9 As shown, this application scenario includes user 901, terminal 902, and server 903.

[0137] As an example, the training of the model provided in this embodiment can be performed by server 903. Server 903 can save the trained model as a feature extraction model, or it can send the trained feature extraction model to terminal 902.

[0138] Text processing methods and intelligent question-answering methods can be implemented on a terminal 902 (e.g., mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.). Figure 9 As shown, based on the question raised by user 901, terminal 902 obtains the central sentences of each cluster category and their corresponding corrected response information from the cloud in advance. Relying on the processor and memory of terminal 902, it performs similarity matching between the question and the central sentences of each cluster category without relying on server 903, and displays the corrected response information of the matched central sentences as the answer to the question to user 901. For example, it can be displayed as text or played by voice.

[0139] As another example, the text processing method and intelligent question-answering method provided in this disclosure can be implemented in the cloud. For example... Figure 9 As shown, after terminal 902 receives a question from user 901, it sends the question to server 903 for processing. After obtaining the corrected response information that matches the central sentence of the question, server 903 returns the corrected response information as the reply to terminal 902.

[0140] It is understood that the terminal mentioned in the embodiments of this disclosure can be a computer device, including but not limited to a terminal or a server. In other words, the computer device can be a server or a terminal, or a system composed of a server and a terminal. The terminal mentioned above can be an electronic device, including but not limited to mobile phones, tablets, desktop computers, laptops, handheld computers, in-vehicle devices, augmented reality / virtual reality (AR / VR) devices, head-mounted displays, smart TVs, wearable devices, smart speakers, digital cameras, webcams, and other mobile internet devices (MIDs) with network access capabilities, or terminals in scenarios such as trains, ships, and flights.

[0141] The servers mentioned above can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, vehicle-road cooperation, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0142] Optionally, the data involved in the embodiments of this disclosure may be stored in a computer device or may be stored based on cloud storage technology, without limitation.

[0143] Figure 10 This is a schematic diagram illustrating the application of the text processing method and intelligent question-answering method provided in this disclosure to an in-vehicle scenario. For example... Figure 10 As shown, the vehicle terminal 1002 can send a question to the computer device 1001. The computer device 1001 calls the trained feature extraction model to obtain the question text features, and matches the question text features with the central feature information of the central sentences of each cluster category. The corrected response information corresponding to the central sentence of the cluster category with the highest similarity is returned to the vehicle terminal 1002 for display. The computer device 1001 can be the server where the application is located, or it can belong to the vehicle terminal 1002 (i.e., the backend of the vehicle terminal 1002), etc., without any restrictions.

[0144] The vehicle terminal 1002 can be installed in the vehicle 1003, and there are no restrictions on this. The sound acquisition component can be a microphone installed on the steering wheel of the vehicle 1003 to collect the voice information corresponding to the user's question, convert the voice information into text form, and obtain the question text.

[0145] The in-vehicle terminal 1002 can display target applications, etc. In this embodiment, the target application can be any type of application. Different applications can be used in different scenarios, such as remote video conferencing, education, messaging, travel, audiobooks, advertising, and other applications that can be used in a vehicle. The travel scenario can be further divided into different sub-scenarios such as commuting, traveling, and traffic congestion; the social scenario can be further divided into different sub-scenarios such as gatherings and interactions; and the entertainment scenario can be further divided into different sub-scenarios such as listening to music, reading novels, and playing games.

[0146] In chatbot products such as intelligent customer service, an indispensable function is to analyze and correct users' historical dialogues (including user questions and the robot's answers or responses). By continuously revising the robot's answers (the corrected answers are called revised responses), a better user experience can be achieved. As the number of users increases, conventional manual screening becomes increasingly difficult, and many repetitive questions cannot be resolved at once, leading to excessive and meaningless work. High-quality user question classification is therefore crucial. The method provided in this disclosure determines the cluster center question for each category and then corrects the answer to that center question. By clustering high-frequency questions and resolving them all at once, the inefficiency caused by repetitive work can be greatly reduced.

[0147] This disclosure proposes an improved DBSCAN-based short text clustering algorithm. In scenarios such as intelligent customer service where users ask short questions, the clustering results achieved using the method provided in this disclosure are more suitable for correcting historical questions asked by the chatbot. This method ensures that the optimization of the cluster center sentence directly relates to the results of all other sentences within the same cluster, achieving the effect of processing a single sentence as if processing a batch of sentences, thus greatly optimizing operational efficiency. The method provided in this disclosure can also be applied to other scenarios requiring the extraction of short text cluster centers for classification.

[0148] We selected historical conversation data and open-source short text data from customer service robot products for practical effect testing, observing the user question clustering results using the method provided in this embodiment. It can be seen that the method provided in this embodiment has good performance in multiple dialogue scenarios, exhibiting stable performance across different scenarios and good robustness. It does not require differentiated adjustment of model parameters for each specific business scenario. No irrelevant data appears in a single clustering result, and the clustering effect and computational complexity meet expectations. A portion of the extracted data is shown below:

[0149] Table 1 Insurance Customer Service Scenarios

[0150]

[0151]

[0152] Table 2 Financial Customer Service Scenarios

[0153]

[0154]

[0155] Table 3 Technical Support Scenarios

[0156]

[0157]

[0158] Figure 11 This is a flowchart of an intelligent question-answering method provided in an embodiment of this disclosure. Figure 11 As shown, the method provided in this disclosure embodiment may include the following steps.

[0159] In S1110, questions awaiting answers are received.

[0160] In S1120, the cluster category to which the question to be answered belongs is determined.

[0161] In S1130, the central question of the cluster category to which the question to be answered belongs is determined.

[0162] In S1140, the corrected response information for the central problem is obtained.

[0163] In S1150, the revised response information is used as the answer to the question to be answered.

[0164] The intelligent question-answering method provided in this disclosure proposes a short text clustering algorithm based on an improved DBSCAN. In scenarios such as intelligent customer service and other short-question clustering, it can solve the hyperparameter sensitivity problem while retaining the advantages of density-based clustering algorithms. It can effectively handle outliers and meet the accuracy requirements of the scenario. It can serve as an optimization scheme for short-text clustering of user questions and can be applied to products such as intelligent customer service robots. Based on the method in this disclosure, the product can obtain more accurate clustering results and more suitable cluster centers, thereby further optimizing the robot's question-answering database.

[0165] Figure 12 This is a schematic diagram of a user-robot interaction interface provided in an embodiment of this disclosure. Figure 12As shown, the robot interacts with the user via text. In the interaction interface 1200, suppose the user inputs the question text "What is drunk driving?" 1201. After receiving the question 1201, the robot first matches the central question corresponding to the question 1201 to "What is drunk driving?", and then obtains the corrected response information for the central question: "Drunk driving, also known as driving under the influence, refers to the act of driving a motor vehicle after consuming alcohol" 1202, which is displayed on the interaction interface 1200.

[0166] Figure 13 This is a schematic diagram illustrating the effect of applying the method provided in this embodiment to an online voice interaction scenario.

[0167] Online voice interaction scenarios refer to situations where online interaction is conducted via voice, such as a user interacting with a voice chatbot. On the voice interaction interface 1300, the system receives voice information 1301 containing a question input by the user. The terminal sends this voice information 1301, or a converted question text, to the server. The server determines the central question matching the question text, obtains the corrected response information for that central question, and converts the corrected response into voice information 1302. The user can click on 1302 to play the voice information and receive the answer to the question.

[0168] Figure 14 This is a schematic diagram of a text processing device provided in an embodiment of this disclosure. Figure 14 As shown, the text processing apparatus 1400 provided in this embodiment includes a processing unit 1410.

[0169] The processing unit 1410 is used to extract features from the text to be processed and obtain the text feature information of the text to be processed.

[0170] The processing unit 1410 is further configured to perform clustering processing on the text feature information according to the first radius parameter to obtain the first clustering result of the text to be processed.

[0171] The processing unit 1410 is further configured to perform clustering processing on the text feature information in the first clustering category with intra-class similarity less than a threshold in the first clustering result, using a second radius parameter to obtain the updated clustering result of the text to be processed in the first clustering category, wherein the second radius parameter is less than the first radius parameter.

[0172] In an exemplary embodiment, the processing unit 1410 is further configured to: determine the central feature information of the first cluster category; obtain the similarity between the text feature information in the first cluster category and the central feature information of the first cluster category; and if the minimum similarity among the similarities between the text feature information in the first cluster category and the central feature information of the first cluster category is less than the threshold, then determine that the intra-cluster similarity of the first cluster category is less than the threshold.

[0173] In an exemplary embodiment, the processing unit 1410 is further configured to: determine the cluster center point of the first cluster category based on the text feature information in the first cluster category; obtain the similarity between the text feature information in the first cluster category and the cluster center point; and select the text feature information with the highest similarity to the cluster center point from the text feature information in the first cluster category as the center feature information of the first cluster category.

[0174] In an exemplary embodiment, the processing unit 1410 is further configured to: select text feature information with at least a minimum point within its first radius parameter from the text feature information as a first core point to construct a second cluster category; for the first text feature information within the first radius parameter of the first core point, if the text feature information has the minimum point within its first radius parameter, then use the first text feature information as a second core point to expand the second cluster category; for the first text feature information within the first radius parameter of the first core point, if the text feature information does not have the minimum point within its first radius parameter, then use the first text feature information as a boundary point of the second cluster category.

[0175] In an exemplary embodiment, the processing unit 1410 is further configured to: select text feature information with at least a minimum point within its second radius parameter from the text feature information of the first cluster category as a third core point to construct a third cluster category; for the second text feature information within the second radius parameter of the third core point, if the text feature information within its second radius parameter has the minimum point, then use the second text feature information as a fourth core point to expand the third cluster category; for the second text feature information within the second radius parameter of the third core point, if the text feature information within its second radius parameter does not have the minimum point, then use the second text feature information as a boundary point of the third cluster category.

[0176] In an exemplary embodiment, the processing unit 1410 is further configured to: process the first sample text and the second sample text respectively through a pre-trained model and a processing layer to obtain first sample feature information of the first sample text and second sample feature information of the second sample text; obtain a predicted similarity between the first sample text and the second sample text based on the first sample feature information and the second sample feature information; train the pre-trained model and the processing layer based on the predicted similarity and the true similarity between the first sample text and the second sample text to obtain a feature extraction model including the pre-trained model and the processing layer; and process the text to be processed through the feature extraction model to obtain the text feature information.

[0177] Figure 14 Other aspects of the embodiments can be found in the other embodiments described above.

[0178] Figure 15 This is a schematic diagram of another text processing apparatus provided in an embodiment of this disclosure. Figure 15 As shown, the text processing apparatus 1500 provided in this embodiment may include a processing unit 1510.

[0179] The processing unit 1510 is used to extract features from the problem text to obtain the problem text feature information.

[0180] The processing unit 1510 is further configured to perform clustering processing on the feature information of the problem text according to the first radius parameter, and obtain the first clustering result of the problem text.

[0181] The processing unit 1510 is further configured to perform clustering processing on the problem text feature information in the first clustering category with intra-class similarity less than a threshold in the first clustering result, using a second radius parameter, to obtain the updated clustering result of the problem text in the first clustering category, wherein the second radius parameter is less than the first radius parameter.

[0182] The processing unit 1510 is also configured to determine the cluster category to which the question text belongs based on the first clustering result and the updated clustering result.

[0183] In an exemplary embodiment, the processing unit 1510 is further configured to: determine the cluster center point of the corresponding cluster category based on the question text feature information in each cluster category; obtain the similarity between the question text feature information in each cluster category and the cluster center point of the corresponding cluster category; select the question text feature information with the highest similarity to the cluster center point of the cluster category as the center feature information of the corresponding cluster category, and use the question text corresponding to the center feature information as the center question of the corresponding cluster category.

[0184] In an exemplary embodiment, the processing unit 1510 is further configured to: obtain response information corresponding to the central question of each cluster category; obtain corrected response information of the response information of the central question; and use the corrected response information of the central question as corrected response information of the question text in the corresponding cluster category.

[0185] Figure 15 Other aspects of the embodiments can be found in the other embodiments described above.

[0186] Figure 16 This is a schematic diagram of an intelligent question-answering device provided in an embodiment of this disclosure. Figure 16 As shown, the intelligent question-answering device 1600 provided in this embodiment may include a transceiver unit 1610 and a processing unit 1620.

[0187] The transceiver unit 1610 is used to receive questions that are yet to be answered.

[0188] The processing unit 1620 is used to determine the cluster category to which the question to be answered belongs.

[0189] Processing unit 1620 is also used to determine the central question of the cluster category to which the question to be answered belongs.

[0190] Processing unit 1620 is also used to obtain corrected response information for the central problem.

[0191] The processing unit 1620 is also configured to use the corrected response information as the response content to the question to be answered.

[0192] Figure 16 Other aspects of the embodiments can be found in the other embodiments described above.

[0193] See Figure 17 , Figure 17 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Figure 17 As shown, the computer device in this embodiment may include one or more processors 1701, a memory 1702, and an input / output interface 1703. The processor 1701, memory 1702, and input / output interface 1703 are connected via a bus 1704. The memory 1702 stores a computer program, which includes program instructions. The input / output interface 1703 receives and outputs data, such as for data interaction between the host machine and the computer device, or for data interaction between various virtual machines within the host machine. The processor 1701 executes the program instructions stored in the memory 1702.

[0194] The processor 1701 can perform the following operations: extract features from the text to be processed to obtain text feature information of the text to be processed; perform clustering processing on the text feature information according to a first radius parameter to obtain a first clustering result of the text to be processed; for a first clustering category in the first clustering result with intra-class similarity less than a threshold, perform clustering processing on the text feature information in the first clustering category using a second radius parameter to obtain an updated clustering result of the text to be processed in the first clustering category, wherein the second radius parameter is smaller than the first radius parameter.

[0195] Alternatively, the processor 1701 may perform the following operations: extract features from the problem text to obtain problem text feature information; perform clustering processing on the problem text feature information according to a first radius parameter to obtain a first clustering result of the problem text; for a first clustering category in the first clustering result where the intra-class similarity is less than a threshold, perform clustering processing on the problem text feature information in the first clustering category using a second radius parameter to obtain an updated clustering result of the problem text in the first clustering category, wherein the second radius parameter is less than the first radius parameter; and determine the clustering category to which the problem text belongs based on the first clustering result and the updated clustering result.

[0196] Alternatively, the processor 1701 may perform the following operations: receive a question to be answered; determine the cluster category to which the question to be answered belongs; determine the central question of the cluster category to which the question to be answered belongs; obtain corrected response information for the central question; and use the corrected response information as the answer content for the question to be answered.

[0197] In some feasible implementations, the processor 1701 may be a central processing unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0198] The memory 1702 may include read-only memory and random access memory, and provides instructions and data to the processor 1701 and input / output interface 1703. A portion of the memory 1702 may also include non-volatile random access memory. For example, the memory 1702 may also store device type information.

[0199] This disclosure provides a computer device including a processor, an input / output interface, and a memory. The processor retrieves a computer program from the memory and executes the steps of the method shown in any of the above embodiments.

[0200] This disclosure also provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and executed by the text processing method provided in each step of any of the above embodiments. Specific implementations of each step in each of the above embodiments can be found therein and will not be repeated here. Furthermore, the beneficial effects of using the same method will not be repeated here either. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this disclosure, please refer to the description of the method embodiments of this disclosure. As an example, the computer program can be deployed to execute on a single computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed across multiple locations and interconnected via a communication network.

[0201] The computer-readable storage medium can be a text processing device or a voice recognition device provided in any of the foregoing embodiments, or an internal storage unit of the computer device, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0202] This disclosure also provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various alternative embodiments described above.

[0203] The terms "first," "second," etc., used in the specification, claims, and drawings of this disclosure are used to distinguish different objects, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0204] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.

[0205] The methods and related apparatus provided in this disclosure are described with reference to the method flowcharts and / or structural diagrams provided in this disclosure. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable application display device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable application display device, generate instructions for implementing the process... Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable application display device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable application display device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.

[0206] The above-disclosed embodiments are merely preferred embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Therefore, any equivalent variations made in accordance with the claims of this disclosure shall still fall within the scope of this disclosure.

Claims

1. A text processing method, characterized in that, include: Feature extraction is performed on the text to be processed to obtain the text feature information of the text to be processed; The text feature information is clustered according to the first radius parameter to obtain the first clustering result of the text to be processed. For the first cluster category in the first clustering result where the intra-class similarity is less than a threshold, the text feature information in the first cluster category is clustered using a second radius parameter to obtain the updated clustering result of the text to be processed in the first cluster category, wherein the second radius parameter is less than the first radius parameter.

2. The method as described in claim 1, characterized in that, Also includes: Determine the central feature information of the first cluster category; Obtain the similarity between the text feature information in the first cluster category and the center feature information of the first cluster category; If the minimum similarity between the text feature information in the first cluster category and the center feature information of the first cluster category is less than the threshold, then it is determined that the intra-cluster similarity of the first cluster category is less than the threshold.

3. The method as described in claim 2, characterized in that, Determining the central feature information of the first cluster category includes: Based on the text feature information in the first cluster category, determine the cluster center point of the first cluster category; Obtain the similarity between the text feature information in the first cluster category and the cluster center point; From the text feature information in the first cluster category, select the text feature information with the highest similarity to the cluster center point as the center feature information of the first cluster category.

4. The method as described in claim 1, characterized in that, Clustering is performed on the text feature information based on the first radius parameter to obtain the first clustering result of the text to be processed, including: Among the text feature information, text feature information that has at least a minimum point within its first radius parameter is selected as the first core point to construct the second cluster category; If the first text feature information within the first radius parameter of the first core point has the text feature information of the minimum point, then the first text feature information is used as the second core point to expand the second clustering category. If the first text feature information within the first radius parameter of the first core point does not contain the text feature information of the minimum point, then the first text feature information is used as the boundary point of the second clustering category.

5. The method as described in claim 1, characterized in that, For the first cluster category in the first clustering result where the intra-cluster similarity is less than a threshold, the text feature information in the first cluster category is clustered using a second radius parameter to obtain the updated clustering result of the text to be processed in the first cluster category, including: In the text feature information of the first cluster category, the text feature information that has at least a minimum point within its second radius parameter is selected as the third core point to construct the third cluster category; If the second text feature information within the second radius parameter of the third core point has the text feature information of the minimum point, then the second text feature information is used as the fourth core point to expand the third clustering category. If the second text feature information within the second radius parameter of the third core point does not contain the text feature information of the minimum point, then the second text feature information is used as the boundary point of the third clustering category.

6. The method as described in claim 1, characterized in that, Feature extraction is performed on the text to be processed to obtain its text feature information, including: The first sample text and the second sample text are processed by a pre-trained model and a processing layer, respectively, to obtain the first sample feature information of the first sample text and the second sample feature information of the second sample text. The predicted similarity between the first sample text and the second sample text is obtained based on the first sample feature information and the second sample feature information. The pre-trained model and the processing layer are trained based on the predicted similarity and the true similarity between the first sample text and the second sample text to obtain a feature extraction model including the pre-trained model and the processing layer. The text to be processed is processed through the feature extraction model to obtain the text feature information.

7. A text processing method, characterized in that, include: Feature extraction is performed on the problem text to obtain the problem text feature information; The feature information of the problem text is clustered according to the first radius parameter to obtain the first clustering result of the problem text; For the first cluster category in the first clustering result where the intra-class similarity is less than a threshold, the second radius parameter is used to perform clustering processing on the problem text feature information in the first cluster category to obtain the updated clustering result of the problem text in the first cluster category, wherein the second radius parameter is less than the first radius parameter; Based on the first clustering result and the updated clustering result, the cluster category to which the question text belongs is determined.

8. The method as described in claim 7, characterized in that, Also includes: Based on the feature information of the question text in each cluster category, the cluster center point of the corresponding cluster category is determined; Obtain the similarity between the feature information of the question text in each cluster category and the cluster center point of the corresponding cluster category; The question text feature information with the highest similarity to the cluster center point of the cluster category is selected as the center feature information of the corresponding cluster category, and the question text corresponding to the center feature information is taken as the center question of the corresponding cluster category.

9. The method as described in claim 8, characterized in that, Also includes: Obtain the response information corresponding to the central question of each cluster category; Corrected response information to obtain the response information for the central problem; The corrected response information for the central question is used as the corrected response information for the question text in the corresponding cluster category.

10. An intelligent question-answering method, characterized in that, include: Receive questions awaiting answers; Determine the cluster category to which the question to be answered belongs; Determine the central question of the cluster category to which the question to be answered belongs; Obtain the corrected response information for the central problem; The corrected response information will be used as the answer to the question to be answered.

11. A text processing device, characterized in that, include: The processing unit is used to extract features from the text to be processed and obtain the text feature information of the text to be processed. The processing unit is further configured to perform clustering processing on the text feature information according to the first radius parameter to obtain the first clustering result of the text to be processed; The processing unit is further configured to perform clustering processing on the text feature information in the first clustering category with intra-class similarity less than a threshold in the first clustering result using a second radius parameter, to obtain the updated clustering result of the text to be processed in the first clustering category, wherein the second radius parameter is smaller than the first radius parameter.

12. A text processing device, characterized in that, include: The processing unit is used to extract features from the problem text to obtain the problem text feature information; The processing unit is further configured to perform clustering processing on the feature information of the problem text according to the first radius parameter, and obtain the first clustering result of the problem text; The processing unit is further configured to perform clustering processing on the problem text feature information in the first clustering category with intra-class similarity less than a threshold in the first clustering result, using a second radius parameter, to obtain the updated clustering result of the problem text in the first clustering category, wherein the second radius parameter is less than the first radius parameter; The processing unit is further configured to determine the cluster category to which the question text belongs based on the first clustering result and the updated clustering result.

13. An intelligent question-and-answer device, characterized in that, include: The transceiver unit is used to receive questions awaiting answers. A processing unit is used to determine the cluster category to which the question to be answered belongs; The processing unit is also used to determine the central question of the cluster category to which the question to be answered belongs; The processing unit is also used to obtain corrected response information for the central problem; The processing unit is further configured to use the corrected response information as the response content for the question to be answered.

14. A computer device, characterized in that, Includes processor, memory, and input / output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store computer programs, and the processor is used to call the computer programs so that the computer device executes the method according to any one of claims 1-6, the method according to any one of claims 7-9, or the method according to claim 10.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-6, the method of any one of claims 7-9, or the method of claim 10.

16. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the method of any one of claims 1-6, the method of any one of claims 7-9, or the method of claim 10.