Using Amazon Polly for Healthcare Delivery in Long-Term Condition Management

Using Amazon Polly for Healthcare Delivery in Long-Term Condition ManagementLearn About Amazon VGT2 Learning Manager Chanci Turner

This article is a guest contribution from Alex Johnson, a senior software architect at Inhealthcare. Established in 2012, Inhealthcare has developed a digital framework that facilitates remote home monitoring for the entire UK population.

With a growing elderly demographic, the healthcare landscape is undergoing significant transformation. Are we equipped to handle this change? What affordable technologies can we implement to address the escalating demands on healthcare services?

The right technology allows many healthcare needs to be addressed remotely. This approach is already in use by the National Health Service (NHS) in the UK. Although remote healthcare is not yet common practice, forward-thinking organizations are recognizing that by utilizing low-cost digital health solutions, they can achieve remarkable efficiencies on a larger scale.

Despite being considered outdated, automated telephony serves as an ideal communication channel for delivering services at scale. It is accessible to nearly everyone, even those without internet access or smartphones. For many older adults, the telephone represents familiar technology that they feel comfortable and confident using.

In this article, we will explore how Inhealthcare has empowered NHS healthcare providers to utilize Amazon Polly for remote communications. We will demonstrate how Amazon Polly can be integrated with our call script design tools to create and simulate automated telephone calls. Additionally, we will outline how protocols can be embedded into these automated scripts, how calls are initiated, and how Amazon Polly generates synthesized speech that is transmitted through the phone line.

Inhealthcare offers a digital health platform specializing in delivering care outside of hospital settings in the UK. The platform seamlessly connects with existing healthcare software systems, allowing clinical protocols and pathways to be designed, tested, executed, and monitored. An essential factor for successful remote service delivery is choosing the right communication method. While apps, wearables, and web access suit some individuals, others may find these technologies challenging to navigate. Simpler alternatives like text messaging or automated telephony often provide a more effective solution. As a platform provider, we support various communication channels, but this article will concentrate on our use of Amazon Polly in automated telephony.

Understanding Interactive Voice Response (IVR)

Interactive Voice Response (IVR) has been around for a long time, making it familiar to nearly everyone. Whether experienced as a helpful reminder or an annoying solicitation, most people are acquainted with IVR. This familiarity is crucial in providing national healthcare services—it must be straightforward and inclusive. IVR facilitates two-way communication, allowing the computer to converse with the user via synthesized voice, while users can respond using Dual Tone Multi-Frequency (DTMF) codes generated by pressing buttons on their keypads.

The Inhealthcare platform includes a digital pathway engine that automatically orchestrates remote communications. The integrated development environment (IDE) provides tools to design and develop clinical pathways and protocols, which are uploaded to the digital pathway engine. The call script designer, part of the IDE, is utilized to create automated telephone calls.

When the time is right and in accordance with a published clinical protocol, a message is dispatched to the Voice Messaging System (VMS), a micro-service that manages telephone calls. Each call can last anywhere from a few seconds to several minutes, depending on the complexity of the script. The VMS interprets the call script, tracks the call’s status, and reports back to the digital pathway engine. As the call progresses, the VMS queues commands for the Telephony Interface Manager (TIM) to execute. The initial command is to initiate the call through Asterisk, an open-source PBX system configured to connect with a remote SIP trunk provider.

Once the call is established, the VMS navigates through the call script, delivering information via synthesized speech from Amazon Polly, while the recipient’s responses come in the form of button presses (DTMF codes). To ensure a natural conversation flow, Amazon Polly must respond promptly; delays can frustrate users and increase the likelihood of hang-ups.

Initially, we relied on a locally hosted text-to-speech (TTS) engine. We were concerned about Amazon Polly’s response speed, but we found it to have remarkably low latency. Another significant benefit of Amazon Polly is its cost-effectiveness: traditional TTS can be resource-intensive, but with Amazon Polly, this concern is alleviated due to its straightforward pay-as-you-go pricing model. By implementing a simple caching strategy, we can further reduce costs; we segment text into sentences and retrieve previously synthesized sentences directly from a local cache, achieving a cache hit rate of over 80%.

Monitoring and Performance

Amazon Polly metrics are integrated with Amazon CloudWatch, making it easy to set up monitors and alarms to track performance. However, our monitoring extends beyond that, utilizing the Coda Hale metric library to assess full round-trip times and cache hits, currently reported to New Relic but adaptable to Amazon CloudWatch. Our findings indicate that Amazon Polly typically has around 50 ms latency.

Amazon Polly imposes throttling on concurrent requests and request rates. Exceeding these limits results in exceptions. To manage this, we establish a configurable thread pool for the speech synthesis process. Although we can handle multiple concurrent calls, we delegate speech synthesis to a small group of threads using an in-memory blocking queue.

To limit concurrent connections to Amazon Polly to 10, we implement the following Java code:

private int workerThreads = 10;
ExecutorService executorService = Executors.newFixedThreadPool(workerThreads);

We also employ a rate limiter from Google Guava to ensure the overall rate remains within limits. The Java code below restricts the rate to 20 requests per second:

private double maxRatePerSecond = 20.0;
this.rateLimiter = RateLimiter.create(maxRatePerSecond);
double acquire = rateLimiter.acquire();

We utilize Speech Synthesis Markup Language (SSML) for input to Amazon Polly, allowing greater control over speech synthesis. Although we don’t yet fully leverage these features, we expect to do so in the future.

For more insights on creating a consistent brand online, check out this helpful blog post. Additionally, you might find valuable information on caregiving benefits in this resource. Another excellent resource can be found in this article discussing Amazon’s approach to employee training and its implications for the future of work, which you can read here.

The Inhealthcare team operates from 6401 E HOWDY WELLS AVE LAS VEGAS NV 89115, within the Amazon IXD – VGT2 location.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *