Just noise? Using GPT3 to analyse Google reviews of London police stations

The data

Exploratory analysis

It’s love-hate: 86% of reviews are either 1 star or 5 star reviews
Note that for some reason ‘y’ has been replaced by ‘i’ 😕

Text analysis: Topic modelling

Text analysis: OpenAI GPT models 💻

Prompt to identify review categories

Imagine you are reading google reviews for a police station.

Your task is to categorise these reviews.

There are 7 categories:
1) 'Waiting times', people complaining that they were waiting for a long time in the police station or for someone to visit them.
2) 'Poor customer service', people complaining that they were not well treated at the station or an officer was rude to them.
3) 'Thank you', the reviewer had a positive experience with the police and wants to show their appreciation.
4) 'Difficulty contacting', people complaining that they could not contact the police over the phone.
5) 'Poor investigation of crime', people complaining that the police did not investigate a crime properly.
6) 'Sarcastic', positive reviews about how they received as good service a bit like a hotel guest after being arrested.
7) 'Other', reviews that do not fall into any of the other categories. Here are some examples.

Example 1: Review: Absolutely Useless! My car got destroyed and answer to this.. sorry nothing we can do for you... my question- are you going to investigate it? Answer- more likely No, So technically none cares .. what is POLICE for then? if you need them they give you papers to complete and that's all, job done! Well done! Oh yeah we don't care who done it, just call your insurance. So where is the justice?!?
Category: 'Poor investigation of crime'.
Example 2: Review: Why do they not ever pick up the phone? Is there a reason for this? I've been trying to get hold of the police station all week! Is there another phone number I can use!!!.
Category: 'Difficulty contacting'.
Example 3: Very nice and friendly staff who are attentive and patient, they helped me very kindly when I was hopeless and homeless. Thank you.
Category: 'Thank you'.
Example 4: Only 1 "officer" working the desk at any time, expect long waiting times if any other person decides to be there at the same time as you.
Category: 'Waiting times'.
Example 5: Review: worst police station ever!!!! They didn't even help me or try to understand my point of view! Very poor service and lots of lie, they never update you on things!
Category: 'Poor customer service'.
Example 6: Review: CAN YOU PLEASE STOP LEAVING DOGS OUTSIDE IN COURTYARD AT NIGHT. I live next door and constantly hear distressed and terrified dogs barking for up to 12 hours at night/into the day. It wakes my dogs, makes them bark, it wakes me up and I have a terrible day at work.
Category: 'other'.
Example 7: Review: amazing hotel my compliments to the chef, had some nice slop and reused teabag tea.
Awesome. Category: 'Sarcastic'
Example 8: Review: Love Brixton police station. Order pizza from my cell, got my Xbox....top place.
Category: 'Sarcastic'.
Review: [INSERT THE REVIEW TO BE CATEGORISED]
Category: [MODEL COMPLETION]
  • I used Open AI’s davinci-002 model. This is a faster and cheaper version of davinci-003 but not as sophisticated in what it can do. I tried using 003 but didn’t see much difference and it took longer to run.
  • Temperature in the model was set to 1. I tried varying this and didn’t see much difference in the results so stuck with the default.
  • Analysis was carried out in R using the OpenAI package.

Text analysis — Using AI to extracting recommendations for improvement

  1. Run a prompt asking the AI to suggest changes as to how we could improve service to address the issue raised by the reviewer
  2. This gives us some long sentences with recommended improvements. So we run the AI over these outputs and ask it to summarise them into a few short words
  3. Then give the AI an aggregate of individual recommendations and ask it to make a series of suggestions to improve our service
Prompt to generate customer service solutions

Imagine you are in charge of making improvements to customer service in a police station.
You're going to read customer reviews that are about the service and/or how they were treated at the station.

You need to suggest changes or solutions that could address the issue.

Example: Complaint: The staff at reception were rude to me and didn't seem to take me seriously.
Solution: Staff should take every complaint or report seriously.

Example: I was waiting for ages, no one told us anything there was only one person at the reception.
Solution: More staff at reception at busier times and better communication with customers.

Complaint: [INSERT TEXT OF COMPLAINT]
Solution: [MODEL COMPLETION]
Prompt to generate customer service solutions
Please summarise these suggested changes at the police station in a few words.

Example: Solution: This customer had a number of issues with their experience at the police station.
To address these issues, the staff should be more polite and efficient, and better equipped to handle customer inquiries.
In addition, the police station should make an effort to be more responsive to the needs of women and victims of violence.
Summary: More polite staff, more understanding of needs of women and victims of violence.

Example: Solution: Staff should be respectful and helpful to all customers.
If a customer reports a bad experience, the staff should take the complaint seriously and try to resolve the issue.
Summary: More respectful, take all complaints seriously.

Example: Solution: The officers should have used better judgement in deciding whether or not to arrest the individuals.
If the individuals were not causing any harm and were fully clothed, there was no need for them to be arrested.
The officers also needs to be more professional and respectful when dealing with individuals, regardless of their age.
Summary: Exercise judgement before arrest, more professional and respectful.

Solution: [INSERT TEXT OF SOLUTION TO BE SUMMARISED]

Summary: [MODEL COMPLETION]
Prompt to generate a series of recommendations

Imagine you are in charge of making specific and actionable recommendations to improve customer service at a police station.

The following are a series of summaries of solutions to customer service complaints at our police station.

There are a lot of them and we need 10 specific and actionable recommendations based on these to make changes to improve our service.

The summaries of the suggested solutions are as follows:
[INSERT LIST OF 50 SOUTION SUMMARIES]

Extracting important information

Prompt to identify named officers

The following is a review about a police station.
If the name of an officer is mentioned in the review, please identify the name of the officer or officers.
Return the exact names of any officers mentioned.

Example 1: Review: On the 9th of February I had an argument with police officer Barry Jones in the station who was very rude to me.
Specific officers named: Barry Jones.

Example 2: Review: The police didn't investigate at all after I reported my bike stolen!!
Specific officers named: none.

Example 3: Review: I had a terrible experience with an officer who pulled me over in my car outside kings cross station and gave no reason for doing so.
I need this to be investigated.
Specific officers named: none.

Example 4: Review: When I went to the station in Brixton I tried to speak to the officer investigating the burglary at my house.
Ed Smith the officer I spoke to was really helpful, thanks.
Specific officers named: Ed Smith.

Example 5: Review: Horrible horrible experience.
I went there to complain about someone and the police officer in the reception was very rude and was kinda blaming Me.
She did not even ask for any relevant question. It was just a waste of time. worst police station ever!!!!
Specific officers named: none.

Example 6: Review: The constable didn't even help me or try to understand my point of view!
Very poor service and lots of lies, they never update you on things!
Specific officers named: none.

Review: [INSERT REVIEW HERE]
Specific officers named: [MODEL COMPLETION]

What are the key takeaways?

  1. The volume of Google maps reviews for police stations is low limiting their value
  2. Reviews may give user insights not captured in standard police feedback channels
  3. AI models show very promising capabilities for analysis of unstructured text:
  • Prompt engineering matters a lot: Iterating the prompts you give the model can dramatically improve the results. Much as with providing instructions to a person, context and examples seems to help a lot. I’m sure that this is going to become it’s own niche art/science.
  • Fine tuning models should improve accuracy a lot: I didn’t try to do this, but OpenAI recommends fine tuning a model specific to your use case by training it on prompts and exemplar solutions.
  • The AI can be be given a framework for analysis: Just as you might write an analysis protocol for analysing qualitative data. You can instruct the AI giving it a role, context and examples to get the best results.
  • Model outputs do need human checking: As with human analysis you need to QA the results. I found it to be pretty good, but it was prone to mistakes. For example, mis-labelling some genuinely positive ‘thank you’ reviews as sarcastic. Or maybe I was wrong and it was right?! 😕

--

--

Designing our world for who and how we are: brought to you by the Behavioural Insights Team — The Nudge Unit

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ed Flahavan

Writing in a personal capacity. Work on home affairs and security projects at the Behavioural Insights Team.