A method, device, equipment and readable storage medium for text subject indexing

By using Zipf's law and cluster analysis to generate word co-occurrence matrices and constructing a two-way word graph, we solve the problem of difficulty in identifying multiple topics and keyword indexing of text in the existing technology, and achieve effective identification and key words of text topics. Word extraction reflects the weight information of topics and words.

CN113590773BActive Publication Date: 2024-09-13INST OF SCI & TECH INFORMATION OF CHINA ACAD OF RAILWAY SCI GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110648194.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-10
Publication Date
2024-09-13
Estimated Expiration
2041-06-10

AI Technical Summary

Technical Problem

Existing text topic indexing methods are difficult to identify multiple topics in the text and use several words for indexing each topic, which lacks effective topic identification and keyword extraction.

Method used

Use Zipf's law to filter words with too high and too low word frequency in the text to be indexed, perform preprocessing and cluster analysis, generate a word co-occurrence matrix, construct a two-way word graph, iteratively calculate the Rank value of the node, cluster-based The weight and Rank value of the node index the text topic.

Benefits of technology

It achieves topic clustering of texts, determines the optimal number of topics, identifies primary and secondary topics, determines keyword indexing based on topic importance, and reflects the weight information of topics and subject words.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590773B
    Figure CN113590773B
Patent Text Reader

Abstract

The present invention provides a method, device, equipment and readable storage medium for text topic indexing, the method comprising: obtaining a text to be indexed, filtering words with too high and too low word frequencies in the text to be indexed by using Zipf's law, and obtaining a candidate word set; preprocessing the text to be indexed to obtain a text word sequence, clustering the text word sequence, and obtaining a weight P of each cluster; based on the candidate word set, generating a word co-occurrence matrix of the candidate word set, constructing a bidirectional word graph based on the word co-occurrence matrix, and iteratively calculating the Rank value of each node in the bidirectional word graph; indexing the text topic based on the weight P of each cluster and the Rank value of each node. The present invention first clusters the text, uses the elbow method to determine the optimal number of topics for the text, and then extracts keyword indexing documents for different topics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text indexing, and in particular to a method, device, equipment and readable storage medium for text subject indexing. Background Art

[0002] Subject indexing is a method of indexing and retrieving information resources from the perspective of text content. Its main technical methods include: using manual indexing, based on subject analysis, and based on certain controlled vocabularies or indexing rules, converting the features of information resources with retrieval significance into corresponding subject terms, and organizing them into identifiers that express the content characteristics of information resources. However, existing methods lack how to identify multiple topics in a text and use several words to index each topic. Summary of the invention

[0003] The object of the present invention is to provide a method, device, equipment and readable storage medium for text subject indexing to improve the above-mentioned problem.

[0004] In order to achieve the above objectives, the present application provides the following technical solutions:

[0005] On the one hand, an embodiment of the present application provides a method for text subject indexing, the method comprising:

[0006] Obtaining a text to be indexed, and using Zipf's law to filter out words with too high or too low frequency in the text to be indexed, to obtain a candidate word set;

[0007] Preprocessing the text to be indexed to obtain a text word sequence, performing cluster analysis on the text word sequence to obtain a weight P of each cluster;

[0008] Based on the candidate word set, a word co-occurrence matrix of the candidate word set is generated, a bidirectional word graph is constructed based on the word co-occurrence matrix, and a Rank value of each node is iteratively calculated in the bidirectional word graph;

[0009] The text topics are indexed based on the weight P of each cluster and the Rank value of each node.

[0010] Optionally, the preprocessing of the text to be indexed to obtain a text word sequence includes:

[0011] Filtering the pictures, tables and formula data of the text to be indexed to obtain the processed text to be indexed;

[0012] The processed text to be indexed is processed by using a professional domain vocabulary and stop words to obtain the text word sequence.

[0013] Optionally, the step of obtaining the text to be indexed and filtering out words with too high or too low frequency in the text to be indexed using Zipf's law to obtain a candidate word set includes:

[0014] Calculating the word frequencies of the words in the text to be indexed, sorting the word frequencies, and numbering the word frequencies in the sorted order;

[0015] Draw a curve graph between word frequency and number, and select words with slopes within a certain range to construct a candidate word set.

[0016] Optionally, generating a word co-occurrence matrix of the candidate word set based on the candidate word set includes:

[0017] Based on the text word sequence, a sliding window with a length of N is set, and the words appearing in the sliding window are defined as co-occurrence relationships. By sliding the window on the candidate word set, the number of co-occurrences between words in the candidate word set is recorded to generate a word co-occurrence matrix for the candidate word set.

[0018] In a second aspect, an embodiment of the present application provides a device for text topic indexing, the device comprising an acquisition module, a processing module, a generation module and an indexing module.

[0019] An acquisition module is used to acquire the text to be indexed, and filter out words with too high or too low frequency in the text to be indexed by using Zipf's law to obtain a set of candidate words;

[0020] A processing module, used for preprocessing the text to be indexed to obtain a text word sequence, performing cluster analysis on the text word sequence to obtain a weight P of each cluster;

[0021] A generating module, configured to generate a word co-occurrence matrix of the candidate word set based on the candidate word set, construct a bidirectional word graph based on the word co-occurrence matrix, and iteratively calculate a Rank value of each node in the bidirectional word graph;

[0022] The indexing module is used to index the text topic based on the weight P of each cluster and the Rank value of each node.

[0023] Optionally, the processing module includes:

[0024] A filtering unit, used for filtering the pictures, tables and formula data of the text to be indexed to obtain the processed text to be indexed;

[0025] The processing unit is used to perform sentence and word segmentation processing on the processed text to be indexed by using a professional domain vocabulary and stop words to obtain the text word sequence.

[0026] Optionally, the acquisition module includes:

[0027] A calculation unit, used for calculating the word frequencies of the words in the text to be indexed, sorting the word frequencies, and numbering the word frequencies in the sorted order;

[0028] The selection unit is used to draw a curve graph between word frequency and number, and select words with slopes within a certain range to construct a candidate word set.

[0029] Optionally, the generating module includes:

[0030] A generating unit is used to set a sliding window of length N based on the text word sequence, wherein the words appearing in the sliding window are defined as co-occurrence relationships, and the number of co-occurrences between words in the candidate word set is recorded by sliding the window on the candidate word set to generate a word co-occurrence matrix of the candidate word set.

[0031] In a third aspect, an embodiment of the present application provides a device for text topic indexing, the device comprising a memory and a processor. The memory is used to store a computer program; the processor is used to implement the steps of the above text topic indexing method when executing the computer program.

[0032] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned text subject indexing method are implemented.

[0033] The beneficial effects of the present invention are:

[0034] 1. The present invention first clusters the text, uses the elbow method to determine the optimal number of topics for the text, and then extracts keyword indexing documents for different topics.

[0035] 2. When using K-mean clustering to identify text topics, this application identifies the weight of the text topic, identifies the main topic, secondary topic and other information, and determines how many keywords should be indexed under the topic based on the importance of the topic. The weight information of the topic and keyword is reflected in the indexing results.

[0036] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or be understood by implementing the embodiments of the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0038] Figure 1 It is a flowchart of a method for text subject indexing described in an embodiment of the present invention;

[0039] Figure 2 is a schematic diagram of the structure of a device for text subject indexing according to an embodiment of the present invention;

[0040] Figure 3 It is a schematic diagram of the structure of the device for text subject indexing described in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0042] It should be noted that similar reference numerals or letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0043] Example 1

[0044] like Figure 1 As shown, this embodiment provides a method for text subject indexing, which includes step S1 and step S2.

[0045] Step S1, obtaining a text to be indexed, and using Zipf's law to filter out words with too high or too low frequency in the text to be indexed to obtain a set of candidate words;

[0046] Step S2: preprocess the text to be indexed to obtain a text word sequence, perform cluster analysis on the text word sequence, and obtain a weight P of each cluster;

[0047] Step S3: Based on the candidate word set, generate a word co-occurrence matrix of the candidate word set, construct a bidirectional word graph based on the word co-occurrence matrix, and iteratively calculate the Rank value of each node in the bidirectional word graph;

[0048] Step S4: indexing the text topic based on the weight P of each cluster and the Rank value of each node.

[0049] In this embodiment, when K-mean clustering is used to identify text topics, the weight of the text topic is identified, and information such as the main topic and the secondary topic are identified. In addition, based on the importance of the topic, it is determined how many keywords should be indexed under the topic, and the weight information of the topic and the keyword is reflected in the indexing results.

[0050] In a specific implementation of the present disclosure, the step S2 may further include step S21 and step S22.

[0051] Step S21, filtering the pictures, tables and formula data of the text to be indexed to obtain the processed text to be indexed;

[0052] Step S22: Use the professional domain vocabulary and stop words to perform sentence and word segmentation on the processed text to be indexed to obtain the text word sequence.

[0053] In a specific implementation of the present disclosure, the step S1 may further include step S11 and step S12.

[0054] Step S11, calculating the word frequencies of the words in the text to be indexed, sorting the word frequencies, and numbering the word frequencies in the sorted order;

[0055] Step S12: draw a curve graph between word frequency and number, and select words with a slope within a certain range to construct a candidate word set.

[0056] In a specific implementation of the present disclosure, the step S3 may further include step S31.

[0057] Step S31: Based on the text word sequence, a sliding window of length N is set, and the words appearing in the sliding window are defined as co-occurrence relationships. By sliding the window on the candidate word set, the number of co-occurrences between words in the candidate word set is recorded to generate a word co-occurrence matrix for the candidate word set.

[0058] Example 2

[0059] like Figure 2As shown, this embodiment provides a device for text topic indexing, which includes an acquisition module 701, a processing module 702, a generation module 703 and an indexing module 704.

[0060] An acquisition module 701 is used to acquire a text to be indexed, and filter out words with too high or too low frequency in the text to be indexed using Zipf's law to obtain a candidate word set;

[0061] Processing module 702, used for preprocessing the text to be indexed to obtain a text word sequence, performing cluster analysis on the text word sequence to obtain a weight P of each cluster;

[0062] A generating module 703 is used to generate a word co-occurrence matrix of the candidate word set based on the candidate word set, construct a bidirectional word graph based on the word co-occurrence matrix, and iteratively calculate the Rank value of each node in the bidirectional word graph;

[0063] The indexing module 704 is used to index the text topic based on the weight P of each cluster and the Rank value of each node.

[0064] In a specific implementation of the present disclosure, the processing module 702 includes a filtering unit 7021 and a processing unit 7022 .

[0065] A filtering unit 7021 is used to filter the pictures, tables and formula data of the text to be indexed to obtain the processed text to be indexed;

[0066] The processing unit 7022 is used to perform sentence and word segmentation processing on the processed text to be indexed by using a professional domain vocabulary and stop words to obtain the text word sequence.

[0067] In a specific implementation of the present disclosure, the acquisition module 701 includes a calculation unit 7011 and a selection unit 7012 .

[0068] A calculation unit 7011 is used to calculate the word frequencies of the words in the text to be indexed, sort the word frequencies, and number the word frequencies in the sorted order;

[0069] The selection unit 7012 is used to draw a curve graph between word frequency and number, and select words with a slope within a certain range to construct a candidate word set.

[0070] In a specific implementation of the present disclosure, the generation module 703 includes a generation unit 7031 .

[0071] The generating unit 7031 is used to set a sliding window of length N based on the text word sequence, and the words appearing in the sliding window are defined as a co-occurrence relationship. By sliding the window on the candidate word set, the number of co-occurrences between words in the candidate word set is recorded to generate a word co-occurrence matrix of the candidate word set.

[0072] It should be noted that, regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.

[0073] Example 3

[0074] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a device for text topic indexing. The device for text topic indexing described below and the method for text topic indexing described above can be referenced to each other.

[0075] Figure 3 FIG. 8 is a block diagram of a text topic indexing device 800 according to an exemplary embodiment. Figure 3 As shown, the text topic indexing device 800 may include: a processor 801 and a memory 802. The text topic indexing device 800 may also include one or more of a multimedia component 803, an input / output (I / O) interface 804, and a communication component 805.

[0076] The processor 801 is used to control the overall operation of the text topic indexing device 800 to complete all or part of the steps in the above-mentioned text topic indexing method. The memory 802 is used to store various types of data to support the operation of the text topic indexing device 800, and these data may include, for example, instructions for any application or method operating on the text topic indexing device 800, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 803 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 802 or sent via the communication component 805. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 804 provides an interface between the processor 801 and other interface modules, and the above-mentioned other interface modules can be keyboards, mice, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 805 is used for wired or wireless communication between the device 800 for text topic indexing and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so the corresponding communication component 805 can include: Wi-Fi module, Bluetooth module, NFC module.

[0077] In an exemplary embodiment, the text subject indexing device 800 can be implemented by one or more application specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), digital signal processors (Digital Signal Processor, referred to as DSP), digital signal processing devices (Digital Signal Processing Device, referred to as DSPD), programmable logic devices (Programmable Logic Device, referred to as PLD), field programmable gate arrays (Field Programmable Gate Array, referred to as FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned text subject indexing method.

[0078] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the above-mentioned method for text topic indexing are implemented. For example, the computer-readable storage medium can be the above-mentioned memory 802 including program instructions, and the above-mentioned program instructions can be executed by the processor 801 of the text topic indexing device 800 to complete the above-mentioned method for text topic indexing.

[0079] Example 4

[0080] Corresponding to the above method embodiment, the embodiment of the present disclosure further provides a readable storage medium. The readable storage medium described below and the method for text subject indexing described above can be referenced to each other.

[0081] A readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the text subject indexing method of the above method embodiment.

[0082] The readable storage medium may specifically be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or other readable storage medium that can store program codes.

[0083] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for text subject indexing, characterized in that: include: Obtain the text to be indexed, and use Zipf's law to filter out words with too high or too low frequency in the text to be indexed to obtain a set of candidate words, including: Calculating the word frequencies of the words in the text to be indexed, sorting the word frequencies, and numbering the word frequencies in order; Draw a curve graph between word frequency and number, and select words with slopes within a preset range to construct a candidate word set; Preprocess the text to be indexed to obtain a text word sequence, perform cluster analysis on the text word sequence, and obtain the weight P of each cluster, including: Filtering the pictures, tables and formula data of the text to be indexed to obtain the processed text to be indexed; Using a professional domain vocabulary and stop words to perform sentence and word segmentation processing on the processed text to be indexed to obtain the text word sequence; Based on the candidate word set, a word co-occurrence matrix of the candidate word set is generated, a bidirectional word graph is constructed based on the word co-occurrence matrix, and a Rank value of each node in the bidirectional word graph is iteratively calculated, including: Based on the text word sequence, a sliding window with a length of N is set, and the words appearing in the sliding window are defined as co-occurrence relationships. By sliding the window on the candidate word set, the number of co-occurrences between words in the candidate word set is recorded to generate a word co-occurrence matrix of the candidate word set; The text topics are indexed based on the weight P of each cluster and the Rank value of each node.

2. A device for text subject indexing, characterized in that: include: The acquisition module is used to acquire the text to be indexed, and use Zipf's law to filter out words with too high or too low frequency in the text to be indexed to obtain a set of candidate words, including: A calculation unit, used for calculating the word frequencies of the words in the text to be indexed, sorting the word frequencies, and numbering the word frequencies in the sorted order; A selection unit is used to draw a curve graph between word frequency and number, and select words with slopes within a preset range to construct a candidate word set; The processing module is used to pre-process the text to be indexed to obtain a text word sequence, perform cluster analysis on the text word sequence, and obtain a weight P of each cluster, including: A filtering unit, used for filtering the pictures, tables and formula data of the text to be indexed to obtain the processed text to be indexed; A processing unit, used for performing sentence and word segmentation processing on the processed text to be indexed by using a professional domain vocabulary and stop words to obtain the text word sequence; A generation module is used to generate a word co-occurrence matrix of the candidate word set based on the candidate word set, construct a bidirectional word graph based on the word co-occurrence matrix, and iteratively calculate the Rank value of each node in the bidirectional word graph, including: A generating unit is used to set a sliding window of length N based on the text word sequence, the words appearing in the sliding window are defined as co-occurrence relationships, and the number of co-occurrences between words in the candidate word set is recorded by sliding the window on the candidate word set to generate a word co-occurrence matrix of the candidate word set; The indexing module is used to index the text topic based on the weight P of each cluster and the Rank value of each node.

3. A device for text subject indexing, characterized in that: include: Memory for storing computer programs; A processor is used to implement the steps of the text subject indexing method as claimed in claim 1 when executing the computer program.

4. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for text subject indexing as claimed in claim 1 are implemented.