Skip to content
This repository was archived by the owner on Jan 4, 2018. It is now read-only.

kkmann1/chatbot-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

chatbot-model

Course project for Metis' Intro to Data Science by analyzing how to make chatbots smarter

Background

The purpose of this model is to measure how effective a chatbot is in answering users' questions. I intend to use this project as a first pass in analyzing the chatbot that my company is developing.

Data

Press release from InfoQ:

Maluuba, a Microsoft company working towards general artificial intelligence, recently released a new open dialogue dataset based on booking a vacation - specifically, finding flights and a hotel.

The dataset contains 1,369 dialogues around travel planning. Each dialogue contains the following:

Key Name Description
id Refers to a unique identification for the dialogue.
userid Refers to a unique identifier for the user taking part in the dialogue.
wizardid Refers to a unique identifier for the wizard taking part in the dialogue.
labels.userSurveyRating A value that represents the user's satisfaction with the Wizard's service, ranging from 1 - complete dissatisfaction to 5 - complete satisfaction.
labels.wizardSurveyTaskSuccessful A boolean which is true if the wizard thinks at the end of the dialogue that the user's goal was achieved.
turns Details of each "turn" of the dialogue. This includes the keys: author, text, labels, timestamp, frames, db

The key frames refers to how often the conversation shifts intentions. The user may start the conversation wanting to go to Toronto, but then also inquire about how to book a trip to California. This would generate a new frame.

A sample of the data is at the bottom of this readme.

Project Check In: August 24, 2017

The frames.json file has been imported into Python and turned into a pandas dataframe.

Two of the main columns contains nested dictionaries: Labels and Turns. Labels was extracted using json normalize so that userSurveyRating and wizardSurveyTaskSuccessful are brought up to the main columns.

However, the nested dictionary within Turns is more extensive. Each dialogue has many Turns, and each Turn has contains dictionaries, such as who the author is, what the text was, the intent of the user in initiating the conversation with the chat wizard, and what is framing the discussion. As noted by Maluuba, "Frame tracking consists of keeping in memory all the different sets of constraints mentioned by the user. It is a generalization of the state tracking task to a setting where not only the current frame is memorized."

I have not been able to extract the Turns dictionary in a manner that makes sense yet. That is the immediate step before continuuing on with the analysis. Once completed, I intend to use the information in Turns as the feature set that will determine if the conversation was successful. The two labels - userSurveyRating and wizardSurveyTaskSuccessful - are the classifiers for these dialogues. Successful dialogues result in if userSurveyRatings are above 4 and if wizardSurveyTaskSuccessful is 1. Supervised machine learning will be used to build this analysis.

Project Check In: September 12, 2017

Because I found it difficult to flatten the Turns nested dictionaries, I ended up using for loops to take the data I wanted from the dictionaries and append them back to the main data frame of results. I also included the library TextBlob, which provides Sentiment Analysis. The results of the sentiment analysis for each dialogue was appended to the final feature matrix.

I was only able to run two passes of the SVM and Random Forest classification models at my data set. The first included all features (around 30 features) and the second was ran for about 20 features. However, I was only able to achieve 75% as a metrics score.

Sample Data

{'id': '0d364be2-9f43-4f5a-8506-1af4523515ba',
 'labels': {'userSurveyRating': 5.0, 'wizardSurveyTaskSuccessful': True},
 'turns': [{'author': 'user',
   'labels': {'active_frame': 1,
    'acts': [{'args': [{'key': 'intent', 'val': 'book'}], 'name': 'inform'},
     {'args': [{'key': 'or_city', 'val': 'Tampa'},
       {'key': 'dst_city', 'val': '-1'}],
      'name': 'inform'}],
    'acts_without_refs': [{'args': [{'key': 'intent', 'val': 'book'}],
      'name': 'inform'},
     {'args': [{'key': 'or_city', 'val': 'Tampa'},
       {'key': 'dst_city', 'val': '-1'}],
      'name': 'inform'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'dst_city': [{'negated': False, 'val': '-1'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}]},
      'requests': []}]},
   'text': "I need to book a trip for the whole family from Tampa but we don't know where to go. Can you help us?",
   'timestamp': 1473717094526.0},
  {'author': 'wizard',
   'db': {'result': [], 'search': []},
   'labels': {'active_frame': 1,
    'acts': [{'args': [{'key': 'n_adults'},
       {'key': 'n_children'},
       {'key': 'budget'}],
      'name': 'request'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'dst_city': [{'negated': False, 'val': '-1'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}]},
      'requests': [{'author': 'wizard', 'key': 'n_adults'},
       {'author': 'wizard', 'key': 'n_children'},
       {'author': 'wizard', 'key': 'budget'}]}]},
   'text': "Sure! How many are you and what's your budget?",
   'timestamp': 1473717128490.0},
  {'author': 'user',
   'labels': {'active_frame': 1,
    'acts': [{'args': [{'key': 'n_adults', 'val': '5'},
       {'key': 'n_children', 'val': '7'},
       {'key': 'budget', 'val': '32800'}],
      'name': 'inform'}],
    'acts_without_refs': [{'args': [{'key': 'n_adults', 'val': '5'},
       {'key': 'n_children', 'val': '7'},
       {'key': 'budget', 'val': '32800'}],
      'name': 'inform'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}]},
      'requests': []}]},
   'text': '5 adults and 7 kids! Yup, the lot of us. We want to spend no more than 32800.',
   'timestamp': 1473717273455.0},
  {'author': 'wizard',
   'db': {'result': [[{'hotel': {'amenities': ['FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '4.5 star hotel',
        'country': 'Germany',
        'dst_city': 'Frankfurt',
        'gst_rating': 8.86,
        'name': 'Mellow Palms Resort',
        'vicinity': []},
       'price': 29257.25,
       'trip': {'duration_days': 20,
        'leaving': {'arrival': {'day': 13,
          'hour': 2,
          'min': 8,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 9, 'min': 8}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 1,
          'hour': 20,
          'min': 8,
          'month': 10,
          'year': 2016},
         'departure': {'day': 1,
          'hour': 11,
          'min': 0,
          'month': 10,
          'year': 2016},
         'duration': {'hours': 9, 'min': 8}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '3.0 star hotel',
        'country': 'Brazil',
        'dst_city': 'Fortaleza',
        'gst_rating': 8.69,
        'name': 'Private Hotel',
        'vicinity': ['mall']},
       'price': 20309.4,
       'trip': {'duration_days': 18,
        'leaving': {'arrival': {'day': 12,
          'hour': 21,
          'min': 43,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 4, 'min': 43}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 30,
          'hour': 15,
          'min': 43,
          'month': 9,
          'year': 2016},
         'departure': {'day': 30,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 4, 'min': 43}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '3.0 star hotel',
        'country': 'Brazil',
        'dst_city': 'Fortaleza',
        'gst_rating': 8.69,
        'name': 'Private Hotel',
        'vicinity': ['mall']},
       'price': 16290.91,
       'trip': {'duration_days': 18,
        'leaving': {'arrival': {'day': 12,
          'hour': 21,
          'min': 43,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 4, 'min': 43}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 30,
          'hour': 15,
          'min': 43,
          'month': 9,
          'year': 2016},
         'departure': {'day': 30,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 4, 'min': 43}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.0 star hotel',
        'country': 'United States',
        'dst_city': 'Philadelphia',
        'gst_rating': 6.61,
        'name': 'Mirror Inn',
        'vicinity': ['park', 'museum']},
       'price': 7056.11,
       'trip': {'duration_days': 18,
        'leaving': {'arrival': {'day': 13,
          'hour': 17,
          'min': 12,
          'month': 9,
          'year': 2016},
         'departure': {'day': 13,
          'hour': 16,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 12}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 1,
          'hour': 12,
          'min': 12,
          'month': 10,
          'year': 2016},
         'departure': {'day': 1,
          'hour': 11,
          'min': 0,
          'month': 10,
          'year': 2016},
         'duration': {'hours': 1, 'min': 12}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.0 star hotel',
        'country': 'United States',
        'dst_city': 'Philadelphia',
        'gst_rating': 6.61,
        'name': 'Mirror Inn',
        'vicinity': ['park', 'museum']},
       'price': 6088.86,
       'trip': {'duration_days': 18,
        'leaving': {'arrival': {'day': 13,
          'hour': 17,
          'min': 12,
          'month': 9,
          'year': 2016},
         'departure': {'day': 13,
          'hour': 16,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 12}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 1,
          'hour': 12,
          'min': 12,
          'month': 10,
          'year': 2016},
         'departure': {'day': 1,
          'hour': 11,
          'min': 0,
          'month': 10,
          'year': 2016},
         'duration': {'hours': 1, 'min': 12}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.5 star hotel',
        'country': 'United States',
        'dst_city': 'San Diego',
        'gst_rating': 6.91,
        'name': 'Majestic Mountain Inn',
        'vicinity': ['park']},
       'price': 7106.61,
       'trip': {'duration_days': 17,
        'leaving': {'arrival': {'day': 12,
          'hour': 18,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 29,
          'hour': 12,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 29,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.5 star hotel',
        'country': 'United States',
        'dst_city': 'San Diego',
        'gst_rating': 6.91,
        'name': 'Majestic Mountain Inn',
        'vicinity': ['park']},
       'price': 6139.6,
       'trip': {'duration_days': 17,
        'leaving': {'arrival': {'day': 12,
          'hour': 18,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 29,
          'hour': 12,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 29,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.5 star hotel',
        'country': 'Brazil',
        'dst_city': 'Goiania',
        'gst_rating': 4.93,
        'name': 'Tesoros Ancientes',
        'vicinity': ['shopping']},
       'price': 19614.1,
       'trip': {'duration_days': 16,
        'leaving': {'arrival': {'day': 15,
          'hour': 8,
          'min': 27,
          'month': 9,
          'year': 2016},
         'departure': {'day': 15,
          'hour': 1,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 7, 'min': 27}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 30,
          'hour': 18,
          'min': 27,
          'month': 9,
          'year': 2016},
         'departure': {'day': 30,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 7, 'min': 27}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.5 star hotel',
        'country': 'Brazil',
        'dst_city': 'Goiania',
        'gst_rating': 4.93,
        'name': 'Tesoros Ancientes',
        'vicinity': ['shopping']},
       'price': 25289.38,
       'trip': {'duration_days': 16,
        'leaving': {'arrival': {'day': 15,
          'hour': 8,
          'min': 27,
          'month': 9,
          'year': 2016},
         'departure': {'day': 15,
          'hour': 1,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 7, 'min': 27}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 30,
          'hour': 18,
          'min': 27,
          'month': 9,
          'year': 2016},
         'departure': {'day': 30,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 7, 'min': 27}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_WIFI'],
        'category': '4.0 star hotel',
        'country': 'Canada',
        'dst_city': 'Montreal',
        'gst_rating': 8.86,
        'name': 'The Illustrious Haven Hotel',
        'vicinity': ['market', 'mall']},
       'price': 14606.28,
       'trip': {'duration_days': 16,
        'leaving': {'arrival': {'day': 13,
          'hour': 7,
          'min': 20,
          'month': 9,
          'year': 2016},
         'departure': {'day': 13,
          'hour': 2,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 5, 'min': 20}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 28,
          'hour': 16,
          'min': 20,
          'month': 9,
          'year': 2016},
         'departure': {'day': 28,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 5, 'min': 20}},
        'seat': 'BUSINESS'}}]],
    'search': [{'NUM_ADULTS': '5',
      'NUM_CHILDREN': '7',
      'ORIGIN_CITY': 'Tampa',
      'PRICE_MAX': '32800',
      'RESULT_LIMIT': '10',
      'timestamp': 1473717286.921}]},
   'labels': {'active_frame': 1,
    'acts': [{'args': [{'key': 'str_date'}, {'key': 'end_date'}],
      'name': 'request'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}]},
      'requests': [{'author': 'wizard', 'key': 'end_date'},
       {'author': 'wizard', 'key': 'str_date'}]}]},
   'text': 'Do you have any date constraints?',
   'timestamp': 1473717309095.0},
  {'author': 'user',
   'labels': {'active_frame': 1,
    'acts': [{'args': [{'key': 'str_date', 'val': 'September 12'},
       {'key': 'end_date', 'val': '26'}],
      'name': 'inform'}],
    'acts_without_refs': [{'args': [{'key': 'str_date', 'val': 'September 12'},
       {'key': 'end_date', 'val': '26'}],
      'name': 'inform'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []}]},
   'text': 'Oh yes! Between September 12 and 26!',
   'timestamp': 1473717407252.0},
  {'author': 'wizard',
   'db': {'result': [[{'hotel': {'amenities': ['FREE_PARKING',
         'FREE_BREAKFAST',
         'FREE_WIFI'],
        'category': '3.0 star hotel',
        'country': 'Canada',
        'dst_city': 'Kingston',
        'gst_rating': 8.49,
        'name': 'Exalted Raven B&B',
        'vicinity': ['museum']},
       'price': 16273.66,
       'trip': {'duration_days': 14,
        'leaving': {'arrival': {'day': 12,
          'hour': 20,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 26,
          'hour': 14,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 26,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '3.0 star hotel',
        'country': 'Canada',
        'dst_city': 'Kingston',
        'gst_rating': 8.49,
        'name': 'Exalted Raven B&B',
        'vicinity': ['museum']},
       'price': 13233.12,
       'trip': {'duration_days': 14,
        'leaving': {'arrival': {'day': 12,
          'hour': 20,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 26,
          'hour': 14,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 26,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.0 star hotel',
        'country': 'United States',
        'dst_city': 'San Diego',
        'gst_rating': 6.51,
        'name': 'Anomaly Inn & Suites',
        'vicinity': ['park']},
       'price': 7668.74,
       'trip': {'duration_days': 14,
        'leaving': {'arrival': {'day': 12,
          'hour': 18,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 26,
          'hour': 12,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 26,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.0 star hotel',
        'country': 'United States',
        'dst_city': 'San Diego',
        'gst_rating': 6.51,
        'name': 'Anomaly Inn & Suites',
        'vicinity': ['park']},
       'price': 6584.11,
       'trip': {'duration_days': 14,
        'leaving': {'arrival': {'day': 12,
          'hour': 18,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 26,
          'hour': 12,
          'min': 16,
          'month': 9,
          'year': 2016},
         'departure': {'day': 26,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 16}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '3.0 star hotel',
        'country': 'Dominican Republic',
        'dst_city': 'Punta Cana',
        'gst_rating': 6.77,
        'name': 'Scarlet Peaks Hotel',
        'vicinity': ['cathedral']},
       'price': 10852.78,
       'trip': {'duration_days': 14,
        'leaving': {'arrival': {'day': 12,
          'hour': 1,
          'min': 59,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 0,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 59}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 25,
          'hour': 12,
          'min': 59,
          'month': 9,
          'year': 2016},
         'departure': {'day': 25,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 59}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '3.0 star hotel',
        'country': 'Dominican Republic',
        'dst_city': 'Punta Cana',
        'gst_rating': 6.77,
        'name': 'Scarlet Peaks Hotel',
        'vicinity': ['cathedral']},
       'price': 9057.8,
       'trip': {'duration_days': 14,
        'leaving': {'arrival': {'day': 12,
          'hour': 1,
          'min': 59,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 0,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 59}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 25,
          'hour': 12,
          'min': 59,
          'month': 9,
          'year': 2016},
         'departure': {'day': 25,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 1, 'min': 59}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '4.0 star hotel',
        'country': 'South Africa',
        'dst_city': 'Queenstown',
        'gst_rating': 8.22,
        'name': 'Emerald Mountain Hotel',
        'vicinity': ['museum']},
       'price': 31122.0,
       'trip': {'duration_days': 14,
        'leaving': {'arrival': {'day': 13,
          'hour': 3,
          'min': 37,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 10, 'min': 37}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 25,
          'hour': 21,
          'min': 37,
          'month': 9,
          'year': 2016},
         'departure': {'day': 25,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 10, 'min': 37}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '4.0 star hotel',
        'country': 'Canada',
        'dst_city': 'Kingston',
        'gst_rating': 8.22,
        'name': 'Ebony Manor Inn & Suites',
        'vicinity': ['museum']},
       'price': 16914.3,
       'trip': {'duration_days': 13,
        'leaving': {'arrival': {'day': 12,
          'hour': 20,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 25,
          'hour': 14,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 25,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'seat': 'BUSINESS'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '4.0 star hotel',
        'country': 'Canada',
        'dst_city': 'Kingston',
        'gst_rating': 8.22,
        'name': 'Ebony Manor Inn & Suites',
        'vicinity': ['museum']},
       'price': 13715.43,
       'trip': {'duration_days': 13,
        'leaving': {'arrival': {'day': 12,
          'hour': 20,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 25,
          'hour': 14,
          'min': 34,
          'month': 9,
          'year': 2016},
         'departure': {'day': 25,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 3, 'min': 34}},
        'seat': 'ECONOMY'}},
      {'hotel': {'amenities': ['FREE_PARKING', 'FREE_BREAKFAST', 'FREE_WIFI'],
        'category': '2.5 star hotel',
        'country': 'Mexico',
        'dst_city': 'Tijuana',
        'gst_rating': 6.77,
        'name': 'Hotel Perfection',
        'vicinity': ['park']},
       'price': 11225.2,
       'trip': {'duration_days': 13,
        'leaving': {'arrival': {'day': 12,
          'hour': 19,
          'min': 47,
          'month': 9,
          'year': 2016},
         'departure': {'day': 12,
          'hour': 17,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 2, 'min': 47}},
        'or_city': 'Tampa',
        'returning': {'arrival': {'day': 25,
          'hour': 13,
          'min': 47,
          'month': 9,
          'year': 2016},
         'departure': {'day': 25,
          'hour': 11,
          'min': 0,
          'month': 9,
          'year': 2016},
         'duration': {'hours': 2, 'min': 47}},
        'seat': 'ECONOMY'}}]],
    'search': [{'END_TIME': '1474934400000',
      'NUM_ADULTS': '5',
      'NUM_CHILDREN': '7',
      'ORIGIN_CITY': 'Tampa',
      'PRICE_MAX': '32800',
      'RESULT_LIMIT': '10',
      'START_TIME': '1473638400000',
      'timestamp': 1473717421.634}]},
   'labels': {'active_frame': 1,
    'acts': [{'args': [{'key': 'duration', 'val': '15 day'},
       {'key': 'category', 'val': '4'},
       {'key': 'dst_city', 'val': 'Queenstown'},
       {'key': 'breakfast', 'val': True},
       {'key': 'wifi', 'val': True},
       {'key': 'parking', 'val': True},
       {'key': 'price', 'val': '31122.0'},
       {'key': 'id', 'val': 2}],
      'name': 'offer'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []},
     {'binary_questions': [],
      'compare_requests': [],
      'frame_id': 2,
      'frame_parent_id': 1,
      'info': {'breakfast': [{'negated': False, 'val': True}],
       'budget': [{'negated': False, 'val': '32800.0'}],
       'category': [{'negated': False, 'val': '4.0'}],
       'dst_city': [{'negated': False, 'val': 'Queenstown'}],
       'duration': [{'negated': False, 'val': '15'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'parking': [{'negated': False, 'val': True}],
       'price': [{'negated': False, 'val': '31122.0'}],
       'str_date': [{'negated': False, 'val': 'september 12'}],
       'wifi': [{'negated': False, 'val': True}]},
      'requests': []}]},
   'text': 'In that case, I would like to recommend you our best deal: a 15 day stay at a prestigious 4 star hotel in Queenstown with free breakfast, wifi, and parking during your entire stay. For the whole family it will just be 31122.0.',
   'timestamp': 1473717475174},
  {'author': 'user',
   'labels': {'active_frame': 2,
    'acts': [{'args': [{'key': 'ref',
        'val': [{'annotations': [], 'frame': 1, 'fromrange': False}]},
       {'key': 'str_date'},
       {'key': 'end_date'}],
      'name': 'confirm'},
     {'args': [{'key': 'ref',
        'val': [{'annotations': [{'key': 'ref_anaphora', 'val': 'that'}],
          'frame': 2,
          'fromrange': False}]}],
      'name': 'switch_frame'},
     {'args': [{'key': 'seat', 'val': 'economy'}], 'name': 'request'}],
    'acts_without_refs': [{'args': [{'key': 'str_date', 'val': None},
       {'key': 'end_date', 'val': None}],
      'name': 'confirm'},
     {'args': [{'key': 'ref_anaphora', 'val': 'that'}],
      'name': 'switch_frame'},
     {'args': [{'key': 'seat', 'val': 'economy'}], 'name': 'request'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []},
     {'binary_questions': [{'author': 'user',
        'key': 'seat',
        'value': 'economy'}],
      'compare_requests': [],
      'frame_id': 2,
      'frame_parent_id': 1,
      'info': {'breakfast': [{'negated': False, 'val': True}],
       'budget': [{'negated': False, 'val': '32800.0'}],
       'category': [{'negated': False, 'val': '4.0'}],
       'dst_city': [{'negated': False, 'val': 'Queenstown'}],
       'duration': [{'negated': False, 'val': '15'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'parking': [{'negated': False, 'val': True}],
       'price': [{'negated': False, 'val': '31122.0'}],
       'str_date': [{'negated': False, 'val': 'september 12'}],
       'wifi': [{'negated': False, 'val': True}]},
      'requests': []}]},
   'text': "That sounds amazing, and it's within those dates? Is that economy class?",
   'timestamp': 1473717572188},
  {'author': 'wizard',
   'db': {'result': [], 'search': []},
   'labels': {'active_frame': 2,
    'acts': [{'args': [{'key': 'str_date', 'val': '12th'},
       {'key': 'end_date', 'val': '25th'},
       {'key': 'seat', 'val': 'economy'}],
      'name': 'inform'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []},
     {'binary_questions': [],
      'compare_requests': [],
      'frame_id': 2,
      'frame_parent_id': 1,
      'info': {'breakfast': [{'negated': False, 'val': True}],
       'budget': [{'negated': False, 'val': '32800.0'}],
       'category': [{'negated': False, 'val': '4.0'}],
       'dst_city': [{'negated': False, 'val': 'Queenstown'}],
       'duration': [{'negated': False, 'val': '15'}],
       'end_date': [{'negated': False, 'val': '25'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'parking': [{'negated': False, 'val': True}],
       'price': [{'negated': False, 'val': '31122.0'}],
       'seat': [{'negated': False, 'val': 'economy'}],
       'str_date': [{'negated': False, 'val': 'september 12'}],
       'wifi': [{'negated': False, 'val': True}]},
      'requests': []}]},
   'text': "Yup it's from the 12th to the 25th, and it will be economy class.",
   'timestamp': 1473717598581},
  {'author': 'user',
   'labels': {'active_frame': 2,
    'acts': [{'args': [{'key': 'intent', 'val': 'book'}], 'name': 'inform'}],
    'acts_without_refs': [{'args': [{'key': 'intent', 'val': 'book'}],
      'name': 'inform'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []},
     {'binary_questions': [],
      'compare_requests': [],
      'frame_id': 2,
      'frame_parent_id': 1,
      'info': {'breakfast': [{'negated': False, 'val': True}],
       'budget': [{'negated': False, 'val': '32800.0'}],
       'category': [{'negated': False, 'val': '4.0'}],
       'dst_city': [{'negated': False, 'val': 'Queenstown'}],
       'duration': [{'negated': False, 'val': '15'}],
       'end_date': [{'negated': False, 'val': '25'}],
       'intent': [{'negated': False, 'val': 'book'},
        {'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'parking': [{'negated': False, 'val': True}],
       'price': [{'negated': False, 'val': '31122.0'}],
       'seat': [{'negated': False, 'val': 'economy'}],
       'str_date': [{'negated': False, 'val': 'september 12'}],
       'wifi': [{'negated': False, 'val': True}]},
      'requests': []}]},
   'text': 'Ok perfect, book me!',
   'timestamp': 1473717611188},
  {'author': 'wizard',
   'db': {'result': [], 'search': []},
   'labels': {'active_frame': 2,
    'acts': [{'args': [{'key': 'action', 'val': 'book'}], 'name': 'inform'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []},
     {'binary_questions': [],
      'compare_requests': [],
      'frame_id': 2,
      'frame_parent_id': 1,
      'info': {'action': [{'negated': False, 'val': 'book'}],
       'breakfast': [{'negated': False, 'val': True}],
       'budget': [{'negated': False, 'val': '32800.0'}],
       'category': [{'negated': False, 'val': '4.0'}],
       'dst_city': [{'negated': False, 'val': 'Queenstown'}],
       'duration': [{'negated': False, 'val': '15'}],
       'end_date': [{'negated': False, 'val': '25'}],
       'intent': [{'negated': False, 'val': 'book'},
        {'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'parking': [{'negated': False, 'val': True}],
       'price': [{'negated': False, 'val': '31122.0'}],
       'seat': [{'negated': False, 'val': 'economy'}],
       'str_date': [{'negated': False, 'val': 'september 12'}],
       'wifi': [{'negated': False, 'val': True}]},
      'requests': []}]},
   'text': 'Consider it done! Have a good trip :slightly_smiling_face:',
   'timestamp': 1473717619766},
  {'author': 'user',
   'labels': {'active_frame': 2,
    'acts': [{'args': [], 'name': 'thankyou'}],
    'acts_without_refs': [{'args': [], 'name': 'thankyou'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []},
     {'binary_questions': [],
      'compare_requests': [],
      'frame_id': 2,
      'frame_parent_id': 1,
      'info': {'action': [{'negated': False, 'val': 'book'}],
       'breakfast': [{'negated': False, 'val': True}],
       'budget': [{'negated': False, 'val': '32800.0'}],
       'category': [{'negated': False, 'val': '4.0'}],
       'dst_city': [{'negated': False, 'val': 'Queenstown'}],
       'duration': [{'negated': False, 'val': '15'}],
       'end_date': [{'negated': False, 'val': '25'}],
       'intent': [{'negated': False, 'val': 'book'},
        {'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'parking': [{'negated': False, 'val': True}],
       'price': [{'negated': False, 'val': '31122.0'}],
       'seat': [{'negated': False, 'val': 'economy'}],
       'str_date': [{'negated': False, 'val': 'september 12'}],
       'wifi': [{'negated': False, 'val': True}]},
      'requests': []}]},
   'text': 'Thanks!',
   'timestamp': 1473717628592},
  {'author': 'wizard',
   'db': {'result': [], 'search': []},
   'labels': {'active_frame': 2,
    'acts': [{'args': [], 'name': 'you_are_welcome'}],
    'frames': [{'binary_questions': [],
      'compare_requests': [],
      'frame_id': 1,
      'frame_parent_id': None,
      'info': {'budget': [{'negated': False, 'val': '32800.0'}],
       'dst_city': [{'negated': False, 'val': '-1'}],
       'end_date': [{'negated': False, 'val': '26'}],
       'intent': [{'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'str_date': [{'negated': False, 'val': 'september 12'}]},
      'requests': []},
     {'binary_questions': [],
      'compare_requests': [],
      'frame_id': 2,
      'frame_parent_id': 1,
      'info': {'action': [{'negated': False, 'val': 'book'}],
       'breakfast': [{'negated': False, 'val': True}],
       'budget': [{'negated': False, 'val': '32800.0'}],
       'category': [{'negated': False, 'val': '4.0'}],
       'dst_city': [{'negated': False, 'val': 'Queenstown'}],
       'duration': [{'negated': False, 'val': '15'}],
       'end_date': [{'negated': False, 'val': '25'}],
       'intent': [{'negated': False, 'val': 'book'},
        {'negated': False, 'val': 'book'}],
       'n_adults': [{'negated': False, 'val': '5'}],
       'n_children': [{'negated': False, 'val': '7'}],
       'or_city': [{'negated': False, 'val': 'Tampa'}],
       'parking': [{'negated': False, 'val': True}],
       'price': [{'negated': False, 'val': '31122.0'}],
       'seat': [{'negated': False, 'val': 'economy'}],
       'str_date': [{'negated': False, 'val': 'september 12'}],
       'wifi': [{'negated': False, 'val': True}]},
      'requests': []}]},
   'text': 'My pleasure!',
   'timestamp': 1473717649089}],
 'user_id': 'U2AMZ8TLK',
 'wizard_id': 'U260BGVS6'}
 

About

Course project for Metis' Intro to Data Science by analyzing how to make chatbots smarter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors