Datasets:
Tasks:
Text Generation
Formats:
parquet
Sub-tasks:
language-modeling
Languages:
Danish
Size:
10M - 100M
ArXiv:
DOI:
License:
Fixed rounding error in average tokens
Browse files
src/dynaword/descriptive_stats.py
CHANGED
@@ -41,7 +41,7 @@ class DescriptiveStatsOverview:
|
|
41 |
@property
|
42 |
def average_document_length_tokens(self) -> float:
|
43 |
return (
|
44 |
-
self.number_of_tokens / self.number_of_samples
|
45 |
if self.number_of_samples > 0
|
46 |
else 0.0
|
47 |
)
|
@@ -49,7 +49,7 @@ class DescriptiveStatsOverview:
|
|
49 |
@property
|
50 |
def average_document_length_characters(self) -> float:
|
51 |
return (
|
52 |
-
self.number_of_characters / self.number_of_samples
|
53 |
if self.number_of_samples > 0
|
54 |
else 0.0
|
55 |
)
|
|
|
41 |
@property
|
42 |
def average_document_length_tokens(self) -> float:
|
43 |
return (
|
44 |
+
round(self.number_of_tokens / self.number_of_samples, 2)
|
45 |
if self.number_of_samples > 0
|
46 |
else 0.0
|
47 |
)
|
|
|
49 |
@property
|
50 |
def average_document_length_characters(self) -> float:
|
51 |
return (
|
52 |
+
round(self.number_of_characters / self.number_of_samples, 2)
|
53 |
if self.number_of_samples > 0
|
54 |
else 0.0
|
55 |
)
|