update
Browse files- data/dev.txt +0 -0
- data/test.txt +0 -0
- data/train.txt +0 -0
- generate_dataset.py +9 -19
data/dev.txt
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test.txt
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train.txt
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
generate_dataset.py
CHANGED
|
@@ -16,19 +16,16 @@ for file in [train_file, dev_file, test_file]:
|
|
| 16 |
with open(file, "w") as f:
|
| 17 |
f.write("")
|
| 18 |
|
| 19 |
-
|
| 20 |
-
f1 = open(train_file, "a")
|
| 21 |
-
f2 = open(dev_file, "a")
|
| 22 |
-
f3 = open(test_file, "a")
|
| 23 |
-
|
| 24 |
-
f = f1
|
| 25 |
content = ""
|
| 26 |
for j, s in enumerate(sentences):
|
| 27 |
-
if j
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
| 32 |
f.write(content)
|
| 33 |
content = ""
|
| 34 |
logger.info(j)
|
|
@@ -42,11 +39,4 @@ for j, s in enumerate(sentences):
|
|
| 42 |
tag = "I-W"
|
| 43 |
content += token + "\t" + tag + "\n"
|
| 44 |
content += "\n"
|
| 45 |
-
|
| 46 |
-
f.write(content)
|
| 47 |
-
content = ""
|
| 48 |
-
logger.info(j)
|
| 49 |
-
|
| 50 |
-
f1.close()
|
| 51 |
-
f2.close()
|
| 52 |
-
f3.close()
|
|
|
|
| 16 |
with open(file, "w") as f:
|
| 17 |
f.write("")
|
| 18 |
|
| 19 |
+
f = open(train_file, "a")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
content = ""
|
| 21 |
for j, s in enumerate(sentences):
|
| 22 |
+
if j == 8000:
|
| 23 |
+
f.close()
|
| 24 |
+
f = open(dev_file, "a")
|
| 25 |
+
if j == 9000:
|
| 26 |
+
f.close()
|
| 27 |
+
f = open(test_file, "a")
|
| 28 |
+
if j % 1000 == 999:
|
| 29 |
f.write(content)
|
| 30 |
content = ""
|
| 31 |
logger.info(j)
|
|
|
|
| 39 |
tag = "I-W"
|
| 40 |
content += token + "\t" + tag + "\n"
|
| 41 |
content += "\n"
|
| 42 |
+
f.close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|