extra dataset only target
Browse files- create_dataset_from_tsv.py +6 -3
- tsv_all_target/dev.tsv +3 -0
- tsv_all_target/test.tsv +3 -0
- tsv_all_target/train.tsv +3 -0
create_dataset_from_tsv.py
CHANGED
@@ -38,6 +38,9 @@ reverse = data[['rev_source','rev_target']]
|
|
38 |
reverse.columns=['source','target']
|
39 |
|
40 |
data = pd.concat([original,reverse])
|
|
|
|
|
|
|
41 |
data = data.sample(frac=1).reset_index(drop=True)
|
42 |
|
43 |
# Train - test - dev
|
@@ -45,9 +48,9 @@ train, test = train_test_split(data, test_size=0.2)
|
|
45 |
test, dev = train_test_split(test, test_size=0.5)
|
46 |
|
47 |
# Write the datasets to disk
|
48 |
-
train.to_csv('
|
49 |
-
test.to_csv('
|
50 |
-
dev.to_csv('
|
51 |
|
52 |
|
53 |
print("Finished")
|
|
|
38 |
reverse.columns=['source','target']
|
39 |
|
40 |
data = pd.concat([original,reverse])
|
41 |
+
#remove the source prefix
|
42 |
+
data['source'] = data['source'].str[4:]
|
43 |
+
|
44 |
data = data.sample(frac=1).reset_index(drop=True)
|
45 |
|
46 |
# Train - test - dev
|
|
|
48 |
test, dev = train_test_split(test, test_size=0.5)
|
49 |
|
50 |
# Write the datasets to disk
|
51 |
+
train.to_csv('tsv_all_target/train.tsv', index=False, header=False, sep='\t')
|
52 |
+
test.to_csv('tsv_all_target/test.tsv', index=False, header=False, sep='\t')
|
53 |
+
dev.to_csv('tsv_all_target/dev.tsv', index=False, header=False, sep='\t')
|
54 |
|
55 |
|
56 |
print("Finished")
|
tsv_all_target/dev.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:bafec9a720bd6d312c3f6ce0ee952b99c0149083f650b8f763cd0301c342cabf
|
3 |
+
size 24631704
|
tsv_all_target/test.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6383084ac8d6bf085b25c764dc696905169c901db0426bd73af6ad3bb26e84dc
|
3 |
+
size 24665511
|
tsv_all_target/train.tsv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d267f23033a53cc1cd70c38424ebcf7624128f3c8870bef1d73069cc52df29b
|
3 |
+
size 197147597
|