Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorSanh committed Jan 3, 2022
1 parent ddc9026 commit 6c05f3b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions datasets/asset/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ def _info(self):
"original": datasets.Value("string"),
"simplification": datasets.Value("string"),
"original_sentence_id": datasets.Value("int32"),
"aspect": datasets.ClassLabel(
names=["meaning", "fluency", "simplicity"]
),
"aspect": datasets.ClassLabel(names=["meaning", "fluency", "simplicity"]),
"worker_id": datasets.Value("int32"),
"rating": datasets.Value("int32"),
}
Expand Down Expand Up @@ -156,8 +154,7 @@ def _generate_examples(self, filepaths, split):
"""Yields examples."""
if self.config.name == "simplification":
files = [open(filepaths[f"asset.{split}.orig"], encoding="utf-8")] + [
open(filepaths[f"asset.{split}.simp.{i}"], encoding="utf-8")
for i in range(10)
open(filepaths[f"asset.{split}.simp.{i}"], encoding="utf-8") for i in range(10)
]
for id_, lines in enumerate(zip(*files)):
yield id_, {
Expand Down

1 comment on commit 6c05f3b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Show benchmarks

PyArrow==3.0.0

Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.009843 / 0.011353 (-0.001510) 0.003904 / 0.011008 (-0.007104) 0.031481 / 0.038508 (-0.007027) 0.034857 / 0.023109 (0.011748) 0.322207 / 0.275898 (0.046309) 0.344873 / 0.323480 (0.021393) 0.007862 / 0.007986 (-0.000124) 0.003436 / 0.004328 (-0.000892) 0.008952 / 0.004250 (0.004702) 0.044485 / 0.037052 (0.007433) 0.311472 / 0.258489 (0.052983) 0.343893 / 0.293841 (0.050052) 0.030915 / 0.128546 (-0.097632) 0.008870 / 0.075646 (-0.066777) 0.255194 / 0.419271 (-0.164078) 0.048607 / 0.043533 (0.005074) 0.303943 / 0.255139 (0.048804) 0.328180 / 0.283200 (0.044981) 0.079444 / 0.141683 (-0.062239) 1.732815 / 1.452155 (0.280660) 1.777858 / 1.492716 (0.285141)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.264307 / 0.018006 (0.246301) 0.433563 / 0.000490 (0.433073) 0.019720 / 0.000200 (0.019520) 0.000267 / 0.000054 (0.000212)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.035581 / 0.037411 (-0.001830) 0.022151 / 0.014526 (0.007626) 0.032957 / 0.176557 (-0.143599) 0.071199 / 0.737135 (-0.665936) 0.033342 / 0.296338 (-0.262996)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.429065 / 0.215209 (0.213856) 4.287388 / 2.077655 (2.209734) 1.967294 / 1.504120 (0.463174) 1.760886 / 1.541195 (0.219691) 1.855493 / 1.468490 (0.387003) 0.444122 / 4.584777 (-4.140655) 4.689063 / 3.745712 (0.943351) 2.178263 / 5.269862 (-3.091599) 0.913808 / 4.565676 (-3.651869) 0.054430 / 0.424275 (-0.369845) 0.012509 / 0.007607 (0.004902) 0.538912 / 0.226044 (0.312867) 5.391182 / 2.268929 (3.122253) 2.385087 / 55.444624 (-53.059537) 1.940733 / 6.876477 (-4.935743) 1.932056 / 2.142072 (-0.210017) 0.565983 / 4.805227 (-4.239244) 0.123033 / 6.500664 (-6.377631) 0.061462 / 0.075469 (-0.014007)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.510488 / 1.841788 (-0.331300) 11.913742 / 8.074308 (3.839434) 26.933263 / 10.191392 (16.741871) 0.782111 / 0.680424 (0.101687) 0.505882 / 0.534201 (-0.028319) 0.489582 / 0.579283 (-0.089701) 0.501230 / 0.434364 (0.066866) 0.316597 / 0.540337 (-0.223741) 0.324413 / 1.386936 (-1.062524)
PyArrow==latest
Show updated benchmarks!

Benchmark: benchmark_array_xd.json

metric read_batch_formatted_as_numpy after write_array2d read_batch_formatted_as_numpy after write_flattened_sequence read_batch_formatted_as_numpy after write_nested_sequence read_batch_unformated after write_array2d read_batch_unformated after write_flattened_sequence read_batch_unformated after write_nested_sequence read_col_formatted_as_numpy after write_array2d read_col_formatted_as_numpy after write_flattened_sequence read_col_formatted_as_numpy after write_nested_sequence read_col_unformated after write_array2d read_col_unformated after write_flattened_sequence read_col_unformated after write_nested_sequence read_formatted_as_numpy after write_array2d read_formatted_as_numpy after write_flattened_sequence read_formatted_as_numpy after write_nested_sequence read_unformated after write_array2d read_unformated after write_flattened_sequence read_unformated after write_nested_sequence write_array2d write_flattened_sequence write_nested_sequence
new / old (diff) 0.008443 / 0.011353 (-0.002910) 0.004016 / 0.011008 (-0.006992) 0.029549 / 0.038508 (-0.008959) 0.033980 / 0.023109 (0.010871) 0.342978 / 0.275898 (0.067080) 0.357970 / 0.323480 (0.034490) 0.006280 / 0.007986 (-0.001706) 0.003536 / 0.004328 (-0.000792) 0.007319 / 0.004250 (0.003069) 0.040570 / 0.037052 (0.003518) 0.331401 / 0.258489 (0.072912) 0.361165 / 0.293841 (0.067324) 0.031739 / 0.128546 (-0.096807) 0.008990 / 0.075646 (-0.066656) 0.253439 / 0.419271 (-0.165832) 0.050829 / 0.043533 (0.007296) 0.329078 / 0.255139 (0.073939) 0.347287 / 0.283200 (0.064087) 0.079210 / 0.141683 (-0.062473) 1.766598 / 1.452155 (0.314443) 1.811423 / 1.492716 (0.318707)

Benchmark: benchmark_getitem_100B.json

metric get_batch_of_1024_random_rows get_batch_of_1024_rows get_first_row get_last_row
new / old (diff) 0.237700 / 0.018006 (0.219693) 0.426599 / 0.000490 (0.426109) 0.000653 / 0.000200 (0.000453) 0.000077 / 0.000054 (0.000023)

Benchmark: benchmark_indices_mapping.json

metric select shard shuffle sort train_test_split
new / old (diff) 0.034399 / 0.037411 (-0.003013) 0.021016 / 0.014526 (0.006491) 0.029829 / 0.176557 (-0.146727) 0.067717 / 0.737135 (-0.669418) 0.031078 / 0.296338 (-0.265261)

Benchmark: benchmark_iterating.json

metric read 5000 read 50000 read_batch 50000 10 read_batch 50000 100 read_batch 50000 1000 read_formatted numpy 5000 read_formatted pandas 5000 read_formatted tensorflow 5000 read_formatted torch 5000 read_formatted_batch numpy 5000 10 read_formatted_batch numpy 5000 1000 shuffled read 5000 shuffled read 50000 shuffled read_batch 50000 10 shuffled read_batch 50000 100 shuffled read_batch 50000 1000 shuffled read_formatted numpy 5000 shuffled read_formatted_batch numpy 5000 10 shuffled read_formatted_batch numpy 5000 1000
new / old (diff) 0.431379 / 0.215209 (0.216170) 4.306000 / 2.077655 (2.228345) 1.917283 / 1.504120 (0.413163) 1.720052 / 1.541195 (0.178857) 1.814728 / 1.468490 (0.346238) 0.444050 / 4.584777 (-4.140727) 4.631910 / 3.745712 (0.886198) 3.904950 / 5.269862 (-1.364911) 0.916641 / 4.565676 (-3.649036) 0.053668 / 0.424275 (-0.370607) 0.012051 / 0.007607 (0.004444) 0.538496 / 0.226044 (0.312451) 5.344455 / 2.268929 (3.075527) 2.381913 / 55.444624 (-53.062711) 2.039583 / 6.876477 (-4.836893) 2.086430 / 2.142072 (-0.055642) 0.553521 / 4.805227 (-4.251706) 0.121347 / 6.500664 (-6.379317) 0.061227 / 0.075469 (-0.014242)

Benchmark: benchmark_map_filter.json

metric filter map fast-tokenizer batched map identity map identity batched map no-op batched map no-op batched numpy map no-op batched pandas map no-op batched pytorch map no-op batched tensorflow
new / old (diff) 1.537771 / 1.841788 (-0.304016) 11.945272 / 8.074308 (3.870964) 27.182614 / 10.191392 (16.991222) 0.850638 / 0.680424 (0.170214) 0.531612 / 0.534201 (-0.002589) 0.498412 / 0.579283 (-0.080871) 0.512125 / 0.434364 (0.077762) 0.329865 / 0.540337 (-0.210473) 0.345828 / 1.386936 (-1.041108)

CML watermark

Please sign in to comment.