Vector Space Model as Cognitive Space for Text Classification
In this era of digitization, knowing the user’s sociolect aspects have become essential features to build the user specific recommendation systems. These sociolect aspects could be found by mining the user’s language sharing in the form of text in social media and reviews.
This paper describes about the experiment that was performed in PAN Author Profiling 2017 shared task. The objective of the task is to find the sociolect aspects of the users from their tweets. The sociolect aspects considered in this experiment are user’s gender and native language information. Here user’s tweets written in a different language from their native language are represented as Document - Term Matrix with document frequency as the constraint. Further classification is done using the Support Vector Machine by taking gender and native language as target classes. This experiment attains the average accuracy of 73.42% in gender prediction and 76.26% in the native language identification task.
The user profiling is an indirect crowd sourcing task, which collect user’s sociolect aspects like age, gender and language variation from their language share (i.e. Tweets, Face book data and Reviews)
PAN - 2017 author profiling task is to predict the author’s gender and language variation from their tweets which are 100 in number . This task can be viewed as a text classification problem by having target class as the author’s sociolect aspects and text as their tweets. The primary component in the text classification problem are representation, feature learning and classification. Here we have modelled the Vector Space Model (VSM) as the author’s cognition
Most of the recent researches are focused on representing the context of the text through distributional and distributed text representation methods   . This context representation of text alone will not contribute much towards the prediction of authors sociolect aspects, since it is also dependent on their source of cognitive knowledge like education, cultural background, age group, working domain etc . In this Author Profiling task ”How” language sharing expressed by an author is having more impact than the ”What” they actually shared . By observing this, here the Document - Term Matrix (DTM) is used as representation method, in which the fundamental features are words and their frequencies used by the users.
The Figure 1 and 2 describes the variation in word frequency with respect to the gender and native language of the users. It can be observed that usage of word and its frequency varies with respect to the user’s sociolect aspects. The frequency of the word used by female is significantly greater than the word used by male. As told above cognitive nature is applicable to native language variation also. We have experimented VSM to model this cognition ability. The words in these Figure 1 and 2 are derived by taking common word across the target classes from the list of words with top 20 highest frequency in the final model. The above shown Figure 1 and 2 has been plotted for English language which is also applicable to the other languages.
2 Text Representation - Vector Space Model
Vector Space Model is built from the documents provided. These set of documents are processed to find its equivalent optimized numerical representation in the matrix format.
Here represents the sentences or documents (here tweets), represents its equivalent matrix format (here DTM) and is the total number of documents.
The commonly used methods under VSM are Document - Term Matrix (DTM) and Term Frequency - Inverse Document Frequency Matrix (TF-IDF). These methods are generally referred to as Bag of Word (BOW) method and it follows bag of word hypothesis . In our methodology, TF-IDF is not taken into consideration because, the control over the document frequency and term significance are modeled through minimum document frequency.
Given a set of texts as in equation 1, the function converts it into the Document Term Matrix (DTM). In this application document refers to the user’s tweet collection, hence the matrix can be viewed as user - term matrix. The function measures the event , where is the occurrence of terms in the texts. The term may take words, phrases (n-grams) or both. The above can be represented as,
Where is the DTM with size. is the number of users, is the minimum document frequency and is the total number of unique words or phrases (types) present in the document set. The word with frequency is not included in the DTM.
3 Feature Learning
Feature learning is the abstract level representation of original text content. This enhances the model performance by filtering the unwanted information and reduces the computation time required to build the model. In this work, frequency of the word across the document (document frequency) is taken as the threshold to limit the number of unique words in the vocabulary to build the user - term matrix . The terms in the vocabulary are constrained by the document frequency. Hence the matrix produced through this can be viewed as user - feature matrix. In the produced matrix row refers to the user and column refer to the word used by the user. The following Feature Scaling table gives the comparison between number of words in user - term matrix and user - feature matrix.
|Language||User - Term||User - Feature|
This experiment does not focus on classification rather than the representation of texts. Therefore the user - feature matrix along with its corresponding target classes are used to train the Support Vector Machine (SVM) classifier with Radial Basis Function (RBF) as the kernal. SVM is a well known non probabilistic classification algorithm which is used most often to perform the VSM based representations . SVM with the default parameter in Scikit Learn library is directly used to build the classifier (i.e. , degree=3, gamma=’auto’, kernel=’rbf’ ).
5 Experiments and Observations
This section details the statistics about the given training data set, experimented system and its outcomes. This experiment is conducted with a machine having Intel i7 processor and 16GB of RAM.
|Language||# Native Language||Total #|
The data set contains 100 tweets per author and these tweets are written in 4 different languages. Within these different languages, native language of the users also varies. The detailed statistics about the data-set utilized is given in PAN 2017 Author Profiling overview paper . The number of variation in the native language is shown in Data - Set Statistics Table. These 100 tweets per author is embedded in an xml file and given with the truth file which contains gender and language variation class of the corresponding author. These xml files are passed through xml Python library
The User - Feature Matrix with the class tags are given to the SVM with Radial Basis Function kernal (RBF Kernal) and to build the classification models. An independent two classification models are build for the gender prediction and identification of Language variation. To build the classifier SVM from the SKLEARN Python library
The above said experiment is conducted with minimum document frequency varying between 2 and 25 while representing tweets as User - Feature Matrix. The final classification model is built by selecting the minimum document frequency with highest accuracy across all four languages. Here minimum document frequency acts as a constraint in the selection of words to build a vocabulary. The minimum document frequency is an event of frequency of the word appearing across the documents (i.e. minimum number of users who used the given word). The performance of the model built against the minimum document frequency is given in the Figures 3 and 4. It can be observed that the performance of the models has attained the constant accuracy for the minimum document frequency greater than 4. From this observation in this experiment final model is built with ”minimum document frequency = 10”.
As the minimum document frequency increases the size of the User - Feature Matrix gets reduced. This is because the number of words to form the vocabulary is less. This has a significant impact on time to build the classification model. This is shown in the Figure 5 and 6.
The User - Feature Matrix of the test data is built against the selected classification model’s vocabulary and thereafter gender, language variations are predicted. The result obtained against the test data are evaluated by the PAN 2017 Author Profiling shared task committee and it is shown in Table 3
The word usage by the users have been represented in the cognitive space by Document - Term Matrix as Vector Space Model. By considering word usage as features, further classification has been carried out using Support Vector Machine. The observed results have attained nearly an average accuracy of 70 % in both the tasks across different languages. From the assumptions made it has been found that these primary results are satisfactory and that Vector Space Model can be considered as the user’s Cognitive Space.
The accuracy of the system can be enriched by representing the tweets using Vector Space Models of Semantics (distributional and distributed representation methods). Our further experimentation will be on deriving the Vector Space Models of Semantics representation methods for modelling the user’s cognitive space from the representation method utilized in this paper.
- Rangel, Francisco, Paolo Rosso, Martin Potthast, and Benno Stein. Overview of the 5th Author Profiling Task at PAN 2017: Gender and Language Variety Identification in Twitter. Working Notes Papers of the CLEF (2017).
- Barathi Ganesh HB, Anand Kumar M and Soman KP. Distributional Semantic Representation for Text Classification and Information Retrieval. 2016.
- Barathi Ganesh HB, Reshma U and Anand Kumar M. Author identification based on word distribution in word space. In Advances in Computing, Communications and Informatics (ICACCI), 2015.
- Socher, Richard, Eric H. Huang, Jeffrey Pennin, Christopher D. Manning, and Andrew Y. Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection.. In Advances in Neural Information Processing Systems, 2011.
- Barathi Ganesh HB, Anand Kumar M and Soman KP. Statistical Semantics in Context Space. 2016.
- Turney, Peter D., and Patrick Pantel. From frequency to meaning: Vector space models of semantics. Journal of artificial intelligence research 37 (2010).
- Hsu, Chih-Wei, Chih-Chung Chang, and Chih-Jen Lin. A practical guide to support vector classification. 2003.
- Tan, Liling and Zampieri, Marcos and Ljubešic, Nikola and Tiedemann, Jörg. Merging Comparable Data Sources for the Discrimination of Similar Languages: The DSL Corpus Collection. Proceedings of the 7th Workshop on Building and Using Comparable Corpora (BUCC) (2014).