Business text classification method and device, electronic equipment and storage medium

By combining the Transformer model and graph neural network, the encoded information of business graph data is extracted for text classification, which solves the problem of inaccurate classification caused by ignoring the relationship between words in existing methods, and achieves more efficient and accurate text classification.

CN118260428BActive Publication Date: 2026-11-06PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410465519.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2026-11-06
Estimated Expiration
2044-04-17

AI Technical Summary

Technical Problem

Existing business text classification methods ignore the distance relationships and semantic structure relationships between words, resulting in inaccurate text classification results.

Method used

A text classification model combining the Transformer model and graph neural network is adopted. By acquiring the business graph data of the text to be classified, distance numerical encoding, edge relation encoding, and importance encoding are extracted and encoded to improve classification accuracy.

Benefits of technology

It improves the accuracy and efficiency of business text classification in the healthcare field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118260428B_ABST
    Figure CN118260428B_ABST
Patent Text Reader

Abstract

This invention relates to artificial intelligence in the healthcare field, disclosing a business text classification method, comprising: preprocessing the text to be classified to obtain a standard business text set, and constructing a word vector matrix corresponding to the standard business text set; transforming the standard business text set into a graph to obtain corresponding business graph data, and extracting distance numerical codes, edge relation codes, and importance codes corresponding to the business graph data; encoding the distance numerical codes, edge relation codes, and importance codes using a text classification model to obtain feature code outputs; and classifying the feature code outputs to obtain standard text classification results. Furthermore, this invention also relates to blockchain technology, whereby the business graph data can be stored on blockchain nodes. This invention also proposes a business text classification device, electronic device, and storage medium. This invention can improve the efficiency of business text classification in the healthcare field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence, and in particular to a business text classification method, apparatus, electronic device, and storage medium. Background Technology

[0002] In the healthcare field, there are often different medical information or medical documents. In order to facilitate doctors or patients to retrieve relevant content, it is necessary to classify the medical texts corresponding to the medical information or medical texts and to define the category descriptions of the classified content types to make the subsequent search results of doctors or patients more accurate.

[0003] Existing business text classification methods typically use the Transformer model to encode and then classify the text. This classification method ignores the distance relationship and semantic structure relationship between words, resulting in inaccurate text classification results. Therefore, there is an urgent need to propose a more accurate business text classification method. Summary of the Invention

[0004] This invention provides a business text classification method, apparatus, electronic device, and storage medium, the main purpose of which is to improve the accuracy of business text classification in the medical and health field.

[0005] To achieve the above objectives, the present invention provides a business text classification method, comprising:

[0006] Obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set;

[0007] The standard business text set is transformed into a graph to obtain the corresponding business graph data. The distance value code, edge relationship code, and importance code corresponding to the business graph data are extracted respectively.

[0008] The distance numerical code, the edge relation code, and the importance code are encoded using a preset text classification model to obtain the feature code output;

[0009] The feature encoding output is then classified to obtain the standard text classification result.

[0010] Optionally, the step of preprocessing the text to be classified to obtain a standard business text set includes:

[0011] Identify texts in the text to be classified that meet preset filtering requirements, and remove texts in the text to be classified that meet preset filtering requirements to obtain cleaned business texts;

[0012] The cleaning business text is processed by text segmentation to obtain a standard business text set.

[0013] Optionally, constructing the word vector matrix corresponding to the standard business text set includes:

[0014] The number of business texts in the standard business text set is identified to obtain the total number of texts. An initial matrix vector is constructed using the total number of texts as the number of columns in a preset matrix.

[0015] The initial matrix vector is set with the column number corresponding to the standard business text as the first value and the remaining column numbers as the second value to obtain the word vector matrix.

[0016] Optionally, the step of performing graphical conversion on the standard business text set to obtain corresponding business graph data includes:

[0017] Extract word segments from the standard business text in the standard business text set as graph nodes, and identify the node relationships between any different graph nodes;

[0018] Business graph data is constructed using the graph nodes as nodes and the node relationships as graph relationships.

[0019] Optionally, the step of extracting the distance numerical code, edge relationship code, and importance code corresponding to the business graph data includes:

[0020] The distance value between any two graph nodes in the business graph data is identified as a distance numerical encoding.

[0021] Extract the relationship type between any two graph nodes in the business graph data, and use the relationship type as the edge relationship code corresponding to the business graph data;

[0022] Identify the part-of-speech tags of different graph nodes in the business graph data, and obtain the importance code corresponding to the business graph data based on the part-of-speech tags.

[0023] Optionally, the step of encoding the distance numerical code, the edge relation code, and the importance code using a preset text classification model to obtain the feature code output includes:

[0024] The business graph data is input into the encoder of a preset text classification model to obtain the business feature vector;

[0025] The business feature vector and the importance code are added together to obtain a summation vector;

[0026] Obtain the first vector, second vector, and third vector corresponding to the summation vector, and multiply the first vector, second vector, and third vector with the preset weight matrix respectively to obtain multiple weight vectors;

[0027] After multiplying the first weight vector and the second weight vector among the plurality of weight vectors, the resulting vector is added to the distance numerical code and the edge relationship code to obtain the final vector. The final vector is then input into a preset activation function to obtain the attention weights.

[0028] The attention weight is multiplied by the third weight vector among the multiple weight vectors to obtain the feature encoding output.

[0029] Optionally, the classification processing of the feature encoding output to obtain a standard text classification result includes:

[0030] The feature encoding output is input into the output layer of a preset text classification model to obtain a standard text classification result. The output layer is a fully connected layer or a multilayer perceptron.

[0031] To address the above problems, the present invention also provides a business text classification device, the device comprising:

[0032] The matrix construction module is used to obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set.

[0033] The feature extraction module is used to perform graphical transformation on the standard business text set to obtain the corresponding business graph data, and extract the distance value code, edge relationship code and importance code corresponding to the business graph data respectively;

[0034] The vector encoding module is used to encode the distance numerical code, the edge relationship code, and the importance code using a preset text classification model to obtain the feature encoding output;

[0035] The text classification module is used to classify the feature encoding output to obtain standard text classification results.

[0036] To address the above problems, the present invention also provides an electronic device, the electronic device comprising:

[0037] At least one processor; and,

[0038] A memory communicatively connected to the at least one processor; wherein,

[0039] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the business text classification method described above.

[0040] To address the aforementioned problems, the present invention also provides a storage medium storing at least one computer program, which is executed by a processor in an electronic device to implement the aforementioned business text classification method.

[0041] In this embodiment of the invention, a text classification model is formed by combining the Transformer model and a graph neural network. Business graph data corresponding to the text to be classified is obtained, and this business graph data is used as input to the text classification model. Text classification is then performed by combining the distance numerical encoding, edge relation encoding, and importance encoding of the text to be classified, resulting in a standard text classification result. Therefore, the business text classification method, apparatus, electronic device, and storage medium proposed in this invention can solve the problem of low efficiency in business text classification in the medical and health field. Attached Figure Description

[0042] Figure 1 This is a flowchart illustrating a business text classification method provided in an embodiment of the present invention;

[0043] Figure 2 for Figure 1 A detailed implementation flowchart of one of the steps;

[0044] Figure 3 A functional block diagram of a business text classification device provided in an embodiment of the present invention;

[0045] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the business text classification method according to an embodiment of the present invention.

[0046] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0047] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0048] This application provides a business text classification method. The execution entity of the business text classification method includes, but is not limited to, at least one of the following: a server, a terminal, or an electronic device that can be configured to execute the method provided in this application. In other words, the business text classification method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to, a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0049] Reference Figure 1 The diagram shown is a flowchart illustrating a business text classification method according to an embodiment of the present invention. In this embodiment, the business text classification method includes the following steps S1-S4:

[0050] S1. Obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set.

[0051] In this embodiment of the invention, the text to be classified needs to be preprocessed to facilitate subsequent model training. The text to be classified can be text in the medical and health field, for example, the text to be classified can be "What are the corresponding symptoms of diabetes", "How to relieve high blood pressure", "How to prevent colds in spring", etc.

[0052] Specifically, see Figure 2 As shown, the text preprocessing of the text to be classified to obtain a standard business text set includes:

[0053] S21. Identify the texts in the text to be classified that meet the preset filtering requirements, and remove the texts in the text to be classified that meet the preset filtering requirements to obtain the cleaned business texts.

[0054] S22. Perform text segmentation on the cleaned business text to obtain a standard business text set.

[0055] In detail, in this scheme, text that meets the screening requirements is text containing useless characters or noise. The useless characters can be special characters such as Martian script. The solution involves identifying text in the text to be classified that meets the preset screening requirements, and then removing the text containing useless characters or noise from the text to be classified to obtain the cleaned business text. A benchmark word segmenter is then used to perform text segmentation processing on the cleaned business text to obtain a standard business text set.

[0056] Furthermore, constructing the word vector matrix corresponding to the standard business text set includes:

[0057] The number of business texts in the standard business text set is identified to obtain the total number of texts. An initial matrix vector is constructed using the total number of texts as the number of columns in a preset matrix.

[0058] The initial matrix vector is set with the column number corresponding to the standard business text as the first value and the remaining column numbers as the second value to obtain the word vector matrix.

[0059] For example, if the total number of texts is 5, then the word vector matrix is ​​[1,0,0,0,0].

[0060] S2. Perform graphical transformation on the standard business text set to obtain the corresponding business graph data, and extract the distance value code, edge relationship code and importance code corresponding to the business graph data respectively.

[0061] In this embodiment of the invention, the standard business text set needs to be converted into a graph-like structure for subsequent data processing.

[0062] Specifically, the step of performing graphical conversion on the standard business text set to obtain corresponding business graph data includes:

[0063] Extract word segments from the standard business text in the standard business text set as graph nodes, and identify the node relationships between any different graph nodes;

[0064] Business graph data is constructed using the graph nodes as nodes and the node relationships as graph relationships.

[0065] In detail, graph transformation refers to converting input text data into a graph-like structure. Nodes in this graph represent words, and edges represent the relationships between these words. These relationships can be determined by various factors such as lexical semantics and context. For an article, each word is assigned a node, and the relationships between these words can be represented by edges.

[0066] Further, the extraction of the distance numerical code, edge relationship code, and importance code corresponding to the business graph data includes:

[0067] The distance value between any two graph nodes in the business graph data is identified as a distance numerical encoding.

[0068] Extract the relationship type between any two graph nodes in the business graph data, and use the relationship type as the edge relationship code corresponding to the business graph data;

[0069] Identify the part-of-speech tags of different graph nodes in the business graph data, and obtain the importance code corresponding to the business graph data based on the part-of-speech tags.

[0070] In detail, the edge value represents the distance between two words, and the distance between words is encoded as a distance value. The relationships between two words are also differentiated; for example, the phrase type formed by two words can be a dependency relationship, a parallel relationship, or a referential relationship, etc. The dependency relationship between words is symmetrical, and its encoding is the edge relationship encoding corresponding to the business graph data. Since each word has a different level of importance in the article, its part of speech is used to distinguish importance, ordered as follows: noun, verb, adjective, numeral, pronoun, adverb, preposition, conjunction, auxiliary word, interjection, and onomatopoeia, with earlier words being more important. Part-of-speech tagging is performed using a tagging tool, and the word importance encoding is the importance encoding corresponding to the business graph data.

[0071] S3. Use a preset text classification model to encode the distance numerical code, the edge relationship code, and the importance code to obtain the feature code output.

[0072] In this embodiment of the invention, the preset text classification model is the Graphormer model. The Graphormer model uses the Transformer encoder to complete the encoding process. The Transformer encoder is a deep neural network based on the self-attention mechanism. It can learn contextual information and transform the contextual information into feature vectors.

[0073] In the Graphormer model, the Transformer encoder transforms a graph-based input into a vector so that the neural network can make a decision.

[0074] Specifically, the step of encoding the distance numerical code, the edge relation code, and the importance code using a preset text classification model to obtain the feature code output includes:

[0075] The business graph data is input into the encoder of a preset text classification model to obtain the business feature vector;

[0076] The business feature vector and the importance code are added together to obtain a summation vector;

[0077] Obtain the first vector, second vector, and third vector corresponding to the summation vector, and multiply the first vector, second vector, and third vector with the preset weight matrix respectively to obtain multiple weight vectors;

[0078] After multiplying the first weight vector and the second weight vector among the plurality of weight vectors, the resulting vector is added to the distance numerical code and the edge relationship code to obtain the final vector. The final vector is then input into a preset activation function to obtain the attention weights.

[0079] The attention weight is multiplied by the third weight vector among the multiple weight vectors to obtain the feature encoding output.

[0080] In detail, the business feature vector is vector-summed with the importance encoding to obtain three identical vectors corresponding to the summation vector: a first vector, a second vector, and a third vector (QKV). These three vectors are then multiplied by a preset weight matrix (WQ, WK, WV) to obtain multiple weight vectors. The preset weight matrix consists of three matrices: WQ, WK, and WV. The multiple weight vectors are three new vectors: QKV. The first weight vector (Q) and the second weight vector (K) are multiplied together and then added to the distance numerical encoding and the edge relation encoding. This result is then input into an activation function to obtain attention weights. These attention weights are multiplied by the third weight vector and used as the input to the output layer. The activation function is the softmax function.

[0081] S4. Classify the feature encoding output to obtain the standard text classification result.

[0082] In this embodiment of the invention, the classification processing of the feature encoding output to obtain a standard text classification result includes:

[0083] The feature encoding output is input into the output layer of a preset text classification model to obtain a standard text classification result. The output layer is a fully connected layer or a multilayer perceptron.

[0084] In detail, the Graphormer model passes the feature encoding output to the output layer to obtain the category of the text data. The output layer is either a fully connected layer or a multilayer perceptron (MLP). With the help of this output layer, the model can determine the category of the text to be classified based on the vectors.

[0085] In this embodiment of the invention, a text classification model is formed by combining the Transformer model and a graph neural network. Business graph data corresponding to the text to be classified is obtained, and this business graph data is used as input to the text classification model. The model combines distance numerical encoding, edge relation encoding, and importance encoding of the text to be classified to perform text classification, resulting in a standard text classification result. Therefore, the business text classification method proposed in this invention can solve the problem of low efficiency in business text classification in the medical and health field.

[0086] like Figure 3 The diagram shown is a functional block diagram of a business text classification device provided in an embodiment of the present invention.

[0087] The business text classification device 100 of this invention can be installed in an electronic device. Depending on the functions implemented, the business text classification device 100 may include a matrix construction module 101, a feature extraction module 102, a vector encoding module 103, and a text classification module 104. The module described in this invention can also be referred to as a unit, which refers to a series of computer program segments that can be executed by the processor of an electronic device and can perform a fixed function, and which are stored in the memory of the electronic device.

[0088] In this embodiment, the functions of each module / unit are as follows:

[0089] The matrix construction module 101 is used to obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set.

[0090] The feature extraction module 102 is used to perform graphical transformation on the standard business text set to obtain corresponding business graph data, and extract the distance value code, edge relationship code and importance code corresponding to the business graph data respectively;

[0091] The vector encoding module 103 is used to encode the distance numerical encoding, the edge relation encoding, and the importance encoding using a preset text classification model to obtain feature encoding output;

[0092] The text classification module 104 is used to classify the feature encoding output to obtain a standard text classification result.

[0093] In detail, the specific implementation methods of each module of the business text classification device 100 are as follows:

[0094] Step 1: Obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set.

[0095] In this embodiment of the invention, the text to be classified needs to be preprocessed to facilitate subsequent model training. The text to be classified can be text in the medical and health field, for example, the text to be classified can be "What are the corresponding symptoms of diabetes", "How to relieve high blood pressure", "How to prevent colds in spring", etc.

[0096] Specifically, the text preprocessing of the text to be classified to obtain a standard business text set includes:

[0097] Identify texts in the text to be classified that meet preset filtering requirements, and remove texts in the text to be classified that meet preset filtering requirements to obtain cleaned business texts;

[0098] The cleaning business text is processed by text segmentation to obtain a standard business text set.

[0099] In detail, in this scheme, text that meets the screening requirements is text containing useless characters or noise. The useless characters can be special characters such as Martian script. The solution involves identifying text in the text to be classified that meets the preset screening requirements, and then removing the text containing useless characters or noise from the text to be classified to obtain the cleaned business text. A benchmark word segmenter is then used to perform text segmentation processing on the cleaned business text to obtain a standard business text set.

[0100] Furthermore, constructing the word vector matrix corresponding to the standard business text set includes:

[0101] The number of business texts in the standard business text set is identified to obtain the total number of texts. An initial matrix vector is constructed using the total number of texts as the number of columns in a preset matrix.

[0102] The initial matrix vector is set with the column number corresponding to the standard business text as the first value and the remaining column numbers as the second value to obtain the word vector matrix.

[0103] For example, if the total number of texts is 5, then the word vector matrix is ​​[1,0,0,0,0].

[0104] Step 2: Perform graphical transformation on the standard business text set to obtain the corresponding business graph data, and extract the distance numerical code, edge relationship code, and importance code corresponding to the business graph data.

[0105] In this embodiment of the invention, the standard business text set needs to be converted into a graph-like structure for subsequent data processing.

[0106] Specifically, the step of performing graphical conversion on the standard business text set to obtain corresponding business graph data includes:

[0107] Extract word segments from the standard business text in the standard business text set as graph nodes, and identify the node relationships between any different graph nodes;

[0108] Business graph data is constructed using the graph nodes as nodes and the node relationships as graph relationships.

[0109] In detail, graph transformation refers to converting input text data into a graph-like structure. Nodes in this graph represent words, and edges represent the relationships between these words. These relationships can be determined by various factors such as lexical semantics and context. For an article, each word is assigned a node, and the relationships between these words can be represented by edges.

[0110] Further, the extraction of the distance numerical code, edge relationship code, and importance code corresponding to the business graph data includes:

[0111] The distance value between any two graph nodes in the business graph data is identified as a distance numerical encoding.

[0112] Extract the relationship type between any two graph nodes in the business graph data, and use the relationship type as the edge relationship code corresponding to the business graph data;

[0113] Identify the part-of-speech tags of different graph nodes in the business graph data, and obtain the importance code corresponding to the business graph data based on the part-of-speech tags.

[0114] In detail, the edge value represents the distance between two words, and the distance between words is encoded as a distance value. The relationships between two words are also differentiated; for example, the phrase type formed by two words can be a dependency relationship, a parallel relationship, or a referential relationship, etc. The dependency relationship between words is symmetrical, and its encoding is the edge relationship encoding corresponding to the business graph data. Since each word has a different level of importance in the article, its part of speech is used to distinguish importance, ordered as follows: noun, verb, adjective, numeral, pronoun, adverb, preposition, conjunction, auxiliary word, interjection, and onomatopoeia, with earlier words being more important. Part-of-speech tagging is performed using a tagging tool, and the word importance encoding is the importance encoding corresponding to the business graph data.

[0115] Step 3: Use a preset text classification model to encode the distance numerical code, the edge relationship code, and the importance code to obtain the feature code output.

[0116] In this embodiment of the invention, the preset text classification model is the Graphormer model. The Graphormer model uses the Transformer encoder to complete the encoding process. The Transformer encoder is a deep neural network based on the self-attention mechanism. It can learn contextual information and transform the contextual information into feature vectors.

[0117] In the Graphormer model, the Transformer encoder transforms a graph-based input into a vector so that the neural network can make a decision.

[0118] Specifically, the step of encoding the distance numerical code, the edge relation code, and the importance code using a preset text classification model to obtain the feature code output includes:

[0119] The business graph data is input into the encoder of a preset text classification model to obtain the business feature vector;

[0120] The business feature vector and the importance code are added together to obtain a summation vector;

[0121] Obtain the first vector, second vector, and third vector corresponding to the summation vector, and multiply the first vector, second vector, and third vector with the preset weight matrix respectively to obtain multiple weight vectors;

[0122] After multiplying the first weight vector and the second weight vector among the plurality of weight vectors, the resulting vector is added to the distance numerical code and the edge relationship code to obtain the final vector. The final vector is then input into a preset activation function to obtain the attention weights.

[0123] The attention weight is multiplied by the third weight vector among the multiple weight vectors to obtain the feature encoding output.

[0124] In detail, the business feature vector is vector-summed with the importance encoding to obtain three identical vectors corresponding to the summation vector: a first vector, a second vector, and a third vector (QKV). These three vectors are then multiplied by a preset weight matrix (WQ, WK, WV) to obtain multiple weight vectors. The preset weight matrix consists of three matrices: WQ, WK, and WV. The multiple weight vectors are three new vectors: QKV. The first weight vector (Q) and the second weight vector (K) are multiplied together and then added to the distance numerical encoding and the edge relation encoding. This result is then input into an activation function to obtain attention weights. These attention weights are multiplied by the third weight vector and used as the input to the output layer. The activation function is the softmax function.

[0125] Step 4: Perform classification processing on the feature encoding output to obtain the standard text classification result.

[0126] In this embodiment of the invention, the classification processing of the feature encoding output to obtain a standard text classification result includes:

[0127] The feature encoding output is input into the output layer of a preset text classification model to obtain a standard text classification result. The output layer is a fully connected layer or a multilayer perceptron.

[0128] In detail, the Graphormer model passes the feature encoding output to the output layer to obtain the category of the text data. The output layer is either a fully connected layer or a multilayer perceptron (MLP). With the help of this output layer, the model can determine the category of the text to be classified based on the vectors.

[0129] In this embodiment of the invention, a text classification model is formed by combining the Transformer model and a graph neural network. Business graph data corresponding to the text to be classified is obtained, and this business graph data is used as input to the text classification model. The model combines distance numerical encoding, edge relation encoding, and importance encoding of the text to be classified to perform text classification, resulting in a standard text classification result. Therefore, the business text classification device proposed in this invention can solve the problem of low efficiency in business text classification in the medical and health field.

[0130] like Figure 4 The diagram shown is a structural schematic of an electronic device for implementing a business text classification method according to an embodiment of the present invention.

[0131] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program, such as a business text classification program, stored in the memory 11 and capable of running on the processor 10.

[0132] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., executing business text classification programs) and calls data stored in the memory 11 to perform various functions of the electronic device and process data.

[0133] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed on the electronic device, such as the code of a business text classification program, but also to temporarily store data that has been output or will be output.

[0134] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.

[0135] The communication interface 13 is used for communication between the aforementioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), or, optionally, a standard wired or wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.

[0136] Figure 4 Only electronic devices with components are shown; those skilled in the art will understand that... Figure 4 The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0137] For example, although not shown, the electronic device may also include a power supply (such as a battery) to power the various components. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0138] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0139] The business text classification program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions, which, when run in the processor 10, can achieve the following:

[0140] Obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set;

[0141] The standard business text set is transformed into a graph to obtain the corresponding business graph data. The distance value code, edge relationship code, and importance code corresponding to the business graph data are extracted respectively.

[0142] The distance numerical code, the edge relation code, and the importance code are encoded using a preset text classification model to obtain the feature code output;

[0143] The feature encoding output is then classified to obtain the standard text classification result.

[0144] Specifically, the specific implementation method of the processor 10 for the above instructions can be referred to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, and will not be repeated here.

[0145] Furthermore, if the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a storage medium. The storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0146] The present invention also provides a storage medium storing a computer program, which, when executed by a processor of an electronic device, can perform the following:

[0147] Obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set;

[0148] The standard business text set is transformed into a graph to obtain the corresponding business graph data. The distance value code, edge relationship code, and importance code corresponding to the business graph data are extracted respectively.

[0149] The distance numerical code, the edge relation code, and the importance code are encoded using a preset text classification model to obtain the feature code output;

[0150] The feature encoding output is then classified to obtain the standard text classification result.

[0151] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0152] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0153] Furthermore, the functional modules in the various embodiments of the present invention 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 in the form of hardware plus software functional modules.

[0154] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0155] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0156] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0157] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0158] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0159] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A business text classification method, characterized in that, The method includes: Obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set; The standard business text set is transformed into a graph to obtain the corresponding business graph data. The distance value code, edge relationship code, and importance code corresponding to the business graph data are extracted respectively. The distance numerical code, the edge relation code, and the importance code are encoded using a preset text classification model to obtain the feature code output; The feature encoding output is classified to obtain the standard text classification result; The step of extracting the distance value code, edge relationship code, and importance code corresponding to the business graph data includes: identifying the distance value between any two graph nodes in the business graph data as the distance value code; extracting the relationship type between any two graph nodes in the business graph data and using the relationship type as the edge relationship code corresponding to the business graph data; identifying the part-of-speech tags of different graph nodes in the business graph data and obtaining the importance code corresponding to the business graph data based on the part-of-speech tags; The step of encoding the distance numerical code, the edge relation code, and the importance code using a preset text classification model to obtain feature code output includes: inputting the business graph data into the encoder of the preset text classification model to obtain a business feature vector; performing vector addition on the business feature vector and the importance code to obtain a summation vector; obtaining a first vector, a second vector, and a third vector corresponding to the summation vector, and multiplying the first vector, the second vector, and the third vector with a preset weight matrix to obtain multiple weight vectors; multiplying the first weight vector and the second weight vector among the multiple weight vectors, and adding the result of the multiplication with the distance numerical code and the edge relation code to obtain a final vector; inputting the final vector into a preset activation function to obtain attention weights; and multiplying the attention weights with the third weight vector among the multiple weight vectors to obtain the feature code output.

2. The business text classification method as described in claim 1, characterized in that, The text preprocessing of the text to be classified to obtain a standard business text set includes: Identify texts in the text to be classified that meet preset filtering requirements, and remove texts in the text to be classified that meet preset filtering requirements to obtain cleaned business texts; The cleaning business text is processed by text segmentation to obtain a standard business text set.

3. The business text classification method as described in claim 1, characterized in that, The construction of the word vector matrix corresponding to the standard business text set includes: The number of business texts in the standard business text set is identified to obtain the total number of texts. An initial matrix vector is constructed using the total number of texts as the number of columns in a preset matrix. The initial matrix vector is set with the column number corresponding to the standard business text as the first value and the remaining column numbers as the second value to obtain the word vector matrix.

4. The business text classification method as described in claim 1, characterized in that, The step of performing graphical conversion on the standard business text set to obtain the corresponding business graph data includes: Extract word segments from the standard business text in the standard business text set as graph nodes, and identify the node relationships between any different graph nodes; Business graph data is constructed using the graph nodes as nodes and the node relationships as graph relationships.

5. The business text classification method as described in claim 1, characterized in that, The classification process performed on the feature encoding output to obtain the standard text classification result includes: The feature encoding output is input into the output layer of a preset text classification model to obtain a standard text classification result. The output layer is a fully connected layer or a multilayer perceptron.

6. A business text classification apparatus, used to implement the business text classification method as described in any one of claims 1 to 5, characterized in that, The device includes: The matrix construction module is used to obtain the text to be classified, perform text preprocessing on the text to be classified to obtain a standard business text set, and construct the word vector matrix corresponding to the standard business text set. The feature extraction module is used to perform graphical transformation on the standard business text set to obtain the corresponding business graph data, and extract the distance value code, edge relationship code and importance code corresponding to the business graph data respectively; The vector encoding module is used to encode the distance numerical code, the edge relationship code, and the importance code using a preset text classification model to obtain the feature encoding output; The text classification module is used to classify the feature encoding output to obtain standard text classification results.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the business text classification method as described in any one of claims 1 to 5.

8. A storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the business text classification method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Classification code determination method, device and equipment and storage medium

    CN112599213A

  • Method and system for aspect-level sentiment classification by merging graphs

    US20230267322A1