Text classification recommendation processing method and system

By semantic clustering of the title and breaking the text of the text, combining the sentence similarity to determine the template title and key breaking sentences, it combines it into a recommended template, which solves the problem that word vectors cannot integrate the information in text and traditional clustering algorithms cannot handle the unlabeled data set in the existing technology, and achieves a more efficient text classification effect.

CN115129854BActive Publication Date: 2025-05-02CHINA MOBILE GROUP JIANGSU +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110292678.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-18
Publication Date
2025-05-02
Estimated Expiration
2041-03-18

AI Technical Summary

Technical Problem

The existing text classification technology has the problem that single word vectors cannot integrate phrase order, length, position and word frequency in text, and without labeled data sets, traditional clustering algorithms such as KNN cannot meet the text classification needs.

Method used

By clustering the titles based on semantic similarity, breaking the main text of the sentence, and determining the template title and key retained breaking sentences based on the sentence similarity between the sentences and other breaking sentences, combining them into a recommended template and saving them to the template library.

Benefits of technology

This method can more effectively integrate text semantic information, improve the accuracy and efficiency of text classification, especially in the absence of labeled data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129854B_ABST
    Figure CN115129854B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a text classification recommendation processing method and system, wherein the method includes: clustering all titles based on the semantic similarity between each title and other titles; segmenting the main text under the titles clustered into one category; determining the template title and the key retained segments in the target main text corresponding to the template title based on the sentence similarity between each segment and all segments under other titles; and combining the template title and the key retained segments into a recommended template and saving them to a template library. The embodiment of the present invention proposes a clustering method for text titles based on a new semantic similarity comparison method, and finally combines to form a recommended template, so that the model can learn more semantic information and make a deeper semantic comparison; based on the clustering text classification method, innovative universal rules are added to enable text classification to achieve better results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text processing, and in particular to a text classification recommendation processing method and system. Background Art

[0002] The commonly used NLP text classification field basically performs text classification by preprocessing the text, such as removing pause words, converting word vectors, etc., and then bringing it into the machine learning algorithm. Commonly used text classification algorithms include support vector machine (SVM), Adaboosting, neural network, etc. These methods are based on the situation where the data set is labeled. For example, in text sentiment classification, the sentences in the text content are divided into sentences with positive emotions and sentences with negative emotions. After the algorithm preprocesses them, it is put into machine learning for training. After obtaining a model, the positive and negative emotions of the sentences to be predicted are judged. When the data set is not labeled, we need to use a clustering algorithm. After preprocessing the text, the text is classified by a clustering algorithm, such as KNN (K-nearest neighbor algorithm). The disadvantage of the existing word vector conversion is that a single word vector does not integrate the order, length, position, and word frequency of the phrases in the text. In addition, the disadvantage of the existing text classification technology is that for text classification data sets, the data is often unlabeled, and it is often time-consuming and labor-intensive to manually label and generate labeled training sets. When the data set is unlabeled, traditional clustering algorithms such as KNN cannot meet the needs of text classification. At this point, it is urgent to try more methods to achieve better text classification results. Summary of the invention

[0003] The present invention provides a text classification recommendation processing method and system to solve the technical defects existing in the prior art.

[0004] The present invention provides a text classification recommendation processing method, comprising:

[0005] Cluster all titles based on the semantic similarity between each title and other titles;

[0006] Segment the text of the main body under the headings that are grouped together;

[0007] Determine the key retained sentences in the template title and the target text corresponding to the template title based on the sentence similarity between each sentence and all the sentences under other titles;

[0008] The template title and key retained sentences are combined into a recommended template and then saved in a template library.

[0009] According to the text classification recommendation processing method provided by the present invention, clustering all titles based on the semantic similarity between each title and other titles includes:

[0010] After word segmentation of each title text, common words, pause words, numbers, English and punctuation marks are filtered out to generate the information in the text of each title. Based on the information in the text of each title, the title word vector is generated respectively.

[0011] Generate semantic similarity between each title and other titles based on the text information fusion formula and the title word vector;

[0012] The titles whose semantic similarity is greater than a preset threshold and whose number of semantic similarities greater than the preset threshold is greater than a preset number are grouped into one category.

[0013] According to the text classification recommendation processing method provided by the present invention, the determining of key retained sentences in the template title and its corresponding target text based on the sentence similarity between each sentence and all sentences under other titles specifically includes:

[0014] After word segmentation of the text of each segment, common words, pause words, numbers, English and punctuation marks are filtered out to generate information in the text of each segment, and based on the information in the text of each segment, a word vector of the main text of each segment is generated respectively;

[0015] Based on the text information fusion formula and the main text word vector of each sentence segment, generate the semantic similarity between each sentence segment and all the sentences under other titles;

[0016] The title with the largest average sentence similarity of all segmented sentences is determined as the template title;

[0017] In the target text range corresponding to the template title, key retained sentences are determined based on the semantic similarity between each sentence and all the sentences under other titles.

[0018] According to the text classification recommendation processing method provided by the present invention, the generating of title word vectors based on the information in the text of each title includes:

[0019] According to One-hot, the first title word vector is obtained for each sentence in each title;

[0020] Taking sentences in each title as units, and according to the position of each word in the sentence, generating a second title word vector;

[0021] Convert each word in each title into a word vector, and generate a third title word vector for each sentence;

[0022] Marking the position of the word vector in each title to generate a fourth title word vector;

[0023] The first title word vector, the second title word vector, the third title word vector, and the fourth title word vector are respectively stretched to a specified length and combined to form a title word vector.

[0024] According to the text classification recommendation processing method provided by the present invention, the generating of the main text word vector of each sentence segment based on the information in the text of each sentence segment respectively includes:

[0025] According to One-hot, the first main text word vector is obtained for each sentence in the main text of each segment;

[0026] Taking sentences in the main text of each segment as units, and generating a second main text word vector according to the position of each word in the sentence;

[0027] Convert each word in the main text of each sentence segment into a word vector, and generate a third main text word vector for each sentence;

[0028] Marking the position of the word vector in the main text of each sentence segment to generate a fourth main text word vector;

[0029] The first main text word vector, the second main text word vector, the third main text word vector, and the fourth main text word vector are respectively stretched to a specified length and combined to form a title main text word vector.

[0030] According to the text classification recommendation processing method provided by the present invention, after the template title and the key retained sentences are combined into a recommended template and saved in a template library, the method further includes:

[0031] Based on the accepted request, a recommended template corresponding to the request is returned, wherein the content of the request includes a request title and a request body text.

[0032] According to the text classification recommendation processing method provided by the present invention, returning a recommendation template corresponding to the request based on the accepted request includes:

[0033] Based on the semantic similarity between the request body text and the key retained sentence, retain the request body text whose semantic similarity meets the preset condition, and sort the request body text that meets the preset condition according to the semantic similarity between the request body text and the key retained sentence;

[0034] Based on the matching ratio of the request title corresponding to the retained request body text and the recommended titles in the template library and the size sorting, the recommended template corresponding to the request is confirmed to be returned.

[0035] The present invention also provides a text classification recommendation processing system, comprising:

[0036] A title clustering module, which is used to cluster all titles based on the semantic similarity between each title and other titles;

[0037] A title segmentation module is used to segment the body text under the titles that are grouped together;

[0038] A classification recommendation determination module, used to determine key retained sentences in a template title and a target text corresponding to the template title based on sentence similarity between each sentence and all sentences under other titles;

[0039] The recommended template generation module is used to combine the template title and key retained sentences into a recommended template and save it to the template library.

[0040] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned text classification recommendation processing methods are implemented.

[0041] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned text classification recommendation processing methods are implemented.

[0042] The embodiment of the present invention proposes a clustering method for text titles based on a new semantic similarity comparison method. By comparing the text content under clustering, the special sentence segments of the text content, and then comparing the similarity between sentences, the universality of the sentences is obtained, and then screening is performed to screen out sentences with high universality, and they are combined to form a recommendation template, so that the model can learn more semantic information and make a deeper semantic comparison; based on the clustering text classification method, innovative universality rules are added to enable text classification to achieve better results. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 It is a flowchart of a text classification recommendation processing method provided by an embodiment of the present invention;

[0045] Figure 2 is a schematic diagram of a text classification recommendation processing system provided by an embodiment of the present invention;

[0046] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] The embodiment of the present invention discloses a text classification recommendation processing method, see Figure 1 ,include:

[0049] S1: Cluster all titles based on the semantic similarity between each title and other titles;

[0050] It is necessary to use various word vectors to compare semantic similarity, obtain the semantic similarity between the title and other titles, and then cluster the titles whose semantic similarity meets the preset conditions into one category.

[0051] Specifically, clustering all titles based on the semantic similarity between each title and other titles includes:

[0052] After the text of each title is segmented, common words, pause words, numbers, English and punctuation marks are filtered out to generate the information in the text of each title, and based on the information in the text of each title, the title word vector is generated respectively; common words refer to words in a certain industry category, also known as common keywords. Common keywords are characterized by being relatively short, generally consisting of 2-3 words, and the most common ones are nouns and professional nouns. The basic attribute of common keywords is that they have a wide coverage, but the positioning accuracy is slightly poor.

[0053] Generate semantic similarity between each title and other titles based on the text information fusion formula and the title word vector;

[0054] The titles with semantic similarity greater than a preset threshold and the number of titles with semantic similarity greater than the preset threshold greater than a preset number are clustered into one category. The similarity when clustering titles in S1 is the similarity between the title and all other titles. The clustering here is based on traditional clustering text classification methods, such as K nearest neighbors. Clustering here provides configurable general rules (such as the number of other titles and similarity).

[0055] S2: Segment the text of the main text under the headings that are clustered into one category;

[0056] The sentences in the body text will be segmented by the three punctuation marks ',', ':', '.', and the body text of each heading will be segmented.

[0057] S3: based on the sentence similarity between each segment and all segments under other titles, determine the template title and the key retained segments in the target text corresponding to the template title;

[0058] Determining the key retained sentences in the template title and its corresponding target text based on the sentence similarity between each sentence and all sentences under other titles specifically includes:

[0059] After word segmentation of the text of each segment, common words, pause words, numbers, English and punctuation marks are filtered out to generate information in the text of each segment, and based on the information in the text of each segment, a word vector of the main text of each segment is generated respectively;

[0060] Based on the text information fusion formula and the main text word vector of each sentence segment, generate the semantic similarity between each sentence segment and all the sentences under other titles;

[0061] The title with the largest average sentence similarity of all segmented sentences is determined as the template title;

[0062] That is to say, for each title that is clustered into one category, find out which title has the greatest overall commonality in the text content (that is, the average sentence similarity of all the segments under this title is the largest). This size will be determined by the average sentence similarity in the entire text content under each title.

[0063] In the target text range corresponding to the template title, key retained sentences are determined based on the semantic similarity between each sentence and all sentences under other titles. After finding the most common text content, the sentences are ranked in the text content under all titles that are clustered together, and the sentences with the semantic similarity in the top 60% are selected as key retained sentences.

[0064] S4: Combining the template title and key retained sentences into a recommended template and saving it to a template library.

[0065] The text classification recommendation processing method provided by the present invention also includes assigning word vectors according to word frequency and word position, and applying them to semantic similarity. Specifically, the method of generating title word vectors based on the information in the text of each title includes:

[0066] According to One-hot, the first title word vector is obtained for each sentence in each title;

[0067] Taking sentences in each title as units, and according to the position of each word in the sentence, generating a second title word vector;

[0068] Convert each word in each title into a word vector, and generate a third title word vector for each sentence;

[0069] Marking the position of the word vector in each title to generate a fourth title word vector;

[0070] The first title word vector, the second title word vector, the third title word vector, and the fourth title word vector are respectively stretched to a specified length and combined to form a title word vector.

[0071] According to the text classification recommendation processing method provided by the present invention, the generating of the main text word vector of each sentence segment based on the information in the text of each sentence segment respectively includes:

[0072] According to One-hot, the first main text word vector is obtained for each sentence in the main text of each segment;

[0073] Taking sentences in the main text of each segment as units, and generating a second main text word vector according to the position of each word in the sentence;

[0074] Convert each word in the main text of each sentence segment into a word vector, and generate a third main text word vector for each sentence;

[0075] Marking the position of the word vector in the main text of each sentence segment to generate a fourth main text word vector;

[0076] The first main text word vector, the second main text word vector, the third main text word vector, and the fourth main text word vector are respectively stretched to a specified length and combined to form a title main text word vector.

[0077] The embodiment of the present invention is applicable to both annotated and unannotated data sets. If there are annotations, it is possible to know from the beginning which text contents belong to a category, and directly execute from S2 to S4 to select the most common sentences from these texts. If there are no annotations, each step described in S1 to S4 is performed one by one.

[0078] According to the text classification recommendation processing method provided by the present invention, after the template title and the key retained sentences are combined into a recommended template and saved in a template library, the method further includes:

[0079] Based on the accepted request, a recommended template corresponding to the request is returned, wherein the content of the request includes the request title and the request body text. In the process of responding to the request, S1-S3 is actually executed based on the request, and then the obtained result is compared with the template library. If it matches the template library, the qualified content in the request can be retained in the template library, and continuously updated and learned, so that the template library is more practical and accurate.

[0080] According to the text classification recommendation processing method provided by the present invention, returning a recommendation template corresponding to the request based on the accepted request includes:

[0081] Based on the semantic similarity between the request body text and the key retained sentence, retain the request body text whose semantic similarity meets the preset condition, and sort the request body text that meets the preset condition according to the semantic similarity between the request body text and the key retained sentence;

[0082] The requested title text content will be compared with the title text retained in the program for similarity. Title text that meets the requirements will be retained and sorted according to the size of similarity.

[0083] Based on the matching ratio of the request title corresponding to the retained request body text and the recommended titles in the template library and the size sorting, the recommended template corresponding to the request is confirmed to be returned.

[0084] Then, the template title and template content to be returned will be determined based on the matching ratio between the text of the requested title and the keywords in the title within the template.

[0085] After the word vector is obtained, a new text semantic similarity method is proposed through the text information fusion formula proposed by the present invention. The method includes:

[0086] The position information is fused according to this formula:

[0087]

[0088] Where tf(wi) is the number of times word wi appears in the target document, and pk(wi) is the kth time word wi appears at the target position in the document sequence.

[0089] This feature reflects the position weight of each occurrence of the candidate keyword and also reflects the frequency of occurrence of the candidate keyword.

[0090] Using a unique method of fusing position information, a score is obtained for the position information of each sentence. On this basis, the existing semantic similarity method is integrated to compare the semantic distance between two sentences.

[0091] The semantic similarity between sentences wi and wj is

[0092]

[0093] d(wi,wj) is the cosine similarity between two sentences.

[0094] Then, by calculating the Dice coefficient of the two word vectors, the Dice coefficient was originally used to measure the similarity between two sets. Here, it is used to measure the probability that two words appear in the same sentence at the same time.

[0095]

[0096] Where cf(wi,wj) is the number of times words wi and wj appear together in the target document, and tf(wi) and tf(wj) are the number of times words wi and wj appear in the target document respectively.

[0097] Next, we get e(wi,wj)=dice(wi,wj)*prs(wi,wj), where e(wi,wj) is the semantic similarity between the two sentences. The semantic similarity between the two texts is formed by integrating the dice coefficient and the word position information.

[0098] Through the above method, we get two sets of information about words and word positions, one is the word vector and the other is the character vector. Then we calculate their e values ​​respectively and then average the two e values.

[0099] The embodiment of the present invention proposes a clustering method for text titles based on a new semantic similarity comparison method. By comparing the text content under clustering, the special sentence segments of the text content, and then comparing the similarity between sentences, the universality of the sentences is obtained, and then screening is performed to screen out sentences with high universality, and they are combined to form a recommendation template, so that the model can learn more semantic information and make a deeper semantic comparison; based on the clustering text classification method, innovative universality rules are added to enable text classification to achieve better results.

[0100] The embodiment of the present invention discloses a text classification recommendation processing system, see Figure 2 ,include:

[0101] A title clustering module 10, for clustering all titles based on the semantic similarity between each title and other titles;

[0102] A title segmentation module 20 is used to segment the text of the titles grouped into one category;

[0103] A classification recommendation determination module 30, for determining key retained sentences in a template title and a target text corresponding to the template title based on sentence similarities between each sentence and all sentences under other titles;

[0104] The recommended template generation module 40 is used to combine the template title and key retained sentences into a recommended template and save it to the template library.

[0105] Furthermore, the title clustering module 10 includes:

[0106] A title word vector generating unit is used to filter out common words, pause words, numbers, English and punctuation marks after segmenting the text of each title, generate the information in the text of each title, and generate a title word vector based on the information in the text of each title;

[0107] A title similarity generating unit, used for generating the semantic similarity between each title and other titles based on the text information fusion formula and the title word vector;

[0108] The titles whose semantic similarity is greater than a preset threshold and whose number of semantic similarities greater than the preset threshold is greater than a preset number are grouped into one category.

[0109] Preferably, the classification recommendation determination module 30 specifically includes:

[0110] A main text word vector generating unit is used to filter out common words, pause words, numbers, English and punctuation marks after segmenting the text of each segment, generate information in the text of each segment, and generate a main text word vector for each segment based on the information in the text of each segment;

[0111] A sentence segment semantic similarity generating unit, used for generating the semantic similarity between each sentence segment and all the sentences under other titles based on the text information fusion formula and the main text word vector of each sentence segment;

[0112] A template title determination unit, used for determining the title with the largest average sentence similarity of all segmented sentences as the template title;

[0113] The key retained sentence determination unit is used to determine the key retained sentences within the target text range corresponding to the template title based on the semantic similarity between each sentence and all the sentences under other titles.

[0114] The above is based on the information in the text of each title, and the title word vectors are generated separately, including:

[0115] According to One-hot, the first title word vector is obtained for each sentence in each title;

[0116] Taking sentences in each title as units, and according to the position of each word in the sentence, generating a second title word vector;

[0117] Convert each word in each title into a word vector, and generate a third title word vector for each sentence;

[0118] Marking the position of the word vector in each title to generate a fourth title word vector;

[0119] The first title word vector, the second title word vector, the third title word vector, and the fourth title word vector are respectively stretched to a specified length and combined to form a title word vector.

[0120] Based on the information in the text of each segment, the word vector of the main text of each segment is generated respectively, including:

[0121] According to One-hot, the first main text word vector is obtained for each sentence in the main text of each segment;

[0122] Taking sentences in the main text of each segment as units, and generating a second main text word vector according to the position of each word in the sentence;

[0123] Convert each word in the main text of each sentence segment into a word vector, and generate a third main text word vector for each sentence;

[0124] Marking the position of the word vector in the main text of each sentence segment to generate a fourth main text word vector;

[0125] The first main text word vector, the second main text word vector, the third main text word vector, and the fourth main text word vector are respectively stretched to a specified length and combined to form a title main text word vector.

[0126] The generation rules of the body text word vector and the title word vector are the same, only the input values ​​in the generation process are different, so the output word vectors are different. The generation rules of the word vectors for accepted requests are also the same.

[0127] The above system also includes:

[0128] Based on the accepted request, a recommended template corresponding to the request is returned, wherein the content of the request includes a request title and a request body text.

[0129] The returning a recommended template corresponding to the request based on the accepted request includes:

[0130] Based on the semantic similarity between the request body text and the key retained sentence, retain the request body text whose semantic similarity meets the preset condition, and sort the request body text that meets the preset condition according to the semantic similarity between the request body text and the key retained sentence;

[0131] Based on the matching ratio of the request title corresponding to the retained request body text and the recommended titles in the template library and the size sorting, the recommended template corresponding to the request is confirmed to be returned.

[0132] Figure 3 An example of a physical structure diagram of an electronic device is shown, and the electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute a text classification recommendation processing method, which includes:

[0133] S1: Cluster all titles based on the semantic similarity between each title and other titles;

[0134] S2: Segment the text of the main text under the headings that are clustered into one category;

[0135] S3: based on the sentence similarity between each segment and all segments under other titles, determine the template title and the key retained segments in the target text corresponding to the template title;

[0136] S4: Combining the template title and key retained sentences into a recommended template and saving it to a template library.

[0137] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium 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 method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0138] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, and when the program instructions are executed by a computer, the computer can execute a text classification recommendation processing method, the method comprising:

[0139] S1: Cluster all titles based on the semantic similarity between each title and other titles;

[0140] S2: Segment the text of the main text under the headings that are clustered into one category;

[0141] S3: based on the sentence similarity between each segment and all segments under other titles, determine the template title and the key retained segments in the target text corresponding to the template title;

[0142] S4: Combining the template title and key retained sentences into a recommended template and saving it to a template library.

[0143] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, a text classification recommendation processing method is implemented, the method comprising:

[0144] S1: Cluster all titles based on the semantic similarity between each title and other titles;

[0145] S2: Segment the text of the main text under the headings that are clustered into one category;

[0146] S3: based on the sentence similarity between each segment and all segments under other titles, determine the template title and the key retained segments in the target text corresponding to the template title;

[0147] S4: Combining the template title and key retained sentences into a recommended template and saving it to a template library.

[0148] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A text classification recommendation processing method, characterized in that: include: Cluster all titles based on the semantic similarity between each title and other titles; Segment the text of the main body under the headings that are grouped together; Determine the key retained sentences in the template title and the target text corresponding to the template title based on the sentence similarity between each sentence and all the sentences under other titles; Combining the template title and key retained sentences into a recommended template and saving it to a template library; The step of determining the template title and the key retained sentences in the target text corresponding to the template title based on the sentence similarity between each sentence and all sentences under other titles includes: After word segmentation of the text of each segment, common words, pause words, numbers, English and punctuation marks are filtered out to generate information in the text of each segment, and based on the information in the text of each segment, a word vector of the main text of each segment is generated respectively; Based on the text information fusion formula and the main text word vector of each sentence segment, generate the semantic similarity between each sentence segment and all the sentences under other titles; The title with the largest average sentence similarity of all segmented sentences is determined as the template title; In the target text range corresponding to the template title, based on the semantic similarity between each segment and all the segments under other titles, determining the key retained segments; Among them, based on the text information fusion formula, a new method for determining text semantic similarity is proposed, and the method includes: The position information is fused according to the following formula: ; in, Words The position weight, Words The number of times it appears in the target document, Words In the document sequence times appeared at the target location; ; in, is the semantic similarity between two sentences; is the cosine similarity of two sentences; Words The position weight, Words The position weight of ; in, is the Dice coefficient, Words and words The number of times they co-occur in the target document, , Words ,word The number of times each appears in the target document; ; in, is the final semantic similarity of the two sentences.

2. The text classification recommendation processing method according to claim 1, characterized in that: The clustering of all titles based on the semantic similarity between each title and other titles includes: After word segmentation of each title text, common words, pause words, numbers, English and punctuation marks are filtered out to generate the information in the text of each title. Based on the information in the text of each title, the title word vector is generated respectively. Generate semantic similarity between each title and other titles based on the text information fusion formula and the title word vector; The titles whose semantic similarity is greater than a preset threshold and whose number of semantic similarities greater than the preset threshold is greater than a preset number are grouped into one category.

3. The text classification recommendation processing method according to claim 2, characterized in that: Generating title word vectors based on the information in the text of each title includes: According to One-hot, the first title word vector is obtained for each sentence in each title; Taking sentences in each title as units, and according to the position of each word in the sentence, generating a second title word vector; Convert each word in each title into a word vector, and generate a third title word vector for each sentence; Marking the position of the word vector in each title to generate a fourth title word vector; The first title word vector, the second title word vector, the third title word vector, and the fourth title word vector are respectively stretched to a specified length and combined to form a title word vector.

4. The text classification recommendation processing method according to claim 1, characterized in that: The generating of the main text word vector of each sentence segment based on the information in the text of each sentence segment respectively comprises: According to One-hot, the first main text word vector is obtained for each sentence in the main text of each segment; Taking sentences in the main text of each segment as units, and generating a second main text word vector according to the position of each word in the sentence; Convert each word in the main text of each sentence segment into a word vector, and generate a third main text word vector for each sentence; Marking the position of the word vector in the main text of each sentence segment to generate a fourth main text word vector; The first main text word vector, the second main text word vector, the third main text word vector, and the fourth main text word vector are respectively stretched to a specified length and combined to form a title main text word vector.

5. The text classification recommendation processing method according to claim 1, characterized in that: After combining the template title and the key retained sentences into a recommended template and saving the template to a template library, the method further includes: Based on the accepted request, a recommended template corresponding to the request is returned, wherein the content of the request includes a request title and a request body text.

6. The text classification recommendation processing method according to claim 5, characterized in that: The returning a recommended template corresponding to the request based on the accepted request includes: Based on the semantic similarity between the request body text and the key retained sentence, retain the request body text whose semantic similarity meets the preset condition, and sort the request body text that meets the preset condition according to the semantic similarity between the request body text and the key retained sentence; Based on the matching ratio of the request title corresponding to the retained request body text and the recommended titles in the template library and the size sorting, the recommended template corresponding to the request is confirmed to be returned.

7. A text classification recommendation processing system, characterized in that: include: A title clustering module, which is used to cluster all titles based on the semantic similarity between each title and other titles; A title segmentation module is used to segment the body text under the titles that are grouped together; A classification recommendation determination module, used to determine key retained sentences in a template title and a target text corresponding to the template title based on sentence similarity between each sentence and all sentences under other titles; A recommended template generation module, used for combining the template title and key retained sentences into a recommended template and saving it to a template library; The classification recommendation determination module is also used to filter out common words, pause words, numbers, English and punctuation marks after segmenting the text of each segment, generate information in the text of each segment, and generate a main text word vector of each segment based on the information in the text of each segment; generate the semantic similarity between each segment and all the segments under other titles based on the text information fusion formula and the main text word vector of each segment; determine the title with the largest average sentence similarity of all segments as the template title; and determine the key retained segments based on the size of the semantic similarity between each segment and all the segments under other titles within the target main text range corresponding to the template title; Among them, based on the text information fusion formula, a new method for determining text semantic similarity is proposed, and the method includes: The position information is fused according to the following formula: ; in, Words The position weight, Words The number of times it appears in the target document, Words In the document sequence times appeared at the target location; ; in, is the semantic similarity between two sentences; is the cosine similarity of two sentences; Words The position weight, Words The position weight of ; in, is the Dice coefficient, Words and words The number of times they co-occur in the target document, , Words ,word The number of times each appears in the target document; ; in, is the final semantic similarity of the two sentences.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the text classification recommendation processing method according to any one of claims 1 to 6 are implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the text classification recommendation processing method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Text event abstract generation method and device, electronic equipment and storage medium

    CN111324728A

  • Method of extracting keywords, device and corresponding computer program

    EP3118751A1