pheepa commited on
Commit
08b0d82
1 Parent(s): 41c919b
Files changed (1) hide show
  1. jira-comments.py +11 -22
jira-comments.py CHANGED
@@ -22,25 +22,15 @@ _REPO = "https://huggingface.co/datasets/pheepa/jira-comments/resolve/main"
22
  _URL = f"{_REPO}/data/jira-comments.tar.gz"
23
 
24
 
25
- class JiraCommentsConfig(datasets.BuilderConfig):
26
- """BuilderConfig for BookCorpus."""
27
-
28
- def __init__(self, split, **kwargs):
29
- """BuilderConfig for BookCorpus.
30
- Args:
31
- **kwargs: keyword arguments forwarded to super.
32
- """
33
- super(JiraCommentsConfig, self).__init__(name='jira-comments', split=split, version=datasets.Version("1.0.0", ""), **kwargs)
34
-
35
- self.path = f"{split}-jira-comments.txt"
36
-
37
-
38
  class JiraComments(datasets.GeneratorBasedBuilder):
39
  """JiraComments dataset."""
40
 
41
  BUILDER_CONFIGS = [
42
- JiraCommentsConfig(name='jira-comments', split='train', description="Train split (75%)"),
43
- JiraCommentsConfig(name='jira-comments', split='test', description="Test split (25%)"),
 
 
 
44
  ]
45
 
46
 
@@ -53,22 +43,21 @@ class JiraComments(datasets.GeneratorBasedBuilder):
53
  }
54
  ),
55
  supervised_keys=None,
56
- citation=_CITATION,
57
  )
58
 
59
  def _split_generators(self, dl_manager):
60
  """Returns SplitGenerators."""
61
  data_dir = dl_manager.download_and_extract(_URL)
 
62
  return [
63
  datasets.SplitGenerator(
64
- name='jira-comments',
65
- split=datasets.Split.TRAIN,
66
- gen_kwargs={"filepath": os.path.join(data_dir, self.config.path)}
67
  ),
68
  datasets.SplitGenerator(
69
- name='jira-comments'
70
- split=datasets.Split.TEST,
71
- gen_kwargs={"filepath": os.path.join(data_dir, self.config.path)}
72
  )
73
  ]
74
 
 
22
  _URL = f"{_REPO}/data/jira-comments.tar.gz"
23
 
24
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  class JiraComments(datasets.GeneratorBasedBuilder):
26
  """JiraComments dataset."""
27
 
28
  BUILDER_CONFIGS = [
29
+ datasets.BuilderConfig(
30
+ name='jira-comments',
31
+ version=datasets.Version("1.0.0"),
32
+ description=_DESCRIPTION
33
+ )
34
  ]
35
 
36
 
 
43
  }
44
  ),
45
  supervised_keys=None,
46
+ citation=_CITATION
47
  )
48
 
49
  def _split_generators(self, dl_manager):
50
  """Returns SplitGenerators."""
51
  data_dir = dl_manager.download_and_extract(_URL)
52
+
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, "test-jira-comments.txt")}
 
61
  )
62
  ]
63