Zeb commited on
Commit
a245e72
1 Parent(s): 89e27fb

Strip data

Browse files
BabyLM.py CHANGED
@@ -131,7 +131,7 @@ class BabyLM(datasets.GeneratorBasedBuilder):
131
  filename = row.strip()
132
  continue
133
  if is_tags:
134
- yield global_idx, {"text": text, "tagged_text": row, "filename": filename}
135
  global_idx += 1
136
  is_tags = False
137
  else:
 
131
  filename = row.strip()
132
  continue
133
  if is_tags:
134
+ yield global_idx, {"text": text.strip(), "tagged_text": row.strip(), "filename": filename}
135
  global_idx += 1
136
  is_tags = False
137
  else:
clean/100M/open_subtitles.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:15ebde7711ac44bf8aaaad41fe6351393fe75c62f9b4672c507576c7c66eb3b3
3
- size 162139191
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a44b1b3a9893597b4bc0693bec307573783b9c35a01718502e5b565e2595fce6
3
+ size 162139182
tag_data.py CHANGED
@@ -106,6 +106,7 @@ def write_tagged_lines(filename, text, tagged_lines):
106
  tokenizer = AutoTokenizer.from_pretrained("CamBabyTrainers/BabyBERTa-3-8192-tokenizer")
107
 
108
  FOLDERS = ['10M', '100M', 'dev', 'test']
 
109
 
110
  if __name__ == "__main__":
111
 
@@ -114,7 +115,7 @@ if __name__ == "__main__":
114
  for folder in FOLDERS:
115
  for root, dirs, files in os.walk(f"clean/{folder}"):
116
  for file in files:
117
- if file.endswith(".txt"):
118
  all_files.append(os.path.join(root, file))
119
 
120
  # Get map from PTB tags to universal tags
@@ -150,3 +151,7 @@ if __name__ == "__main__":
150
  new_file = file.replace('clean', 'tagged_gold')
151
  os.makedirs(os.path.dirname(new_file), exist_ok=True)
152
  write_tagged_lines(new_file, lines, gold_tagged_lines)
 
 
 
 
 
106
  tokenizer = AutoTokenizer.from_pretrained("CamBabyTrainers/BabyBERTa-3-8192-tokenizer")
107
 
108
  FOLDERS = ['10M', '100M', 'dev', 'test']
109
+ FILENAMES = ['qed.txt', 'switchboard.txt']
110
 
111
  if __name__ == "__main__":
112
 
 
115
  for folder in FOLDERS:
116
  for root, dirs, files in os.walk(f"clean/{folder}"):
117
  for file in files:
118
+ if file.endswith(".txt") and file.split('/')[-1] in FILENAMES:
119
  all_files.append(os.path.join(root, file))
120
 
121
  # Get map from PTB tags to universal tags
 
151
  new_file = file.replace('clean', 'tagged_gold')
152
  os.makedirs(os.path.dirname(new_file), exist_ok=True)
153
  write_tagged_lines(new_file, lines, gold_tagged_lines)
154
+
155
+
156
+ os.remove('tmp.txt')
157
+ os.remove('tmp_tagged.txt')
tagged/100M/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e3f403fc460f5c6e116f0d460ff473aa5db355e94b56a3b1a15d138e706772ac
3
- size 287786495
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bb8331ac5ee04908bad5b87fe873d367d6e2b27dc90d81fd76f23da0ad80357
3
+ size 285761401
tagged/100M/switchboard.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:35e49daf5376ff13def3784278e42ac6cef5bd8f5a05e6993f7177a1041ead0f
3
- size 34573221
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50d6c3d94fa08d2adc4152af2eecb1881b7dec32b003edfe71a0ff8e4ceb7860
3
+ size 34572605
tagged/10M/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:398bdc6a937bbb8f642e1220a5a7bc625af82d1b37cc49ca0d8d3abce7a4348d
3
- size 29362437
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b92eda693ff3f59fce72387d538945ef859bce739798347f0eaffce0e6ffbdc
3
+ size 29062685
tagged/10M/switchboard.txt CHANGED
The diff for this file is too large to render. See raw diff
 
tagged/dev/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:18e33e09de9e1a87782d6287e55df31d9b7beaa7d163208f030e6ae1b7884cd5
3
- size 27146777
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:43bb6072b65b56859f44900162ad049518bba3f84e96a978ffbae7a7222fa1f2
3
+ size 26965217
tagged/dev/switchboard.txt CHANGED
The diff for this file is too large to render. See raw diff
 
tagged/test/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:958e3e09e697adb709b8f9a608d06cff185fd15a316fa9e7d37d1a0f8bf4b702
3
- size 33826636
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7de66d6908250d7a5024a4bf1150a3e15efb80ead0a447f74aa361dd574c8ecc
3
+ size 33511376
tagged/test/switchboard.txt CHANGED
The diff for this file is too large to render. See raw diff
 
tagged_gold/100M/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:58e81b7d616f612f43d11b656b1a14a8bfc19549f7902f09b824a2e78e168e00
3
- size 287086795
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c74224a9a9583b0c06a9cb6f8c7aaf4596dc5752994083a646d26c11647a5a53
3
+ size 285012660
tagged_gold/100M/switchboard.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:678b858800f9ad99428b73d7138033646c4b2faaa174f39001be38f5fc68e5da
3
- size 34293159
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5a01c2f3968709b9975ab77fc1db74be45d00b4c321301f9d4e54f45d98d3005
3
+ size 34296376
tagged_gold/10M/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cb87c82f221102da04efa894d7b86295b45e33ccd41ad41e4c32eb8694328389
3
- size 29288906
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d52bb038cf8a7228bfcbe515cace993b5136d2f44813243c554cde38c93a1389
3
+ size 28982300
tagged_gold/10M/switchboard.txt CHANGED
The diff for this file is too large to render. See raw diff
 
tagged_gold/dev/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:636bc574c1043bdbebbb27cb9ed229df420b77c0514068b1c9af49096ee53a77
3
- size 27085998
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7222b290d0a6e411a92b7339e48eed99cc8671474732c115ae39a3bf6fda13c
3
+ size 26899649
tagged_gold/dev/switchboard.txt CHANGED
The diff for this file is too large to render. See raw diff
 
tagged_gold/test/qed.txt CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:887097ac23d36d1b375678623454523c7a2d3311d593d25a6d2837dd1db76fc3
3
- size 33745085
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79103249d1c287537695108b0d5e853128d7248aae130afb432c4c144b1258ab
3
+ size 33423852
tagged_gold/test/switchboard.txt CHANGED
The diff for this file is too large to render. See raw diff