Coder Social home page Coder Social logo

irishmorales / modelling-personality-from-twts Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 8.85 MB

ML model for personality trait recognition using structural metrics of Twitter tweets

Python 100.00%
big-five-traits machine-learning nlp nlp-machine-learning personality-predicting personality-traits twitter

modelling-personality-from-twts's Introduction

modelling-personality-from-twts

A study by nerds. Okay, seriously. Scripts for personality trait recognition based on structural metrics of tweets.

Full paper: "Analyzing Structural Metrics to Predict Twitter User Personality Traits".
Made with @zivhd & @kildor22. Part of Project Personality by @EdTheAlchemist.

Structural Metrics:

  • Words per Tweet
  • Characters per word
  • Uppercase letters per Tweet
  • Punctuation marks per Tweet
  • Hashtags per Tweet
  • Mentions per Tweet
  • Links per Tweet
  • Emojis per Tweet
  • Emoticons per Tweet
  • Consecutive repeated characters per word (ex. "hmmm")
  • Consecutive repeated words per Tweet (ex. "pls pls pls")

Regression Models:

  • Mean regression (baseline)
  • Linear regression
  • Support vector regression

Notes:

  • Personality traits based on Five Factor Model
  • Overwrite core.py from "emoji" library with the one in this repo
  • Raw data available only to authors

Directory tree/file descriptions:

root  
├── figures  
│   └── ...all plots per trait-metric pair output by regression.py  
├── practice-data  
│   └── ...practice data files  
├── preprocessed-data  
│   ├── tweet_tweet_pp.csv  (not in repo due to file size)  
|   |   - all preprocessed tweets  
|   |   - output of preprocessing.py on project-data/twitter_tweet.csv  
│   ├── tweet_tweet_pp_practice.csv  
|   |   - output of preprocessing.py on practice-data/tweet_tweet.csv  
│   ├── twt_user_masterlist.csv  
|   |   - info of all twt users  
│   ├── twt_valid_user_masterlist.csv  
|   |   - info of all valid twt users  
│   └── user_metrics.csv  
|       - user metrics for all *valid* twt users  
├── project-data (not in repo due to file size)  
│   ├── user.csv  
│   ├── twitter_tweet.csv  
│   ├── twitter_data.csv  
│   └── personality_test.csv  
├── .gitignore  
├── changelog.txt  
├── core.py  
|   - used instead of core.py in python emoji library  
|   - tokenizes emojis  
├── count.py  
|   - py3, counts metrics for each user  
|   - input:  
|     - preprocessed-data/tweet_tweet_pp.csv  
|     - preprocessed-data/twt_user_masterlist.csv  
|     - preprocessed-data/twt_valid_user_masterlist.csv  
|   - output:  
|     - preprocessed-data/user_metrics.csv  
├── emoticons.txt  
|   - additional emoticons recognized in twts  
├── filter_users.py   
|   - py3, writes masterlist and filters invalid users  
|   - input:  
|     - project-data/twitter_data.csv  
|     - project-data/user.csv  
|     - project-data/personality_test.csv  
|   - output:  
|     - preprocessed-data/twt_user_masterlist.csv  
|     - preprocessed-data/twt_valid_user_masterlist.csv  
├── preprocessing.py  
|   - py2, performs tokenization  
|   - input:  project-data/twitter_tweet.csv  
|   - output: preprocessed-data/tweet_tweet_pp.csv  
├── project-data.zip  
├── README.md  
├── regression.py  
|   - py3, performs regression and outputs plots  
|   - input:  
|     - preprocessed-data/user_metrics.csv  
|     - preprocessed-data/twt_valid_user_masterlist.csv  
|   - output:  
|     - results.txt  
|     - plots in figures/  
└── results.txt  
    - RMSE & R^2 scores for regression on all trait-metric pairs  

modelling-personality-from-twts's People

Contributors

irishmorales avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

jard-io

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.