def generate_vocabs(datasets):
	"""Generates vocabularies from a list of data sets
	:param datasets (list): A list of data sets
	:return (dict): A dictionary of vocabs
	"""
	event_type_set = set()
	role_type_set = set()
	for dataset in datasets:
		event_type_set.update(dataset.event_type_set)
		role_type_set.update(dataset.role_type_set)

	# entity and trigger labels
	prefix = ['B', 'I']
	trigger_label_stoi = {'O': 0}

	for t in event_type_set:
		for p in prefix:
			trigger_label_stoi['{}-{}'.format(p, t)] = len(trigger_label_stoi)


	event_type_stoi = {k: i for i, k in enumerate(event_type_set, 1)}
	event_type_stoi['O'] = 0


	role_type_stoi = {k: i for i, k in enumerate(role_type_set, 1)}
	role_type_stoi['O'] = 0


	return {
		'event_type': event_type_stoi,
		'role_type': role_type_stoi,
		'trigger_label': trigger_label_stoi,
	}