author profiling from personal content blogscse.iitkgp.ac.in/~pawang/courses/snlp15/projects... ·...

25
Author Profiling from Personal Content Blogs Aseem Patni (12CS10008) Ayush Singhal (12CS10002) Soham Dan (12CS10059) Pranay Yadav (12CS30025) Shubham Saxena (12CS30032) Bhushan Kulkarni (12CS30016) Mentors: Sruthi Warrier Anurag Verma

Upload: others

Post on 22-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Author Profiling from Personal Content Blogs

Aseem Patni (12CS10008)Ayush Singhal (12CS10002)

Soham Dan (12CS10059)Pranay Yadav (12CS30025)

Shubham Saxena (12CS30032)Bhushan Kulkarni (12CS30016)

Mentors:Sruthi WarrierAnurag Verma

Page 2: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Abstract● This project aims to predict personally identifiable information (PII), such as

age and gender of the author by extracting features from his/her personal content blog texts.

● We consider Content-based and Semantic features for the classification task.

● We also use Word2Vec vectors along with 1-gram and 2-gram counts as features.

Page 3: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Datasets Used● Blog Authorship Corpus

○ 19,320 bloggers gathered from blogger.com in August 2004. ○ 681,288 posts and over 140 million words ○ 35 posts and 7250 words per person○ One of three age groups — ”10s” [13-17], ”20s” [23-27], ”30s” [33-47]. ○ Equal Sampling of male and female bloggers

● PAN’ 14 & ‘15 Corpus○ Made available for use during Author Profiling Shared Task in PAN ’14○ Under consideration - English blog posts○ One of these age groups: [18-24], [25-34], [35-49], [50-64], [65-xx].○ 2278 posts, 148 authors ○ On an average, 15 blogs per author.

Page 4: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Pre-Processing

Page 5: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Blog Authorship Corpus● Initially, 19320 XML Files, each pertaining to a unique author● Each XML file contains date of posting followed by the post.● All the HTML links in the post replaced by a unique tag ’urlLink’ ● We cleaned the data by discarding the following blog posts -

○ empty blog posts.○ posts which contain only HTML links and no text.○ posts with sentence length < 3 words.

● Exported to JSON for further analysis.● For few tasks, we also removed the STOP WORDS from further

consideration.

Page 6: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

PAN ’14 and PAN ‘15 Corpus● Initially, 148 XML Files, each pertaining to a unique author● Each XML file contains Author ID and Blog posts.● Wrote regex to translated HTML entities like ’&amp;’, ’&ldquo;’ to regular

texts.● Exported to JSON for further analysis.● For few tasks, we also removed the STOP WORDS from further

consideration.

Page 7: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Features

Page 8: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Semantic Features● Topic Modeling using LDA

○ Variance in the probability distribution of the topics he/she blogs about.○ Using gensim package API

● Opinion score of the blogs○ Average opinion score of the blogs by the author○ Using SentiWordNet package

● Word2Vec ○ Average Word2Vec representation of the blogs by the author○ Using gensim package API

● Discourse Analysis ○ Average % of Explicit and Implicit Discourse relations in the blogs by the author ○ Using Java-based Discourse Parser (GNU Public License)

Page 9: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Feature Selected Feature Selected

# of Hyperlinks Readability Metrics

# of Quotations Automated Readability Index

Average Sentence Length Flesch Reading Ease

Distribution of POS tags Fresh Kincaid Grade Level

Distribution of Punctuators Gunning Fog index

# Named Entities SMOG Index

# Non- Word Errors Coleman Liau Index

# References to Past/ Future LIX

# Non-English Words RIX

Syntactic Features

Page 10: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Feature Selection (Contd.)

Analysis of Variance

Page 11: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Topic Modelling as a featureUsing gensim LDA API with param = 10 (# of topics to be retrieved)

Feature Used due to significant positive correlation in both gender and age.

Opinion Scores as a feature Using SentiWordNet 3.0.0, to assign average sentiment score to blogs by a particular user.

Feature rejected due to low correlation across age and gender.

Page 12: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Discourse Analysis as a feature

No. of explicit and implicit discourse relations

No. of Sentences

Both intra- and inter-sentential discourse relations considered.

Feature rejected due to low correlation.

F =

Page 13: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Word2Vec vectors as a featureUsing GraphLab and gensim API for word2vec word embedding of the blog.

Average word2vec vector is obtained for each author by averaging the individual vectors for each of the blogs by him/her.

Word2Vec neural net was trained on the entire Blog Authorship Corpus.

As we shall see, resulted in good accuracy in the classification task.

Page 14: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Learning Techniquesand Evaluation

Page 15: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Technique Precision Recall ROC Accuracy(%)

Logistic Regression 0.697 0.692 0.733 69.23

CART 0.661 0.651 0.729 65.41

Random Forest 0.696 0.683 0.731 70.87

SVM (Normalised Kernel) 0.689 0.679 0.732 68.29

AdaBoost 0.701 0.698 0.723 71.03

Gender : Learning Techniques Comparison

Features used: Semantic + Content - { Neural Word Embeddings, 1-gram and 2-gram features}

Page 16: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Technique Accuracy (%)

Logistic Regression 58.34

CART 53.11

Random Forest 59.89

SVM (Normalised Kernel) 57.17

AdaBoost 60.70

Age :Learning Techniques ComparisonFeatures used: Semantic + Content - { Neural Word Embeddings, 1-gram and 2-gram features}

Page 17: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Word2Vec

Page 18: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

81.9% accuracy in gender prediction

Page 19: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

67.05% accuracy in age group prediction

Page 20: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Gender : Evaluation (contd.)Complete Blog Authorship Corpus was used for Evaluation.

Training : Test Split was set at 80 : 20

Features Used : Unigram and Bigram counts, Neural Word Embeddings.

Precision : 82%

Recall : 80.4%

Accuracy : 81.9% (using Boosted Trees)

Page 21: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Age : Evaluation (contd.)

Complete Blog Authorship Corpus was used.

Training : Test Split was set at 80 : 20

Features Used : Unigram and Bigram counts, Neural Word Embeddings.

Precision : 74.5%

Recall : 66.67%

Accuracy : 67.85% (using Boosted Trees)

Page 22: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

PAN Author Profiling Task at CLEF 2013

[1] Wikipedia Semantic + Word n-grams + POS n-grams

SVM Gender Prediction Accuracy: 62.12%

Age Prediction Accuracy: 66.51%

Page 23: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

ConclusionAn extensive list of syntactic features were used with a variety of learning methods including ensemble learning, which gave a decent accuracy in both gender and age prediction.

Incorporation of semantic features gave a far better accuracy than usage of only content-based features.

This shows the power of Neural Networks in Age and Gender Prediction from text.

Page 24: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

Future WorkInvestigating further to reveal a suitable combination of syntactic and semantic features that can further boost the accuracy of predictions.

Using textual features for predicting other personally identifiable information of authors, like stylometric information.

Page 25: Author Profiling from Personal Content Blogscse.iitkgp.ac.in/~pawang/courses/SNLP15/Projects... · Sruthi Warrier Anurag Verma. Abstract This project aims to predict personally identifiable

References1. Varma Et Al. 2013. Exploiting Wikipedia Categorization for Predicting Age and Gender of

Blog Authors. Notebook for PAN at CLEF 2013. 2. Smith Et. Al. 2011. Author Age Prediction from Text using Linear Regression. In Proceedings

of the ACL Workshop on Language Technology for Cultural Heritage, Social Sciences, and Humanities (LATECH 2011), Portland, OR, June 2011.

3. Francisco Rangel, Paolo Rosso, Moshe Koppel, Efstathios Stamatatos, and Giacomo Inches. Overview of the Author Profiling Task at PAN 2013. Proceedings of PAN at CLEF 2013.

4. Argamon Et. Al. 2009. Automatically profiling the author of an anonymous text. Communications of the ACM 52 (2): 119-123.

5. Schler Et. Al. 2006. Effects of Age and Gender on Blogging. In Proceedings of AAAI Spring Symposium on Computational Approaches for Analyzing Weblogs, March 2006.

6. Meina Et. Al. 2013. Ensemble-based Classification for Author Profiling Using Various Features. The Notebook for 2013 PAN at CLEF 2013