Text processing method, apparatus, device, storage medium, and program product
By processing text in the call center customer service domain using a pre-built vector dictionary and target task model, the problems of excessive computing resources and insufficient accuracy are solved, achieving efficient and accurate text processing.
Patent Information
- Application Number
- CN202510281472.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-03-11
AI Technical Summary
Text processing in the call center customer service field suffers from excessive computational resources, response speeds that cannot meet actual business needs, and general-purpose large models that cannot meet actual accuracy requirements.
The target text is processed by a pre-built vector dictionary to obtain target vectors. The target vectors are then processed using text classification models, text clustering models, or sentiment analysis models specific to the call center customer service domain. The vector dictionary consists of multiple samples and their corresponding text vectors. The text vectors include at least semantic feature vectors and local difference vectors.
It improves the accuracy and efficiency of text processing, reduces the computational complexity of the model, and adapts to the specific needs of the call center customer service field.
Smart Images

Figure CN120216684B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a text processing method, apparatus, device, storage medium, and program product. Background Art
[0002] In the call center customer service field, a large amount of text is generated every day, such as work order texts, which record user requests. Text processing and analysis is key to core business service analysis and helps improve the user service experience.
[0003] Although relevant large-scale models are open source, they often require excessive computing resources for text processing in call center customer service, and their universal application often results in response times that fail to meet actual business needs. Furthermore, these large-scale models are general-purpose, and their accuracy is insufficient for call center customer service. Summary of the Invention
[0004] The present application provides a text processing method, apparatus, device, storage medium, and program product, which can not only improve the accuracy of text processing, but also improve the efficiency of text processing.
[0005] In a first aspect, an embodiment of the present application provides a text processing method, comprising: obtaining a target text; processing the target text based on a pre-constructed vector dictionary to obtain a target vector; wherein the vector dictionary is composed of multiple samples and corresponding text vectors; the text vector is obtained based on at least a semantic feature vector and a local difference vector; the local difference vector is obtained based on local features and difference features; processing the target vector based on a target task model to obtain a text processing result; wherein the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service.
[0006] In the second aspect, an embodiment of the present application also provides a text processing device, including: a target text acquisition module for acquiring a target text; a text processing module for processing the target text based on a pre-built vector dictionary to obtain a target vector; wherein the vector dictionary is composed of multiple samples and corresponding text vectors; the text vector is obtained based on at least a semantic feature vector and a local difference vector; a vector processing module for processing the target vector based on a target task model to obtain a text processing result; wherein the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service.
[0007] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the text processing method as described in the embodiment of the present application.
[0008] In a fourth aspect, an embodiment of the present application further provides a storage medium comprising computer-executable instructions, which, when executed by a computer processor, are used to execute the text processing method as described in the embodiment of the present application.
[0009] In a fifth aspect, an embodiment of the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the text processing method as described in the embodiment of the present application.
[0010] The technical solution of the embodiment of the present application is to obtain a target text; process the target text based on a pre-constructed vector dictionary to obtain a target vector; wherein the vector dictionary is composed of multiple samples and corresponding text vectors; the text vector is obtained at least according to a semantic feature vector and a local difference vector; the local difference vector is obtained according to local features and difference features; process the target vector based on a target task model to obtain a text processing result; wherein the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service. In the embodiment of the present application, the target text is processed by a pre-constructed vector dictionary to obtain a target vector, and then the target vector is processed by the target task model. Since the target vector includes a semantic feature vector and a local difference vector, the accuracy of text processing can be improved, and the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service, which can improve the efficiency of text processing relative to the method of using a general large model. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0012] Figure 1 A flowchart of a text processing method provided in an embodiment of the present application;
[0013] Figure 2 A schematic diagram of the structure of a text processing device provided in an embodiment of the present application;
[0014] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0015] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0016] It should be understood that the various steps described in the method implementation of the present disclosure can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect. The term "including" and its variations used herein are open inclusions, that is, "including but not limited to". It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "multiple" mentioned in this disclosure are illustrative and not restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more". It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of relevant laws, regulations and relevant provisions.
[0017] Figure 1 This is a flowchart of a text processing method provided by an embodiment of the present application. The method can be executed by a text processing device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, PC or server. Figure 1 As shown, the method includes:
[0018] S110: Obtain target text.
[0019] In this embodiment, the target text is not limited and can be, for example, a work order text generated by a work order system of a call center, a text transcribed from a telephone recording, or an online customer service text, etc. The target text is used to record user complaints or demands.
[0020] S120 : Process the target text based on a pre-built vector dictionary to obtain a target vector.
[0021] The vector dictionary is composed of multiple samples and corresponding text vectors; the text vector is obtained based on at least a semantic feature vector and a local difference vector; and the local difference vector is obtained based on local features and difference features.
[0022] In this embodiment, the target text may be matched with each sample in the vector dictionary. If the match is successful, the text vector of the corresponding sample is used as the target vector of the target sample.
[0023] Optionally, the target text is processed based on a pre-constructed vector dictionary to obtain a target vector, including: matching the target text with a sample in the vector dictionary to obtain a matching result; if the matching result is a successful match, using the corresponding vector in the vector dictionary as the target vector; if the matching result is a failed match, updating the vector dictionary based on the target text to process the target text based on the updated vector dictionary.
[0024] In this embodiment, if the target text successfully matches a sample in the vector dictionary, indicating that the vector dictionary contains the same sample as the target text, the corresponding vector in the vector dictionary is used as the target vector. If the target text fails to match a sample in the vector dictionary, indicating that the vector dictionary contains the same sample as the target text, the vector dictionary is updated based on the target text, and the target text is processed based on the updated vector dictionary. The updating method is similar to the method for constructing the vector dictionary.
[0025] This embodiment uses a vector dictionary to obtain the target vector before processing the target task model. This allows for direct access to the text representation (vector representation) corresponding to the target text, eliminating the need for the model to learn the text representation from scratch. This reduces model complexity and speeds up model training and prediction. The vector dictionary also provides semantic, local, and variance information, thereby improving model performance.
[0026] Optionally, the vector dictionary is constructed as follows: obtaining a training set including multiple tasks; performing local feature processing on each sample in the training set to obtain multiple target local features corresponding to each sample; performing difference processing on each sample in the training set to obtain multiple difference features corresponding to each sample; performing vector processing on each sample in the training set to obtain a semantic feature vector corresponding to each sample; for each sample, processing the corresponding multiple target local features and the multiple difference features to obtain a local difference vector corresponding to each sample; and splicing the semantic feature vector and the local difference vector to obtain a text vector corresponding to each sample.
[0027] Among them, multiple tasks can be understood as text classification tasks, text clustering tasks, and sentiment analysis tasks.
[0028] In this embodiment, local features of each sample in the training set can be extracted by any method, such as convolutional neural network and N-gram method, to obtain multiple target local features corresponding to each sample.
[0029] In this embodiment, each sample in the training set may be subjected to difference processing in any manner, such as fuzzy matching or similarity calculation, to obtain a plurality of difference features corresponding to each sample.
[0030] In this embodiment, vector processing can be performed on each sample in the training set using any universal large model, that is, a semantic feature vector corresponding to each sample can be obtained using the universal large model.
[0031] In this embodiment, for each sample, the corresponding multiple target local features can be vectorized to obtain a local fusion vector, each difference feature can be directly used as a difference vector, and the local fusion vector and the multiple difference vectors can be fused to obtain a local difference vector corresponding to each sample.
[0032] In this embodiment, the semantic feature vector and the local difference vector are spliced, such as horizontally or vertically, to obtain a text vector corresponding to each sample.
[0033] Optionally, local feature processing is performed on each sample in the training set to obtain multiple target local features corresponding to each sample, including: setting a first set window size, a second set window size, a third set window size and a fourth set window size respectively; wherein, the first set window size is smaller than the second set window size; the second set window size is smaller than the third set window size; the third set window size is smaller than the fourth set window size; feature extraction is performed on each sample according to the first set window size, the second set window size, the third set window size and the fourth set window size respectively to obtain multiple initial local features corresponding to each set window size corresponding to each sample; counting the number of occurrences of each initial local feature corresponding to each set window size; and taking the initial local feature whose number of occurrences is greater than a set threshold as the target local feature of the corresponding set window size.
[0034] Exemplarily, the first setting window size is 1, the second setting window size is 2, the third setting window size is 3, and the fourth setting window size is 4.
[0035] For example, feature extraction can be performed on each sample using a first set window size, a moving step size of 1, and a sliding motion from left to right to obtain multiple initial local features corresponding to the first set window size. For example, for the sentence "I love you", the multiple initial local features are "I", "love", and "you".
[0036] For example, feature extraction can be performed on each sample using the second set window size, a moving step of 1, and a sliding motion from left to right to obtain multiple initial local features corresponding to the second set window size. For example, for the sentence "I love you", the multiple initial local features are "I love" and "love you".
[0037] For example, feature extraction can be performed on each sample using a third set window size, a moving step of 1, and a sliding motion from left to right to obtain multiple initial local features corresponding to the third set window size. For example, for "I love machine learning," the multiple initial local features are "I love machine," "love machine," "machine learning," and "machine learning."
[0038] Exemplarily, feature extraction can be performed on each sample in a manner of sliding from left to right with a fourth set window size and a moving step of 1, to obtain a plurality of initial local features corresponding to the fourth set window size. For example, “I love machine learning because machine learning is very popular”, and the multiple initial local features are respectively “I love machines”, “love machine learning”, “machine learning”, “machine learning because”, “learning because of machines”, “learning because of machines”, “because of machines”, “for machine learning”, “machine learning”, “machine learning”, “machine learning is very”, and “learning is very popular”. Exemplarily, the threshold value is set to 2 as an example. Since the number of occurrences of the initial local feature of “machine learning” is 2, which is equal to the set threshold value, the initial local feature of “machine learning” can be used as the target local feature corresponding to the fourth set window size. By analogy, the target local feature (one or more) of each set window size of each sample can be obtained, so that a plurality of target local features corresponding to each sample can be obtained.
[0039] Optionally, each sample in the training set is subjected to difference processing to obtain multiple difference features corresponding to each sample, including: for any target sample, determining the number of intersection terms between the target sample and each sample in the remaining samples in the training set; wherein the remaining samples and the target sample constitute the training set; wherein the number of intersection terms is the number of words that exist in common in the target sample and any one of the remaining samples; determining the number of union terms between the target sample and each sample in the remaining samples in the training set; wherein the number of union terms is the number of deduplicated words after the target sample and any one of the remaining samples are merged; based on the number of intersection terms, the number of union terms and the difference coefficient, determining the difference features between the target sample and each sample in the remaining samples.
[0040] In this embodiment, each sample in the training set may be segmented to construct a word set corresponding to each sample.
[0041] In this embodiment, the target sample is any sample in the training set.
[0042] For example, take 3 training sets as an example, take A as the target sample, and the remaining samples as B and C. The number of intersection terms between A and B can be determined, that is, the number of words that exist in common in A and B, and the number of intersection terms between A and C can be determined, that is, the number of words that exist in common in A and C. The number of union terms between A and B can be determined, that is, the number of words that are deduplicated after A and B are merged, and the number of union terms between A and C can be determined, that is, the number of words that are deduplicated after A and B are merged.
[0043] For example, taking the difference coefficient as 1, the difference characteristics of A and B are: 1-(the number of intersection terms between A and B / the number of union terms between A and B); the difference characteristics of A and C are: 1-(the number of intersection terms between A and C / the number of union terms between A and C).
[0044] In this embodiment, based on the number of intersection terms, the number of union terms and the difference coefficient, a method of determining the difference characteristics between the target sample and each sample in the remaining samples is used, so that the vector dictionary has global difference characteristics, which facilitates improving the performance of subsequent models, such as the performance of text clustering.
[0045] Optionally, for each sample, the corresponding multiple target local features and the multiple difference features are processed to obtain a local difference vector corresponding to each sample, including: performing vector conversion on the multiple target local features corresponding to each set window size of each sample to obtain a local vector corresponding to each set window size of each sample; fusing the local vectors corresponding to each set window size in each sample to obtain a local fusion vector corresponding to each sample; fusing the local fusion vector corresponding to each sample with the multiple difference features corresponding to each sample to obtain a local difference vector corresponding to each sample.
[0046] In this embodiment, there is no limitation on the method of vector conversion. For example, the conversion can be performed through one-hot encoding, bag-of-words model, or a shallow neural network model.
[0047] In this embodiment, the local vectors corresponding to each set window size in each sample may be fused, such as horizontal splicing or vertical splicing, to obtain a local fusion vector corresponding to each sample. In this embodiment, the difference feature may be directly used as a vector.
[0048] In this embodiment, the local fusion vector corresponding to each sample may be concatenated with the multiple difference features corresponding to each sample to obtain a local difference vector corresponding to each sample.
[0049] S130 : Process the target vector based on the target task model to obtain a text processing result.
[0050] The target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the call center customer service field. The text processing results may vary depending on the task. For example, for a classification task, if the target task model is a text classification model, the text processing result may be a text classification result. For a clustering task, if the target task model is a text clustering model, the text processing result may be a text clustering result. For a sentiment analysis task, if the target task model is a sentiment analysis model, the text processing result may be a sentiment analysis result.
[0051] In this embodiment, if the task is classification, the target text is a work order text, and the target task model is a text classification model. The text classification model can be used to classify the work order text to analyze which types of problems users complain about most frequently. If the task is clustering, the target text is a telephone recording text, and the target task model is a text clustering model. The text clustering model can be used to perform clustering statistics on the work order text to analyze the main areas of complaint. If the task is sentiment analysis, the target text is an online customer service text, and the target task model is a sentiment analysis model. The sentiment analysis model can be used to analyze the online customer service text to determine whether users express particular dissatisfaction when describing their problems.
[0052] It should be noted that the samples in the training set of the target task model can be the same as the samples in the training set for constructing the vector dictionary.
[0053] The technical solution of the embodiment of the present application is to obtain a target text; process the target text based on a pre-constructed vector dictionary to obtain a target vector; wherein the vector dictionary is composed of multiple samples and corresponding text vectors; the text vector is obtained at least according to a semantic feature vector and a local difference vector; the local difference vector is obtained according to local features and difference features; the target vector is processed based on a target task model to obtain a text processing result; wherein the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service. In the embodiment of the present application, the target text is processed by a pre-constructed vector dictionary to obtain a target vector, and then the target vector is processed by the target task model. Since the target vector includes a semantic feature vector and a local difference vector, the accuracy of text processing can be improved, and the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service. Compared with the method of using a general large model (training a general large model requires a lot of computing resources), it is not only more targeted, but also can improve the efficiency of text processing.
[0054] Figure 2 A schematic diagram of the structure of a text processing device provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the device includes: a target text acquisition module 210, a text processing module 220 and a vector processing module 230;
[0055] A target text acquisition module 210 is used to acquire the target text;
[0056] A text processing module 220 is configured to process the target text based on a pre-built vector dictionary to obtain a target vector; wherein the vector dictionary is composed of a plurality of samples and corresponding text vectors; and the text vector is obtained based on at least a semantic feature vector and a local difference vector;
[0057] The vector processing module 230 is used to process the target vector based on the target task model to obtain a text processing result; wherein the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the call center customer service field.
[0058] The technical solution of the embodiment of the present application is to obtain the target text through the target text acquisition module; to process the target text based on a pre-constructed vector dictionary through the text processing module to obtain a target vector; wherein the vector dictionary is composed of multiple samples and corresponding text vectors; the text vector is obtained at least according to the semantic feature vector and the local difference vector; the local difference vector is obtained according to the local feature and the difference feature; to process the target vector based on the target task model through the vector processing module to obtain a text processing result; wherein the target task model is any one of the text classification model, text clustering model and sentiment analysis model in the field of call center customer service. In the embodiment of the present application, the target text is processed through a pre-constructed vector dictionary to obtain a target vector, and then the target vector is processed by the target task model. Since the target vector includes the semantic feature vector and the local difference vector, the accuracy of text processing can be improved, and the target task model is any one of the text classification model, text clustering model and sentiment analysis model in the field of call center customer service, which can improve the efficiency of text processing relative to the method of using a general large model.
[0059] Optionally, the text processing module is specifically used to: match the target text with the samples in the vector dictionary to obtain a matching result; if the matching result is a successful match, use the corresponding vector in the vector dictionary as the target vector; if the matching result is a failed match, update the vector dictionary based on the target text to process the target text based on the updated vector dictionary.
[0060] Optionally, the above-mentioned device also includes a construction module for obtaining a training set including multiple tasks; performing local feature processing on each sample in the training set to obtain multiple target local features corresponding to each sample; performing difference processing on each sample in the training set to obtain multiple difference features corresponding to each sample; performing vector processing on each sample in the training set to obtain a semantic feature vector corresponding to each sample; for each sample, processing the corresponding multiple target local features and the multiple difference features to obtain a local difference vector corresponding to each sample; splicing the semantic feature vector and the local difference vector to obtain a text vector corresponding to each sample.
[0061] Optionally, the construction module is also used to: respectively set a first set window size, a second set window size, a third set window size and a fourth set window size; wherein, the first set window size is smaller than the second set window size; the second set window size is smaller than the third set window size; the third set window size is smaller than the fourth set window size; perform feature extraction on each sample according to the first set window size, the second set window size, the third set window size and the fourth set window size, respectively, to obtain multiple initial local features corresponding to each set window size corresponding to each sample; count the number of occurrences of each initial local feature corresponding to each set window size; and use the initial local feature whose number of occurrences is greater than or equal to the set threshold as the target local feature of the corresponding set window size.
[0062] Optionally, the construction module is also used to: for any target sample, determine the number of intersection terms between the target sample and each of the remaining samples in the training set; wherein the remaining samples and the target sample constitute the training set; wherein the number of intersection terms is the number of words that exist in common in the target sample and any one of the remaining samples; determine the number of union terms between the target sample and each of the remaining samples in the training set; wherein the number of union terms is the number of deduplicated words after the target sample and any one of the remaining samples are merged; based on the number of intersection terms, the number of union terms combined with the difference coefficient, determine the difference characteristics between the target sample and each of the remaining samples.
[0063] Optionally, the construction module is also used to: perform vector conversion on multiple target local features corresponding to each set window size of each sample to obtain a local vector corresponding to each set window size of each sample; fuse the local vectors corresponding to each set window size in each sample to obtain a local fusion vector corresponding to each sample; fuse the local fusion vector corresponding to each sample with the multiple difference features corresponding to each sample to obtain a local difference vector corresponding to each sample.
[0064] The text processing device provided in the embodiment of the present application can execute the text processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0065] Figure 3 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0066] like Figure 3 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the random access memory (RAM) 13. The processor 11, the read-only memory (ROM) 12, and the random access memory (RAM) 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0067] Various components in the electronic device 10 are connected to an input / output (I / O) interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0068] The processor 11 may be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors for running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as method text processing.
[0069] In some embodiments, the method text processing may be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the read-only memory (ROM) 12 and / or the communication unit 19. When the computer program is loaded into the random access memory (RAM) 13 and executed by the processor 11, one or more steps of the method text processing described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method text processing in any other appropriate manner (e.g., by means of firmware).
[0070] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0071] Computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0072] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0073] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0074] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0075] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0076] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the text processing method provided in any embodiment of the present application.
[0077] The computer program product, during implementation, may be written in one or more programming languages or a combination thereof, for performing the operations of the present application, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0078] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the appended claims.
Claims
1. A text processing method, characterized in that: include: Get the target text; The target text is processed based on a pre-constructed vector dictionary to obtain a target vector; wherein the vector dictionary is composed of multiple samples and corresponding text vectors; the text vector is obtained by splicing at least a semantic feature vector and a local difference vector; the local difference vector is obtained based on the local features and the difference features; Processing the target vector based on a target task model to obtain a text processing result; wherein the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service; The vector dictionary is constructed by: obtaining a training set including multiple tasks; A first set window size, a second set window size, a third set window size, and a fourth set window size are set respectively; wherein the first set window size is smaller than the second set window size; the second set window size is smaller than the third set window size; and the third set window size is smaller than the fourth set window size; feature extraction is performed on each sample according to the first set window size, the second set window size, the third set window size, and the fourth set window size, respectively, to obtain a plurality of initial local features corresponding to each set window size corresponding to each sample; the number of occurrences of each initial local feature corresponding to each set window size is counted; and the initial local feature whose number of occurrences is greater than or equal to a set threshold is used as the target local feature of the corresponding set window size; For any target sample, determine the number of intersection terms between the target sample and each of the remaining samples in the training set; wherein the remaining samples and the target sample constitute the training set; wherein the number of intersection terms is the number of words that exist in common in the target sample and any one of the remaining samples; determine the number of union terms between the target sample and each of the remaining samples in the training set; wherein the number of union terms is the number of deduplicated words after the target sample and any one of the remaining samples are merged; based on the number of intersection terms, the number of union terms and the difference coefficient, determine the difference characteristics between the target sample and each of the remaining samples; Performing vector processing on each sample in the training set to obtain a semantic feature vector corresponding to each sample; For each of the samples, processing the corresponding multiple target local features and multiple difference features to obtain a local difference vector corresponding to each of the samples; The semantic feature vector and the local difference vector are concatenated to obtain a text vector corresponding to each sample.
2. The method according to claim 1, characterized in that The target text is processed based on a pre-built vector dictionary to obtain a target vector, including: Matching the target text with samples in the vector dictionary to obtain a matching result; If the matching result is successful, the corresponding vector in the vector dictionary is used as the target vector; If the matching result is a matching failure, the vector dictionary is updated based on the target text, so as to process the target text based on the updated vector dictionary.
3. The method according to claim 1, characterized in that For each of the samples, processing the corresponding multiple target local features and the multiple difference features to obtain a local difference vector corresponding to each of the samples includes: Performing vector conversion on the multiple target local features corresponding to each set window size of each sample to obtain the local vector corresponding to each set window size of each sample; Fusing the local vectors corresponding to each set window size in each sample to obtain a local fusion vector corresponding to each sample; The local fusion vector corresponding to each sample is fused with the multiple difference features corresponding to each sample to obtain the local difference vector corresponding to each sample.
4. A text processing device, characterized in that: include: A target text acquisition module is used to acquire the target text; A text processing module, configured to process the target text based on a pre-built vector dictionary to obtain a target vector; wherein the vector dictionary is composed of a plurality of samples and corresponding text vectors; and the text vector is obtained based on at least a semantic feature vector and a local difference vector; A vector processing module, configured to process the target vector based on a target task model to obtain a text processing result; wherein the target task model is any one of a text classification model, a text clustering model, and a sentiment analysis model in the field of call center customer service; The device also includes a construction module for obtaining a training set including multiple tasks; setting a first set window size, a second set window size, a third set window size, and a fourth set window size respectively; wherein the first set window size is smaller than the second set window size; the second set window size is smaller than the third set window size; and the third set window size is smaller than the fourth set window size; performing feature extraction on each sample according to the first set window size, the second set window size, the third set window size, and the fourth set window size respectively, to obtain a plurality of initial local features corresponding to each set window size corresponding to each sample; counting the number of occurrences of each initial local feature corresponding to each set window size; and using the initial local feature whose number of occurrences is greater than or equal to a set threshold as the target local feature of the corresponding set window size; For any target sample, determine the number of intersection terms between the target sample and each of the remaining samples in the training set; wherein the remaining samples and the target sample constitute the training set; wherein the number of intersection terms is the number of words that exist in common in the target sample and any one of the remaining samples; determine the number of union terms between the target sample and each of the remaining samples in the training set; wherein the number of union terms is the number of deduplicated words after the target sample and any one of the remaining samples are merged; based on the number of intersection terms, the number of union terms and the difference coefficient, determine the difference characteristics between the target sample and each of the remaining samples; Performing vector processing on each sample in the training set to obtain a semantic feature vector corresponding to each sample; For each of the samples, the corresponding multiple target local features and multiple difference features are processed to obtain a local difference vector corresponding to each sample; the semantic feature vector and the local difference vector are spliced to obtain a text vector corresponding to each sample.
5. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the text processing method according to any one of claims 1 to 3.
6. A storage medium comprising computer-executable instructions, wherein the computer-executable instructions are used to perform the text processing method according to any one of claims 1 to 3 when executed by a computer processor.
7. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the text processing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Emotion analysis method and device
CN106502989A
Text matching method and device, electronic equipment and storage medium
CN118797048A