# Gender Classification Using Sentiment Analysis and Deep Learning in a Health Web Forum
## 4 Results
### Deep Learning Results  
We tested two methods of embedding words into vectors, random word-embedding and the word2 Vec method. We also varied the CNN structure with two filter sizes of length 3 or 8, which implies that three words or eight words are aggregated. The number of filters is set to 10. For parameter optimization, we used ADAM [24]. This uses squared gradients to scale the learning rate and takes advantage of momentum by using the moving average of the gradient instead of the gradient itself. The experiment results show that the random word-embedding method outperforms the word2 Vec method. We guess that word2 Vec is built with formal text from GoogleNews, but our text dataset is written in spoken language. Thus, word2 Vec does not work well in our case. The accuracy of the random word embedding method ranges between 88% and 91% depending on the CNN structure. On the other hand, the accuracy with the word2 Vec ranges between 67% and 71%. Secondly, we varied the feature set from word features to senti-word features. The sentiment feature set is low-dimensional with a small number of features, so we judged that deep learning is not necessary for this feature set. Thus, we tested CNN for the reduced feature consisting of senti-words and the full feature set consisting of word features. We achieved 88.7% with senti-word features and 90.6% with word features. The number of senti-word features is at 20% of the number of word features, but it generates a comparable performance. Compared to traditional machine learning algorithms, CNN dramatically increases the performance. For the female class, the precision and recall are much improved and the performance for the two classes is equally good. We changed the CNN structure to find the best structure for our context. Starting from a simple structure, we designed more complicated structures. The combination of two convolution layers proceeded by the pooling layer, the dropout layer after that, and the fully-connected layer at last, outperformed other structures. A more complicated model with two convolutional layers outperforms the simplest model with one convolutional layer. However, the accuracy increases by at most 0.004. Slight modifications to the baseline model, in the second row, degrade the accuracy. From the other models, we found one fully connected layer is enough for comparing the second through fourth models. The max pooling layer employed to reduce feature dimension is best deployed right after each convolutional layer. In future work, we will test more complicated structures and more diversity in terms of the number of filters and sizes. Table 8 indicates the result of CNN performance according to each structure. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Feature** **l Accuracy** & **NB (\%)** & **SVM (\%)** & **RF (\%)** \\ \hline TF/Boolean (5) \({}^{1}\) + senti & 41.52/41.32 & 59.55/59.57 & 73.3/72.79 \\ TF/Boolean (10) \({}^{2}\) + senti & 44.95/45.13 & 70.68/71.66 & **74.41/73.59** \\ TF/Boolean (15) \({}^{3}\) + senti & 49.48/51.08 & 71.72/**72.79** & 73.16/73.05 \\ TF/Boolean (100) \({}^{4}\) + senti & **61.5/66.16** & **71.99**/72.52 & 72.9/73.52 \\ \hline \hline \end{tabular} \({}^{1}\) including 7588 words, \({}^{2}\) including 4822 words, \({}^{3}\) including 4732 words, \({}^{4}\) including 1108 words.  
\end{table} 
Table 7: The accuracy of gender detection using different feature set. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**CNN Structure**} & \multirow{2}{*}{**Accuracy**} & \multicolumn{2}{c}{**Female**} & \multicolumn{2}{c}{**Male**} \\ \cline{3-5}  & & **Precision** & **Recall** & **Precision** & **Recall** \\ \hline Conv + Pool + Dropout + FC & 0.906 & 0.93 & 0.91 & 0.87 & 0.90 \\ Conv + Pool + Conv + Pool + Dropout + FC & **0.910** & 0.93 & 0.92 & 0.88 & 0.89 \\ Conv + Pool + Conv + FC + Dropout + FC & 0.905 & 0.94 & 0.89 & 0.86 & 0.92 \\ Conv + Conv + Pool + FC + Dropout +FC & 0.887 & 0.91 & 0.90 & 0.85 & 0.87 \\ \hline \hline \end{tabular}
\end{table}