karolrogozinski / restaurant-recommendations-dialog-system

Utrecht University INFOMAIR '24
0 stars 0 forks source link

Implement the state machine #12

Open karolrogozinski opened 12 hours ago

karolrogozinski commented 12 hours ago

Implement the diagram you have created as a dialog management system in Python. Make sure you implement the system conceptually as a state transition function, i.e., your code should contain a function that has the current dialog state and the current user utterance as input and the next dialog state with associated system utterance as output. Use the dialog acts resulting from your classifier from Part 1 in the state transition function. For example: at the start of the dialog, if the user utterance is classified as hello, then the dialog remains in the dialog initiation stage, and the next system utterance should be to ask the user for his preferences. Alternatively, if at the start of the dialog the user utterance is classified as inform, then the next dialog state should be to extract preferences from the inform utterance and proceed based on the number and type of preferences that is extracted. Convert user input to lower case before classifying the dialog act (and before computing Levenshtein edit distance, see below) to match the data format used for training the classifier in Part 1a. For extracting preferences you can use a keyword matching algorithm, i.e., if somewhere in the utterance a keyword is found that represents a type of cuisine, a location, or a price range, or if you find a typical pattern for stating a preference, you can assume that this is the user preference for the respective category. Examples: I’m looking for Italian food → Italian is the food type based on pattern {variable} food I want to go to a bistro → bistro is the food type based on the keyword list for types of food