briankchan commited on
Commit
818d7ad
·
1 Parent(s): 1ef3ac7

Update embeddings

Browse files
data/categories.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:4dddf959c29d7af260e7eeacd5a6dbd1c249b54fc492b21c6489dcf68f970402
3
  size 1134750
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6521f92d3db3b7b34fb971dd902fe707470a5e07867d13737cb148ba597bd4b
3
  size 1134750
data/dishes.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e8436a53e09bff69275cd04b47a46c55a1e4e6e4f8ae1f856026e02060bffd9
3
  size 7290051
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:765848ef3ced029b3c3178d5bd6d95fee83e26d119261940b3b3e76e97f26897
3
  size 7290051
data/restaurants.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:9d379bf61329a9e615a2cdfe082e99df5fe63f3278876e5addcf18e6e059c4ec
3
- size 1863120
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d3ca5f59f7088bd0cb369d3a33013b1a40dbcf269b6b62c0b43ed5ce87c60b1e
3
+ size 1858087
scripts/create_embeddings.py CHANGED
@@ -99,13 +99,22 @@ def main():
99
  cs = literal_eval(row['categories'])
100
 
101
  location = get_district_name(row['map_latitude'], row['map_longitude'])
 
 
 
 
 
 
 
 
 
102
 
103
  text = f"""\
104
  Name: {name}
105
- Intro: {row['intro']}
106
- Categories: {", ".join(cs)}
107
  Dishes: {", ".join(ds)}
108
- Location: {", ".join(location)}\
 
109
  """
110
 
111
  r = RestaurantDescription(
@@ -115,7 +124,7 @@ Location: {", ".join(location)}\
115
  name=name,
116
  name_alt=name_alt,
117
  intro=row['intro'],
118
- price=int(row['price']),
119
  rating=calculate_rating(row['score_cry'], row['score_o_k'], row['score_smile']),
120
  categories=cs,
121
  dishes=ds,
@@ -131,8 +140,8 @@ Location: {", ".join(location)}\
131
  dish_list = DocList[Dish](dishes.values())
132
  category_list = DocList[Category](categories.values())
133
 
134
- # import IPython
135
- # IPython.embed()
136
 
137
  embedding_settings = AzureOpenaiEmbeddings.load_from_env()
138
 
 
99
  cs = literal_eval(row['categories'])
100
 
101
  location = get_district_name(row['map_latitude'], row['map_longitude'])
102
+ price = int(row['price'])
103
+ if price < 100:
104
+ price_bucket = 'cheap'
105
+ elif 300 > price >= 100:
106
+ price_bucket = 'moderate'
107
+ elif price >= 300:
108
+ price_bucket = 'expensive'
109
+
110
+ extra_data = ' Romantic Dining.' if 'Romantic Dining' in cs else ""
111
 
112
  text = f"""\
113
  Name: {name}
114
+ Intro: {row['intro']}{extra_data}
 
115
  Dishes: {", ".join(ds)}
116
+ Location: {", ".join(location)}
117
+ Price: {price_bucket}\
118
  """
119
 
120
  r = RestaurantDescription(
 
124
  name=name,
125
  name_alt=name_alt,
126
  intro=row['intro'],
127
+ price=price,
128
  rating=calculate_rating(row['score_cry'], row['score_o_k'], row['score_smile']),
129
  categories=cs,
130
  dishes=ds,
 
140
  dish_list = DocList[Dish](dishes.values())
141
  category_list = DocList[Category](categories.values())
142
 
143
+ import IPython
144
+ IPython.embed()
145
 
146
  embedding_settings = AzureOpenaiEmbeddings.load_from_env()
147