Text theme determination method, device and readable storage medium
By calculating the preset theme intensity value of the text, combining multiple theme recognition tools and processing methods, the problem of unintuitive determination of text themes is solved, achieving more intuitive and efficient theme recognition.
Patent Information
- Application Number
- CN202110047739.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-14
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-01-14
AI Technical Summary
Existing methods for determining text topics are not intuitive and cannot accurately identify and display topics in text.
By calculating the intensity value corresponding to the preset topic of the subject text to be determined, if the intensity value is greater than the preset intensity threshold, it is determined that there is a preset topic in the text, and the topic recognition tools related to word content, word combination correlation and word order are used for recognition and calculation, combining the topic matching template, theme weight calculation and vectorization processing.
It realizes more intuitive and accurate identification of topics in the text when determining text topics, improving the efficiency and accuracy of topic determination.
Smart Images

Figure CN112765970B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and particularly to a method, device and readable storage medium for determining a text theme. Background Art
[0002] During the actual operation of a business (matters to be processed in various industries), descriptive texts about objects, behaviors, and results are generated. Such descriptive texts are called texts, and the central idea or main view contained in the texts is called a theme. The number and content of the themes are related to the above-mentioned business. For example, for a review of a restaurant, it may contain multiple themes such as the taste of dishes, the environmental layout, and the service quality.
[0003] Currently, the method for extracting themes from texts is to directly extract keywords from the input text, calculate and rank the importance of the keywords, and display the important keywords. However, directly displaying the keywords cannot intuitively reflect their corresponding themes.
[0004] It can be seen that currently, when determining the theme in a text, there is a problem that the theme determination is not intuitive. Summary of the Invention
[0005] The main purpose of the present invention is to provide a method, device and readable storage medium for determining a text theme, aiming to solve the technical problem that the existing theme determination in a text is not intuitive.
[0006] To achieve the above purpose, the present invention provides a method for determining a text theme, and the method for determining a text theme includes the steps of:
[0007] Obtain a text whose theme is to be determined;
[0008] Calculate the intensity value corresponding to a preset theme based on the text to be determined;
[0009] If the intensity value is greater than a preset intensity threshold, it is determined that the preset theme exists in the text to be determined.
[0010] Optionally, the obtaining of the text whose theme is to be determined includes:
[0011] Obtain an initial text based on a preset business requirement;
[0012] Perform a filtering process on the initial text based on a preset filtering method to obtain the text whose theme is to be determined.
[0013] Optionally, the calculating of the intensity value corresponding to a preset theme based on the text to be determined includes:
[0014] Identify the subject text to be determined based on a preset subject identification tool to obtain a subject identification intermediate result;
[0015] The intensity value corresponding to the preset theme is calculated based on the intermediate result of theme identification.
[0016] Optionally, the preset topic includes at least two topics, and before the preset topic identification tool is used to identify the topic text to be determined, the following steps are included:
[0017] The preset topics are subject-classified based on preset classification rules to obtain a subject classification result; the subject category corresponding to the subject classification result includes at least one of the following: a subject category related to word content, a subject category related to word combination, and a subject category related to word order, wherein the subject categories correspond to different ways of expressing meaning;
[0018] The identifying the subject text to be determined based on a preset subject identification tool includes at least one of the following:
[0019] Identify the subject text to be determined based on a preset word content related subject identification tool corresponding to the word content related subject category to obtain a subject matching result;
[0020] Identify the subject text to be determined based on a preset word combination related subject identification tool corresponding to the word combination related subject category, and obtain a subject weight calculation result;
[0021] Identify the topic text to be determined based on a preset word order related topic identification tool corresponding to the word order related topic category, and obtain a topic prediction result;
[0022] The topic identification intermediate result is the topic matching result, the topic weight calculation result and / or the topic prediction result; the topic identification intermediate result corresponds to the preset topic identification tool.
[0023] Optionally, the identifying the to-be-determined topic text by a preset topic identification tool corresponding to the topic category related to the word content includes:
[0024] Obtain a topic matching template corresponding to a topic category related to the word content;
[0025] The to-be-determined topic text is matched based on the topic matching template.
[0026] Optionally, the identifying the to-be-determined topic text by a preset topic identification tool corresponding to the topic category related to the word combination includes:
[0027] Performing word segmentation processing on the subject text to be determined to obtain a plurality of words;
[0028] Calculate the topic weights of the topics corresponding to the topic categories related to each of the words and the word combinations based on a preset topic weight calculation model;
[0029] Sum up the topic weights to obtain the total topic weight;
[0030] Perform normalization processing on the total topic weight.
[0031] Optionally, before calculating the topic weights of the topics corresponding to the topic categories related to each of the words and the word combinations based on the preset topic weight calculation model, it includes: training the preset topic weight calculation model, including:
[0032] Obtain training data, an untrained model, and manually intervened screening parameters;
[0033] Train the untrained model based on the manually intervened screening parameters and the training data to obtain the preset topic weight calculation model.
[0034] Optionally, identifying the to-be-determined topic text based on the preset topic recognition tool corresponding to the topic category related to the word order includes:
[0035] Perform vectorization processing on the to-be-determined topic text to obtain a word vector matrix;
[0036] Perform prediction processing on the word vector matrix based on the preset topic prediction model corresponding to the topic type related to the word order.
[0037] In addition, to achieve the above object, the present invention further provides a text topic determination device, which includes a memory, a processor, and a text topic determination program stored on the memory and executable on the processor. When the text topic determination program is executed by the processor, the steps of the above-mentioned text topic determination method are implemented.
[0038] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, on which a text topic determination program is stored. When the text topic determination program is executed by a processor, the steps of the above-mentioned text topic determination method are implemented.
[0039] The present invention obtains a text of a subject to be determined; calculates an intensity value corresponding to a preset subject based on the text to be determined; and if the intensity value is greater than a preset intensity threshold, determines that the preset subject exists in the text of the subject to be determined. The present invention realizes that when determining the subject existing in the text of the subject to be determined, it is determined by calculating the intensity value corresponding to the preset subject of the text to be determined. When the intensity value is greater than the preset intensity threshold, it is determined that the preset subject exists in the text of the subject to be determined. Thus, it can be seen that the subject existing in the text of the subject to be determined is intuitively reflected by the intensity value, so that when determining the subject in the text, the subject determination is more intuitive. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 is a schematic flowchart of the first embodiment of the method for determining the text subject of the present invention;
[0041] Figure 2 is a schematic flowchart of the second embodiment of the method for determining the text subject of the present invention;
[0042] Figure 3 is a schematic diagram of the functional modules of the preferred embodiment of the device for determining the text subject of the present invention;
[0043] Figure 4 is a schematic diagram of the structure of the hardware operating environment involved in the embodiment solution of the present invention.
[0044] The implementation, functional features and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0046] The present invention provides a method for determining a text subject, referring to Figure 1 , Figure 1 is a schematic flowchart of the first embodiment of the method for determining the text subject of the present invention.
[0047] The embodiments of the present invention provide embodiments of the method for determining a text subject. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described herein may be executed in a different order. The method for determining a text subject can be applied to a server and / or a terminal, and the terminal includes but is not limited to a personal computer, a mobile phone, etc. For the sake of convenience of description, the execution subject is omitted hereinafter to describe the steps of the method for determining a text subject. The method for determining a text subject includes:
[0048] Step 110, obtain a text of a subject to be determined.
[0049] Specifically, obtain the text of the subject to be determined. Among them, the text of the subject to be determined is related to specific business, that is, for different businesses, the text of the subject to be determined is different.
[0050] Furthermore, step S110 includes:
[0051] Step a, obtain the initial text based on the preset business requirements.
[0052] Specifically, obtain the initial text based on the preset business requirements. The preset business requirements correspond to the above specific business, that is, select the target business from different businesses according to the requirements. In addition, auxiliary judgment information for assisting in determining the theme existing in the text of the subject to be determined can also be obtained. For example, it is necessary to determine whether there is a taste of the dishes in a review of a restaurant. The auxiliary judgment information can be that the review is a positive review. It can be understood that if the review is a positive review, when determining whether there is a taste of the dishes in the review, it can be determined around whether the dishes are delicious and attractive, rather than around whether the dishes are unappetizing and unappetizing. It can be understood that the auxiliary determination of the theme existing in the text of the subject to be determined by the auxiliary judgment information reduces the determination process and improves the efficiency of the determination process.
[0053] Step b, filter the initial text based on the preset filtering method to obtain the text of the subject to be determined.
[0054] Specifically, filter the initial text based on the preset filtering method to obtain the text of the subject to be determined. Among them, the filtering process is to filter the misleading information that is likely to affect semantic judgment in the text of the subject to be determined. The misleading information includes fixed description templates, etc.
[0055] Step S120, calculate the intensity value corresponding to the preset theme based on the text to be determined.
[0056] Specifically, calculate the intensity value corresponding to the preset theme based on the text of the subject to be determined. The intensity value is used to determine whether the preset theme exists in the text of the subject to be determined. Among them, the preset theme is determined by the preset business requirements, and the semantics of the preset theme are clear.
[0057] Step S130, if the intensity value is greater than the preset intensity threshold, determine that the preset theme exists in the text of the subject to be determined.
[0058] Specifically, if the intensity value is greater than the preset intensity threshold, determine that the preset theme exists in the text of the subject to be determined. If the intensity value is equal to the preset intensity threshold, determine that the preset theme does not exist in the text of the subject to be determined. Among them, the preset intensity threshold can be set according to specific needs and is not specifically limited in this embodiment. For example, the preset intensity threshold can be zero.
[0059] This embodiment obtains the subject text to be determined; calculates the strength value corresponding to the preset subject based on the subject text to be determined; and determines that the preset subject exists in the subject text to be determined if the strength value is greater than the preset strength threshold. This achieves that when determining the subject existing in the subject text to be determined, the strength value corresponding to the preset subject of the subject text to be determined is calculated, and when the strength value is greater than the preset strength threshold, it is determined that the preset subject exists in the subject text to be determined. It can be seen that the strength value intuitively reflects the subject existing in the subject text to be determined, so that when determining the subject in the text, the subject determination is more intuitive.
[0060] Further, refer to Figure 2 Based on the first embodiment of the text topic determination method of the present invention, a second embodiment is proposed, wherein the step of calculating the strength value corresponding to the preset topic based on the text to be determined includes:
[0061] Step S121, identifying the subject text to be determined based on a preset subject identification tool to obtain a subject identification intermediate result.
[0062] Specifically, the subject text to be determined is identified based on a preset subject identification tool, a preliminary identification of the subject existing in the subject text to be determined is completed, and an intermediate result of subject identification is obtained.
[0063] The preset topics include at least two topics. Before the preset topic identification tool identifies the topic text to be determined, the following steps are included:
[0064] Step c, classifying the preset topics based on preset classification rules to obtain topic classification results; the topic categories corresponding to the topic classification results include at least one of the following: word content-related topic categories, word combination-related topic categories, and word order-related topic categories, wherein the meanings corresponding to the topic categories are different.
[0065] Specifically, the preset topics are classified based on preset classification rules to obtain topic classification results, wherein the topic categories corresponding to the topic classification results include at least one of the following: word content-related topic categories, word combination-related topic categories, and word order-related topic categories, wherein the meanings corresponding to the topic categories are different.
[0066] It should be noted that the preset classification rule is to classify according to the expression method of the preset theme.
[0067] It should be noted that for the semantic expression method, the theme corresponding to the theme category related to word content is a theme with a fixed semantic expression form; the theme corresponding to the theme category related to word combination is a theme corresponding to the use of multiple keywords for semantic expression, that is, this theme cannot be determined by a single keyword; the theme corresponding to the theme category related to word order is a theme with a complex semantic expression form, which is related to the order of keywords, and this order is too complex to be summarized manually.
[0068] It should be noted that keywords are words in the text of the to-be-determined theme that can reflect the theme, that is, there is a belonging relationship between the keywords and the theme. For example, if the keywords are "decoration", "layout", and "comfort", it can be known from the above keywords that the corresponding theme is environmental layout.
[0069] Step d, the identifying of the to-be-determined theme text based on a preset theme recognition tool includes at least one of the following:
[0070] Identifying the to-be-determined theme text based on the preset word content-related theme recognition tool corresponding to the theme category related to word content, and obtaining a theme matching result;
[0071] Identifying the to-be-determined theme text based on the preset word combination-related theme recognition tool corresponding to the theme category related to word combination, and obtaining a theme weight calculation result;
[0072] Identifying the to-be-determined theme text based on the preset word order-related theme recognition tool corresponding to the theme category related to word order, and obtaining a theme prediction result;
[0073] The intermediate result of theme recognition is the theme matching result, the theme weight calculation result, and / or the theme prediction result; the intermediate result of theme recognition corresponds to the preset theme recognition tool.
[0074] Specifically, different topics correspond to different preset topic recognition tools. Among them, recognizing the to-be-determined topic text based on the preset topic recognition tools includes recognizing the to-be-determined topic text based on the preset word content-related topic recognition tool corresponding to the word content-related topic category, recognizing the to-be-determined topic text based on the preset word combination-related topic recognition tool corresponding to the word combination-related topic category, and / or recognizing the to-be-determined topic text based on the preset word order-related topic recognition tool corresponding to the word order-related topic category, that is, recognizing the to-be-determined topic text based on the preset word content-related topic recognition tool corresponding to the word content-related topic category, recognizing the to-be-determined topic text based on the preset word combination-related topic recognition tool corresponding to the word combination-related topic category, recognizing the to-be-determined topic text based on the preset word order-related topic recognition tool corresponding to the word order-related topic category, recognizing the to-be-determined topic text based on the preset word content-related topic recognition tool corresponding to the word content-related topic category and recognizing the to-be-determined topic text based on the preset word combination-related topic recognition tool corresponding to the word combination-related topic category, recognizing the to-be-determined topic text based on the preset word content-related topic recognition tool corresponding to the word content-related topic category and recognizing the to-be-determined topic text based on the preset word order-related topic recognition tool corresponding to the word order-related topic category, recognizing the to-be-determined topic text based on the preset word content-related topic recognition tool corresponding to the word content-related topic category and recognizing the to-be-determined topic text based on the preset word combination-related topic recognition tool corresponding to the word combination-related topic category, and recognizing the to-be-determined topic text based on the preset word order-related topic recognition tool corresponding to the word order-related topic category.
[0075] It should be noted that the above intermediate topic recognition results are topic matching results, topic weight calculation results, and / or topic prediction results; the intermediate topic recognition results correspond to the preset topic recognition tools. For example, if the preset topic recognition tool is the preset word combination-related topic recognition tool, the intermediate topic recognition result is the topic weight calculation result; if the preset topic recognition tools are the preset word combination-related topic recognition tool and the preset word order-related topic recognition tool, the intermediate topic recognition results are the topic weight calculation result and the topic prediction result.
[0076] It should be noted that by classifying the preset topics and identifying the topics corresponding to different topic types in the text to be determined through different preset topic recognition tools, it is equivalent to converting the topic recognition problem of the text into a multi-label recognition problem; compared with the recognition method of using a single preset topic recognition tool to recognize the text to be determined, the method of using different preset topic recognition tools to respectively recognize the text to be determined reduces the coupling of the recognition model corresponding to the preset topic recognition tool, making the process of training the recognition model and the process of using the recognition model for prediction more flexible, and facilitating the adjustment of the recognition model. It can be understood that the text data corresponding to a single preset topic recognition tool is larger and more chaotic than the classified text data corresponding to different preset topic recognition tools.
[0077] Step S122, calculate the intensity value corresponding to the preset topic based on the intermediate result of topic recognition.
[0078] Specifically, calculate the intensity value corresponding to the preset topic based on the intermediate result of topic recognition. It should be noted that in order to more intuitively reflect whether there is one or more topics in the text to be determined, the corresponding relationship between the preset topic and the intensity value can be preset, which is reflected in the form of an intensity vector. Specifically, the intensity value can be reflected in the form of an intensity vector, where there is a corresponding relationship between each position of the intensity vector and each topic. For example, the topic corresponding to position 0 is the taste of the dish, and the topic corresponding to position 1 is the environmental layout.
[0079] The above-mentioned identification of the text to be determined by using the preset topic recognition tool corresponding to the topic category related to the word content includes:
[0080] Step d1, obtain the topic matching template corresponding to the topic category related to the word content.
[0081] Specifically, obtain the topic matching template corresponding to the topic category related to the word content. The topic matching template is a regular topic classifier, and its corresponding matching template includes keywords, key sentences, regular expressions, etc. The use of regular expressions increases the generalization ability of the topic matching template. Among them, the key sentence is similar to the keyword, and there is also a belonging relationship between the key sentence and the topic. For example, if the key sentence is "The environment is very good", then the corresponding topic is the environmental layout; the regular expression has a similar form to the keyword and the key sentence, and it can be used to check whether a string contains a certain character substring.
[0082] Step d2, match the text to be determined based on the topic matching template.
[0083] Specifically, match the text to be determined based on the topic matching template, that is, search for the topic matching template in the text to be determined.
[0084] The above-mentioned method for identifying the to-be-determined theme text by using the preset theme recognition tool corresponding to the theme category related to the word combination includes:
[0085] Step d3: Perform word segmentation on the to-be-determined theme text to obtain a number of words.
[0086] Specifically, perform word segmentation on the to-be-determined theme text to obtain a number of words, and these words are used as the input of the preset theme weight calculation model.
[0087] Step d4: Calculate the theme weights of each of the words corresponding to the theme of the theme category related to the word combination based on the preset theme weight calculation model.
[0088] Specifically, calculate the theme weights of each word corresponding to the theme of the theme type related to the word combination based on the preset theme weight calculation model. Among them, the theme category related to the word combination includes one or more themes. When the theme category related to the word combination includes multiple themes, calculate the theme weights of each theme respectively. For example, if the theme category related to the word combination includes themes A, B, and C, the calculation process is to calculate the weights of all words on themes A, B, and C respectively through the preset theme prediction models corresponding to themes A, B, and C. In addition, in addition to calculating the weights of all words on the above themes, it is also necessary to calculate the weights of all words on other themes. Among them, the preset theme weight calculation model can be an MNB (Multinomial Naive Bayes) classifier.
[0089] Step d5: Sum up the theme weights to obtain the total theme weight.
[0090] Specifically, sum up the theme weights to obtain the total theme weight. Among them, the weights of each theme are summed respectively. For example, the total theme weight of theme A is obtained by adding up the theme weights corresponding to all words of theme A alone, and the total theme weight of theme B is obtained by adding up the theme weights corresponding to all words of theme B alone.
[0091] Step d6: Perform normalization processing on the total theme weight.
[0092] Specifically, perform normalization processing on the total theme weight to obtain the probability value of the to-be-confirmed theme text in theme A, the probability value of the to-be-confirmed theme text in theme B, etc. Among them, the normalization processing is to convert the data into a decimal between (0, 1) or (-1, 1). The main purpose is to facilitate data processing and map the data to the range of 0 to 1 for processing, which is more convenient and fast.
[0093] Before calculating the topic weights of each of the words and the topics corresponding to the topic categories related to the word combination based on the preset topic weight calculation model, the following steps are included: training the preset topic weight calculation model, including:
[0094] Step e, obtaining training data, an untrained model, and artificial intervention screening parameters.
[0095] Specifically, obtain training data, an untrained model, and artificial intervention screening parameters. It should be noted that the training data is generated by the one-vs-rest method. Among them, the process of generating training data by one-vs-rest is to regard the data corresponding to the target topic in the original data as one category and the data corresponding to non-target topics in the original data as another category, which can meet the usage requirements of the training data. For example, if it is necessary to train an untrained model into a preset topic weight calculation model capable of calculating the weight of topic A, the data corresponding to topic A in the original data can be regarded as one category, and the data corresponding to non-topic A in the original data can be regarded as another category to obtain the training data.
[0096] Step f, training the untrained model based on the artificial intervention screening parameters and the training data to obtain the preset topic weight calculation model.
[0097] Specifically, training the untrained model based on the training data, and in this training process, it is necessary to adjust the training process through artificial intervention screening parameters, that is, artificially intervene in this training process to remove noise, so as to increase the generalization ability of the feature dictionary of the preset topic weight calculation model, that is, increase the adaptability of the preset topic weight calculation model to new samples, so that the prediction accuracy of the obtained preset topic weight calculation model is improved. For example, for dataset A, A-train is the training set, A-test is the test set, the preset topic weight calculation model 1 and the preset topic weight calculation model 2 are trained on A-train and tested on A-test. The test result of the preset topic weight calculation model 1 is better than that of the preset topic weight calculation model 2, indicating that the generalization ability of the preset topic weight calculation model 1 is strong.
[0098] The above-mentioned recognition of the text to be determined for the topic based on the preset topic recognition tool corresponding to the word order-related topic category includes:
[0099] Step g, performing vectorization processing on the text to be determined for the topic to obtain a character vector matrix.
[0100] Specifically, the text to be determined for the theme is vectorized to obtain a word vector matrix, which is composed of word vectors corresponding to multiple words. It should be noted that the word vectors included in the word vector matrix can be set according to specific needs. For example, the text to be determined for the theme is segmented into an array by word. It can be understood that the lengths of each array are the same. Then, each word is replaced with a word vector. It should be noted that there is a mapping relationship between the word and the word vector. Another example is to find the sentence with the longest length (the number of words) in the text to be determined for the theme, and use the length of this sentence as the number of word vectors included in the word vector matrix. For other sentences, when the length is insufficient, zeros are filled, such as filling zeros at the beginning of the sentence or at the end of the sentence, so that the length of this sentence is equal to the length of the sentence with the longest length.
[0101] Step h, perform a prediction process on the word vector matrix based on the preset theme prediction model corresponding to the theme type related to the word order.
[0102] Specifically, perform a prediction process on the word vector matrix based on the preset theme prediction model corresponding to the theme type related to the word order to obtain the probability that the text to be determined for the theme contains the preset theme. Among them, the preset theme prediction model is a word vector neural network classifier. When training the preset theme prediction model, its training data is also generated in the one-vs-rest manner. After obtaining the word vector matrix, it is trained through a convolutional neural network to obtain the preset theme prediction model. It should be noted that the preset theme prediction model learns the semantic structure in the text to be determined for the theme, so that when predicting the theme corresponding to the scenario where the semantics is related to the word order, the prediction accuracy is improved.
[0103] In this embodiment, the text to be determined for the theme is recognized based on the preset theme recognition tool to obtain an intermediate result of theme recognition; and the intensity value corresponding to the preset theme is calculated based on the intermediate result of theme recognition. It realizes obtaining the intensity value corresponding to the preset theme through the preset theme recognition tool, and the obtained intensity value is more accurate.
[0104] In addition, the present invention also provides a text theme determination device, as Figure 3 shown, the text theme determination device includes:
[0105] An acquisition module, configured to acquire the text to be determined for the theme;
[0106] A calculation module, configured to calculate the intensity value corresponding to the preset theme based on the text to be determined;
[0107] A determination module, configured to determine that the preset theme exists in the text to be determined for the theme if the intensity value is greater than a preset intensity threshold.
[0108] Further, the acquisition module includes:
[0109] An acquisition sub-module, configured to acquire an initial text based on a preset business requirement;
[0110] A filtering sub-module, configured to perform filtering processing on the initial text based on a preset filtering method to obtain the to-be-determined topic text.
[0111] Furthermore, the calculation module includes:
[0112] An identification sub-module, configured to identify the to-be-determined topic text based on a preset topic identification tool to obtain an intermediate result of topic identification;
[0113] A calculation sub-module, configured to calculate an intensity value corresponding to the preset topic based on the intermediate result of topic identification.
[0114] Furthermore, the preset topic includes at least two topics, and the calculation module further includes:
[0115] A classification sub-module, configured to perform topic classification on the preset topic based on a preset classification rule to obtain a topic classification result;
[0116] The identification sub-module includes at least one of the following:
[0117] A first identification unit, configured to identify the to-be-determined topic text based on a preset word-content-related topic identification tool corresponding to the word-content-related topic category;
[0118] A second identification unit, configured to identify the to-be-determined topic text based on a preset word-combination-related topic identification tool corresponding to the word-combination-related topic category;
[0119] A third identification unit, configured to identify the to-be-determined topic text based on a preset word-order-related topic identification tool corresponding to the word-order-related topic category.
[0120] Furthermore, the first identification unit includes:
[0121] An acquisition subunit, configured to acquire a topic matching template corresponding to the word-content-related topic category;
[0122] A matching subunit, configured to match the to-be-determined topic text based on the topic matching template.
[0123] Furthermore, the second identification unit includes:
[0124] A word segmentation subunit, configured to perform word segmentation processing on the to-be-determined topic text to obtain a plurality of words;
[0125] A calculation subunit, configured to calculate a topic weight of each word corresponding to the topic of the word-combination-related topic category based on a preset topic weight calculation model;
[0126] A summation subunit, configured to sum up the weights of each of the said topics to obtain a total topic weight;
[0127] A normalization subunit, configured to perform normalization processing on the total topic weight.
[0128] Furthermore, the second recognition unit further includes:
[0129] An acquisition subunit, configured to acquire training data, an untrained model, and manually intervened screening parameters;
[0130] A training subunit, configured to train the untrained model based on the manually intervened screening parameters and the training data to obtain the preset topic weight calculation model.
[0131] Furthermore, the third recognition unit includes:
[0132] A vectorization subunit, configured to perform vectorization processing on the text of the to-be-determined topic to obtain a word vector matrix;
[0133] A prediction subunit, configured to perform prediction processing on the word vector matrix based on the preset topic prediction model corresponding to the word order-related topic type.
[0134] The specific implementation manner of the text topic determination device of the present invention is basically the same as that of the embodiments of the above text topic determination method, and will not be elaborated herein.
[0135] In addition, the present invention further provides a text topic determination device. As Figure 4 shown, Figure 4 is a schematic structural diagram of the hardware operating environment involved in the embodiment solution of the present invention.
[0136] It should be noted that Figure 4 can be the schematic structural diagram of the hardware operating environment of the text topic determination device.
[0137] As Figure 4As shown in the figure, the text theme determination device may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, and a communication bus 1002. Among them, the communication bus 1002 is used to implement the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0138] Optionally, the text theme determination device may further include an RF (Radio Frequency) circuit, sensors, an audio circuit, a WiFi module, and so on.
[0139] Those skilled in the art can understand that Figure 4 the structure of the text theme determination device shown in
[0140] does not constitute a limitation on the text theme determination device, and may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout. Figure 4 As shown in the figure, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a text theme determination program. Among them, the operating system is a program for managing and controlling the hardware and software resources of the text theme determination device, and supports the operation of the text theme determination program and other software or programs.
[0141] In Figure 4 the text theme determination device shown in the figure, the user interface 1003 is mainly used to connect to a terminal and communicate with the terminal for data, such as receiving the text of the theme to be determined sent by the terminal; the network interface 1004 is mainly used to communicate with a background server for data; the processor 1001 may be used to call the text theme determination program stored in the memory 1005 and execute the steps of the text theme determination method as described above.
[0142] The specific implementation manner of the text theme determination device of the present invention is basically the same as that of each embodiment of the above text theme determination method, and will not be described in detail here.
[0143] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which a text theme determination program is stored. When the text theme determination program is executed by a processor, the steps of the text theme determination method described above are implemented.
[0144] The specific implementation manner of the computer-readable storage medium of the present invention is basically the same as that of each embodiment of the above text theme determination method, and will not be described in detail here.
[0145] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without more limitations, an element defined by the statement "including a..." does not exclude the existence of another identical element in the process, method, article or device including that element.
[0146] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments.
[0147] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which may be a mobile phone, computer, server, device, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0148] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. A method for determining a text theme, characterized in that, The text topic determination method comprises the following steps: Get the subject text to be determined; Calculating a strength value corresponding to a preset theme based on the text to be determined; The preset topics are subject-classified based on preset classification rules to obtain a subject classification result; the subject category corresponding to the subject classification result includes at least one of the following: a subject category related to word content, a subject category related to word combination, and a subject category related to word order, wherein the subject categories correspond to different ways of expressing meaning; The calculating the strength value corresponding to the preset theme based on the text to be determined includes: Identify the subject text to be determined based on a preset subject identification tool to obtain a subject identification intermediate result, wherein different subject categories correspond to different preset subject identification tools, and the subject identification intermediate result corresponds to the preset subject identification tool; Calculating the intensity value corresponding to the preset theme based on the theme identification intermediate result, wherein the preset theme includes at least two themes; If the strength value is greater than a preset strength threshold, it is determined that the preset topic exists in the topic text to be determined.
2. The text topic determination method according to claim 1, characterized in that The obtaining of the subject text to be determined includes: Get initial text based on preset business requirements; The initial text is filtered based on a preset filtering method to obtain the subject text to be determined.
3. The text topic determination method according to claim 1, wherein The identifying the subject text to be determined based on a preset subject identification tool includes at least one of the following: Identify the subject text to be determined based on a preset word content related subject identification tool corresponding to the word content related subject category to obtain a subject matching result; Identify the subject text to be determined based on a preset word combination related subject identification tool corresponding to the word combination related subject category, and obtain a subject weight calculation result; Identify the topic text to be determined based on a preset word order related topic identification tool corresponding to the word order related topic category, and obtain a topic prediction result; The topic identification intermediate result is the topic matching result, the topic weight calculation result and / or the topic prediction result.
4. The text theme determination method according to claim 3, characterized in that The identifying of the to-be-determined topic text by a preset topic identification tool corresponding to the topic category related to the word content includes: Obtain a topic matching template corresponding to a topic category related to the word content; The to-be-determined topic text is matched based on the topic matching template.
5. The text topic determination method according to claim 3, wherein The identifying of the to-be-determined topic text by a preset topic identification tool corresponding to the topic category related to the word combination includes: Performing word segmentation processing on the subject text to be determined to obtain a plurality of words; Calculate the topic weight of each of the words and the topic category related to the word combination based on a preset topic weight calculation model; Sum up the weights of each topic to obtain the total weight of the topic; The total weight of the topic is normalized.
6. The text theme determination method according to claim 5, characterized in that, The method of calculating the topic weights of the topics corresponding to the topic categories related to the word combinations based on the preset topic weight calculation model includes: training the preset topic weight calculation model, specifically including: Obtain training data, untrained models, and manual intervention screening parameters; The untrained model is trained based on the manual intervention screening parameters and the training data to obtain the preset topic weight calculation model.
7. The text theme determination method according to claim 3, wherein The preset topic recognition tool corresponding to the word order-related topic category recognizes the to-be-determined topic text, including: Performing vectorization processing on the to-be-determined topic text to obtain a word vector matrix; Performing prediction processing on the word vector matrix based on the preset topic prediction model corresponding to the word order-related topic type.
8. A text theme determination device, characterized in that The text topic determination device includes a memory, a processor, and a text topic determination program stored on the memory and executable on the processor. When the text topic determination program is executed by the processor, the steps of the text topic determination method according to any one of claims 1 to 7 are implemented.
9. A computer-readable storage medium, characterized in that, A text topic determination program is stored on the computer-readable storage medium. When the text topic determination program is executed by the processor, the steps of the text topic determination method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Abnormal text recognition method and device, computing equipment and medium
CN110929026A