Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    TypeError
Message:      Couldn't cast array of type struct<a_href: string, valid_from: string, valid_to: string> to null
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 99, in get_rows_or_raise
                  return get_rows(
                         ^^^^^^^^^
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/utils.py", line 77, in get_rows
                  rows_plus_one = list(itertools.islice(ds, rows_max_number + 1))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2690, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2227, in __iter__
                  for key, pa_table in self._iter_arrow():
                                       ^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 2251, in _iter_arrow
                  for key, pa_table in self.ex_iterable._iter_arrow():
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 494, in _iter_arrow
                  for key, pa_table in iterator:
                                       ^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/iterable_dataset.py", line 384, in _iter_arrow
                  for key, pa_table in self.generate_tables_fn(**gen_kwags):
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 289, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 124, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2272, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2224, in cast_table_to_schema
                  cast_array_to_feature(
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 1795, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2052, in cast_array_to_feature
                  casted_array_values = _c(array.values, feature.feature)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 1797, in wrapper
                  return func(array, *args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2086, in cast_array_to_feature
                  return array_cast(
                         ^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 1797, in wrapper
                  return func(array, *args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 1950, in array_cast
                  raise TypeError(f"Couldn't cast array of type {_short_str(array.type)} to {_short_str(pa_type)}")
              TypeError: Couldn't cast array of type struct<a_href: string, valid_from: string, valid_to: string> to null

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

##Ontario Laws & Regulations Dataset

⚖️Ontario Laws & Regs⚖️

The Ontario Laws & Regs dataset contains 5,096 Ontario laws and regulations.

The laws and regulations consist of the most recent version of all current and revoked laws and regs.

The dataset is distributed under the MIT license and is intended to facilitate ML and data tasks involving Ontario legislation.

In addition, a scraper is provided which is capable of capturing different configurations of the data directly from the Ontario eLaws website, found here.

Structure🏛️

Each law and regulation is stored in its own json file which contains the following fields & sub-fields:

  1. act_info/reg_info: Act/Reg Info, includes: -- full_title: Full Title -- act_name_text/reg_name_text: Act/Reg Name Text -- citation: Citation -- act_under: For regulations only, the parent act. -- url: URL -- date_scraped: Date Scraped
  2. copyright: Crown copyright blurb -- Copyright: As required by eLaws TOS
  3. versions: Versions, includes a list of versions containing: -- a_href: URL slug for given version -- valid_from: Valid from -- valid_to: Valid to
  4. current_regs: Current Regs (for Statutes), being a list of associated regulations, containing: -- a_href: URL slug for given regulation -- Citation: Citation -- title: Title
  5. revoked_regs: Revoked Regs (for Statutes), being a list of associated revoked regulations, containing: -- revoked_reg_a_href: URL slug for given revoked regulation -- revoked_reg_citation: Citation -- revoked_reg_title: Title
  6. content: Contents of the act or regulation, being a list of sections, containing: -- id: Section # -- section: Section title -- content: Section content, as utf-8 text -- raw_html: raw html of section content, containing extra features

Collection 📥

Documents were sourced from the Ontario eLaws Website.

eLaws Scraper was used to extract the documents and parse them to jsons.

Licence 📜

Both the dataset and its associated scraper are distributed under MIT license.

Downloads last month
1,726