Dakhoo commited on
Commit
b7aef38
1 Parent(s): c10ee29

added wine attribute to csv

Browse files
.gitattributes CHANGED
@@ -1,3 +1,4 @@
 
1
  *.jsonl filter=lfs diff=lfs merge=lfs -text
2
  *.7z filter=lfs diff=lfs merge=lfs -text
3
  *.arrow filter=lfs diff=lfs merge=lfs -text
 
1
+ *.csv filter=lfs diff=lfs merge=lfs -text
2
  *.jsonl filter=lfs diff=lfs merge=lfs -text
3
  *.7z filter=lfs diff=lfs merge=lfs -text
4
  *.arrow filter=lfs diff=lfs merge=lfs -text
code/notebook.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 2,
6
  "metadata": {},
7
  "outputs": [],
8
  "source": [
@@ -11,7 +11,7 @@
11
  },
12
  {
13
  "cell_type": "code",
14
- "execution_count": 3,
15
  "metadata": {},
16
  "outputs": [],
17
  "source": [
@@ -65,7 +65,7 @@
65
  },
66
  {
67
  "cell_type": "code",
68
- "execution_count": 6,
69
  "metadata": {},
70
  "outputs": [],
71
  "source": [
@@ -99,8 +99,8 @@
99
  "write_jsonl(df_vintages, '../data/vintages/vintages_dataset.jsonl')\n",
100
  "\n",
101
  "# LOAD IMAGES 'small'\n",
102
- "df_small = df_image_review_attributes.sample(frac = 0.1)\n",
103
- "write_jsonl(df_small, '../data/small/small_dataset.jsonl')\n",
104
  "# df_napping\n",
105
  "# df_participant\n",
106
  "\n",
@@ -857,16 +857,298 @@
857
  },
858
  {
859
  "cell_type": "code",
860
- "execution_count": 27,
861
  "metadata": {},
862
  "outputs": [],
863
  "source": [
 
864
  "# read the json file\n",
865
  "with open('/Users/alka/Devel/GIT_LFS_SKIP_SMUDGE=1/metadata/all/all_dataset.jsonl') as json_file:\n",
866
  " data = json_file.readlines()\n",
867
  " data = [json.loads(line) for line in data] # convert string to dict format"
868
  ]
869
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
870
  {
871
  "cell_type": "code",
872
  "execution_count": null,
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 1,
6
  "metadata": {},
7
  "outputs": [],
8
  "source": [
 
11
  },
12
  {
13
  "cell_type": "code",
14
+ "execution_count": 2,
15
  "metadata": {},
16
  "outputs": [],
17
  "source": [
 
65
  },
66
  {
67
  "cell_type": "code",
68
+ "execution_count": 5,
69
  "metadata": {},
70
  "outputs": [],
71
  "source": [
 
99
  "write_jsonl(df_vintages, '../data/vintages/vintages_dataset.jsonl')\n",
100
  "\n",
101
  "# LOAD IMAGES 'small'\n",
102
+ "# df_small = df_image_review_attributes.sample(frac = 0.1)\n",
103
+ "# write_jsonl(df_small, '../data/small/small_dataset.jsonl')\n",
104
  "# df_napping\n",
105
  "# df_participant\n",
106
  "\n",
 
857
  },
858
  {
859
  "cell_type": "code",
860
+ "execution_count": 3,
861
  "metadata": {},
862
  "outputs": [],
863
  "source": [
864
+ "import json\n",
865
  "# read the json file\n",
866
  "with open('/Users/alka/Devel/GIT_LFS_SKIP_SMUDGE=1/metadata/all/all_dataset.jsonl') as json_file:\n",
867
  " data = json_file.readlines()\n",
868
  " data = [json.loads(line) for line in data] # convert string to dict format"
869
  ]
870
  },
871
+ {
872
+ "cell_type": "code",
873
+ "execution_count": 5,
874
+ "metadata": {},
875
+ "outputs": [],
876
+ "source": [
877
+ "import pandas as pd\n",
878
+ "data_df = pd.DataFrame(data)"
879
+ ]
880
+ },
881
+ {
882
+ "cell_type": "code",
883
+ "execution_count": 10,
884
+ "metadata": {},
885
+ "outputs": [],
886
+ "source": [
887
+ "aa = data_df.copy()"
888
+ ]
889
+ },
890
+ {
891
+ "cell_type": "code",
892
+ "execution_count": 11,
893
+ "metadata": {},
894
+ "outputs": [],
895
+ "source": [
896
+ "# remove charactr p from the image column\n",
897
+ "aa['image'] = pd.DataFrame([item.replace('p/', '') for item in data_df.image if item is not None])"
898
+ ]
899
+ },
900
+ {
901
+ "cell_type": "code",
902
+ "execution_count": 13,
903
+ "metadata": {},
904
+ "outputs": [
905
+ {
906
+ "data": {
907
+ "text/html": [
908
+ "<div>\n",
909
+ "<style scoped>\n",
910
+ " .dataframe tbody tr th:only-of-type {\n",
911
+ " vertical-align: middle;\n",
912
+ " }\n",
913
+ "\n",
914
+ " .dataframe tbody tr th {\n",
915
+ " vertical-align: top;\n",
916
+ " }\n",
917
+ "\n",
918
+ " .dataframe thead th {\n",
919
+ " text-align: right;\n",
920
+ " }\n",
921
+ "</style>\n",
922
+ "<table border=\"1\" class=\"dataframe\">\n",
923
+ " <thead>\n",
924
+ " <tr style=\"text-align: right;\">\n",
925
+ " <th></th>\n",
926
+ " <th>vintage_id</th>\n",
927
+ " <th>image</th>\n",
928
+ " <th>review</th>\n",
929
+ " <th>experiment_id</th>\n",
930
+ " <th>year</th>\n",
931
+ " <th>winery_id</th>\n",
932
+ " <th>wine_alcohol</th>\n",
933
+ " <th>country</th>\n",
934
+ " <th>region</th>\n",
935
+ " <th>price</th>\n",
936
+ " <th>rating</th>\n",
937
+ " <th>grape</th>\n",
938
+ " </tr>\n",
939
+ " </thead>\n",
940
+ " <tbody>\n",
941
+ " <tr>\n",
942
+ " <th>0</th>\n",
943
+ " <td>150301706</td>\n",
944
+ " <td>p/iVoa6qR6TSKjLeb1RoHWtQ.jpg</td>\n",
945
+ " <td>Ничего особого в нем не нашел. В меру сухое, в...</td>\n",
946
+ " <td>NaN</td>\n",
947
+ " <td>NaN</td>\n",
948
+ " <td>NaN</td>\n",
949
+ " <td>NaN</td>\n",
950
+ " <td>None</td>\n",
951
+ " <td>None</td>\n",
952
+ " <td>NaN</td>\n",
953
+ " <td>NaN</td>\n",
954
+ " <td>None</td>\n",
955
+ " </tr>\n",
956
+ " <tr>\n",
957
+ " <th>1</th>\n",
958
+ " <td>159555436</td>\n",
959
+ " <td>p/e2W_085qRbCQbZJVp_tzHA.jpg</td>\n",
960
+ " <td>None</td>\n",
961
+ " <td>NaN</td>\n",
962
+ " <td>NaN</td>\n",
963
+ " <td>NaN</td>\n",
964
+ " <td>NaN</td>\n",
965
+ " <td>None</td>\n",
966
+ " <td>None</td>\n",
967
+ " <td>NaN</td>\n",
968
+ " <td>NaN</td>\n",
969
+ " <td>None</td>\n",
970
+ " </tr>\n",
971
+ " <tr>\n",
972
+ " <th>2</th>\n",
973
+ " <td>146958680</td>\n",
974
+ " <td>p/DdLNo35SRiCMxpoKTiEXyQ.jpg</td>\n",
975
+ " <td>None</td>\n",
976
+ " <td>NaN</td>\n",
977
+ " <td>NaN</td>\n",
978
+ " <td>NaN</td>\n",
979
+ " <td>NaN</td>\n",
980
+ " <td>None</td>\n",
981
+ " <td>None</td>\n",
982
+ " <td>NaN</td>\n",
983
+ " <td>NaN</td>\n",
984
+ " <td>None</td>\n",
985
+ " </tr>\n",
986
+ " <tr>\n",
987
+ " <th>3</th>\n",
988
+ " <td>2014691</td>\n",
989
+ " <td>p/vi-1ygw7RXCM6Pnwx9C6CA.jpg</td>\n",
990
+ " <td>3,3/5. Белая Риоха. Бленд на основе виуры (75%...</td>\n",
991
+ " <td>NaN</td>\n",
992
+ " <td>NaN</td>\n",
993
+ " <td>NaN</td>\n",
994
+ " <td>NaN</td>\n",
995
+ " <td>None</td>\n",
996
+ " <td>None</td>\n",
997
+ " <td>NaN</td>\n",
998
+ " <td>NaN</td>\n",
999
+ " <td>None</td>\n",
1000
+ " </tr>\n",
1001
+ " <tr>\n",
1002
+ " <th>4</th>\n",
1003
+ " <td>153305559</td>\n",
1004
+ " <td>p/1pjborIfR1Wdlr35jEHbtA.jpg</td>\n",
1005
+ " <td>Parfum! Super frumos!</td>\n",
1006
+ " <td>NaN</td>\n",
1007
+ " <td>NaN</td>\n",
1008
+ " <td>NaN</td>\n",
1009
+ " <td>NaN</td>\n",
1010
+ " <td>None</td>\n",
1011
+ " <td>None</td>\n",
1012
+ " <td>NaN</td>\n",
1013
+ " <td>NaN</td>\n",
1014
+ " <td>None</td>\n",
1015
+ " </tr>\n",
1016
+ " <tr>\n",
1017
+ " <th>5</th>\n",
1018
+ " <td>162913950</td>\n",
1019
+ " <td>p/kDz5LBlFRz2wb61xaMj_Dw.jpg</td>\n",
1020
+ " <td>Bom vinho</td>\n",
1021
+ " <td>NaN</td>\n",
1022
+ " <td>NaN</td>\n",
1023
+ " <td>NaN</td>\n",
1024
+ " <td>NaN</td>\n",
1025
+ " <td>None</td>\n",
1026
+ " <td>None</td>\n",
1027
+ " <td>NaN</td>\n",
1028
+ " <td>NaN</td>\n",
1029
+ " <td>None</td>\n",
1030
+ " </tr>\n",
1031
+ " <tr>\n",
1032
+ " <th>6</th>\n",
1033
+ " <td>14230455</td>\n",
1034
+ " <td>p/EJQLq-qLShSP-uf2Tg-G1g.jpg</td>\n",
1035
+ " <td>None</td>\n",
1036
+ " <td>NaN</td>\n",
1037
+ " <td>NaN</td>\n",
1038
+ " <td>NaN</td>\n",
1039
+ " <td>NaN</td>\n",
1040
+ " <td>None</td>\n",
1041
+ " <td>None</td>\n",
1042
+ " <td>NaN</td>\n",
1043
+ " <td>NaN</td>\n",
1044
+ " <td>None</td>\n",
1045
+ " </tr>\n",
1046
+ " <tr>\n",
1047
+ " <th>7</th>\n",
1048
+ " <td>159888939</td>\n",
1049
+ " <td>p/MhhKQteWSXW0gYUNnvHs6A.jpg</td>\n",
1050
+ " <td>V nice whitr</td>\n",
1051
+ " <td>NaN</td>\n",
1052
+ " <td>NaN</td>\n",
1053
+ " <td>NaN</td>\n",
1054
+ " <td>NaN</td>\n",
1055
+ " <td>None</td>\n",
1056
+ " <td>None</td>\n",
1057
+ " <td>NaN</td>\n",
1058
+ " <td>NaN</td>\n",
1059
+ " <td>None</td>\n",
1060
+ " </tr>\n",
1061
+ " <tr>\n",
1062
+ " <th>8</th>\n",
1063
+ " <td>3261951</td>\n",
1064
+ " <td>p/fdsdbl6XR2ynvoQnNYLXQQ.jpg</td>\n",
1065
+ " <td>Great label and ok tasting. Not the best but n...</td>\n",
1066
+ " <td>NaN</td>\n",
1067
+ " <td>NaN</td>\n",
1068
+ " <td>NaN</td>\n",
1069
+ " <td>NaN</td>\n",
1070
+ " <td>None</td>\n",
1071
+ " <td>None</td>\n",
1072
+ " <td>NaN</td>\n",
1073
+ " <td>NaN</td>\n",
1074
+ " <td>None</td>\n",
1075
+ " </tr>\n",
1076
+ " <tr>\n",
1077
+ " <th>9</th>\n",
1078
+ " <td>32363311</td>\n",
1079
+ " <td>p/BQkoD9sXQi-EIk3e2cG-YA.jpg</td>\n",
1080
+ " <td>None</td>\n",
1081
+ " <td>NaN</td>\n",
1082
+ " <td>NaN</td>\n",
1083
+ " <td>NaN</td>\n",
1084
+ " <td>NaN</td>\n",
1085
+ " <td>None</td>\n",
1086
+ " <td>None</td>\n",
1087
+ " <td>NaN</td>\n",
1088
+ " <td>NaN</td>\n",
1089
+ " <td>None</td>\n",
1090
+ " </tr>\n",
1091
+ " </tbody>\n",
1092
+ "</table>\n",
1093
+ "</div>"
1094
+ ],
1095
+ "text/plain": [
1096
+ " vintage_id image \\\n",
1097
+ "0 150301706 p/iVoa6qR6TSKjLeb1RoHWtQ.jpg \n",
1098
+ "1 159555436 p/e2W_085qRbCQbZJVp_tzHA.jpg \n",
1099
+ "2 146958680 p/DdLNo35SRiCMxpoKTiEXyQ.jpg \n",
1100
+ "3 2014691 p/vi-1ygw7RXCM6Pnwx9C6CA.jpg \n",
1101
+ "4 153305559 p/1pjborIfR1Wdlr35jEHbtA.jpg \n",
1102
+ "5 162913950 p/kDz5LBlFRz2wb61xaMj_Dw.jpg \n",
1103
+ "6 14230455 p/EJQLq-qLShSP-uf2Tg-G1g.jpg \n",
1104
+ "7 159888939 p/MhhKQteWSXW0gYUNnvHs6A.jpg \n",
1105
+ "8 3261951 p/fdsdbl6XR2ynvoQnNYLXQQ.jpg \n",
1106
+ "9 32363311 p/BQkoD9sXQi-EIk3e2cG-YA.jpg \n",
1107
+ "\n",
1108
+ " review experiment_id year \\\n",
1109
+ "0 Ничего особого в нем не нашел. В меру сухое, в... NaN NaN \n",
1110
+ "1 None NaN NaN \n",
1111
+ "2 None NaN NaN \n",
1112
+ "3 3,3/5. Белая Риоха. Бленд на основе виуры (75%... NaN NaN \n",
1113
+ "4 Parfum! Super frumos! NaN NaN \n",
1114
+ "5 Bom vinho NaN NaN \n",
1115
+ "6 None NaN NaN \n",
1116
+ "7 V nice whitr NaN NaN \n",
1117
+ "8 Great label and ok tasting. Not the best but n... NaN NaN \n",
1118
+ "9 None NaN NaN \n",
1119
+ "\n",
1120
+ " winery_id wine_alcohol country region price rating grape \n",
1121
+ "0 NaN NaN None None NaN NaN None \n",
1122
+ "1 NaN NaN None None NaN NaN None \n",
1123
+ "2 NaN NaN None None NaN NaN None \n",
1124
+ "3 NaN NaN None None NaN NaN None \n",
1125
+ "4 NaN NaN None None NaN NaN None \n",
1126
+ "5 NaN NaN None None NaN NaN None \n",
1127
+ "6 NaN NaN None None NaN NaN None \n",
1128
+ "7 NaN NaN None None NaN NaN None \n",
1129
+ "8 NaN NaN None None NaN NaN None \n",
1130
+ "9 NaN NaN None None NaN NaN None "
1131
+ ]
1132
+ },
1133
+ "execution_count": 13,
1134
+ "metadata": {},
1135
+ "output_type": "execute_result"
1136
+ }
1137
+ ],
1138
+ "source": [
1139
+ "data_df.head(10)"
1140
+ ]
1141
+ },
1142
+ {
1143
+ "cell_type": "code",
1144
+ "execution_count": 16,
1145
+ "metadata": {},
1146
+ "outputs": [],
1147
+ "source": [
1148
+ "# write aa into jsonl format\n",
1149
+ "write_jsonl(aa, '/Users/alka/Devel/GIT_LFS_SKIP_SMUDGE=1/metadata/all/all_dataset.jsonl')"
1150
+ ]
1151
+ },
1152
  {
1153
  "cell_type": "code",
1154
  "execution_count": null,
data/csv/images_reviews_attributes.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52fa0b65c6c0c9d2030f7e6d893ee3be30b865da31346cd9cdfcb406c0983b74
3
+ size 146174207