Spoiler alert: At the end of Romeo and Juliet, they some die.
OK, as spoilers go, it’s not big. Most people have read the play, watched one of the celebrated films or sat through infinite school lessons devoted to William Shakespeare and his work. They know it doesn’t end well for Verona’s most celebrated couple.
In fact, the challenge is finding thing no one knows about the world-celebrated, 300-year-old play. That’s where artificial intelligence can help.
Phil Harvey, a Cloud Solution designer at Microsoft in the UK, used the company’s Text Analytics API on 19 of The Bard’s plays. The API, which is available to anyone as part of Microsoft’s Azure psychological feature employment, can be used to identify sentiment and topics in text, as well as pick out key phrases and entities. This API is one of several Natural Language process (NLP) tools available on Azure.
By creating a series of colourful, Power BI graphs (below) showing how negative (red) or positive (green) the language used by The Bard’s characters was, he hoped to shine a new light on some of the sterling pieces of literature, as well as make them more accessible to people who worry the plays are too complex to easily understand.
Harvey aforesaid: “People can see entire plotlines just by looking at my graphs on language sentiment. Because visual examples are much easier to absorb, it makes Shakespeare and his plays more accessible. Reading language from the sixteenth and seventeenth centuries can be challenging, so this is a quick way of showing them what Shakespeare is trying to do.
“It’s a great example of information giving us new property to know and new shipway of knowing it; it’s a fundamental change to how we process the world around us. We can now pick up Shakespeare, turn it into a information set and process it with algorithmic rules in a new way to learn thing I didn’t know before.”
What Harvey’s graphs reveal is that Romeo struggles with more extreme feelings than Juliet. Love has a much lesser effect on him challenging stereotypes of the time that women – the fairer sex – were more prone to the highs and lows of relationships.
“It’s absorbing to see that the male lead is the one with more extreme feelings,” Harvey added. “The longest lines, some positive and negative, are expressed by him. Juliet is steadier; she is positive and negative but not extreme in what she says. Romeo is a fellow of more extreme feeling, he’s bouncing around all over the place.
“Macbeth is besides absorbing because there are these two peaks of feeling, and Shakespeare uses the wives at these points to turn the story. I besides looked at Helena and Hermia in A summer solstice Night’s Dream, because they have a crossed-over love story. They are some positive at the start but then they find out thing and it gets negative towards the end.”
His Shakespeare graphs are the final step in a long process. After downloading a text file of The Bard’s plays from the net, Harvey had to process the information to prepare it for Microsoft’s AI algorithmic rules. He removed all the stage directions, keeping the act and scene numbers, the characters’ name calling and what they aforesaid. He then uploaded the text to Microsoft psychological feature employment API, a set of tools that can be used in apps, websites and bots to see, hear, speak, understand and interpret users through natural methods of communication.
The Text Analytics API is pre-trained with an extensive body of text with sentiment associations. The model uses a combination of techniques during text analysis, including text process, part-of-speech analysis, word placement and word associations.
After scanning the Shakespeare plays, Microsoft’s NLP tool gave the lines of dialogue a score between zero and one – tons close to one indicated a positive sentiment, and tons close to zero indicated a negative sentiment.
However, before you start imagining a world in which only robots read books before telling world the gist of what happened, Harvey discovered some unexpected challenges with his test.
While the AI system worked well for Shakespeare plays that contained straightforward plots and dialogue, it struggled to determine if more nuanced speech was positive or negative. The algorithmic rule couldn’t work out whether Hamlet’s mad ravings were real or fanciful, whether characters were being deceptive or telling the truth. That meant that the AI labeled events as positive when they negative, and vice-versa. The AI believed The Comedy of Errors was a tragedy because of the physical, slapstick moments in the play.
Harvey accomplished that the environment of the plays that dealt with what truly makes us unique as world – jesting, elation, lying, double meanings, blind, irony – could only be detected and taken by human readers. His project required AI working aboard world to truly understand and fully appreciate Shakespeare.
Harvey insists that his experiments with Shakespeare’s plays are just a starting point but that the same combination of AI and world can eventually be extended to companies and their staff, too.
“Take the example of customers phoning their energy company,” he aforesaid. “With Microsoft’s NLP tools, you could see if conversations that happen after 5pm are more negative than those that happen at 9am, and deploy staff consequently . You could besides see if a call centre worker turns conversations negative, even if they start out positive, and work with that person to ensure that doesn’t happen in the future.
“It can help companies engage with information in a different way and assist them with everyday tasks.”
Harvey besides aforesaid journalists could use the tool to see how readers are responding to their articles, or social media experts would get an idea of how consumers viewed their brand.
For now, Harvey is concentrating on the literary study and is turning his attention to Charles Dickens, if he can persuade the V&A in London to let him study some of their manuscripts.
“In the V&A manuscripts, you can see where Dickens has crossed out words. I would love to train a custom vision model on that to get a page by page view of his changes. I could then look at a published copy of the text and see which environment of the book he worked on most; possibly that part went well but he had trouble with this bit. Dickens’s work was serialised in newspapers, so we mightiness be able to deduce whether he was receiving feedback from editors that we didn’t know about. I think that’s amazing.”