Text analysis method and device and computer readable storage medium

By matching and classifying business keywords and emotional keywords, the emotional type of user speech data is automatically determined, solving the problems of low efficiency and low accuracy in the existing technology, and achieving more efficient and accurate emotion type recognition. .

CN119311810APending Publication Date: 2025-01-14SF TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310854088.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-12
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

The prior art methods of determining the emotional type to which the user's speech data belongs are inefficient and have low accuracy.

Method used

By obtaining the text to be processed, matching based on the business keyword set and the emotional keyword set, multiple first keywords are obtained, classified and weighted, and finally the emotional type to which the text belongs is determined.

Benefits of technology

It realizes the automatic determination of the emotional type of the text to be processed, improves the efficiency and accuracy, and solves the problems of low efficiency and low accuracy in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311810A_ABST
    Figure CN119311810A_ABST
Patent Text Reader

Abstract

The invention discloses a text analysis method. The method comprises the steps of obtaining a to-be-processed text; based on the business keyword set and the emotion keyword set, matching the to-be-processed text to obtain a plurality of first keywords; classifying the plurality of first keywords, and determining the type to which each first keyword belongs; and determining a first weight corresponding to each type, and determining an emotion type to which the to-be-processed text belongs based on the plurality of first weights. The embodiment of the invention further discloses a text analysis device and a computer readable storage medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to text analysis technology in the field of text analysis, and in particular to a text analysis method, device and computer-readable storage medium. Background Art

[0002] With the rapid development of computer and network communication technology, the Internet has provided a new way for the expression and dissemination of public opinion. More and more people are expressing their opinions and views on certain things through the Internet. Among them, in order to obtain the user's experience of using a certain product, related technologies usually need to collect user speech data about the product on various platforms, and manually analyze the user speech data to determine the emotion type to which the user speech data belongs, so as to use the emotion type to represent the user's experience of using the product. However, the above method of determining the emotion type to which the user speech data belongs has the problem of low efficiency and low accuracy. Summary of the invention

[0003] In order to solve the above technical problems, the embodiments of the present application hope to provide a text analysis method, device and computer-readable storage medium, which solve the problem that the method of determining the emotion type of user speech data in the related art is low in efficiency and accuracy.

[0004] A text analysis method, the method comprising:

[0005] Get the text to be processed;

[0006] Based on the business keyword set and the emotional keyword set, the text to be processed is matched to obtain a plurality of first keywords;

[0007] Classifying the multiple first keywords to determine the type to which each first keyword belongs;

[0008] A first weight corresponding to each type is determined, and based on the multiple first weights, the emotion type to which the text to be processed belongs is determined.

[0009] In the above scheme, the business keyword set and the emotional keyword set can be obtained in the following way:

[0010] Obtain the first business keyword and the first emotional keyword;

[0011] Acquire a second business keyword associated with the first business keyword; wherein the business keyword set includes the first business keyword and the second business keyword;

[0012] Acquire a second emotion keyword associated with the first emotion keyword; wherein the emotion keyword set includes the first emotion keyword and the second emotion keyword.

[0013] In the above solution, the text to be processed is matched based on the business keyword set and the emotional keyword set to obtain multiple first keywords, including:

[0014] Performing word segmentation processing on the text to be processed to obtain multiple words;

[0015] The multiple words are matched with the words in the business keyword set and the words in the emotional keyword set respectively to obtain the multiple first keywords.

[0016] In the above solution, the step of classifying the plurality of first keywords and determining the type to which each first keyword belongs includes:

[0017] Based on the business demand information, the multiple first keywords are classified to determine the type to which each first keyword belongs; wherein the business demand information includes at least two of the publishing channel information, e-commerce platform information, service product information, publisher information, service link information corresponding to the product, and emotional tags.

[0018] In the above solution, determining the emotion type of the to-be-processed text based on the multiple first weights includes:

[0019] Determining a media risk level based on the obtained source information of the text to be processed;

[0020] Obtaining a second weight corresponding to the media risk level;

[0021] Obtaining a comprehensive target weight according to the plurality of first weights and the second weight;

[0022] Based on the comprehensive target weight, the sentiment type of the text to be processed belongs to is determined.

[0023] In the above scheme, determining the sentiment type of the to-be-processed text based on the comprehensive target weight includes:

[0024] When the comprehensive target weight is greater than or equal to the weight threshold, determining that the sentiment type of the to-be-processed text is a negative sentiment type;

[0025] When the comprehensive target weight is less than the weight threshold, it is detected whether the text to be processed contains the target character to obtain a detection result, and based on the detection result, the emotion type to which the text to be processed belongs is determined.

[0026] In the above scheme, determining the emotion type of the text to be processed based on the detection result includes:

[0027] When the detection result indicates that the text to be processed contains the target character, obtaining a second keyword related to the target character from the text to be processed;

[0028] Based on the second keyword, the emotion type to which the text to be processed belongs is determined.

[0029] In the above solution, determining the emotion type of the text to be processed based on the second keyword includes:

[0030] In the case where the second keyword represents a complaint channel, determining that the emotion type is a negative emotion type;

[0031] When the second keyword represents the name of the target user and the number of third keywords representing negative emotions in the first keywords is greater than a target number threshold, the emotion type is determined to be a negative emotion type.

[0032] In the above solution, determining the first weight corresponding to each first keyword, and determining the emotion type of the to-be-processed text based on the multiple first weights, includes:

[0033] Determining a media risk level based on the obtained source information of the text to be processed;

[0034] Get a pre-trained sentiment classification model;

[0035] Using the sentiment classification model, determining a first weight corresponding to each type, a second weight corresponding to the media risk level, and performing operations on the plurality of first weights and the second weights to output a comprehensive target weight;

[0036] Based on the comprehensive target weight, the sentiment type of the text to be processed belongs to is determined.

[0037] A text analysis device, the device comprising: a processor, a memory and a communication bus;

[0038] The processor is used to execute the text analysis program in the memory to implement the steps of the above text analysis method.

[0039] A text analysis device, comprising:

[0040] An acquisition unit, used for acquiring text to be processed;

[0041] A processing unit, configured to match the text to be processed based on a business keyword set and an emotional keyword set to obtain a plurality of first keywords;

[0042] The processing unit is further used to classify the multiple first keywords and determine the type to which each first keyword belongs;

[0043] The processing unit is further used to determine a first weight corresponding to each type, and based on multiple first weights, determine the emotion type to which the text to be processed belongs.

[0044] A computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the above-mentioned text analysis method.

[0045] The text analysis method, device and computer-readable storage medium provided in the embodiments of the present application obtain a text to be processed; match the text to be processed based on a business keyword set and a sentiment keyword set to obtain multiple first keywords; classify the multiple first keywords to determine the type to which each first keyword belongs; determine the first weight corresponding to each type, and determine the sentiment type to which the text to be processed belongs based on the multiple first weights; in this way, the text to be processed can be matched based on the business keyword set and the sentiment keyword set to obtain the first keyword, and the sentiment type to which the text to be processed belongs can be determined based on the first weight corresponding to the type to which the first keyword belongs, thereby realizing automatic determination of the sentiment type to which the text to be processed belongs, without the need to determine the sentiment type by manual analysis, thereby improving the efficiency and accuracy of determining the sentiment type, and solving the problem of low efficiency and low accuracy in determining the sentiment type in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A flowchart of a text analysis method provided in an embodiment of the present application;

[0047] Figure 2 A flowchart of another text analysis method provided in an embodiment of the present application;

[0048] Figure 3 A flowchart of another text analysis method provided in an embodiment of the present application;

[0049] Figure 4 A structural diagram of a text analysis device provided in an embodiment of the present application;

[0050] Figure 5 A schematic diagram of the structure of a text analysis device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The technical solutions 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.

[0052] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] The present application embodiment provides a text analysis method, which can be applied to a text analysis device, referring to Figure 1 As shown, the method comprises the following steps:

[0054] Step 101: Obtain the text to be processed.

[0055] The text to be processed may be text to be processed related to the target keyword.

[0056] In the embodiment of the present application, the text analysis device may be a device with data processing capabilities; in a feasible implementation, the text analysis device may be a terminal or a server. The text to be processed may be actively downloaded by the text analysis device through the network; the text to be processed may also be acquired by other devices and sent to the text analysis device. In this way, different acquisition methods may be used to acquire the text to be processed, which improves the flexibility of acquiring the text to be processed.

[0057] Specifically, the text analysis device can periodically obtain the text to be processed through business keywords and / or product keywords by calling the application programming interface (API) of content search on different social platforms; wherein the target keywords include business keywords and / or product keywords.

[0058] In a feasible implementation, the target keywords may be logistics and the names of companies that provide logistics services; and the text to be processed may be speech data related to logistics.

[0059] It should be noted that in the related art, user speech data is usually collected manually. However, due to the wide variety of social platforms, the amount of user speech data is very large. Manual collection is often not timely enough and data may be missed, resulting in incomplete data analysis. In the embodiments of the present application, it is realized that the massive data of the social platform is automatically screened using business keywords and / or product keywords to extract the text to be processed that at least includes the user speech data, thereby improving the efficiency of obtaining the text to be processed and improving the comprehensiveness of subsequent data analysis.

[0060] Step 102: Match the text to be processed based on the business keyword set and the emotional keyword set to obtain multiple first keywords.

[0061] The business keyword set includes business keywords and keywords related to the business; the emotion keyword set includes emotion keywords and keywords related to the emotion keywords.

[0062] In an embodiment of the present application, keywords in the business keyword set can be used to perform keyword matching on the text to be processed to obtain a first keyword, and keywords in the emotional keyword set can be used to perform keyword matching on the text to be processed to obtain a first keyword. The first keyword is a business keyword or an emotional keyword; in this way, the emotional keyword set and the business keyword set are considered at the same time, and keyword matching is performed on the text to be processed, which improves the comprehensiveness of the first keyword obtained, and further improves the accuracy of the subsequent determination of the emotional type of the text to be processed based on the first keyword. The business keyword is a keyword that characterizes the attributes of the product and / or the service; the emotional keyword is a keyword that characterizes emotional feelings.

[0063] In a feasible implementation, the business keyword set includes logistics service keywords and keywords related to logistics keywords; the emotional keyword set includes emotional keywords related to logistics and keywords related to the emotional keywords.

[0064] Step 103: Classify the multiple first keywords and determine the type to which each first keyword belongs.

[0065] In an embodiment of the present application, a plurality of pre-set classification indicators can be used to determine the subtype indicator in the target classification indicator to which each first keyword belongs, and obtain the type to which each first keyword belongs; in this way, a plurality of first keywords can be divided into a plurality of types, so that the emotion type to which the to-be-processed text belongs can be determined based on the plurality of types in the subsequent process, thereby improving the accuracy of the emotion type to which the to-be-processed text belongs. The classification indicator can be determined based on business demand information. The target classification indicator represents the type to which a product attribute, service or emotional feeling belongs; the target classification indicator can include a plurality of subtype indicators.

[0066] In a feasible implementation method, for the logistics business, the target classification indicators include release channels, shopping activities, shopping purposes, service products and other indicators; among them, the target classification indicators take the release channel as an example, then its sub-type indicators can be social promotion, complaints, information sharing and other channels.

[0067] Step 104: determine the first weight corresponding to the type to which each first keyword belongs, and determine the sentiment type to which the to-be-processed text belongs based on the multiple first weights.

[0068] In the embodiment of the present application, the first weight corresponding to each type can be preset or determined by an artificial intelligence (AI) algorithm; the text analysis device can calculate multiple first weights to obtain a comprehensive target weight, so as to determine the emotion type of the text to be processed based on the comprehensive target weight. The emotion type includes a positive emotion type and a negative emotion type.

[0069] In a feasible implementation, multiple first weights may be summed to obtain a comprehensive target weight; multiple first weights may also be averaged to obtain a comprehensive target weight.

[0070] The text analysis method provided in the embodiment of the present application obtains a text to be processed; matches the text to be processed based on a business keyword set and a sentiment keyword set to obtain multiple first keywords; classifies the multiple first keywords to determine the type to which each first keyword belongs; determines a first weight corresponding to each type, and determines the sentiment type to which the text to be processed belongs based on the multiple first weights; in this way, the text to be processed can be matched based on the business keyword set and the sentiment keyword set to obtain the first keyword, and the sentiment type to which the text to be processed belongs can be determined based on the first weight corresponding to the type to which the first keyword belongs, thereby realizing automatic determination of the sentiment type to which the text to be processed belongs, without the need to determine the sentiment type by manual analysis, thereby improving the efficiency and accuracy of determining the sentiment type, and solving the problem of low efficiency and low accuracy in determining the sentiment type in the related art.

[0071] Based on the above embodiments, the embodiments of the present application provide a text analysis method, which is applied to a text analysis device, referring to Figure 2 As shown, the method comprises the following steps:

[0072] Step 201: Obtain the text to be processed.

[0073] Step 202: perform word segmentation on the text to be processed to obtain multiple words.

[0074] In the embodiment of the present application, a word segmenter may be used to perform word segmentation on the text to be processed to obtain multiple words.

[0075] In a feasible implementation, the word segmenter can be the Jieba Chinese word segmenter and / or the NLTK English word segmenter.

[0076] Step 203: Match the multiple words with the words in the business keyword set and the words in the emotional keyword set to obtain multiple first keywords.

[0077] In the embodiment of the present application, multiple words can be matched with words in the business keyword set to determine a first keyword that matches the words in the business keyword set from the multiple words, and multiple words can be matched with words in the emotional keyword set to determine a second keyword that matches the words in the emotional keyword set from the multiple words. The first keyword is a business keyword or an emotional keyword; in this way, multiple words in the text to be processed can be screened to obtain the first keyword to improve the effectiveness of the determined first keyword; and the screening reduces the data used for the subsequent determination of the emotional type of the text to be processed, thereby reducing the computational complexity.

[0078] Step 204: Classify the multiple first keywords based on the business demand information and determine the type to which each first keyword belongs.

[0079] The business demand information includes at least two of the following: release channel information, e-commerce platform information, service product information, publisher information, product corresponding service link information, and emotional tags. The business demand information represents information such as product attributes, product service links, product uses, business fields, and emotional directions.

[0080] In an embodiment of the present application, multiple first keywords can be classified according to business demand information, and sub-business demand information in the business demand information to which each first keyword belongs can be determined to obtain the type to which each first keyword belongs; in this way, the influence of business keywords on the sentiment classification of the text to be processed is taken into consideration, and multiple first keywords extracted from the text to be processed can be classified based on the business demand information, so that the sentiment type of the text to be processed can be determined based on the type to which the first keyword belongs, thereby improving the accuracy of the determined sentiment type to which the text to be processed belongs.

[0081] In a feasible implementation, publishing channel information may include event participation, social promotion, complaints and resource sharing; e-commerce platforms include shopping platform A, shopping platform B and shopping platform C; service product information includes product names, such as XX logistics; publisher information includes the publisher's company, the publisher's occupation, the industry to which the publisher's occupation belongs, the model of the mobile phone used by the publisher when publishing the text to be processed, the production company corresponding to the mobile phone used by the publisher, and the location of the production company; the service links corresponding to the product include delivery service and collection service; emotional labels include positive emotional labels (such as too fast, short time, and pleasant) and negative emotional labels (too slow, long time, and too bad).

[0082] Among them, when classifying, a keyword representing a release channel can be obtained from the first keyword, and based on the keyword, it can be determined which type of release channel it belongs to. For example, if the keyword belongs to social promotion in the release channel, then it means that the keyword representing the release channel among the multiple first keywords belongs to the category of social promotion. A keyword representing an e-commerce platform can also be obtained from the first keyword, which can be the name of a shopping platform. When the name of the shopping platform is determined to be shopping platform B, the keyword representing the e-commerce platform belongs to the category of shopping platform B. In this way, the type corresponding to each first keyword can be obtained in this way.

[0083] Step 205: Determine a first weight corresponding to the type to which each first keyword belongs.

[0084] Step 206: Determine the media risk level based on the obtained source information of the text to be processed.

[0085] Among them, the source information can represent the category of the account that published the text to be processed.

[0086] In an embodiment of the present application, the account that publishes the text to be processed can be obtained, the source information of the text to be processed can be determined based on the account, and the media risk level corresponding to the source information can be determined.

[0087] Among them, the media risk level can also be called the public opinion risk level; the media risk level refers to the potential risk level caused by information released on public platforms such as social media and the Internet.

[0088] In a feasible implementation, the categories of accounts that publish texts to be processed may include at least one of customer accounts, competitor accounts, regulatory accounts, rights protection accounts, media accounts, personal accounts with large amounts of traffic, and personal accounts with no traffic; among which, the media risk level of regulatory accounts, rights protection accounts, and competitor accounts is level one; the media risk level of customer accounts, media accounts, and personal accounts with large amounts of traffic is level two; and the media risk level of personal accounts with no traffic is level three.

[0089] Step 207: Obtain a second weight corresponding to the media risk level.

[0090] In the embodiment of the present application, the weight corresponding to each media risk level may be pre-set, or may be determined based on the distribution of categories of multiple first keywords, or may be calculated using an AI algorithm.

[0091] The higher the media risk level, the greater the corresponding second weight; when the media risk level is level 1, the corresponding second weight is the highest. In this way, the influence of data from multiple dimensions on determining the emotional type of the text to be processed is taken into account, and the emotional type of the text to be processed is determined by obtaining the second weight corresponding to the media risk level and the first weight of the type to which the first keyword belongs, thereby improving the accuracy of subsequent determination of the emotional type of the text to be processed.

[0092] In a feasible implementation, the media risk level is set to three levels; wherein the weight corresponding to the first level is 0.7, the weight corresponding to the second level is 0.2, and the weight corresponding to the third level is 0.1.

[0093] Step 208: Calculate the multiple first weights and second weights to obtain a comprehensive target weight.

[0094] In an embodiment of the present application, multiple first weights can be screened to obtain screened first weights, and arithmetic operations can be performed on the screened first weights and second weights to obtain a comprehensive target weight; of course, arithmetic operations can also be performed directly on multiple first weights and second weights to obtain a comprehensive target weight; in this way, a variety of methods can be flexibly adopted to determine the comprehensive target weight, thereby improving the flexibility of determining the comprehensive target weight.

[0095] In a feasible implementation, multiple first weights can be screened to sum or average the screened first weights and second weights to obtain a comprehensive target weight; multiple first weights and second weights can be summed to obtain a comprehensive target weight; or multiple first weights and second weights can be averaged to obtain a comprehensive target weight; wherein the arithmetic operation includes summing or averaging.

[0096] Step 209: Determine the sentiment type of the text to be processed based on the comprehensive target weight.

[0097] In an embodiment of the present application, the comprehensive target weight and the weight threshold may be compared to obtain a comparison result, so as to determine the emotion type to which the text to be processed belongs according to the comparison result.

[0098] It should be noted that a naive Bayes model pre-trained based on a large number of sample keywords and sample keyword types can also be used. The first keyword and the type to which the first keyword belongs can be input into the naive Bayes model, so that the naive Bayes model can output the sentiment type to which the text to be processed belongs.

[0099] It should be noted that step 209 can be implemented through steps A1 to A2:

[0100] Step A1: When the comprehensive target weight is greater than or equal to the weight threshold, determine that the sentiment type of the text to be processed is a negative sentiment type.

[0101] Among them, the weight threshold can be determined according to the method adopted when calculating the comprehensive target weight.

[0102] In a feasible implementation, the weight threshold may be 1. When the comprehensive target weight is greater than 1 or equal to 1, it is determined that the sentiment type of the text to be processed is a negative sentiment type.

[0103] Step A2: When the comprehensive target weight is less than the weight threshold, detect whether the text to be processed contains the target character to obtain a detection result, and determine the emotion type of the text to be processed based on the detection result.

[0104] In an embodiment of the present application, when the comprehensive target weight is less than the weight threshold, it is necessary to further determine the emotion type of the text to be processed. Specifically, it can be to detect whether the target characters exist in the text to be processed to obtain the detection result, so as to further determine the emotion type of the text to be processed based on the detection result.

[0105] Among them, when the detection result indicates that the text to be processed does not contain the target character, the emotion type of the text to be processed is determined to be a positive emotion type; when the detection result indicates that the text to be processed contains the target character, it is necessary to further determine the emotion type of the text to be processed based on the target character.

[0106] It should be noted that, for the description of the same steps and the same contents in the embodiment of the present application as in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0107] The text analysis method provided in the embodiment of the present application can match the text to be processed based on a business keyword set and a sentiment keyword set to obtain a first keyword, and determine the sentiment type of the text to be processed based on a first weight corresponding to the type to which the first keyword belongs, thereby realizing automatic determination of the sentiment type of the text to be processed, eliminating the need to use manual analysis to determine the sentiment type, improving the efficiency and accuracy of determining the sentiment type, and solving the problem of low efficiency and low accuracy in determining the sentiment type in related technologies.

[0108] Based on the above embodiments, the embodiments of the present application provide a text analysis method, referring to Figure 3 As shown, the method comprises the following steps:

[0109] Step 301: Obtain the text to be processed.

[0110] Step 302: perform word segmentation on the text to be processed to obtain multiple words.

[0111] Step 303: Match the multiple words with the words in the business keyword set and the words in the emotional keyword set to obtain multiple first keywords.

[0112] Step 304: Classify the multiple first keywords based on the business demand information and determine the type to which each first keyword belongs.

[0113] The business demand information includes at least two of the following: publishing channel information, e-commerce platform information, service product information, publisher information, service link information corresponding to the product, and emotional tags.

[0114] It should be noted that steps 305 to 308 or steps 309 to 311 may be executed after step 304 .

[0115] Step 305: Determine a first weight corresponding to the type to which each first keyword belongs.

[0116] Step 306: Determine the media risk level based on the obtained source information of the text to be processed.

[0117] Step 307: Obtain a second weight corresponding to the media risk level.

[0118] Step 308: Calculate the first weight and the second weight to obtain a comprehensive target weight.

[0119] It should be noted that, after step 308 , steps 312 or 313 to 315 may be executed.

[0120] Step 309: Determine the media risk level based on the obtained source information of the text to be processed.

[0121] Step 310: Obtain a pre-trained sentiment classification model.

[0122] In the embodiment of the present application, the sentiment classification model may be obtained by pre-training sample keywords and types of sample keywords using a logistic regression algorithm.

[0123] In a feasible implementation, the sentiment classification model may be a logistic regression model.

[0124] Step 311: Use the sentiment classification model to determine the first weight corresponding to each type, the second weight corresponding to the media risk level, and calculate multiple first weights and second weights to output a comprehensive target weight.

[0125] In an embodiment of the present application, each first keyword, the type to which the first keyword belongs, and the media risk level can be input into the sentiment classification model, so that the sentiment classification model analyzes the first keyword, the type to which the first keyword belongs, and the media risk level, determines the first weight corresponding to the type to which each first keyword belongs, the second weight corresponding to the media risk level, and performs operations on the first weight and the second weight, and then the sentiment analysis model can output the comprehensive target weight; in this way, the first weight corresponding to each first keyword, the second weight corresponding to the media risk level, and the comprehensive target weight can be determined through the sentiment analysis model, thereby realizing the automated determination of the first weight and the second weight, improving the accuracy of the determined first weight and the second weight, and improving the efficiency of determining the comprehensive target weight.

[0126] In a feasible implementation, the sentiment classification model may sum the multiple first weights and the second weights to obtain a comprehensive target weight; the sentiment classification model may also average the multiple first weights and the second weights to obtain a comprehensive target weight.

[0127] It should be noted that step 312 or 313 to 315 may be executed after step 311 .

[0128] Step 312: When the comprehensive target weight is greater than or equal to the weight threshold, determine that the sentiment type of the text to be processed is a negative sentiment type.

[0129] Step 313: When the comprehensive target weight is less than the weight threshold, detect whether there is a target character in the text to be processed to obtain a detection result.

[0130] Step 314: When the detection result indicates that the text to be processed contains the target character, obtain a second keyword related to the target character from the text to be processed.

[0131] In the embodiment of the present application, the target character may be a character having an indicative meaning; the text analysis device may obtain a second keyword related to the target character from the text to be processed based on the position of the target character.

[0132] In a feasible implementation, the target character may be “@”; the second keyword may be a keyword adjacent to the @ character and located on the right side of the target character.

[0133] Step 315: Based on the second keyword, determine the emotion type to which the text to be processed belongs.

[0134] In an embodiment of the present application, the second keyword can be matched with a keyword representing a complaint channel, and the second keyword can be matched with a keyword representing the name of a target user, and the emotion type to which the text to be processed belongs can be determined based on the matching results.

[0135] It should be noted that step 315 can be implemented through steps B1 and B2:

[0136] Step B1: When the second keyword represents the complaint channel, determine that the sentiment type is a negative sentiment type.

[0137] In an embodiment of the present application, when the matching result represents that the second keyword matches the keyword representing the complaint channel, it is determined that the second keyword represents the complaint channel. At this time, the emotion type is determined to be a negative emotion type.

[0138] Step B1: When the second keyword represents the name of the target user and the number of third keywords representing negative emotions in the first keyword is greater than a target number threshold, determine that the emotion type is a negative emotion type.

[0139] The name of the target user may be the name of the company to which the product belongs.

[0140] In the embodiment of the present application, when the matching result represents that the second keyword matches the keyword representing the name of the target user, it is determined that the second keyword represents the name of the target user; the number of third keywords representing negative emotions in the first keyword can be detected based on the keywords representing negative emotions in the emotional keyword set. When the second keyword does not represent the name of the target user, and / or the number of third keywords representing negative emotions in the first keyword is less than or equal to the target number threshold, the emotional type is determined to be a positive emotional type.

[0141] In a feasible implementation, the target quantity threshold can be 1; the name of the target user can be the name of the logistics company; when the second keyword represents the name of the logistics company F and the number of third keywords is greater than 1, it is determined that the sentiment type of the text to be processed is a negative sentiment type.

[0142] Based on the foregoing embodiment, in other embodiments of the present application, the text analysis method further includes the following steps:

[0143] Step 316: Obtain a first business keyword and a first emotional keyword.

[0144] It should be noted that steps 316 to 318 may be performed before step 301; steps 316 to 318 may also be performed after step 301; of course, steps 316 to 318 and step 301 may also be performed simultaneously.

[0145] In the embodiment of the present application, the first business keyword and the first emotion keyword may be selected from a dictionary library or preset.

[0146] In a feasible implementation, for the logistics field, the first business keyword may be keywords such as cash on delivery and door-to-door pickup; the first emotional keyword may be keywords such as fast, slow delivery and fast delivery.

[0147] Step 317: Acquire a second business keyword associated with the first business keyword.

[0148] The service keyword set includes a first service keyword and a second service keyword. The second service keyword may be a service keyword in the words of the corpus that has a semantic association with the first service keyword, or a keyword in the words of the corpus that matches the first service keyword.

[0149] In the embodiment of the present application, the semantic association between the first business keyword and each word in the corpus can be calculated, and then the association greater than the first association threshold can be determined from multiple associations to obtain the first association, and the word corresponding to the first association in the corpus is used as the second business keyword. Of course, the matching degree between the first business keyword and each word in the corpus can also be calculated, and then the matching degree greater than the first matching threshold can be determined from multiple matching degrees to obtain the first matching degree, and the word corresponding to the first matching degree in the corpus is used as the second business keyword.

[0150] Step 318: Acquire a second emotion keyword associated with the first emotion keyword from the corpus.

[0151] The emotion keyword set includes a first emotion keyword and a second emotion keyword. The second emotion keyword may be a keyword in the words of the corpus that has a semantic association with the first emotion keyword, or a keyword in the words of the corpus that matches the first emotion keyword.

[0152] In the embodiment of the present application, the semantic association between the first emotional keyword and each word in the corpus can be calculated, and then the association greater than the second association threshold can be determined from multiple associations to obtain the second association, and then the word corresponding to the second association in the corpus is used as the second emotional keyword. Of course, the matching degree between the first emotional keyword and each word in the corpus can also be calculated, and then the matching degree greater than the second matching threshold can be determined from multiple matching degrees to obtain the second matching degree, and the word corresponding to the second matching degree in the corpus is used as the second emotional keyword.

[0153] The first relevance threshold and the second relevance threshold may be the same or different. The first matching threshold and the second matching threshold may be the same or different.

[0154] In a feasible implementation, a sentiment orientation pointwise mutual information algorithm (Semantic Orientation Pointwise Mutual Information, SO-PMI) can be used to determine the semantic association between the first sentiment keyword and each word in the corpus, so as to determine the second sentiment keyword from the words in the corpus.

[0155] It should be noted that in the embodiment of the present application, the emotional keywords in the existing dictionary in the prior art are not used to determine the emotional tendency of the text to be processed. The influence of business keywords on determining the emotional type of the text to be processed is taken into consideration, and the business keyword set and the emotional keyword set are reconstructed so as to determine the emotional type of the text to be processed based on the business keyword set and the emotional keyword set, thereby improving the accuracy of the determined emotional type of the text to be processed.

[0156] Moreover, the second business keyword is determined by determining the semantic association between the first business keyword and the words in the corpus, and a business keyword set is constructed based on the first business keyword and the second business keyword, thereby increasing the number of words in the constructed business keyword set, so that the first keyword related to the business can be extracted from the text to be processed based on the business keyword set in the future; the second emotion keyword is determined by determining the semantic association between the first emotion keyword and the words in the corpus, and an emotion keyword set is constructed based on the first emotion keyword and the second emotion keyword, thereby increasing the number of words in the constructed emotion keyword set, so that the first keyword related to emotion can be extracted from the text to be processed based on the emotion keyword set in the future. In this way, the first keyword can be fully extracted from the text to be processed by constructing a business keyword set and an emotion keyword set, thereby improving the comprehensiveness of extracting the first keyword, and further improving the accuracy of determining the emotion type to which the text to be processed belongs based on the first keyword in the future.

[0157] In the field of logistics, the text analysis method provided in the embodiment of the present application can help data analysts quickly screen out the texts to be processed related to logistics companies from the data of massive social platforms and determine the emotional type of the texts to be processed; among them, the emotional type of the texts to be processed can help data analysts quickly locate problems in the logistics service process.

[0158] It should be noted that, for the description of the same steps and the same contents in the embodiment of the present application as in other embodiments, reference can be made to the description in other embodiments and will not be repeated here.

[0159] The text analysis method provided in the embodiment of the present application can match the text to be processed based on a business keyword set and a sentiment keyword set to obtain a first keyword, and determine the sentiment type of the text to be processed based on a first weight corresponding to the type to which the first keyword belongs, thereby realizing automatic determination of the sentiment type of the text to be processed, eliminating the need to use manual analysis to determine the sentiment type, improving the efficiency and accuracy of determining the sentiment type, and solving the problem of low efficiency and low accuracy in determining the sentiment type in related technologies.

[0160] Based on the above embodiments, the embodiments of the present application provide a text analysis device, which can be applied to Figure 1 to Figure 3 In the text analysis method provided in the corresponding embodiment, refer to Figure 4 As shown, the text analysis device 4 may include a processor 41, a memory 42 and a communication bus 43;

[0161] The communication bus 43 is used to realize the communication connection between the processor 41 and the memory 42;

[0162] The processor 41 is used to execute the text analysis program in the memory 42 to implement the following steps:

[0163] Get the text to be processed;

[0164] Based on the business keyword set and the sentiment keyword set, the text to be processed is matched to obtain multiple first keywords;

[0165] Classifying the multiple first keywords to determine the type to which each first keyword belongs;

[0166] A first weight corresponding to each type is determined, and based on the multiple first weights, the sentiment type to which the text to be processed belongs is determined.

[0167] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42 to implement the following steps:

[0168] Obtain the first business keyword and the first emotional keyword;

[0169] Acquire a second business keyword associated with the first business keyword; wherein the business keyword set includes the first business keyword and the second business keyword;

[0170] A second emotion keyword associated with the first emotion keyword is obtained; wherein the emotion keyword set includes the first emotion keyword and the second emotion keyword.

[0171] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42, based on the business keyword set and the emotional keyword set, to match the text to be processed, and obtain multiple first keywords to implement the following steps:

[0172] Perform word segmentation on the text to be processed to obtain multiple words;

[0173] The multiple words are matched with the words in the business keyword set and the words in the emotional keyword set respectively to obtain multiple first keywords.

[0174] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42 to classify the multiple first keywords and determine the type to which each first keyword belongs, so as to implement the following steps:

[0175] Based on the business demand information, multiple first keywords are classified to determine the type of each first keyword; wherein the business demand information includes at least two of the publishing channel information, e-commerce platform information, service product information, publisher information, product corresponding service link information and emotional tags.

[0176] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42 to determine the emotion type of the text to be processed based on the multiple first weights, so as to implement the following steps:

[0177] Determine the media risk level based on the source information of the text to be processed;

[0178] Obtain a second weight corresponding to the media risk level;

[0179] Calculate the multiple first weights and second weights to obtain a comprehensive target weight;

[0180] Based on the comprehensive target weight, the sentiment type of the text to be processed is determined.

[0181] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42 to determine the emotion type of the text to be processed based on the comprehensive target weight, so as to implement the following steps:

[0182] When the comprehensive target weight is greater than or equal to the weight threshold, the sentiment type of the text to be processed is determined to be a negative sentiment type;

[0183] When the comprehensive target weight is less than the weight threshold, it is detected whether the text to be processed contains the target character to obtain a detection result, and based on the detection result, the emotion type to which the text to be processed belongs is determined.

[0184] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42 to determine the emotion type of the text to be processed based on the detection result, so as to implement the following steps:

[0185] When the detection result indicates that the text to be processed contains the target character, obtaining a second keyword related to the target character from the text to be processed;

[0186] Based on the second keyword, the sentiment type of the text to be processed is determined.

[0187] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42 to determine the emotion type of the to-be-processed text based on the second keyword, so as to implement the following steps:

[0188] In the case where the second keyword represents the complaint channel, the sentiment type is determined to be a negative sentiment type;

[0189] When the second keyword represents the name of the target user and the number of third keywords representing negative emotions in the first keywords is greater than the target number threshold, the emotion type is determined to be a negative emotion type.

[0190] In other embodiments of the present application, the processor 41 is used to execute the text analysis program in the memory 42 to determine the first weight corresponding to each first keyword, and based on the multiple first weights, determine the emotion type to which the text to be processed belongs, so as to implement the following steps:

[0191] Determine the media risk level based on the source information of the text to be processed;

[0192] Get a pre-trained sentiment classification model;

[0193] Using a sentiment classification model, determining a first weight corresponding to each type, a second weight corresponding to a media risk level, and performing operations on a plurality of first weights and second weights to output a comprehensive target weight;

[0194] Based on the comprehensive target weight, the sentiment type of the text to be processed is determined.

[0195] It should be noted that the specific implementation process of the steps executed by the processor in this embodiment can refer to Figure 1 to Figure 3 The implementation process of the text analysis method provided in the corresponding embodiment will not be repeated here.

[0196] The text analysis device provided in the embodiment of the present application can match the text to be processed based on a business keyword set and a sentiment keyword set to obtain a first keyword, and determine the sentiment type to which the text to be processed belongs based on a first weight corresponding to the type to which the first keyword belongs, thereby realizing automatic determination of the sentiment type to which the text to be processed belongs. There is no need to use manual analysis to determine the sentiment type, thereby improving the efficiency and accuracy of determining the sentiment type, and solving the problem of low efficiency and low accuracy in determining the sentiment type in related technologies.

[0197] Based on the above embodiments, the present application provides a text analysis device, which can be applied to Figure 1 to Figure 3 In the text analysis method provided in the corresponding embodiment, refer to Figure 5 As shown, the text analysis device 5 includes:

[0198] An acquisition unit 51 is used to acquire the text to be processed;

[0199] A processing unit 52 is used to match the text to be processed based on the business keyword set and the emotional keyword set to obtain a plurality of first keywords;

[0200] The processing unit 52 is further used to classify the multiple first keywords and determine the type to which each first keyword belongs;

[0201] The processing unit 52 is further configured to determine a first weight corresponding to each type, and determine the emotion type to which the text to be processed belongs based on the multiple first weights.

[0202] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0203] Obtain the first business keyword and the first emotional keyword;

[0204] Acquire a second business keyword associated with the first business keyword; wherein the business keyword set includes the first business keyword and the second business keyword;

[0205] A second emotion keyword associated with the first emotion keyword is obtained; wherein the emotion keyword set includes the first emotion keyword and the second emotion keyword.

[0206] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0207] Perform word segmentation on the text to be processed to obtain multiple words;

[0208] The multiple words are matched with the words in the business keyword set and the words in the emotional keyword set respectively to obtain multiple first keywords.

[0209] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0210] Based on the business demand information, multiple first keywords are classified to determine the type of each first keyword; wherein the business demand information includes at least two of the publishing channel information, e-commerce platform information, service product information, publisher information, product corresponding service link information and emotional tags.

[0211] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0212] Determine the media risk level based on the source information of the text to be processed;

[0213] Obtain a second weight corresponding to the media risk level;

[0214] Calculate the multiple first weights and second weights to obtain a comprehensive target weight;

[0215] Based on the comprehensive target weight, the sentiment type of the text to be processed is determined.

[0216] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0217] When the comprehensive target weight is greater than or equal to the weight threshold, the sentiment type of the text to be processed is determined to be a negative sentiment type;

[0218] When the comprehensive target weight is less than the weight threshold, it is detected whether the text to be processed contains the target character to obtain a detection result, and based on the detection result, the emotion type to which the text to be processed belongs is determined.

[0219] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0220] When the detection result indicates that the text to be processed contains the target character, obtaining a second keyword related to the target character from the text to be processed;

[0221] Based on the second keyword, the sentiment type of the text to be processed is determined.

[0222] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0223] In the case where the second keyword represents the complaint channel, the sentiment type is determined to be a negative sentiment type;

[0224] When the second keyword represents the name of the target user and the number of third keywords representing negative emotions in the first keywords is greater than the target number threshold, the emotion type is determined to be a negative emotion type.

[0225] In other embodiments of the present application, the processing unit 52 is further configured to perform the following steps:

[0226] Determine the media risk level based on the source information of the text to be processed;

[0227] Get a pre-trained sentiment classification model;

[0228] Using a sentiment classification model, determining a first weight corresponding to each type, a second weight corresponding to a media risk level, and performing operations on a plurality of first weights and second weights to output a comprehensive target weight;

[0229] Based on the comprehensive target weight, the sentiment type of the text to be processed is determined.

[0230] It should be noted that the specific implementation process of the steps performed by each unit in the embodiment of the present application can be referred to Figure 1 to Figure 3 The implementation process of the text analysis method provided in the corresponding embodiment will not be repeated here.

[0231] The text analysis device provided in the embodiment of the present application can match the text to be processed based on a business keyword set and a sentiment keyword set to obtain a first keyword, and determine the sentiment type to which the text to be processed belongs based on a first weight corresponding to the type to which the first keyword belongs, thereby realizing automatic determination of the sentiment type to which the text to be processed belongs. There is no need to use manual analysis to determine the sentiment type, thereby improving the efficiency and accuracy of determining the sentiment type, and solving the problem of low efficiency and low accuracy in determining the sentiment type in related technologies.

[0232] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement Figure 1 to Figure 3 The corresponding embodiments provide steps of the text analysis method.

[0233] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.

[0234] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0235] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0236] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods 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, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0237] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0238] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0239] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0240] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A text analysis method, characterized in that: The method comprises: Get the text to be processed; Based on the business keyword set and the emotional keyword set, the text to be processed is matched to obtain a plurality of first keywords; Classifying the multiple first keywords to determine the type to which each first keyword belongs; A first weight corresponding to each type is determined, and based on the multiple first weights, the emotion type to which the text to be processed belongs is determined.

2. The method according to claim 1, characterized in that The business keyword set and the emotional keyword set can be obtained in the following manner: Obtain the first business keyword and the first emotional keyword; Acquire a second business keyword associated with the first business keyword; wherein the business keyword set includes the first business keyword and the second business keyword; Acquire a second emotion keyword associated with the first emotion keyword; wherein the emotion keyword set includes the first emotion keyword and the second emotion keyword.

3. The method according to claim 1, characterized in that The text to be processed is matched based on the business keyword set and the emotional keyword set to obtain a plurality of first keywords, including: Performing word segmentation processing on the text to be processed to obtain multiple words; The multiple words are matched with the words in the business keyword set and the words in the emotional keyword set respectively to obtain the multiple first keywords.

4. The method according to claim 1, characterized in that The classifying the plurality of first keywords to determine the type to which each first keyword belongs includes: Based on the business demand information, the multiple first keywords are classified to determine the type of each first keyword; wherein the business demand information includes at least two of the publishing channel information, e-commerce platform information, service product information, publisher information, service link information corresponding to the product, and emotional tags.

5. The method according to claim 1, characterized in that The step of determining the emotion type of the text to be processed based on the multiple first weights includes: Determining a media risk level based on the obtained source information of the text to be processed; Obtaining a second weight corresponding to the media risk level; Obtaining a comprehensive target weight according to the plurality of first weights and the second weight; Based on the comprehensive target weight, the sentiment type of the text to be processed belongs to is determined.

6. The method according to claim 5, characterized in that Determining the sentiment type of the to-be-processed text based on the comprehensive target weight includes: When the comprehensive target weight is greater than or equal to the weight threshold, determining that the sentiment type of the to-be-processed text is a negative sentiment type; In the case that the comprehensive target weight is less than the weight threshold, it is detected whether the text to be processed contains the target character to obtain a detection result, and based on the detection result, the emotion type to which the text to be processed belongs is determined.

7. The method according to claim 6, characterized in that Determining the emotion type of the text to be processed based on the detection result includes: When the detection result indicates that the text to be processed contains the target character, obtaining a second keyword related to the target character from the text to be processed; Based on the second keyword, the emotion type to which the text to be processed belongs is determined.

8. The method according to claim 7, characterized in that The step of determining the emotion type of the text to be processed based on the second keyword includes: In the case where the second keyword represents a complaint channel, determining that the emotion type is a negative emotion type; When the second keyword represents the name of the target user and the number of third keywords representing negative emotions in the first keywords is greater than a target number threshold, the emotion type is determined to be a negative emotion type.

9. A text analysis device, characterized in that: The device comprises: An acquisition unit, used for acquiring text to be processed; A processing unit, configured to match the text to be processed based on a business keyword set and an emotional keyword set to obtain a plurality of first keywords; The processing unit is further used to classify the multiple first keywords and determine the type to which each first keyword belongs; The processing unit is further used to determine a first weight corresponding to each type, and based on multiple first weights, determine the emotion type to which the text to be processed belongs.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the text analysis method according to any one of claims 1 to 8.