Uncategorized

Fun with Theresa May’s first Speech as PM and the Google Cloud Speech and Natural Language APIs

It’s not so often you get brand new PM Theresa May and fun in the same sentence, but when I learnt yesterday Google was launching their Cloud Speech and Natural Language APIs, I knew right away what would be a good proof of concept: Ms May‘s inaugural speech.

If you are wondering what Cloud Speech API and Natural Language APIs are, they are basically Machine Learning models trained by Google and offered as a service, so you can just send your audio files to Speech API and get back a transcript. And once you have the transcript, you can use the Natural Language API to get a list of names, organisations, and locations mentioned in the text. Not only that, you can also run sentiment analysis on the text and even get back a lot of syntax/semantics information in case you want to dig deeper.

Got your attention? Cool. Just let me show you what I did. I took the video from https://www.youtube.com/watch?v=FDyZ8trge2E and extracted the audio. In order to use Cloud Speech API, your audio should have a particular format, so I converted it using the following command line


sox Theresa_May_First_speech_as_Prime_Minister_BBC_News.flac --rate 16k --bits 16 --channels 1 theresa_may_mp_extract.flac trim 01:30 =02:12

Note I am extracting just my 42 favourite seconds of the audio.

I am uploading my file to Google Cloud Storage and, having set up my cloud account previously, I can already run this:


curl -s -k -H "Content-Type: application/json"  -H "Authorization: Bearer ya29.Ci8nAzIo94pFL-CPsdRgLH1qkIM4Zo_Iq-getfRDJJ41ZVvpK9aFODnwaXPuzYXmzw" https://speech.googleapis.com/v1beta1/speech:syncrecognize  -d @audio_may.json

I am getting back this beautiful JSON


{
"results": [
{
"alternatives": [
{
"transcript": "that means fighting against the burning injustice but if you're born        poor        you will die on average 9 years earlier than others if you're black you're treated more harshly by the criminal justice system then if your weight is there a white working class boy you're less likely than anybody else in Britain to go to university is right Estate school you're less likely to reach the top professions then if your educated privately if you're a woman you will earn less than a man if you suffer from mental health problem there's not enough help to hand if you're young you'll find it harder than ever before to own your own home",
"confidence": 0.935612
}
]
}
]
}

Not bad at all. Except for punctuation marks and a few minor problems (then instead of than) everything looks hunky dory. Great diction Theresa!

Let’s send this text to the Cloud Natural Language API and see what it says. To do so, I need to prepare a simple JSON with the content and the type of processing I want to do:


{
"document":{
"type":"PLAIN_TEXT",
"content":"that means fighting against the burning injustice but if you're born poor you will die on average 9 years earlier than others if you're black you're treated more harshly by the criminal justice system then if your weight is there a white working class boy you're less likely than anybody else in Britain to go to university is right Estate school you're less likely to reach the top professions then if your educated privately if you're a woman you will earn less than a man if you suffer from mental health problem there's not enough help to hand if you're young you'll find it harder than ever before to own your own home"
},
"features": {
"extractDocumentSentiment": true,
"extractEntities": true
}

}

I am asking only for Entities and Sentiments. I don’t care about the syntax of this particular text.

And I run this command


curl -s -k -H "Content-Type: application/json"  -H "Authorization: Bearer ya29.Ci8nA8vXgbR9VQ9NtXbhpj3Nz1oLwzShqn0gt0Ts2RnrCR-UDHg9W-mynn_WERa_9Q" https://language.googleapis.com/v1beta1/documents:annotateText  -d @nlp_may.json

As a result I get a JSON back


{
"sentences": [],
"tokens": [],
"entities": [
{
"name": "Britain",
"type": "LOCATION",
"metadata": {
"wikipedia_url": "http://en.wikipedia.org/wiki/United_Kingdom"
},
"salience": 0.010285536,
"mentions": [
{
"text": {
"content": "Britain",
"beginOffset": -1
}
}
]
}
],
"documentSentiment": {
"polarity": -1,
"magnitude": 0.7
},
"language": "en"
}

So, it seems Ms May mentioned Britain, and the sentiment of that extract was very negative, as we can see with the -1. Also, the strength of the sentiment is quite bland, at only 0.7. Dear Theresa, why so sad? Of course I chose an isolated extract, but if I take the full text as seen here things will surely change.

I change my JSON request to send the full text, and what I am getting now is much more interesting. The list of Entities is much more complete, including now The European Union, Northern Ireland, Scotland, Wales, Great Britain, Her Majesty the Queen (Hi Elizabeth!), David Cameron, The Conservative and Unionist Party, and Buckingham Palace. And each of those entities is featuring a link to the corresponding Wikipedia page. I kid you not. Just Wow!

And what about sentiment? Well, as expected when you take the full document the outcome is more positive (0.1 in a scale from -1 to 1) and the strength is clearly higher, at 9.7 magnitude.

I took a video, transcribed it, automatically extracted entities of different types with links to their corresponding pages and could guess the sentiment and strength of the speech. I never suspected Brexit could be this fun.

I can only start thinking of a million interesting applications that would benefit from something like this.

And don’t get me started about the Cloud Vision API… but that might be for another occasion.

** you have all the JSON requests and responses available at https://gist.github.com/javier/c3e0075f8077be87bb157471847211e2

And remember, if you need professional help with anything Google Cloud Platform or big data related, teowaki is always happy to help.

Javier Ramírez. Co-founder of Teowaki. Google Developer Expert and Google Authorized Trainer for the Google Cloud Platform.
Standard
Announcements

What kind of ant are you?

teowaki is —and will always be— free for public contents. It is one of the ways we have to contribute back to the open source community and to all the awesome events the different communities organise.

As an individual user, you can also enjoy free of charge your own personal area where you post private links and practices for your eyes only.

After our first months of public beta, I am excited to announce teowaki’s price plans, for developers who need to share contents privately with others.

price_plans

Are you a soldier ant? Do you work from the trenches to make your startup or small team successful? Teams of up to 4 people can enjoy  teowaki for as low as £12* per month.

Are you a queen ant? Do you have a team you feed and take care of? Teams from 5 to 30 members pay £9** per month per developer. Teams of over 30 members pay a flat rate of £400***.

Are you a scout ant? Do you like the freedom of working on your own while being able to share privately with other individuals and organisations? Individual users pay £9** per month.

If you pay yearly, you will pay only for 10 months every year in all the plans.

All our price plans come with a 30 days free trial. You don’t need to enter your credit card in advance, because we hate sites that ask for your card before letting you judge if they are good enough for you. And of course you can upgrade, downgrade or cancel your plan without any restrictions.

It took us a while to figure out the best plans for our users, and we think our proposal is a fair one. But if you would like to have a personalised plan for you or your organisation, contact us at hello@teowaki.com and let us know what is your idea. We will try our best to accommodate to your needs.


* 15€ or $20, depending on your country
** 10€ or $15, depending on your country
*** 500€ or $700, depending on your country

Standard
Announcements

Who said RSS is dead?

Well, it wasn’t me. RSS is a great way of getting updates when you have a feed of news. There are RSS readers virtually for every device and programming language. Don’t you believe me? Then take a look at this developer working on a RSS aggregator in COBOL.

When we thought of which mechanism we should use for users to subscribe to their notifications, it’s no surprise RSS was our first choice. So let me introduce you without further ado our brand new RSS feed service for your notifications.

atom_feedJust log in into teowaki —if you were already logged in, you might have to reload the page— and you should see the notification feed links right below the menu, as you can see in the picture.

Pick your favorite format, Atom or RSS, and add it to your favourite reader. I have installed a generic RSS reader on my phone, so from now on I will never miss any updates from my developer friends, even when I am not logged in into teowaki.

If you are experiencing any difficulties using your notifications feed, get in contact via hello@teowaki.com and we’ll try our best to help you out.

RSS is dead, long live RSS!

Standard
Announcements

Good bye noise! Receive only relevant messages

This past weekend we were at the Fosdem conference, in Brussels. It was a great event, and of course there was a lot of communication between the attendees, as you can see in the sample tweets below.

fosdem-1 fosdem-noise1 noise3

ada_shout

The problem with this kind of tweets is that most of the followers of the authors were not at Fosdem, or even in Belgium. So for them, those messages were useless and just noise. And we hate noise.

We just added geolocated shouts to teowaki, so now you can send a message to one or all of your teams, but only to people who are around a physical location. Let me show you an example. Ada feels like downing a beer today, so she sends a shout inviting her friends around her location to meet later.

Diego and Javier share teams with Ada. Ada is in London, as is Javier. But Diego is in Madrid today. Javier will receive Ada’s shout as a notification, and will also see it on his timeline.

javi-ada

Diego won’t be notified about this, as Ada decided only people within 5 kilometers from Old Street, London, should get her shout.

diec_ada_notifications

But even if Diego won’t get any useless noise in his timeline, he can still know about this shout. If he navigates to the team’s page, or if he filter the shouts for a given team,  there it is, the message from Ada. He can be updated on what his teammates are up to, but he won’t get notified about irrelevant messages.

diec_ada_teowaki_team

I hope you will enjoy this little new feature as much as we do. As usual, feel free to contact us at hello@teowaki.com if you have any feedback. Happy shouting!

Standard
Community

teowaki’s 300

Last week we saw the 300th user signing up for teowaki. We are still a bit far from world domination but we couldn’t be happier. And we want to thank every one of you for trusting us.

But we want more! We need you to spread the word, create organisations and teams and invite your friends to join teowaki.

Do you regularly attend a community event in your town? Create a team for it and use teowaki to keep sharing information in between meetings. Are you teaching other people how to be a better developer? Use teowaki to keep the group in touch. Changing jobs? You don’t need to stop sharing with your colleagues; just add an alumni group for your company and tell them to join and keep you up to date on what’s hot and what’s not. 

There are endless situations when a tool for sharing links, short messages, best practices and mistakes comes handy.  If there is anything you are missing at teowaki that keeps you from using it more, please let us know at hello@teowaki.com. We want to make the best service possible for software developers to interact with each other and we won’t stop until we get it.

This is what 300* happy users look like:

users_montage_january_2014

* There are actually 302 users up there

Standard
Announcements, Uncategorized

Teowaki puts you on the map

Time flies when you are having fun. It’s been already one month since we announced our public launch and we have been busy adding a lot of small things to make teowaki even better for you.

After our Xmas break, we started the year by improving our search engine and adding individual pages for links, shouts and jesters. Then we added the “personas” feature to your profile, so you can let everybody know your different online identities. In the meantime, we got the opportunity to speak at local communities of developers in Zaragoza and London, sharing with them the technologies we are using at teowaki.

And today we are proud to announce our first geolocation features. You can now add your location to your profile, so other users can see where you are based. This is the cornerstone for the rest of our geospatial functionalities. In a few weeks you will be able to filter your search results by proximity —search for people or teams close to you— or to send shouts to users around one area.

How does it work?

When you visit your profile settings, your browser will ask for permission to use your computer’s location. Unless you allow your browser to pass your information to teowaki, we won’t be able to guess your current city and country automatically.

browser_permissions

A note on your privacy: We know it is technically possible to try and guess your current location using other techniques, like checking your IP against a database, but we think you as a user should have the last word in saying if you want us to geolocate you or not.  We won’t try to guess any geospatial information about you unless you allow us specifically to do so.*

Once you allow us to guess your location, teowaki will show your position on a map. In the rare cases where we can’t automatically locate you, or if our location is wrong, you can enter your city and country in the location text box and we will map it.

settings_map_and_flag

Even if you want us to keep your location, so we can use it for proximity searches, you can still uncheck the option to share your location publicly. In that case, we will store your location in our servers and we will use it internally, but we will never disclose your location to other uses. You can switch this check on and off as many times as you want. You are in total control of what and when it is shared about you.

Don’t forget to use the “Update” button to save your settings.

What does it look like?

Once you enter your location and give your permission, the name of your base location and a small map will be displayed on your profile.

user_public_profile

Feedback

Is there any way we can make this better for you? let us know at hello@teowaki.com

* our analytics backend uses techniques for geolocating every request we get to the system by analyzing the IP address. This is done at as a separate process and we don’t associate this information to your user, just anonymously to every request that hits our servers for statistical purposes.

Standard
Announcements

teowaki is now open

Back in November, we invited 50 of our developer friends to try the alpha version of teowaki. We have learned a lot from them (thank you all!), we have improved the tool in the last few weeks, and we are ready now for the big opening.

Our mission is to make you happier and to help you stay in contact with your friends and colleagues no matter where you are. Please start using teowaki, invite your developer friends to your teams, and let us know how we can make teowaki better for you.

You might be wondering what kind of things you can share with other developers at teowaki, and the answer is pretty much anything that makes sense for you. As an example, we at teowaki are using the site for sharing interesting links about  software developmenttools we likedistributed systemsnews, or  just for fun. We also share our  best practices  and  code snippets, and even the methodologies we use. When we publish something that doesn’t need to last for long, we just set an expiration date and forget about it.

We have also created a team for getting feedback from our users and we use private teams for talking about development issues, telling jokes, publishing mistakes we have made or keeping track of interesting events.

At the moment teowaki allows you to share links, best practices, shouts (short messages), jesters (mistakes) and, of course, your profile. You can share information privately or publicly, with just one team or with as many as you like. You can search for public contents from other users and fork them into your teams, so you don’t need to start writing from scratch.

You can join as many teams as you want, so you can communicate at the same time with your colleagues, the customers you are freelancing for, your friends from Uni, the members of your local communities, or the delegates to that conference you attended last summer. Because we don’t think it’s fair you have to stop sharing valuable information with interesting developers only because you quit a job, or you live in a different city or you can’t find the time for meeting regularly.

User profiles are another interesting feature. No matter if you change teams or companies in the future, your URL will always stay with you. You can go by different nicknames when joining different teams and if you want to keep a particular membership secret, you only need to go to your settings and mark that team as hidden. You know, sometimes your boss doesn’t need  to know you are freelancing for other people.

If you are an event organizer, teowaki gives you a free backchannel for you to use before, during and after the events. Let event participants curate link lists, have conversations, and extend the reach of your event. Have separate teams for volunteers, organizers, speakers and delegates if you want. Provide a single URL where everybody can keep up to date with the news, so you can  enjoy more free time for making your event awesome.

We are just providing the channel, but we are keen to see how you all are going to use it and we are looking forward to learning from you and making a site where developers feel at home.

teowaki is now open. Welcome aboard.

Standard