To get started with this project, follow the steps below:
You will need an Anaconda environment for a faster setup.
-
Download and Unzip Environment
- Download and unzip the provided environment file
-
Clone the Repository
- Clone the project and checkout the main branch
-
Add Conda Environment
- Add the conda environment to the project as the interpreter
-
Install Dependencies
- Navigate to the directory of the package.json file: https://github.com/elenagaz/An-Investigation-of-Depression-on-a-Language-Moderation-Model-Using-Concept-Activation-Vectors/tree/main/lit_nlp
- Run the following commands to install dependencies and build the project:
yarn install yarn build
To run the demo I have created, execute the main method of the specified file. Navigate to the path: my_model_moderation and run the demo
To reproduce the TCAV scores for the depression concept, run the demo and only choose the first 148 examples labeled as OK (image 1) and add them as a slice (image 2), then navigate to the TCAV tab (image 3) and run TCAV with the selected classes (image 4) - this takes a while as there are predictions that must be rerun.
Moreover, for each of the symptoms, each symptom file from the directory must be added as the file path on line and the demo must be rerun.
All results with the corrected p-value of 0.00256 can be found in this directory
However, the results with the initial p-value of 0.05 can be found in this directory
All protocols of data generation for depression and random data can be found here
All files used for the generation of TCAV scores can be found in this directory
Additionally, all files for validation, including the files used as training data can be found in these directories KoalaAI_Text-Moderation-v2-smal and moderation_api_release
Some edits have been made to ensure compatibility with Windows.