User demand information extraction method and device based on text mining, equipment, storage medium and product
Through text mining-based methods, user appeal information from massive texts is automatically extracted, which solves the problems of low efficiency and low accuracy in the existing technology, achieving fast and accurate information extraction and improving user satisfaction.
Patent Information
- Application Number
- CN202410816509.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-10-01
AI Technical Summary
In the existing technology, the method of manually reviewing massive texts to extract user demand information is inefficient and inaccurate, and cannot quickly and accurately extract user demand information, resulting in the inability to effectively improve banking services and reducing user satisfaction.
Using a method based on text mining, by obtaining the text to be processed, performing word segmentation processing and recognition model identification, generating triplet information and building a knowledge graph, automatically extracting user appeal information, saving labor costs, and improving efficiency and accuracy.
It achieves rapid and accurate extraction of user appeal information, saves labor costs, and improves the efficiency of banking business improvement and user satisfaction.
Smart Images

Figure CN118733770A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data, and in particular to a method, device, equipment, storage medium and product for extracting user demand information based on text mining. Background Art
[0002] With the continuous development of banking services, in the process of providing banking services to users, user feedback will be recorded in the form of text, which will result in a massive amount of text. It is necessary to extract user demand information from the massive text.
[0003] In the prior art, the user's demand information is obtained by manually viewing the text.
[0004] However, in the above method, the method of obtaining user demand information by manually reviewing text requires high labor costs, and has low efficiency, low accuracy, and low coverage, so it is impossible to quickly and accurately extract user demand information; and further, it is impossible to provide good improvement measures to solve user demands, thereby reducing user satisfaction with banking services. Summary of the invention
[0005] The present application provides a method, device, equipment, storage medium and product for extracting user demand information based on text mining, so as to solve the problem of how to quickly and accurately extract user demand information from massive texts.
[0006] In a first aspect, the present application provides a method for extracting user demand information based on text mining, comprising:
[0007] Obtaining a text set to be processed; wherein the text set to be processed includes a plurality of texts to be processed;
[0008] Performing word segmentation processing on the text to be processed to obtain a word sequence of the text to be processed, wherein the word sequence of the text to be processed includes each word in the text to be processed;
[0009] Inputting the word sequence of the text to be processed into a preset first recognition model for recognition processing, and obtaining at least one triplet of the text to be processed; wherein the triplet includes an object element, an attribute element, and evaluation information, wherein the object element is an object evaluated by a user, the attribute element is an attribute of the object element, and the evaluation information is an evaluation result of the object element under the attribute element;
[0010] A knowledge graph is generated based on the triple information of the text to be processed; wherein the knowledge graph includes the triple information of the text to be processed; and the triple information in the knowledge graph represents user demand information.
[0011] In a second aspect, the present application provides a user demand information extraction device based on text mining, comprising:
[0012] An acquisition module, used for acquiring a text set to be processed; wherein the text set to be processed includes a plurality of texts to be processed;
[0013] A first processing module is used to perform word segmentation processing on the text to be processed to obtain a word sequence of the text to be processed, wherein the word sequence of the text to be processed includes each word in the text to be processed;
[0014] A second processing module is used to input the word sequence of the text to be processed into a preset first recognition model for recognition processing, and obtain at least one triple information of the text to be processed; wherein the triple information includes an object element, an attribute element, and evaluation information, the object element is an object evaluated by a user, the attribute element is an attribute of the object element, and the evaluation information is an evaluation result of the object element under the attribute element;
[0015] A generation module generates a knowledge graph based on the triple information of the text to be processed; wherein the knowledge graph includes the triple information of the text to be processed; and the triple information in the knowledge graph represents the user demand information.
[0016] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0017] The memory stores computer-executable instructions;
[0018] The processor executes the computer-executable instructions stored in the memory to implement the method described in the first aspect above.
[0019] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect above.
[0020] In a fifth aspect, a computer program product comprises a computer program, which, when executed by a processor, implements the method described in the first aspect above.
[0021] The user demand information extraction method, device, equipment, storage medium and product based on text mining provided by the present application automatically obtain a set of texts to be processed, wherein the set of texts to be processed includes multiple texts to be processed. Afterwards, each text to be processed is automatically divided into single sentences, and then the text to be processed of each single sentence is divided into word sequences. Then, the word sequence of the text to be processed is automatically input into a preset first recognition model for recognition processing to obtain at least one triple information of the text to be processed, wherein the triple information includes object elements, attribute elements, and evaluation information. Finally, the triple information of the text to be processed is automatically stored in a graph database to obtain a knowledge graph.
[0022] By automatically dividing each text to be processed into a single sentence, and then dividing the text to be processed of each single sentence into a word sequence and inputting it into the preset first recognition model, the preset first recognition model can more accurately identify the triple information. Since the triple information includes object elements, attribute elements, and evaluation information, the user's demand information can be accurately summarized. By storing the triple information in a graph database to generate a knowledge graph, it is possible to quickly query based on the content in the triple information based on the graph database, so that the user's demand information can be quickly located. Therefore, this embodiment can quickly and accurately extract the user's demand information, save labor costs, and has high efficiency, high accuracy, and high coverage.
[0023] After quickly and accurately extracting user demand information, we can provide good improvement measures to solve user demands, thereby improving user satisfaction with banking services. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0025] Figure 1 A flowchart of a method for extracting user demand information based on text mining provided in an embodiment of the present application;
[0026] Figure 2 An example of a knowledge graph provided for an embodiment of the present application;
[0027] Figure 3 A flowchart of another method for extracting user demand information based on text mining provided in an embodiment of the present application;
[0028] Figure 4 A schematic diagram of the structure of a device for extracting user demand information based on text mining provided in an embodiment of the present application;
[0029] Figure 5A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0030] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0033] In addition, this application involves big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and the use of artificial intelligence technology for automated decision-making, and a technical solution for making decisions that have a significant impact on personal rights and interests based on the results of automated decision-making. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decision-making; if the user chooses to reject, the expert decision-making process will be entered.
[0034] It should be noted that the method and device for extracting user demand information based on text mining in the present application can be used in the field of big data, and can also be used in any field except artificial intelligence. The application field of the method and device for extracting user demand information based on text mining in the present application is not limited.
[0035] With the continuous development of science and technology, banks can obtain users' opinions on banking services from various channels, such as recording users' feedback from customer service calls in text form, and obtaining users' text opinions on banking services from Internet news media or social media. As a result, a huge amount of text will be obtained. It is necessary to extract users' demand information from the huge amount of text.
[0036] In one example, users' textual opinions on banking services can be manually sampled to obtain information about their demands.
[0037] However, in the above method, since a large amount of text opinions are manually checked, high labor costs are required, and the efficiency, accuracy and coverage are low, so it is impossible to quickly and accurately extract user demand information; and therefore, it is impossible to provide good improvement measures to solve user demands, thereby reducing user satisfaction with banking services.
[0038] In response to the problems in the prior art, the present application proposes the following technical concept: automatically extracting accurately summarized user demand information from a massive amount of text opinions, and at the same time, automatically filtering, classifying and identifying important text opinions from a massive amount of text opinions. Since the present application automatically extracts user demand information from a massive amount of text opinions, it can save labor costs and has high efficiency, high accuracy and high coverage. At the same time, since the present application automatically extracts accurately summarized user demand information and automatically filters, classifies and identifies important text opinions from a massive amount of text opinions, it can quickly and accurately extract user demand information. Further, good improvement measures can be provided to resolve user demands and improve user satisfaction with banking services.
[0039] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0040] Figure 1 A flowchart of a method for extracting user demand information based on text mining provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0041] S101, obtaining a text set to be processed; wherein the text set to be processed includes a plurality of texts to be processed.
[0042] Exemplarily, the execution subject of this embodiment can be a server, or a terminal device, or an electronic device, or a user demand information extraction device or device based on text mining, or other devices or equipment that can implement the solution of this application, without limitation. Among them, the server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server can also be a server of a distributed system, or a server combined with a blockchain.
[0043] This embodiment is introduced by taking the execution subject as a server as an example.
[0044] The server obtains a text set to be processed, wherein the text set to be processed includes a plurality of texts to be processed.
[0045] The text to be processed may be, for example, customer service records obtained from a bank server, feedback text from a user by calling a customer service hotline, or news reports or social media texts related to the bank downloaded from the Internet, etc. This embodiment does not limit this.
[0046] The language of the text to be processed may be, for example, Chinese, English, or a mixture of Chinese and English, etc. This embodiment does not impose any limitation on this.
[0047] S102 , performing word segmentation processing on the text to be processed to obtain a word sequence of the text to be processed, wherein the word sequence of the text to be processed includes each word in the text to be processed.
[0048] After obtaining the to-be-processed text set, the server may perform sentence segmentation processing on each to-be-processed text in the to-be-processed text set to obtain a sentence set corresponding to each to-be-processed text.
[0049] For example, the server can segment sentences based on the period or line break in the text to be processed. Assuming that the content of a text to be processed is "Today, I went to the counter to do business, and the teller's attitude was bad. The electronic bank inter-bank remittance was unsuccessful.", the server can segment the text to be processed into two sentences: [Today, I went to the counter to do business, and the teller's attitude was bad.] and [The electronic bank inter-bank remittance was unsuccessful.] based on the period.
[0050] After obtaining the sentence set corresponding to each text to be processed, the server inputs the sentence set corresponding to each text to be processed into a word segmenter (such as BasicTokenizer word segmenter and / or WordpieceTokenizer word segmenter, etc.), performs word segmentation on each sentence in the sentence set, and obtains the word sequence of each sentence in the text to be processed.
[0051] The word sequence of each sentence in the to-be-processed text includes each word in each sentence in the to-be-processed text. For Chinese, the word sequence of each sentence in the to-be-processed text may be, for example, splitting the sentence into a series of Chinese characters and removing punctuation marks. Assume that the sentence "Today, I was doing business at the counter, and the teller's attitude was bad." is processed by word segmentation, and the result is ['today', 'day', 'at', 'counter', 'counter', 'do', 'business', 'business', 'counter', 'clerk', 'attitude', 'degree', 'not', 'good'].
[0052] For English, the word sequence of each sentence in the text to be processed can be understood as splitting the sentence into a series of words or subwords, where subwords can be understood as, for example, when a word does not exist in the vocabulary of the word segmenter, splitting the word into multiple subwords in the vocabulary, and adding ## in front of the subwords, the purpose is to use these subwords to better understand the semantics of the sentence later. Suppose the sentence "The attitude of the teller is notgood." is segmented, and ['the', 'attitude', 'of', 'the', 'teller', 'is', 'not', 'good'] is obtained. For example, suppose that during word segmentation, the word unaffable does not exist in the vocabulary of the word segmenter, but its corresponding subwords un, aff, and able exist in the vocabulary, then ##un, ##aff, and ##able are also taken as the results of word segmentation.
[0053] The same sentence contains both Chinese and English. The processing method is similar to the above and will not be repeated here.
[0054] S103. Input the word sequence of the text to be processed into a preset first recognition model for recognition processing to obtain at least one triplet of the text to be processed; wherein the triplet information includes an object element, an attribute element, and evaluation information. The object element is the object evaluated by the user, the attribute element is the attribute of the object element, and the evaluation information is the evaluation result of the object element under the attribute element.
[0055] After obtaining the word sequence of each sentence in the text to be processed, the server may input the word sequence of each sentence in the text to be processed into a preset first recognition model for recognition processing to obtain at least one triplet information of the text to be processed.
[0056] Among them, the preset first recognition model can be, for example, an ErBERT automatic ontology model, which can realize the extraction of triple information from the word sequence of the text to be processed. The triple information includes object elements, attribute elements, and evaluation information. The object element is the object evaluated by the user, the attribute element is the attribute of the object element, and the evaluation information is the evaluation result of the object element under the attribute element. For example, the server inputs the word sequence ['today', 'day', 'in', 'counter', 'desk', 'office', 'business', 'business', 'counter', 'staff', 'attitude', 'degree', 'not', 'good'] into the preset first recognition model, and can obtain the triple information <teller, attitude, bad>, wherein "teller" is the object element, "attitude" is the attribute element, and "bad" is the evaluation information.
[0057] S104. Generate a knowledge graph based on the triple information of the text to be processed; wherein the knowledge graph includes the triple information of the text to be processed; the triple information in the knowledge graph represents the user demand information.
[0058] Knowledge graph is a technical method that uses a graph model to describe knowledge and model the relationship between all things in the world. The knowledge graph of this embodiment includes triple information of the text to be processed.
[0059] The server can store the knowledge graph through a graph database (such as a Neo4j graph database). In the graph database of this embodiment, the knowledge graph includes nodes and edges, wherein the nodes can be object elements or evaluation information in triple information, and the edges can be attribute elements in triple information.
[0060] For example, you can combine Figure 2 To understand, Figure 2 The knowledge graph example provided in the embodiment of the present application is as follows: Figure 2 As shown, in the knowledge graph example 20, nodes 201, 207, and 210 represent object elements in their respective triple information, nodes 203, 205, 209, 212, and 214 represent evaluation information in their respective triple information, and edges 202, 204, 206, 208, 211, and 213 represent attribute elements in their respective triple information.
[0061] like Figure 2 As shown, each edge and its two adjacent nodes form a triplet of information. For example, node 201, edge 202, and node 203 form a triplet of information <teller, attitude, bad>. The composition of other triplet information is similar to that of the triplet information <teller, attitude, bad>, which will not be repeated here.
[0062] Figure 2Each triplet of information in represents an accurate summary of user demand information. For example, from the triplet information <teller, attitude, bad>, we can see the user demand information that the teller has a bad attitude.
[0063] In order to generate a knowledge graph, the server can map at least one triple information of the text to be processed to an OWL file after obtaining it, and convert the OWL file into RDF format through a tool (such as the RDB2RDF tool), and then import the RDF into the graph database through a graph database tool (such as the Neo4j graph database) to generate a knowledge graph.
[0064] In this embodiment, first, a set of texts to be processed is automatically obtained, wherein the set of texts to be processed includes a plurality of texts to be processed. Afterwards, each text to be processed is automatically segmented into a single sentence, and then each single sentence of the text to be processed is segmented into a word sequence. Then, the word sequence of the text to be processed is automatically input into a preset first recognition model for recognition processing, and at least one triple information of the text to be processed is obtained, wherein the triple information includes an object element, an attribute element, and evaluation information. Finally, the triple information of the text to be processed is automatically stored in a graph database, thereby obtaining a knowledge graph.
[0065] By automatically dividing each text to be processed into a single sentence, and then dividing the text to be processed of each single sentence into a word sequence and inputting it into the preset first recognition model, the preset first recognition model can more accurately identify the triple information. Since the triple information includes object elements, attribute elements, and evaluation information, the user's demand information can be accurately summarized. By storing the triple information in a graph database to generate a knowledge graph, it is possible to quickly query based on the content in the triple information based on the graph database, so that the user's demand information can be quickly located. Therefore, this embodiment can quickly and accurately extract the user's demand information, save labor costs, and has high efficiency, high accuracy, and high coverage.
[0066] After quickly and accurately extracting user demand information, we can provide good improvement measures to solve user demands, thereby improving user satisfaction with banking services.
[0067] Figure 3 A flowchart of another method for extracting user demand information based on text mining provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the method includes:
[0068] S301, obtaining a text set to be processed; wherein the text set to be processed includes a plurality of texts to be processed.
[0069] Exemplarily, the execution subject of this embodiment can be a server, or a terminal device, or an electronic device, or a user demand information extraction device or device based on text mining, or other devices or equipment that can implement the solution of this application, without limitation. Among them, the server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server can also be a server of a distributed system, or a server combined with a blockchain.
[0070] This embodiment is introduced by taking the execution subject as a server as an example.
[0071] The implementation of step S301 is similar to that of step S101. For a detailed description, please refer to the description of step S101, which will not be repeated here.
[0072] S302 , performing word segmentation processing on the text to be processed to obtain a word sequence of the text to be processed, wherein the word sequence of the text to be processed includes each word in the text to be processed.
[0073] The implementation of step S302 is similar to that of step S102. For detailed description, please refer to the description of step S102, which will not be repeated here.
[0074] S303. Input the word sequence of the text to be processed into the word vectorization module in the preset first recognition model to perform feature extraction on the word sequence of the text to be processed to obtain feature information of the word sequence of the text to be processed; wherein the feature information includes the semantics of the text to be processed and the vectorization features of each word in the word sequence.
[0075] After the server obtains the word sequence of each sentence in the text to be processed, it inputs it into the word vectorization module in the preset first recognition model (such as the ErBERT automatic ontology model), and first vectorizes each word in the word sequence of each sentence in the text to be processed, that is, a combined vector representation of word vector representation (token embedding), sentence vector representation (segment embedding), and position vector representation (position embedding). It should be noted that each word in the word sequence, if it is Chinese, refers to Chinese characters, and if it is English, refers to words or subwords.
[0076] Among them, the word vector representation can be understood as converting each word in the word sequence of each sentence into a vector of fixed dimension (for example, it can be converted into a 768-dimensional vector), and at the same time adding the word vector representation corresponding to the beginning ([CLS]) at the beginning of each sentence. The dimension of the word vector representation is the same as the dimension of the word vector representation corresponding to each word in the word sequence. The server can, for example, obtain the word vector representation corresponding to each word by looking up the pre-trained embedding table in the preset first recognition model. At this time, the word vector representation corresponding to each word in the word sequence can be understood as recording the semantics of the word itself. The word vector representation corresponding to [CLS] in the word sequence currently has no obvious semantic features, and it is mainly used to subsequently record the semantics of the entire sentence.
[0077] For example, for the word sequence ['today', 'day', 'in', 'counter', 'office', 'business', 'service', 'counter', 'staff', 'attitude', 'degree', 'not', 'good'], the server can find the 768-dimensional word vector representation corresponding to 'today' in the pre-trained embedding table in the preset first recognition model. Similarly, it can also find the 768-dimensional word vector representation corresponding to other characters in the word sequence. At the same time, the 768-dimensional word vector representation corresponding to [CLS] is added to the beginning of the sentence.
[0078] Segment embedding refers to the vector representation used to distinguish whether each word in the word segmentation sequence belongs to the first sentence or the second sentence in the classification task of the sentence pair. The dimension of the vector representation is the same as the dimension of the word vector representation corresponding to each word in the word sequence. For example, a 768-dimensional 0 vector can be used to represent the first sentence in the sentence pair, and a 768-dimensional 1 vector can be used to represent the second sentence in the sentence pair. Since the present embodiment is a single sentence input into the preset first recognition model, the sentence vector representation corresponding to the [CLS] of the word sequence and the sentence vector representation corresponding to each word can all be set to 768-dimensional 0.
[0079] For example, for the word sequence ['[CLS]', 'today', 'day', 'in', 'counter', 'desk', 'office', 'business', 'service', 'counter', 'staff', 'attitude', 'degree', 'not', 'good'] with [CLS] added, the server can assign the sentence vector representation corresponding to '[CLS]', the sentence vector representation corresponding to 'today', and the sentence vector representation corresponding to each other word in the word sequence to 768-dimensional 0.
[0080] The position vector representation can be understood as the order of each word in the sentence in the word sequence of each additional [CLS]. The preset first recognition model can encode the [CLS] and each word in each sentence through pre-training when applied. The dimension of the vector representation is the same as the dimension of the word vector representation corresponding to each word in the word sequence. Since the semantics of the same word may be different when the order in the sentence is different, recording the position vector representation is conducive to the preset first recognition model to more accurately understand the semantics of the word in the sentence.
[0081] For example, for the word sequence ['[CLS]', 'today', 'day', 'in', 'counter', 'desk', 'office', 'business', 'service', 'counter', 'staff', 'attitude', 'degree', 'not', 'good'] with [CLS] added, the server can represent the position vector corresponding to '[CLS]' as 768-dimensional 0, the position vector corresponding to 'today' as 768-dimensional 1, and the position vectors corresponding to subsequent words are represented by adding 1 in sequence.
[0082] After the server obtains the word vector representation, sentence vector representation, and position vector representation corresponding to [CLS] and each word in the word sequence with [CLS] added to each sentence in the text to be processed, it can add them together to obtain the combined vector representation corresponding to [CLS] and each word in the word sequence. Afterwards, the server performs feature extraction on the combined vector representation corresponding to [CLS] and each word in the word sequence with [CLS] added to each sentence in the text to be processed based on the word vectorization module in the preset first recognition model to obtain the feature information of the word sequence of the text to be processed, which can also be understood as obtaining the vectorized features corresponding to [CLS] and each word in the word sequence with [CLS] added to each sentence in the text to be processed.
[0083] For example, the server inputs the word sequence ['today', 'day', 'in', 'counter', 'office', 'business', 'service', 'counter', 'staff', 'attitude', 'degree', 'not', 'good'] into the word vectorization module in the preset first recognition model for feature extraction, and obtains the feature information of [CLS] representing the semantics of the entire sentence, the feature information representing the semantics of 'today', the feature information representing the semantics of 'day', and the feature information representing the semantics of each other word in the word sequence.
[0084] When the word vectorization module in the preset first recognition model extracts features for each word in the word sequence, its contextual information in the sentence will be considered (for example, when the preset first recognition model is pre-trained, the bidirectional contextual information in the sentence can be learned by predicting the masked words, so that the semantic information of each word in the bidirectional context of the sentence can be better captured when the model is applied.) At the same time, the semantics of the word itself can be considered through the word vector representation in the combined vector representation corresponding to each word, and the positional semantics of the word in the sentence can be considered through the position vector representation in the combined vector representation corresponding to each word, so that the feature information corresponding to each word in the word sequence containing rich semantic features can be extracted.
[0085] [CLS] is initially a symbol without obvious semantic features. After feature extraction by the word vectorization module in the preset first recognition model, the feature information corresponding to [CLS] can fairly integrate the meanings of each word in its corresponding sentence, and thus can be used as the semantic representation of the corresponding entire sentence.
[0086] S304 , performing maximum pooling processing on the feature information of the word sequence of the text to be processed to obtain processed feature information.
[0087] After obtaining the [CLS] of each sentence in the text to be processed and the feature information corresponding to each word in the word sequence, the server can perform maximum pooling processing on the [CLS] of each sentence in the text to be processed and the feature information corresponding to each word in the word sequence, so as to reduce the dimension of the [CLS] of each sentence in the text to be processed and the feature information corresponding to each word in the word sequence, so as to simplify the network calculation complexity, extract the main semantic features, and obtain the processed feature information.
[0088] For example, the server performs maximum pooling processing on the feature information of [CLS] and the word sequence ['[CLS]','today','day','in','counter','desk','office','business','service','counter','staff','attitude','degree','not','good'] to obtain the processed feature information, that is, the feature information of [CLS] and the word sequence ['[CLS]','today','day','in','counter','desk','office','business','service','counter','staff','attitude','degree','not','good'] with reduced dimension and extracted main semantic features, among which '[CLS]' represents the main semantic features of its corresponding sentence, 'today' represents its main semantic features, and each other character in the word sequence represents its main semantic features.
[0089] S305. Based on the entity extraction module in the preset first recognition model, perform entity extraction processing on the processed feature information to obtain vector information of the entity corresponding to the text to be processed; and based on the relationship classification module in the preset first recognition model, process the vector information of the entity and the processed feature information to obtain a relationship vector between each pair of adjacent entities in the text to be processed, where the relationship vector represents the relationship between a pair of adjacent entities, where a pair of adjacent entities include object elements and evaluation information, and where the relationship between a pair of adjacent entities is an attribute element.
[0090] After the server extracts the feature information of [CLS] and word sequence of the main semantic features from each sentence in the text to be processed, it can perform entity extraction processing on the feature information of [CLS] and word sequence of the main semantic features extracted based on the entity extraction module in the preset first recognition model. For example, a sequence annotation method (such as BIO annotation method) can be used to identify the boundary of the entity, and then the corresponding entity name is determined by the boundary of the entity. After that, the feature information of the entity name and the [CLS] of the sentence in which it is located is concatenated and sent to the fully connected layer to predict the entity category, and the scores of the corresponding multiple predicted entity categories are obtained. After that, the scores of the entity categories are mapped to the probabilities of each predicted entity category through the activation function layer (such as softmax layer), and the predicted entity category with the largest probability is selected as the corresponding entity category of the text to be processed. After that, the feature information of the entity name, entity category, and [CLS] of the sentence in which it is located is used as the vector information of the entity.
[0091] For example, based on the entity extraction module in the preset first recognition model, the server extracts the main semantic features of [CLS] and the feature information of the word sequence ['[CLS]', 'today', 'day', 'in', 'counter', 'desk', 'office', 'business', 'service', 'counter', 'staff', 'attitude', 'degree', 'not', 'good'], and can use the sequence annotation method (such as the BIO annotation method) to identify 'counter', 'staff' is the boundary of the entity, and then it can be determined that 'teller' is the corresponding entity name according to the boundary of the entity. Then, the feature information of [CLS] of the sentence where the entity name 'teller' is located is concatenated and sent to the fully connected layer and the softmax layer. Assuming that the predicted entity category with the highest probability is the staff member in the object element, the staff member in the object element is used as the entity category corresponding to the entity name 'teller'. After that, the entity name 'teller', the entity category of the staff member in the object element, and the feature information of [CLS] of the sentence where it is located are used as the vector information of the entity corresponding to 'teller'.
[0092] Similarly, the vector information of the entity corresponding to "bad" can also be obtained, where "bad" is the corresponding entity name, the corresponding entity category is evaluation information, and the vector information of the entity also includes the feature information of [CLS] of the sentence in which it is located.
[0093] When performing entity extraction based on the entity extraction module in the preset first recognition model, when using the sequence labeling method to identify the boundaries of entities, since the main semantic features of each word are taken into consideration and the main semantic features include the semantic features of the context of the word, the boundaries of the entity can be more accurately identified, thereby more accurately identifying the name of the entity, and then inputting the more accurate name of the entity and the feature information of [CLS] that represents the semantic features of the sentence in which it is located into the fully connected layer, the entity category can be more accurately predicted.
[0094] After obtaining the vector information of the entities in each sentence in the text to be processed, the server extracts the main semantic features [CLS] and the feature information of the word sequence in the sentence, and the vector information of the text corresponding to each pair of adjacent entities is used as the candidate relationship vector. Then, the vector information of each pair of adjacent entities in each sentence in the text to be processed and the candidate relationship vector between the pair of adjacent entities are input into the relationship classification module in the preset first recognition model, that is, the vector information of each pair of adjacent entities in each sentence in the text to be processed and the candidate relationship vector between the pair of adjacent entities are sent to the fully connected layer to predict the relationship vector between the pair of adjacent entities, and obtain the scores of the corresponding multiple predicted relationship vectors. After that, the scores of the multiple predicted relationship vectors are mapped to the probabilities of each predicted relationship vector through the activation function layer (such as the softmax layer), and the predicted relationship vector with the largest probability is selected as the relationship vector between the pair of adjacent entities, wherein the relationship between a pair of adjacent entities can be understood as an attribute element.
[0095] For example, suppose the server extracts the vector information of the entity corresponding to 'teller' and the vector information of the entity corresponding to 'bad' from the feature information of the word sequence ['[CLS]', 'today', 'day', 'in', 'counter', 'desk', 'office', 'business', 'service', 'counter', 'clerk', 'attitude', 'degree', 'not', 'good'] which has extracted the main semantic features of [CLS]. Then, the server uses the vector information of the text corresponding to the word sequence between the above two adjacent entities as the candidate relationship vector corresponding to 'attitude'.
[0096] Afterwards, the server inputs the vector information of the entity corresponding to 'teller', the vector information of the entity corresponding to 'bad', and the candidate relationship vector corresponding to 'attitude' into the relationship classification module in the preset first recognition model. Assuming that the predicted relationship vector with the highest probability is the relationship vector corresponding to 'attitude', the relationship vector corresponding to 'attitude' is used as the relationship vector between the pair of adjacent entities.
[0097] Relationship extraction is performed based on the relationship classification module in the preset first recognition model. When predicting the relationship vector in the fully connected layer, the semantic features in the vector information of a pair of adjacent entities are considered (including the semantic features of each entity and the feature information of [CLS] that represents the overall semantic features of the sentence in which it is located), and the candidate relationship vectors between a pair of adjacent entities are also considered. Therefore, the relationship vector of the pair of adjacent entities can be predicted more accurately.
[0098] S306. Generate triple information of the text to be processed based on the vector information of the entity corresponding to the text to be processed and the relationship vector between each pair of adjacent entities in the text to be processed; the triple information includes object elements, attribute elements, and evaluation information, the object element is the object evaluated by the user, the attribute element is the attribute of the object element, and the evaluation information is the evaluation result of the object element under the attribute element.
[0099] After obtaining the vector information of the entity corresponding to the text to be processed and the relationship vector between each pair of adjacent entities in the text to be processed, the server can generate a triplet of information of the text to be processed in the order of <object element, attribute element, evaluation information> for each pair of adjacent entity vectors and the relationship vector between the pair of adjacent entities.
[0100] For example, if the server obtains the vector information of the entity corresponding to "teller" (the entity category is the staff member of the object element) and the vector information of the entity corresponding to "bad" (the entity category is the evaluation information), and the above two entities are adjacent, and at the same time, the relationship vector corresponding to "attitude" between the adjacent entities is obtained (which can also be understood as an attribute element), the triple information of <teller, attitude, bad> can be generated. It can be seen that this triple information is an accurate summary of the user's demand information.
[0101] S307. Generate a knowledge graph based on the triple information of the text to be processed; wherein the knowledge graph includes the triple information of the text to be processed; the triple information in the knowledge graph represents the user demand information.
[0102] The implementation of step S307 is similar to that of step S104. For detailed description, please refer to the description of step S104, which will not be repeated here.
[0103] S308: Filter the subset to filter out useless text to be processed, and obtain a filtered subset.
[0104] In one example, the text collection to be processed includes subcollections corresponding to different text sources, and the subcollections include text to be processed from the same text source.
[0105] Step S308 may include, for example, the following process:
[0106] The subset is input into the Naive Bayes model for filtering to filter out useless texts to be processed, thereby obtaining a filtered subset.
[0107] Alternatively, the subset is input into a naive Bayes model based on Laplace smoothing for filtering to filter out useless texts to be processed, thereby obtaining a subset after filtering.
[0108] The text collection to be processed includes subsets corresponding to different text sources. For example, multiple opinion texts from users' feedback on customer service calls can form a subset, or multiple related texts from news reports can form a subset, and multiple related texts from social media can also form a subset.
[0109] The subset corresponding to each text source may include a large amount of unprocessed texts under the same text source, including unprocessed texts that contain user demand information and unprocessed texts that do not contain user demand information. Therefore, the server can filter each subset to filter out useless unprocessed texts and obtain a filtered subset.
[0110] Specifically, there are two implementation methods, for example:
[0111] In the first possible implementation, two categories are preset, namely, the category of useful sentences and the category of useless sentences, wherein the category of useful sentences can be understood as sentences containing user's demand information, and the category of useless sentences can be understood as sentences not containing user's demand information.
[0112] Assume that the naive Bayes model has been trained and has learned the keywords in the sentence, the prior probability of belonging to the category of useful sentences, and the prior probability of belonging to the category of useless sentences for a newly input sentence. It has also learned that after inputting a new sentence, it can predict the keywords in the sentence, the posterior probability of belonging to the category of useful sentences, and the posterior probability of belonging to the category of useless sentences based on the prior probabilities corresponding to the keywords in the sentence, and select the category with the largest posterior probability as the prediction result and output it.
[0113] Afterwards, the server can perform sentence segmentation on each text to be processed in each subset, and then convert each sentence in the text to be processed into a one-dimensional sentence vector, and input the one-dimensional sentence vector into the trained naive Bayes model to predict the category corresponding to each sentence in the one-dimensional sentence vector. Then, the text to be processed corresponding to the one-dimensional sentence vector of the category of all useless sentences is deleted to filter out the useless text to be processed and obtain the filtered subset.
[0114] For example, the content of a text to be processed in a subset is: "Points can be used for a lottery. Cards can be exchanged for points. ATMs cannot be used for withdrawals." First, the text is segmented and converted into a one-dimensional sentence vector, which includes the vector corresponding to "points can be used for a lottery", the vector corresponding to "cards can be exchanged for points", and the vector corresponding to "ATMs cannot be used for withdrawals".
[0115] After that, the one-dimensional sentence vector is input into the trained naive Bayes model, and it can be predicted that the category corresponding to "points can be used for lottery" in the one-dimensional sentence vector is the category of useless sentences, the category corresponding to "card exchange points" is also the category of useless sentences, and the category corresponding to "self-service teller machine cannot withdraw money" is the category of useful sentences. Since the one-dimensional sentence vector corresponding to the text to be processed contains the category of useful sentences, the text to be processed is retained.
[0116] If the content of the text to be processed is only: "Points can be used for lottery. Get a card to exchange points.", similar to the above implementation, it can be understood that the one-dimensional sentence vector corresponding to the text to be processed is all useless sentence categories, so the text to be processed is deleted, thereby filtering out the useless text to be processed.
[0117] In the first possible implementation, if a keyword representing a category of useful sentences has not appeared during the training of the Naive Bayes model, then when the Naive Bayes model is applied, since the prior probability is 0, the predicted posterior probability is also 0, so the category cannot be predicted, which is obviously unreasonable. In order to solve this problem, this embodiment provides a second possible implementation, that is, based on the first possible implementation, a Naive Bayes model based on Laplace smoothing is used instead of the Naive Bayes model.
[0118] When training the Naive Bayes model based on Laplace smoothing, it is assumed that there have been two trainings before the training is performed. The prediction results of one training belong to the category of useful sentences, and the prediction results of the other training belong to the category of useless sentences. Therefore, the zero probability problem of the Naive Bayes model can be solved. Since the training sample is relatively large, adding two training results will not affect the accuracy of the prediction results of the Naive Bayes model based on Laplace smoothing.
[0119] S309 , clustering the texts to be processed in the filtered subset to obtain at least one text category of the filtered subset, each text category having at least one text to be processed.
[0120] After the server obtains the filtered subset, the number of texts to be processed in the filtered subset may still be relatively large, and the demand information of multiple types of users is mixed together, which is not conducive to identifying the demand information of users. Therefore, the server can perform clustering processing on the texts to be processed in the filtered subset (for example, a Chinese restaurant process clustering model can be used) to obtain at least one text category of the filtered subset.
[0121] Among them, the Chinese restaurant process clustering model can construct an infinite-dimensional probability distribution by simulating the dining behavior of customers in Chinese restaurants, which is used to generate infinite text categories. Each text category corresponds to a cluster, and each cluster includes at least one text to be processed. These texts to be processed all reflect the same or similar user demand information. Therefore, the user demand information in the text to be processed corresponding to a certain text category can be quickly queried.
[0122] For example, assuming that the subset 1 from the text source 1 after filtering includes text A1 to be processed, text A2 to be processed, text A3 to be processed, text A4 to be processed, and text A5 to be processed, and the subset is input into the Chinese restaurant process clustering model, we can obtain text category 1 including text A1 to be processed, text A3 to be processed, and text A5 to be processed, and text category 2 including text A2 to be processed and text A4 to be processed.
[0123] S310 , aggregate the texts to be processed under the text categories of the filtered subsets corresponding to the text sources to obtain processed text categories.
[0124] In one example, step S310 includes the following steps:
[0125] The first step of step S310 is to extract keywords from the text to be processed under the text category corresponding to each text source, and obtain keywords of the text to be processed under the text category corresponding to each text source.
[0126] The second step of step S310: for the text to be processed under the same text source, if it is determined that the keywords of the text to be processed under the text source are the same as the keywords of the text to be processed under other text sources, the text to be processed under other text sources is classified into the text category to which the text to be processed under the text source belongs.
[0127] After the server obtains at least one text category of each subset after filtering, since the descriptions of the same type of user's demand information in different text sources may be different, the same type of user's demand information may exist in the texts to be processed from different text sources, which is not conducive to quickly identifying the user's demand information.
[0128] In order to solve the above problem, the server can aggregate the text to be processed by the keywords in the text to be processed to obtain the processed text categories. Since the processed text in each text category more accurately reflects the demand information of the same or similar users, the user demand information in the text to be processed corresponding to a certain text category can be queried more quickly.
[0129] For example, based on the example described in step S309, it is assumed that the subset 2 from text source 2 after filtering includes text category 3 of to-be-processed text B1, to-be-processed text B2, and to-be-processed text B3. First, keyword extraction is performed on the to-be-processed texts under the text category corresponding to each text source to obtain the keywords of the to-be-processed texts under the text category corresponding to each text source. For the to-be-processed texts under subset 2 of text source 2, it is assumed that the keywords of to-be-processed text B3 under text category 3 are the same as the keywords of to-be-processed text A3 under text category 1 under subset 1 of text source 1, then the to-be-processed text A3 is moved from text category 1 under subset 1 of text source 1 to text category 3 under subset 2 of text source 2.
[0130] S311, obtaining a first set of texts to be trained and a second set of texts to be trained; wherein the first set of texts to be trained includes texts to be trained under a first label, and the second set of texts to be trained includes texts to be trained under a second label.
[0131] For example, the first label may indicate that the user's demand information corresponding to the to-be-trained text has a higher importance level. The second label may indicate that the user's demand information corresponding to the to-be-trained text has a lower importance level than the user's demand information corresponding to the to-be-trained text under the first label.
[0132] The training texts in the first training text set and the second training text set may be obtained, for example, by accessing the historical opinion texts of users who give feedback by calling customer service on the bank server; they may also be obtained by downloading historical news reports related to the bank from the Internet; they may also be historical social media texts related to the bank downloaded from the Internet, etc. At the same time, each training text is labeled with the first label or the second label.
[0133] S312: Based on the first text set to be trained and the second text set to be trained, the initial logistic regression model is trained to obtain a preset second recognition model.
[0134] It is understandable that the initial logistic regression model, for example, can be a support vector machine model, which can achieve efficient data classification by finding the optimal separation hyperplane in the feature space. However, since the model has not been learned from any data, it does not yet have the ability to classify the text to be processed. Therefore, it is necessary to use the first text set to be trained and the second text set to be trained to train the initial logistic regression model so that the initial logistic regression model can automatically learn the classification rules and features according to the input data, so that effective classification can be performed on unknown data.
[0135] After obtaining the first set of texts to be trained and the second set of texts to be trained, the server can input them into the initial logistic regression model for training. After each training process, the predicted value of each text to be trained after training and the true value corresponding to the text to be trained (the first label or the second label corresponding to the text to be trained) are input into the loss function to calculate the loss under the parameters, and according to the value of the loss function, the updated parameters are generated with the goal of minimizing the loss function. Then, the training process is performed again according to the updated parameters, and the training is repeated multiple times until the loss function is minimized, the training is terminated, and the initial logistic regression model after training is used as the preset second recognition model.
[0136] It can be understood that in the process of training the initial logistic regression model, the model will continuously learn the rules and features in the first set of texts to be trained and the second set of texts to be trained, and gradually optimize its own parameters, so that it can better classify unknown data in the future.
[0137] Since the first set of texts to be trained and the second set of texts to be trained do not change frequently, for example, the process of step S311 to step S312 can be performed once every N months to update the preset second recognition model. (N is a natural number ≥ 1, and the specific implementation can be determined according to actual needs and experience, and this embodiment does not limit this)
[0138] S313. Input the processed texts to be processed under each text category into a preset second recognition model to obtain each text to be processed under the first label and each text to be processed under the second label; wherein the first label and the second label are both importance levels of the text, and the importance level represented by the first label is higher than the importance level represented by the second label.
[0139] After obtaining the processed texts to be processed under each text category, the server inputs them into the latest preset second recognition model to obtain each text to be processed under the first label and each text to be processed under the second label.
[0140] For example, the server inputs the processed text A1 and text A5 under text category 1, the processed text A2 and text A4 under text category 2, and the processed text B1, text B2, text B3, and text A3 under text category 3 into the preset second recognition model, and the processed text A2, text A4, and text B3 under the first label can be obtained. These processed texts can be understood as the importance level of the user's demand information corresponding to them. At the same time, the processed text A1, text A5, text B1, text B2, and text A3 under the second label are obtained. These processed texts can be understood as the importance level of the user's demand information corresponding to them, which is lower than the importance level of the user's demand information corresponding to the processed text under the first label.
[0141] S314. Display the text to be processed under the first label to the user; and in response to the user's processing instruction for the text to be processed under the first label, determine that the user demand information indicated by the processing instruction is the user demand information in the text to be processed under the first label; wherein the processing instruction indicates the user demand information in the text to be processed.
[0142] After obtaining the text to be processed under the first tag, the server may send the text to be processed to the terminal device, and then the terminal device may display the text to be processed to the user.
[0143] If the terminal device receives a processing instruction issued by the user for the text to be processed under the first tag, the terminal device sends the content of the processing instruction to the server. Afterwards, the server uses the content of the processing instruction as the user demand information in the corresponding text to be processed.
[0144] The content of the processing instruction, for example, can also be understood as the user demand information extracted from the text to be processed after the user views it. The user can input the content of the processing instruction into the terminal device.
[0145] In one example, it is assumed that the texts to be processed under the first tag obtained by the server are text A2 to be processed, text A4 to be processed, and text B3 to be processed. After that, the server sends them to the terminal device, and the terminal device displays these texts to be processed to the user. Assuming that the terminal device receives the processing instruction for the text A2 to be processed issued by the user, that is, the user's demand information corresponding to the text A2 to be processed, the terminal device sends the user's demand information corresponding to the text A2 to be processed to the server. Then, the server uses the user's demand information as the user demand information in the text A2 to be processed.
[0146] Since the user's demand information corresponding to the to-be-processed text under the first label has a high importance level, the above processing can facilitate the priority processing of the user's demand information with a high importance level.
[0147] S315. In response to a user's trigger instruction on the knowledge graph, solution information is generated according to the triple information to which the information represented by the node indicated by the trigger instruction belongs; wherein the trigger instruction is used to indicate the node in the knowledge graph selected by the user, and the node in the knowledge graph is the object element or evaluation information in the triple information; the solution information represents the solution to the evaluation information in the triple information.
[0148] After the server generates the knowledge graph, it can also send the knowledge graph to the terminal device, which then displays the knowledge graph to the user. When the terminal device receives a trigger instruction for the knowledge graph from the user, the terminal device sends the trigger instruction to the server. Then, the server generates the solution information corresponding to the user demand information represented by the triple information based on the triple information to which the information represented by the node indicated by the trigger instruction belongs and the preset triple information and solution mapping relationship table, and sends it to the terminal device, which then displays it to the user.
[0149] In an example, suppose the knowledge graph generated by the server is as follows Figure 2 As shown, the preset triple information and solution mapping relationship table indicates the solution information corresponding to the user demand information represented by each triple information, for example Figure 2 In the preset triplet information and solution mapping relationship table, the corresponding solution information for the triplet information <electronic banking, inter-bank remittance, failure> is: fix the problem of the inter-bank remittance module in the electronic banking program product; in the preset triplet information and solution mapping relationship table, the corresponding solution information for the triplet information <electronic banking, balance change SMS reminder, cannot be received> is: fix the problem of the balance change SMS reminder module in the electronic banking program product.
[0150] Assume that the node indicated by the trigger instruction sent by the user to the knowledge graph received by the server is Figure 2 In the electronic banking, the server obtains the solution information corresponding to each triplet information related to the electronic banking from the preset triplet information and solution mapping relationship table, and sends it to the terminal device, which then displays it to the user.
[0151] In this embodiment, when extracting features from each word in a word sequence based on the word vectorization module in the preset first recognition model, the context information in the sentence is considered. At the same time, the semantics of the word itself and the position semantics of the word in the sentence can be considered through the combined vector corresponding to each word, so that the feature information corresponding to each word in the word sequence with rich semantic features can be extracted. The feature information corresponding to [CLS] can fairly integrate the meanings of each word in the corresponding sentence, so that it can be used as the semantic representation of the corresponding entire sentence.
[0152] Afterwards, the feature information of the word sequence of the processed text is subjected to maximum pooling processing to obtain the processed feature information reflecting the main semantic features. Furthermore, when performing entity extraction based on the entity extraction module in the preset first recognition model, when using the sequence labeling method to identify the boundary of the entity, since the main semantic features of each word are taken into account, and the main semantic features include the semantic features of the context of the word, the boundary of the entity can be more accurately identified, and thus the name of the entity can be more accurately identified, and then the more accurate entity name and the feature information of [CLS] representing the semantic features of the sentence in which it is located are input into the fully connected layer, which can more accurately predict the entity category, so that the entity vector information determined according to the predicted entity category is more accurate.
[0153] Then, relationship extraction is performed based on the relationship classification module in the preset first recognition model. When predicting the relationship vector in the fully connected layer, the semantic features in the vector information of a pair of adjacent entities are taken into account, and the candidate relationship vectors between a pair of adjacent entities are also considered. Therefore, the relationship vector of the pair of adjacent entities can be predicted more accurately.
[0154] According to the more accurate entity vector information corresponding to the text to be processed and the more accurate relationship vector between each pair of adjacent entities in the text to be processed, more accurate triple information of the text to be processed can be generated. Then, based on the triple information of the text to be processed, a knowledge graph is automatically generated. Since each triple information is an accurate summary of the user's demand information, this embodiment can quickly and accurately extract the user's demand information, save labor costs, high efficiency, high accuracy, and high coverage, and can provide good improvement measures to solve the user's demands and improve the user's satisfaction with banking services.
[0155] In this embodiment, the subset of the text to be processed is filtered based on the naive Bayes model or the naive Bayes model based on Laplace smoothing, which can filter out useless text to be processed. After that, the text to be processed in the subset after filtering is clustered (for example, the Chinese restaurant process clustering model can be used), and then the aggregation process is performed according to the keywords in the text to be processed, so that the text to be processed under different text categories can be obtained. Furthermore, it is conducive to quickly identifying the user's demand information from the text to be processed of different text categories.
[0156] In this embodiment, by inputting the processed texts to be processed under each text category into the preset second recognition model, each text to be processed containing user demand information with a high importance level is obtained, so that each text to be processed containing user demand information with a high importance level can be preferentially processed.
[0157] In this embodiment, solution information corresponding to the user demand information represented by the triple information is generated according to the triple information to which the information represented by the node indicated by the trigger instruction belongs and a preset triple information and solution mapping relationship table.
[0158] Therefore, it is possible to quickly and accurately extract user demand information, save labor costs, and have high efficiency, high accuracy, and high coverage, and then provide good improvement measures to solve user demands and improve user satisfaction with banking services.
[0159] Figure 4 A schematic diagram of a user demand information extraction device based on text mining provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the device 40 includes:
[0160] The acquisition module 401 is used to acquire a text set to be processed; wherein the text set to be processed includes a plurality of texts to be processed.
[0161] The first processing module 402 is used to perform word segmentation processing on the text to be processed to obtain a word sequence of the text to be processed, wherein the word sequence of the text to be processed includes each word in the text to be processed.
[0162] The second processing module 403 is used to input the word sequence of the text to be processed into the preset first recognition model for recognition processing to obtain at least one triple information of the text to be processed; wherein the triple information includes object elements, attribute elements, and evaluation information, the object element is the object evaluated by the user, the attribute element is the attribute of the object element, and the evaluation information is the evaluation result of the object element under the attribute element.
[0163] The generation module 404 generates a knowledge graph based on the triple information of the text to be processed; wherein the knowledge graph includes the triple information of the text to be processed; and the triple information in the knowledge graph represents the user demand information.
[0164] In a possible implementation, the second processing module 403 is specifically configured to:
[0165] Inputting the word sequence of the text to be processed into the word vectorization module in the preset first recognition model to extract features of the word sequence of the text to be processed, and obtaining feature information of the word sequence of the text to be processed; wherein the feature information includes the semantics of the text to be processed and the vectorization features of each word in the word sequence;
[0166] Perform maximum pooling processing on the feature information of the word sequence of the text to be processed to obtain the processed feature information;
[0167] Based on the entity extraction module in the preset first recognition model, entity extraction processing is performed on the processed feature information to obtain vector information of the entity corresponding to the text to be processed; and based on the relationship classification module in the preset first recognition model, the vector information of the entity and the processed feature information are processed to obtain a relationship vector between each pair of adjacent entities in the text to be processed, where the relationship vector represents the relationship between a pair of adjacent entities, where a pair of adjacent entities includes object elements and evaluation information, and where the relationship between a pair of adjacent entities is an attribute element;
[0168] According to the vector information of the entity corresponding to the text to be processed and the relationship vector between each pair of adjacent entities in the text to be processed, the triple information of the text to be processed is generated.
[0169] In a possible implementation, the text collection to be processed includes subcollections corresponding to different text sources, and the subcollections include texts to be processed from the same text source.
[0170] In a possible implementation, the device 40 provided in this embodiment is further used for:
[0171] Filtering the subset to filter out useless texts to be processed, and obtaining a filtered subset;
[0172] Performing clustering processing on the texts to be processed in the filtered subset to obtain at least one text category of the filtered subset, each text category having at least one text to be processed;
[0173] Aggregate the texts to be processed under the text categories of the filtered subsets corresponding to each text source to obtain each processed text category;
[0174] Input the processed texts to be processed under each text category into a preset second recognition model to obtain each text to be processed under a first label and each text to be processed under a second label; wherein the first label and the second label are both importance levels of the text, and the importance level represented by the first label is higher than the importance level represented by the second label;
[0175] Display the text to be processed under the first label to the user; and in response to the user's processing instruction for the text to be processed under the first label, determine that the user demand information indicated by the processing instruction is the user demand information in the text to be processed under the first label; wherein the processing instruction indicates the user demand information in the text to be processed.
[0176] In a possible implementation, the device 40 provided in this embodiment, when filtering the subset to filter out useless text to be processed and obtaining the filtered subset, is specifically used to:
[0177] The subset is input into the Naive Bayes model for filtering to filter out useless texts to be processed, thereby obtaining a filtered subset.
[0178] In a possible implementation, the device 40 provided in this embodiment, when filtering the subset to filter out useless text to be processed and obtaining the filtered subset, is specifically used to:
[0179] The subset is input into a naive Bayes model based on Laplace smoothing for filtering to filter out useless texts to be processed, thereby obtaining a filtered subset.
[0180] In a possible implementation, the apparatus 40 provided in this embodiment, when performing aggregation processing on the text to be processed under the text category of the filtered subset corresponding to each text source to obtain each processed text category, is specifically used to:
[0181] Extract keywords from the text to be processed under the text category corresponding to each text source to obtain keywords of the text to be processed under the text category corresponding to each text source;
[0182] For the text to be processed under the same text source, if it is determined that the keywords of the text to be processed under the text source are the same as the keywords of the text to be processed under other text sources, the text to be processed under the other text sources will be classified into the text category to which the text to be processed under the text source belongs.
[0183] In a possible implementation, the device 40 provided in this embodiment is further used for:
[0184] Obtain a first set of texts to be trained and a second set of texts to be trained; wherein the first set of texts to be trained includes texts to be trained under a first label, and the second set of texts to be trained includes texts to be trained under a second label;
[0185] Based on the first text set to be trained and the second text set to be trained, the initial logistic regression model is trained to obtain a preset second recognition model.
[0186] In a possible implementation, the device 40 provided in this embodiment is further used for:
[0187] In response to a user's trigger instruction on a knowledge graph, solution information is generated based on the triple information to which the information represented by the node indicated by the trigger instruction belongs; wherein the trigger instruction is used to indicate the node in the knowledge graph selected by the user, and the node in the knowledge graph is the object element or evaluation information in the triple information; the solution information represents the solution to the evaluation information in the triple information.
[0188] For example, this embodiment can refer to the above method embodiment, and its principles and technical effects are similar and will not be described in detail.
[0189] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, such as Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the electronic device 50 also includes a communication interface 503. The processor 501, the memory 502 and the communication interface 503 are connected via a bus 504.
[0190] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.
[0191] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0192] In the above-mentioned embodiment, it should be understood that the processor 501 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor.
[0193] The memory 502 may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0194] The bus 504 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 504 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus 504 in the drawings of the present application is not limited to only one bus or one type of bus.
[0195] The electronic device provided in this embodiment may be the server in the above embodiment.
[0196] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0197] The present application also provides a computer program product, which includes a computer program, and the computer program implements the above method when executed by a processor.
[0198] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0199] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0200] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0201] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0202] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0203] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0204] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0205] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0206] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for extracting user demand information based on text mining, It is characterized in that The method comprises: Obtaining a text set to be processed; wherein the text set to be processed includes a plurality of texts to be processed; Performing word segmentation processing on the text to be processed to obtain a word sequence of the text to be processed, wherein the word sequence of the text to be processed includes each word in the text to be processed; Inputting the word sequence of the text to be processed into a preset first recognition model for recognition processing, and obtaining at least one triplet of the text to be processed; wherein the triplet includes an object element, an attribute element, and evaluation information, wherein the object element is an object evaluated by a user, the attribute element is an attribute of the object element, and the evaluation information is an evaluation result of the object element under the attribute element; A knowledge graph is generated based on the triple information of the text to be processed; wherein the knowledge graph includes the triple information of the text to be processed; and the triple information in the knowledge graph represents user demand information.
2. The method according to claim 1, It is characterized in that Inputting the word sequence of the text to be processed into a preset first recognition model for recognition processing to obtain at least one triplet of information of the text to be processed, including: Inputting the word sequence of the text to be processed into the word vectorization module in the preset first recognition model to extract features of the word sequence of the text to be processed, and obtaining feature information of the word sequence of the text to be processed; wherein the feature information includes the semantics of the text to be processed and the vectorization features of each word in the word sequence; Performing maximum pooling processing on the feature information of the word sequence of the text to be processed to obtain processed feature information; Based on the entity extraction module in the preset first recognition model, the processed feature information is subjected to entity extraction processing to obtain vector information of the entity corresponding to the text to be processed; and based on the relationship classification module in the preset first recognition model, the vector information of the entity and the processed feature information are processed to obtain a relationship vector between each pair of adjacent entities in the text to be processed, wherein the relationship vector represents the relationship between a pair of adjacent entities, wherein a pair of adjacent entities includes object elements and evaluation information, and the relationship between a pair of adjacent entities is an attribute element; The triplet information of the text to be processed is generated according to the vector information of the entity corresponding to the text to be processed and the relationship vector between each pair of adjacent entities in the text to be processed.
3. The method according to claim 1, It is characterized in that The text collection to be processed includes sub-collections corresponding to different text sources, and the sub-collections include texts to be processed under the same text source; The method further comprises: Filtering the subset to filter out useless text to be processed, and obtaining a filtered subset; Performing clustering processing on the texts to be processed in the filtered subset to obtain at least one text category of the filtered subset, each of which has at least one text to be processed; Aggregate the texts to be processed under the text categories of the filtered subsets corresponding to each text source to obtain each processed text category; Input the processed texts to be processed under each text category into a preset second recognition model to obtain each text to be processed under a first label and each text to be processed under a second label; wherein the first label and the second label are both importance levels of the text, and the importance level represented by the first label is higher than the importance level represented by the second label; Display the text to be processed under the first label to the user; and in response to the user's processing instruction for the text to be processed under the first label, determine that the user demand information indicated by the processing instruction is the user demand information in the text to be processed under the first label; wherein the processing instruction indicates the user demand information in the text to be processed.
4. The method according to claim 3, It is characterized in that The subset is filtered to filter out useless text to be processed, and a filtered subset is obtained, including: The subset is input into the Naive Bayes model for filtering to filter out useless texts to be processed, thereby obtaining a subset after filtering.
5. The method according to claim 3, It is characterized in that The subset is filtered to filter out useless text to be processed, and a filtered subset is obtained, including: The subset is input into a naive Bayes model based on Laplace smoothing for filtering to filter out useless texts to be processed, thereby obtaining a subset after filtering.
6. The method according to claim 3, It is characterized in that Aggregate the texts to be processed under the text categories of the filtered subsets corresponding to each text source to obtain the processed text categories, including: Extract keywords from the text to be processed under the text category corresponding to each text source to obtain keywords of the text to be processed under the text category corresponding to each text source; For the text to be processed under the same text source, if it is determined that the keywords of the text to be processed under the text source are the same as the keywords of the text to be processed under other text sources, the text to be processed under the other text sources will be classified into the text category to which the text to be processed under the text source belongs.
7. The method according to claim 3, It is characterized in that The method further comprises: Obtain a first set of texts to be trained and a second set of texts to be trained; wherein the first set of texts to be trained includes texts to be trained under a first label, and the second set of texts to be trained includes texts to be trained under a second label; Based on the first text set to be trained and the second text set to be trained, an initial logistic regression model is trained to obtain the preset second recognition model.
8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: In response to a user's trigger instruction for the knowledge graph, solution information is generated according to the triple information to which the information represented by the node indicated by the trigger instruction belongs; wherein the trigger instruction is used to indicate the node in the knowledge graph selected by the user, and the node in the knowledge graph is an object element or evaluation information in the triple information; the solution information represents a solution to the evaluation information in the triple information.
9. A user demand information extraction device based on text mining, include: An acquisition module, used for acquiring a text set to be processed; wherein the text set to be processed includes a plurality of texts to be processed; A first processing module is used to perform word segmentation processing on the text to be processed to obtain a word sequence of the text to be processed, wherein the word sequence of the text to be processed includes each word in the text to be processed; A second processing module is used to input the word sequence of the text to be processed into a preset first recognition model for recognition processing, and obtain at least one triple information of the text to be processed; wherein the triple information includes an object element, an attribute element, and evaluation information, the object element is an object evaluated by a user, the attribute element is an attribute of the object element, and the evaluation information is an evaluation result of the object element under the attribute element; A generation module generates a knowledge graph based on the triple information of the text to be processed; wherein the knowledge graph includes the triple information of the text to be processed; and the triple information in the knowledge graph represents the user demand information.
10. An electronic device, It is characterized in that include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.
12. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
