When the Municipal Services Office (MSO) was established in 2014, it was billed as a one-stop shop for people to provide feedback on day-to-day issues like malfunctioning corridor lights, leaky covered walkways, and littered common areas.
The next year, the OneService App was launched to receive feedback digitally.
In line with MSO’s vision to continuously improve their services, and push the technical boundaries for gathering municipal issues through other means, MSO worked with GovTech to develop the OneService chatbot for WhatsApp and Telegram.
This enables citizens to easily lodge a case and provide additional, crucial information about the complaint through commonly used social messaging apps, such as WhatsApp and Telegram. Powered by machine learning, the chatbot would be able to:
1) Automatically identify the nature of the complaint and classify it into the appropriate category (killer litter, illegal parking, etc),
2) Extract the relevant details of the incident that needs attention (location, address, landmark, when it occurred, etc), fill in the feedback template, and get the user to verify and provide additional details.
3) And identify the correct government agency that should take action (NEA, NParks, LTA, etc) and pass the case on.
How did the Moments of Life Division’s Virtual Intelligent Chat Assistant (VICA) team and the Data Science and Artificial Intelligence Division’s GovText team work together to develop a chatbot capable of having a conversation?
Identifying the case type
With the OneService app in operation since 2015, MSO has collected a substantial amount of feedback from the public.
Every time a case is looked into, an officer will tag a case with its corresponding case type, and this information is stored in the database. Since the feedback submitted through the chatbot will be similar to that submitted through the app, the app’s data can be used to train the chatbot’s case type categoriser.
Essentially, this means feeding both the feedback text and case type of each case to the categoriser so that it learns to associate certain words and patterns in the text with its corresponding case type.
Drawing from its experience, the case type categoriser will look for relevant words and patterns to help it make a best guess of what the correct case type should be based on just the feedback text.
Armed with over 160,000 cases from two years’ worth of OneService app data, the teams tried out different techniques in Natural Language Processing (the field of getting computers to understand human language) and managed to build a categoriser which can predict the correct case type correctly 80 per cent of the time.
They then extracted the key case details and pre-filled the case form for the user.
“This is trickier because unlike the case type, we had no existing labelled key words as the MSO staff had no need to label the key words in their work process,” said GovTech.
“Hence, we set up an annotation framework and get our MSO colleagues to help us annotate the words within the feedback text with labels representing the types of important information required to resolve a case such as the dates and times the incidents occurred, landmarks, and addresses.”
In all, they labelled text from 5,600 cases, yielding these annotations.
They used these prepared examples to train a case details recogniser, which can identify the different types of key information with 85 per cent accuracy.
At this stage, they are able to automatically identify the nature of the complaint, extract the relevant details, fill up the feedback template, and prompt the user to add missing information.
Identify the appropriate agency
Now that the case has been successfully filed by the user, they needed to find the correct agency to deal with it.
As you might already know, municipal services are overseen by multiple agencies, so it may not always be straightforward nor simple for the OneService Chatbot to activate the right process.
For this step, in addition to the feedback text and the case type (automatically tagged and then verified by the user), they use the images and the geolocation submitted by the user.
But why didn’t they just use the images and geolocation to help identify the case type?
GovTech reasoned that while these additional data helped boost accuracy of the case type identification by between two and three per cent, the relatively small gain in prediction performance did not justify the additional time it took to generate the predicted case type.
“After all, we don’t want to keep the user waiting for too long when they are conversing with the chatbot,” it added.
At the agency identification stage however, the user is no longer involved and they can afford to take more time to process the geolocation and image data.
Geolocations have an important role in identifying the right agency, because some types of cases can be handled by more than one agency based on just the case description alone. Hence, the agency assigned would depend on which agency’s land an incident took place in, or is nearest to.
For example, if a Tree Pruning case is reported within a housing estate, the nearest town council will be assigned to handle the case. However, if a similar case happens in a park (e.g. West Coast Park), NParks will be assigned to handle the case instead.
As for images submitted by users, the teams used an objection detection model to look for cigarette butts, lampposts, ceiling lights, and other items commonly associated with municipal issues.
“We do this because the likelihoods of certain agencies dealing with a case increase when certain objects are present in the images (e.g. trees/bushes -> NPARKs, cigarette butts -> NEA). Combining these new data points, we are able to correctly direct cases to the right agency 85 per cent of the time,” said GovTech.
Now at the beta-launch stage
After making some tweaks based on feedback received from a completed trial with a small segment of the public, the OneService Chatbot has been “beta” launched and is available on WhatsApp and Telegram from July 2021.
Residents can start a conversation with the Chatbot by texting “Hi” to +65 9821 9004 (WhatsApp) or @OneServiceSG Bot (Telegram).
If you’re creatively attuned, you can also participate in the Chatbot design competition that will help determine the Chatbot’s avatar and “personality” for the official launch. More information on the competition can be found here.
Featured Image Credit: MSO / GovTech