|
| 1 | +# coding=utf-8 |
| 2 | +# Copyright 2025 The TensorFlow Datasets Authors. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +"""Asimov 2.0 datasets.""" |
| 17 | + |
| 18 | +from tensorflow_datasets.robotics import dataset_importer_builder |
| 19 | + |
| 20 | +# TODO: Fix the citation. |
| 21 | +ASIMOV_V2_CITATION = """ |
| 22 | +@article{, |
| 23 | + author = {Abhishek Jindal and Dmitry Kalashnikov and R. Alex Hofer and Oscar Chang and Divya Garikapati and Anirudha Majumdar and Pierre Sermanet and Vikas Sindhwani}, |
| 24 | + title = {Can AI Perceive Physical Danger and Intervene?}, |
| 25 | + journal = {}, |
| 26 | + url = {}, |
| 27 | + year = {2026}, |
| 28 | +} |
| 29 | +""" |
| 30 | + |
| 31 | +ASIMOV_V2_HOMEPAGE = 'https://asimov-benchmark.github.io/v2/' |
| 32 | + |
| 33 | + |
| 34 | +class AsimovV2Injuries(dataset_importer_builder.TFDSDatasetImporterBuilder): |
| 35 | + """DatasetBuilder for `asimov_2_injuries` dataset.""" |
| 36 | + |
| 37 | + def get_description(self): |
| 38 | + return 'Situations generated from real hospital injury reports.' |
| 39 | + |
| 40 | + def get_citation(self): |
| 41 | + return ASIMOV_V2_CITATION |
| 42 | + |
| 43 | + def get_homepage(self): |
| 44 | + return ASIMOV_V2_HOMEPAGE |
| 45 | + |
| 46 | + def get_relative_dataset_location(self): |
| 47 | + return 'asimov_v2_injuries/0.1.0' |
| 48 | + |
| 49 | + |
| 50 | +class AsimovV2Videos(dataset_importer_builder.TFDSDatasetImporterBuilder): |
| 51 | + """DatasetBuilder for `asimov_2_videos` dataset.""" |
| 52 | + |
| 53 | + def get_description(self): |
| 54 | + return ( |
| 55 | + 'Photorealistic videos involving potential physical injury scenarios.' |
| 56 | + ) |
| 57 | + |
| 58 | + def get_citation(self): |
| 59 | + return ASIMOV_V2_CITATION |
| 60 | + |
| 61 | + def get_homepage(self): |
| 62 | + return ASIMOV_V2_HOMEPAGE |
| 63 | + |
| 64 | + def get_relative_dataset_location(self): |
| 65 | + return 'asimov_v2_videos/0.1.0' |
| 66 | + |
| 67 | + |
| 68 | +class AsimovV2ConstraintsWithoutRationale( |
| 69 | + dataset_importer_builder.TFDSDatasetImporterBuilder |
| 70 | +): |
| 71 | + """DatasetBuilder for `asimov_v2_constraints_without_rationale` dataset.""" |
| 72 | + |
| 73 | + def get_description(self): |
| 74 | + return ( |
| 75 | + 'Dataset to evaluate the ability to reason and adhere to' |
| 76 | + ' physical safety constraints imposed by embodiment limitations.' |
| 77 | + ' No rationale for the answer needs to be provided.' |
| 78 | + ) |
| 79 | + |
| 80 | + def get_citation(self): |
| 81 | + return ASIMOV_V2_CITATION |
| 82 | + |
| 83 | + def get_homepage(self): |
| 84 | + return ASIMOV_V2_HOMEPAGE |
| 85 | + |
| 86 | + def get_relative_dataset_location(self): |
| 87 | + return 'asimov_v2_constraints_without_rationale/0.1.0' |
| 88 | + |
| 89 | + |
| 90 | +class AsimovV2ConstraintsWithRationale( |
| 91 | + dataset_importer_builder.TFDSDatasetImporterBuilder |
| 92 | +): |
| 93 | + """DatasetBuilder for `asimov_v2_constraints_with_rationale` dataset.""" |
| 94 | + |
| 95 | + def get_description(self): |
| 96 | + return ( |
| 97 | + 'Dataset to evaluate the ability to reason and adhere to' |
| 98 | + ' physical safety constraints imposed by embodiment limitations.' |
| 99 | + ' Rationale for the answer needs to be provided.' |
| 100 | + ) |
| 101 | + |
| 102 | + def get_citation(self): |
| 103 | + return ASIMOV_V2_CITATION |
| 104 | + |
| 105 | + def get_homepage(self): |
| 106 | + return ASIMOV_V2_HOMEPAGE |
| 107 | + |
| 108 | + def get_relative_dataset_location(self): |
| 109 | + return 'asimov_v2_constraints_with_rationale/0.1.0' |
0 commit comments