jordimas commited on
Commit
3fa91d6
1 Parent(s): 9379a24

New dataset

Browse files
.gitattributes CHANGED
@@ -27,3 +27,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
  MemoriesProjectesLliures.en-ca.ca filter=lfs diff=lfs merge=lfs -text
29
  MemoriesProjectesLliures.en-ca.en filter=lfs diff=lfs merge=lfs -text
 
 
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
  MemoriesProjectesLliures.en-ca.ca filter=lfs diff=lfs merge=lfs -text
29
  MemoriesProjectesLliures.en-ca.en filter=lfs diff=lfs merge=lfs -text
30
+ MemoriesProjectesLliures.tsv filter=lfs diff=lfs merge=lfs -text
MemoriesProjectesLliures.tsv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ecc65ea0efc8338d81a25bd7514cee0118736ba2fa12e337993929414ad71f66
3
+ size 78708161
MemoriesProjectesLliures.en-ca.ca → raw/MemoriesProjectesLliures.en-ca.ca RENAMED
File without changes
MemoriesProjectesLliures.en-ca.en → raw/MemoriesProjectesLliures.en-ca.en RENAMED
File without changes
raw/txt-to-tsv.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+
4
+
5
+ def generate_tsv(source_filename, target_filename, output_filename):
6
+
7
+ SEPARATOR = '\t'
8
+
9
+ with open(source_filename, "r") as source,\
10
+ open(target_filename, "r") as target,\
11
+ open(output_filename, "w") as output:
12
+
13
+ while True:
14
+
15
+ src = source.readline()
16
+ trg = target.readline()
17
+
18
+ if not (src and trg):
19
+ break
20
+
21
+ if SEPARATOR in src or SEPARATOR in trg:
22
+ continue
23
+
24
+ src = src.strip()
25
+ trg = trg.strip()
26
+
27
+ output.write(f"{src}{SEPARATOR}{trg}\n")
28
+
29
+
30
+ def main():
31
+
32
+ print("Generate TSV from a two text files")
33
+ generate_tsv("MemoriesProjectesLliures.en-ca.en", "MemoriesProjectesLliures.en-ca.ca", "MemoriesProjectesLliures.tsv")
34
+
35
+ if __name__ == "__main__":
36
+ main()