GithubHelp home page GithubHelp logo

gesiscss / sexism_custom_classifier Goto Github PK

View Code? Open in Web Editor NEW
6.0 14.0 3.0 33.01 MB

Custom classifiers to detect sexist language.

License: MIT License

Jupyter Notebook 83.57% Python 16.43%
sexism-detection natural-language-processing nlp sckit-learn bert

sexism_custom_classifier's Introduction

Binder

Sexism Custom Classifier

Introduction

Sexism custom classifier is implemented to detect sexism automatically in the field of natural language processing. In this work, the dataset from Samory et al. (2020) was used to train three models on top of four different feature sets (both individual and combinations). The aim of the experiments is to answer two research questions:

  • What is the informativeness of different feature sets on the sexism detection task?
  • What are the improvements on the sexism classifiers’ performance when different feature sets are introduced?

Support Features

  • Sentiment : The sentiment intensity provided by VADER sentiment analysis method.
  • Word N-grams : Term Frequency/Inverse Frequency (TF-IDF) weights of word n-grams proviided by scikit-learn.
  • Type Dependency : The type dependency relationships provided by Stanford Parser. The parser can be dowloaded from here.
  • Document Embeddings : The document embeddings provided by BERT language representation model.

Support Models

  • Logistic Regression
  • Convolutional Neural Network
  • Support Vector Machine

Experiments

This example code trains Logistic Regression on top of sentiment and uni-gram features. To replicate the results, run the scripts in the 'experiments/scripts.txt'

export PARAMS_FILE='experiments/params.json'
export HYPERPARAMS_FILE='experiments/hyperparams.json'

python run.py \
  --params_file=$PARAMS_FILE \
  --hyperparams_file=$HYPERPARAMS_FILE \

This example code obtains the pre-trained BERT embeddings.

export DATA_FILE=/path/data.csv

python run_bert_feature_extraction.py \
	--data_file=$DATA_FILE \

sexism_custom_classifier's People

Contributors

elifdaldal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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.