Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
webdataset
Languages:
English
Size:
< 1K
Tags:
jira
labels
Browse files- jira-comments.py +7 -4
jira-comments.py
CHANGED
@@ -53,16 +53,19 @@ class JiraComments(datasets.GeneratorBasedBuilder):
|
|
53 |
return [
|
54 |
datasets.SplitGenerator(
|
55 |
name=datasets.Split.TRAIN,
|
56 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "train-jira-comments.txt")}
|
57 |
),
|
58 |
datasets.SplitGenerator(
|
59 |
name=datasets.Split.TEST,
|
60 |
-
gen_kwargs={"filepath": os.path.join(data_dir,
|
61 |
)
|
62 |
]
|
63 |
|
64 |
def _generate_examples(self, filepath):
|
65 |
"""Yields examples."""
|
66 |
with open(filepath, 'r') as f:
|
67 |
-
|
68 |
-
|
|
|
|
|
|
|
|
53 |
return [
|
54 |
datasets.SplitGenerator(
|
55 |
name=datasets.Split.TRAIN,
|
56 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "train-pairs-jira-comments.txt")}
|
57 |
),
|
58 |
datasets.SplitGenerator(
|
59 |
name=datasets.Split.TEST,
|
60 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "test-pairs-jira-comments.txt")}
|
61 |
)
|
62 |
]
|
63 |
|
64 |
def _generate_examples(self, filepath):
|
65 |
"""Yields examples."""
|
66 |
with open(filepath, 'r') as f:
|
67 |
+
triples = f.read()
|
68 |
+
|
69 |
+
for id_, line in enumerate(range(0, len(triples), 3)):
|
70 |
+
l, a, b = line.split('\n')
|
71 |
+
yield id_, {"text": ' '.join([a, b]), 'labels': int(l)}
|