Skip to content

Commit 2ffecbc

Browse files
author
Adrian van der Lek
committed
Merge branch 'master' of github.com:DS3Lab/cognival-cli
2 parents 22e6d02 + bc14f77 commit 2ffecbc

File tree

1 file changed

+56
-30
lines changed

1 file changed

+56
-30
lines changed

README.md

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,24 @@ For practical purposes, this tool should be used. It is based on the original co
1717

1818
Feel free to report issues and bugs you encounter.
1919

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
2138
- Python 3.7.4 or newer
2239
- 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.)
2340
- 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
2845
- CuDNN >= 7.6.5
2946
- NVIDIA drivers >= 418.39 (can be determined with nvidia-smi)
3047
- 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`.
3266

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.
3667

3768
## Terminology
3869
- 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:
5687
- Generating an interactive HTML or static PDF report, showing both aggregate and detail statistics in tabular and plot form,
5788
as well as plots visualizing the training history and history of key statistics over different experimental runs.
5889

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`.
6490

6591
## Overview of commands
6692
`<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:
94+
`command argument`
95+
Otherwise, each parameter must be named:
96+
`command parameter1=argument2 parameter2=argument2`
6997

7098
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]`).
7199

72100
### 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
83111
data (embeddings, cognitive sources, configurations and results), in case this data should not reside
84112
in $HOME (e.g. due to quota restrictions).
85113

@@ -97,7 +125,7 @@ Note that the syntax is a simplified version of Python's, as strings and ints ca
97125

98126
Experiment details can either be viewed for a single cognitive source or for the entire configuration (this can be quite verbose!):
99127

100-
`config show details=True`
128+
`config show details=True`
101129
`config show details=True cognitive-source=eeg_zuco`
102130

103131
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
126154
`config delete cognitive-sources=[eeg_zuco] embeddings=[glove.6B.50]`
127155

128156
Deleting cognitive sources:
129-
`config delete cognitive-sources=[eeg_zuco]`
157+
`config delete cognitive-sources=[eeg_zuco]`
130158
`config delete modalities=[eeg_zuco]`
131159

132160
Deleting configurations:
@@ -143,13 +171,11 @@ Note that the syntax is a simplified version of Python's, as strings and ints ca
143171

144172
- 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.
145173

146-
Default embeddings: `import embeddings glove.6B.50`
174+
Default embeddings: `import embeddings glove.6B.50`
147175
Custom embeddings: `import embeddings http://example.org/example.zip`
148176

149-
- 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.
153179
Call: `import random-baselines embeddings=glove.6B.50 [num-baselines=10] [seed-func=exp_e_floored] [force=False]`
154180

155181
- list
@@ -159,7 +185,7 @@ Note that the syntax is a simplified version of Python's, as strings and ints ca
159185
- cognitive-sources: Lists imported cognitive sources along with their features (where applicable).
160186

161187
- 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.
163189
Call: `run [embeddings=[all]] [modalities=None] [cognitive-sources=[all]] [cognitive-features=None] [baselines=True]`
164190

165191
- significance: Compute the significance of results of an experimental run. Note that this requires that random baselines have been

0 commit comments

Comments
 (0)