No project description provided
Project description
Entropy-conVergence Metric
The following is a full implementation of the convergence-entropy measurement framework (here referred to as Entropy-conVergence Metric, or EVM) as described in Rosen and Dale 2023. We've taken strides to make this package as easy to implement as possible.
At its core there are two things that researchers need to define for the most basic version of the EVM algorithm. Those are:
- A word vector model (we suggest those implemented in the HuggingFace transformer library)
- An entropy object
Demonstrating how this would look in code:
from EVM import EVM, languageModelLayers
from transformers import AutoTokenizer, AutoModel
wv = languageModelLayers('roberta-base', layers=[7])
mod = EVM(
word_vector_model = wv
)
mod('No political action can be taken without first consulting the populace', 'it is the prerogative of the political class to make decisions'), \
mod('No political action can be taken without first consulting the populace', 'Ultimately the populace has to have the right to decide their own fate')
The above returns the entropy for the first sentence upon having read the second sentence, consistent with the equations and formulation listed in Rosen and Dale 2023.
Any use of this package should cite it using the following:
@article{rosen_berts_2023,
title = {{BERTs} of a feather: {Studying} inter- and intra-group communication via information theory and language models},
shorttitle = {{BERTs} of a feather},
url = {https://link.springer.com/10.3758/s13428-023-02267-2},
doi = {10.3758/s13428-023-02267-2},
journal = {Behavior Research Methods},
author = {Rosen, Zachary P and Dale, Rick},
year = {2023},
}
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
Hashes for convergence_entropy_metric-1.0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeba14c0048f4b0f5e9dff4601045e5e975d2fbc90dc563abc3892e0a9c61f19 |
|
MD5 | 972232381972beaa518b027ad1bb9b1c |
|
BLAKE2b-256 | 797404bc95107aa852d06b2f3cc6ca044f1596dfb4177e81dd1ac89b4ee145bb |
Hashes for convergence_entropy_metric-1.0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78b6887fb92c860cd3756576c9edd3f8795dec17ac6b839af0c236ae9b8fa915 |
|
MD5 | e823665c3a4893cacc6ba407d7a6de5b |
|
BLAKE2b-256 | 758c840504af09da23a30bad541708893791795a636c5994497ff9b51ba2ec70 |