PyCon 2016 in Portland, Or
hills next to breadcrumb illustration

Dive into Natural Language Processing: How to judge debates using Python

Abhinav Gupta, Adyasha Maharana

Audience level:
Intermediate
Category:
Other

Description

You are in a heated debate with your sibling over ‘Which game is better: Candy Crush vs Clash of Clans’ (the latter, obviously). How to decide the winner? Why not build a virtual debate moderator which does just that! This talk will guide you through the application of Python NLP techniques to analyze arguments during a debate and define a strategy to figure out the winner.

Abstract

_Getting back to another example to explain the concepts involved in this problem:_ Suppose that, you are discussing with your friend whether PyCon is popular in US or not. The discussion will start with you taking a stance for the topic (Let us assume that you believe, PyCon is popular in US). Then, the discussion can progress in four different ways: 1. You remain firm on your stance throughout the complete discussion (You present instances related to popularity of PyCon in US) 2. You change your stance due to influence from other opinions 3. You remain neutral. 4. You talk off the topic or deviate from it. (While talking about PyCon, you start comparing it with other summits like Collision Conference and you end up discussing about popularity of Collision Conference instead of PyCon). ### Addressing 1, 2 and 3: All of these 3 points talks about the stance that you might take in a debate. In terms of NLP, this translates to positive, negative or neutral argument, which leads to the famous technique known as Sentiment Analysis i.e.  deciding the polarity of an argument. We will discuss how to tackle this problem using a simple yet effective classifier trained on a Presidential Debate corpus. #### Backtracking: After you you have become an expert at determining whether I am presenting an argument with a positive or a negative tone, you still have to consider that we are processing a debate. We will have multiple arguments; if I am saying with a negative tone, I might be countering my opponent’s argument. Basically, every negative argument doesn’t represent that I am speaking against the main topic. We will see how we can trace back an argument to its origin using a tree diagram. ### Addressing 4: I know that you can determine my stance in a debate, but what if I shifted to a completely different topic during the course of the debate. To identify this, we will use another popular technique - Sentence Similarity, which will measure the similarity between two concepts based on their semantics and word-order. Once we have understood the problem at hand and figured how to solve it, we will talk about the other aspects of this framework, mainly Interface and Scoring Strategy ### Interface: We will discuss a bit about how the present interface looks like and believe me, it can be replicated so quickly and easily, owing to the open source community. ### Scoring: Once we have a metric to measure stance and relevance of an argument, we will define a simple yet intuitive metric to calculate the score of each debater at the end of the debate, which will also take the depth of the debate into account. ### Additional Resources A brief introduction to these topics can be found in the following links: 1. Natural Language Processing: [http://bit.ly/1EIw2B9](http://bit.ly/1EIw2B9) 2. Parts of Speech Tagging : a. [http://www.cs.umd.edu/~nau/cmsc421/part-of-speech-tagging.pdf](http://www.cs.umd.edu/~nau/cmsc421/part-of-speech-tagging.pdf) b. [http://nlp.stanford.edu/software/tagger.shtml](http://nlp.stanford.edu/software/tagger.shtml) 3. Semantic Similarity : [http://bit.ly/1d65YtU](http://bit.ly/1d65YtU) 4. Sentiment Analysis : [http://www.lct-master.org/files/MullenSentimentCourseSlides.pdf](http://www.lct-master.org/files/MullenSentimentCourseSlides.pdf)