AI Awesomeness: 2020 Update! Microsoft Cognitive Services Speaker Recognition API

A while back I showed how to use the Microsoft Speaker Recognition APIs in the simplest way I could think of; using a web page to record audio and call the various APIs to set up and test Speaker Verification and Speaker Identification.

Honestly, the hardest part of this by far was getting the audio recorded in the correct format for the APIs to accept! I hacked the wonderful recorderjs from Matt Diamond to set the correct bitrate, channels, etc, and eventually got there through trial and error (and squinting at the minified source code of the Microsoft demo page)!

In the run up to //Build this year, there have been a lot of changes in the Microsoft AI space.

One of these changes managed to break my existing Speaker Recognition API applications (it’s still in Preview, so don’t be surprised!) by moving Speaker Recognition under the Speech Service project, slightly changing the APIs and their endpoints, and adding new functionality (exciting!)

In this article I’ll show the same web page implementation, but use the updated 2020 Speaker Recognition APIs, and introduce the new Verification API that doesn’t rely on a predefined list of passphrases.

Continue reading

Customized WebPageTest Lighthouse Results using a Custom Test Agent

In my recent article Eco Worriers: Saving the Planet, One Unoptimized Website at a Time for the fantastic annual Perf Planet advent calendar, I mentioned how I created a Private WebPageTest setup to use my own custom test agents, which were configured to use an extra Lighthouse plugin (The Green Web Foundation’s "greenhouse").

In this article I’ll show how to create custom WebPageTest agents, and how to configure your Private WebPageTest instance to use these instead of the default test agents.

Continue reading

Automating WebPageTest using the nodejs webpagetest-api package

WebPageTest-api NodeJS

Hopefully you’ve already had a chance to play around with the amazing WebPageTest during your website performance testing adventure so far.

In case not, I have a few articles you might like to browse, to help you get up to speed using this fantastic, free, open source, website performance testing tool.

It has a website interface and also an API, which I went through in the previous article.

In this article I’ll show you how to use the incredible webpagetest-api nodejs package to make the orchestration and automation of your WebPageTest setup even easier!

Continue reading

AI Awesomeness Part Deux! Microsoft Cognitive Services Speaker Identification

The Speaker Recognition API: AI Awesomeness

In a recent article I introduced Microsoft Cognitive Services’ Speaker Verification service, using a recording of a person repeating one of a set of key phrases to verify that user by their voiceprint.

The second main feature of the Speaker Recognition API is Speaker Identification, which can compare a piece of audio to a selection of voiceprints and tell you who was talking! For example, both Barclays and HSBC banks have investigated using passive speaker identification during customer support calls to give an added layer of user identification while you’re chatting to customer support. Or you could prime your profiles against all the speakers in a conference, and have their name automatically appear on screen when they’re talking in a panel discussion.

In this article I’m going to introduce you to the Speaker Identification API from the Cognitive Services and go through an example of using it for fun and profit! Though mainly fun.

Continue reading

London Bot Framework Meetup Numero Four

On the 16th January I had the pleasure of hosting another London BotFramework meetup at the newly constructed event space in the Just Eat offices.

London BotFramework Meetup #4

They’ve joined three floors with a staircase, so attendees can have beers and pizza upstairs while the presenters sweat with the AV equipment downstairs!

There was a great turnout for this one, including the usual gang and a few new faces too.

Before I get started, in case you haven’t already seen it, you should totally subscribe to the weekly Artificially Intelligent newsletter that has the latest news in AI, Chatbots, and Speech and Image Recognition!
Go sign up for Artificially Intelligent!

Video

Just want to get stuck in? Here’s the video; first half is Jimmy, second half is Jessica.

Sessions

For this meetup we were fortunate enough to have the Engström MVP power team, Jessica and Jimmy, who were in town for NDC London and graced us with their presence.

1) Developing Cross Platform Bots: Jimmy Engström

Jimmy Engstrom - Cross Platform Bots
The first session included several fantastic live demos where Jimmy creates a simple chat bot and, with minimal development effort, gets it working on Alexa, Cortana, and Google Home!

(Rendering my own ingenious Alexa BotFramework hack from last year quite useless!)

During the day Jimmy Engström is a .NET developer and he does all the fun stuff during his spare time. He and his wife run a code intensive user group (Coding After Work) that focuses on helping participants with code and design problems, and a podcast with the same name. Jimmy can be found tweeting as @apeoholic

2) Conversational UX: Jessica Engström

Jessica Engstrom - Conversational UX
In the second half Jessica gave a great overview of creating a framework to ensure your bot – speech or text based – seems less, well, robotic!

Some great takeaways from this which can easily be applied to your next project.

Being a geek shows in all parts of Jessica Engström’s life, whether it be organizing hackathons, running a user group and a podcast with her husband, game nights (retro or VR/MR) with friends, just catching the latest superhero movie or speaking internationally at conferences.

Her favorite topics is UX/UI and Mixed reality and other futuristic tech. She’s a Windows Development MVP. Together with her husband she runs a company called “AZM dev” which is focused on HoloLens and Windows development.

Follow her exploits over on twitter as @grytlappen

Summary

The updated event space at Just Eat is great and gives better visibility of the sessions thanks to stadium seating at the back.

The sessions were insightful and overall I think this went well.

Here’s to the next one and don’t forget to join up (and actually attend when you RSVP… ahem…)

Image Placeholders: Do it right or don’t do it at all. Please.

Hello. I’m a grumpy old web dev. I’m still wasting valuable memory on things like the deprecated img element’s lowsrc attribute (bring it back!), the hacks needed to get a website looking acceptable in both Firefox 2.5 and IE5.5 and IE on Mac, and what “cards” and “decks” meant in WAP terminology.

Having this – possibly pointless – information to hand means I am constantly getting frustrated at supposed “breakthrough” approaches to web development and optimisation which seem to be adding complexity for the sake of it, sometimes apparently ignoring existing tech.

What’s more annoying is when a good approach to something is implemented so badly that it reflects poorly on the original concept. I’ve previously written about how abusing something clever like React results in an awful user experience.

Don’t get me wrong, I absolutely love new tech, new approaches, new thinking, new opinions. I’m just sometimes grumpy about it because these new things don’t suit my personal preferences. Hence this article! Wahey!

Continue reading

London Bot Framework Meetup the Third

Welcome to the Third London BotFramework Meetup! Here's the line up

On Wednesday 22nd November 2017 I had the pleasure of running the third London Bot Framework meetup at the lovely Just Eat office in central London. The offices have been recently upgraded and the new meetup space has a huge 9 screen display a multiple mic speaker system, including a fantastic CatchBox throwable mic for ensuring everyone hears the audience questions

It has been a year since the previous one (whoops) but it was great to see some familiar faces return in the attendees. I had forgotten how much fun it is to emcee an event like this! Maybe next time I’ll be sure to just emcee and not also commit presenting a session too.

Continue reading

London Buses use TLS1.2!

My lovely little London Bus “app” (possibly the most basic web page you can imagine + connection to the Transport for London API) broke recently, and given the tube strike today I felt I the urge to fix it.

The error occurred when the web page called the proxy (to avoid Cross Origin Request errors there needs to be a server-side api proxy on the same domain as the html page) which calls the TFL API. The proxy is THE WORLD’S MOST BASIC PROXY

It’s just “File -> Add -> New Item -> Web Service (ASMX)”, with this single method:

[WebMethod]
public string getMeTheDataFrom(string here)
{
    using (var response = new System.Net.WebClient())
    {
        return response.DownloadString(here);
    }
}

Continue reading

Transcribing messages in BotFramework

Now that you’ve deployed your well structured, exception handling, language understanding chatbot, how do you know just what people are saying to it?

Sure, you could copy and paste some logging code all over the place, but there must be a cleaner way.

In this article I’ll show you a few simple tricks to be able to save each message going to and from your botframework chatbot.

IDialog

Let’s start off by saving messages going to any dialog that implements IDialog<T>.

In order to implement IDialog<T> you only need to implement the StartAsync method; however, this isn’t much use on its own, so let’s get the dialog into a conversation loop by adding in a MessageReceivedAsync method and calling that from StartAsync and from itself:

Continue reading

Rate-Limiting, Powershell, Pester, and the ZenDesk API

Have you ever had to utterly hammer an API via a little Powershell script, only to find you’re getting rate limited, and lose all that previously downloaded data before you could persist it somewhere?

I have. I’ve recently put together a script to query a customer support ticketing system’s API, get a list of all tickets within a given time period, then query again to get to get the full content for each ticket.

All of this data is being added to a custom Powershell object (as opposed to churning out to a file as I go) since I convert it all to Json right at the end.

I’d rather not get half way through a few thousand calls and then have the process fail due to being throttled, so I’ve chosen to create a little function that will check for – in my case – an HTTP 429 response (“Too Many Requests”), get the value of the “Retry-After” header, then wait that many seconds before trying again.

This particular implementation is all quite specific to the ZenDesk API, but could easily be adapted to other APIs which rate limit/throttle and return the appropriate headers.

Continue reading