dnth commited on
Commit
6410e2c
1 Parent(s): e9eeb3e

rearrange columns

Browse files
Files changed (1) hide show
  1. merge_w_timm_pets.ipynb +67 -11
merge_w_timm_pets.ipynb CHANGED
@@ -2981,15 +2981,71 @@
2981
  "enriched_ds"
2982
  ]
2983
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2984
  {
2985
  "cell_type": "code",
2986
- "execution_count": 45,
2987
  "metadata": {},
2988
  "outputs": [
2989
  {
2990
  "data": {
2991
  "application/vnd.jupyter.widget-view+json": {
2992
- "model_id": "e6c5ed1b8e324423abedf847b1c01648",
2993
  "version_major": 2,
2994
  "version_minor": 0
2995
  },
@@ -3003,7 +3059,7 @@
3003
  {
3004
  "data": {
3005
  "application/vnd.jupyter.widget-view+json": {
3006
- "model_id": "afb4592fbc5f48bfb62c8bff3a0a3a19",
3007
  "version_major": 2,
3008
  "version_minor": 0
3009
  },
@@ -3017,7 +3073,7 @@
3017
  {
3018
  "data": {
3019
  "application/vnd.jupyter.widget-view+json": {
3020
- "model_id": "9873a38d223d42298fc82d2f5689f756",
3021
  "version_major": 2,
3022
  "version_minor": 0
3023
  },
@@ -3031,7 +3087,7 @@
3031
  {
3032
  "data": {
3033
  "application/vnd.jupyter.widget-view+json": {
3034
- "model_id": "6c4da14823e347939b15bf17b2af5ea8",
3035
  "version_major": 2,
3036
  "version_minor": 0
3037
  },
@@ -3045,7 +3101,7 @@
3045
  {
3046
  "data": {
3047
  "application/vnd.jupyter.widget-view+json": {
3048
- "model_id": "91fc9c32e1bd41e2abab91f6b1003011",
3049
  "version_major": 2,
3050
  "version_minor": 0
3051
  },
@@ -3059,7 +3115,7 @@
3059
  {
3060
  "data": {
3061
  "application/vnd.jupyter.widget-view+json": {
3062
- "model_id": "c02eee21c01d4264b457b4bb180bf393",
3063
  "version_major": 2,
3064
  "version_minor": 0
3065
  },
@@ -3073,12 +3129,12 @@
3073
  {
3074
  "data": {
3075
  "application/vnd.jupyter.widget-view+json": {
3076
- "model_id": "c1d87aa72162439d939fea70411b86a7",
3077
  "version_major": 2,
3078
  "version_minor": 0
3079
  },
3080
  "text/plain": [
3081
- "README.md: 0%| | 0.00/697 [00:00<?, ?B/s]"
3082
  ]
3083
  },
3084
  "metadata": {},
@@ -3087,10 +3143,10 @@
3087
  {
3088
  "data": {
3089
  "text/plain": [
3090
- "CommitInfo(commit_url='https://huggingface.co/datasets/dnth/pets-enriched/commit/4790179a492eec12ea09889d74492104657b6e01', commit_message='Upload dataset', commit_description='', oid='4790179a492eec12ea09889d74492104657b6e01', pr_url=None, pr_revision=None, pr_num=None)"
3091
  ]
3092
  },
3093
- "execution_count": 45,
3094
  "metadata": {},
3095
  "output_type": "execute_result"
3096
  }
 
2981
  "enriched_ds"
2982
  ]
2983
  },
2984
+ {
2985
+ "cell_type": "markdown",
2986
+ "metadata": {},
2987
+ "source": []
2988
+ },
2989
+ {
2990
+ "cell_type": "code",
2991
+ "execution_count": 48,
2992
+ "metadata": {},
2993
+ "outputs": [],
2994
+ "source": [
2995
+ "new_column_order = [\n",
2996
+ " 'image_id',\n",
2997
+ " 'image',\n",
2998
+ " 'label_cat_dog',\n",
2999
+ " 'label_breed',\n",
3000
+ " 'labels_bbox_enriched',\n",
3001
+ " 'caption_enriched'\n",
3002
+ "]\n",
3003
+ "\n",
3004
+ "# Rearrange columns for both train and test sets\n",
3005
+ "enriched_ds = DatasetDict({\n",
3006
+ " 'train': enriched_ds['train'].select_columns(new_column_order),\n",
3007
+ " 'test': enriched_ds['test'].select_columns(new_column_order)\n",
3008
+ "})"
3009
+ ]
3010
+ },
3011
+ {
3012
+ "cell_type": "code",
3013
+ "execution_count": 49,
3014
+ "metadata": {},
3015
+ "outputs": [
3016
+ {
3017
+ "data": {
3018
+ "text/plain": [
3019
+ "DatasetDict({\n",
3020
+ " train: Dataset({\n",
3021
+ " features: ['image_id', 'image', 'label_cat_dog', 'label_breed', 'labels_bbox_enriched', 'caption_enriched'],\n",
3022
+ " num_rows: 3680\n",
3023
+ " })\n",
3024
+ " test: Dataset({\n",
3025
+ " features: ['image_id', 'image', 'label_cat_dog', 'label_breed', 'labels_bbox_enriched', 'caption_enriched'],\n",
3026
+ " num_rows: 3669\n",
3027
+ " })\n",
3028
+ "})"
3029
+ ]
3030
+ },
3031
+ "execution_count": 49,
3032
+ "metadata": {},
3033
+ "output_type": "execute_result"
3034
+ }
3035
+ ],
3036
+ "source": [
3037
+ "enriched_ds"
3038
+ ]
3039
+ },
3040
  {
3041
  "cell_type": "code",
3042
+ "execution_count": 50,
3043
  "metadata": {},
3044
  "outputs": [
3045
  {
3046
  "data": {
3047
  "application/vnd.jupyter.widget-view+json": {
3048
+ "model_id": "6dc3fa504bde49cd9f0d5cbe21ae7950",
3049
  "version_major": 2,
3050
  "version_minor": 0
3051
  },
 
3059
  {
3060
  "data": {
3061
  "application/vnd.jupyter.widget-view+json": {
3062
+ "model_id": "a0732e1c70b94b1795eeac4d26047541",
3063
  "version_major": 2,
3064
  "version_minor": 0
3065
  },
 
3073
  {
3074
  "data": {
3075
  "application/vnd.jupyter.widget-view+json": {
3076
+ "model_id": "1f792662897a4ad188cb4a9ad4f8abf3",
3077
  "version_major": 2,
3078
  "version_minor": 0
3079
  },
 
3087
  {
3088
  "data": {
3089
  "application/vnd.jupyter.widget-view+json": {
3090
+ "model_id": "a76eaa66c4624f69a7f4af073c4c7b46",
3091
  "version_major": 2,
3092
  "version_minor": 0
3093
  },
 
3101
  {
3102
  "data": {
3103
  "application/vnd.jupyter.widget-view+json": {
3104
+ "model_id": "7de87ad564554d069beb6785a441a0a0",
3105
  "version_major": 2,
3106
  "version_minor": 0
3107
  },
 
3115
  {
3116
  "data": {
3117
  "application/vnd.jupyter.widget-view+json": {
3118
+ "model_id": "27f736fd3bc94e349534b65f663bea58",
3119
  "version_major": 2,
3120
  "version_minor": 0
3121
  },
 
3129
  {
3130
  "data": {
3131
  "application/vnd.jupyter.widget-view+json": {
3132
+ "model_id": "5a854117808142058a9018af80bae0bf",
3133
  "version_major": 2,
3134
  "version_minor": 0
3135
  },
3136
  "text/plain": [
3137
+ "README.md: 0%| | 0.00/1.10k [00:00<?, ?B/s]"
3138
  ]
3139
  },
3140
  "metadata": {},
 
3143
  {
3144
  "data": {
3145
  "text/plain": [
3146
+ "CommitInfo(commit_url='https://huggingface.co/datasets/dnth/pets-enriched/commit/e9eeb3ecbee85b319f0dbabf9ecba910bcfdbccd', commit_message='Upload dataset', commit_description='', oid='e9eeb3ecbee85b319f0dbabf9ecba910bcfdbccd', pr_url=None, pr_revision=None, pr_num=None)"
3147
  ]
3148
  },
3149
+ "execution_count": 50,
3150
  "metadata": {},
3151
  "output_type": "execute_result"
3152
  }