Create and quantify 'archetypes' of your constructs. A dictionary-like method run amok!
Project description
Archetypes!
This is a library developed to run what might be called a "souped-up dictionary method" for psychological text analysis. Or any kind of text analysis, really.
The core idea behind Archetypes is that you pre-define a set of prototypical sentences that reflect the construct that you are looking to measure in a body of text. Using modern contextual embeddings, then, this library will aggregate your prototypes into an archetypal representation of your construct. Then, you can quantify texts in your corpus for their semantic similarity to your construct(s) of interest.
Note: For the curious: no, this approach not inspired by anything Jungian in nature. In the past, I've said a few things about Jungian archetypes that have inspired scholars to write more than a few frustrated e-mails to me. Apologies to the Jungians.
Installation
This package is easily installable via pip via the following command:
pip install archetyper
Requirements
If you want to run the library without pip
installing as shown above, you will need to first install the following packages:
numpy
tqdm
torch
sentence_transformers
nltk
You can try to install these all in one go by running the following command from your terminal/cmd:
pip install numpy tqdm torch sentence_transformers nltk
Examples
I have provided an example notebook in this repo that walks through the basic process of using this library, along with demonstrations of a few important "helper" functions to help you evaluate the statistical/psychometric qualities of your archetypes.
Citation
This method is originally described in the following forthcoming paper:
@inproceedings{varadarajan_archetypes_2024,
address = {St. Julians, Malta},
title = {Archetypes and {Entropy}: {Theory}-{Driven} {Extraction} of {Evidence} for {Suicide} {Risk}},
booktitle = {Proceedings of the {Tenth} {Workshop} on {Computational} {Linguistics} and {Clinical} {Psychology}},
publisher = {Association for Computational Linguistics},
author = {Varadarajan, Vasudha and Lahnala, Allison and Ganesan, Adithya V. and Dey, Gourab and Mangalik, Siddharth and Bucur, Ana-Maria and Soni, Nikita and Rao, Rajath and Lanning, Kevin and Vallejo, Isabella and Flek, Lucie and Schwartz, H. Andrew and Welch, Charles and Boyd, Ryan L.},
year = {2024},
}
The citation above will be updated once the paper is actually published 😊
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file archetyper-1.0.2.tar.gz
.
File metadata
- Download URL: archetyper-1.0.2.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93ca47596280822b7434046e3a6eca74c512bc4ba8c2e1c43afedba72ce006df |
|
MD5 | 335dd7234d4f9d6eec74bc9d5138d42d |
|
BLAKE2b-256 | ba24dda07bb60161ce2339fd872b979ecef862deb075e705e85edd3b4bc25ba0 |
File details
Details for the file archetyper-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: archetyper-1.0.2-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fcd78d5dad85977c913a1a1c62891c32d75c4c76509fde5e7a0f7b928f83e5eb |
|
MD5 | 6e49663af5377665f7f7a76fdf9fb325 |
|
BLAKE2b-256 | 9a93684ddbf905ad95569f1abed77ab0401b1fd628531c72e7d0c73e81ac3161 |