• Nu S-Au Găsit Rezultate

View of Mental Health Monitoring Using Sentimental Analysis

N/A
N/A
Protected

Academic year: 2022

Share "View of Mental Health Monitoring Using Sentimental Analysis"

Copied!
8
0
0

Text complet

(1)

Mental Health Monitoring Using Sentimental Analysis

Dr. J. Godwin Ponsam1, S.Sheeba Rachel*2

1Assisstant Professor, Department of Information Technology, SRM Institute of Science and Technology, Kattankulathur, India

2 Assistant Professor, Department of Information Technology, Sri Sairam Engineering College, Chennai,

India

*[email protected]

ABSTRACT

Mental health is an indicator of psychological, social and emotional well- being of an individual. Almost all parts of society is affected by the underlying and unnoticed mental disorders. Popular social networking websites can play a major role in detecting these dangerous psychological patterns. The sequence of mental disorders around the globe can show the thoughts and felling of individuals . According to recent studies and the reports of WHO, almost 70% of world’s population is suffering from some kind of mental disorder and it sums upto a remarkable number. Health systems however have not responded adequately to burden of mental disorder. More than half of the population doesn’t have proper knowledge of the topic and those who know do not have a proper system to deal with it. A lot of enhancement in health care system is the need of time along with better awareness programs .People with mental health illness require adequate knowledge, social support and care.

This paper targets twitter as a platform to find the pattern of mental illnesses. Sentiment analysis method is used to find different behavioral patterns in diverse classification of mental disorders . To tackle the growing problem we present a new approach by focusing on the analysis of various disorders by using the respective hash tags on twitter. Neural network algorithms like CNN and front end application to depict the output is proposed using react as front end with REST APIframework

.

Keywords

CNN, REST API, Sentiment analysis

1. Introduction

1.1 What is MentalHealth

Mental Health constitutes of social, psychological and emotional well-being of an individual .In technical terms it can also be defined as lack of mental illness. The basic human functions like thinking, feeling and acting accordingly are affected by the mental well being of an individual. It also helps in determining how we handle stress, make choices and relate to others. Someone who is functioning at a satisfactory level of emotional and behavioral adjustment can be termed as mentally healthy person

1.2 MentalDisorders

Mental disorders or mental illnesses are the conditions that cause impairment of human functioning. These psychiatric disorders cause significant change in behavioral and mental patterns leading to number of different issues. The causes of these disorders however are still a field of research. Mental illness constitutes a wide range of conditions affecting behavior, mood and social performance of an individual. Some of the examples include depression,

(2)

2. Literature Review

Sentiment analysis usingNLP

Most of Natural Processing Operation requires, sentiment analysis. Deep Learning manages this task quite effectively and efficiently. Xi Ouyang[1] uses CNN and Word2Vec to develop aframework.Convolution Neural Network needs input to work on. In order to prepare the input Pan Zhou[2] proposed Word2Vec to present Vector Representation. This Vector representation will improve our network’s efficiency . The Word2Vec is targeted to create Vector Representation. Cheng Hua Li[1] used three channels of convolution layers. Dropout technique is used to improve the efficiency of themodel.Analysis of these sentiments is one of the important techniques that tells how humans deals with the textual content/information. If the complexities and errors are reduced sentiment analysis is way helpful. In our project we used sentiment analysis to analyze the sentiment of tweets which can be further used to analyze mental health.

Many places, Deep Learning technique has been used to to analyze text and has been found that it is giving better result. Socher[10] has used Recursive Neural Network, to demonstrate the movie reviews. He used Parse Trees for doing so. There were some demerits in this technique. Parse Tree has nodes, which are in fact the words, or collection of the same.

Getting the Labels of each sentence as well as getting labels of each words, this makes up the huge data. In the case where dataset is too big , labeling will be difficult task. This was the reason why this technique is not preferred , when the dataset is too big. In that case , Convolution Neural Network comes out to be handy. It has less connection as compared to other Neural Network. Convolution Neural Network as shown great success in classification Problem, like the success of the Image net Classification which involved Conv-Nets[1]. In CNN we just need to label the whole sentence instead of going word by word. Simply using one Deep Learning method will not give efficient result. Word2Vec is used along with it, which is neural net and prepares the text and processes it before it is used in any kind of algorithm.

3. Proposed Methodology 3.1 Preprocessing of thetext

Removing of unwanted symbols, which is nothing but getting the text prepared which would not effect or cause errors during the training of the model. For this purpose Word2Vec functionality is used.Word2Vec is implemented from genism module. It is used basically to train word vectors.Word2vec is used to find interdependency between words inthe corpus.

Word2Vec allows the words having same meaning to have same Vector Representation.

Let's consider in this project while we are giving keyword to extract tweet and the keyword or hashtag value is Depression then th vector model will contain all the instances as that of

"sad", "unhappy" etc. All these instances will be in the same model. We have also used regiular expressions to remove unwanted. This entire process of cleaning the dataset and getting it ready for the next step is Normalization.

(3)

3.2Tokenization of thetext

Tokenization is basically getting the objects of the dataset ( hereit is sequence of letters or characters), and converting to tokens. These tokens can be processed easily thereafter. Here words in the dataset or that are being extracted are referred to astokens.

Here KerasTokenizer is used which provides many inbuilt functionality to get the text ready.

This helps to add padding in the input data . Padding helps to have all the inputs of same length

3.3 Implementing CNNModel

CNN is a collection of deep, forward neural networks ( cycle is not performed after the connection between nodes) & uses a variety of different layer perceptrons which requires minimum amount of preprocessing. These are taken from visual cortex.

CNN architecture used for text processing. It begins with an input sentence split up into word embeddings: low-dimensional representations computed by models like word2vec.Convolution Neural Network needs input to work on. In order to prepare the input proposed Word2Vec to present Vector Representation. This Vector representation will improve the performance of the neural model. The main objective of using Word2Vec is : create Vector Representation. Cheng Hua Li used three channels of conv2d layers and even Pooling operation in the model.

Words are split up into features and simultaneously passed into the convolutional layer. After that result obtained from convolution are "Pooled" and then combined to a representative number.

Convolutions grows a greater “receptive field” as multiple layers are combined. Thisimplies that each action in the conv portraysmange.py file which includes all of the object that are going into it, i.e. prior and post to it.

Here, we have developed a Convolution Neural Network, where the entire preprocessed data is passed into, CNN is part of DeepLearning which belongs to section of Neural Network which is said to be Artificial. Basically CNN is applied to images , but in our case we have got after preprocessing and cleaning.

Convolution is basically applying a function to the matrix, the function can be sliding function. The concept of Convolution Neural Network involves joining of neurons in one section to other objects in the layer which is post to it.

As we get vectors which are pre-trained from word2vec, convolution neural network will be trained. In this paper 2d conv layers and pooling operations are used which are applied to layers. The main objective of convo is to get the input characterstics. The main objective of pooling is to get the conv matrix. As the model is trained drop-out is one of the important technique in the operation. In our case instead of images in each layer, the input is sentences represented as Matrix. Rows of each matrix represent a word, which is also calledVector.

In NLP filters are used over the entire over Row, which is word embedding. On Multiple Convolution Layers activation functions are applied in our model. In our case Relu and Sigmoid are used as Activation function, applied on the convolution layer. The characterstics of each neuron include bias, weight and If neural network will not have activation function , it will be nothing but a Linear Regression Model.

(4)

One of the important parameter or object of Covolution Neural Network are Pooling Layers used after the convolution layer. After the filter is applied to the layers, pooling is done by applying max operation on the output of each filter. As soon as Pooling is applied computation is reduced. It provides fixed size to the outputmatrix.

A pooling layer is a unique layer joinedas son as the model layers are formed. Pooling operation involved in Pooling, mostly like a filtering technique which is applied to feature objects that are obtained as map.

Pooling is basically used for classification in this case. After the Neural Network Model is made ,Overfittig is to be avoided. To avoid Overfitting , Dropout is used.

Value of dropuputis given as parameter, mostly the value is between 0.2 to 0.8. The value which we have given i 0.3, it prevents the model from being overfitting. Maximum Pooling :Usedto Calculate the highest value for each object of the inptcharacterstic obtained

Whenever there is translation of the input, pooling helps to make representation invariant.

After Using Dropout Dense Layer is added to the model, with an activation function. The ActivationfunctionusedisSigmoid.Sigmoidisnonlinearactivationfunction.Sigmoid

hasthevaluebetween0and1.Sincetherearemultipleneuronsinthemodel,thefinal

output after using the Sigmoid Activation Function is non linear. The expression for Sig Act^nFunc is:

f(x) -> 1/(1+e^-x)

If Act^nFunc is not used , model would only be able to perform linear mapping between the two variables. Using the Sigmoid activation function it would provide non linear property to the entire model.

Later on after the model is trained and layers are embeded in the model, Metric function is used. To check the performance of the model metric function is used.

There are many types of Metric function like: 1.Accuracy

1. Binary Accuracy 3.sparse_categorical_accuracy 4.categorical_accurac The metric function used in our model in to check the accuracy of the model is Accuracy Metric

Sequential Model : It basically has layers which are linearly sacked. It has one of the important method which is compile. The parameters are1. Loss 2.Optimizer 3.Metric Loss Function used is:

BCE :

Binary Cross Entropy checks how much difference is there between the actual value and guessed value on basis of inputs. Prediction made for each classes. To get the final loss , average of the losses is taken. Final loss tells exact value of difference between actual value ad predicted value. It is also called Sigmoid Cross EntropyLoss.

Equation:

BCE , because it is used problems which are binary. Pipeline is created for each of the classes of the model.Finally the loss is summed up and change is made accordingly. Pipeline is created for each of the classes.Finally the the model is saved as .h5 file and tokenizer as .pkl file

(5)

Backend

For backend, Django is used to develop. Django basically uses the logic of "views". It encapsulates the concept responsible for executing user request and then simultaneously return the response. Therefore any request received at the server is executed and processed at tis location.n order to connect to the views, urls.py is used. There is particular structure pattern that is followed while creating file of Django.

The structure of files are as follows:

1. Manage file: It is generated whenever any Django Project. It sets the environment variable which points to the settings. py file. It is command lineutility

2. init.py: It is basically vacant file which initiates that which particular files should be directedto.

3. settings.py: It has module levelvariables.

Settings is assigned dynamically using normal python syntax.

4. urls.py: It has url declaration for the project. It has table of content for django supported webpage or website. Django helps to designURLs.

There is complete process how Django executes or processes a request. It checks for root url- config to use. Incoming HTTP request has urlconf attribute, its value is replaced. As soon as the url pattern is matched ,Django imports and simultaneously calls the view. An instance of HTTP request is one of the important parameters. If no URL pattern is matched Django uses error handling to catch in that case.

5. wsgi.py: Web Server Gateway Interface, allows web servers to forward request to web application or framework written in python. Application callable is one of the important concept of WSGI which helps the server to communicate with the code. It basically exposes application callable as module levelvariable.

The path to the application callable is obtained by the WSGI server from the configuration.

There is runserver command in Django built in server, which reads from WSI app setting. It wraps up the application object .Django uses default views and templates forseveral

HTML codes(eror codes).

TWEEPY:

Twitter is the source of data. In order to get tweets , we use tweepy. Twitter has an API. Credentials are required to accesss. This is the first step.Twiiter user account is the first requirement. Then we get the developer account.

The important credentials in order to use the developer account are:

1. Cons_K 2. Cons_Sec

(6)

3. AccesibleTokens 4.Accessible_token_sec tweepy.OAuthHandler has cons key and cons secret as the argument.In order to obtain tweets we use the cursor function. A customised hashtags is used in order to get the tweets, which is obtained from the frontend.We have used filter:retweets so that we can get only unique tweets. if not done so then labels of the sentiments will get biased because of variable frequency ofthe retweets.req.getter.set("tokoen-sync:regen",np, modes=ext’.

Figure (i) FlowDiagram

4. Implementation Results

5. CONCLUSION

Sentiment analysis being one of the most researched topics of time leads a way to multiple domains and researches .It can specifically play an important role in medical science. As we

(7)

started this project with an idea of targeting one of the most ignored yet important type of issue, mental health. This word when is brought into discussion , often leads to one common point, The need to understand and work on the problems init.

The application we created has been one of the best solutions to analysis of sentiments on a common and one of the most widely used public platform .Instead of just creating an application and analyzing twitter, we channel the idea to a more wider domain of mental health.It can help various organizations to determine how their approaches to resolve issues and the common programs affect the mass. The sentiments based on hashtags can be determined with utmost accuracy multiple benefits can be drawn out of it. User along with creating an analysis can also see the proper meaning and description of the hashtags and can see fes examples tweets for getting an idea. In this was our application becomes one of the most user friendly applications available and could be used by a wide domain of users. From professionals to naïve people.

REFERENCES

[1] Sentiment Analysis Using Convolutional Neural Network Authors:Xi Ouyang , Pan Zhou School of Electronic Information and Communications Huazhong University of Science

&Technology INSPEC, Accession Number: 15681318 DOI:

10.1109/CIT/IUCC/DASC/PICOM.2015.349

[2] Mikolov T, Chen K, Corrado G, et al, “Efficient estimation of word representations in vector space,” arXiv preprint arXiv:1301.3781,2013.

[3] Survey of Sentiment Analysis Using Deep Learning Techniques, Author: M.

IndhraomPrabha ; G. UmaraniSrikanth, INSPEC Accession Number:18761334 DOI: 10.1109/ICIICT1.2019.8741438

[4] Text categorization using WordNet. Authors: JumiSarmah ; Anup Kumar Barman ; Shikhar Kr. Sarma, INSPEC Accession Number: 13861082 , DOI:

10.1109/ICACCI.2013.6637151

[5] A User Profile Modeling Method Based on Word2Vec , Authors: JianqiaoHu ; Feng Jin ; Guigang Zhang ; Jian Wang ; Yi Yan DOI: 10.1109/QRS-C.2017.74g INSPEC Accession Number:17098551

[6] Controlled dropout: A different approach to using dropout on deep neural network , Author: ByungSooKo; Han-Gyu Kim ; Kyo-Joong Oh ; Ho-JinChoi, INSPEC Accession Number: 16758407 , DOI: 10.1109/BIGCOMP.2017.7881693

[7] Natural language processing textualizing , Author:A. Gelbukh, INSPEC Accession Number: 8846012, DOI:10.1109/ICHIS.2005.79

[8] Activation functions and their characteristics in deep neural networks, INSPEC Accession Number: 17898364, DOI:10.1109/CCDC.2018.8407425

[9] Variable Convolution and Pooling Convolutional Neural Network for Text Sentiment Classification, Author: Min Dong ; Yongfa Li ; Xue Tang ; JingyunXu ; Sheng Bi ; Yi Cai INSPEC Accession Number: 19313523, DOI:10.1109/ACCESS.2020.2966726

[10] F. Andry, L. Wan, and D. Nicholson, “A mobile application accessing patientshealth records through a rest api,” in HEALTHINF 2011 INTERNATIONAL CONFERENCE ON HEALTH INFORMATICS, 2011, pp.27–32.

[11] J. Godwin Ponsam and R. Srinivasan, "Secure key Management Scheme for MANET", European Journal of scientific engineering Research, vol. 38, no. 4, April 2016.

[12] J. Godwin Ponsam and R. Srinivasan, "Trust Management scheme for

(8)

[13] J. Godwin Ponsam and R. Srinivasan, "Multilayer Intrusion Detection in MANET", International Journal of Computer Applications, vol. 98, no. 20, 2014.

[14] J. Godwin Ponsam and R. Srinivasan, "A survey on MANET Security Challenges Attacks and its countermeasures", International Journal of Emerging Trends and Technology in Computer Science, vol. 3, no. 1.2012

Referințe

DOCUMENTE SIMILARE

public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {.

Results obtained reveal the reliability and good predicatively of neural network model for the prediction of the size of Ag-NPs in green method.. (Received May 22, 2013;

Actor – method – object, a tripartite unit which in Greenspan’s case can be considered a complete control panel, maybe the most coveted by a professional, Greenspan’s merit seems

In the single-layer neural network, the training process is relatively straightforward because the error (or loss function) can be computed as a direct function of the weights,

De¸si ˆın ambele cazuri de mai sus (S ¸si S ′ ) algoritmul Perceptron g˘ ase¸ste un separator liniar pentru datele de intrare, acest fapt nu este garantat ˆın gazul general,

The best performance, considering both the train and test results, was achieved by using GLRLM features for directions {45 ◦ , 90 ◦ , 135 ◦ }, GA feature selection with DT and

pooling problems, large number of binary variables l process design problem. non-linear reaction kinetics,

However, the sphere is topologically different from the donut, and from the flat (Euclidean) space.. Classification of two