imthanhlv commited on
Commit
a691575
1 Parent(s): c0c3c21

update script

Browse files
Files changed (1) hide show
  1. binhvq_dedup.py +7 -5
binhvq_dedup.py CHANGED
@@ -2,6 +2,7 @@ import datasets
2
  import os
3
  import logging
4
  import lm_dataformat
 
5
 
6
 
7
  _DESC = """
@@ -43,9 +44,9 @@ class BinhvqConfig(datasets.BuilderConfig):
43
  class Binhvq(datasets.GeneratorBasedBuilder):
44
  BUILDER_CONFIGS = [
45
  BinhvqConfig(
46
- name="plain_text",
47
  version=datasets.Version("1.0.0", ""),
48
- description="Plain text",
49
  ),
50
  ]
51
 
@@ -71,7 +72,8 @@ class Binhvq(datasets.GeneratorBasedBuilder):
71
 
72
  def _generate_examples(self, filepath):
73
  logging.info(f"Generating examples from {filepath}")
 
74
  reader = lm_dataformat.Reader(filepath)
75
- for doc in reader.stream_data():
76
- yield {"text": doc}
77
-
 
2
  import os
3
  import logging
4
  import lm_dataformat
5
+ from tqdm import tqdm
6
 
7
 
8
  _DESC = """
 
44
  class Binhvq(datasets.GeneratorBasedBuilder):
45
  BUILDER_CONFIGS = [
46
  BinhvqConfig(
47
+ name="text",
48
  version=datasets.Version("1.0.0", ""),
49
+ description="Text",
50
  ),
51
  ]
52
 
 
72
 
73
  def _generate_examples(self, filepath):
74
  logging.info(f"Generating examples from {filepath}")
75
+ _id = 0
76
  reader = lm_dataformat.Reader(filepath)
77
+ for doc in tqdm(reader.stream_data()):
78
+ yield _id, {"text": doc}
79
+ _id += 1