Microsoft is getting into the SparkNotes game with its latest project. In an April 23 blog post, Microsoft explained that it is using AI to help decode 19 plays from William Shakespeare in an attempt “to shine a new light on some of the greatest pieces of literature, as well as make them more accessible to people who worry the plays are too complex to easily understand.”
Phil Harvey, a cloud solution architect at Microsoft, turned to Microsoft’s Text Analytics API to help him identify sentiment and topics in text and pick out key phrases and entities.
Using the data collected, Harvey created Power BI graphs that show how negative or positive the language used by various characters was. “People can see entire plotlines just by looking at my graphs on language sentiment,” he explained. “Because visual examples are much easier to absorb, it makes Shakespeare and his plays more accessible. Reading language from the 16th and 17th centuries can be challenging, so this is a quick way of showing them what Shakespeare is trying to do.”
In order to develop the graphs, Harvey had to locate a text file of the plays and then prep the data for Microsoft’s AI algorithms. To do so, he removed all stage directions, keeping the act and scene numbers, the characters’ names, and their dialogue. Once prepped, he uploaded it to Microsoft’s Cognitive Services API.
“After scanning the Shakespeare plays, Microsoft’s NLP tool gave the lines of dialogue a score between zero and one – scores close to one indicated a positive sentiment, and scores close to zero indicated a negative sentiment,” Microsoft explained.
However, Harvey did uncover some limitations with the AI and places where even it was confused by the Bard’s writing.
“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,” Microsoft said.
“The algorithm couldn’t work out whether Hamlet’s mad ravings were real or imagined, whether characters were being deceptive or telling the truth. That meant that the AI labeled events as positive when they were negative, and vice-versa. The AI believed The Comedy of Errors was a tragedy because of the physical, slapstick moments in the play.”
In terms of more practical applications of AI, Harvey said that the work could be extended to companies or even governments.
“Take the example of customers phoning their energy company,” he said. “[Y]ou could see if conversations that happen after 5 p.m. are more negative than those that happen at 9 a.m., and deploy staff accordingly. You could also see if a call center worker turns conversations negative, even if they start out positive, and work with that person to ensure that doesn’t happen in the future.”
Next up for Harvey? Decoding Charles Dickens.