You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56-30Lines changed: 56 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,24 @@ For practical purposes, this tool should be used. It is based on the original co
17
17
18
18
Feel free to report issues and bugs you encounter.
19
19
20
-
## Requirements
20
+
## A framework for cognitive word embedding evaluation
21
+
The CogniVal tool generates and fits a neural network regression to predict cognitive data such as fMRI, eye-tracking and EEG (corpora mapping words to cognitive signals) from word embedding inputs.
22
+
Thus, it allows determining the predictive power of sets of of word embeddings with respect to cognitive sources. Currently supported modalities are **eye-tracking**, **electroencephalography (EEG)** and **functional magnetic resonance imaging (fMRI)**. Furthermore, the significance of the prediction can be estimated by comparing a set of embeddings with n-fold random baselines of identical dimensionality and computing statistic significance using the Wilcoxon signed-rank test with conservative Bonferroni correction, counteracting the multiple hypotheses problem.
23
+
24
+
## Installation
25
+
26
+
### Installing latest release with pip
27
+
1. Download the `.tar.gz` file of the latest release from [https://github.com/DS3Lab/cognival-cli/releases/](https://github.com/DS3Lab/cognival-cli/releases/)
28
+
2. Install with pip (this will automatically install all requirements):
29
+
`pip install ./cognival-0.1.1.tar.gz`
30
+
31
+
### Installing from source
32
+
1. Clone or download this repository as a ZIP.
33
+
2. Manually install all Python requirements specified in `requirements.txt`.
34
+
3. In the main `cognival-cli` directory, run:
35
+
`python setup.py install`
36
+
37
+
### Requirements
21
38
- Python 3.7.4 or newer
22
39
- For PDF generation of reports: wkhtmltopdf version 0.12.5 or newer (available from https://wkhtmltopdf.org/. Note: At the time of writing this README, the version available from Ubuntu repositories is outdated.)
23
40
- For manual browsing and viewing of user files: vim (any recent version)
@@ -28,11 +45,25 @@ For practical purposes, this tool should be used. It is based on the original co
28
45
- CuDNN >= 7.6.5
29
46
- NVIDIA drivers >= 418.39 (can be determined with nvidia-smi)
30
47
- NVIDIA SMI (for scheduling and monitoring)
31
-
- Python requirements are specified in requirements.txt (must be manually installed through pip when installing via `python setup.py install`). When installing a tar.gz release via pip, requirements are installed automatically.
48
+
- Python requirements are specified in `requirements.txt`.
49
+
50
+
### Uninstalling
51
+
If you need to uninstall CogniVal, run:
52
+
` pip uninstall cognival`
53
+
54
+
## Getting started
55
+
56
+
After successful installation, the tool is globally available and can be started as interactive shell, by executing the command:
57
+
`cognival`
58
+
59
+
Instructions and a demo configuration will appear when starting the tool.
60
+
61
+
### Execution and file paths
62
+
63
+
After installation, the tool is globally available and can be started as interactive shell, by executing `cognival`. Alternatively, commands not relying on a state (i.e. requiring an active configuration, which is stored in the session) can be run as command-line parameters, e.g. `cognival list configs`.
64
+
65
+
User files are stored in `$HOME/.cognival` by default. This can be reconfigured (e.g. when there are space limitations for the home directory on a shared server). The path of the user files is specified in a global configuration file, which is stored in the site-packages directory of the virtual environment. The command history is stored in `$HOME/.cognival_history`.
32
66
33
-
## A framework for cognitive word embedding evaluation
34
-
The tool generates and fits a neural network regression to predict cognitive data such as fMRI, eye-tracking and EEG (corpora mapping words to cognitive signals) from word embedding inputs.
35
-
Thus, it allows determining the predictive power of sets of of word embeddings with respect to cognitive sources. Currently supported modalities are **eye-tracking**, **electroencephalography (EEG)** and **functional magnetic resonance imaging (fMRI)**. Furthermore, the significance of the prediction can be estimated by comparing a set of embeddings with n-fold random baselines of identical dimensionality and computing statistic significance using the Wilcoxon signed-rank test with conservative Bonferroni correction, counteracting the multiple hypotheses problem.
36
67
37
68
## Terminology
38
69
- Embeddings: Word embeddings in textual format, with a single vector per word. Context-sensitive embedding types like BERT and ELMo thus require preprocessing
@@ -56,30 +87,27 @@ The CogniVal interactive shell allows:
56
87
- Generating an interactive HTML or static PDF report, showing both aggregate and detail statistics in tabular and plot form,
57
88
as well as plots visualizing the training history and history of key statistics over different experimental runs.
58
89
59
-
## Execution and file paths
60
-
61
-
After installation, the tool is globally available and can be started as interactive shell, by executing `cognival`. Alternatively, commands not relying on a state (i.e. requiring an active configuration, which is stored in the session) can be run as command-line parameters, e.g. `cognival list configs`.
62
-
63
-
User files are stored in `$HOME/.cognival` by default. This can be reconfigured (e.g. when there are space limitations for the home directory on a shared server). The path of the user files is specified in a global configuration file, which is stored in the site-packages directory of the virtual environment. The command history is stored in `$HOME/.cognival_history`.
64
90
65
91
## Overview of commands
66
92
`<Tab>` shows all available commands, subcommands and parameters at the given position, as well as argument types and default values where applicable.
67
-
By pressing `<Left>`, previously executed commands can be auto-completed. When a command is executed with only one argument, it can be
68
-
provided in a positional manner: `command argument`. Otherwise, each parameter must be named: `command parameter1=argument2 parameter2=argument2`.
93
+
By pressing `<Left>`, previously executed commands can be auto-completed. When a command is executed with only one argument, it can be provided in a positional manner:
Note that the syntax is a simplified version of Python's, as strings and ints can be provided without quotes (except for URLs in the context of custom embedding import), however lists must be enclosed in brackets: `list-param=[value1, value2]`. List parameters require lists even for single values (`list-param=[value]`) and the special value `all`, indicating all possbile values (`list-param=[all]`).
71
99
72
100
### Basic commands
73
-
- clear: Clears the shell
74
-
- history: Shows the history of executed commands in descending order. The history is stored in $HOME/.cognival_history
75
-
- readme: Shows this README file in less
76
-
- welcome: Shows the welcome message in less
77
-
- help / ?: Shows a brief overview over all commands
78
-
- quit / exit: Terminates the shell session.
79
-
- example-calls: Lists example calls for a single or all commands.
80
-
- browse: Browses the user directory and view files using vim, per default in read-only mode. (requires that vim is installed).
81
-
- update-vocabulary: Scans all imported cognitive sources and updates the vocabulary file.
82
-
- properties: Edit general CogniVal properties (user directory, etc.). Currently only used to set the directory for user
101
+
-`clear`: Clears the shell
102
+
-`history`: Shows the history of executed commands in descending order. The history is stored in $HOME/.cognival_history
103
+
-`readme`: Shows this README file in less
104
+
-`welcome`: Shows the welcome message in less (including the demo instructions)
105
+
-`help` or `?`: Shows a brief overview over all commands
106
+
-`quit` or `exit`: Terminates the shell session.
107
+
-`example-calls`: Lists example calls for a single or all commands.
108
+
-`browse`: Browses the user directory and view files using vim, per default in read-only mode. (requires that vim is installed).
109
+
-`update-vocabulary`: Scans all imported cognitive sources and updates the vocabulary file.
110
+
-`properties`: Edit general CogniVal properties (user directory, etc.). Currently only used to set the directory for user
83
111
data (embeddings, cognitive sources, configurations and results), in case this data should not reside
84
112
in $HOME (e.g. due to quota restrictions).
85
113
@@ -97,7 +125,7 @@ Note that the syntax is a simplified version of Python's, as strings and ints ca
97
125
98
126
Experiment details can either be viewed for a single cognitive source or for the entire configuration (this can be quite verbose!):
99
127
100
-
`config show details=True`
128
+
`config show details=True`
101
129
`config show details=True cognitive-source=eeg_zuco`
102
130
103
131
Call: `config show [details=False] [cognitive-source=None] [hide-random=True]`
@@ -126,7 +154,7 @@ Note that the syntax is a simplified version of Python's, as strings and ints ca
@@ -143,13 +171,11 @@ Note that the syntax is a simplified version of Python's, as strings and ints ca
143
171
144
172
- embeddings: Import and preprocess default embeddings (see CogniVal paper) as well as custom embeddings (word2vec compliant text/binary or BERT compliant). Allows to directly associate random baselines with the embeddings.
- random-baselines: Associate or re-associate (`force` parameter) embeddings with a set of random baselines. random baselines of a set are generated with different seeds and results are averaged during evaluation to increase robustness of significance testing.
150
-
151
-
The parameter `no-embeddings` specifies the number of "folds" to generate (default: 10). Generation is parallelized greedily across available CPU cores - 1.
152
-
177
+
- random-baselines: Associate or re-associate (`force` parameter) embeddings with a set of random baselines. random baselines of a set are generated with different seeds and results are averaged during evaluation to increase robustness of significance testing.
178
+
The parameter `no-embeddings` specifies the number of "folds" to generate (default: 10). Generation is parallelized greedily across available CPU cores - 1.
@@ -159,7 +185,7 @@ Note that the syntax is a simplified version of Python's, as strings and ints ca
159
185
- cognitive-sources: Lists imported cognitive sources along with their features (where applicable).
160
186
161
187
- run: Run all or a subset of experiments specified in a configuration. The parameters `embeddings`, `modalities` and `cognitive-sources` correspond to `config experiment`. Note that `cognitive-features` is a nested list that must specify features
162
-
for all cognitive-sources. Each inner list must be specified as semicolon-separated string within quotes.
188
+
for all cognitive-sources. Each inner list must be specified as semicolon-separated string within quotes.
0 commit comments