{'fraction_non_alphanumeric': 0.026654346435425403, 'fraction_numerical': 0.005828417087213021, 'mean_word_length': 4.601114649681529, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Analysis of the Passion Criminal Tendencies Based on the Topic-Emotion Model

With the penetration of the Internet into daily life, more and more crime clues could be discovered on the Internet. Therefore, this paper uses a new method to predict whether the instant message on the internet has the tendency of emotional crime. It is because that the single theme-based analysis of criminal tendency, which ignores the impact of emotions, may confound the declarative sentences and normal expression with statements that contain criminal tendencies. The method used in this study introduces the analysis of emotional fluctuations while analysing themes. In order to solve the problems above, the study adopts seq2seq model to analyse emotional fluctuation. Themes and the values of emotional fluctuation are put into linear SVM as input vector to judge whether the instant message has an emotional crime tendency. The average predication accuracy of the model reached 86%, which basically accords with the assumption made before the experiment. This model can not only be used to analyse emotional crime, but also to screen the radical opinions on the internet.


Introduction
Text Data Mining is a process to understand the content and meanings by analyzing texts with rich semantics. It has become an increasingly popular and important research field in the data mining domain.
Instant messages on the Internet are one of the fastest growing social ways. The Internet has replaced texts and become the main way to spread the news. In such a complex network environment, various potential problems are also derived. For example, the frequency of cyberbullying and cybercrime are increasing year by year. The number of users on the Internet is huge: as far as QQ is concerned, according to the official website, the average number of online users during prime time (18:00-19:00) exceeds 300 million [1]. Such a large amount of user traffic is inevitably accompanied with a large number of instant information records. However, there's no perfect solution of obtaining useful information by analyzing instant message so far.

Issue Raised
The author before [2] classifies the conversation reply into two types, the short response waiting for time class-SRWTC and long response waiting time class-LRWTC. He claims that he can predict response time by analyzing conversation content. In another passage [3], the author establishes classification system that creates a concept-based profile, which represents a summary of the topics, discussed in a chat room or by an individual participant and determines the subject of the conversation texts by analyzing interactive texts. However, there is no further way to analyze emotions in the passages.
In the previous study, the researchers have made an effective analysis of the relationship between conversation topics and criminal tendency [4]. However, the accuracy is low. For example, a conversation may involve the topic of guns and ammunition. If the analysis of this conversation just considers about the topic, it is more likely that the conversation is involved in the field of crime. However, if we analyze the content, it is also possible that the conversation simply discusses the relevant knowledge in a plain tone. In the definition of safe cybercrime [5], it can belong to criminal offense only if the cybercriminals realize that their behavior will cause the result of jeopardizing national security and hope the danger happens. And if an individual is in a state of negative passion and stress, it is easier to cause criminal behavior [4].
In this article, in addition to analyzing the topic of the texts [6] [7], it also introduces the analysis of conversational sentiment [8] [9]. This article mainly analyzes local conversation which consists of instant message and finds out the relationship between topics and sentiment value (use the sentiment dictionary [10] and NN model) according to the result of an analysis [11]. Then we can analyze whether the content of the conversation has a criminal tendency. After the emotional extremes are introduced in the local conversation analysis which consists of instant messages between two people, the results of the text analysis can be expressed as the difference of sentiment value between A and B on the X topic. For example, if the emotional extreme value is high when A and B talk about guns, we can infer that the conversation is involved in the crime field.

Terminology and Definitions
There are several features of conversations generated from instant messages: each message is labelled with sender and timestamp, so chat record could be represented as a set of messages. For example: in chat record   . As a result, we choose interval times that lie at 95 percentiles to represent max t , as in equation (1), which is regarded as the condition of segmenting chat record into local conversations. Besides, the mean of all interval times in a chat record excluding interval times lie at 95 percentiles and above, is regarded as the condition of single conversation, recorded as t  , as in equation (2).

Local Conversation:
The set of messages that sent by both sides. Generation rule: First, get all the t  of the chat record and check each t  from the beginning of the record. If max tt  , regard the message before the interval as the end of the last local conversation, and regard the message after the interval as the beginning of the next new local conversation.

Single Conversation:
A complete sentence with subject and predicate generated by one side of chatters. A turn could be constructed by one or several messages.

An
Turn is the th n turn produced by A. The generation method is written in part 4.1

Turn:
A set of instance message generated by both sides of chatters in short term, (the single conversation is the subset of the local conversation; local conversation is composed of several single conversations). Generation rule: First, get all the t  of the local conversation, and check each t  from the beginning of the record. If tt    , regard the message before interval as the end of last single conversation, and regard the message after the interval as the beginning of the next new single conversation.
i SC means the th i single conversation in the local conversation. 3.1.9. Sentiment n : The sentiment value produced by A in local conversation by using seq2seq model.

Constraint of Research
The same point between turn and short text is that their numbers of words are small. However, there are also some differences between the above two. Firstly, as more and more turns cumulate, the sentiments of the speaker may change a lot, they may change their emotion from happy to sad. Comparing with this, the short text is usually with a single emotion. Secondly, the short text is always with a personal idea or one theme, but the dialogue made up by instant message (local conversation) can represent two persons' or even several people's communicational relationship, so a local conversation can either be related to one theme or several themes. The two uncertainties above bring a lot of difficulties for the analysis of local conversations. What's more, it is inaccurate to get the specific themes by only analyzing one person's dialogue. It is better to consider the time sequential and the themes of one turn to get an accurate theme or several accurate themes of one local conversation. This paper limits the number of persons in the local conversation to 2.

The process of the generation of theme model
The original input of the model is a local conversation, which includes pure texts (excluding pictures, emoticons and etc.) sent by two participants, timestamps and usernames along with each message. As figure 1 shows, to get the themes of the input, the model starts with breaking up the local conversation into a number of single conversations according to the definition (using the interval time calculated by timestamps of adjacent messages). Then, using the word segmentation tool to get a set of words of every single conversation. After this, KNN algorithm is applied. Use the occurrence frequency of every word in the single conversation to create a vector which represents the single conversation. And regard the vector as the input of KNN algorithm to get the theme of each single conversation. Last, the theme set of local conversation is collected by gathering all the themes together.  Figure 2 shows the construct of the sentiment-text tree. Since this paper will analyse the sentiment value of A and B respectively, we divide the local conversation into the sets of turns of A and B respectively. As 3.3 shows, the words have research value only when they are put into a single turn. So firstly, we divide the sets of turns of A and B to several turns. And secondly, we split the turns into words (We analysis all of the words in units of turns). Thirdly, we generate the sentiment value of the single turn by using the model shown in the right model in figure 3. Finally, we generate the final sentiment value of Turn A by calculating the mean of sentiment values of Turn i A .

Label theme for lines:
To obtain the original corpus, we crawled subtitles of movies which belong to 6 themes: criminal, shopping, daily, food, hospital, travel. Of each theme, there are 5 subtitle files of movies or teleplays. And labelled those subtle files with 6 themes and take them as the training set.

Generation of sentiment dictionary:
This paper gets the complete sentiment dictionary by crawling data from comments of Amazon and T-mall, the steps are as followed: • Get the score of comments and cut the comments into words.

•
Make the scores as the input values, make the comments sentences as tags and put scores into CNN model, quantify the weight of words of different sentiment and generate a preliminary sentiment dictionary • Integrate the preliminary sentiment dictionary into the existing sentiment dictionary, calculate the mean of the weight of words which both exists in the preliminary sentiment dictionary and existing sentiment dictionary; add the non-existing words into sentiment dictionary.

Sentence construction and word segmentation:
Since the conversation may be informal, it is possible that a message sent by chatter would be an incomplete sentence. So; we have to group the scattered message into a turn. First, put together all the messages sent from one side. Then use the dependency analysis method from HANLP [12] to analyse the sentence elements grammatically. Last, according to the position of subjects, we separate turns from the message aggregate.

Generation of KNN model for theme analysis:
• Segment sentence in the training set into words, then generate a word frequency library by calculating the relative word frequency. • Rank words that appear in the training set by relative word frequency and choose the top 100 words to constructing 30 vectors of 100 Dimensions to represent training set. Each dimension is valued by the word's frequency. At last, use those vectors to generate the KNN model.

Generation sentiment vector for sentiment analysis:
• Generation of local conversation: Since the number of characters in movie or TV series is a lot, which is the same as group chat, to meet the limit of our research, this paper chooses two persons with the most interaction as the two sides of conversation and makes the lines as local conversation, then makes the two persons' dialogue as two turns. • Analysis the sentiment value of two person's turns (1) Taking "turn A" as an example, make turn A as a list and every element of the list is a complete turn.
(2) Cut the words for "turn A", remove the stop words and calculate the sentiment value i x for every turn by using equation 3 ( i is the th i sentence, n is the number of negative words, m is the sentiment weight of the word, j is the th j word in one sentence). (1) seq2seq:Taking one side of local conversation "A" as an example, firstly, we use formula 1 to calculate t x , before this we have already calcuated the sentiment value of Turn −1 as  ( c is the correction factor to prevent model from divergence). Analysising B is the same as analysising A.
(2) CNN&NN: Taking one side of local conversation "A" as an example, firstly, we use formula 1 to calculate t x , then we input t x to the two formula:

( )
tt cnn When 0 t x = , the two models have no output value.
We use seq2seq, CNN and NN model to generate three polyline charts, compare them with the standard polyline chart and the results are as followed:     Figure 8 is the enlarged version of figure 7.
As figure 8 and 9 show, the output of NN model and CNN model diverge; as all of the figure above show, the output of seq2seq is the most stable and accurate one. Table 1 shows the standard deviation and the recall rate of the three models.

Analysis of criminal tendency
Firstly, we put the training data on the label "whether it is a crime-themed conversation"; secondly, we use seq2seq model to calculate the sentiment value, KNN model to calculate the themes of local conversation. We bring the sentiment value and the number that the local conversation's crime subject relevance is greater than 3 as two dimensions into the SVM classifier. From the SVM classifier, we know the "sentiment value" and "the number of themes associated with criminal in a chat" in a chat with "high criminal tendency". Finally, we put the validation data on the label "whether it is a crime-themed conversation" according to the classifier (1 for YES and 0 for NO) and calculate the accuracy of the model. The result is as followed:

Conclusion
In this paper, the accuracy of the final criminal tendency analysis reached 86%. Because the sample data of the training set is not enough, some topics of the new subtitles cannot be correctly classified. In the future study, we will increase the amount of sample data, which requires us to further improve the efficiency of the algorithm and apply distributed computing on this algorithm, etc.