Sentimental AI

Dec 27, 2018 by Prateek

It is fun to watch Artificial Intelligence fail. Their logical innocence (stupidity?) can be hilarious. One of my first encounters with AI was with ELIZA — the 1966 NLP program — using the doctor package on emacs. I would spend hours making it say stupid things, and while we’ve come a long way with NLP since Eliza, computers still haven’t lost their innocence — just ask Siri if they know Eliza.

The wink-sentiment package is no exception to this. Built on top of our tokenizer and AFINN it is not only able to detect sentiment but is also able to handle negation:

In the examples above gray is a neutral sentiment, blue and its deeper shades are for negative sentiment, and pink and it's brighter shades are used to show positive sentiment.

While it can handle negation and two word phrases it is no match for sarcasm, unless of course you use the right emoji: 😝

But human sentiments aren’t limited to tokenized words or emojis, they have layers of meaning. Testing the package with songs and poetry really reveals the depth of the problem we’re trying to solve for. It is a tall order for any sentiment analysis technique.

Here are a few lines from the poem Figures in a Landscape by Doppler by Ranjit Hoskote. Notice how it only catches the positive sentiment at the end:

Next we have the song All Blues written by Oscar Brown. It initially captures the two meanings of "blue", and finally ends at an appropriate deep blue:

Seeing AI fumble, and sometimes even fail, is the how we learn more about it. It helps us decide the direction of our work and look at new ways of solving these problems. Stay tuned for our next experiment where we compare different approaches to sentiment analysis.

The GIFs above were made using our testing tool Sentimental, do give it a try.


NLP in Agriculture

Nov 18, 2018 by Sanjaya

Farmer query data

Several years ago, even before we had the idea of making Wink, our nascent NLP code was put to the test — we got a chance to analyze the queries of Indian farmers. These queries were in Hinglish (a mix of Hindi and English) and were in subjects ranging from sowing, harvesting, to plant protection. Our goal was to find distribution of various crops, discover trends and pattern of diseases in various crops across geographies with time.

In June this year we got a chance to relive those memorable moments when we spotted a large corpus of farmer queries on Open Government Data Platform. It was a gold mine for us. We decided to analyze about 3 million of them using our current tools. It was real fun! Here is a summary of the methodology:

NLP process in agriculture


We were able to extract hyper-local disease and virus trends from this data and even create day-by-day timelines. Using it we created many invaluable insights. Below is a heatmap visualization of blight occurrences in Maharashtra:

Blight in Maharashtra (2016)


Another unique insight was of how different diseases affected onions in Ahmadnagar throughout the year:

Onion Ahmednagar (2016)


These outcomes became the primary component of our keynote address at the IBM Agri Tech Challenge 2018 conference in mid June this year. With our current wink NLP packages we could put all of this together rapidly. It took less than a minute on a Macbook Pro to clean, classify, extract crops, and tag diseases on the entire data set.

We will be showcasing the detailed recipe of this project on Github soon. Keep an eye out while we release the next generation tools, and be ready for more fun. 😀

For speaking engagements or any other enquiries feel free to get in touch at wink@graype.in.


A more permissive license

Nov 8, 2018 by Rachna

We decided to switch from AGPLv3 license to MIT recently.

mit.png

Almost one and half years ago we commenced our journey to open source our intellectual property that has been used in solving business problems and also develop all new code as open source.

We felt that AGPLv3 license was the way to go! Our thought was driven by the fact that AGPLv3 will allow developers to use the wink packages on an "as-is" basis in any commercial closed-source application and there are no compulsions to make their work as "open source”. Only if they choose to enhance or modify any of the wink packages, AGPLv3 expects them to make those changes available in open source so that the community can benefit from them!

Over time we had several interactions with the developer community and realized that it curtailed their freedom in certain ways and the eventual benefit of promoting open source was not being achieved by binding developers. The desire to contribute in open source has to originate from deep within and can not be enforced. It triggered an intense debate within the team.

We decided to switch the licensing of our packages to MIT. This is permissive, has no restrictions and the choice to open source any enhancements is left to the developer.

Starting today, all our packages are available under the MIT license. Long live open source!

ASCII Art Credit: AsciiWorld & Patorjk. Image made using Carbon.