<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nanda Kumar on Medium]]></title>
        <description><![CDATA[Stories by Nanda Kumar on Medium]]></description>
        <link>https://medium.com/@nandhu02111997?source=rss-40e4ba67dc2b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ufvDPc-BnWHf0cJZlDkuhQ.jpeg</url>
            <title>Stories by Nanda Kumar on Medium</title>
            <link>https://medium.com/@nandhu02111997?source=rss-40e4ba67dc2b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 02:53:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nandhu02111997/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Identifying Question-Answer pair in threaded conversations- Approaches/Summary]]></title>
            <link>https://medium.com/@nandhu02111997/identifying-question-answer-pair-in-threaded-conversations-approaches-summary-8e42fc2ad1ea?source=rss-40e4ba67dc2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e42fc2ad1ea</guid>
            <category><![CDATA[question-answering]]></category>
            <category><![CDATA[bert]]></category>
            <dc:creator><![CDATA[Nanda Kumar]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 23:59:54 GMT</pubDate>
            <atom:updated>2021-09-06T04:36:02.700Z</atom:updated>
            <content:encoded><![CDATA[<p>Group text platforms like Telegram, WhatsApp are largely becoming the place for domain-oriented discussions. Conversations in such groups often contain forms of question and answering. Someone is looking for information, and someone is giving answers. Both sides working to create a community-driven knowledge source. Such group chats are different from open source community-answering platforms (StackOverflow, AskUbuntu) in terms of mining these question-answer pairs because platforms often have additional metadata information like upvotes, user-credibility check etc.. and conversations in such platforms are also less prone to deviate from the original topic since most discussions are an individual post.</p><p>Group chats on the other hand offer little to no metadata (except the ‘reply_to’ choice which is also optional) and can also be flooded with spam messages and several parallel discussions on different topics can be held simultaneously, which leads to mixing messages. The lack of start and endpoints in a group also makes it difficult to find questions, let alone suitable answers. All these problems aside, group chats are quickly becoming ‘the way’ to clarify doubts and ask questions, especially within organizations (google chats/slack messages). This is why it’s important to mine these QA pairs, which can add knowledge to existing documentation on the topic.</p><p><strong>Problem Setup</strong> :</p><p>Extracting QA pairs is not a new task by any means, several people have already conducted research on the same topic. [<a href="https://aclanthology.org/C04-1128.pdf">1</a>] talks about extracting questions and answers from email conversations where they use POS tags and traditional ML techniques for identifying questions. [<a href="https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/37565.pdf">2</a>] focuses on using pattern-matching heuristics like 5W1H and <a href="http://hanj.cs.illinois.edu/pdf/span01.pdf">Prefixspan</a> algorithm for identifying questions in Twitter messages. [<a href="https://webdocs.cs.ualberta.ca/~zaiane/postscript/c3s2e14.pdf">3</a>] talks about classifying each sentence into one of the three classes, <em>Statements, Questions, </em>and <em>Requests.</em></p><p>These approaches are solid but in a group text chain that’s continuous, there are numerous messages each of which don’t need to be classified. This is why it’s important to have a clear concise sorted-out dialogue for mining QA pairs.</p><p>[<a href="https://ieeexplore.ieee.org/abstract/document/9435511/">4</a>] talks about the exact same issue and presents a practical approach to solve this problem. Two of the main issues highlighted in the paper are,</p><blockquote>1.Conversation Disentanglement</blockquote><blockquote>2. Question-Answer pair Detection</blockquote><p><strong>Conversation Disentanglement :</strong></p><p>Conversation Disentanglement or Conversation Structure Modeling is the problem in which multiple conversations occur in the same channel simultaneously, and the listener should decide which utterance is part of the conversation he will respond to. Discovering the conversation structure allows us to segment the conversation by topics and focus on QA extraction from these dialogues instead of the whole corpus.</p><p>[<a href="https://arxiv.org/pdf/1911.10666.pdf">5</a>] presents a great approach to solve this, they use the BERT model to encode dialogue messages, followed by the use of classification tokens [CLS] by a transformer which then connects with an FC layer to determine whether the last message belongs to a given message branch.</p><p>Elaborating on the problem and solution presented in [5]: They define the problem of conversation structure modelling as identifying the parent utterance(s) to which each utterance in the conversation responds to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*IMyXGlxJr0h_K1Gk8qUWmg.png" /></figure><p>They propose a new Masked Hierarchical Transformer model to learn conversation structures taking into account the prior context of each utterance. A pre-trained transformer is used to produce a feature vector of each utterance. Then a second-stage transformer is applied to compare and aggregate utterances and produce the probability for each utterance being the parent of a target utterance. To utilize the previous conversation structure information, a novel masking mechanism is introduced for the second-stage transformer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*641S2NkBHmUOT5z5odirmA.png" /></figure><p>The conversation structure modelling task can be viewed as an utterance pair classification task for the ‘reply to’ relationship. You have your target utterance and all the utterances that came before it, it’s a matter of pairing with the right parent utterance (one-many).</p><p>The input of the model is a sequence of history utterances S1, S2 ···, SL, where the target utterance is placed at the end of the sequence as SL. For each utterance, an utterance encoder (BERT encoder) is first used to produce a feature vector. This feature vector along with the [CLS] is passed on to the second transformer. In order to use conversation structure, rather than the entire history, they’ve designed a masking mechanism to filter out redundant utterances, and only leverage ancestral(parent) utterances to predict the target utterance.</p><p>The mask is a binary L*L matrix whose values are determined by the following properties,</p><ol><li>All history utterances are able to attend to the target utterance.</li><li>Every utterance is able to attend to itself</li><li>Every non-target utterance is able to attend to its ancestors in the conversation graph.</li><li>All remaining utterances should not be attended to.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*wQyIk_ohjHyKWvD-m6cBhQ.png" /></figure><p>Consider a conversation example on the left side of the Figure above. The mask matrix is shown on the right, denoted as M. The last column of the matrix is all one due to property (1) above. The diagonal elements of the matrix are one due to property (2). Finally, for property (3), consider the following example pairs. Utterance 1 is the ancestor for utterance 4. Therefore, utterance 1 can be attended to by utterance 4 and the corresponding element in the mask matrix M41 = 1. On the other hand, utterance 3 is not the ancestor of utterance 4. Therefore, the information of utterance 3 is not accessible to utterance 4 and M43 = 0.</p><p>For each target utterance, they generate this asymmetric mask matrix that encodes the conversation structure until that point in time and run the second transformer on the entire sequence of utterances seen thus far.</p><p>This is just one of the approaches for solving the problem of conversation disentanglement and that leaves us with,</p><p><strong>Question-Answer Pair Detection :</strong></p><p>After breaking down the conversation into clear dialogues, further analysis can be carried out. [<a href="https://arxiv.org/pdf/1903.02419.pdf">6</a>] learn separate SVM classifiers to distinguish questions and answers. They use the following features: Question Mark, 5W1H Words, N-grams, Stop Words, etc. In [<a href="http://pages.stat.wisc.edu/~sding/paper/ACL08_pre.pdf">7</a>], the authors propose a framework for allocating QA-context triplets (context means clarification to the question) based on Conditional Random Fields(CRFs). They use an SVM classifier for extracting a question, the CRF for the question context, and answer extraction.</p><p>In addition to the above-described supervised approaches for extracting QA pairs, one of the areas of research is to create semi-supervised and unsupervised methods. [<a href="https://aclanthology.org/I13-1001.pdf">8</a>] employs a Co-training technique, which implies the usage of two classifiers using different features and applying them on unmarked examples, followed by the addition of the most confident examples to the labelled data.</p><p>All these approaches are based on low-level linguistic features and were published before the deep learning surge, the newer approaches like RNNs, LSTMs, and Transformer models (BERT) are much better at capturing context and providing accurate results.</p><p>The simplest and effective way to go would be to use pre-trained BERT embeddings to encode the sentences and use an FC layer to classify them into the 3 classes (statements, questions, requests).</p><p>For capturing answers, again the approaches presented in the above-mentioned papers lack high-level linguistic features but are good standalone techniques to utilize especially the linear CRF model. The linear chain edges can capture the dependency between two utterances.</p><p>Alternatively ranking methods like Elasticsearch can also provide satisfactory results, but it’s difficult to bank on since it uses TF-IDF scores to rank the paragraphs and we’re mostly dealing with micro-texts here. So similar to question identification the most effective method is the BERT-based question answering module, where we input a question and pass the rest of the sorted dialogue as a paragraph and the model, will output a start and end index of the detected answer from the paragraph.</p><p><strong>Conclusion :</strong></p><p>Information extraction from internet relay chats (IRCs) has been a problem of interest for more than a decade but we lacked effective(generic) methods to solve it. Advancements in transformer models have really helped the cause in solving the conversation disentanglement and question answering detection. We hope the ideas explored in this blog, can act as a guide to solve this problem.</p><p><strong>Limitations :</strong></p><p>With that being said, there are still are some avenues that need to be looked at, eg ., the conversation disentanglement approach relies heavily on the sentences being clean and the embeddings being able to capture the context between utterances, so if we are dealing with domain-based conversations, this can be increasingly difficult, eg .,</p><blockquote>Sent 1: Is Peutron 248 a good chip to game vlogging.</blockquote><blockquote>Sent 2: P229 and P301 provide a higher refresh rate.</blockquote><p>One other problem we might see is, differentiating from the root question and follow-up questions, in the multi-party conversation, the user replying can have clarification questions to the root questions, which need not be tagged as a question and extracted a QA-pair. We need to be able to differentiate the types and tag them accordingly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e42fc2ad1ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>