update
Browse files- statistics.py +23 -3
statistics.py
CHANGED
|
@@ -1,3 +1,23 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from os.path import dirname, join
|
| 2 |
+
|
| 3 |
+
def count_lines(filepath):
|
| 4 |
+
with open(filepath, encoding="utf-8") as f:
|
| 5 |
+
lines = f.read().splitlines()
|
| 6 |
+
return len(lines)
|
| 7 |
+
|
| 8 |
+
def statistic(subset_folder):
|
| 9 |
+
print("Train\t\t", count_lines(join(subset_folder, "train.txt")))
|
| 10 |
+
print("Validation\t", count_lines(join(subset_folder, "validation.txt")))
|
| 11 |
+
print("Test\t\t", count_lines(join(subset_folder, "test.txt")))
|
| 12 |
+
|
| 13 |
+
pwd = dirname(__file__)
|
| 14 |
+
dataset_folder = join(pwd, "data")
|
| 15 |
+
|
| 16 |
+
print("Subset Small")
|
| 17 |
+
statistic(join(dataset_folder, "small"))
|
| 18 |
+
|
| 19 |
+
print("Subset Base")
|
| 20 |
+
statistic(join(dataset_folder, "base"))
|
| 21 |
+
|
| 22 |
+
print("Subset Large")
|
| 23 |
+
statistic(join(dataset_folder, "large"))
|