alistairmcleay commited on
Commit
57d41b7
1 Parent(s): f29dd07

Manage price in lexicalisation properly

Browse files
scripts/UBAR_code/interaction/UBAR_interact.py CHANGED
@@ -62,11 +62,14 @@ class UbarSystemModel: # may inherit convlab or not, just like andy's
62
 
63
  # Note in hotel there is specific price data too but to simplify things
64
  # we just use the price range (e.g. moderate)
65
- # TODO: there are different uses of price in different databases ('price' vs 'pricerange':
66
- # need to deal with this appropriately below)
 
 
 
67
  slots_to_db_keys_map = {
68
- "[value_price]": "price",
69
- "[value_pricerange]": "pricerange",
70
  "[value_food]": "food",
71
  "[value_area]": "area",
72
  "[value_type]": "type",
 
62
 
63
  # Note in hotel there is specific price data too but to simplify things
64
  # we just use the price range (e.g. moderate)
65
+ db_price_key = "price"
66
+ # if domain is restaurant then use "pricerange"
67
+ if self.turn_domain[0] == "restaurant":
68
+ db_price_key = "pricerange"
69
+
70
  slots_to_db_keys_map = {
71
+ "[value_price]": db_price_key,
72
+ "[value_pricerange]": db_price_key,
73
  "[value_food]": "food",
74
  "[value_area]": "area",
75
  "[value_type]": "type",