Text data classification method and device, electronic equipment and nonvolatile storage medium
By working together with large and small models and combining them with a conflicting outcome arbitration model, the limitations of a single model in semantic understanding and classification decision-making are overcome, achieving efficient and accurate text data classification.
Patent Information
- Application Number
- CN202511143717.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-14
- Publication Date
- 2025-12-02
AI Technical Summary
Existing technologies suffer from poor text data classification performance due to the limitations of single models in semantic understanding and classification decisions.
The first model is matched with the target vocabulary to determine the first score, and the second model is matched with the target semantic feature library to determine the second score. The final classification result is determined by the collaborative work of the large and small models and the arbitration model for conflicting results.
It achieves efficient and accurate text data classification, overcomes the limitations of single models in semantic understanding and classification decisions, and improves the effectiveness of text data classification.
Smart Images

Figure CN121051584A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of natural language processing technology, and more specifically, to a text data classification method, apparatus, electronic device, and non-volatile storage medium. Background Technology
[0002] With the rapid development of artificial intelligence technology, semantic text analysis has become a core technical means to uncover user needs and optimize service quality. In the business scenarios of telecommunications operators, the sources of semantic text data are extremely diverse, including translated voice call texts, online customer service dialogue records, user complaint ticket texts, voice assistant interaction logs, and outbound marketing quality inspection voice messages. This text data is characterized by its large scale, complex types, and strong semantic dynamism, urgently requiring efficient preprocessing and deep analysis methods to extract its implicit value.
[0003] However, semantic analysis in related technologies often focuses on the application of single models. Due to the limitations of single models in semantic understanding and classification decisions, there is often a technical problem of poor semantic analysis results for text data.
[0004] There is currently no effective solution to the above problems. Summary of the Invention
[0005] This application provides a text data classification method, apparatus, electronic device, and non-volatile storage medium to at least solve the technical problem in the related art that the text data classification effect is poor due to the limitations of a single model in semantic understanding and classification decision.
[0006] According to one aspect of the embodiments of this application, a text data classification method is provided, comprising: acquiring target text data, wherein the target text data is text data collected in a target scene; employing a first model to match the target text data with words in a target lexicon, and determining a first score corresponding to the target text data based on the matching result, wherein the target lexicon contains multiple words and word tag information corresponding to the words, the word tag information is used to characterize the sentiment tendency of the words, and the first score is used to characterize the degree of matching between the target text data and the target category at the word level; employing a second model to match a first semantic feature corresponding to the target text data with a target semantic feature library, and determining a second score corresponding to the target text data based on the matching result, wherein the computational load and complexity of the second model are greater than those of the first model, the target semantic feature library contains multiple second semantic features and feature tag information corresponding to the second semantic features, the feature tag information is used to characterize the sentiment tendency of the second semantic features, and the second score is used to characterize the degree of matching between the target text data and the target category at the semantic level; and determining a classification result of the target text data based on the first score and the second score, wherein the classification result is used to characterize whether the target text data belongs to the target category.
[0007] Optionally, the method further includes: determining the prompt words corresponding to the target scene, and using an initial large language model, extracting sample data from the target scene based on the prompt words to obtain an initial lexicon and / or an initial semantic feature library corresponding to the target scene; determining the initial labels corresponding to each word in the initial lexicon and / or each semantic feature in the initial semantic feature library, wherein the initial labels include: positive labels and negative labels, where positive labels represent that the word or semantic feature has a positive emotional tendency in the target scene, and negative labels represent that the word or semantic feature has a negative emotional tendency in the target scene; fine-tuning the initial large language model based on the word and / or semantic features and the initial labels corresponding to the word and / or semantic features to obtain a target large language model, and using the target large language model to re-extract the sample data to obtain a target lexicon and / or a target semantic feature lexicon.
[0008] Optionally, determining the first score corresponding to the target text data based on the matching results includes: performing word segmentation on the target text data to obtain multiple words, and encoding the words to obtain vector representations corresponding to the words; determining a first similarity parameter between the vector representation of the word segment and the vector representation of the first type of words in the target lexicon, and determining a second similarity parameter between the vector representation of the word segment and the vector representation of the second type of words in the target lexicon, wherein the first type of words are words in the target lexicon whose sentiment tendency is positive as represented by word tag information, and the second type of words are words in the target lexicon whose sentiment tendency is negative as represented by word tag information; and determining the first score corresponding to the target text data based on the first similarity parameter and the second similarity parameter.
[0009] Optionally, determining the first score corresponding to the target text data based on the first similarity parameter and the second similarity parameter includes: if the first similarity parameter / or the second similarity parameter is greater than a preset similarity threshold, determining that the target text data contains words; counting the first number of words with positive sentiment and the second number of words with negative sentiment in the target text data; determining the word weight value of each word based on the word tag information corresponding to the words that are contained, and determining the first score corresponding to the target text data based on the first number, the second number, and the word weight value.
[0010] Optionally, the second model is trained using a large language model. Determining the second score corresponding to the target text data based on the matching results includes: classifying and merging the second semantic features in the target semantic feature library according to a preset classification directory to obtain at least one category of second semantic features; using the second model to perform semantic analysis on the target text data and the target semantic feature library to obtain the first semantic feature in the target text data that matches the category of the second semantic feature, and the reasoning for determining that the first semantic feature matches the category of the second semantic feature; determining the semantic feature weight value of the second semantic feature based on the feature label information of the second semantic feature that matches the first semantic feature, and determining the second score corresponding to the target text data based on the semantic feature weight value.
[0011] Optionally, determining the classification result of the target text data based on the first score and the second score includes: if both the first score and the second score are greater than a preset score threshold, determining that the target text data belongs to the target category; if neither the first score nor the second score is greater than the preset score threshold, determining that the target text data does not belong to the target category; if only the first score is greater than the preset score threshold, or only the second score is greater than the preset score threshold, using a contradictory result arbitration model to analyze the target text data and determine the probability value of the target text data belonging to the target category, wherein the contradictory result arbitration model is trained based on a training dataset, which contains multiple text data and category labels for the text data; and if the probability value is greater than a preset probability threshold, determining that the target text data belongs to the target category.
[0012] Optionally, the method further includes: sending the classification result of the target text data and the judgment criteria corresponding to the classification result to the front-end interactive interface for display, wherein the judgment criteria include at least one of the following: a first score, a second score, the hit words and / or second semantic features, and specific text fragments in the target text data related to the classification result; obtaining the evaluation information for the classification result triggered in the front-end interactive interface, wherein the evaluation information is used to characterize the user's satisfaction with the classification result or error correction information; and optimizing the classification model based on the evaluation information, wherein the classification model includes at least one of the following: a first model, a second model, and a conflicting result arbitration model.
[0013] According to another aspect of the embodiments of this application, a text data classification apparatus is also provided, comprising: a data acquisition module, configured to acquire target text data, wherein the target text data is text data collected in a target scene; a first scoring module, configured to use a first model to match the target text data with words in a target lexicon, and determine a first score corresponding to the target text data based on the matching result, wherein the target lexicon contains multiple words and word tag information corresponding to the words, the word tag information is used to characterize the sentiment tendency of the words, and the first score is used to characterize the degree of matching between the target text data and the target category at the word level; and a second scoring module, configured to use a second model to classify the target text data into a target category. The first semantic feature corresponding to the text data is matched with the target semantic feature library, and a second score is determined based on the matching result. The computational cost and complexity of the second model are greater than those of the first model. The target semantic feature library contains multiple second semantic features and corresponding feature label information. The feature label information is used to characterize the sentiment tendency of the second semantic features, and the second score is used to characterize the degree of semantic matching between the target text data and the target category. The text classification module is used to determine the classification result of the target text data based on the first score and the second score. The classification result is used to characterize whether the target text data belongs to the target category.
[0014] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program executes a text data classification method during runtime.
[0015] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored computer program, wherein the device where the non-volatile storage medium is located executes a text data classification method by running the computer program.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of a text data classification method.
[0017] In this embodiment, the following steps are employed: 1) Acquire target text data, which is text data collected in the target scene; 2) Use a first model to match the target text data with words in a target lexicon, and determine a first score corresponding to the target text data based on the matching results. The target lexicon contains multiple words and corresponding word tag information. The word tag information is used to characterize the sentiment tendency of the words, and the first score is used to characterize the degree of matching between the target text data and the target category at the word level; 3) Use a second model to match the first semantic feature corresponding to the target text data with a target semantic feature library, and determine a second score corresponding to the target text data based on the matching results. The computational complexity of the second model is... The computational complexity of the first model is greater than that of the second model. The target semantic feature library contains multiple second semantic features and corresponding feature labels. The feature labels are used to characterize the sentiment tendency of the second semantic features, and the second score is used to characterize the degree of semantic matching between the target text data and the target category. Based on the first and second scores, the classification result of the target text data is determined. The classification result is used to characterize whether the target text data belongs to the target category. Through the collaborative work of the large and small models, the goal of efficient and accurate text classification is achieved, thereby solving the technical problem of poor text data classification results caused by the limitations of a single model in semantic understanding and classification decision-making in related technologies. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a method for classifying text data, according to an embodiment of this application.
[0020] Figure 2 This is a schematic diagram of a text data classification method provided according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a method flow for semantic text analysis based on size model collaboration provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram illustrating a method flow for constructing a lexicon and a semantic feature library according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of a method for calculating typical word packet similarity scores based on a small model, according to an embodiment of this application.
[0024] Figure 6 This is a schematic diagram of a method for calculating typical word packet similarity scores based on a small model, according to an embodiment of this application.
[0025] Figure 7 This is a schematic diagram of the output structure of a collaborative decision-making model based on an embodiment of this application. Detailed Implementation
[0026] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0028] To facilitate a better understanding of the embodiments of this application by those skilled in the art, some technical terms or nouns involved in the embodiments of this application are explained as follows:
[0029] Automatic Speech Recognition (ASR) is a technology that uses computer algorithms to convert human speech signals into editable and understandable text or commands. Its core goal is to enable machines to "understand" human language, achieving automatic speech-to-text conversion. It is an important branch of Natural Language Processing (NLP) within the field of artificial intelligence.
[0030] NLP (Natural Language Processing) is an important branch of artificial intelligence and computer science. It mainly studies how to enable computers to understand, process and generate human natural language (such as Chinese and English) to achieve effective communication between humans and machines.
[0031] LoRA (Low-Rank Adaptation) is an efficient model fine-tuning technique designed to rapidly adapt large pre-trained models (such as LLM and Vision models) by reducing the number of trainable parameters and computational costs. Its core idea is to approximate the update of model weights through low-rank decomposition, thereby significantly reducing the memory and computational resources required for fine-tuning while maintaining model performance.
[0032] BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language model based on deep learning. Its core goal is to capture the contextual semantic relationships of words in text through bidirectional pre-training, thereby providing high-quality semantic representations for various natural language processing (NLP) tasks.
[0033] In related technologies, research on semantic analysis has mostly focused on the application of single models (such as large models based on BERT or lightweight small models). However, while large models offer high accuracy, they are computationally expensive and difficult to meet real-time requirements. Small models, while flexible in deployment, lack sufficient depth of semantic understanding. Therefore, due to the limitations of single models in semantic understanding and classification decisions, related technologies often perform poorly in semantic analysis of text data, mainly due to the following problems:
[0034] 1) Static rule dependency: Traditional methods rely on manual rule bases (such as keyword matching), which are difficult to cover complex semantic variations (such as "network card" may refer to "network lag" or "network card device"), and the number of static rules is limited, resulting in incomplete semantic analysis and low accuracy.
[0035] 2) Poor model interpretability: The models in related technologies are difficult to meet the output classification requirements for different scenarios, and cannot provide reasonable explanations. The poor interpretability of the models makes it difficult to apply and promote them in real business.
[0036] 3) Lagging dynamic updates: User needs and business rules based on expert experience are constantly changing, and the system in the relevant technology lacks adaptive iteration capabilities, resulting in the analysis effect decaying over time.
[0037] Therefore, how to achieve a balance between efficiency and accuracy through a collaborative mechanism between large and small models has become a pressing technical challenge.
[0038] To address the aforementioned issues, this application provides relevant solutions that can be widely applied to the following related scenarios in the telecommunications field:
[0039] 1) Call Quality Inspection: Real-time analysis of customer service call transcripts to detect service compliance (e.g., whether keyword packages are missing) and emotional fluctuations (e.g., abnormal emotions of customer service or users) to improve service compliance and user satisfaction.
[0040] 2) Abnormal / Malicious Complaint Identification: In a massive number of complaint tickets, semantic analysis is used to identify duplicate complaints, false complaints (such as malicious claims), and violations (such as profiting from complaints), thereby reducing operational risks.
[0041] 3) Intelligent customer service needs understanding: Analyze the implicit intentions in user inquiry text (such as "slow network speed" may correspond to insufficient bandwidth, equipment failure or unreasonable package), and dynamically optimize the response strategy in combination with the context.
[0042] The following is a detailed description of the proposed solution.
[0043] According to an embodiment of this application, a method for classifying text data is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0044] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal (or electronic device) for implementing a text data classification method is shown. Figure 1 As shown, the computer terminal 10 (or electronic device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0045] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or electronic device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0046] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the text data classification method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned text data classification method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0047] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0048] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or electronic device).
[0049] Under the above operating environment, this application provides a text data classification method. Figure 2 This is a schematic diagram of a text data classification method provided in an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0050] Step S202: Obtain target text data, wherein the target text data is text data collected in the target scene;
[0051] Step S204: Using the first model, the target text data is matched with the words in the target lexicon, and the first score corresponding to the target text data is determined based on the matching results. The target lexicon contains multiple words and word tag information corresponding to the words. The word tag information is used to represent the sentiment tendency of the words, and the first score is used to represent the degree of matching between the target text data and the target category at the word level.
[0052] Step S206: Using the second model, the first semantic feature corresponding to the target text data is matched with the target semantic feature library, and the second score corresponding to the target text data is determined based on the matching result. The computational amount and complexity of the second model are greater than those of the first model. The target semantic feature library contains multiple second semantic features and feature label information corresponding to the second semantic features. The feature label information is used to characterize the sentiment tendency of the second semantic features, and the second score is used to characterize the degree of matching between the target text data and the target category at the semantic level.
[0053] Step S208: Based on the first score and the second score, determine the classification result of the target text data, wherein the classification result is used to characterize whether the target text data belongs to the target category.
[0054] Through the above steps, the collaborative work of large and small models achieves efficient and accurate text classification, thereby solving the technical problem of poor text data classification results caused by the limitations of a single model in semantic understanding and classification decision-making in related technologies.
[0055] The text data classification method in steps S202 to S208 of the embodiments of this application will be further described below.
[0056] Figure 3 This is a schematic diagram illustrating a method flow for semantic text analysis based on size model collaboration according to an embodiment of this application, as shown below. Figure 3 As shown, the embodiments of this application mainly include the following steps: text data acquisition and preprocessing, word package and semantic feature extraction and feature library (including word library and semantic feature library) construction, typical word package matching based on small model, text semantic feature matching based on large model, collaborative decision output of large and small models, and generation and feedback optimization of judgment criteria. These will be described in detail below.
[0057] First, after obtaining the raw data, it can be preprocessed to obtain the target text data, as follows.
[0058] In this embodiment, the data sources may include forms such as voice (in scenarios like customer incoming calls for consultation) and text (filled in by customer service staff and customers). For the data in the voice scenario, the call voice needs to be first converted into text data through automatic speech recognition (ASR system). Secondly, all the text data needs to be cleaned, such as special character filtering: removing non-character symbols mis-recognized by ASR (such as garbled characters, meaningless punctuation marks, etc.); traditional and simplified Chinese conversion: unifying the text to simplified Chinese (such as the ASR mis-outputting traditional Chinese); pinyin error correction: identifying and correcting errors caused by homophones (such as "meeting minutes" being mis-written as "meeting summary", "already" being mis-recognized as "already", etc.); removing redundant colloquial expressions and modal particles: constructing a dictionary of Chinese colloquial words and modal particles, such as "um", "ah", "that", "then", etc., identifying and deleting redundant words in the text to make the text more concise and standardized; removing duplicate content: calculating the hash value of the text paragraph or sentence, and judging whether there is duplicate content by comparing the hash values. If there is, the duplicate part is deleted.
[0059] In addition, in the embodiments of this application, a vocabulary library and a semantic feature library can also be constructed for the target scenario, and the specific steps are as follows.
[0060] In some embodiments of this application, the method further includes: determining the prompt words corresponding to the target scenario, and using the initial large language model to extract the sample data in the target scenario according to the prompt words to obtain the initial vocabulary library and / or the initial semantic feature library corresponding to the target scenario; determining the initial labels corresponding to each vocabulary in the initial vocabulary library and / or each semantic feature in the initial semantic feature library, where the initial labels include: positive labels and negative labels, and the positive labels represent that the vocabulary or semantic feature has a positive emotional tendency in the target scenario, and the negative labels represent that the vocabulary or semantic feature has a negative emotional tendency in the target scenario; fine-tuning and training the initial large language model according to the vocabulary and / or semantic feature, and the initial labels corresponding to the vocabulary and / or semantic feature to obtain the target large language model, and using the target large language model to re-extract the sample data to obtain the target vocabulary library and / or the target semantic feature library.
[0061] Such as Figure 4As shown, when constructing a lexicon, keyword packages for specific scenarios (target scenarios) can be built based on the experience of industry experts, and the lexicon can be formed based on the capabilities of the large model. Specifically, firstly, based on the native capabilities of the large model, the large model prompt word engineering is used to extract typical word packages from the sample data in an unsupervised manner, generating a preliminary positive / negative lexicon (without weights) for a specific scenario, and producing an initial lexicon. The controllable parameters mainly include scenario limitation, generation diversity (Temperature adjustment), deduplication filtering, etc. Secondly, the labeled positive and negative samples are used to fine-tune the large language model using the LoRA method, enabling the large model to learn more professional domain knowledge. The fine-tuned large model (i.e., the target large language model) is used to extract positive / negative word packages and optimize the lexicon. Finally, expert experience can be combined to weight the positive and negative word packages (i.e., the vocabulary label information mentioned above). The positive score range is set to 0-10, with higher scores indicating greater positive strength; the negative score range is -10-0, with lower scores indicating greater negative strength. By continuously inputting new positive and negative samples, candidate word packages are extracted in real time. After manual review, the lexicon is updated and iteratively optimized.
[0062] The construction of the semantic feature library follows a similar process. First, leveraging the native capabilities of a large model and based on industry expert experience, a prompt word engineering framework for specific scenarios is built. Unsupervised semantic feature extraction is then performed on sample data to form a preliminary unweighted semantic feature library (i.e., the initial semantic feature library). Second, the finely tuned large model is used to extract positive / negative semantic features, optimizing the semantic feature library. Finally, expert experience can be combined to weight and label the features (feature label information). As new positive and negative samples are continuously input, candidate semantic features are extracted in real time. After manual review, the semantic feature library is updated and iteratively optimized. Simultaneously, implicit customer characteristics (such as "complaints" and "business opportunities") can be identified during feature extraction, allowing for the focus on key business objectives based on these implicit characteristics.
[0063] Subsequently, on the one hand, typical word pack matching can be performed based on the small model (i.e., the first model). That is, the first model is used to match the target text data with the words in the target vocabulary, and the first score corresponding to the target text data is determined based on the matching results. The specific steps are as follows.
[0064] In some embodiments of this application, determining the first score corresponding to the target text data based on the matching results includes the following steps: performing word segmentation on the target text data to obtain multiple word segments, and encoding the word segments to obtain vector representations corresponding to the word segments; determining a first similarity parameter between the vector representation of the word segments and the vector representation of a first category of words in the target lexicon, and determining a second similarity parameter between the vector representation of the word segments and the vector representation of a second category of words in the target lexicon, wherein the first category of words are words in the target lexicon whose sentiment tendency is positive, and the second category of words are words in the target lexicon whose sentiment tendency is negative; and determining the first score corresponding to the target text data based on the first similarity parameter and the second similarity parameter.
[0065] This application embodiment uses a small model (i.e., the first model, generally a lightweight word vector model) to identify typical word packets, which can significantly shorten the inference time and effectively reduce project costs without reducing accuracy. In this embodiment, the first model is illustrated using the BGE model as an example. Its training process includes three stages: a pre-training stage, a large-scale weakly supervised training stage, and a supervised fine-tuning stage, as detailed below.
[0066] The pre-training phase can be performed on communication domain datasets, using the RetroMAE model architecture. The pre-training objective function is as follows: Where X represents a set of clean text. For text that has undergone noise processing, Enc is the encoder and Dec is the decoder. RetroMAE's model architecture is an asymmetric encoder-decoder structure. Its encoder part consists of BERT (a 12-layer Transformer encoder), while its decoder part consists of only a single-layer Transformer decoder.
[0067] In the general text fine-tuning stage, unlabeled C-MTP data can be used for fine-tuning, and the model fine-tuning adopts a contrastive learning approach. In the task-specific fine-tuning stage, labeled C-MTP data can be used to further fine-tune the model. In this stage, the labeled dataset is smaller but of higher quality.
[0068] In this embodiment, the BGE model can be used to match the corresponding positive and negative weights in the feature library. Then, all the matched word packets of this text are divided into positive and negative, and all the positive weights and all the negative weights are summed to obtain the final negative score and positive score of the text.
[0069] Specifically, such as Figure 5As shown, for the target text data to be processed, it can first be decomposed into a set of sentences and a list of short words (i.e., the aforementioned word segmentation). Then, each sentence in the sentence set and each element in the short word list (i.e., the aforementioned word segmentation) are input into the encoder of the first model. After encoding processing, the vector representation corresponding to each sentence is obtained. At the same time, the positive word packs (first type of vocabulary) and negative word packs (second type of vocabulary) in the lexicon are used as inputs and sequentially fed into the encoder to obtain the vector representations corresponding to each positive and negative word pack. Furthermore, cosine similarity is calculated for each sentence vector and each positive and negative word pack vector to obtain the first similarity parameter and the second similarity parameter.
[0070] Furthermore, based on the first similarity parameter and the second similarity parameter, the first score corresponding to the target text data can be determined. The specific steps are as follows.
[0071] In some embodiments of this application, determining the first score corresponding to the target text data based on the first similarity parameter and the second similarity parameter includes the following steps: when the first similarity parameter / or the second similarity parameter is greater than a preset similarity threshold, determining that the target text data hits words; counting the first number of words with positive sentiment and the second number of words with negative sentiment in the target text data; determining the word weight value of each word based on the word tag information corresponding to the hit words, and determining the first score corresponding to the target text data based on the first number, the second number, and the word weight value.
[0072] Specifically, a reasonable similarity threshold can be set through expert verification. When the cosine similarity between the sentence vector and the word bag vector is greater than the set threshold, the sentence is determined to have hit the corresponding positive or negative word bag. That is, if the first similarity parameter / or the second similarity parameter is greater than the preset similarity threshold, the target text data is determined to have hit the word. Then, word bag weight statistical features can be further matched. Specifically, a set of typical positive and negative word bags can be extracted for each text segment and assigned corresponding weights (word weight values) from the lexicon. The total score is obtained by summing the positive and negative weights separately, and the difference between the two is used as the polarity score of the text (i.e., the first score). Simultaneously, the number of positive and negative word bag hits is incorporated into the scoring model as an auxiliary feature, and the score is affected by the frequency or intensity of the hits.
[0073] On the other hand, text semantic features can also be matched based on a large model (second model). That is, the second model is used to match the first semantic features corresponding to the target text data with the target semantic feature library, and the second score corresponding to the target text data is determined based on the matching results. The specific steps are as follows.
[0074] In some embodiments of this application, the second model is obtained by training a large language model; determining the second score corresponding to the target text data based on the matching result includes the following steps: classifying and merging the second semantic features in the target semantic feature library according to the preset classification directory information to obtain at least one type of second semantic feature; using the second model to perform semantic analysis on the target text data and the target semantic feature library to obtain the first semantic feature in the target text data that matches the category of the second semantic feature, and the judgment reason for determining that the categories of the first semantic feature and the second semantic feature match; determining the semantic feature weight value of the second semantic feature based on the feature label information of the second semantic feature that matches the first semantic feature, and determining the second score corresponding to the target text data based on the semantic feature weight value.
[0075] Specifically, when using a large language model (the second model) to identify the first semantic feature, based on a specific scenario (target scenario), and leveraging the capabilities of the large model, a prompt word project can be constructed around four key elements: background information, specific needs, output format, and optimization requirements. This allows the large model to summarize the features of the text and select those that match the text's semantic feature library. Furthermore, to avoid errors caused by the large model's "illusion," it can be forced to provide reasons for the match (i.e., the aforementioned judgment reasons) and undergo secondary verification.
[0076] Meanwhile, as the feature library iterates, issues such as unclear classification and semantic similarity often arise, leading to an increase in the number of features and a lack of clear distinction between them. Therefore, leveraging the text summarization capabilities of large models, these models can periodically classify and merge similar semantic features and remove redundant items. For example, in a telecommunications scenario, 20 primary categories and 131 secondary categories could be subdivided to fully utilize the capabilities of large models and iteratively optimize the semantic feature library.
[0077] After determining the second semantic feature that matches the first semantic feature, a semantic feature weighting statistical feature can be performed. Specifically, the semantic feature results output by the large model can be matched with positive and negative feature weights (semantic feature weight values) according to the semantic feature library. The total score is obtained by summing the positive and negative weights separately, and the difference between the two is used as the polarity score of the text (i.e., the second score). At the same time, the number of hits of positive and negative semantic features is incorporated into the scoring model as an auxiliary feature, and the score is also affected by the hit frequency or intensity.
[0078] After obtaining the first and second scores from the size models (i.e., the first model and the second model), the final output can be further coordinated and determined, and the specific steps are as follows.
[0079] In some embodiments of this application, determining the classification result of the target text data based on the first score and the second score includes the following steps: if both the first score and the second score are greater than a preset score threshold, the target text data is determined to belong to the target category; if neither the first score nor the second score is greater than the preset score threshold, the target text data is determined not to belong to the target category; if only the first score is greater than the preset score threshold, or only the second score is greater than the preset score threshold, a contradictory result arbitration model is used to analyze the target text data and determine the probability value of the target text data belonging to the target category, wherein the contradictory result arbitration model is trained based on a training dataset, which contains multiple text data and category labels for the text data; if the probability value is greater than a preset probability threshold, the target text data is determined to belong to the target category.
[0080] In this embodiment, the outputs of two independent models—small model (vector model) matching and large model semantic feature extraction—can be comprehensively evaluated. A collaborative decision-making model is then used to arbitrate conflicting results, ultimately outputting a conclusion on whether the target text data belongs to the target category in this specific scenario (target scenario). Specifically, as follows... Figure 6 As shown, when both the small model score (first score) and the large model score (second score) are higher than the preset score thresholds, the system directly determines it as the target category and outputs a high-confidence reason. When both the small model score (first score) and the large model score (second score) are lower than the preset score thresholds, the system determines it as a non-target category and similarly outputs a low-confidence reason. Only when the small model score (first score) and the large model score (second score) show a high and a low difference is the conflicting result arbitration model triggered. This model is trained on a large amount of historical data and can calculate the probability value of the target category based on the input features. If the calculated probability value is higher than the set decision threshold, it is determined that the target category is highly likely; otherwise, it is determined that the target category is less likely.
[0081] Specifically, the collaborative decision-making rules in this application construct a collaborative decision-making model. The model is divided into three categories: when both are high, the model outputs 1, indicating that it belongs to the target category; when both are low, the model outputs -1, indicating that it belongs to the non-target category; when arbitrating conflicting results, the positive and negative scores output by the larger and smaller models, the difference between the positive and negative scores, and the number of features hitting positive and negative samples are used as parameters to determine the output as 1 or -1. The formula of the collaborative decision-making model is expressed as follows:
[0082]
[0083] Among them, S v For the small model score, T v S is the decision threshold for the small model. m For the large model score, Tm Let T be the decision threshold for the large model, P be the probability value obtained from the conflict outcome arbitration model, and T be the probability value obtained from the conflict outcome arbitration model. p Let sgn(x) be the decision threshold for the probabilistic model, and sgn(x) be the sign function, with the specific formula as follows:
[0084]
[0085] The core of the probability output of P is linear regression plus probability mapping, which associates the fused features obtained above with the probabilities of the target class and non-target class. The cross-entropy loss function drives parameter optimization. First, the input features are linearly weighted and summed, as shown in the following formula:
[0086] z = w T x+b
[0087] Where w is the model weight vector, b is the bias, and x is the input feature. Next, the linear output z is mapped to the [0,1] interval using the Sigmoid function, representing the probability P that the sample belongs to the positive class, as shown in the following formula:
[0088]
[0089] After determining the final classification result of the target text data, the judgment criteria can be generated and optimized, as follows.
[0090] In some embodiments of this application, the method further includes the following steps: sending the classification result of the target text data and the judgment criteria corresponding to the classification result to the front-end interactive interface for display, wherein the judgment criteria include at least one of the following: a first score, a second score, the hit words and / or second semantic features, and specific text fragments in the target text data related to the classification result; obtaining the evaluation information for the classification result triggered in the front-end interactive interface, wherein the evaluation information is used to characterize the user's satisfaction with the classification result or error correction information; optimizing the classification model based on the evaluation information, wherein the classification model includes at least one of the following: a first model, a second model, and a contradictory result arbitration model.
[0091] Specifically, when generating the judgment criteria, the system can output three parts—specific scenario labels, criteria fragments, and confidence level explanations—depending on the needs of different specific scenarios. Specific scenario labels are strongly correlated with scenario classification; for example, a business opportunity scenario indicates the existence of a business opportunity, a fraud prevention scenario indicates suspected fraud, and a complaint scenario indicates malicious complaints. Criteria fragments utilize a fragment extraction algorithm, employing an attention mechanism to locate the three to five most contributing words in the text and generating readable fragments by associating them with the context of two sentences. Confidence level explanations support multi-dimensional weighted detailed output, such as positive / negative word packages, positive / negative semantic feature recognition, and latent features.
[0092] Simultaneously, a closed-loop manual review feedback mechanism can be introduced to continuously optimize the feature categories and feature weights of the feature library (lexicon and semantic feature library). By writing automated scripts, a multi-level review process can be constructed, supporting dynamic updates of the feature library, fine-tuning of the large model, and optimization of model parameters. Specifically, this includes: 1) Dynamic updates of the feature library: Based on the results of positive and negative samples, and according to the dataset and expert experience, it supports merging feature library categories, combining multiple features, and adding, deleting, or modifying single features. Simultaneously, the weights of the aforementioned features are continuously iterated to achieve dynamic updates of the feature library. 2) Fine-tuning of the large model: Based on expert experience, domain-specific corpus data is collected, and the large model is fine-tuned using the LoRA method to make the large model more suitable for the specific scenario, thereby solving problems such as insufficient understanding of professional terminology and lack of rule-based knowledge. 3) Optimization of the conflicting result arbitration model: Based on the positive and negative samples of the review feedback, an incremental dataset is constructed to update the weights of the conflicting result arbitration model. Simultaneously, based on the training results of the dataset, the network structure is improved, and the output of the conflicting result arbitration is optimized.
[0093] The above process steps are illustrated below with an example, using the malicious complaint identification scenario based on customer complaint channel data as an example.
[0094] 1) High-risk situation:
[0095] Text data: "The user requests a change of plan, claiming that customer service deceived them into signing up for a 299 plan when they were initially on a 199 plan. They request verification of the signing process and demand compensation of 100 yuan per month for the fees from March to January, demanding double compensation. They also disagree with the extra 20 yuan for the ringback tone benefit package in June and demand triple compensation, totaling 2800 yuan in compensation. Please contact us for processing, urgent, thank you."
[0096] Small model score (first score): 17 points. Matched positive typical word packs: "3 times compensation" (9 points); "2 times compensation" (6 points), total positive score 15 points; no negative word packs were matched;
[0097] Large model score (second score): 23 points. Matched positive text semantic features: "High business familiarity and professionalism" (8 points), "Emphasis on time" (7 points); "Clear objectives" (8 points); "Clear logic" (7 points), total positive score 30 points. Matched negative features: "Common language" (7 points), total negative score 7 points.
[0098] Collaborative decision-making results of large and small models: both high, identified as the target, final result: the user's complaint was malicious;
[0099] 2) Low-low situation:
[0100] Text data: "The user complained that they requested to go to the xx business hall to cancel their broadband service, saying that a staff member had previously told them they could go there to cancel it. They requested to verify which specific business hall to go to. We were unable to verify that the xx business hall had the authority to cancel the service, and the business hall did not accept the request. The user stated that they had already gone to the xx business hall and the service could not be processed, causing a delay. They requested that the telecom company compensate them for the loss and asked the staff member they had previously contacted to handle the matter. We were unable to find any relevant cancellation work order. Please verify and contact us for processing. Thank you."
[0101] Small model total score (first score): -20 points. Positive match to the word pack: "compensate for losses" (7 points). Negative match to the word pack: "xxx business hall" (9 points), three instances, total positive score 27 points.
[0102] Overall model score (second score): 14 points. Matched positive text semantic features: "Emphasizing multiple unsuccessful communications" (7 points), total positive score 7 points. Matched negative text semantic features: "Expressing confusion or uncertainty" (7 points), "Dissatisfaction with service" (6 points), "Unfamiliarity with process or business" (8 points), total negative score 21 points.
[0103] Collaborative decision-making results of large and small models: both low, determined to be non-target, final result: user complaint was not malicious;
[0104] 3) One high and one low situation:
[0105] The text reads: "Complaint about malicious deductions! All charges must be clearly stated. These deductions exceeding the package limit were made without any notification for over a year (October 2023 - February 2025). I wouldn't have noticed unless my elderly relative kept asking me to top up their phone credit! When I signed up for the package, they lied to me, saying it was 109 yuan per month, including 500 minutes of calls and 50GB of data, with unlimited use beyond the speed limit without additional charges. In reality, it was just 500 minutes and 20GB of data per month, with unlimited charges for data usage beyond that. The highest monthly charge was 376 yuan. I demand a full refund of the data usage fee, which is 1231 yuan today, plus 423.7 yuan for other miscellaneous charges such as ringback tones, premium services, and other benefits. This violates my right to know and my right to property. If this is not accepted, I will take the evidence and file a complaint with the Ministry of Industry and Information Technology."
[0106] Small model score (first score): 15 points. Positive keyword matching: "MIIT complaint" (8 points) appeared twice, "all refunds" (8 points), total positive score 24 points; negative keyword matching: "deceive the elderly" (9 points), negative score 9 points.
[0107] Large model score (second score): -19 points. Matched positive text semantic features: "questioning process specifications" (7 points), "complaint threats" (8 points), total positive score 15 points. Matched negative text semantic features: "obvious emotional fluctuations" (7 points), "dissatisfaction with service" (6 points), "expressing confusion or uncertainty" (8 points), "repeatedly expressing dissatisfaction" (6 points), total negative score 34 points.
[0108] The collaborative decision-making results of the large and small models are: one high and one low. The result is that the probability model outputs a non-target value, which is: the user's complaint is not malicious.
[0109] This application's solution employs a collaborative approach between large and small models. The large model extracts text features and intent for deep semantic text understanding, while a lightweight word vector model is constructed. The small model handles rapid responses in high-frequency scenarios, and a task intelligent routing mechanism optimizes resource allocation, thereby shortening processing time, reducing costs without compromising accuracy, resulting in higher cost-effectiveness. Furthermore, a dynamic weighting mechanism is introduced, enabling the model to adapt to changes in the word library. A collaborative decision-making model involving both large and small models is also incorporated to output target value probabilities. A dual-model complementary verification mechanism reduces the false positive rate, effectively improving decision accuracy. Additionally, a dynamic closed-loop update mechanism allows for the creation of automated scripts based on user feedback and changes in business rules, enabling dynamic incremental updates to the feature library and ensuring that semantic analysis capabilities remain aligned with business needs.
[0110] This proposed solution enhances the ability to mine implicit features from voice and text data, overcoming the limitations of traditional keyword matching or single-model analysis. Through collaborative feature extraction using both large and small models, it identifies implicit user characteristics from text, achieving fine-grained and contextualized semantic understanding. Furthermore, addressing the diversity of business terminology in the telecommunications field, it constructs a domain-enhanced semantic representation model, improving model robustness through collaborative large and small model analysis. A closed-loop feedback system is also established, automatically triggering incremental model updates based on changes in business rules and user interaction feedback, avoiding performance degradation caused by data drift in traditional static models. Additionally, it breaks down semantic data barriers in isolated scenarios such as call quality inspection, complaint handling, and intelligent customer service. Through cross-scenario knowledge transfer, it uncovers business insights behind semantics, providing data-driven decision-making support for optimizing product design, improving service quality, and reducing operational risks.
[0111] According to an embodiment of this application, an embodiment of a text data classification device is also provided. Figure 7 This is a schematic diagram of a text data classification device according to an embodiment of this application. Figure 7 As shown, the device includes:
[0112] The data acquisition module 70 is used to acquire target text data, wherein the target text data is text data collected in the target scene;
[0113] The first scoring module 72 is used to match the target text data with the words in the target lexicon using the first model, and determine the first score corresponding to the target text data based on the matching results. The target lexicon contains multiple words and word tag information corresponding to the words. The word tag information is used to represent the sentiment tendency of the words, and the first score is used to represent the degree of matching between the target text data and the target category at the word level.
[0114] The second scoring module 74 is used to use a second model to match the first semantic features corresponding to the target text data with the target semantic feature library, and determine the second score corresponding to the target text data based on the matching results. The computational amount and complexity of the second model are greater than those of the first model. The target semantic feature library contains multiple second semantic features and feature label information corresponding to the second semantic features. The feature label information is used to characterize the sentiment tendency of the second semantic features. The second score is used to characterize the degree of matching between the target text data and the target category at the semantic level.
[0115] The text classification module 76 is used to determine the classification result of the target text data based on the first score and the second score, wherein the classification result is used to characterize whether the target text data belongs to the target category.
[0116] Optionally, the text data classification device is further configured to: determine the prompt words corresponding to the target scene, and using an initial large language model, extract sample data under the target scene based on the prompt words to obtain an initial lexicon and / or an initial semantic feature library corresponding to the target scene; determine the initial labels corresponding to each word in the initial lexicon and / or each semantic feature in the initial semantic feature library, wherein the initial labels include: positive labels and negative labels, where positive labels represent that the word or semantic feature has a positive emotional tendency under the target scene, and negative labels represent that the word or semantic feature has a negative emotional tendency under the target scene; fine-tune the initial large language model based on the word and / or semantic features and the initial labels corresponding to the word and / or semantic features to obtain a target large language model, and use the target large language model to re-extract the sample data to obtain a target lexicon and / or a target semantic feature lexicon.
[0117] Optionally, determining the first score corresponding to the target text data based on the matching results includes: performing word segmentation on the target text data to obtain multiple words, and encoding the words to obtain vector representations corresponding to the words; determining a first similarity parameter between the vector representation of the word segment and the vector representation of the first type of words in the target lexicon, and determining a second similarity parameter between the vector representation of the word segment and the vector representation of the second type of words in the target lexicon, wherein the first type of words are words in the target lexicon whose sentiment tendency is positive as represented by word tag information, and the second type of words are words in the target lexicon whose sentiment tendency is negative as represented by word tag information; and determining the first score corresponding to the target text data based on the first similarity parameter and the second similarity parameter.
[0118] Optionally, determining the first score corresponding to the target text data based on the first similarity parameter and the second similarity parameter includes: if the first similarity parameter / or the second similarity parameter is greater than a preset similarity threshold, determining that the target text data contains words; counting the first number of words with positive sentiment and the second number of words with negative sentiment in the target text data; determining the word weight value of each word based on the word tag information corresponding to the words that are contained, and determining the first score corresponding to the target text data based on the first number, the second number, and the word weight value.
[0119] Optionally, the second model is trained using a large language model. Determining the second score corresponding to the target text data based on the matching results includes: classifying and merging the second semantic features in the target semantic feature library according to a preset classification directory to obtain at least one category of second semantic features; using the second model to perform semantic analysis on the target text data and the target semantic feature library to obtain the first semantic feature in the target text data that matches the category of the second semantic feature, and the reasoning for determining that the first semantic feature matches the category of the second semantic feature; determining the semantic feature weight value of the second semantic feature based on the feature label information of the second semantic feature that matches the first semantic feature, and determining the second score corresponding to the target text data based on the semantic feature weight value.
[0120] Optionally, determining the classification result of the target text data based on the first score and the second score includes: if both the first score and the second score are greater than a preset score threshold, determining that the target text data belongs to the target category; if neither the first score nor the second score is greater than the preset score threshold, determining that the target text data does not belong to the target category; if only the first score is greater than the preset score threshold, or only the second score is greater than the preset score threshold, using a contradictory result arbitration model to analyze the target text data and determine the probability value of the target text data belonging to the target category, wherein the contradictory result arbitration model is trained based on a training dataset, which contains multiple text data and category labels for the text data; and if the probability value is greater than a preset probability threshold, determining that the target text data belongs to the target category.
[0121] Optionally, the text data classification device is further configured to: send the classification result of the target text data and the judgment criteria corresponding to the classification result to the front-end interactive interface for display, wherein the judgment criteria include at least one of the following: a first score, a second score, the hit words and / or second semantic features, and specific text fragments in the target text data related to the classification result; obtain evaluation information for the classification result triggered in the front-end interactive interface, wherein the evaluation information is used to characterize the user's satisfaction with the classification result or error correction information; and optimize the classification model based on the evaluation information, wherein the classification model includes at least one of the following: a first model, a second model, and a contradictory result arbitration model.
[0122] It should be noted that each module in the above-mentioned text data classification device can be a program module (for example, a set of program instructions to implement a certain function) or a hardware module. For the latter, it can be manifested in the following forms, but is not limited to them: each of the above modules is manifested as a processor, or the functions of each of the above modules are implemented by a processor.
[0123] It should be noted that the text data classification device provided in this embodiment can be used to perform... Figure 2 The text data classification method shown above is also applicable to the embodiments of this application, and will not be repeated here.
[0124] This application embodiment also provides a non-volatile storage medium, which includes a stored computer program. The device containing the non-volatile storage medium executes the following text data classification method by running the computer program: acquiring target text data, wherein the target text data is text data collected in a target scene; using a first model to match the target text data with words in a target lexicon, and determining a first score corresponding to the target text data based on the matching result; wherein the target lexicon contains multiple words and corresponding word tag information, the word tag information being used to characterize the sentiment tendency of the words, and the first score being used to characterize the matching of the target text data with the target category at the word level. The degree of matching is determined by employing a second model to match the first semantic feature corresponding to the target text data with the target semantic feature library. Based on the matching result, a second score is determined for the target text data. The computational complexity of the second model is greater than that of the first model. The target semantic feature library contains multiple second semantic features and corresponding feature label information. The feature label information is used to characterize the sentiment tendency of the second semantic features. The second score is used to characterize the degree of matching between the target text data and the target category at the semantic level. Based on the first score and the second score, the classification result of the target text data is determined. The classification result is used to characterize whether the target text data belongs to the target category.
[0125] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the text data classification method described in various embodiments of this application: acquiring target text data, wherein the target text data is text data collected in a target scene; using a first model to match the target text data with words in a target lexicon, and determining a first score corresponding to the target text data based on the matching result, wherein the target lexicon contains multiple words and corresponding word tag information, the word tag information being used to characterize the sentiment tendency of the words, and the first score being used to characterize the degree of matching between the target text data and the target category at the word level; using... The second model matches the first semantic feature corresponding to the target text data with the target semantic feature library, and determines the second score corresponding to the target text data based on the matching result. The computational cost and complexity of the second model are greater than those of the first model. The target semantic feature library contains multiple second semantic features and corresponding feature label information. The feature label information is used to characterize the sentiment tendency of the second semantic feature, and the second score is used to characterize the degree of semantic matching between the target text data and the target category. Based on the first score and the second score, the classification result of the target text data is determined, and the classification result is used to characterize whether the target text data belongs to the target category.
[0126] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0127] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0132] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A text data classification method, characterized in that, include: Acquire target text data, wherein the target text data is text data collected in the target scene; The first model is used to match the target text data with words in the target lexicon, and a first score is determined based on the matching results. The target lexicon contains multiple words and word tag information corresponding to the words. The word tag information is used to characterize the sentiment tendency of the words. The first score is used to characterize the degree of matching between the target text data and the target category at the word level. A second model is used to match the first semantic feature corresponding to the target text data with the target semantic feature library, and a second score corresponding to the target text data is determined based on the matching result. The computational complexity of the second model is greater than that of the first model. The target semantic feature library contains multiple second semantic features and feature label information corresponding to the second semantic features. The feature label information is used to characterize the sentiment tendency of the second semantic feature. The second score is used to characterize the degree of matching between the target text data and the target category at the semantic level. Based on the first score and the second score, a classification result for the target text data is determined, wherein the classification result is used to characterize whether the target text data belongs to the target category.
2. The text data classification method according to claim 1, characterized in that, The method further includes: Determine the prompt words corresponding to the target scene, and use an initial large language model to extract sample data under the target scene based on the prompt words to obtain the initial word library and / or initial semantic feature library corresponding to the target scene; Determine the initial labels corresponding to each word in the initial lexicon and / or each semantic feature in the initial semantic feature library, wherein the initial labels include: positive labels and negative labels, wherein the positive labels represent that the word or semantic feature has a positive emotional tendency in the target scenario, and the negative labels represent that the word or semantic feature has a negative emotional tendency in the target scenario; Based on the vocabulary and / or the semantic features, and the initial labels corresponding to the vocabulary and / or the semantic features, the initial large language model is fine-tuned and trained to obtain the target large language model. Then, the sample data is re-extracted using the target large language model to obtain the target lexicon and / or the target semantic feature lexicon.
3. The text data classification method according to claim 1, characterized in that, Based on the matching results, the first score corresponding to the target text data is determined as follows: The target text data is segmented to obtain multiple words, and the segmented words are encoded to obtain vector representations corresponding to the segmented words. A first similarity parameter is determined between the vector representation of the word segmentation and the vector representation of the first type of words in the target lexicon, and a second similarity parameter is determined between the vector representation of the word segmentation and the vector representation of the second type of words in the target lexicon, wherein the first type of words are words in the target lexicon whose sentiment tendency is positive as represented by the word tag information, and the second type of words are words in the target lexicon whose sentiment tendency is negative as represented by the word tag information. Based on the first similarity parameter and the second similarity parameter, the first score corresponding to the target text data is determined.
4. The text data classification method according to claim 3, characterized in that, Based on the first similarity parameter and the second similarity parameter, the first score corresponding to the target text data is determined as follows: If the first similarity parameter and / or the second similarity parameter are greater than a preset similarity threshold, it is determined that the target text data matches the word. The first number of words with a positive sentiment tendency in the target text data and the second number of words with a negative sentiment tendency in the target text data are counted. Based on the word tag information corresponding to the hit words, the word weight value of each word is determined, and based on the first quantity, the second quantity, and the word weight value, the first score corresponding to the target text data is determined.
5. The text data classification method according to claim 1, characterized in that, The second model was obtained by training a large language model; Based on the matching results, the second score corresponding to the target text data is determined to include: According to the preset classification directory information, the second semantic features in the target semantic feature library are classified and merged to obtain at least one category of the second semantic features; Using the second model, semantic analysis is performed on the target text data and the target semantic feature library to obtain the first semantic feature in the target text data that matches the category of the second semantic feature, and the reason for determining that the first semantic feature matches the category of the second semantic feature; Based on the feature label information of the second semantic feature that matches the first semantic feature, the semantic feature weight value of the second semantic feature is determined, and based on the semantic feature weight value, the second score corresponding to the target text data is determined.
6. The text data classification method according to claim 1, characterized in that, Based on the first score and the second score, the classification result of the target text data is determined as follows: If both the first score and the second score are greater than the preset score threshold, the target text data is determined to belong to the target category; If neither the first score nor the second score is greater than the preset score threshold, it is determined that the target text data does not belong to the target category; In the case where only the first score is greater than the preset score threshold, or only the second score is greater than the preset score threshold, a contradictory result arbitration model is used to analyze the target text data and determine the probability value of the target text data belonging to the target category. The contradictory result arbitration model is trained based on a training dataset, which contains multiple text data and the category labels of the text data. If the probability value is greater than a preset probability threshold, the target text data is determined to belong to the target category.
7. The text data classification method according to claim 6, characterized in that, The method further includes: The classification results of the target text data and the judgment criteria corresponding to the classification results are sent to the front-end interactive interface for display. The judgment criteria include at least one of the following: the first score, the second score, the hit words and / or the second semantic features, and the specific text fragments in the target text data that are related to the classification results. Obtain evaluation information for the classification result triggered in the front-end interactive interface, wherein the evaluation information is used to characterize the user's satisfaction with the classification result or error correction information; Based on the evaluation information, the classification model is optimized, wherein the classification model includes at least one of the following: the first model, the second model, and the contradictory result arbitration model.
8. A text data classification device, characterized in that, include: The data acquisition module is used to acquire target text data, wherein the target text data is text data collected in the target scene; The first scoring module is used to match the target text data with words in the target lexicon using a first model, and determine the first score corresponding to the target text data based on the matching results. The target lexicon contains multiple words and word tag information corresponding to the words. The word tag information is used to characterize the sentiment tendency of the words. The first score is used to characterize the degree of matching between the target text data and the target category at the word level. The second scoring module is used to match the first semantic feature corresponding to the target text data with the target semantic feature library using a second model, and determine the second score corresponding to the target text data based on the matching result. The second model has a higher computational cost and complexity than the first model. The target semantic feature library contains multiple second semantic features and feature label information corresponding to the second semantic features. The feature label information is used to characterize the sentiment tendency of the second semantic features. The second score is used to characterize the degree of matching between the target text data and the target category at the semantic level. A text classification module is used to determine the classification result of the target text data based on the first score and the second score, wherein the classification result is used to characterize whether the target text data belongs to the target category.
9. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the text data classification method according to any one of claims 1 to 7.
10. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored computer program, wherein the device containing the non-volatile storage medium executes the text data classification method according to any one of claims 1 to 7 by running the computer program.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the text data classification method according to any one of claims 1 to 7.