Code Monkey home page Code Monkey logo

acl22-depression-phq9's Introduction

acl22-depression-phq9

1. Weakly label symptoms

Collect positive symptoms

#!/bin/bash
symp_dir=('data/anhedonia'  'data/concentration'  'data/eating'  'data/fatigue'  'data/mood'  'data/psychomotor'  'data/self-esteem'  'data/self-harm'  'data/sleep')
pattern_dir='resources/patterns/'
pps=('anhedonia_problem.txt' 'concetration_problem.txt'  'eating_problem.txt'   'fatigue_problem.txt'  'mood_problem.txt'  'psychomotor_problem.txt'  'self-esteem_problem.txt'  'self-harm_problem.txt'  'sleep_disorder.txt')
np='negation_templates.txt'
cc='cc_templates.txt'
pt='pronoun_templates.txt'

for i in ${!symp_dir[*]}
do
        python prepare_data/filter_symptoms.py --input ${symp_dir[$i]}/posts  --output ${symp_dir[$i]}/filtered_post --pp $pattern_dir${pps[$i]} --np $pattern_dir$np --cc $pattern_dir$cc --pt $pattern_dir$pt --use_sentiment > ${symp_dir[$i]}/log.txt &
done

Generate negative symptoms

python prepare_data/generate_neg.py --input input_file --ouptut ouptut_file [NEGATIVE_FOLDER]

Aggregate and split folds

python prepare_data/aggregate_and_split_data.py --input [INPUT_FOLDER]

2. Train question/symptom models

python code/train_question_model.py --epoch 100 --es_patience 5 --batch_size 16 --model cnn --train data/anhedonia/train.jsonl --dev data/anhedonia/dev.jsonl --test data/anhedonia/test.jsonl --save models/anhedonia --bert base --hidden_dim 5 --sig al 

3. Symptom inference on posts

python code/run_questionnaire.py  --bert base --model cnn --hidden_dim 5 --input [INPUT_PATH]  --log [LOG_PATH] --output [OUTPUT_PATH]

4. Train depression models

python code/train_depression.py --train [TRAIN_PATH] --dev [DEV_PATH] --test [TEST_PATH] --epochs 400 --es_patience 5 --batch_size 16 --lr 0.0001 --save models/ --model cnn --fold 0 

acl22-depression-phq9's People

Contributors

thongnt99 avatar

Watchers

James Cloos 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.