generate_dictionary function

Create a data dictionary from labelled data