license:cc0-1.0 size_categories:10K<n<100K region:us
---
license: cc0-1.0
size_categories:
- 10K<n<100K
---
This repository contains the speech BCI data kindly made available by Willett, Kunz, Fan, *et al*. [here](https://datadryad.org/stash/dataset/doi:10.5061/dryad.x69p8czpq), 
reformatted to make it easier to use for machine learning experiments. The data is in the public domain.

The repository contains three `.npz` files: `train.npz`, `val.npz`, and `test.npz`, containing the training, validation (or development), and test sets, respectively.
The test set contains the evaluation data used for the Brain-to-Text '24 competition [here](https://eval.ai/web/challenges/challenge-page/2099/overview).

Each file contains the following keys for each trial:

* `'sentence'`: target sentence (dtype: `<U87`)
* `'spike_power'`: spike power in all channels (dtype: `float32`)
* `'tx1'`: number of threshold crossings with a threshold of -3.5 x RMS (dtype: `uint8`)
* `'tx2'`: number of threshold crossings with a threshold of -4.5 x RMS (dtype: `uint8`)
* `'tx3'`: number of threshold crossings with a threshold of -5.5 x RMS (dtype: `uint8`)
* `'tx4'`: number of threshold crossings with a threshold of -6.5 x RMS (dtype: `uint8`)
* `'block_id'`: an integer index representing the experimental block id (dtype: `uint8`)
* `'day_id'`: an integer index representing the recording date (dtype: `uint8`)

The neural features in `'spike_power'`, `'tx1'`, `'tx2'`, `'tx3'`, `'tx4'` all have the shape `T x 256`, where `T` is the number of time bins in the corresponding trial and
`256` is the number of electrodes. To access, for example, the spike power data for the first trial of the training set, after downloading the corresponding file, 
you can do something like this:
```python
import numpy as np

data = np.load('train.npz', allow_pickle=True)

x = data['spike_power'][0]
```
and similarly for the other features and trials. The training set contains a total of **8800** trials, the validation set contains **880** trials 
and the test set contains **1200** trials (with the target sentences missing in the test set since they are held out for the Brain-to-Text competition).