Coder Social home page Coder Social logo

bert-personality-classification's Introduction

Myers-Briggs Personality Classification and Personality-Specific Language Generation Using Pretrained Language Models

To install BERT, make sure you have pytorch installed, then call

pip install pytorch-pretrained-bert

First run the scraper files to scrape data, then run

python classification/dataset_combiner

Classification:

Run classification model by calling:

python classification/personality_classifier_main.py --do_train --do_eval

Language Generation:

Download pre-trained weights from Google BERT-Base, Cased model (https://storage.googleapis.com/bert_models/2018_10_18/cased_L-12_H-768_A-12.zip) and save to language_generation/data/weights

Convert tensorflow to pytorch-compatible weights by calling:

export BERT_BASE_DIR=language_generation/data/weights/cased_L-12_H-768_A-12

python language_generation/convert_tf_checkpoint_to_pytorch.py \
    --tf_checkpoint_path $BERT_BASE_DIR/bert_model.ckpt \
    --bert_config_file $BERT_BASE_DIR/bert_config.json \
    --pytorch_dump_path $BERT_BASE_DIR/pytorch_model.bin

Create training data by running:

python language_generation/create_training_data.py

Run language generation by calling

python language_generation/personality_language_generation.py \
    --data_dir=language_generation/data/input/<type>
    --output_dir=language_generation/outputs/<type>

For example to run language generation for type ENFJ, run:

python language_generation/personality_language_generation.py \
--data_dir=language_generation/data/input/ENFJ
--output_dir=language_generation/outputs/ENFJ

bert-personality-classification's People

Contributors

sedrickkeh avatar itsuncheng avatar

Watchers

James Cloos avatar  avatar

bert-personality-classification's Issues

Data labelling

I'm interested on using the code for experimenting and label some text reviews that I have. I there any function in code that can I use and predict the personality based on my text input ?

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.