Code Monkey home page Code Monkey logo

clpsych_challenge_2019's Introduction

CLPsych_Challenge_2019

CLPsych_Challenge_2019 @ NAACL Conference. Link to paper: https://www.aclweb.org/anthology/papers/W/W19/W19-3022/

Read the paper attached above to understand the methodology

Read the Challenge given README for more info on the Challenge files

To reproduce numbers from paper above, use the preprocessed dataset folder in the following link which contains the full train data and the challenge given set aside test set. Link here: https://www.dropbox.com/sh/vo9rfh793isptn1/AACTnvSzg5NwWTpJqwZzmBIta?dl=0

Separate source files were created for training and testing which look almost identical. Due to the lack of time neatness had to be compromised. I apologize for the tardiness in advance :)

Source File Description

Folder Descriptions:
Neural Network modelling: Contains all the BERT Training scripts
PreProcessing: Contains all the scripts to prepare the data for input to BERT

File Descriptions:
Files under Neural Network Modelling:
All run_classifier_* files run the bert text classification code with task specific modification such as number of labels, etc
Refer the BERT Tutorial for more info: https://github.com/md-labs/BERT_Tutorial

Files under PreProcessing:
The Task A, Task B and Task C folders all contains similar files with the same intent but with minor changes specific to each task

I have described only one of the folders here (Task-A) but they apply to all files in other Task folders too.

Combine_Data_With_Labels_Task_A.py- Combines various users involved in Task A with their respective labels
Input Files:
crowd_train.csv, task_A_train.posts.csv
Output Files:
trainUserIds_TaskA_Final.csv, testUserIds_TaskA_Final.csv

PreProcessing_User_Posts_Task_*.py- Expands contractions, removes stopwords, etc and writes the posts in BERT required Input format
Input Files:
word_contractions_expansion.json, combined_data_Task_A.csv, trainUserIds_TaskA_Final.csv OR testUserIds_TaskA_Final.csv, task_A_train.posts.csv
Output Files:
User_Posts_Processed_Train.csv
Similar Files: PreProcessing_User_Posts_Task_*.py

PreProcessing_For_MIL_Task_*.py- Expands contractions, removes stopwords, etc and writes the posts in a json files with key as user id and value as list of posts (=5)
Input Files:
word_contractions_expansion.json, combined_data_Task_A.csv, trainUserIds_TaskA_Final.csv OR testUserIds_TaskA_Final.csv, task_A_train.posts.csv
Output Files:
User_To_Posts.json
Similar Files: PreProcessing_For_MIL_Test_Task_*.py

Convert_And_Write_Files_To_BERT_Required_Format.py- Write files in BERT Required Format

Convert_Output_To_Reqd_Format.py- Convert Output from BERT to Labels in Challenge

Get_User_Embeddings_From_BERT.py- For each user, get the embeddings from BERT for their respective posts. This code just retrieves the data from the Embeddings json file that is written by BERT
Similar File: Get_User_Embeddings_From_BERT_Test.py

Merging_Data_From_Different_Files.py- Do an SQL join on the the dataset by joining on 'user_id', 'post_id' and 'subreddit'

Oversampling.py- Oversampling Class B Samples to Class A

Partitioning_Train_Data.py- Splits the Full Train Data into Train-Test Sets and Oversampling the training data

Read_CLS_Embeddings.py- Read CLS Embeddings from extracted BERT Embeddings to train MIL

clpsych_challenge_2019's People

Contributors

ashwinambal avatar

Watchers

 avatar paper2code - bot 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.