<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.8.7">Jekyll</generator><link href="http://kaveri-ai.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="http://kaveri-ai.github.io/" rel="alternate" type="text/html" /><updated>2020-06-06T07:20:23+00:00</updated><id>http://kaveri-ai.github.io/feed.xml</id><title type="html">kaveri-ai blog posts</title><subtitle>We are an AI startup focusing on machine learning to solve business needs.</subtitle><entry><title type="html">Welcome to Kaveri-AI!</title><link href="http://kaveri-ai.github.io/jekyll/update/2020/06/05/welcome-to-jekyll.html" rel="alternate" type="text/html" title="Welcome to Kaveri-AI!" /><published>2020-06-05T16:53:04+00:00</published><updated>2020-06-05T16:53:04+00:00</updated><id>http://kaveri-ai.github.io/jekyll/update/2020/06/05/welcome-to-jekyll</id><content type="html" xml:base="http://kaveri-ai.github.io/jekyll/update/2020/06/05/welcome-to-jekyll.html">&lt;p&gt;You’ll find this post in your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;_posts&lt;/code&gt; directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;jekyll serve&lt;/code&gt;, which launches a web server and auto-regenerates your site when a file is updated.&lt;/p&gt;

&lt;p&gt;Jekyll requires blog post files to be named according to the following format:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;YEAR-MONTH-DAY-title.MARKUP&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Where &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;YEAR&lt;/code&gt; is a four-digit number, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MONTH&lt;/code&gt; and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DAY&lt;/code&gt; are both two-digit numbers, and &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;MARKUP&lt;/code&gt; is the file extension representing the format used in the file. After that, include the necessary front matter. Take a look at the source for this post to get an idea about how it works.&lt;/p&gt;

&lt;p&gt;Jekyll also offers powerful support for code snippets:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-ruby&quot; data-lang=&quot;ruby&quot;&gt;&lt;span class=&quot;k&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;puts&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Hi, &lt;/span&gt;&lt;span class=&quot;si&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;print_hi&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;'Tom'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;c1&quot;&gt;#=&amp;gt; prints 'Hi, Tom' to STDOUT.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Check out the &lt;a href=&quot;https://jekyllrb.com/docs/home&quot;&gt;Jekyll docs&lt;/a&gt; for more info on how to get the most out of Jekyll. File all bugs/feature requests at &lt;a href=&quot;https://github.com/jekyll/jekyll&quot;&gt;Jekyll’s GitHub repo&lt;/a&gt;. If you have questions, you can ask them on &lt;a href=&quot;https://talk.jekyllrb.com/&quot;&gt;Jekyll Talk&lt;/a&gt;.&lt;/p&gt;</content><author><name></name></author><summary type="html">You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.</summary></entry><entry><title type="html">Question Answering systems using BERT and Transformers</title><link href="http://kaveri-ai.github.io/jekyll/update/2020/01/04/BERT-QA.html" rel="alternate" type="text/html" title="Question Answering systems using BERT and Transformers" /><published>2020-01-04T16:53:04+00:00</published><updated>2020-01-04T16:53:04+00:00</updated><id>http://kaveri-ai.github.io/jekyll/update/2020/01/04/BERT%20QA</id><content type="html" xml:base="http://kaveri-ai.github.io/jekyll/update/2020/01/04/BERT-QA.html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Question Answering is a fascinating topic since ages. Examinations, 
Quiz competitions - QA is ubiquitous. There are different methods to find answers to questions - search,
FAQ based, extractive QA and others. Each method is different and has its own pros and cons.&lt;/p&gt;

&lt;p&gt;To set some context on what these words mean -&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Search - Finding relevant documents in a text corpus&lt;/li&gt;
  &lt;li&gt;FAQ - Finding the answer based on a similar question already in the FAQ (Frequently Asked Questions)&lt;/li&gt;
  &lt;li&gt;Extractive QA - Finding the right answer automatically from the text corpus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The invention of &lt;a href=&quot;http://jalammar.github.io/illustrated-transformer/&quot;&gt;&lt;strong&gt;Transformer&lt;/strong&gt;&lt;/a&gt; 
and subsequent &lt;a href=&quot;https://ai.googleblog.com/2018/11/open-sourcing-bert-state-of-art-pre.html&quot;&gt;&lt;strong&gt;BERT&lt;/strong&gt;&lt;/a&gt; methods in recent years has moved the needle in achieving 
great accuracies and have made these techniques &lt;strong&gt;usable&lt;/strong&gt; in production applications.&lt;/p&gt;

&lt;p&gt;We explain how to build QA applications at scale using these recent trends.&lt;/p&gt;

&lt;h3 id=&quot;our-work&quot;&gt;Our Work&lt;/h3&gt;

&lt;p&gt;We have applied BERT based architectures in FAQ based, document based QA systems. Overall the procedure is -&lt;/p&gt;

&lt;h4 id=&quot;data-processing&quot;&gt;Data Processing&lt;/h4&gt;
&lt;p&gt;Text data from different sources (read webpages, documents, social media, emails and others) 
are collected, cleaned, pre-processed and indexed into a search platform like Elastic Search.&lt;/p&gt;

&lt;h4 id=&quot;model-training--fine-tuning&quot;&gt;Model Training &amp;amp; Fine Tuning&lt;/h4&gt;
&lt;p&gt;There are a variety of &lt;a href=&quot;https://huggingface.co/transformers/summary.html&quot;&gt;&lt;strong&gt;BERT based models&lt;/strong&gt;&lt;/a&gt;. 
Models pre-trained on large corpus of text have to be fine tuned on the required task, in this case a Q&amp;amp;A task using Q&amp;amp;A datasets. 
The data can be from open source or annotated using the particular customer data.&lt;/p&gt;

&lt;h4 id=&quot;ask-a-question&quot;&gt;Ask a Question&lt;/h4&gt;
&lt;p&gt;When a query is entered by the user in the platform – the following happens.&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Candidate passages from the search platform will be retrieved using a text algorithm&lt;/li&gt;
  &lt;li&gt;The candidate passages will be scored based on relevance&lt;/li&gt;
  &lt;li&gt;The top N passages will be input into the model to generate the potential answers (for every passage) along with the confidence scores.&lt;/li&gt;
  &lt;li&gt;The produced answers will be scored using an ML approach to finalize the best k answers&lt;/li&gt;
  &lt;li&gt;The answers will be presented to the user&lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;user-feedback&quot;&gt;User Feedback&lt;/h4&gt;
&lt;p&gt;Platform will support the capability for the user to provide feedback on the answers shown. 
The collected data will be stored and used for improving the scoring algorithms.&lt;/p&gt;

&lt;p&gt;A schematic is below&lt;/p&gt;

&lt;div class=&quot;imgcap&quot;&gt;
&lt;img src=&quot;/assets/bertqa.jpg&quot; /&gt;
&lt;/div&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;p&gt;Overall, QA systems reduce the time taken to find answers in a text corpus. We have experience in building
and deploying these applications in cloud as well as on-premise.&lt;/p&gt;

&lt;p&gt;A couple of demo applications:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Millet FAQ Answering - &lt;a href=&quot;http://millet-qa.herokuapp.com&quot;&gt;&lt;strong&gt;click here&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://en.wikipedia.org/wiki/Tirukkuṛaḷ&quot;&gt;&lt;strong&gt;Thirukkural&lt;/strong&gt;&lt;/a&gt; search using Tamil keyword - &lt;a href=&quot;http://kural-search.herokuapp.com&quot;&gt;&lt;strong&gt;click here&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please reach us &lt;a href=&quot;http://www.kaveri-ai.in&quot;&gt;here&lt;/a&gt; if you are looking for text solutions.&lt;/p&gt;</content><author><name></name></author><summary type="html">Build and deploy Q&amp;A systems at scale on corpus of text such as web sites, web pages, documents and FAQs</summary></entry><entry><title type="html">Assisting Customer Service Agents using deep learning techniques</title><link href="http://kaveri-ai.github.io/jekyll/update/2019/10/15/deep-learning-in-text.html" rel="alternate" type="text/html" title="Assisting Customer Service Agents using deep learning techniques" /><published>2019-10-15T16:53:04+00:00</published><updated>2019-10-15T16:53:04+00:00</updated><id>http://kaveri-ai.github.io/jekyll/update/2019/10/15/deep%20learning%20in%20text</id><content type="html" xml:base="http://kaveri-ai.github.io/jekyll/update/2019/10/15/deep-learning-in-text.html">&lt;h2 id=&quot;introduction&quot;&gt;Introduction&lt;/h2&gt;

&lt;p&gt;Applications that assist Agents and supervisors when they respond to customers are very common. For example,
Agents are assisted with predefined responses when they answer email, chat or social media customer queries. 
The usefulness and accuracy of these suggestions can be improved by deep learning 
and transfer learning techniques.&lt;/p&gt;

&lt;h4 id=&quot;examples-of-agent-assist-systems&quot;&gt;Examples of Agent Assist Systems&lt;/h4&gt;
&lt;p&gt;When a question pops up on Agent’s chat window, the potential responses/answers can appear on the Agent’s screen
for him to either select one of the responses or build his own response based on the responses available.&lt;/p&gt;

&lt;p&gt;Similarly, email and social media systems can suggest top N responses for an incoming interaction from customer.&lt;/p&gt;

&lt;p&gt;Further, sentiments and Intents of these interactions can be shown to the agents for appropriate responses.&lt;/p&gt;

&lt;p&gt;Machine learning systems can produce these responses from historical interactions, documents, FAQs, 
internal web pages and knowledge articles.&lt;/p&gt;

&lt;h3 id=&quot;our-work&quot;&gt;Our Work&lt;/h3&gt;

&lt;p&gt;In the email scenario, we wanted to suggest top 5 email responses when an agent receives a new email 
to service. This will be by using the historical emails that have been answered before (by other agents)&lt;/p&gt;

&lt;h4 id=&quot;feature-based-approach&quot;&gt;Feature based approach&lt;/h4&gt;

&lt;p&gt;We started with a simple bag-of-words approach with TF-IDF scores to find cosine similarity between emails and the top most 
ones that are closer to the un-answered email can be listed to the Agent. We built a very basic model 
with this approach (with lots of other features such as exact word count) and this works perfectly OK in few cases.&lt;/p&gt;

&lt;p&gt;There are few challenges such as the model couldn’t take the language semantic into account. 
In production, we had to calculate cosine similarity with a huge set of interactions to find out 
the ones that are closer to a particular email. So, this doesn’t scale well for real time use cases.&lt;/p&gt;

&lt;p&gt;A simple code snippet using &lt;a href=&quot;https://scikit-learn.org/stable/&quot;&gt;sklearn&lt;/a&gt; package for calculating cosine similarity.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-python&quot; data-lang=&quot;python&quot;&gt;    &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sklearn.feature_extraction.text&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TfidfVectorizer&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;m_tfidf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TfidfVectorizer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;min_df&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;use_idf&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;bp&quot;&gt;True&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tokenizer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tokenize&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;preprocessor&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pre_process&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;norm&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;'l2'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;tfidf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;m_tfidf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fit_transform&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;all_docs&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    
    &lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;sklearn.metrics.pairwise&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;linear_kernel&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;cos_sim&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;linear_kernel&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;tfidf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;],&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;tfidf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;flatten&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;doc_index&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;cos_sim&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;argsort&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()[:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;
    &lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h4 id=&quot;bert-based-model-approach&quot;&gt;BERT based model Approach&lt;/h4&gt;
&lt;p&gt;Recent advancements in text architectures such as Transformers and BERT have improved accuracy the
of Question-Answering, Text Classification, Sentiment Analysis and various other tasks.&lt;/p&gt;

&lt;p&gt;We calculated BERT similarity between emails instead of TF-IDF to improve the results.&lt;/p&gt;

&lt;p&gt;BERT is trained on huge corpuses of text and understands the language semantics better instead of 
just using word counts and word importance. We have used BERT in Q&amp;amp;A and text classification. 
You can find more details &lt;a href=&quot;2020-01-04-BERT%20QA.markdown&quot;&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4 id=&quot;embedding-approach&quot;&gt;Embedding Approach&lt;/h4&gt;

&lt;p&gt;Transfer Learning/pre-training is a boon in machine learning especially deep learning. 
This helps in applying the “learning” (read weight matrix) from a different dataset in a similar domain to a new problem in the same or related domain.
We were inspired by the Quora question similarity problem &lt;a href=&quot;https://www.kaggle.com/c/quora-question-pairs&quot;&gt;kaggle competition&lt;/a&gt; and wanted 
to apply some of the techniques to solve our use case.&lt;/p&gt;

&lt;p&gt;To build our models, we used GloVe embedding, Tensorflow and Keras.
Word Embedding captures very powerful semantic relationships in text data. 
We wanted to leverage the already trained GloVe/Word2Vec models. The central idea is to convert the 
email text into word embedding first followed by a convolution/RNN (LSTM) deep layers on top of it 
with fully connected layers and finally a softmax layer for classification. This is similar to the 
other conventional deep network architectures except that the training will be disabled for the 
embedding layer. In Keras, it is as simple as setting trainable=false for the embedding layer.&lt;/p&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;p&gt;Contact centers handle lot of text data and deriving meaningful insights using machine learning techniques
can bring value by&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;reducing &lt;strong&gt;agent handling time&lt;/strong&gt; allowing agent spend more time on important tasks&lt;/li&gt;
  &lt;li&gt;improving &lt;strong&gt;customer experience&lt;/strong&gt; by providing better resolutions&lt;/li&gt;
  &lt;li&gt;&lt;strong&gt;first call resolution&lt;/strong&gt; based on targeted, accurate responses.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Please reach out us if you need more details on this!&lt;/p&gt;</content><author><name></name></author><summary type="html">Implementing machine learning systems that suggest responses to agents when they are responding to an email or chat or social media conversation</summary></entry></feed>