49714 Programming for Online Prototypes
· 9 members
A hands on introduction to building online products and services through code
apple allows you to simulate conversations you could have or have had with your partner. With apple one can build a greater understanding of their partner and relationship through conversation.
apple is designed for an individual to simulate a conversation based on a topic that could become an argument between that individual and their partner. For the purposes of this exercise, I will look at only one situation; when an individual’s partner makes plans for them without asking them beforehand.
apple function as a SMS bot via Twilio. Each conversation consists of four participants: the user, the apple bot (introduces you to apple and provides help), a simulated partner bot (named Chris), and a mediator bot.
A user is first introduced to the purpose of the bot and the scenario the user is supposed to imagine themselves in for the purposes of the simulation. Once the simulation begins, the mediator suggest a basic framework for conversation (based on Pangaro’s CLEAT model) and provide relationship advice (based on research, literature, etc…).
The bot utilizes Dialogflow to understand what users are saying, if they are successfully addressing the CLEAT model, and what advice is the most relevant.
This project was informed, designed, and built for my thesis Conversational Symbiosis Amongst Humans and AI In the Context of Plateaus in Romantic Relationships. Currently, I am trying to answer a number of research question, these include:
I used ideas from a variety of literature. These include the four stages of a romantic conversation, I developed based on Gordon Pask's Conversation Theory and Paul Pangaro and Hugh Dubberly's work on conversation. The four stages include:
The bot also takes advantage of knowledge and advice from relationship literature, that includes:
Some historical projects I used for inspiration include:
Before going into this process, I had completed a good amount of research in regards to my thesis. Lots of that knowledge was useful for this assignment.
To effectively use that knowledge and complete this assignment, I mapped everything I had seen in the last year and develop a number of points that would be the most relevant for this project. A lot of those points, were the aspects I mentioned in the Context section.
What I have not previously thought about was the dialogue for such a bot.
I took some time to develop what I began to call blocks. Blocks allow both the mediator bot and Chris to guide the conversation so that I can touch on specific topics. These blocks include an introduction to the bot, the activation of a bot, and a block designed specifically for a mediator bot to introduce the concept of paraphrasing in the context of two partners having a conversation.
Below, you can see an example of blocks. In each block, I look for a specific type of answer with the help of DialogFlow. If I do not get the type of answer I am looking for, I use a backup question that should produce a more specific answer that will allow apple to move to the next block.
You can see how I implemented blocks in the code below.
Click to Expand
elsif session[:eight_stage_complete] == true if latest_message_intent_name == "taylorConfirmationYes" || latest_message_intent_name == "yesNoQuestionYes" session[:ninth_stage_complete] = true session[:eight_stage_complete] = false send_to_twilio tenth_response_array_yes elsif latest_message_intent_name == "taylorConfirmationNo" || latest_message_intent_name == "yesNoQuestionNo" session[:tenth_stage_first_no] = true send_to_twilio tenth_response_array_no elsif session[:tenth_stage_first_no] == true session[:ninth_stage_complete] = true session[:eight_stage_complete] = false send_to_twilio tenth_response_array_yes else send_to_twilio tenth_response_array_backup end elsif session[:ninth_stage_complete] == true
I also attempted to make the code I was developing as reusable as possible. I achieved this by creating functions that I could call numerous times in a variety of loops.
Click to Expand
def send_to_dialogflow message, dialogflow_client response = dialogflow_client.text_request message.to_s parsed_response = response[:result][:fulfillment][:speech] parsed_response_intent_name = response[:result][:metadata][:intentName] [parsed_response, parsed_response_intent_name] end
Click to Expand
def send_to_twilio input_responses # Build a twilio response object response = Twilio::TwiML::MessagingResponse.new input_responses.each do |individual_response| response.message do |message| unless individual_response.nil? message.body(individual_response) end unless individual_response.nil? message.media(individual_response) end end end # send a response to twilio content_type 'text/xml' response.to_s end
In the apple scenario I created, four different individuals are involved. apple the bot. Taylor, which is played by the user. Chris, a bot that plays Taylor’s partner. And also the Mediator Bot, an objective, non judgmental, accepting, and thoughtful third party.
When users first message apple they are introduced to the bot through apple the bot, what it does, and how a user can trigger those options.
Users are told they can
simulate two types of conversations. Type 1 to have a conversation with a simulated partner. Type 2 to include a mediator bot.
to learn about what else you can do, type assistance.
Once a user goes through the initial setup, the user is taken into the simulation.
You are now entering an alternative world. Your partner is just about to text you about the event next Saturday.
Once in that world, a user talks to their partner. The user and Chris go back and forth for a short amount of time, before Chris (their partner) asks to include the mediator bot. The mediator bot introduces themselves and the four stages of conversation (sharing phase, exchange phase, evolution phase, response phase) I mentioned before.
The mediator bot then facilitates a productive conversation between the two parties. It utilizes strategies from intimate relationship literature, to provide scientifically proven advice, which in turn would build credibility for the mediator bot.
By the end of the conversation, a user is able to reflect on their own conversations, see how strategies mentioned in the chat could be potentially used and where they have potentially made mistakes with a partner in the past.
They then have the ability to redo the simulation or choose from a number of other simulations (these has not been developed).
Through a conversation on apple, a user is able to reflect on their own conversations, see how strategies mentioned in the chat could be potentially used and where they have potentially made mistakes with a partner in the past.
Still, there were a couple issues I confronted when making the bot.
1. The timing of the texts. Ideally I would be able to replicate the timing of a real conversation, but I could not figure a way to do that with Twilio.
2. Inability to differentiate individuals. Below, you see a more optimal version where users would be able to easily scan and differentiate different individual’s messages. Today, I used a technique inspired by screenwriting to differentiate roles.
3. Struggled visualizing the stages of conversation. I struggled with the visualizing these stages with the tools and the personalization they allow me in creating a bot. Ideally, a user would be able to see exactly where they are in a conversation, what that need to do, and what they have already achieved.
Regardless of those issues, apple will serve as a probe to answer a number of research questions pertaining to my thesis. It can also serve as a artifact that allows a user to take advantage of the effectiveness of simulations. By picturing a successful action, one is able to enhance their ability to make decisions in the future.
As I go forward and further develop some of the ideas in apple, it will be important to build a greater understanding of the ramifications of including a bot into a conversation between two partners and how an artificial agent can be effectively deployed in the communications of two partners.
Allows you to simulate conversations you could have or have had with your partner. With apple one can build a greater understanding of their partner and relationship through conversation.
October 17th, 2018