# coding=utf-8 # """AMI summary dataset.""" import json import datasets _CITATION = """\ @inproceedings{10.1007/11677482_3, author = {Carletta, Jean and Ashby, Simone and Bourban, Sebastien and Flynn, Mike and Guillemot, Mael and Hain, Thomas and Kadlec, Jaroslav and Karaiskos, Vasilis and Kraaij, Wessel and Kronenthal, Melissa and Lathoud, Guillaume and Lincoln, Mike and Lisowska, Agnes and McCowan, Iain and Post, Wilfried and Reidsma, Dennis and Wellner, Pierre}, title = {The AMI Meeting Corpus: A Pre-Announcement}, year = {2005}, isbn = {3540325492}, publisher = {Springer-Verlag}, address = {Berlin, Heidelberg}, url = {https://doi.org/10.1007/11677482_3}, doi = {10.1007/11677482_3}, abstract = {The AMI Meeting Corpus is a multi-modal data set consisting of 100 hours of meeting recordings. It is being created in the context of a project that is developing meeting browsing technology and will eventually be released publicly. Some of the meetings it contains are naturally occurring, and some are elicited, particularly using a scenario in which the participants play different roles in a design team, taking a design project from kick-off to completion over the course of a day. The corpus is being recorded using a wide range of devices including close-talking and far-field microphones, individual and room-view video cameras, projection, a whiteboard, and individual pens, all of which produce output signals that are synchronized with each other. It is also being hand-annotated for many different phenomena, including orthographic transcription, discourse properties such as named entities and dialogue acts, summaries, emotions, and some head and hand gestures. We describe the data set, including the rationale behind using elicited material, and explain how the material is being recorded, transcribed and annotated.}, booktitle = {Proceedings of the Second International Conference on Machine Learning for Multimodal Interaction}, pages = {28–39}, numpages = {12}, location = {Edinburgh, UK}, series = {MLMI'05} } """ _DESCRIPTION = """\ The AMI Meeting Corpus consists of 100 hours of meeting recordings. The recordings use a range of signals synchronized to a common timeline. These include close-talking and far-field microphones, individual and room-view video cameras, and output from a slide projector and an electronic whiteboard. During the meetings, the participants also have unsynchronized pens available to them that record what is written. The meetings were recorded in English using three different rooms with different acoustic properties, and include mostly non-native speakers. \n """ _HOMEPAGE = "https://groups.inf.ed.ac.uk/ami/corpus/" _LICENSE = "CC BY 4.0" _BASE_DATA_URL = "https://huggingface.co/datasets/yuanpj/ami_summ/resolve/main/data/" _SPLIT_URL = _BASE_DATA_URL + "{split}.json" logger = datasets.utils.logging.get_logger(__name__) class AmisummConfig(datasets.BuilderConfig): """BuilderConfig for the summary subset of AMI Corpus.""" def __init__(self, name, *args, **kwargs): """BuilderConfig for the summary subset of AMI Corpus""" super().__init__(name=name, *args, **kwargs) class Amisumm(datasets.GeneratorBasedBuilder): """AMI summary dataset.""" VERSION = datasets.Version("1.0.0") BUILDER_CONFIGS = [AmisummConfig(name="ami_summ")] def _info(self): features = datasets.Features( { "sample_id": datasets.Value("string"), "dialogue": [ { "id": datasets.Value("string"), "speaker": datasets.Value("string"), "starttime": datasets.Value("string"), "startwordid": datasets.Value("string"), "endtime": datasets.Value("string"), "endwordid": datasets.Value("string"), "text": datasets.Value("string"), "label": datasets.Value("string"), "attributes": datasets.Value("string"), } ], "summary": [ { "id": datasets.Value("string"), "text": datasets.Value("string"), "type": datasets.Value("string"), } ], } ) # TODO: add license return datasets.DatasetInfo( description=_DESCRIPTION, features=features, supervised_keys=None, homepage=_HOMEPAGE, license=_LICENSE, citation=_CITATION, ) def _split_generators(self, dl_manager): """Returns SplitGenerators.""" split_urls = {} for split in ["train", "val", "test"]: split_urls[split] = _SPLIT_URL.format(split=split) file_paths = dl_manager.download(split_urls) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={ "path": file_paths["train"], }, ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={ "path": file_paths["val"], }, ), datasets.SplitGenerator( name=datasets.Split.TEST, gen_kwargs={ "path": file_paths["test"], }, ), ] def _generate_examples(self, path): """Yields examples.""" data = json.load(open(path, "r", encoding="utf-8")) for example in data: yield example["sample_id"], example