Target text classification method and device, storage medium and computer program product

By parsing the title and text content from the target text, determining keywords and matching tags through the keyword model, the problem of unclear target text classification caused by manual classification is solved, and the efficiency and accuracy of automated classification is achieved.

CN119829762APending Publication Date: 2025-04-15HUANENG CLEAN ENERGY RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411729210.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In the prior art, the problem of unclear classification of target texts by manually classifying target texts.

Method used

By parsing the title and text content from the target text, determining the keywords corresponding to the title and text content, and determining the tags corresponding to the keywords from the preset label database through the keyword model, the classification of the target text is automated.

Benefits of technology

The automated classification of target text is achieved, the uncertainty and consistency of manual classification is avoided, and the classification efficiency and accuracy are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829762A_ABST
    Figure CN119829762A_ABST
Patent Text Reader

Abstract

The invention discloses a target text classification method and device, a storage medium and a computer program product, and relates to the field of artificial intelligence, and the target text classification method comprises the following steps: analyzing a title and text content of a target text from the target text; determining a first keyword corresponding to the title and a second keyword corresponding to the text content; a first label corresponding to the first keyword and a second label corresponding to the second keyword are determined from a preset label database through a keyword model, and the first label and the second label are both used for classifying the target text; and classifying the target text according to the first label and the second label. By adopting the technical scheme, the problem that the classification of the target text is not clear due to manual classification of the target text in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and more specifically, to a method and device for classifying a target text, a storage medium, and a computer program product. Background Art

[0002] In related technologies, the management and classification of target texts mostly rely on manual operations. When faced with large amounts of complex data, manual classification is often limited by personal experience and cognition. Different people may have different opinions on the classification of target texts, leading to unclear classification of target texts.

[0003] With regard to the problem in related technologies that manual classification of target texts leads to unclear classification of target texts, no effective solution has been proposed so far.

[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0005] The embodiments of the present application provide a method and device for classifying a target text, a storage medium, and a computer program product, so as to at least solve the problem in the related art that the target text classification is unclear due to manual classification of the target text.

[0006] According to one aspect of an embodiment of the present application, a method for classifying a target text is provided, comprising: parsing the title and text content of the target text from the target text; determining a first keyword corresponding to the title and a second keyword corresponding to the text content; determining a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein both the first tag and the second tag are used to classify the target text; and classifying the target text according to the first tag and the second tag.

[0007] In an exemplary embodiment, determining the first keyword corresponding to the title and the second keyword corresponding to the text content includes: removing target type words in the title and the text content to obtain a first title and a first text, wherein the target type words include at least one of the following: stop words, low-frequency words, and high-frequency words; determining a target number of words with the highest frequency of occurrence in the first title as the first keyword and a target number of words with the highest frequency of occurrence in the first text as the second keyword.

[0008] In an exemplary embodiment, before determining the first tag corresponding to the first keyword and the second tag corresponding to the second keyword from a preset tag database through a keyword model, the method also includes: preprocessing the first keyword and the second keyword, wherein the preprocessing includes at least one of the following: unifying the English fonts in the first keyword and the second keyword into lowercase fonts; removing punctuation marks and special symbols in the first keyword and the second keyword; converting abbreviations in the first keyword and the second keyword into standard terms; and converting the preprocessed first keyword and the second keyword into a first vector and a second vector, respectively, through a pre-trained word embedding model.

[0009] In an exemplary embodiment, a first tag corresponding to the first keyword and a second tag corresponding to the second keyword are determined from a preset tag database through a keyword model, including: determining a first tag vector having the highest target number similarity with the first vector and a second tag vector having the highest target number similarity with the second vector from the tag vectors of the tag database through the keyword model; and determining that the tag corresponding to the first tag vector is the first tag, and the tag corresponding to the second tag vector is the second tag.

[0010] In an exemplary embodiment, parsing the target text's title and text content from the target text includes: determining the file type of the target text; when the file type is plain text, identifying the title part and the body part of the plain text, and extracting the text of the title part as the title and the text of the body part as the text content, respectively.

[0011] In an exemplary embodiment, after determining the file type of the target text, the method further includes: when the file type is a picture, recognizing the text in the picture through optical characters, and determining that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

[0012] In an exemplary embodiment, after determining the file type of the target text, the method further includes: when the file type is a video, converting the video into a picture through frame extraction technology, and determining through image recognition that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

[0013] According to another aspect of an embodiment of the present application, a target text classification device is also provided, including: a parsing module, used to parse the title and text content of the target text from the target text; a first determination module, used to determine a first keyword corresponding to the title and a second keyword corresponding to the text content; a second determination module, used to determine a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text; a classification module, used to classify the target text according to the first tag and the second tag.

[0014] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned target text classification method when running.

[0015] According to another aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the target text classification method through the computer program.

[0016] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0017] Through this application, the title and text content of the target text are parsed from the target text; the first keyword corresponding to the title and the second keyword corresponding to the text content are determined; the first tag corresponding to the first keyword and the second tag corresponding to the second keyword are determined from a preset tag database through a keyword model; and the target text is classified according to the first tag and the second tag. This solves the problem in the related art that the classification of the target text is unclear due to manual classification of the target text. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 It is a hardware structure block diagram of a computer terminal of a target text classification method according to an embodiment of the present application;

[0021] Figure 2 is a flow chart of a method for classifying a target text according to an embodiment of the present application;

[0022] Figure 3 is a flow chart of a method for classifying a target text according to an embodiment of the present application;

[0023] Figure 4 is a detailed flow chart of a method for classifying a target text according to an embodiment of the present application;

[0024] Figure 5 It is a structural block diagram of a target text classification device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below 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, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a target text classification method according to an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, MCU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the classification method of the target text in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0029] A wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0030] In this embodiment, a target text classification method is provided, which is applied to the above-mentioned computer terminal. Figure 2 is a flow chart of a method for classifying a target text according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0031] Step S202, parsing the target text to obtain the title and text content of the target text;

[0032] Step S204, determining a first keyword corresponding to the title and a second keyword corresponding to the text content;

[0033] Step S206, determining a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text;

[0034] Step S208: classify the target text according to the first label and the second label.

[0035] Through the above steps, the title and text content of the target text are parsed from the target text; the first keyword corresponding to the title and the second keyword corresponding to the text content are determined; the first tag corresponding to the first keyword and the second tag corresponding to the second keyword are determined from a preset tag database through a keyword model, wherein both the first tag and the second tag are used to classify the target text; the target text is classified according to the first tag and the second tag. This solves the problem in the related art that the classification of the target text is unclear due to manual classification of the target text.

[0036] In an exemplary embodiment, determining the first keyword corresponding to the title and the second keyword corresponding to the text content includes: removing target type words in the title and the text content to obtain a first title and a first text, wherein the target type words include at least one of the following: stop words, low-frequency words, and high-frequency words; determining a target number of words with the highest frequency of occurrence in the first title as the first keyword and a target number of words with the highest frequency of occurrence in the first text as the second keyword.

[0037] Alternatively, suppose there is a technical document describing the maintenance of a hydropower station generator, and its title is: Generator Working Principle and Maintenance Guide, and the text content includes: In a hydropower station, the generator is one of the core equipment, and its working principle is based on electromagnetic induction. Maintenance includes regular inspection of bearings, cleaning of fans and cooling systems, and monitoring of current and voltage fluctuations. Remove stop words: in, among, is, one of, it, of, and, including, and of. High-frequency words (assuming that all documents in this document set involve hydropower stations): hydropower stations. Low-frequency words (assuming that other documents in this document set rarely mention it) fan. After removing the above target type words, the first title is: Generator Working Principle Maintenance Guide, and the first text is: The working principle of the core equipment of the generator is based on electromagnetic induction, and maintenance regularly checks bearings, cleans the cooling system, and monitors current and voltage fluctuations. Select the first keyword from the first title, assuming that the target number is 3, then the first keyword is: generator, working principle, maintenance. Select the second keyword from the first text, assuming that the target number is 5, and the second keyword is: generator, working principle, maintenance, check bearings, monitor current and voltage.

[0038] In an exemplary embodiment, before determining the first tag corresponding to the first keyword and the second tag corresponding to the second keyword from a preset tag database through a keyword model, the method also includes: preprocessing the first keyword and the second keyword, wherein the preprocessing includes at least one of the following: unifying the English fonts in the first keyword and the second keyword into lowercase fonts; removing punctuation marks and special symbols in the first keyword and the second keyword; converting abbreviations in the first keyword and the second keyword into standard terms; and converting the preprocessed first keyword and the second keyword into a first vector and a second vector, respectively, through a pre-trained word embedding model.

[0039] Optionally, assuming that the original keywords are: Generator, Maintenance, Overhaul, the keywords after unified font are: generator, maintenance, overhaul. Or the original keywords are: HVAC, DRC (assuming that HVAC stands for environmental control and ventilation, DRC stands for equipment operation center), the keywords after conversion to standard terms are: environmental control and ventilation, equipment operation center. The above pre-processed keywords are converted into vector form through a pre-trained word embedding model (such as Word2Vec, GloVe, BERT, etc.).

[0040] In an exemplary embodiment, a first tag corresponding to the first keyword and a second tag corresponding to the second keyword are determined from a preset tag database through a keyword model, including: determining a first tag vector having the highest target number similarity with the first vector and a second tag vector having the highest target number similarity with the second vector from the tag vectors of the tag database through the keyword model; and determining that the tag corresponding to the first tag vector is the first tag, and the tag corresponding to the second tag vector is the second tag.

[0041] The keyword model is used to calculate the similarity between the keyword vector and all the label vectors in the label vector library. Common similarity calculation methods include cosine similarity, Euclidean distance, etc., but the keyword model usually uses more complex mechanisms, such as attention mechanism, to comprehensively consider the various characteristics of the keyword vector. Based on the calculated similarity, select the first label vector with the highest target number of similarities with the first keyword vector, and the second label vector with the highest target number of similarities with the second keyword vector. The determination of the target number depends on the specific application requirements and scenarios. For example, the top 5 label vectors with the highest similarity can be selected. The labels corresponding to the label vector that best matches the keyword vector are determined as the first label and the second label.

[0042] In an exemplary embodiment, parsing the target text's title and text content from the target text includes: determining the file type of the target text; when the file type is plain text, identifying the title part and the body part of the plain text, and extracting the text of the title part as the title and the text of the body part as the text content, respectively.

[0043] Analyze the format of the input file to determine the file type. The file type directly determines the subsequent information extraction method. For example, PDF, images, videos, and plain text (such as .txt files) are processed differently. Once the file is confirmed to be a plain text type, the next step is to identify and separate the title and body parts. The title is often located at the beginning of the text, using bold, large fonts or special formatting. At the same time, the title is often concise and clear, summarizing the main content of the document. The body contains more detailed information and descriptions.

[0044] Alternatively, assume that there is a file that is determined to be plain text by analyzing the file extension (.txt) or the file content (such as checking whether there is binary data, image data, etc.). Assume that the first line of the file: Hydropower Station Equipment Maintenance Guide is obviously more concise than the following paragraphs, and is located at the beginning of the file, with a bold font and a larger font size than the subsequent text, and can be identified as a title. The text after the first line is considered to be the main text.

[0045] In an exemplary embodiment, after determining the file type of the target text, the method further includes: when the file type is a picture, recognizing the text in the picture through optical characters, and determining that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

[0046] When the target file is a picture, the picture is preprocessed, wherein the preprocessing includes: adjusting the picture size to a preset size and denoising the picture. The preprocessed picture is recognized by OCR, and the text in the picture is converted into an editable text format. A deep learning model, such as a convolutional neural network or a recurrent neural network model, is used to recognize the text layout and font in the picture. The text at the top of the picture or the text with a larger font or a specific format is identified as a title, and the text in the rest of the picture (i.e., the part of the picture other than the title) is identified as text content.

[0047] In an exemplary embodiment, after determining the file type of the target text, the method further includes: when the file type is a video, converting the video into a picture through frame extraction technology, and determining through image recognition that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

[0048] In the case where the target file is a video, key frames are extracted from the video. These key frames usually contain relatively static text information rather than rapidly changing images or video content. Common frame extraction techniques include frame extraction based on change detection or frame extraction at fixed time intervals, wherein frame extraction based on change detection can detect scene changes or text changes. Image recognition technology, especially OCR recognition technology, is used on the extracted key frames to identify the text in the picture. Similar to processing still pictures, this step converts the text in the picture into an editable text format. After identifying all the text in the key frames, the text at the top of the picture or the text with a larger font or a specific format is identified as a title, and the text in the rest of the picture (i.e., the part of the picture other than the title) is identified as text content.

[0049] In order to better understand the process of the above-mentioned target text classification method, the above-mentioned target text classification method is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present application.

[0050] Figure 3 is a flow chart of a method for classifying a target text according to an embodiment of the present application, such as Figure 3As shown, specifically including the following:

[0051] Optionally, the original data of the target text of the hydropower station is input into a computer terminal. These target texts include design drawings, equipment manuals, operation records, maintenance reports, etc., covering multiple data formats such as PDF, pictures, Word documents, Excel tables, text files and videos. According to the type of target text, different technical means are used to extract the title and text content. For PDF and picture files, OCR technology is used to identify and extract the title and text content. For Word, Excel and text files, text parsing technology is used to separate the title and text according to the document structure. For video materials, video parsing is first performed, and the title and text content are extracted by frame extraction, OCR recognition and speech-to-text technology. The first keyword of the above title and the second keyword of the above text content are determined by a deep learning model. Optionally, it is assumed that the first keyword is keyword A, B, C, and the second keyword is keyword X, Y, Z. The first keyword and the second keyword are input into the keyword-label map, so that keywords A, B, C and X, Y, Z find corresponding labels in the map respectively, wherein the keyword-label map is constructed according to the domain file and can map keywords with set labels. Based on the results of keyword-label graph recognition, multi-dimensional labels are generated, each of which represents an aspect or attribute of the technical data, such as equipment type, functional description, operating procedures, etc.

[0052] Obviously, the above-described embodiments are only a part of the embodiments of the present application, not all of the embodiments. In order to better understand the above-mentioned target text classification method, the above-mentioned process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:

[0053] In an optional embodiment, in combination Figure 4 The classification method of the target text of this application is further explained. Figure 4 As shown, including the following:

[0054] Determine the file type of the target text. For example, for PDF and images, convert the text in the image into an editable text format by using OCR to recognize the preprocessed image. Use a deep learning model, such as a convolutional neural network or a recurrent neural network model, to recognize the text layout and font in the image. Identify the text at the top of the image or the text with a larger font or a specific format as a title, and recognize the text in the rest of the image (i.e., the part of the image other than the title) as text content. Before OCR recognition, preprocess the image, such as adjusting brightness, contrast, binarization, denoising, etc., to improve recognition accuracy. OCR engines may include but are not limited to Tesseract, ABBYY FineReader, Adobe Acrobat OCR, etc.

[0055] For documents such as Word, Excel, and TXT, different parsing strategies are used according to the structure and format of the document, such as table detection, paragraph segmentation, and title recognition, to determine that the content at the beginning of the text, using bold, large fonts, or special formats is the title, and the content other than the title in the text is the body. You can also use text processing libraries such as python-docx, pandas, and PyPDF2 to directly read and parse the title and text in the file. Alternatively, assume that there is a file that is determined to be plain text by analyzing the file extension (.txt) or the file content (such as checking whether there is binary data, image data, etc.). Assume that the first line of the file: Hydropower Station Equipment Maintenance Guide is obviously more concise than the subsequent paragraphs, and is located at the beginning of the file, with a bold font and a font size larger than the subsequent text, and is recognized as a title. The text content after the first line is considered to be the body.

[0056] For videos, use video processing tools such as OpenCV and moviepy to convert the video into a series of image frames, and use image recognition technology, especially OCR recognition technology, on the extracted key frames to identify the text in the picture. Similar to processing still pictures, convert the text in the picture into an editable text format. After identifying all the text in the key frames, the text at the top of the picture or the text with a larger font or a specific format is identified as the title, and the text in the rest of the picture (that is, the part of the picture other than the title) is identified as text content.

[0057] After determining the title and text content of the target text, extract the target number of first keywords with the highest frequency from the title and the target number of second keywords with the highest frequency from the text content through self-developed or ready-made keyword extraction algorithms, such as TF-IDF, TextRank, BERT, GPT, etc. These keywords can be single words or phrases.

[0058] The mapping rules between keywords and tags are established through machine learning models to distinguish different levels and types of tags, such as equipment categories, functional descriptions, problem areas, etc. A keyword-tag graph is constructed based on the mapping rules between keywords and tags using a graph database (such as Neo4j, JanusGraph), where the nodes in the keyword-tag graph represent keywords or tags, and the edges represent the relationship between keywords and tags. Optionally, in the constructed keyword graph, the "generator" node is connected to the "equipment type" tag node; the "cleaning" node is connected to the "maintenance operation" tag node. The graph also includes an indirect association between "generator" and "maintenance operation", indicating that the "generator" requires a maintenance operation of "cleaning".

[0059] Import the extracted first and second keywords into the keyword-label graph, and search for label nodes matching the keywords in the graph, as well as the relationship paths between these label nodes. This process involves graph query algorithms, such as depth-first search, breadth-first search, or more complex graph algorithms, to determine the strength of association and path length between keywords and labels. For example, starting from "generator", find label nodes associated with it, such as "equipment type". Starting from "maintenance procedures", find labels associated with it, such as "maintenance operation" and "procedure". Based on the paths and relationships in the graph, generate a set of multidimensional labels that describe the title and content of the target text from different dimensions. Among them, the generation of multidimensional labels involves screening and sorting the label set to ensure that the final label set is both comprehensive and representative. The generated multidimensional labels are applied to scenarios such as document management, information retrieval, and intelligent recommendation. At the same time, based on user feedback and usage effects, continuously optimize the keyword extraction algorithm and keyword-label graph to improve the accuracy and efficiency of label generation.

[0060] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0061] In the present embodiment, a target text classification device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.

[0062] Figure 5 : is a structural block diagram of a target text classification device according to an embodiment of the present application, the device comprising:

[0063] A parsing module 50, used to parse the target text to obtain the title and text content of the target text;

[0064] A first determination module 52, used to determine a first keyword corresponding to the title and a second keyword corresponding to the text content;

[0065] A second determination module 54 is used to determine a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text;

[0066] The classification module 56 is used to classify the target text according to the first label and the second label.

[0067] Through the above device, the title and text content of the target text are parsed from the target text; the first keyword corresponding to the title and the second keyword corresponding to the text content are determined; the first tag corresponding to the first keyword and the second tag corresponding to the second keyword are determined from a preset tag database through a keyword model, wherein both the first tag and the second tag are used to classify the target text; the target text is classified according to the first tag and the second tag. This solves the problem in the related art that the classification of the target text is unclear due to manual classification of the target text.

[0068] In an exemplary embodiment, the first determination module 52 is also used to remove target type words in the title and the text content to obtain a first title and a first text, wherein the target type words include at least one of the following: stop words, low-frequency words, and high-frequency words; determine that the target number of words with the highest frequency of occurrence in the first title are the first keyword and the target number of words with the highest frequency of occurrence in the first text are the second keyword.

[0069] In an exemplary embodiment, the second determination module 54 is further used to preprocess the first keyword and the second keyword, wherein the preprocessing includes at least one of the following: unifying the English fonts in the first keyword and the second keyword into lowercase fonts; removing punctuation marks and special symbols in the first keyword and the second keyword; converting abbreviations in the first keyword and the second keyword into standard terms; and converting the preprocessed first keyword and the second keyword into a first vector and a second vector, respectively, through a pre-trained word embedding model.

[0070] In an exemplary embodiment, the second determination module 54 is also used to determine, from the label vectors of the label database through the keyword model, a first label vector of the target quantity with the highest similarity to the first vector, and a second label vector of the target quantity with the highest similarity to the second vector; and determine that the label corresponding to the first label vector is the first label, and the label corresponding to the second label vector is the second label.

[0071] In an exemplary embodiment, the parsing module 50 is also used to determine the file type of the target text; when the file type is plain text, the title part and the body part of the plain text are identified, and the text of the title part is extracted as the title and the text of the body part is extracted as the text content respectively.

[0072] In an exemplary embodiment, the parsing module 50 is also used to, when the file type is a picture, recognize the text in the picture through optical character recognition, and determine that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

[0073] In an exemplary embodiment, the parsing module 50 is also used to, when the file type is a video, convert the video into a picture through a frame extraction technology, and determine through image recognition that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

[0074] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0075] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0076] S1, parsing the title and text content of the target text from the target text;

[0077] S2, determining a first keyword corresponding to the title and a second keyword corresponding to the text content;

[0078] S3, determining a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text;

[0079] S4: classify the target text according to the first label and the second label.

[0080] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0081] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0082] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0083] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0084] S1, parsing the title and text content of the target text from the target text;

[0085] S2, determining a first keyword corresponding to the title and a second keyword corresponding to the text content;

[0086] S3, determining a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text;

[0087] S4: classify the target text according to the first label and the second label.

[0088] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0089] An embodiment of the present application further provides a computer program product, comprising a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program product, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0090] Optionally, in this embodiment, the above computer program may be configured to implement the following steps when executed by a processor:

[0091] S1, parsing the title and text content of the target text from the target text;

[0092] S2, determining a first keyword corresponding to the title and a second keyword corresponding to the text content;

[0093] S3, determining a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text;

[0094] S4: classify the target text according to the first label and the second label.

[0095] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0096] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0097] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for classifying a target text, characterized in that: include: Parsing the title and text content of the target text from the target text; Determine a first keyword corresponding to the title and a second keyword corresponding to the text content; Determine a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text; The target text is classified according to the first label and the second label.

2. The target text classification method according to claim 1, characterized in that: Determining a first keyword corresponding to the title and a second keyword corresponding to the text content includes: Remove target type words from the title and the text content to obtain a first title and a first text, wherein the target type words include at least one of the following: stop words, low-frequency words, and high-frequency words; determine that the target number of words with the highest frequency of appearance in the first title are the first keywords and the target number of words with the highest frequency of appearance in the first text are the second keywords.

3. The target text classification method according to claim 1, characterized in that: Before determining the first tag corresponding to the first keyword and the second tag corresponding to the second keyword from a preset tag database through a keyword model, the method further includes: Preprocessing the first keyword and the second keyword, wherein the preprocessing includes at least one of the following: unifying the English fonts in the first keyword and the second keyword into lowercase fonts; removing punctuation marks and special symbols in the first keyword and the second keyword; converting abbreviations in the first keyword and the second keyword into standard terms; The preprocessed first keyword and the second keyword are converted into a first vector and a second vector respectively through a pre-trained word embedding model.

4. The target text classification method according to claim 3, characterized in that: Determining a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model includes: Determine, from the tag vectors in the tag database, by using the keyword model, a first tag vector of the target quantity having the highest similarity to the first vector, and a second tag vector of the target quantity having the highest similarity to the second vector; It is determined that the label corresponding to the first label vector is the first label, and the label corresponding to the second label vector is the second label.

5. The target text classification method according to claim 1, characterized in that: Parsing the title and text content of the target text from the target text includes: Determining the file type of the target text; In the case that the file type is plain text, the title part and the body part of the plain text are identified, and the text of the title part is extracted as the title and the text of the body part is extracted as the text content.

6. The target text classification method according to claim 5, characterized in that: After determining the file type of the target text, the method further includes: In the case where the file type is a picture, optical character recognition is used to identify the text in the picture, and it is determined that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

7. The target text classification method according to claim 5, characterized in that: After determining the file type of the target text, the method further includes: In the case where the file type is a video, the video is converted into a picture through frame extraction technology, and image recognition is used to determine that the text at the top of the picture is the title, and the text in the rest of the picture is the text content, wherein the rest refers to the part of the picture other than the top.

8. A target text classification device, characterized in that: include: A parsing module, used for parsing the title and text content of the target text from the target text; A first determination module, used to determine a first keyword corresponding to the title and a second keyword corresponding to the text content; A second determination module is used to determine a first tag corresponding to the first keyword and a second tag corresponding to the second keyword from a preset tag database through a keyword model, wherein the first tag and the second tag are both used to classify the target text; A classification module is used to classify the target text according to the first label and the second label.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.