text and sum in one file
Browse files- .gitattributes +1 -0
- ami-summary.py +69 -0
.gitattributes
CHANGED
|
@@ -52,3 +52,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
| 53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
| 54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
| 55 |
+
data/ami-summary.tar.gz filter=lfs diff=lfs merge=lfs -text
|
ami-summary.py
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import datasets
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
_DESCRIPTION = """\
|
| 5 |
+
Dataset of meeting transcriptions and summaries of AMI courpus.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
_CITATION = """\
|
| 9 |
+
@InProceedings{Zhu_2015_ICCV,
|
| 10 |
+
title = {AMI for summarization task},
|
| 11 |
+
author = {Filipp Abapolov},
|
| 12 |
+
month = {Fubruary},
|
| 13 |
+
year = {2023}
|
| 14 |
+
}
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
_REPO = "https://huggingface.co/datasets/pheepa/ami-summary/resolve/main"
|
| 18 |
+
_URL = f"{_REPO}/data/ami-summary.tar.gz"
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class AmiSummary(datasets.GeneratorBasedBuilder):
|
| 22 |
+
"""AmiSummary dataset."""
|
| 23 |
+
|
| 24 |
+
BUILDER_CONFIGS = [
|
| 25 |
+
datasets.BuilderConfig(
|
| 26 |
+
name='ami-summary',
|
| 27 |
+
version=datasets.Version("1.0.0"),
|
| 28 |
+
description=_DESCRIPTION
|
| 29 |
+
)
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
def _info(self):
|
| 33 |
+
return datasets.DatasetInfo(
|
| 34 |
+
description=_DESCRIPTION,
|
| 35 |
+
features=datasets.Features(
|
| 36 |
+
{
|
| 37 |
+
"text": datasets.Value("string"),
|
| 38 |
+
"summary": datasets.Value("string")
|
| 39 |
+
}
|
| 40 |
+
),
|
| 41 |
+
supervised_keys=None,
|
| 42 |
+
citation=_CITATION
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
def _split_generators(self, dl_manager):
|
| 46 |
+
"""Returns SplitGenerators."""
|
| 47 |
+
data_dir = dl_manager.download_and_extract(_URL)
|
| 48 |
+
|
| 49 |
+
return [
|
| 50 |
+
datasets.SplitGenerator(
|
| 51 |
+
name=datasets.Split.TRAIN,
|
| 52 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "train_ami.txt")}
|
| 53 |
+
),
|
| 54 |
+
datasets.SplitGenerator(
|
| 55 |
+
name=datasets.Split.TEST,
|
| 56 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "test_ami.txt")}
|
| 57 |
+
)
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
def _generate_examples(self, filepath):
|
| 61 |
+
"""Yields examples."""
|
| 62 |
+
with open(filepath, 'r') as f:
|
| 63 |
+
lines = f.read().split('\n')
|
| 64 |
+
pairs = []
|
| 65 |
+
for i in range(0, len(lines), 2):
|
| 66 |
+
pairs.append((lines[i], lines[i + 1]))
|
| 67 |
+
|
| 68 |
+
for i, comment in enumerate(pairs):
|
| 69 |
+
yield i, {'text': pairs[0], 'summary': pairs[1]}
|