simulation.user.movies package

Submodules

simulation.user.movies.movies_simulated_user module

Simple simulated user for the movie domain

Author: Shuo Zhang

class simulation.user.movies.movies_simulated_user.MovieSimulatedUser(dialogue_file, response_tempt={'...': ['Hope you can be clearer in the future...'], 'Complete': ['I really like this movie!', 'Thanks!', 'I will watch it. Thanks!', 'bye', 'Thank you!'], 'Disclose': ['I like {genre} movies', 'I enjoy {genre} movies', 'I usually prefer to watch {genre}'], 'Disclose-review': ['I really like it', 'Just so so', 'It is an average movie', 'I dislike it'], 'Disclose-review-dislike': ['Just so so', 'I dislike it'], 'Disclose-review-like': ['I really like it', 'It is an average movie'], 'End': ['Bye'], 'Expand': ['I also like {genre} movies', 'I also enjoy {genre} movies', 'I also prefer to watch {genre}'], 'Inquire': ['Can you book me tickets?', 'Please book it for me'], 'Interrupt': ['Can we change to another movie?'], 'List': ['Could you recommend some movies?'], 'More': ['What else?'], 'Navigate': ['Help'], 'Non-disclose': ['Hello'], 'Non-disclose-review': ['I forgot', 'I do not remember'], 'Note': ['No', 'No, tell me more about it', 'Nope'], 'Note-dislike': ['I do not like it', 'I dislike this movie', 'I dont like it'], 'Note-end': ['Seems good, I will watch it.', 'I will watch it.', 'It is great!'], 'Note-yes': ['Yes, I have see it already', "This I've watched"], 'Refine': ['Actually, I like {genre} movies', 'Actually,. I enjoy {genre} movies', 'Actually,. I usually prefer to watch {genre} movies'], 'Repeat': ['Tell me about its plot!', 'Give me the storyline!', 'Who are the actors?', 'Actors?', 'Who directed this movie?', 'Director?', 'What is the release time', 'Release year?', 'How long is it this movie?', 'Duration?', 'Rating on IMDB'], 'Revise': ['Sorry, I change my mind. I like {genre} movies', 'Sorry, I change my mind.. I enjoy {genre} movies', 'Sorry, I change my mind.. I usually prefer to watch {genre}'], 'Similar': ['Could you recommend another movies?', 'Can you recommend another one?', 'Another']}, mode='ms')

Bases: simulation.user.simulated_user.SimulatedUser, simulation.user.user_generator.UserGenerator, simulation.nlp.movies.movies_nlg.MoviesNLG, simulation.nlp.movies.movies_nlu.MoviesNLU

Simulated user for movie domain

agenda

Agenda property.

Returns: agenda

annotate_bot_intent(utterance)

Annotate the bot reply by intent.

If there is no exactly the same sentence, find the one with the best cosine similarity.

Parameters:utterance – system utterance

intent_map: {sentence:intent} dictionary built based on history tfidf_matrix: tf idf matrix

Returns: Intent of the most similar sentence

generate_response(utterance, persona=None)

Generates response based on the received utterance.

Parameters:
  • utterance – reply from chatbot; relayed by conversation manager
  • persona – user persona

Returns: updated user response

init_a(agenda_stat)

Initiates agenda stack by sampling push actions.

Parameters:agenda_stat – agenda stat

Returns: agenda stack

init_agenda()

Initiates/prints agenda stack by sampling push actions.

Returns: agenda stack

init_agenda_qrfa()

Initiates agenda stack for QRFA model.

Returns: updates agenda stack and prints out

init_agenda_qrfa_test()

Tests of initiating agenda stack for QRFA model.

Returns: updates agenda stack and prints out

init_dialog()

Initiates dialog with the conversational system.

Returns: initial utterance

next_action(stat)

Determines the next action

Parameters:stat – states

Returns: next action based on probability disctribution

simulation.user.movies.movies_simulated_user.file_process(dialogue_file='1224_ms.json')

Converts the json dialogue records.

Parameters:file – annotated dialogue corpus.

Returns: mediate files

simulation.user.movies.movies_simulated_user.qrfa_agenda_generate(qrfa_file)

Generates agenda for QRFA.

Parameters:file – annotated dialogue corpus

Returns: agenda list

simulation.user.movies.movies_simulated_user.state_map(agenda)

Builds the state map based on agenda.

Parameters:agenda – agenda

Returns: agenda map

Module contents