Wednesday, October 17, 2018

Can a quant help make a better poet?

I have been intrigued by the applications of Artificial Intelligence (AI). The theory goes that you can program a machine to do things that humans are doing today. I buy the argument about machines replacing humans in routine, mundane tasks. But, can a machine take over the creativity process? Can a machine exhibit emotions like humans do? Can it write a poem or a story? In my own little way, I set out to find out...
Machines taking over humans' tasks - this is not something new. As we look around us, we see lots of examples of this. Afterall, the Automated Teller Machine - or as we better know it, the "ATM" - is a machine that replaced a human, the bank teller.

But with the growing attention and hype about Artificial Intelligence and Machine Learning, people are talking about two diametrically opposite scenarios: one in which machines help propel mankind into an amazing future, and the other where machines rule the world, to the point where humans become subservient to them.

While I believe that AI has the ability to make our lives much easier by taking over the performance of mundane tasks, there is still a question in the back of my head; can AI replace the thing that makes us human - emotions? Can it grow the ability to feel emotion and express it, through poems or stories?

I have been working on a book, a novella of sorts for quite some time now. It is titled "Catharsis" and tells the story of a girl who goes through some challenges in life. When I shared the first draft of the book with my teachers and my family for inputs, some of them said that it was "dark" and "not inspiring". While I agreed that it was a dark story - it was meant to be - I also knew that there was a good message behind it, one that was inspiring. Perhaps I didn't make it clear enough though, and I had to know for sure - had my book lost all the optimistic connotations I had tried to incorporate into it?

To get an independent view, I turned to a computer. I had just taken a few data analytics and machine learning classes from Berkeley and Stanford, and started researching a topic called "Sentiment Analysis", whereby you could have a piece of software analyze the sentiment of the written word.

After nearly a month of playing around with various algorithms and public domain pieces of software, I was able to get a lexicon called "DepecheMood" to analyze my book. I had to download the software, and feed it each chapter of my book and have it tell me the sentiment of the chapter. DepecheMood is the world's largest crowd-sourced sentiment analysis program whereby the community at large trains the software to understand and classify sentiment of a given piece of text into eight categories, viz: Afraid, Angry, Sad, Annoyed, Don't Care, Amused, Inspired and Happy.

I wrote small programs that summarized the sentiment of each chapter as an average of the sentiments of each line in the chapter.

The result was, as shown in the picture below, eye-opening for me.

Figure 1: Sentiment Analysis of the final draft of my book

From the picture above, it was clear to me that while my story did have a mix of emotions, there was nothing really exciting about the "mood" of the story. It did seem a bit monotonous, and arguably didn't have enough of the positive sentiments like Happiness and Inspiration. It did seem more skewed towards the negative sentiments.

The machine had answered my question, without a bias.

I set out to rewrite my book. It took me nearly five months to come up with the revised version. I resisted the temptation to feed each chapter in, till I was done with the writing. However, when I finished writing, I ran the analysis again, and here is what the summary result looked like.

Figure 2: Sentiment Analysis of the final version of my book

This time, the story had more ups and downs, perhaps more twists and turns in emotions. One chapter in particular (chapter 3) had the protagonist really afraid, but also inspired to do something about the problem she was facing. As the story progressed, you could see the protagonist being happy and overcoming her fears. I will not spoil the story further, but you can see that the final version looks completely different than the original version I started out with.

So, did I have the machine write me a story? Did it replace me as a writer? No. I had the machine tell me what was wrong with my story and helped me write a better story, with the message I had set out to send.

The future of machines making humans better, is a future that I see with Artificial Intelligence and robots.
Read more ...

Monday, October 1, 2018

Love what you do, do what you love

I’ve always envied people who were good at something they loved. People who dedicated their entire lives to a sport, not because anyone was pressuring them to, but because they genuinely loved it... I’ve always envied people who were good at something they loved. People who dedicated their entire lives to a sport, not because anyone was pressuring them to, but because they genuinely loved it. People who could sit for hours in front of the same canvas, perfecting details that only the trained eye could perceive, because they felt the most at ease with a paintbrush in their hand. People who looked forward to a sociology or physics exam, because it was their equivalent of a match to an athlete or an exhibition to an artist. It was their opportunity to showcase their talent. To do something that they loved and be given due credit for it, to be recognized.

I’ve tried my hand at a number of things, to find ‘the one’, but in this case in terms of a calling rather than a person. I learned early on that art wasn’t really my thing. I still like to paint now and then, just for fun, but it’s never something to be impressed by. That’s okay though, it was always just for relaxation. Classical dancing, again, was something I did not enjoy much. That’s not to say that I don’t still let loose when an especially good song comes on at a party. Athletics were .... a no. Serious organized sports were never my thing. Unfortunately I have measly upper or lower body strength, nor any interest in becoming an Olympian. And I’m 100% okay with that. The only thing that has ever come close to being ‘the one’ for me would be writing. But there’s still a part of me that wonders if there’s anything truly special about my writing, or if it’s just ...

Regardless, it’s something that I love doing. And I’ve learned that only devoting time to things you’re good at but may not necessarily love is a sad way to live life. So I paint, and I dance, and I swim - whenever I get the chance. And I feel great afterwards. Because even though these aren’t things that I’m good at - and probably never will be - they make me happy. And isn’t that all any of us are looking for?
Read more ...