Pondr, Fostering Connection through Good Conversation

We tend to chat all the time with friends new and olds, but often it feels like we’re just scratching at the surface, or defaulting to predictable, mundane conversations. Really good conversations — ones that introduce an element of vulnerability, spur a moment of fun, or create a deep sense of closeness — are few and far between. And when we have those types of conversations, we remember them.

Pondr is a game that turns strangers into friends, and friends into besties, by fostering connection and closeness through really good conversations. Using Cohere, Pondr generates question prompts on command that are uniquely tailored to the players’ setting. Whether you’re looking to deepen a connection with someone you’ve known forever, or you’re just hoping to become more familiar with a new friend, Pondr will help you drive the right sort of conversation.

You can build your own version of Pondr by following these simple steps:

  1. Generate potential conversation questions
  2. Rank the generated questions
  3. Put the generation and classification behind an interface

In this notebook we will walk through the first two steps.

Setup

Install and import the tools we will need as well as initializing the Cohere model.

PYTHON
1import cohere
2from cohere.responses.classify import Example
3import pandas as pd
PYTHON
1co=cohere.Client('YOUR_API_KEY')

1. Generate Potential Conversation Questions

Generate a list of potential conversation questions and retain the first 10.

PYTHON
1#user_input is hardcoded for this example
2user_input='I am meeting up with a coworker. We are meeting at a fancy restaurant. I wanna ask some interesting questions. These questions should be deep.'
3prompt=user_input+'\nHere are 10 interesting questions to ask:\n1)'
4response=co.generate(model='xlarge', prompt=prompt, max_tokens=200, temperature=5).generations[0].text
5response
PYTHON
1def generation_to_df(generation):
2 generation=response.split('\n')
3 clean_questions=[]
4 for i in range(10):
5 curr_q=generation[i]
6 clean_questions.append(curr_q[curr_q.find(')')+1:])
7 clean_q_df=pd.DataFrame(clean_questions, columns=['questions'])
8 return clean_q_df
PYTHON
1clean_q_df = generation_to_df(response)
2pd.options.display.max_colwidth=150
3clean_q_df

2. Classify Questions

Rank and sort the questions based on interestingness and specificity.

PYTHON
1interestingness=[
2 Example("What do you think is the hardest part of what I do for a living?", "Not Interesting"),
3 Example("What\'s the first thing you noticed about me?", "Interesting"),
4 Example("Do you think plants thrive or die in my care?", "Interesting"),
5 Example("Do I seem like more of a creative or analytical type?", "Interesting"),
6 Example("What subject do you think I thrived at in school?", "Not Interesting"),
7 Example("What\'s been your happiest memory this past year?", "Interesting"),
8 Example("What lesson took you the longest to un-learn?", "Not Interesting"),
9 Example("How can you become a better person?", "Not Interesting"),
10 Example("Do you think I intimidate others? Why or why not?", "Interesting"),
11 Example("What\'s the most embarrassing thing that happened to you on a date?", "Not Interesting"),
12 Example("How would you describe what you think my type is in three words?", "Interesting"),
13 Example("What do you think I\'m most likely to splurge on?", "Interesting"),
14 Example("As a child what do you think I wanted to be when I grow up?", "Interesting"),
15 Example("Do you think you are usually early, on time, or late to events?", "Not Interesting"),
16 Example("Do you think I was popular at school?", "Interesting"),
17 Example("What questions are you trying to answer most in your life right now?", "Not Interesting")]
18specificity=[
19 Example("What\'s the first thing you noticed about me?", "Specific"),
20 Example("Do you think plants thrive or die in my care?", "Specific"),
21 Example("Do I seem like more of a creative or analytical type?", "Not Specific"),
22 Example("How would you describe what you think my type is in three words?", "Not Specific"),
23 Example("What do you think I\'m most likely to splurge on?", "Specific"),
24 Example("What subject do you think I thrived at in school?", "Not Specific"),
25 Example("As a child what do you think I wanted to be when I grow up?", "Specific"),
26 Example("Do you think I was popular at school?", "Specific"),
27 Example("Do you think you\'re usually early, on time, or late to events?", "Specific"),
28 Example("Do you think I intimidate others? Why or why not?", "Specific"),
29 Example("What\'s been your happiest memory this past year?", "Not Specific"),
30 Example("What subject do you think I thrived at in school?", "Specific"),
31 Example("What\'s the biggest mistake that you think you needed to make to become who you are now?", "Specific"),
32 Example("Is there anything you\'ve done recently that you\'re incredibly proud of?", "Not Specific"),
33 Example("How are you and your siblings similar?", "Not Specific"),
34 Example("What\'s the worst pain you have ever been in that wasn\'t physical?", "Specific"),
35 Example("Has a stranger ever changed your life?", "Specific"),
36 Example("Do you think the image you have of yourself matches the image other people see you as?", "Specific"),
37 Example("What would your younger self not believe about your life today?", "Specific")]
PYTHON
1def add_attribute(df, attribute, name, target):
2
3 response = co.classify(
4 model='medium',
5 inputs=list(df['questions']),
6 examples=attribute)
7
8 q_conf=[]
9 for q in response.classifications:
10 q_conf.append(q.labels[target].confidence)
11
12 df[name]=q_conf
PYTHON
1add_attribute(clean_q_df, interestingness, 'interestingness', 'Interesting')
2add_attribute(clean_q_df, specificity, 'specificity', 'Specific')
3clean_q_df['average']= clean_q_df.iloc[:,1:].mean(axis=1)
4clean_q_df.sort_values(by='average', ascending=False)