<commit_before># Preprocessing

Preprocess data using external libraries.

### Eventual Dependencies
* natsort: `pip install natsort`
* Caffe
* [sklearn-theano](https://github.com/sklearn-theano/sklearn-theano)
* [imageio](https://github.com/imageio/imageio.git)

### Converting a video dataset to hdf5
Dependencies: `avconv` or `ffmpeg`, `h5py`.
Assume the following folder structure:
```
root
|-dataset
  |-video_class_1
    |-video_1.avi
    |-video_2.avi
  |-video_class_2
  ...
```

We want to convert all the videos to a single hdf5 tensor. To do that,
we use the `convert_dataset_to_hdf5` that calls `convert_videos_to_hdf5`
recursively on each folder. Also, we want a second matrix with the labels of
each video given by the folder name. From the `root` directory we do the
following:<commit_msg>Update preprocessing README.md<commit_after># Preprocessing

Preprocess data using external libraries.

### Eventual Dependencies
* natsort: `pip install natsort`
* Caffe
* [sklearn-theano](https://github.com/sklearn-theano/sklearn-theano)
* [imageio](https://github.com/imageio/imageio.git)

### Converting a video dataset to hdf5
Dependencies: `avconv` or `ffmpeg`, `h5py`.
Assume the following folder structure:
```
root
|-dataset
  |-video_class_1
    |-video_1.avi
    |-video_2.avi
  |-video_class_2
  ...
```

We want to convert all the videos to a single hdf5 tensor. That dataset will be
called `'data'` inside the hdf5. To do that,
we use the `convert_dataset_to_hdf5` that calls `convert_videos_to_hdf5`
recursively on each class folder. Also, on the same hdf5 we want a second matrix, called
`'labels'`, with the labels of each video given by the folder name. From the `root` directory we do the
following:
{'fraction_non_alphanumeric': 0.10569105691056911, 'fraction_numerical': 0.011614401858304297, 'mean_word_length': 4.576051779935275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3600086', 'n_tokens_mistral': 590, 'n_tokens_neox': 559, 'n_words': 195}