A Python package to parse and manage CREA word vectors. Learn more about this project on GitHub: https://github.com/WiredBrains-Lab/
Project description
CREA-Vectors
This is a package to access CREA vectors via pycrea. Various data collection methods are also included. Future updates will allow users to add their collected vectors to the main set.
How to run the code
- pip install pycrea in your terminal
- In python import the library
- from crea import CREA
- c = CREA() # Automatically loads main dictionary or
- c = CREA('path_to_file.json') # Load custom json file
- c_cols = CREA(col_names = True) loads feature names
Usage
- all_vectors = c.get_all_vectors()
- vector = c.get_vector('word1')
- vectors = c.get_vectors(['word1', 'word2'])
- vectors_and_cols = c_cols.select_cols(['word1', 'word2'], [feature_1, feature_2])
- similarity = c.cosine_similarity('word1', 'word2')
- n_similar = c.top_n_similar('word1', 5) # defaults to 5
PsychoPy Data Collection
- Results are saved as a JSON file named 'results.json'
- Currently it is overwritten each time
- JSON file has the structure {'target_word': {'Rating Category 1': rating_1, ... 'Rating Category n': rating_n}}
- CREA.get_raw('results.json') gets the new raw data from results.json and adds a new row to raw results.csv
- CREA.calculate_averages('results.csv') calculates the average of results.csv and returns a DataFrame of the averages
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycrea-0.1.3.tar.gz.
File metadata
- Download URL: pycrea-0.1.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2e6ccdd182183f19267e0e25c17afd008c57e91098721f2bca1225025efde30
|
|
| MD5 |
434353528dd7b441661b5a835a76ee02
|
|
| BLAKE2b-256 |
2d747e0dd82f14b7bc0a9c86f9aff1240baa07df0d91f4e5faaad046c886823b
|
File details
Details for the file pycrea-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pycrea-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1a67b3c31f2d1245ab9de776cb0d2d01cb3e5bb98ecadffe4f74dc4892d0814
|
|
| MD5 |
31640b6eb37746da73b0b397ec7da1be
|
|
| BLAKE2b-256 |
558123a5e7816a4ba96d0396c445cb8ae313fde3dc145c47e62cf24579a8fcea
|