# Reddit Quitting
This is an analysis building off of the [Reddit Job Change](https://osf.io/gxbts) project.
## Scripts
The [process.py](https://osf.io/mz6js) script uses the Mistral API by way of DSPy to process texts with a prompt.
This produces the [prompted.json](https://osf.io/rpnw5) file (with previous versions producing [prompted_nodspy.json](https://osf.io/e8nzb) and [prompted_noex.json](https://osf.io/rp4ta)).
The [embeddings.py](https://osf.io/vm52y) script also uses the Mistral API to retrieve message embeddings.
This produces the [embeddings.csv.xz](https://osf.io/z3vmh) file.
The [analysis.R](https://osf.io/scj7v) script reads in the various results to analyze them.
## Service API Keys
To optimize locally, you'd need a [Hugging Face API key](https://huggingface.co/settings/tokens): Replace `<HUGGING_FACE_HUB_TOKEN>` in the [docker-compose.yml](https://osf.io/svpku) file.
To use the optimized prompt, you'd need a [Mistral API key](https://admin.mistral.ai/organization/api-keys): Replace `<MISTRAL_API_KEY>` in the [.env](https://osf.io/6pca8) file.