A method and apparatus for representing a fault text

By performing word frequency statistics and topic modeling on faulty texts, and retaining a preset number of faulty sentences for vector transformation, the problems of data sparsity and high dimensionality in the Word2Vec method are solved, and the performance of the faulty text classification model is improved.

CN116069929BActive Publication Date: 2025-12-26中国农业银行股份有限公司北京市分行
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310096186.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-18
Publication Date
2025-12-26
Estimated Expiration
2043-01-18

AI Technical Summary

Technical Problem

In existing technologies, the data vectors obtained by the Word2Vec method for representing faulty texts suffer from data sparsity and high dimensionality, resulting in unclear representations of faulty texts and affecting the training effect and classification performance of faulty text classification models.

Method used

By performing word frequency statistics on faulty texts, using topic modeling to model topics, the probability distribution of the first topic is obtained. A preset number of faulty sentences are retained, and vector transformation is performed using vector representation methods to obtain faulty text data vectors.

Benefits of technology

It improves the representation ability of fault texts, avoids the problems of data sparsity and high dimensionality, and enhances the training effect and performance of fault text classification models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116069929B_ABST
    Figure CN116069929B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for representing fault text. In the method, firstly, word frequency statistics of the fault text are obtained; then, a topic modeling model is used to model the word frequency statistics to obtain a first topic probability distribution result; then, a preset number of fault sentences in the fault text are reserved according to the first topic probability distribution result; finally, a vector conversion is performed on the preset number of fault sentences by using a vector representation method to obtain a fault text data vector corresponding to the fault text. It can be seen that the method excludes a part of the fault sentences according to the first topic probability distribution result, and only the preset number of fault sentences are reserved, that is, the fault text is denoised, the fault text data vector obtained by converting the reserved fault sentences represents the fault text, the representation ability of the fault text is improved, the training effect of model training is improved, and the performance of the fault text classification model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of text processing, and particularly relates to a fault text representation method and device. BACKGROUND

[0002] In the process of software development and software use, it is difficult to avoid the occurrence of faults, and software faults can cause very serious consequences. Generally, fault texts are generated after software faults occur. How to classify fault texts and determine the types of faults is of great significance for fault positioning and fault repair.

[0003] Among them, the representation ability of fault texts is one of the important factors for accurately classifying fault texts. In the prior art, the representation method of fault texts is usually as follows: a vector representation method such as a word embedding Word2Vec method is used to convert fault texts into fault text data vectors. However, in this representation method of fault texts, the fault text data vectors obtained by the Word2Vec method have the problems of data sparsity and high data dimension, which leads to unobvious representation of fault texts, affects the training effect of the fault text classification model, and further leads to poor classification performance of the fault text classification model.

[0004] Therefore, how to improve the representation ability of fault texts has become a problem to be solved at present. SUMMARY

[0005] Therefore, the embodiments of the present application provide a fault text representation method and device, which aims to improve the representation ability of fault texts.

[0006] In a first aspect, the embodiments of the present application provide a fault text representation method, which comprises:

[0007] Performing word frequency statistics on the fault text to obtain a word frequency statistics result of the fault text, wherein the fault text comprises a plurality of fault sentences;

[0008] Performing topic modeling on the word frequency statistics result by a topic modeling model to obtain a first topic probability distribution result;

[0009] According to the first topic probability distribution result, retaining a preset number of fault sentences in the fault text;

[0010] Performing vector conversion on the preset number of fault sentences by a vector representation method to obtain a fault text data vector corresponding to the fault text.

[0011] Optionally, the performing topic modeling on the word frequency statistics result by a topic modeling model to obtain a first topic probability distribution result comprises:

[0012] modeling the word frequency statistics result through the topic modeling model to obtain a plurality of topics corresponding to the fault text;

[0013] calculating a topic probability of the fault text according to the plurality of topics to obtain the first topic probability distribution result.

[0014] Optionally, the first topic probability distribution result includes a second topic probability distribution result corresponding to the fault text and a plurality of third topic probability distribution results corresponding to the plurality of fault sentences; and the retaining, according to the first topic probability distribution result, of a preset number of fault sentences in the fault text includes:

[0015] determining a target topic corresponding to a maximum topic probability according to the second topic probability distribution result;

[0016] sorting, according to the plurality of third topic probability distribution results, probabilities of the target topic in the plurality of fault sentences to obtain a plurality of sorted fault sentences;

[0017] retaining the preset number of fault sentences in the plurality of sorted fault sentences.

[0018] Optionally, the vector representation method is specifically a word embedding word2vec method.

[0019] Optionally, the topic modeling model is specifically a latent Dirichlet allocation (LDA) model.

[0020] In a second aspect, an embodiment of the present application provides a fault text classification model training method, and the method includes:

[0021] obtaining a fault text data vector, the fault text data vector being obtained according to the representation method of the fault text in the first aspect;

[0022] training a preset classification model according to the fault text data vector and a fault category label corresponding to the fault text data vector to obtain the fault text classification model.

[0023] In a third aspect, an embodiment of the present application provides a fault text representation device, and the device includes:

[0024] a statistics module configured to perform word frequency statistics on a fault text to obtain word frequency statistics result of the fault text, the fault text including a plurality of fault sentences;

[0025] a modeling module configured to perform topic modeling on the word frequency statistics result through a topic modeling model to obtain a first topic probability distribution result;

[0026] a retaining module configured to retain a preset number of fault sentences in the fault text according to the first topic probability distribution result;

[0027] a converting module configured to perform vector conversion on the preset number of fault sentences by using a vector representation method to obtain a fault text data vector corresponding to the fault text.

[0028] In a fourth aspect, an embodiment of the present application provides a fault text classification model training apparatus, and the apparatus comprises:

[0029] a obtaining module configured to obtain a fault text data vector, wherein the fault text data vector sample is obtained according to the fault text representation method of the first aspect;

[0030] a training module configured to train a preset classification model according to the fault text data vector and a fault category label corresponding to the fault text data vector, to obtain the fault text classification model.

[0031] In a fifth aspect, an embodiment of the present application provides a device, and the device comprises:

[0032] a memory configured to store a computer program;

[0033] a processor configured to execute the computer program, so that the device executes the fault text representation method of the first aspect or the fault text classification model training method of the second aspect.

[0034] In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, when the computer program is executed, a device executing the computer program implements the fault text representation method of the first aspect or the fault text classification model training method of the second aspect.

[0035] Compared with the prior art, the embodiment of the present application has the following beneficial effects:

[0036] The embodiment of the present application provides a representation method and device of a fault text. In the method, firstly, word frequency statistics of the fault text are carried out to obtain a word frequency statistics result of the fault text, wherein the fault text comprises a plurality of fault sentences; then, a topic modeling model is used to carry out topic modeling on the word frequency statistics result to obtain a first topic probability distribution result; then, according to the first topic probability distribution result, a preset number of fault sentences in the fault text are reserved; finally, a vector representation method is used to carry out vector conversion on the preset number of fault sentences to obtain a fault text data vector corresponding to the fault text. It can be seen that the method excludes a part of the fault sentences according to the first topic probability distribution result, and only the preset number of fault sentences are reserved, that is, the fault text is denoised, the fault text data vector obtained by converting the reserved fault sentences represents the fault text, the representation ability of the fault text can be improved, the data sparsity and high dimensionality of the fault text data vector are avoided, so that a fault text classification model is trained based on the obtained fault text data vector, the training effect of model training is improved, and the performance of the fault text classification model is improved. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0038] Figure 1 The application scenario of the representation method of the fault text provided by the embodiment of the present application;

[0039] Figure 2 The flowchart of the representation method of the fault text provided by the embodiment of the present application;

[0040] Figure 3 The flowchart of the fault text classification model training method provided by the embodiment of the present application;

[0041] Figure 4 The structural schematic diagram of the representation device of the fault text provided by the embodiment of the present application;

[0042] Figure 5 The structural schematic diagram of the fault text classification model training device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0043] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort belong to the scope of protection of the present application.

[0044] At present, the existing representation method of fault text is generally as follows: a vector representation method such as Word2Vec method is used to convert the fault text into a fault text data vector. However, in the representation method of fault text, the fault text data vector obtained by the Word2Vec method has problems of data sparsity and high dimension, which leads to unobvious representation of the fault text, affects the training effect of the fault text classification model, and further leads to poor classification performance of the fault text classification model. Therefore, how to improve the representation ability of the fault text has become a problem to be solved at present.

[0045] Based on this, in order to solve the above problems, the embodiments of the present application provide a representation method and device of fault text. In the method, first, word frequency statistics of the fault text are performed to obtain a word frequency statistics result of the fault text, wherein the fault text includes multiple fault sentences; then, a topic modeling model is used to perform topic modeling on the word frequency statistics result to obtain a first topic probability distribution result; then, according to the first topic probability distribution result, a preset number of fault sentences in the fault text are reserved; finally, a vector representation method is used to perform vector conversion on the preset number of fault sentences to obtain a fault text data vector corresponding to the fault text. It can be seen that, according to the first topic probability distribution result, a part of the fault sentences are excluded, and only the preset number of fault sentences are reserved, that is, the fault text is denoised, and the fault text data vector obtained by converting the reserved fault sentences represents the fault text, which can improve the representation ability of the fault text, avoid the problems of data sparsity and high dimension of the fault text data vector, so as to subsequently train the fault text classification model based on the obtained fault text data vector, improve the training effect of the model training, and thus improve the performance of the fault text classification model.

[0046] For example, one of the scenarios of the embodiments of the present application can be applied to the scenario as shown in FIG. 1. Figure 1 The scenario includes a database 101 and a server 102, wherein the database 101 includes fault text, and the server 102 uses the embodiments provided by the embodiments of the present application to obtain the fault text from the database 101 for representation of the fault text.

[0047] Firstly, in the above application scenarios, although the action description of the embodiment provided by the present application is executed by the server 102; however, the present application is not limited in the execution subject, as long as the action disclosed by the embodiment provided by the present application is executed.

[0048] Secondly, the above scenario is only one scenario example provided by the present application, and the present application is not limited to this scenario.

[0049] The representation method and device of the fault text, and the specific implementation of the fault text classification model training method and device in the present application will be described in detail below with reference to the accompanying drawings and embodiments.

[0050] Referring to Figure 2 , the figure is a flow chart of a representation method of a fault text provided by the present application, in combination with Figure 2 , specifically can include:

[0051] S201: word frequency statistics is performed on the fault text to obtain a word frequency statistics result of the fault text, and the fault text includes multiple fault sentences.

[0052] For the specific implementation of S201, the present application can not be specifically limited, in order to facilitate understanding, the following will be described in combination with a possible implementation.

[0053] In a possible implementation, the fault text including multiple fault sentences can be first processed by word segmentation to obtain a word segmentation result, and then word frequency statistics is performed on each fault sentence according to the word segmentation result, that is, the frequency of multiple words appearing in each fault sentence is counted to obtain the word frequency statistics result of each fault sentence, and the word frequency statistics result of the fault text can be obtained.

[0054] In addition, there can be some meaningless words or symbols in the fault text, which affect the word frequency statistics result, therefore, before performing word frequency statistics on the fault text, the fault text can be preprocessed to obtain a preprocessed fault text. Correspondingly, S201 can specifically be: word frequency statistics is performed on the preprocessed fault text to obtain a word frequency statistics result of the preprocessed fault text. After preprocessing the fault text and then performing word frequency statistics, the semantic features of the fault text can be amplified to some extent, some non-key texts can be removed, and a more effective word frequency statistics result can be obtained.

[0055] S202: a topic modeling model is used to perform topic modeling on the word frequency statistics result to obtain a first topic probability distribution result.

[0056] The word frequency statistics result is input into a topic modeling model to perform topic modeling, that is, a plurality of topics are extracted from the word frequency statistics result to express the central idea of the fault text, and a first topic probability distribution result of the fault text including a plurality of fault sentences is obtained. The topic probability distribution result refers to the distribution of the plurality of topics in the fault text.

[0057] In the embodiments of the present application, the process of obtaining the first topic probability distribution result can not be specifically limited, and for the convenience of understanding, the following describes a possible implementation.

[0058] In a possible implementation, S202 can specifically include: performing topic modeling on the word frequency statistics result by a topic modeling model to obtain a plurality of topics corresponding to the fault text; and calculating the topic probability of the fault text according to the plurality of topics to obtain the first topic probability distribution result.

[0059] The topic modeling model can not be specifically limited in the embodiments of the present application, and for the convenience of understanding, the following describes a possible implementation.

[0060] In a possible implementation, the topic modeling model can specifically be a Latent Dirichlet Allocation (LDA) model. When the LDA model is used, the number of topics can be preset, that is, the word frequency statistics result is subjected to topic modeling according to the preset number. The LDA model is a document generation model, and the idea of the model is that an article is of a plurality of topics, and each topic corresponds to different words. The construction process of an article is that a topic is first selected with a certain probability, and then a word is selected with a certain probability under the topic, so that the first word of the article is generated. The whole article is generated by repeating the process. The LDA model is the inverse process of document generation, that is, the corresponding plurality of topics can be found according to the fault text, and the corresponding words can be found according to the plurality of topics.

[0061] In a possible implementation, the topic modeling model can also be a BTM (Biterm Topic Model) model. The BTM model is more suitable for topic modeling of texts with fewer words, and when the fault text is a short text, the BTM model can be used for topic modeling.

[0062] Of course, other topic modeling models can also be used, which does not affect the implementation of the embodiments of the present application.

[0063] S203: According to the first topic probability distribution result, a preset number of fault sentences in the fault text are retained.

[0064] The first topic probability distribution result can not be specifically limited by the embodiments of the present application, and in order to facilitate understanding, the following will be described in combination with a possible implementation.

[0065] In a possible implementation, the topic probability distribution result can include a second topic probability distribution result corresponding to the fault text, that is, the distribution probability of the plurality of topics in the fault text corresponding to the fault text, and can also include a third topic probability distribution result corresponding to each fault sentence in the plurality of fault sentences, that is, the distribution probability of the plurality of topics in each fault sentence; accordingly, according to the second topic probability distribution result, a target topic corresponding to the maximum topic probability can be obtained, and according to the plurality of probability sizes corresponding to the target topic in the plurality of fault sentences, the plurality of fault sentences after sorting can be sorted, and the fault sentences meeting the preset number in the plurality of fault sentences after sorting can be reserved. Therefore, the first topic probability distribution result can specifically include: the second topic probability distribution result corresponding to the fault text and the plurality of third topic probability distribution results corresponding to the plurality of fault sentences; accordingly, S203 can specifically include: determining a target topic corresponding to the maximum topic probability according to the second topic probability distribution result; sorting the probability corresponding to the target topic in the plurality of fault sentences according to the plurality of third topic probability distribution results, to obtain the plurality of fault sentences after sorting; and reserving the fault sentences of the preset number in the plurality of fault sentences after sorting. It can be seen that the fault sentences with larger target topic probability distribution corresponding to the maximum topic probability are reserved, the fault sentences with unobvious target topic probability distribution in the fault text are excluded, that is, the fault text is denoised, which is beneficial to improve the representation ability of the fault text.

[0066] For example, if the plurality of fault sentences are sorted in the order of the probability distribution of the target topic in the fault sentences from large to small, then according to the preset number, the fault sentences with larger probability distribution in the plurality of fault sentences after sorting are reserved, that is, the first fault sentence is reserved from the back.

[0067] S204: performing vector conversion on the fault sentences of the preset number by using a vector representation method, to obtain a fault text data vector corresponding to the fault text.

[0068] The vector representation method can not be specifically limited by the embodiments of the present application, and in order to facilitate understanding, the following will be described in combination with a possible implementation.

[0069] In a possible implementation, the vector representation method can be specifically a word embedding word2vec method. The word2vec is a method for converting text into a vector, which includes two algorithms, namely skip-gram and CBOW, and the biggest difference between them is that the skip-gram is used to predict the words around the center word through the center word, and the CBOW is used to predict the center word through the surrounding words.

[0070] In a possible implementation, the vector representation method can also be a Term Frequency-Inverse Document Frequency (TF-IDF) method. The TF-IDF is a statistical method that can evaluate the importance of a word to a text, and can convert the fault text into a vector.

[0071] Of course, other vector representation methods can also be used without affecting the implementation of the embodiments of the present application.

[0072] Based on the related content of S201-S204, in the embodiments of the present application, first, the word frequency of the fault text is counted to obtain the word frequency statistical result of the fault text, wherein the fault text includes multiple fault sentences; then, the word frequency statistical result is modeled by a topic modeling model to obtain a first topic probability distribution result; then, according to the first topic probability distribution result, a preset number of fault sentences in the fault text are retained; finally, the preset number of fault sentences are converted into vectors by a vector representation method to obtain a fault text data vector corresponding to the fault text. As can be seen, according to the first topic probability distribution result, a part of the fault sentences are excluded, and only the preset number of fault sentences are retained, that is, the fault text is denoised, and the fault text data vector obtained by converting the retained fault sentences represents the fault text, which can improve the representation ability of the fault text, avoid the data sparsity and high dimensionality of the fault text data vector, so as to subsequently train the fault text classification model based on the obtained fault text data vector, improve the training effect of the model training, and thus improve the performance of the fault text classification model.

[0073] Referring to Figure 3 , the figure is a flowchart of a fault text classification model training method provided by the embodiments of the present application, which, in combination with Figure 3 , can specifically include:

[0074] S301: Obtain a fault text data vector, which is obtained according to the representation method of the fault text of any embodiment.

[0075] Obtain the fault text data vector generated by the representation method of the fault text, which is more obvious in representation.

[0076] S302: Train a preset classification model according to the fault text data vector and the fault category label corresponding to the fault text data vector to obtain a fault text classification model.

[0077] Based on the fault text data vector with more obvious representation, the performance of the obtained fault text classification model can be greatly improved, and more accurate fault text classification results can be obtained.

[0078] For example, the preset classification model can be a stochastic gradient descent model, a logistic regression model, or a gradient ascent model. Of course, it can also be other preset classification models, which does not affect the implementation of the embodiments of the present application.

[0079] Based on the above related content of S301-S302, in the embodiments of the present application, the preset classification model is trained based on the fault text data vector with more obvious representation, which can further improve the training effect of model training, thereby improving the performance of the fault text classification model and obtaining more accurate fault text classification results.

[0080] The above is some specific implementation of the representation method of the fault text and the training method of the fault text classification model provided by the embodiments of the present application. Based on this, the present application also provides a corresponding device. The device provided by the embodiments of the present application will be introduced from the perspective of functional modularization.

[0081] Referring to Figure 4 The figure is a structural schematic diagram of a fault text representation device 400 provided by the embodiments of the present application. The device 400 can include:

[0082] The statistical module 401 is configured to perform word frequency statistics on the fault text to obtain a word frequency statistical result of the fault text. The fault text includes multiple fault sentences.

[0083] The modeling module 402 is configured to perform topic modeling on the word frequency statistical result by a topic modeling model to obtain a first topic probability distribution result.

[0084] The retention module 403 is configured to retain a preset number of fault sentences in the fault text according to the first topic probability distribution result.

[0085] The conversion module 404 is configured to perform vector conversion on the preset number of fault sentences by a vector representation method to obtain a fault text data vector corresponding to the fault text.

[0086] In the embodiments of the present application, through the cooperation of the statistical module 401, the modeling module 402, the retention module 403, and the conversion module 404, a part of the fault sentences are excluded according to the first topic probability distribution result, and only the preset number of fault sentences are retained, i.e. the fault text is denoised. The fault text data vector obtained by converting the retained fault sentences represents the fault text, which can improve the representation ability of the fault text, avoid the data sparsity and high dimensionality problem of the fault text data vector, so as to subsequently train the fault text classification model based on the obtained fault text data vector, improve the training effect of model training, and thereby improve the performance of the fault text classification model.

[0087] As an implementation form, the modeling module 402 can specifically include:

[0088] a modeling unit configured to perform topic modeling on the word frequency statistics result by using a topic modeling model to obtain a plurality of topics corresponding to the fault text;

[0089] a calculation unit configured to calculate a topic probability of the fault text according to the plurality of topics to obtain a first topic probability distribution result.

[0090] As an implementation form, the first topic probability distribution result in the modeling module 402 can specifically include:

[0091] a second topic probability distribution result corresponding to the fault text and a plurality of third topic probability distribution results corresponding to the plurality of fault sentences.

[0092] Correspondingly, the retaining module 403 can specifically include:

[0093] a determination unit configured to determine a target topic corresponding to a maximum topic probability according to the second topic probability distribution result;

[0094] a sorting unit configured to sort probabilities of the target topic in the plurality of fault sentences according to the plurality of third topic probability distribution results to obtain a plurality of sorted fault sentences;

[0095] a retaining unit configured to retain a preset number of fault sentences in the plurality of sorted fault sentences.

[0096] As an implementation form, the vector representation method in the conversion module 404 can be specifically a word embedding word2vec method.

[0097] As an implementation form, the topic modeling model in the modeling module 402 can be specifically a latent Dirichlet allocation (LDA) model.

[0098] Referring to Figure 5 The figure is a structural schematic diagram of a fault text classification model training device 500 provided by an embodiment of the application. The device 500 can include:

[0099] an acquisition module 501 configured to acquire a fault text data vector. The fault text data vector sample is obtained according to the representation method of the fault text according to any embodiment of the application.

[0100] a training module 502 configured to train a preset classification model according to the fault text data vector and a fault category label corresponding to the fault text data vector to obtain a fault text classification model.

[0101] In the embodiment of the present application, through the cooperation of the acquisition module 501 and the training module 502, the preset classification model is trained based on the fault text data vector with more obvious representation, which can further improve the training effect of model training, thereby improving the performance of the fault text classification model and obtaining more accurate fault text classification results.

[0102] The embodiment of the present application also provides a corresponding device and a computer readable storage medium for implementing the scheme provided by the embodiment of the present application.

[0103] The device includes a memory and a processor, the memory is used to store a computer program, and the processor is used to execute the computer program to enable the device to execute the representation method of the fault text according to any embodiment of the present application, or the fault text classification model training method according to any embodiment of the present application.

[0104] The computer readable storage medium stores a computer program, and when the computer program is executed, the device executing the computer program implements the representation method of the fault text according to any embodiment of the present application, or the fault text classification model training method according to any embodiment of the present application.

[0105] The "first" and "second" in the names mentioned in the embodiments of the present application are only used for name identification, and do not represent the first and second in order.

[0106] From the description of the above embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a general hardware platform. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product. The computer software product can be stored in a storage medium, such as a read-only memory (English: read-only memory, ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the method described in each embodiment or some parts of the embodiments of the present application.

[0107] It should be noted that each of the embodiments of the present specification is described in a progressive manner, and the same or similar parts between the embodiments can be mutually referred to, and each of the embodiments focuses on the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, they are described more simply, and the relevant parts can be referred to the part of the description of the method embodiments. The above-described device embodiments are only illustrative, and the units described as separate components can or can not be physically separated, and the components indicated as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to the actual needs. Those skilled in the art can understand and implement it without creative labor.

[0108] The above describes only one specific embodiment of the present application, but the protection scope of the present application is not limited to this. Any skilled person in the art can easily think of changes or replacements within the technical range disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of representing a fault text, characterized by, The method comprises: word frequency statistics are performed on the fault text to obtain word frequency statistics results of the fault text, the fault text comprising a plurality of fault sentences; a topic modeling model is used to perform topic modeling on the word frequency statistics results to obtain first topic probability distribution results; a preset number of fault sentences in the fault text are retained according to the first topic probability distribution results; a vector representation method is used to perform vector conversion on the preset number of fault sentences to obtain a fault text data vector corresponding to the fault text; the topic modeling model is used to perform topic modeling on the word frequency statistics results to obtain first topic probability distribution results, comprising: the topic modeling model is used to perform topic modeling on the word frequency statistics results to obtain a plurality of topics corresponding to the fault text; the first topic probability distribution results are obtained by calculating the topic probability of the fault text according to the plurality of topics; the first topic probability distribution results comprise second topic probability distribution results corresponding to the fault text and a plurality of third topic probability distribution results corresponding to the plurality of fault sentences; the preset number of fault sentences in the fault text are retained according to the first topic probability distribution results, comprising: a target topic corresponding to a maximum topic probability is determined according to the second topic probability distribution results; the second topic probability distribution results are distribution probabilities of the plurality of topics in the fault text; the plurality of fault sentences are sorted according to the probabilities of the target topic in the plurality of fault sentences according to the plurality of third topic probability distribution results to obtain sorted fault sentences; the third topic probability distribution results are distribution probabilities of the plurality of topics in each fault sentence; the preset number of fault sentences in the sorted fault sentences are retained.

2. The method of claim 1, wherein, The vector representation method is specifically a word embedding word2vec method.

3. The method of claim 1, wherein, The topic modeling model is specifically a latent Dirichlet allocation (LDA) model.

4. A method for training a failure text classification model, characterized by, The method comprises: a fault text data vector is obtained according to the representation method of the fault text in any one of claims 1 to 3; a preset classification model is trained according to the fault text data vector and a fault category label corresponding to the fault text data vector to obtain a fault text classification model.

5. An apparatus for representing a fault text, characterized by The device comprises: a statistics module configured to perform word frequency statistics on a fault text to obtain word frequency statistics results of the fault text, the fault text comprising a plurality of fault sentences; a modeling module configured to use a topic modeling model to perform topic modeling on the word frequency statistics results to obtain first topic probability distribution results; a retaining module configured to retain a preset number of fault sentences in the fault text according to the first topic probability distribution results; a conversion module configured to use a vector representation method to perform vector conversion on the preset number of fault sentences to obtain a fault text data vector corresponding to the fault text; the modeling module specifically comprises: a modeling unit configured to use a topic modeling model to perform topic modeling on the word frequency statistics results to obtain a plurality of topics corresponding to the fault text; A computing unit is configured to calculate a topic probability of the fault text according to a plurality of topics, and obtain a first topic probability distribution result; The first topic probability distribution result in the modeling module specifically includes: A second topic probability distribution result corresponding to the fault text and a plurality of third topic probability distribution results corresponding to a plurality of fault sentences; the second topic probability distribution result is a distribution probability of a plurality of topics in the fault text corresponding to the fault text; and the third topic probability distribution result is a distribution probability of the plurality of topics in each fault sentence; Correspondingly, the retaining module specifically includes: A determining unit configured to determine a target topic corresponding to a maximum topic probability according to the second topic probability distribution result; An ordering unit configured to order probabilities of the target topic in the plurality of fault sentences according to the plurality of third topic probability distribution results, and obtain a plurality of ordered fault sentences; A retaining unit configured to retain a preset number of fault sentences in the plurality of ordered fault sentences. 6.A fault text classification model training apparatus, characterized in that, The device includes: An acquisition module configured to acquire a fault text data vector, the fault text data vector being obtained according to the representation method of the fault text in any one of claims 1 to 3; A training module configured to train a preset classification model according to the fault text data vector and a fault category label corresponding to the fault text data vector, and obtain the fault text classification model.

7. An electronic device, comprising: The device includes: A memory configured to store a computer program; A processor configured to execute the computer program, so that the device executes the steps of the representation method of the fault text in any one of claims 1 to 3, or the steps of the fault text classification model training method in claim 4.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, when the computer program is run, the device running the computer program implements the steps of the representation method of the fault text in any one of claims 1 to 3, or the steps of the fault text classification model training method in claim 4.

Citation Information

Patent Citations

  • Method for realizing extraction type text abstract by fusing TFIDF and LDA

    CN113987133A

  • Keyword recommendation method and system based on latent dirichlet allocation model

    US20180307680A1