<?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[Holler Developers - Medium]]></title>
        <description><![CDATA[Holler is here to make your texts, posts, payments, and DMs more expressive. How? By suggesting the most relevant content — animated Stickers and GIFs– right when you need it the most in chat. - Medium]]></description>
        <link>https://medium.com/holler-developers?source=rss----b7d2eb150afd---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Holler Developers - Medium</title>
            <link>https://medium.com/holler-developers?source=rss----b7d2eb150afd---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 13 Nov 2026 02:58:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/holler-developers" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Emoji Understanding — An Overview]]></title>
            <link>https://medium.com/holler-developers/emoji-understanding-an-overview-df1a354f7ac0?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/df1a354f7ac0</guid>
            <category><![CDATA[emoji-meaning]]></category>
            <category><![CDATA[emoji-similarity]]></category>
            <category><![CDATA[emoji-prediction]]></category>
            <category><![CDATA[emoji-research]]></category>
            <category><![CDATA[emoji-meaning-change]]></category>
            <dc:creator><![CDATA[Sanjaya Wijeratne]]></dc:creator>
            <pubDate>Tue, 15 Feb 2022 17:53:15 GMT</pubDate>
            <atom:updated>2022-02-15T18:48:15.229Z</atom:updated>
            <content:encoded><![CDATA[<h3>Emoji Understanding — An Overview</h3><p><em>AI Research at </em><a href="http://holler.io/"><em>Holler Technologies</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PfmMJUsmDHfnqQV6ORYu_Q.jpeg" /><figcaption>Image Source — <a href="https://www.macrumors.com/2021/12/02/most-popular-emoji-2021/">https://www.macrumors.com/2021/12/02/most-popular-emoji-2021/</a></figcaption></figure><p>With the rise of social media, pictographs, commonly referred to as “<em>emoji</em>” have become one of the world’s fastest-growing forms of communication [<a href="https://www.theguardian.com/artanddesign/2016/sep/06/emojis-shigetaka-kurita-mark-davis-coding-language">Parkin, 2016</a>]. First introduced three decades ago, emoji become mainstream after their standardization by The Unicode Consortium in 2009, which enabled emoji adoption on mobile platforms. The rapid growth of emoji began in 2011 when the Apple iPhone added an emoji keyboard to iOS, and again in 2013 when the Android mobile platform started to support emoji on their mobile devices [<a href="https://instagram-engineering.com/emojineering-part-1-machine-learning-for-emoji-trendsmachine-learning-for-emoji-trends-7f5f9cb979ad">Dimson, 2015</a>]. Since then, emojis have become an important part of online communication. Today, they are being used billions of times across all major social media platforms to express sentiment, emotion, and sarcasm among other non-verbal cues. Thus, understanding what is expressed through emoji in text messages is extremely important to the modern-day Natural Language Processing (NLP) and Natural Language Understanding (NLU) applications.</p><p>As analysis and modeling of written text by natural language processing techniques have enabled important advances such as machine translation [<a href="https://aclanthology.org/1952.earlymt-1.1.pdf">Weaver, 1955</a>], word sense disambiguation [<a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.153.8457&amp;rep=rep1&amp;type=pdf">Navigli, 2009</a>], semantic similarity [<a href="https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.403.5446&amp;rep=rep1&amp;type=pdf">Gomma and Fahmy, 2013</a>], and search [<a href="https://www.csee.umbc.edu/courses/graduate/691/spring12/03/papers/p700-guha.pdf">Guha et al., 2003</a>], the transfer of such methods (or development of new methods) over emoji is only beginning to be explored [<a href="https://arxiv.org/pdf/1707.04652.pdf">Wijeratne et al., 2017a</a>]. Only recently have there been efforts to mimic standard natural language processing techniques used for semantic similarity, sense disambiguation, and search into the realm of emoji. Such emoji understanding tasks are essential to automatically process, derive meaning, and interpret text fused with emoji. In this article, we will look at four emoji understanding tasks, namely, calculating emoji similarity, emoji sense disambiguation, emoji prediction, and identifying the changes in emoji meaning over time. We will go through the past research that has been conducted on these tasks and discuss what is more to be done there.</p><h4>Calculating Emoji Similarity</h4><p>Calculating similarity in a vocabulary of words is one of the basic problems found in language understanding research [<a href="https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.403.5446&amp;rep=rep1&amp;type=pdf">Gomma and Fahmy, 2013</a>]. Similarly, calculating emoji similarity is one of the basic research problems found in emoji understanding research [<a href="https://corescholar.libraries.wright.edu/cgi/viewcontent.cgi?article=3368&amp;context=etd_all">Wijeratne, 2018</a>]. The notion of the similarity of two emojis is very broad. One can imagine a similarity measure based on the pixel similarity of emoji pictographs, yet this may not be useful since the pictorial representation of an emoji varies by mobile and computer platform [<a href="https://www.aaai.org/ocs/index.php/ICWSM/ICWSM16/paper/viewFile/13167/12746">Miller et al., 2016</a>]. Two similar-looking pictographs may also correspond to emoji with radically different senses (e.g., twelve-thirty 🕧 and six o’clock 🕕, raised hand ✋ and raised back of hand 🤚, etc.). Similarly, one could define the semantic similarity of emoji such that the measure reflects the likeness of their meaning, interpretation, or intended use. We prefer the semantic similarity measures based on the meanings of the emoji. Below, we will briefly go over the past research conducted on this space.</p><p>Barbieri et al. were the first ones to study the emoji similarity problem [<a href="https://repositori.upf.edu/bitstream/handle/10230/33776/Barbieri_emoji_mean_LREC2016.pdf?sequence=1&amp;isAllowed=y">Barbieri et al, 2016</a>]. They collected a sample of 10 million tweets originating from the USA and trained an emoji embedding model using tweets as the input. Then, using 50 manually-generated emoji pairs annotated by humans for emoji similarity and relatedness, they evaluated how well the learned emoji embeddings align with the human annotations. They reported that the learned emoji embeddings align more closely with the relatedness judgment scores of human annotators than the similarity judgment scores. Eisner et al. used a word embedding model learned over the Google News corpus, applied it to emoji names and keywords extracted from the Unicode Consortium website, and learned an emoji embedding model which they called emoji2vec [<a href="https://arxiv.org/pdf/1609.08359.pdf">Eisner et al., 2016</a>]. Using <a href="https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding">t-SNE</a> for data visualization, Eisner et al. showed that the high dimensional emoji embeddings learned by emoji2vec could group emoji into clusters based on their similarity. They also showed that their emoji embedding model could outperform Barbieri et al.’s model in a sentiment analysis task. Pohl et al. studied the emoji similarity problem using two methods; one based on the emoji keywords extracted from the Unicode Consortium website and the other based on emoji embeddings learned from a Twitter message corpus [<a href="https://www2.hci.uni-hannover.de/papers/Pohl2017TOCHI.pdf">Pohl et al., 2017</a>]. They used the <a href="https://en.wikipedia.org/wiki/Jaccard_index">Jaccard Coefficient</a> on the emoji keywords extracted from the Unicode Consortium to find the similarity of two emojis. They evaluated their approach using 90 manually-generated emoji pairs. Wijeratne et al. studied semantic similarity of emoji through embedding models [<a href="https://dl.acm.org/doi/pdf/10.1145/3106426.3106490">Wijeratne et al., 2017a</a>] that are learned over machine-readable emoji meanings extracted from the EmojiNet [<a href="https://arxiv.org/pdf/1707.04652.pdf">Wijeratne et al., 2017b</a>] knowledge base. Using emoji descriptions, emoji sense labels, and emoji sense definitions, and with different training corpora obtained from Twitter and Google News, they developed and tested multiple embedding models to measure emoji similarity. To evaluate their work, they created a new dataset called <a href="https://www.kaggle.com/sanjayaw/emosim508">EmoSim508</a>, which assigned human-annotated semantic similarity scores to a set of 508 carefully selected emoji pairs. After validation with <a href="https://www.kaggle.com/sanjayaw/emosim508">EmoSim508</a>, they further evaluated their emoji embedding models using a sentiment analysis benchmark and showed that their models outperform Barbieri et al.’s and Eisner et al.’s models, achieving the state-of-the-art results in emoji similarity.</p><h4>Emoji Sense Disambiguation</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K2tQH0m-dmVRFjXZ22pYVw.png" /><figcaption>Figure 1 — Emoji Usage on Social Media with Multiple Senses</figcaption></figure><p>When emoji were first introduced, they were defined with no rigid semantics attached [<a href="http://www.unicode.org/faq/emoji_dingbats.html#4.0.1">Unicode FAQ</a>], which allowed people to develop their own use and interpretation. Without rigid semantics attached to them, emoji symbols can take on different meanings based on the context of a message. Thus, for natural language processing and understanding tasks, machines must learn to disambiguate the meaning or the ‘sense’ of an emoji in text messages. For example, consider the three emojis 😂, 🔫, and 💰 and their use in multiple tweets shown in Figure 1. Depending on the context, we see that each of these emojis can take on wildly different meanings. People use the 😂 emoji to mean laughter, happiness, and humor; the 🔫 emoji to discuss killings, shootings, or anger; and the 💰 emoji to express that something is expensive, working hard to earn money, or simply to refer to money. Knowing the meaning of an emoji can significantly enhance applications that study, analyze, and summarize electronic communications. For example, rather than stripping away emoji in a preprocessing step, the sentiment analysis application reported in [<a href="https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0144296">Novak et al., 2015</a>] uses emoji to improve its sentiment score. Similarly, emoji can be used to detect sarcasm in text messages [<a href="https://arxiv.org/pdf/1708.00524.pdf">Felbo et al., 2017</a>]. Thus, the task of emoji sense disambiguation, which is the ability to identify the meaning of an emoji in the context of a message in a computational manner [<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5519135/">Wijeratne et al., 2016</a>], plays an important role in natural language processing and understanding applications.</p><p>Emoji sense disambiguation hasn’t received much attention from the research community as it’s considered one of the difficult problems to solve [<a href="https://ojs.aaai.org/index.php/ICWSM/article/view/14901/14751">Miller et al, 2017</a>] due to many reasons. For example, [<a href="https://ojs.aaai.org/index.php/ICWSM/article/view/14901/14751">Miller et al, 2017</a>] discussed how difficult it is to come to a common consensus on emoji meanings among emoji users on social media. Since the same emoji could appear differently on different mobile and web platforms, when coupled with the issues related to coming to a common consensus with emoji meanings, it is difficult to collect a properly annotated training dataset for supervised learning of emoji meanings. Such issues can be avoided if we had access to a list of possible emoji meanings for each emoji (e.g., an emoji meaning dictionary or a knowledge-base), thus, we can use those meanings as a starting point to tackle the emoji sense disambiguation problem. Based on this idea, an attempt has been made to solve the emoji sense disambiguation problem in a knowledge-based setting using EmojiNet [<a href="https://arxiv.org/pdf/1707.04652.pdf">Wijeratne et al., 2017a</a>]. EmojiNet [<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5519135/">Wijeratne et al., 2016</a>, <a href="https://arxiv.org/pdf/1707.04652.pdf">Wijeratne et al., 2017a</a>] is an emoji meaning dictionary consisting of: (i) 12,904 sense labels (emoji meanings) over 2,389 emoji, which were extracted from the web and linked to machine-readable sense definitions seen in <a href="https://babelnet.org/">BabelNet</a>; (ii) context words associated with each emoji sense, which are inferred through word embedding models trained over Google News corpus and a Twitter message corpus for each emoji sense definition; and (iii) recognizing discrepancies in the presentation of emoji on different platforms, specification of the most likely platform-based emoji sense for a selected set of emoji [<a href="https://www.kaggle.com/rtatman/emojinet">Download EmojiNet</a>]. To discuss how EmojiNet can be used to solve the emoji sense disambiguation problem, they illustrate disambiguation of the sense of the 🙏 emoji, which is one of the most misunderstood emoji on social media, as it is used in two example tweets.</p><blockquote><strong>Tweet 1 :</strong> Pray for my family 🙏 God gained an angel today.</blockquote><blockquote><strong>Tweet 2 :</strong> Hard to win, but we did it man 🙏 Lets celebrate!</blockquote><p>EmojiNet lists high five(noun) and pray(verb) as valid senses for the 🙏 emoji. For high five(noun), EmojiNet lists three definitions and for pray(verb), it lists two definitions. Wijeratne et al. take all the words that appear in their corresponding definitions as possible context words that can appear when the corresponding emoji (or sense) is being used in a sentence (tweets 1 and 2 in this case). For each sense, they extract the following sets of words from EmojiNet:</p><blockquote><strong>pray(verb) :</strong> {worship, thanksgiving, saint, pray, higher, god, confession}</blockquote><blockquote><strong>high five(noun) :</strong> {palm, high, hand, slide, celebrate, raise, person, five}</blockquote><p>To calculate the sense of the emoji in each tweet, they calculate the overlap between the words which appear in the tweet with words appearing with each emoji sense listed above. This method is called the Simplified LESK Algorithm [<a href="http://www.lrec-conf.org/proceedings/lrec2004/pdf/219.pdf">Vasilescu et al., 2004</a>]. The sense with the highest word overlap is assigned to the emoji at the end of a successful run of the algorithm. We can see that 🙏 emoji in Tweet 1 will be assigned pray(verb) based on the overlap of words {god, pray} with words retrieved from the sense definition of pray(verb) and the same 🙏 emoji in Twee 2 will be assigned high five(noun) based on the overlap of word {celebrate} with words retrieved from the sense definition of high five(noun). The above example only shows the minimal set of words that one could extract from EmojiNet. Since EmojiNet senses are linked with their corresponding BabelNet senses using BabelNet sense IDs, one could easily utilize other resources available in BabelNet such as related <a href="https://wordnet.princeton.edu/">WordNet</a> senses, <a href="https://verbs.colorado.edu/verbnet/">VerbNet</a> senses, Wikipedia pages, etc. to collect an improved set of context words for emoji sense disambiguation tasks. Wijeratne et al. further discussed how this idea can be extended with word embeddings learned from Twitter and Google News text corpora and reported their findings in [<a href="https://arxiv.org/pdf/1707.04652.pdf">Wijeratne et al., 2017a</a>]. We encourage the readers to go through Section 6.2 of [<a href="https://arxiv.org/pdf/1707.04652.pdf">Wijeratne et al., 2017a</a>] for more information on their latest studies.</p><p><strong>Emoji Prediction and Semantic Change of Emoji Meanings</strong></p><p>Word prediction is a popular, widespread functionality found in several computer and mobile interfaces; however, emoji prediction software was not well developed until recently. Barbieri et al. carried out one of the first studies to address the problem of predicting an emoji given a text input [<a href="https://aclanthology.org/E17-2017.pdf">Barbieri et al., 2017</a>]. Undertaken in a dataset of tweets each containing only one emoji, the research intended to guess the exact emoji used in the tweet given the text. They developed a computational model based on Long Short-term Memory Networks that relied on two different embedding models for representing the input sequence: words and character embedding, the latter to better model noisy social media text. Overall, their neural model outperformed competitive baselines based on word-level information. It is noticeable that the good behavior of word-level information, since word-emoji associations are common in the dataset they used (e.g., word “love” and ❤️), however, considering word sequences offers competitive advantages. They extended their work to study the use of visual information (i.e., images) in combination with text to predict emojis on the Instagram social network [<a href="https://aclanthology.org/N18-2107.pdf">Barbieri et al, 2018a</a>]. The interest in the emoji prediction task is probably evident by the large number of research teams that took part in the first Multilingual Emoji Prediction challenge organized at the SemEval 2018 evaluation forum, where 49 and 22 teams took part in the English and Spanish emoji prediction tasks, respectively [<a href="https://aclanthology.org/S18-1003.pdf">Barbieri et al, 2018b</a>].</p><p>Out of the problems that we’ve looked at so far, research on emoji meaning change over time has received very little attention. There’s only one recent study by Robertson et al. on Quantifying Change in Emoji Meaning from 2012–2018 [<a href="http://workshop-proceedings.icwsm.org/pdf/2021_07.pdf">Robertson et al., 2021</a>] that looks at this issue. They identified five patterns in emoji semantic development and reported that the less abstract an emoji is, the more likely it is to undergo a semantic change. They also provided a web interface to experiment with the semantic meaning changes of any emoji that is found in their dataset [<a href="https://emoji-semantic-change.herokuapp.com/">Emoji Semantic Change Over Time</a>]. We encourage the reader to explore [<a href="https://emoji-semantic-change.herokuapp.com/">Emoji Semantic Change Over Time</a>] web application to learn more about the changes in emoji meanings over time.</p><h4>Future Research Directions</h4><p>We will now look at the possible future research directions along the lines of the four emoji understanding problems we discussed in this article. Out of the four problems, calculating emoji similarity and emoji prediction has received the most attention from the research community. The emoji similarity problem has seen the most promising solutions out of the four problems, however, one could experiment with the recent large language models like BERT and XLNet to learn better emoji embedding representations to improve the performance of the downstream tasks such as sentiment analysis and emoji-based search. The emoji prediction problem has also received a lot of attention from the research community recently, however, due to the challenging nature of the problem, the results reported in the laters papers have great room for improvement. For example, solutions that look at the positional embeddings of emoji along with word and character embeddings could be one promising direction to study as research reports that the position of an emoji in a sentence affects the way it is used and interpreted. Emoji sense disambiguation could also be improved by looking at ways to incorporate platform-specific emoji datasets and meanings into the sense disambiguation process. For example, the recent emoji sense disambiguation results reported by Wijeratne et al. on Twitter data can be further improved by utilizing the <strong><em>source</em></strong> attribute returned by Twitter API with each tweet at the data collection time. The <strong><em>source</em></strong> attribute reports the platform in which the tweet was originated, allowing a computer system to utilize that information in the sense disambiguation process. Similarly, recent language models such as BERT and XLNet could also help to learn better emoji embedding models, which could improve the sense disambiguation process. We hope this article motivates the reader to take on the emoji understanding problems discussed above and extend the state-of-the-art.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df1a354f7ac0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/emoji-understanding-an-overview-df1a354f7ac0">Emoji Understanding — An Overview</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Towards On-device Offline Training Part 1]]></title>
            <link>https://medium.com/holler-developers/towards-on-device-offline-training-part-1-71d0ea840051?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/71d0ea840051</guid>
            <category><![CDATA[on-device-learning]]></category>
            <category><![CDATA[recommendation-system]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[interleaving]]></category>
            <category><![CDATA[personalization]]></category>
            <dc:creator><![CDATA[Abhishek]]></dc:creator>
            <pubDate>Wed, 02 Feb 2022 17:52:58 GMT</pubDate>
            <atom:updated>2022-02-02T17:52:57.887Z</atom:updated>
            <content:encoded><![CDATA[<p><em>AI Research at </em><a href="http://holler.io/"><em>Holler Technologies</em></a></p><h4><strong>Introduction</strong></h4><p>What do we do?</p><p>At Holler, we aim at enriching your Conversations. We do this by enhancing the text our users write, with Stickers and Gifs. To do this the right way, we need to suggest content in appropriate situations, with the intent that it is shared by the users during their chat. This leads us to an array of algorithms that are a part of our in-house Recommendation Decision System.</p><p>These algorithms can be divided into two major blocks, a <strong>Generalization block</strong> and a <strong>Personalization block</strong>, While Generalization aims at suggesting a Stream of content appropriate for the situation, it doesn’t account for the user preferences, Personalization, on the other hand, aims at ranking the general stream and curating it for the individual user.</p><p>We aim at achieving the said personalization <strong>On-device</strong>, this helps us with getting results <em>live and offline</em>. There are a few blocks that need to be understood to dive deep into the On-device models.</p><p>Next, we talk about the various <strong>Sources</strong> of Sticker Content, the <strong>Streams</strong> of content, 2 on-device <strong>Storage</strong> data structures, and <strong>Interleaving(</strong>the first block of algorithm that resides on the device and aims at personalization.)</p><h3><strong>Sources</strong></h3><h4><strong>Branded Content</strong></h4><p>This is content created for specific campaigns for partnering brands. Although this content is directly tied to a revenue stream we at Holler do not bombard the users with so-called “ads”. Instead, the branded content is interleaved with Organic content to avoid brand saturation for the user.</p><h4><strong>Organic Content — Historical</strong></h4><p>This is organic content that the system has published before. We have a lot of user interaction data on this content and hence Server Side Machine Learning models can be applied to the same and they serve as data for the Generalization Block.</p><h4><strong>Organic Content — Newly On-boarded</strong></h4><p>The creative team always comes up with new content on a daily basis. The aim is to get this content to the users as fast as possible and to garner as much reaction(shares) as possible. This helps in making an informed decision of what the users want and how receptive they are to the new content.</p><h3><strong>Streams</strong></h3><p>We define a list of content as a stream, there are 2 kinds of streams with respect to each device</p><h4><strong>Incoming Stream</strong></h4><p>The Stream of content that is suggested to the user after a situation is triggered is called an incoming Stream, a very basic version of a stream that stores only the source of data looks something like this. Where A == Branded, B == Organic</p><p><strong><em>A B A B A B A B A B</em></strong></p><p>After the user has interacted with the Incoming Stream a corresponding Stream that goes out of the device is called the Outgoing Stream. Along with the Source of content, this Stream also stores the info regarding user interaction, namely <strong>view</strong> or <strong>share</strong>, and looks something like this</p><p><strong><em>Av Bv Av Bv Av Bv Av Bs Av Bv</em></strong></p><p>Here the <strong><em>s</em></strong> associated with <strong><em>B</em></strong> suggests that organic content was shared during this interaction.</p><h3><strong>Storage</strong></h3><p>The next aim is to temporarily store user interactions on the device that could be then used to make decisions instantaneously, without leaving the device. This means that this data storage must be memory-efficient{should not strain the memory resources on the device}, time-efficient{should be easily available to be utilized for instant recommendations} and should adapt to a cold-start problem.</p><p>Some streams worth storing could be</p><ol><li>Source of Content using min-sketch counters and bit vectors</li><li>The content itself, using bloom filters</li><li>The message, using Locality Sensitive hashing</li></ol><p>Let&#39;s draw our focus on the first point and shed more light on the 2 data structures namely, Bit-vector and Min-Sketch Counter</p><h4><strong>Bit vector</strong></h4><p>We want to store the information, like the one we saw above, i.e. what source of content did the user share during their last interaction.</p><p>A <strong>bit vector</strong> is an array data structure that saves bits in a compact fashion, It is effective in determining the absence or presence of a particular entity. What we want is to toggle the values of the vector between 0 and 1 based on whether a user has shared content from a particular source during their last interaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*xsSFSd12tuxeYF8SDDhHsQ.png" /><figcaption>example of a bit-vector</figcaption></figure><h4><strong>Min-Sketch Counter</strong></h4><p>What we want is to get the number of times a user shares the content from a particular source, we can use a hash table that is a simple counter and get away with it when we have only 3 sources of content for a short stream, but as this number increases so will the space complexity of our hash table.</p><p>Keeping this in mind we implement a <strong>Count Min-sketch</strong>, which is a probabilistic data structure that stores a frequency table of events in a stream of data.</p><p>There are 3 steps involved in its creation and use,</p><ol><li><strong>Initialization</strong>: a simple matrix (<strong><em>d X w</em></strong>) is initialized to 0, where <strong><em>w </em></strong>is the width, which can correspond to the number of content sources while <strong><em>d </em></strong>is the depth and is equal to the number of hash functions.</li><li><strong>Increment</strong>: As the stream begins to come in, the element goes thru <strong><em>h</em></strong> number of hash functions, and the corresponding locations are incremented by one. This goes on till the end of the stream.</li><li><strong>Retrieval</strong>: now we retrieve the counts of each source which can be used to inform our model and give a snapshot of the same to the algorithm that uses it.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tHzx8YtHWbdlydnR06-mrg.png" /><figcaption>example of a Count Min-Sketch</figcaption></figure><h3><strong>Interleaving</strong></h3><p>To interleave is to present results from various sources in a fashion such that each source is given an equal opportunity to perform in front of the users. For instance, Sticker content at holler comes from three major sources, branded(A), organic historical(B) and organic newly-onboarded(C), a very basic interleaving would present the results in an equal fashion like</p><p><strong><em>A B C A B C A B C</em></strong></p><p>In order to improve upon this basic approach, there are 2 models which we try to implement around the concept of interleaving.</p><h4><strong>Static Interleaving</strong></h4><p>This approach interleaves a ranked list of Historical content with fresh, newly onboarded content. It is static because the interleaving takes place in a fixed ratio of 2:1 and is given to all users. This ensures a chance for the newly on-boarded content to show up to the users instead of being lost at the end of the list.</p><p>The benefits of this approach are sure shot but limited, It works well since the count of newly onboard content is usually low compared to Historical content.</p><p>For 2 newly on-boarded content static interleaving produces the stream below.</p><p><strong><em>B B C B B C B B B</em></strong></p><p>Once we back the Interleaving with storage and help it learn we get a smart version known as Dynamic Interleaving.</p><h4><strong>Dynamic Interleaving</strong></h4><p>We take the concept of Interleaving a step further by making it work on-device, making it personalized for the device user, and helping it learn.</p><p>Now, the task of Dynamic interleaving is two-fold,</p><p>First, we want to shuffle the order of the sources keeping the ratios intact, this is based on the very last response of the user. The logic behind this is to make the user feel a sense of personalization in the fact that the responses are immediately adapted to user preferences.</p><p>For instance, if we start with the first stream a particular user sees</p><p><strong><em>A B A B A B A B A B</em></strong></p><p>And if the user shares <strong><em>B . </em></strong>The outgoing stream looks like</p><p><strong><em>Av Bv Av Bv Av Bv Av Bs Av Bv</em></strong></p><p>The shuffling component use this info and for the next incoming stream we would switch and it will look like</p><p><strong><em>B A B A B A B A B A B A</em></strong></p><p>To favor what the user prefers, albeit temporarily.</p><p>And secondly, we want to change the ratio of content of the sources based on the count of the Short Term responses of the users.</p><p>For the incoming stream</p><p><strong><em>A B A B A B A B A B A B</em></strong></p><p>If <strong><em>A </em></strong>is preferred on a consistent basis, for instance, the last 10 times have seen a 9:1 or 8:2 in favor of <strong><em>A</em></strong>, then <strong><em>A</em></strong> is preferred more than <strong><em>B,</em></strong> and thus the next time the suggestion becomes</p><p><strong><em>A A B A A B A A B A A B</em></strong></p><p>and so on with the source flipping also into account.</p><h4><strong>Dynamic Interleaving for Sources of Content.</strong></h4><p>Let us dive into the 4 step process</p><ol><li>STM (short term memory) storage using a Bit vector</li><li>Shuffling component</li><li>SCM (short count memory) using MinCountSketch</li><li>Preference Weightage</li></ol><p>Example : For three sources A, B, C</p><p>{This is a snapshot of results stored in the 2 data structures and not the data structures themselves}</p><p><strong><em>STM == A:0,B:0,C:0</em></strong></p><p><strong><em>SCM == A:0,B:0,C:0</em></strong></p><p>IN_stream_1 (this is what the user is given when they ask for a recommendation.)</p><p><strong><em>A,B,C,A,B,C,A,B,C,A,B,C</em></strong></p><p>OUT_stream_1. This is what the STREAMS component on_device receives after the user has interacted with IN_stream_1.</p><p><strong><em>Av, Bv, Cv, Av, Bs, Cv, Av, Bv, Cv, Av, Bv, Cv</em></strong></p><p><strong><em>STM == A:0,B:1,C:0</em></strong></p><p><strong><em>SCM == A:0,B:1,C:0</em></strong></p><p>IN_stream_2:</p><p><strong>A,B,C,A,B,C,A,B,C,A,B,C</strong></p><p>Checks STM and SCM</p><ol><li>The shuffling component activates and reshuffles the stream::</li></ol><p><strong><em>B, A, C, B, A, C, B, A, C, B, A, C</em></strong>. The STM is then <strong>washed out</strong>.</p><ol><li>Preference weightage remains inactive since it waits for a certain threshold to be touched before making a decision.</li><li>Assuming the threshold for SCM is 5, once a single source hits 5(say <strong><em>A</em></strong>) the ratio of that source is doubled</li></ol><p>For<strong><em>, STM == A:1,B:0,C:0</em></strong></p><p><strong><em>SCM == A:5,B:1,C:1 </em></strong>the stream would look like</p><p><strong><em>A, A, B, C, A, A, B, C, B, C, B, C</em></strong></p><p><strong>Wash-Out</strong>, Both STM and SCM memory run the risk of being erased or wiped out owing to some reason or the other, while STM is agnostic to this behavior since only the last thing is what matters, the SCM can use the <strong>Call-back</strong> where at the end of the day each device reports the sum values and thus can be refreshed and resent to the device in the event of an SCM wash out.</p><p>Thus with the help of shuffling component and preference weightage, a unique combination of order and ratio is achieved for each device. This personalization is achieved by all data that resides on the device, thus creating <strong>self-sufficient on-device systems.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*mKiEJI65jUrVb1favpzHjg.png" /><figcaption><strong>self-sufficient on-device systems</strong></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71d0ea840051" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/towards-on-device-offline-training-part-1-71d0ea840051">Towards On-device Offline Training Part 1</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Slot Filling using Sequence Models]]></title>
            <link>https://medium.com/holler-developers/slot-filling-using-sequence-models-78ecd928b300?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/78ecd928b300</guid>
            <category><![CDATA[sequence-labeling]]></category>
            <category><![CDATA[slot-labeling]]></category>
            <category><![CDATA[recurrent-neural-network]]></category>
            <category><![CDATA[bi-lstm]]></category>
            <category><![CDATA[slot-filling]]></category>
            <dc:creator><![CDATA[Deepak Pandita]]></dc:creator>
            <pubDate>Thu, 27 Jan 2022 18:27:25 GMT</pubDate>
            <atom:updated>2023-11-29T04:27:28.237Z</atom:updated>
            <content:encoded><![CDATA[<p><em>AI Research at </em><a href="http://holler.io/"><em>Holler Technologies</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YQk1f0TWPduMB5f_" /><figcaption>Photo by <a href="https://unsplash.com/@freshseteyes?utm_source=medium&amp;utm_medium=referral">Quaid Lagan</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Slot filling is the subsequent task to intent detection and is very critical in Natural Language Understanding. If you are unaware of intent detection, then I would suggest reading my previous article, <a href="https://medium.com/holler-developers/intent-detection-using-sequence-models-ddae9cd861ee">Intent Detection using Sequence Models</a> for an overview. Intent detection aims to recognize the intention of the user query whereas, in slot filling, we identify the slots in the user query. We can think of slots as the parameters of a user query e.g. “I want to watch The Matrix”. Here, the intent is to watch a movie, and “The Matrix” is the name of the movie that we would like to identify. Slot filling is a key component in task-oriented dialog systems and can be used to better understand search queries.</p><p>In this article, we first go through the slot filling problem setup and the dataset used. Next, we use sequence models to solve the problem. We develop our solution in Python using pandas, Tensorflow Keras, and scikit-learn libraries.</p><h3>Problem</h3><p>Slot filling is traditionally treated as a sequence labeling problem. Given an utterance, the task is to assign a label to each token in the utterance. The tokens are labeled using an <a href="https://en.wikipedia.org/wiki/Inside%E2%80%93outside%E2%80%93beginning_(tagging)">IOB</a> (Inside, Outside, and Beginning) encoding scheme. For example “The Matrix” will be labeled as <em>B-movie_name I-movie_name</em>.</p><h3>Dataset</h3><p>To solve this problem, we need a dataset containing utterances that are labeled with slots. For this article, we use the <a href="https://arxiv.org/pdf/1805.10190v3.pdf">Snips</a> dataset which is a widely used dataset for intent detection and slot filling benchmarking. We take a subset of 7<em>874</em> utterances containing <em>35</em> slot types across <em>4</em> intent types (<em>AddToPlayist</em>, <em>BookRestaurant</em>, <em>PlayMusic</em>, and <em>SearchScreeningEvent</em>). The data is stored in plain text files. Let’s go ahead and load the dataset (Figure 1).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d4db3df76a3e019a10f2310383bf6a3/href">https://medium.com/media/9d4db3df76a3e019a10f2310383bf6a3/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tib7g3-joU2v2SgFmIiLVw.png" /><figcaption>Figure 1: Sample Data</figcaption></figure><h3>Data Preparation</h3><p>After we load our dataset, we split it into train and test sets. We split the dataset into <em>80%</em> train and <em>20%</em> test split using the scikit-learn library. The RANDOM_STATE variable is used to make sure we can replicate the experiments.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f84a20045ba9ca72524bf0593208c8c8/href">https://medium.com/media/f84a20045ba9ca72524bf0593208c8c8/href</a></iframe><pre>(6299,) (1575,) (6299,) (1575,)</pre><p>After splitting the dataset, we need to make sure it is in the format that can be accepted by our model. First, we initialize the tokenizers using the Tensorflow Keras library. We then use the tokenizers on our train and test datasets to get sequences. We need to pad the sequence to make sure that the length is the same across the samples and datasets. We limit the size of the vocabulary to NUM_WORDS. This allows us to handle out of vocabulary words seen during the test phase using the OOV_TOKEN. We also use one-hot vectors for the slot labels.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f7fe006c233317354ac4da1a713efa49/href">https://medium.com/media/f7fe006c233317354ac4da1a713efa49/href</a></iframe><pre>(6299, 35, 58) (1575, 35, 58)<br>(1575, 35, 1) (1575, 35, 1)</pre><h3>Training the Model</h3><p>Now that the data is prepared, we are ready for the training phase. In this article, we train a bidirectional long short-term memory (BiLSTM) model by using the Sequential class from Tensorflow Keras and adding layers to it. We start with the Embedding layer to represent each word with a vector of length EMBEDDING_DIM. Then, we add a BiLSTM layer by utilizing the Bidirectional wrapper class for the LSTM layer with dimension NUM_UNITS and <em>relu</em> activation. To get the output, we need to use the Dense layer with the TimeDistributed layer as we want the model to produce slot labels at each timestep i.e. for each word. The Dense layer output size is the number of slot labels and has a <em>softmax</em> activation. Next, we train the BiLSTM model and use <em>categorical cross-entropy</em> loss and <em>adam</em> optimizer for training. We also use <em>10%</em> of the data as the validation set.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0ee0b66b8865a7da8851400a8806a42/href">https://medium.com/media/c0ee0b66b8865a7da8851400a8806a42/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jkTE6LKhvTIoBdCg3DJgYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaFjLFSwHoddzxQWlMydXg.png" /></figure><p>We notice the loss on the training set and validation set decreasing as the training progresses. We stop after <em>7</em> epochs here but you can experiment with a greater number of epochs too.</p><h4>Plot Learning Curves</h4><p>After model training, we plot the learning curves by plotting the loss function for the training and validation sets.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/804af6ba9685129a2b5eb76cbf116088/href">https://medium.com/media/804af6ba9685129a2b5eb76cbf116088/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*baDJqO2Ob5-TuN7-TWQ6hQ.jpeg" /><figcaption>Figure 2: Learning Curves</figcaption></figure><p>As shown in Figure 2, the loss function on the train and validation set keeps decreasing and starts to become stable with a small gap in-between. Therefore, we can say this is a good model for the data.</p><h3>Evaluation</h3><p>Now, let’s evaluate the performance of the model on the test set.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f5064e2a7a630e9f8f86baa01523280/href">https://medium.com/media/3f5064e2a7a630e9f8f86baa01523280/href</a></iframe><pre>50/50 [==============================] - 0s 5ms/step - loss: 0.1515 - precision: 0.9787 - recall: 0.9531 - accuracy: 0.9624</pre><p>As we can notice, the accuracy of the model is <em>96.24%</em> on the test data but don’t let it mislead you. This metric is calculated on all the tokens and most of them will be the <em>Outside (O)</em> tokens. What we are really interested in here would be the performance on identifying the slots. An alternate way is to compute Precision, Recall, and F1-score over the spans of labels. However, it is out of scope for this article.</p><h3>Prediction using the model</h3><p>Let’s run our model on an example.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f16613a633191fd568d7ffc0ee545a0/href">https://medium.com/media/0f16613a633191fd568d7ffc0ee545a0/href</a></iframe><pre>I want to watch The Matrix<br>[&#39;O&#39;, &#39;O&#39;, &#39;O&#39;, &#39;O&#39;, &#39;B-movie_name&#39;, &#39;I-movie_name&#39;]</pre><p>The model correctly predicts the movie name in the input sentence as “The Matrix”.</p><h3>Summary</h3><p>In this article, we discussed the problem of slot filling, a key component for Natural Language Understanding. We prepared the data and implemented a BiLSTM model for labeling slots in a sentence. We briefly discussed the model performance and evaluation. We also demonstrated how the trained model can be used to predict slot labels for an input sentence.</p><p>A Jupyter Notebook containing the code can be found <a href="https://github.com/deepakpandita57/Slot_Filling">here</a>.</p><h3>Resources</h3><p>If you’re interested in learning more, here are some resources:</p><ul><li><a href="https://machinelearningmastery.com/gentle-introduction-long-short-term-memory-networks-experts/">https://machinelearningmastery.com/gentle-introduction-long-short-term-memory-networks-experts/</a></li><li><a href="https://machinelearningmastery.com/reshape-input-data-long-short-term-memory-networks-keras/">https://machinelearningmastery.com/reshape-input-data-long-short-term-memory-networks-keras/</a></li><li><a href="https://machinelearningmastery.com/timedistributed-layer-for-long-short-term-memory-networks-in-python/">https://machinelearningmastery.com/timedistributed-layer-for-long-short-term-memory-networks-in-python/</a></li></ul><h3>References</h3><ul><li>Coucke, A., Saade, A., Ball, A., Bluche, T., Caulier, A., Leroy, D., Doumouro, C., Gisselbrecht, T., Caltagirone, F., Lavril, T. and Primet, M., 2018. Snips voice platform: an embedded spoken language understanding system for private-by-design voice interfaces. <em>arXiv preprint arXiv:1805.10190</em>.</li><li><a href="https://machinelearningmastery.com/develop-bidirectional-lstm-sequence-classification-python-keras/">https://machinelearningmastery.com/develop-bidirectional-lstm-sequence-classification-python-keras/</a></li></ul><p>Thanks for reading! If you have questions or if you would like us to write on anything, please drop a comment or reach out on <a href="https://sites.google.com/view/deepakpandita/">my website</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78ecd928b300" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/slot-filling-using-sequence-models-78ecd928b300">Slot Filling using Sequence Models</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text Classification using Neural Networks]]></title>
            <link>https://medium.com/holler-developers/text-classification-using-neural-networks-400a5a32f88?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/400a5a32f88</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[backpropagation]]></category>
            <dc:creator><![CDATA[Sai Beathanabhotla]]></dc:creator>
            <pubDate>Fri, 21 Jan 2022 15:34:54 GMT</pubDate>
            <atom:updated>2022-01-21T15:34:54.859Z</atom:updated>
            <content:encoded><![CDATA[<p><em>AI Research at </em><a href="http://holler.io/"><em>Holler Technologies</em></a></p><h3>INTRODUCTION</h3><p>Text classification is a machine learning technique that assigns a set of predefined categories to open-ended text. Text classification is one of the fundamental tasks in natural language processing. Popular examples of text classification include spam classification, sentiment classification, news categorization, chat conversations can be classified into categories, etc.</p><p>In this article, we focus on the problem of category classification using word embeddings. The main goal of this article is to explain how Neural Networks work internally. We develop our solution in Python using pandas, TensorFlow Keras, and scikit-learn libraries.</p><h3>DATASET</h3><p>We have developed a dataset using publicly available datasets for different categories like Food, Music, Games, Watch Next, Politics, etc.</p><h3>NEURAL NETWORKS</h3><p>The basic idea behind a neural network is to <em>simulate</em> lots of densely interconnected brain cells inside a computer so you can get it to learn things, recognize patterns, and make decisions in a human-like way. Neural networks are the usual representation we make of the brain: neurons interconnected to other neurons which form a network. The operation of a neural network is straightforward: one enter variables as inputs (for example an image if the neural network is supposed to tell what is on an image), and after some calculations, the output is returned (following the first example, giving an image of a cat should return the word “cat”).</p><h4>What does a neural network consist of?</h4><p>A typical neural network has anything from a few dozen to hundreds, thousands or even millions of artificial neurons arranged in a series of layers, each of which connects to the layers on either side. The first layer is the layer in which inputs are entered, which are designed to receive various forms of information from the outside world that the network will attempt to learn about, recognize, or otherwise process. Other neurons sit on the opposite side of the network and signal how it responds to the information it’s learned; this layer is known as the output layer. In between the input and output layers, are one or more layers of hidden units, which, together, form the majority of the artificial brain. These layers are called hidden layers. Most neural networks are fully connected, which means each hidden unit and each output unit are connected to every unit in the layers on either side. The connections between one unit and another are represented by a number called weight, which can be either positive or negative. The higher the weight, the more influence one unit has on another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ALysTeudak2-7EIp" /></figure><p>Although a simple neural network for simple problem solving could consist of just four layers, as illustrated here, it could also consist of many different layers between the input and the output. A richer structure like this is called a deep neural network (DNN), and it’s typically used for tackling much more complex problems. In theory, a DNN can map any kind of input to any kind of output, but the drawback is that it needs considerably more training: it needs to “see” millions or billions of examples compared to perhaps the hundreds or thousands that a simpler network might need.</p><h4>What does a neuron do</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*DLEEv0APbZSLWKgO" /></figure><p>First, the neuron adds up the value of every neuron from the previous layer it is connected to. In the above figure, there are 3 inputs (x1, x2, x3) coming to the neuron, so 3 neurons of the previous column are connected to our neuron.</p><p>This value is multiplied, before being added, by another variable called “weight” (w1, w2, w3) which determines the connection between the two neurons. Each connection of neurons has its own weight, and those are the only values that will be modified during the learning process.</p><p>Moreover, a bias value may be added to the total value calculated. It is not a value coming from a specific neuron and is chosen before the learning phase, but can be useful for the network.</p><p>After all those summations, the neuron finally applies a function called “activation function” to the obtained value. Sigmoid, Tanh, RELU, Leaky RELU, Softmax are some examples of activation functions. Now, the neuron is ready to send its new value to other neurons.</p><h4>How does a neural network learn things?</h4><p>Information flows through a neural network in two ways. When it’s learning (being trained) or operating normally (after being trained), patterns of information are fed into the network via the input units, which trigger the layers of hidden units, and these in turn arrive at the output units. This common design is called a feedforward network. Not all units “fire” all the time. Each unit receives inputs from the units to its left, and the inputs are multiplied by the weights of the connections they travel along. Every unit adds up all the inputs it receives in this way and (in the simplest type of network) if the sum is more than a certain threshold value, the unit “fires” and triggers the units it’s connected to.</p><p>For a neural network to learn, there has to be an element of feedback involved. Neural networks learn things typically by a feedback process called backpropagation. This involves comparing the output a network produces with the output it was meant to produce, and using the <em>difference</em> between them to modify the weights of the connections between the units in the network, working from the output units through the hidden units to the input units — going backward, in other words. In time, backpropagation causes the network to learn, reducing the difference between actual and intended output to the point where the two exactly coincide, so the network figures things out exactly as it should.</p><h4>CODE</h4><pre># Import all required libraries<br>import pandas as pd<br>import numpy as np<br>from string import punctuation<br>from keras.preprocessing.text import Tokenizer<br>from keras.preprocessing.sequence import pad_sequences<br>from keras.models import Sequential<br>from keras.layers import *<br>from keras.layers.convolutional import *<br>from keras.preprocessing import text, sequence<br>from keras import *<br>from keras.utils import to_categorical<br>import gensim<br>from gensim.models import Word2Vec<br>from sklearn import *<br>from sklearn.feature_extraction.text import *<br>from sklearn.metrics import *<br>import nltk<br>nltk.download(‘punkt’)</pre><p>Here we will be using Google’s Word2Vec for training the neural networks. So we are going to initialize the Word2Vec model and write helper functions that will help us in extracting embedding from the text. Here we are using 300 dimension vectors which will be the input shape to the model.</p><pre>input_dim = 300</pre><pre>wv = gensim.models.KeyedVectors.load_word2vec_format(“path_to_file/GoogleNews-vectors-negative300.bin.gz”, binary=True)<br>wv.init_sims(replace=True)</pre><pre>def tokenize_text(text):<br>    tokens = nltk.word_tokenize(text, language=’english’)<br>    return tokens</pre><pre>def word_averaging(words):<br>    mean = []<br>    for word in words:<br>        if isinstance(word, np.ndarray):<br>            mean.append(word)<br>        elif word in wv.vocab:<br>            mean.append(wv.syn0norm[wv.vocab[word].index])<br>    if not mean:<br>        return np.zeros(wv.vector_size,)<br>    mean = np.array(mean).mean(axis=0)<br>    return mean</pre><p>We need to load the data and do training and testing data splits. The variable out_dim will be equal to the number of class labels we will be having in our data.</p><pre>out_dim = #some value based on the use case</pre><pre># LOAD INPUT DATA WITH TWO COLUMNS — ‘TEXT’ AND ‘CATEGORY&#39;<br>path_to_input_data = &quot;&quot;<br>data = pd.read_csv(path_to_input_data)</pre><pre>target_names = list(set(data.category.tolist()))</pre><pre>data_train, data_test = model_selection.train_test_split(data, test_size=0.1, random_state=42, stratify = data.category)</pre><p>We will be using LabelEncoder to encode the target variable and create mappings for each class label in our data.</p><pre>encoder = preprocessing.LabelEncoder()<br>y_data = encoder.fit_transform(data_train.category)<br>y_test_data = encoder_nc.fit_transform(data_test.category)</pre><pre>mapping = dict(zip(encoder.classes_, encoder.transform(encode.classes_)))<br>print(mapping)</pre><p>Below is the code for extracting features, training a model, testing it on test data, and getting the performance metrics like Precision, Recall, and F-score.</p><pre># generate 2d classification dataset<br>X = data_train.text<br>y = y_data</pre><pre>train_tokenized = X.apply(lambda r: tokenize_text(r)).values<br>X_train_word_average = word_averaging_list(wv, train_tokenized)</pre><pre>test_tokenized = data_test.text.apply(lambda r: tokenize_text(r)).values<br>X_test_word_average_nc = word_averaging_list(wv,test_tokenized_nc)<br>train_labels = to_categorical(y)</pre><pre># Training a sequential model<br>model = Sequential()<br>model.add(Dense(300, input_dim=input_dim, activation=’relu’))<br>model.add(Dense(100, activation=’relu’))<br>model.add(Dense(out_dim, activation=’softmax’))<br>model.compile(loss=’binary_crossentropy’, optimizer=’adam’)<br>model.fit(X_train_word_average, train_labels, epochs=10, verbose=0)</pre><pre>score = model.predict_classes(X_test_word_average)<br>print(‘Test accuracy:’, score)<br>print(‘accuracy %s’ % accuracy_score(score, y_test_data))</pre><pre>print(classification_report(y_test_data, score, target_names = target_names))</pre><h3>CONCLUSION</h3><p>In this article, I went through a detailed explanation of how neural networks work under the hood using mathematical techniques. Knowing the nuts and bolts will fortify your neural networks knowledge and make you feel comfortable taking on more complex models.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=400a5a32f88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/text-classification-using-neural-networks-400a5a32f88">Text Classification using Neural Networks</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blockchain Technology Explained — Part 1]]></title>
            <link>https://medium.com/holler-developers/blockchain-technology-explained-part-1-c7aab5e3b2f0?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/c7aab5e3b2f0</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[blockchain-technology]]></category>
            <dc:creator><![CDATA[Patrick Perrin, Ph.D.]]></dc:creator>
            <pubDate>Thu, 20 Jan 2022 15:45:31 GMT</pubDate>
            <atom:updated>2022-01-21T19:02:34.419Z</atom:updated>
            <content:encoded><![CDATA[<h3>Blockchain Technology Explained — Part 1: Basic Definitions</h3><p><em>AI Research at </em><a href="http://holler.io/"><em>Holler Technologies</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-kkKlT5TjqrcZvb5PYUB6g.png" /></figure><p>Who has not heard about blockchain these days? We hear about blockchain, coins, tokens, cryptocurrencies, NFTs, etc. almost everyday. We know FinTech and VCs pour a lot of money in this technology for the past few years. But what does that mean? What is it? Where do we start to understand this technology and also what can we do with it? Should a company integrate these into their portfolio of tech solutions? Is it another buzzword or a hype or something really crucial we need to have as a tech company? Where should we even start to navigate these waters, in a technological point of view?</p><p>This document is the first of a series on Blockchain Technology to make sense of this technology as a tech business. We will define the major concepts from a business point of view, and answer questions such as does my business need blockchain? How do we implement them? Are there development environments for blockchain? Should we have our own coin, or token, or network? What is a blockchain anyway? What’s a token? Is there any machine learning or AI in blockchain technology? Should there be? There are many questions regarding this developing technology, still in its infancy.</p><p>Let’s start from the basics, what is blockchain technology. We will build from there. First we need a good understanding of what that technology is and what it can do, before we can leverage it and use it accordingly. This brief is the journey in learning that technology.</p><p>It’s always good to have an example, right? So, we will take the example of Holler Studios, one of our divisions here at Holler Technologies. Holler Studios constantly create original content, in the form of original stickers, characters, GIFs, and such, that we distribute to our partner messaging platforms. These content are suggested by our AI algorithms to relevant conversations so participants tell their stories better using these original content. For example, when you use Venmo and see all these amazing relevant stickers, that’s us. A question we have asked ourselves a while back at Holler was how to protect these content assets as they are in the public domain, even though they are own by Holler? These characters are unique, and Holler should own them. Of course, every company will have different assets to protect, such as supply chains, patents, processes, products, etc. but also lines of codes, ideas, machine learning models, and such.</p><h3>What is a Blockchain Network?</h3><p>A blockchain network refers to a distributed, decentralized peer-to-peer network with no central control that represents a shared append-only ledger facilitating the process of recording immutable transactions of valuable assets in a business network. It also allows to track such assets. Anything of defined value or purpose can be an asset, and thus anything can be tracked and traded on a blockchain network. Lots of concepts to define here:</p><ul><li>Ledger</li><li>Transaction</li><li>Asset</li><li>Decentralized</li><li>Shared</li><li>Immutable</li><li>Record</li><li>Network</li><li>Blockchain</li></ul><p>We define all these next to give a clear picture.</p><h3>Distributed Append-Only Ledger</h3><p>The ledger is a dynamic and distributed set of immutable records, or transactions regarding the assets being managed in the network. It is instantaneously updated across the blockchain network, and since a transaction is recorded exactly once, there is no risk of duplication or errors, or stealing the asset. The ledger is secure in the sense that it is viewed by all, and transaction cannot be modified once recorded.</p><p>All network members have a copy of the ledger and then have a full view of the transactions and the assets. They do not rely on a single vulnerable access point to know about an asset and its transactions.</p><p>The network is synced automatically through a protocol referred to as consensus. Every time a transaction is recorded, it is automatically propagated through the network for transparency.</p><h3>Transactions are Immutable Records</h3><p>Immutable means that the transactions in the shared distributed ledger cannot change over time, and the technology does not enable them to change, or be deleted. It is an important characteristic because it provides transparency and a single shared view of the ledger to the network members, enabling trust, confidence, and protection of the traded/tracked assets. Since a record in the ledger is immutable, no network member can change or tamper with it once it is recorded in the shared ledger.</p><p>Transactions can also be associated with a set of rules, called smart contracts. A smart contract is stored in the blockchain network and executed automatically. It precisely defines a change of asset ownership based on certain conditions, or an upgrade in the value of the asset based on particular conditions, or a time limit in the asset life and/or value, and such. For example, we could have smart rules depreciating the asset value automatically over time.</p><h3>Assets are either Tangible or Intangible</h3><p>Assets can be either tangible or intangible. Tangible means that the asset is a physical object that can be touched. Examples of tangible assets are: a jacket , a painting, a house, a phone, etc.</p><p>Intangible then means the asset has no physical presence and thus cannot be grasped or touched. These types of assets can be ideas, intellectual property, or any other digital or virtual content such as a sticker, a song, or a proprietary machine learning model or notebook or computer program.</p><h3>How Blockchain Works — An Example</h3><p>Let’s assume the example relevant to Holler, Holler Studio has created something unique and proprietary to Holler, say an intangible asset in the form of a digital sticker or a digital character, for which Holler fully owns the rights and content, at least at first. Now, we want to record in the some Blockchain Network relevant to stickers, the transaction that Holler has created and owns the particular sticker Asset X. That transaction is recorded as a block of data that enable the existence of the new Asset X in the Blockchain Network. The data block, that has been defined for such cases, records information about the who (unique identification for ownership), the what (unique asset identifier in the network), the when it was created for the first time and attribution to Holler’s full ownership, as well as other information such as the asset initial value, condition, and other attributes relevant to the type of asset that can protect ownership, uniqueness of the asset, and value of the asset to the creator, its first owner. At that time, we also define the smart rules associated to the particular asset.</p><p>Now, when the asset is sold, or transformed, or value is increased or decreased due to market or other conditions, or anything else, other blocks of data will be created. Say, for example that the asset is being sold to a particualr person, thus, a record of new ownership is created. These blocks are connected to the blocks already created for the asset, and thus altogether form a chain of data as the asset properties and existence evolve over time. Such asset block chain records and validates the exact time and sequence of transactions that pertain to the asset. The blocks are securely linked to each other, thus protecting the asset and its transactions, as blocks are immutable, thus cannot be altered, deleted, or even new blocks inserted between two existing blocks. This is called a blockchain, and every asset managed has a blockchain. The group of all assets and their associated blockchains are implemented as a blockchain network.</p><p>It is important to reiterate that the asset blockchain is irreversible. Each block validates the previous block and thus the entire blockchain is protected. As we have seen, it is impossible to change an existing record, but also to add or fake additional records in the existing chain.</p><p>Furthermore, the ledger is distributed among the network members for transparency and trust. These characteristics of a blockchain to be tamper-evident, more secure, and transparent protect against malicious intent, such as transferring illegal ownership of an asset, or who was the initial creator, thus enabling fair monetization to Holler content creations from start, protecting their assets from being stolen. Each asset is fully traceable from its creation, protecting Holler IPs. At Holler, assets to protect are not only Holler Studio content, but also Technology proprietary solutions, such as snippets of code, processes, and machine learning models.</p><h3>Types of Blockchain Networks</h3><p>There are 4 types of blockchain networks. Which one to implement depends on the business goals.</p><ol><li>A <strong>Public Blockchain Network</strong> allows anyone to join and participate, for example Bitcoin. These networks are less secure and private, as every transaction is visible to the network members. Also, due to the large size, these networks require a lot of energy to operate, as every transaction is sent across the network for visibility. The strength of a blockchain network becomes its drawbacks for these types of networks. A public network is the most visible and therefore the most transparent to the population at large, gaining wider general trust in its transactions. However, it is costly to update all nodes to maintain such transparency, and it is more vulnerable security wise, as transaction creation is more difficult to verify.</li><li>At the other extreme, a <strong>(Fully) Private Blockchain Network</strong> is typically run by an organization that fully governs the network, such as who can be a member and participate in creating records, but also in its visibility and transparency as who can track and view an asset blockchain. Also it may seem restrictive, it also boots trust and confidence between the participants of the network. It also ensure greater security of the transaction chains. The business who owns the network has full control on the policies and rules of the network, can revert transactions, and such. The participants are known, limited, and as such, the network collisions and attacks, thus risk are limited. It is also cheaper to operate as the number of nodes can be order of magnitude less than a public network; transactions are cheaper and faster to propagate through the network. Finally, since read permissions are restricted, these networks provide a greater level of privacy.</li><li>Intuitively a private blockchain network is also a <strong>Permissioned (or Semi-Private) Blockchain Network</strong>, as specific restrictions are put in place to decide and control who can participate in the network. Public blockchain networks can also be restrictive and permissioned without being private. Participants will need to receive an invitation to participate in the network. Private and Semi-Private blockchain networks closely resemble how a company runs a website. Cost is being reduced compared to Public networks.</li><li>A <strong>Consortium Blockchain Network</strong> shares the responsibility and cost of blockchains across several defined organizations, allowing only their members to create and/or view blockchain transactions and assets journeys. The main advantage by limiting memberships is more security but also lower cost to operate, as there are less nodes in the network to update for each transaction being created, and shared cost among the consortium. They extend private networks to a larger, but still controlled audience, while limiting the cost to operate.</li></ol><h3>Conclusions</h3><p>In this first article in the Blockchain Technology series, we have looked at basic definitions of a blockchain, the assets, transactions, and types of networks. We have looked at an example here at Holler with the Holler Studios content. Next, we will go deeper into tokens and coins. Stay tuned.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7aab5e3b2f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/blockchain-technology-explained-part-1-c7aab5e3b2f0">Blockchain Technology Explained — Part 1</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Offensive Message Identification is Hard?]]></title>
            <link>https://medium.com/holler-developers/why-offensive-message-identification-is-hard-922a63fa59b8?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/922a63fa59b8</guid>
            <category><![CDATA[research]]></category>
            <category><![CDATA[identify-offensive-text]]></category>
            <category><![CDATA[social-media]]></category>
            <category><![CDATA[offensive-text-filtering]]></category>
            <category><![CDATA[offensive-message]]></category>
            <dc:creator><![CDATA[Sanjaya Wijeratne]]></dc:creator>
            <pubDate>Wed, 19 Jan 2022 18:23:06 GMT</pubDate>
            <atom:updated>2022-01-24T11:14:01.290Z</atom:updated>
            <content:encoded><![CDATA[<p><em>AI Research at </em><a href="http://holler.io/"><em>Holler Technologies</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2O1T6tSP8FMN8F6kvrQeg.jpeg" /><figcaption>Image Source — <a href="https://www.psychologicalscience.org/observer/the-science-of-swearing">https://www.psychologicalscience.org/observer/the-science-of-swearing</a></figcaption></figure><p>Today, we live in a society where the Internet and online communication have become a major part of our everyday life. Especially with the recent COVID-19 pandemic, the number of hours we spend in front of a screen has increased dramatically. Early surveys reported nearly 70% increase in the Internet use during the pandemic, out of which, half of the time was spent on social media [<a href="https://www.forbes.com/sites/markbeech/2020/03/25/covid-19-pushes-up-internet-use-70-streaming-more-than-12-first-figures-reveal/">Beech, 2020</a>].</p><p>People rely on social media to share and receive information including the latest news, communicate with their networks including friends and family, learn new things, develop their interests, and be entertained among others. In 2019, it was reported that more than 70% of Americans use social media sites everyday [<a href="https://www.pewresearch.org/internet/fact-sheet/social-media/">Pew Research, 2019</a>] while YouTube and Facebook being the most popular ones among them [<a href="https://www.pewresearch.org/internet/2021/04/07/social-media-use-in-2021/">Pew Research, 2021</a>]. Majority of the users access these sites on a daily basis, however, the sentiment associated with social media use still tend to be negative [<a href="https://www.pewresearch.org/fact-tank/2020/10/15/64-of-americans-say-social-media-have-a-mostly-negative-effect-on-the-way-things-are-going-in-the-u-s-today/">Pew Research, 2020</a>]. Research suggests that sharing of misinformation and online hate and harassment in social media are the two main reasons why people have a negative sentiment towards social media websites. Recent studies show that roughly four-in-ten Americans have experienced online harassment on these sites [<a href="https://www.pewtrusts.org/en/trust/archive/spring-2021/online-harassment-isnt-growing-but-its-getting-more-severe">Bertazzo, 2021</a>] and 79% of the social media users believe that the social media companies are doing a fair or poor job at addressing online harassment on their platforms [<a href="https://www.pewresearch.org/internet/2021/01/13/the-state-of-online-harassment/">Pew Research, 2021</a>]. In this article, we will look at the challenges in offensive language identification, which is the language often used in online harassment.</p><h4>Offensive Language and Offensive Language Identification</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/244/1*u2pnSbzJt-w7ARE9Qaf0iA.jpeg" /><figcaption>Image Source — <a href="https://tinyurl.com/27w8cydv">https://tinyurl.com/27w8cydv</a></figcaption></figure><p>Offensive language or profanity is the use of certain words and phrases that are considered by some to be rude, impolite, offensive, obscene, or insulting [<a href="https://corescholar.libraries.wright.edu/cgi/viewcontent.cgi?article=1966&amp;context=knoesis">Wang et al., 2014</a>]. People also refer to offensive language use as swearing, cursing, or using bad language. The use of offensive language occurs more often than we think in our day-to-day conversations. [<a href="https://www.researchgate.net/publication/10796714_The_Sounds_of_Social_Life_A_Psychometric_Analysis_of_Students&#39;_Daily_Social_Environments_and_Natural_Conversations">Mehl and Pennebaker, 2003</a>] reported that 0.5% to 0.7% of all words we speak are curse words, given that 1% of all the words we speak are first-person plural pronouns (e.g., we, us, our). In another study, [<a href="https://www.mcla.edu/Assets/uploads/MCLA/import/www.mcla.edu/Undergraduate/uploads/textWidget/1457.00018/documents/Jay_Taboo.pdf">Jay, 2009</a>] found 70 curse words in an 11,609-word tape-recorded conversations of elementary school students and college students. Use of offensive language is common across social media platforms too. By analyzing 51 million tweets posted by 14 million Twitter users, [<a href="https://corescholar.libraries.wright.edu/cgi/viewcontent.cgi?article=1966&amp;context=knoesis">Wang et al., 2014</a>] reported that curse words occurred at a rate of 1.15% on Twitter, and 7.73% of all tweets in their dataset contained curse words. Similar studies done by analyzing the language used in public and private Facebook posts report that the most common offensive words are used millions of times in Facebook posts, everyday [<a href="https://wersm.com/most-popular-curse-words-on-facebook/">WeRSM, 2013</a>].</p><p>Offensive language identification in social media is the process of identifying and detecting the user generated offensive content or comments that are hateful in nature that target an individual or a group [<a href="https://aclanthology.org/S19-2010.pdf">Zampieri et al., 2019</a>]. Recent research studies the problem of offensive language identification via a three way schema that looks at (i). Offensive Language Detection where the focus is on detecting whether a social media post contains any form of offensive content (aggressive, sexist, racist, etc.) or not, (ii). Categorization of Offensive Language which focuses on detecting whether an offensive message contains a targeted insult (towards an individual or a group) or not, and (iii). Offensive Language Target Identification where the focus is on detecting the targeted individual, group, or entity (a business organization, an event etc.) present in an offensive message [<a href="https://aclanthology.org/N19-1144.pdf">Zampieri et al., 2019a</a>]. Online offensive messages could be a result of many social media activities that link to online harassment, cyber bullying, expressing hate, aggression, racism, sexism and research has been conducted covering many such online activities where the identification of offensive language or words lies at the heart of solving them [<a href="https://hatespeechdata.com/">Hate Speech Data</a>]. However, the problems such as detecting the relationship between the sender and the receiver of an offensive message exchange and identifying offensive messages that are associated with non-textual elements present in social media messages such as emoji or stickers are not extensively studied [<a href="https://arxiv.org/pdf/2108.05921.pdf">Kirk et al., 2021</a>]. We will go over some of those issues later in this article.</p><h4>Types of Offensive Messages</h4><p>In this section, we will briefly go over some of the common offensive message types we find on social media platforms and in major datasets available for researchers who work on offensive message identification and filtering. The following is a subset of the offensive message types identified by Founta et al., in their work [<a href="https://arxiv.org/pdf/1802.00393.pdf">Founta et al., 2018</a>].</p><ol><li>Offensive Language — Profanity, strongly impolite, rude, or vulgar language expressed with fighting or hurtful words in order to insult a targeted individual or group.</li><li>Abusive Language — Any strongly impolite, rude, or hurtful language using profanity, that can show a debasement of someone or something, or show intense emotion.</li><li>Hate Speech — Language used to express hatred towards a targeted individual or group, or is intended to be derogatory, to humiliate, or to insult the members of the group, on the basis of attributes such as race, religion, ethnic origin, sexual orientation, disability, or gender.</li><li>Aggressive Speech — Overt, angry and often violent social interaction delivered via electronic means, with the intention of inflicting damage or other unpleasantness upon another individual or group of people, who perceive such acts as derogatory, harmful, or unwanted.</li></ol><p>As you may see, the above common offensive message type definitions overlap in terms of the language/offensive words used, which makes it difficult to generate computer models that clearly distinguish such messages. In the next section, we will look at such challenges.</p><h4>What Makes it Difficult to Build Computer Models to Identify Offensive Messages?</h4><p>Offensive message identification and filtering is a difficult task due to many reasons. In this section, we briefly go over the challenges in offensive message identification that are related to training data collection, overlapping definitions in offensive message types, issues arise due to the relationship between the sender and the receiver of an offensive message exchange, and offensive messages that are associated with non-textual elements such as emoji and stickers which could change the semantics expressed in the message text making it offensive.</p><ol><li>Training Data Collection — To train any supervised training model, we need access to labeled training data. In the context of offensive message filtering, we have to have offensive messages posted on social media websites in our labeled training dataset. Most of the social media websites use human moderators to weed out the offensive messages posted on their platforms. Similarly, the majority of the social media sites let the users of their sites to report any offensive content to the moderators, so that the moderators can remove them from their websites. Even though this seems an inefficient way of removing the offensive messages, eventually they will be removed from the social media websites. Therefore, searching for social media websites for offensive messages can be harder than one would think. Moreover, many social media websites don’t let the raw message text to be shared with others for research purposes, but the message IDs. More often than not, retrieving labeled datasets used by other researchers using the message IDs results in missing data due to the fact that the removal of offensive messages by site moderators by the time of message retrieval. Thus, collecting a labeled offensive message training dataset could be a major challenge faced by researchers. For a list of already published offensive message datasets that are commonly used in research studies, please visit [<a href="https://hatespeechdata.com/">Hate Speech Data</a>].</li><li>Class Imbalance and the Language Used in Training Data — Even though 0.5% to 0.7% of all words we speak are curse words [<a href="https://www.researchgate.net/publication/10796714_The_Sounds_of_Social_Life_A_Psychometric_Analysis_of_Students&#39;_Daily_Social_Environments_and_Natural_Conversations">Mehl and Pennebaker, 2003</a>], non-cursing words still largely outnumber curse words in labeled datasets. For example, if we used the dataset collected by [<a href="https://corescholar.libraries.wright.edu/cgi/viewcontent.cgi?article=1966&amp;context=knoesis">Wang et al., 2014</a>] in their experiments to learn a binary classifier that labels whether a message is offensive or not, our offensive dataset would still consist of 7.73% of all tweets in the dataset. This means, a little more than 92% of our training data would still be non-offensive text, which leaves us with an imbalanced dataset. This problem becomes even worse if we try to introduce fine-grained offensive message types such as Racist, Sexist, Aggressive messages etc. into our classifier instead of an umbrella class to represent all offensive messages. For example, if we wanted to develop a multi-class classifier that labels a message as Racist, Sexist, Aggressive, or Non-offensive using [<a href="https://corescholar.libraries.wright.edu/cgi/viewcontent.cgi?article=1966&amp;context=knoesis">Wang et al., 2014</a>]’s dataset, the 7.73% of offensive tweets will be further divided into Racist, Sexist, Aggressive classes, making the dataset further imbalanced. Similarly, the same set of curse words are used across the above fine-grained offensive message types, making it challenging to develop multi-class classifiers that rely only on word-level linguistic features. Such simple multi-class models could be helpful when one wants to deploy their offensive classifier on resource-constrained devices such as mobile phones where the same classification techniques and linguistic features one could use on a server-side environment might not be available on client-side (e.g., The TensorFlow-Lite machine learning model deployment platform for resource-constrained devices doesn’t support all TensorFlow functionality [<a href="https://www.tensorflow.org/lite/guide/ops_compatibility">see here</a>]).</li><li>Sender-receiver Relationship of an Offensive Message Exchange — Not all messages that contain offensive words are hateful [<a href="https://benjamins.com/catalog/z.57">Jay, 1992</a>]. For example, close friends often use curse words in their social media messages targeted at each other even though they don’t wish to harass their close friends. A majority of offensive message identification models that are based on word-level features rely on curse word lists [<a href="http://www.cse.psu.edu/~sxz16/papers/ceas2010-CameraReady-ZhiXu.pdf">Xu, 2010</a>] or they want the classifier model to automatically learn the relationships among curse words and the other words appearing with curse words to learn features to classify offensive messages. Therefore, not knowing the relationship between a sender and a receiver in an offensive message exchange could result in classifying messages that are not meant to harass the receiver as offensive. This problem is very difficult to address, especially using social media datasets as learning the relationship between two random individuals that exchange offensive messages on a social media website is a very difficult problem. Due to this reason, there has not been much research conducted in this area and it continues to exist as an open challenge for offensive message identification.</li><li>Issues with the Presence of Visual Communication Elements in Textual Data — Visual communication is a powerful tool for expressing non-verbal cues such as gestures and emotions which are otherwise difficult to express by only using words in online messaging [<a href="https://www.holler.io/insights/visual-communication-in-a-digital-world-the-complete-guide">Holler, 2021</a>]. Ranging from emoticons [<a href="https://en.wikipedia.org/wiki/Emoticon">Wikipedia</a>] to Facebook’s latest addition to the spectrum of the visual elements, Soundmoji [<a href="https://www.lifewire.com/facebooks-soundmojis-would-be-annoying-if-they-werent-so-well-designed-5193824">Majcher, 2021</a>], these pictorial characters give great expressive power to the users of online social media websites and messaging platforms. The presence of visual elements in social media messages has increased dramatically in recent years and become an important part of text classification systems [<a href="https://aiisc.ai/emoji2022/#section-cfp">Emoji Workshop, 2022</a>]. Thus, it is important to consider visual communication elements when building offensive message identification systems that can process the latest messages posted on social media websites. Past research has shown that visual communication elements such as emoji can take different meanings based on the context of their use [<a href="https://arxiv.org/pdf/1707.04652.pdf">Wijeratne, 2017</a>]. Oftentimes, certain emoji can be associated with offensive meanings as well, making them a tool for social network users to express hate towards others [<a href="https://arxiv.org/pdf/2108.05921.pdf">Kirk et al., 2021</a>]. A recent example for using emoji to express hate would be the racist social media comments received by Bukayo Saka, Jadon Sancho, and Marcus Rashford following England’s defeat in the Euro 2020 soccer final [<a href="https://www.msn.com/en-gb/news/uknews/bukayo-saka-jadon-sancho-and-marcus-rashford-racially-abused-online-after-england-euro-2020-final-defeat/ar-AAM1WGY">Jamieson, 2020</a>]. The angry social media users across all major social media platforms used emoji such as 🐒, 🐵, 🍌, and 🍉 to throw racial insults towards the players of color who play for the English Football team. Handling nuances such as emoji meanings in offensive message identification is still at its infancy. A recent work by [<a href="https://arxiv.org/pdf/2108.05921.pdf">Kirk et al., 2021</a>] was the first one to investigate this issue. They created a labeled training dataset consisting of offensive messages with emoji and showed that the current offensive message identification systems can be improved by using emoji presented in the context of a social media message. Even though their initial results are promising, there’s much more work needed to be done in this area. For example, there are other non-verbal communicative elements such as stickers and GIFs that could cause similar issues. For example, an image search tool developed by Google incorrectly labeled photos of black people as gorillas [<a href="https://www.bbc.com/news/technology-33347866">BBC, 2015</a>]. Similar references could be used as in the previous case with emoji but using GIFs and stickers to throw racist messages at people of color. Thus, more research needs to be done in this area to learn the relationships between the targets involved in the offensive message exchange and the visual elements used.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/262/1*45ttHggRB_0-KY15wyC15w.png" /><figcaption>Image Source — <a href="https://tinyurl.com/mr4b35sp">https://tinyurl.com/mr4b35sp</a></figcaption></figure><h4>Conclusion</h4><p>In this article, we looked at why offensive message identification is a difficult problem to solve using computer models. We discussed the negative sentiment associated with social media in general due to the presence of hate in social media websites, we defined what is an offensive message and what is meant by offensive message identification by explaining a three way schema proposed in recent research, we looked at different types of offensive messages found on social media sites, and discussed why it is difficult to build computer models that correctly distinguish them. We also shed light on research areas related to offensive message filtering that have not been extensively studied. We hope this article motivates the reader to take on the less-worked on research areas related to offensive message identification and filtering.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=922a63fa59b8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/why-offensive-message-identification-is-hard-922a63fa59b8">Why Offensive Message Identification is Hard?</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hackathons-A Powerful Stimulus tool for Innovation and Growth]]></title>
            <link>https://medium.com/holler-developers/hackathons-a-powerful-stimulus-tool-for-innovation-and-growth-c611d1977974?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/c611d1977974</guid>
            <dc:creator><![CDATA[Divya Ravi]]></dc:creator>
            <pubDate>Mon, 15 Nov 2021 22:05:44 GMT</pubDate>
            <atom:updated>2021-11-15T22:05:44.434Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently here at Holler, we successfully conducted our second virtual hackathon for the year. With a couple of successful hackathons conducted in the past (both onsite and offsite), we value hackathons as a key impetus for our innovation and growth. Especially in this pandemic work from home situation, hackathons prove to be valuable for both idea generation and connecting teams.</p><blockquote>Hackathons are events conducted by gathering people from different teams to collaborate, brainstorm, develop and deliver a tangible product within a short period of time.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kZRkM1muKXwDKjrkFaJLDg.jpeg" /></figure><p>Here are a few reasons why we think hackathons are important to the tech organization (startups especially).</p><h3>Innovation and creativity:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*F6ggtytwEfHQ7fK1dXUY1w.jpeg" /></figure><p>Hackathons are proven to help in accelerating innovation by stockpiling digital ideas and solutions demonstrating the possibilities of open innovation. They encourage company-wide innovation and creativity by allowing participants to run wild with their ideas. They’re a perfect environment for experimentation with low failure costs. Even in failure cases, the lessons learned will be invaluable. Stepping away from regular sprints and project deliverables, hackathons help nurture creativity by allowing us to come up with innovative ideas which can potentially create our next big successful product.</p><h3>Rapid Prototyping and MVPs:</h3><p>Hackathons are the ideal place where cutting-edge technology meets real-world applications with a richer exchange of ideas. The business product is different from the business prototype. A prototype needs to demonstrate the ability to conceptualize an idea into a substantial output. The important thing is understanding of the idea being possible, then the prototype can be tested to gather feedback to refine and rebuild. At a Hackathon, we need not perfect a product, instead, we must rapidly construct a prototype of our idea. The fast-paced nature of a hackathon is perfect for testing ideas and failing fast. Hackathons allow groups to communicate the value of their hack to an audience during the final demo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Msm5QlSPmJXaoI3URCzPiQ.png" /></figure><h3>Cross-Functioning and Learning:</h3><p>With deadlines and deliverables, we get minimal chances to work cross-functionally and learn about other parts of the organization in our day-to-day work. Hackathons promote cross-functional learning and development by letting participants choose to work across teams to solve a bigger problem. Hackathons encourage participants to experiment with new cutting-edge technologies and methodologies. Their open environment is ideal for developers to make meaningful connections. With limited time, people quickly learn how to ask for guidance from others. The Hackathon environment allows participants to coordinate easily and learn from each other, targeting one common goal to be achieved. Exposure to several participants from different backgrounds and varying skill sets facilitates acquiring expert knowledge in a more casual environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ppEKcyl3bYz0jBObybx6uA.jpeg" /></figure><h3>Diversity and Collaboration:</h3><p>Hackathons aren’t all about being innovative. They’re also about sharing knowledge and encouraging each other. That’s why it’s important to encourage diverse participation. Hackathons promote the collaboration of tech and business experts in solving real-world problems. Having an open, collaborative format, hackathons open doors to professionals from diverse backgrounds to solve challenges together. The best result out of this can be achieved by making it a well-rounded approach for innovation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GmDkLucaYlqDLUD9sf6ilA.jpeg" /></figure><h3>Bridge tech and talent gaps:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/1*kx8v0R2nnXnaXKEVZuDMbQ.jpeg" /></figure><p>Hackathons are an effective platform to bring industry challenges and business challenges to light and discuss their solutions. In a world of fast phased digital transformations, businesses need to engage with the latest technology, else risk getting left behind. Hackathons shed light on any talent gap or technology gap that companies might possess. Post hackathon feedback and analysis can help an organization to identify and take action on the areas that need any attention.</p><h3>Tips: For running a successful hackathon</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*ouuK71QY4SuPTivZrgAIZw.png" /></figure><blockquote>1. Set a theme or a clear goal</blockquote><blockquote>2. Plan ahead on logistics and dates</blockquote><blockquote>3. Motivate and engage people</blockquote><blockquote>4. Be communicative and responsive</blockquote><blockquote>5. Streamline team formation and management</blockquote><blockquote>6. Defining and following up on checkpoints</blockquote><blockquote>7. Present demos and share the success amongst the organization</blockquote><blockquote>8. Have a post Hackathon Plan (Feedback and potential expansion on the hackathon outcome product)</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c611d1977974" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/hackathons-a-powerful-stimulus-tool-for-innovation-and-growth-c611d1977974">Hackathons-A Powerful Stimulus tool for Innovation and Growth</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Processing the BIGG data]]></title>
            <link>https://medium.com/holler-developers/processing-the-bigg-data-3327c563c670?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/3327c563c670</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[distributed-processing]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[apache-spark]]></category>
            <dc:creator><![CDATA[Sai Beathanabhotla]]></dc:creator>
            <pubDate>Mon, 13 Sep 2021 22:45:07 GMT</pubDate>
            <atom:updated>2021-09-13T22:45:06.977Z</atom:updated>
            <content:encoded><![CDATA[<p>Data wrangling is the process of transforming and mapping data from one “raw” data form into another format with the intent of making it more appropriate and valuable for a variety of downstream purposes such as analytics. The goal of data wrangling is to assure both the quality and the usefulness of the data. Data wrangling typically follows a set of general steps which begin with extracting the data in a raw form from the data source, “munging” the raw data (e.g. sorting) or parsing the data into predefined data structures, and finally depositing the resulting content into a data sink for storage and future use. Data Wrangling is one of the most crucial steps for any Data Science or Machine Learning project and it’s the longest too.</p><p><strong>One of the downstream purposes of data wrangling, as mentioned above, is data analysis.</strong></p><p>Data analysis is a process of inspecting, cleansing, transforming, and modeling data with the goal of discovering useful information, informing conclusions, and supporting decision-making. In today’s business world, data analysis (descriptive analytics, exploratory data analysis, predictive analytics) plays a role in making decisions more scientifically and helping businesses operate more effectively.</p><p>In this article, we focus on processing big data. We first will take a look at what Pandas offers in data processing, limitations of Pandas and then will dive into Apache Spark for processing big data.</p><blockquote>Pandas is one of the most famous data science tools and it’s definitely a game-changer for wrangling and analyzing data. Pandas is a fast, powerful, flexible, and easy-to-use open-source data analysis and manipulation tool.</blockquote><p>Let us now look at a few examples of pandas.</p><p><strong>Reading the data from a CSV file</strong></p><p>We can either read from a CSV file or create a Dataframe directly. For simplicity, we will create a Dataframe manually and work with a small dataset in this article (but, including the code to read from a CSV file too).</p><pre>import pandas as pd<br>data = pd.read_csv(path_to_file)<br>data.head()</pre><pre># Creating a DataFrame manually<br>d = {&#39;id&#39;: [1, 1, 1, 1, 2, 2, 2, 2, 2 ,2], &#39;words&#39;: [&#39;hello&#39;, &#39;how are you&#39;, &#39;pizza&#39;, &#39;thank you&#39;, &#39;lol&#39;, &quot;what&#39;s up&quot;, &#39;beer&#39;, &#39;i love you&#39;, &#39;good morning&#39;, &#39;rent&#39;], &#39;value&#39;: [100, 300, 50, 10, 100, 344, 588, 22, 211, 323]}<br>data = pd.DataFrame(data=d)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/0*JKJt5-YgyhSdAYkW" /></figure><p><strong>Grouping by a certain column to generate counts and aggregations</strong></p><pre>data_grouped = data.groupby(&#39;id&#39;).count().reset_index()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*HivKd-4ijyITt_hWR8SPlA.png" /><figcaption>Group by operation on the DataFrame</figcaption></figure><p><strong>Applying Lambda functions on the data frame</strong></p><p>Applying a small lambda function that returns the number of words in a string by splitting it on whitespace.</p><pre>def number_of_words(text):<br>    return len(text.split(&quot; &quot;))</pre><pre>data[‘total_words’] = data[&#39;words&#39;].apply(lambda x : number_of_words(x))<br>data.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/0*q_w0y8OuJQh1Iwpq" /><figcaption>Created ‘total_words’ column using lambda function</figcaption></figure><p>We apply all these operators/functions as part of our day-to-day analysis of the data. Let’s say we have a dataset of 100K records. We will not have any issues running all the above code on it. Now, let’s say we have a dataset of 1 million records. We might still not have any issues but it might take some time to finish the task. Let’s say we now have a dataset of 1 billion records. We would get memory issues considering the amount of memory Pandas needs since it has limitations on the size of the data it processes.</p><h4><strong>WE NEED TO VERTICALLY SCALE THE RESOURCES IN ORDER TO PERFORM THE TASK WHICH IS NOT ADVISABLE AND EFFICIENT.</strong></h4><blockquote>Here comes Apache Spark!!</blockquote><blockquote>Apache Spark is a distributed data processing platform specialized for big data applications. It has become the de-facto standard in processing big data. By its distributed and in-memory working principle, it is supposed to perform fast by default.</blockquote><p>Let’s take a look at the features of Spark.</p><ul><li><strong>Swift Processing: </strong>Using Apache Spark, we achieve a high data processing speed of about 100x faster in memory and 10x faster on the disk. This is made possible by reducing the number of read-write to disk.</li><li><strong>Dynamic in Nature</strong></li><li><strong>In-Memory Computation in Spark: </strong>With in-memory processing, we can increase the processing speed. Here the data is being cached so we need not fetch data from the disk every time thus the time is saved. Spark has a DAG execution engine that facilitates in-memory computation and acyclic data flow resulting in high speed.</li><li><strong>Reusability: </strong>We can reuse the Spark code for batch-processing, join streams against historical data or run ad-hoc queries on stream state.</li><li><strong>Lazy Evaluation in Apache Spark</strong></li><li><strong>Fault Tolerance in Spark: </strong>Apache Spark provides fault tolerance through Spark abstraction-RDD. Spark RDDs are designed to handle the failure of any worker node in the cluster. Thus, it ensures that the loss of data reduces to zero.</li></ul><h3>Execution Model</h3><p>In contrast to Pandas, Spark uses a <em>lazy execution</em> model. So when you apply some transformation to a DataFrame, the data is not processed immediately. Transformations are lazy in nature and execution will not start until an <strong><em>action</em></strong><em> </em><strong><em>is</em></strong><em> </em><strong><em>triggered</em></strong>. Let us take a look at how Spark stages tasks internally:</p><ol><li>A <em>logical execution plan</em> is created from the transformations which essentially is a graph (a DAG) where nodes represent operations (like reading data or applying a transformation).</li><li>Now an <em>analyzed execution plan</em> is derived where all column names and external references to data sources are checked and resolved.</li><li>Spark iteratively applies the available optimization strategies to transforms the analyzed execution plan into an <em>optimized execution plan</em>. For example, filter operations are pushed as near as possible to the data sources in order to reduce the number of records as early as possible.</li><li>Finally, the result of the previous step is transformed into a <em>physical execution plan</em> where transformations are pipelined together into so-called <em>stages.</em></li><li>The physical execution plan then is split up along the data into so-called <em>tasks</em>, which then can be executed in parallel and distributed by the machines in the cluster.</li></ol><p>It is important to understand that by lazily following execution plans, the total working data set does not ever completely materialize into RAM at any point in time. Instead, all the data (including input data and intermediate results) is split up into small chunks, which are processed independently and even results are eventually stored within small chunks and those never need to fit into RAM at once.</p><h3>Spark Architecture Overview</h3><p>The Apache Spark framework uses a master-slave architecture that consists of a driver, which runs as a master node, and many executors that run across as worker nodes in the cluster. Spark can also be used for batch processing and real-time processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ai73CmrTBGW5LgKS" /><figcaption><strong>High-level Spark Architecture</strong></figcaption></figure><p>The driver is responsible for analyzing, distributing, monitoring, scheduling, and maintaining all the necessary information during the lifetime of the spark process. Executors are only responsible for executing the part of the code assigned to them by the driver and reporting the status back to the driver. Each spark process would have a separate driver and exclusive executors.</p><h3><strong>Deep Dive into Spark Architecture</strong></h3><p>The <em>driver program, </em>in the master node, drives our application. The code you are writing behaves as a driver program or if you are using the interactive shell, the shell acts as the driver program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c8QyTWObmeI-P5MX" /></figure><p>Inside the driver program, the first thing you do is, <em>create</em> a <em>SparkContext.</em> SparkContext is the entry point of Spark functionality. The most important step of any Spark driver application is to generate SparkContext.It is similar to your database connection. Any command you execute in your database goes through the database connection. Likewise, anything you do on Spark goes through Spark context.</p><p>Now, this Spark context works with the <em>cluster manager</em> to manage various jobs. The driver program &amp; Spark context takes care of the job execution within the cluster. A job is split into multiple tasks which are distributed over the worker node.</p><p>W<em>orker nodes</em> are the slave nodes whose job is to basically execute the tasks. These tasks are then executed on the partitioned data in the worker node and hence return back the result to the Spark Context.</p><p>​​To combine it all together, in short, SparkContext takes the job, breaks the job into tasks, and distributes them to the worker nodes. These tasks work on the partitioned RDD/DataFrame, perform operations, collect the results and return to the main Spark Context.</p><p>Now that we have learned about Spark and its working, let us take a look at some examples of data aggregations, manipulations in PySpark.</p><p><strong>Reading a CSV file into a Spark data frame</strong></p><p>We can create a Spark Dataframe by reading from a CSV file or manually too. Let’s convert the Pandas Dataframe we created above into a Spark Dataframe.</p><pre># importing required libraries<strong><br>import</strong> pyspark.sql.functions <strong>as</strong> pf<br><strong>from</strong> pyspark.sql.types <strong>import</strong> *<br><strong>from</strong> pyspark.sql <strong>import</strong> Window<br>from pyspark.sql.functions import pandas_udf, PandasUDFType</pre><pre><br>data_spark_csv = spark.read.csv(path_to_file, header=True)<br>display(data_spark_csv)</pre><pre># Converting Pandas Dataframe to a Spark Dataframe<br>data_spark = spark.createDataFrame(data)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/0*SljmZEXw5EvyOep8" /><figcaption>Spark DataFrame created by converting a pandas DataFrame</figcaption></figure><p>Anytime a DataFrame is created in Spark context, it will be distributed across various nodes and can be cached there. And any operations/transformations we do on the DataFrame’s will also be distributed across the worker nodes.</p><p><strong>Grouping by to perform aggregations</strong></p><pre>data_grouped = data_spark.groupby(&quot;id&quot;).count()<br>display(data_grouped)</pre><pre>data_group2 = data_spark.groupby(&#39;id&#39;).agg(pf.sum(&#39;count&#39;))<br>display(data_group2)</pre><pre>data_group3 = data_spark.groupby(&#39;id&#39;).agg(pf.collect_set(&#39;words&#39;).alias(&#39;words_list&#39;))<br>display(data_group3)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2jzKYByzURz-oJuq" /><figcaption>collect_set function to collect all the ‘words’ into a list in a group</figcaption></figure><p><strong>User-Defined Functions</strong></p><p>Spark also provides features for User-Defined Functions that can be used in data manipulation and data analysis. We can write UDF&#39;s to work on each row and generate a single value for each of them.</p><pre>def length_of_words(term):<br>    return len(term.split(&quot; &quot;))</pre><pre>length_of_word_udf = udf(lambda x : length_of_words(x), IntegerType())<br>data_spark = data_spark.withColumn(&#39;length_of_word&#39;, length_of_word_udf(data_spark.column1))</pre><p><strong>Window Functions</strong></p><p>Spark also provides features for Window Functions which can operate on a group of rows (like frame, partition) and return a single value for every input row.</p><pre>w = Window.partitionBy(&#39;id&#39;).orderBy(&#39;value&#39;)<br>data_spark_words_list = dd.withColumn(&#39;words_list&#39;, pf.collect_list(&#39;words&#39;).over(w)).withColumn(&#39;value_list&#39;, pf.collect_list(&#39;value&#39;).over(w))<br>display(data_spark_words_list)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYM65BrIqTqFhlw61oW0uw.png" /><figcaption>Window function to collect all words for each window so far</figcaption></figure><p><strong>Grouped Map Pandas UDFs</strong></p><p>Grouped map Pandas UDFs are designed for split-apply-combine patterns in data analysis, and they operate on all the data for some groups, e.g., “for each ID, apply this operation”. Grouped map Pandas UDFs first splits a Spark DataFrame into groups based on the conditions specified in the Groupby operator, applies a user-defined function (pandas.DataFrame -&gt; pandas.DataFrame) to each group, combines, and returns the results as a new Spark DataFrame. Pandas UDFs optimized and faster for grouped operations.</p><pre>schema = StructType([<br>    StructField(&quot;id&quot;, IntegerType()),<br>    StructField(&quot;words&quot;, StringType()),<br>    StructField(&quot;value&quot;, IntegerType()),<br>    StructField(&quot;total_words&quot;, IntegerType()),<br>    StructField(&quot;mean_subtracted&quot;, IntegerType())</pre><pre>])</pre><pre><a href="http://twitter.com/pandas_udf">@pandas_udf</a>(schema, PandasUDFType.GROUPED_MAP)<br>def subtract_mean(pdf):<br>    return pdf.assign(mean_subtracted=pdf.value - pdf.value.mean())<br>data_pandas_udf = data_spark.groupby(&#39;id&#39;).apply(subtract_mean)<br>display(data_pandas_udf)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ECpVj9YuK5N5so1VS7bXog.png" /><figcaption>Created mean_subtracted column using Pandas UDF</figcaption></figure><blockquote><strong>The best part here is that the data is distributed to all the worker nodes and aggregations are done on big data and results can be achieved efficiently using Spark.</strong></blockquote><p>P.S: The goal of the article is just to show the functionality of Spark and what it offers (with some examples). The data used in this article is a very small one. So if you want to test them out, try them on large-scale datasets.</p><h3><strong>Conclusion</strong></h3><p>Spark is inherently multi-threaded and can make use of all cores of your machine. By breaking down the total amount of work into individual tasks, which then can be processed independently (as soon as each task’s input data is available) in parallel, Spark makes very efficient use of the available cluster resources.</p><p>Spark also scales very well with huge amounts of data. It does not only scale via multiple machines in a cluster, but <em>the ability to spill intermediate results to disk</em> is at the core of the design of Spark. Therefore Spark is almost never limited by the total amount of main memory, but only by the total amount of available disk space.</p><p>The virtually unlimited scalability both in terms of data and processing power makes Spark a <em>distributed and parallel relational execution engine for processing big data.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3327c563c670" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/processing-the-bigg-data-3327c563c670">Processing the BIGG data</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Six Software Skills I Wish I Learned in College]]></title>
            <link>https://medium.com/holler-developers/six-software-skills-i-wish-i-learned-in-college-d3110ec95a63?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/d3110ec95a63</guid>
            <category><![CDATA[internships]]></category>
            <category><![CDATA[skills-development]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[first-job]]></category>
            <dc:creator><![CDATA[Matthew Binshtok]]></dc:creator>
            <pubDate>Thu, 19 Aug 2021 19:00:37 GMT</pubDate>
            <atom:updated>2021-08-19T19:00:37.283Z</atom:updated>
            <content:encoded><![CDATA[<h3>Six Software Skills I Wish I Learned in College CS Courses</h3><p><em>by Matthew Binshtok, Software Engineer, Holler</em></p><p>At the beginning of July, I celebrated two years working at Holler and I used the occasion as a time for self-reflection. Eventually, this led me to consider the technical knowledge and skills that I wish my classes introduced while I was completing coursework at my university. There are bootcamps that cover some of these skills, and during my junior year I participated in one such program. But in my opinion, practical skills like learning to use Github are just as fundamental to a career in computer science or software engineering as knowing how to find the time complexity of an algorithm or understanding how Turing machines work. My hope is that any educators that come across this article try to integrate at least one of these topics into their curriculum, that students find this to be a useful resource to help them prepare for internships and entry-level roles, and that developers keep these topics in mind when mentoring young software engineers.</p><p>Here are the six software engineering skills I wish I learned in my computer science courses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*heMVspPjnU7E8Ex02ATRGQ.png" /></figure><h3>1. Code Reviews</h3><p>In my opinion, this one is a no brainer. For all the emphasis universities place on collaborative work as a part of the curriculum, professors do not explain how to effectively give feedback to your peers, or how to productively receive feedback about your code and learn for the future. Code reviews can help students see new solutions and better understand ideas that transcend any specific project. A benefit of becoming accustomed to the code review process is learning to consider how others will view your code. For junior engineers looking to impress, feedback about their code can often be misconstrued as criticism, when in fact it’s just feedback to help them become better engineers. Because it may be difficult to integrate code reviews into a course, a terrific alternative would be exercises to walk through code, explain concepts encoded to peers, as well as explain any assumptions made. In the wise words of <a href="https://www.youtube.com/watch?v=8SMOB6k3hkM">Uncle Bob</a>, the only valid way to measure clean code is WTFs/minute during a code review…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*vh09WDiuj4jHWXPn7994DA.png" /></figure><h3>2. Debugging</h3><p>print(&quot;wtfffff&quot;, badlyChosenVariableName)</p><p>Any student who has slammed their head on a keyboard at 11:59PM trying to find the mistake in their code will be familiar with the line above. It’s an easy thing to copy and paste throughout your code to assess how a program is behaving and whether or not it aligns with your expectations of how it should run. Those familiar with using debuggers know that they do a lot of this work for you (and more!), but learning to use a debugger can be intimidating. It often takes some system setup unless you’re using a fancy IDE (most students aren’t), and isn’t something that students may see as worthwhile to pick up on their own. Using a debugger effectively is an important skill that universities should teach formally. Even simple exercises like directing students to fix broken code using a debugger will enlighten them to the benefits of using one to step through code and making it a part of their development routine.</p><p>By the way, professional IDEs like JetBrains, and other tools are available for free for students! Check out Github’s compilation of offers for students here: <a href="https://education.github.com/pack">https://education.github.com/pack</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*lCtCN3Pz1VvgCBE7G028Yw.png" /></figure><h3>3. Testing</h3><p>Spending an eternity debugging a large program is avoidable if your code is both well-organized and well-tested. These two concepts can be taught hand-in-hand as good coding practices that help students understand the benefits of investing time in considering the use cases prior to implementing a program. Even within implementation, teaching students to write smaller, independently testable functions starts building good habits. An important side effect of understanding good practice here is learning to think about special circumstances and edge cases as you’re writing code instead of waiting until you’ve completed the implementation. Otherwise, once contributing code in a professional environment, students will discover the cruel truth in Murphy’s law that anything that can go wrong, will go wrong.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2djKeGYqyYttjtNXLZyU1g.png" /></figure><h3>4. Change Management and Deployment</h3><p>For many students, one of the biggest hurdles in starting as a contributor at their first internship or full-time job is learning the basics of Git, Github, version control, and more generally the process by which their code goes from running on their machine to running in production environments. Introducing these concepts in college courses teaches students a few things:</p><ul><li>To keep their code in a working state more frequently</li><li>To view their code as the beginning of a larger pipeline</li><li>To determine how to change their code in ways that can be rolled back later</li><li>To build confidence in functionality before it ends up in production</li></ul><p>Furthermore, there are important practical topics such as CI/CD (continuous integration and continuous deployment) that are very difficult to understand without the basics of change management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*qZEWiI_UaTJxII2nHzJESg.png" /></figure><h3>5. The Cloud and Cloud Service Providers</h3><p>If we’re being honest, there could be an entire course for this topic, but the reality is that most students graduate university without knowledge of the cloud or its capabilities. Among curious and excited CS students, many have an itch to run their programs and applications in a way that other people can access them. Introducing the main services that cloud providers offer and their frequent use cases can catalyze students to explore the possibilities that exist for deploying their projects. The cloud is rapidly evolving, and thus the available technologies are evolving, but that should not deter instructors from providing students with a glimpse of this important space. Here are a few questions that can serve as the foundation for a simple introduction to the cloud:</p><ul><li>What is “the cloud”?</li><li>What are some major public cloud providers?</li><li>How can I allow real users to access my applications?</li><li>What are the most common use cases for the cloud?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*TgrbI_UF7jFlmP_ixxXn-g.png" /></figure><h3>6. Breaking Projects Down</h3><p>Last spring, Holler brought on two interns from my alma mater, Hunter College, as part of the CUNY 2X Tech Talent Pipeline. CUNY 2X Tech is a city-led initiative to double the number of CUNY graduates with CS degrees, and assist them in finding employment in the NYC Tech scene.</p><p>I sat down with the engineering team to brainstorm attainable goals for the interns as part of the overarching theme of preparing them for their future full-time roles, whether it be with us or another organization. Among the goals we drew up for them was one I felt very strongly about: learning to break down large, abstract requests into implementable pieces of work.</p><p>In university coursework, the instructions will say that a submission for a programming assignment has to do a number of highly specific things. It is usually pretty easy to translate those requirements into code. Things are a lot messier in the software industry — the problem statement is not so well-defined and all the requirements are not fleshed out. Aspiring software engineers would benefit from practicing things like:</p><ul><li>Clarifying the problem space and requirements</li><li>Thinking about distinct implementable components</li><li>Defining dependencies on other developers or systems</li><li>Logically sequencing the work that has to be completed</li></ul><p>This is an important step for aspiring software engineers to move from a university setting to a professional setting. The way one completes assignments for a course is inherently different to the way one contributes to continuously evolving projects.</p><p>I spent a lot of time with the interns working through the practices listed above. In the last week of their internship, they received tremendous acclaim from the rest of the company after presenting their projects. I believe that a large part of their success was due to their dedication to understanding and using these organizational principles.</p><h3>Honorable Mentions</h3><p>Before wrapping up, I want to give a special shoutout to two people who helped me brainstorm the skills for this article! Thank you to Maria Mahin of Disney Streaming Services, a fellow 2019 Hunter alum, and Kevin Liang of Hubspot, Northeastern University ’19, for their aid in drafting the list for this article.</p><p>Below is a list of additional topics/skills for which even a brief introduction to these concepts can go a long way in shaping how entry-level engineers think about software development.</p><p><strong><em>1. Containers</em></strong></p><p>What are they and how are they useful? Understanding common technologies for containers and cluster management/deployment would also be beneficial. This is the way of the tech world.</p><p><strong><em>2. Technical Documentation and Design Documentation</em></strong></p><p>In university, the goal is to pass your coursework and show that you know the concepts. In the professional world, technical and design documentation are a pre-requisite for building anything, even if the design is on the back of a napkin.</p><p><strong><em>3. API Development</em></strong></p><p>What is an API? What are some different types? What are best practices to consider when writing one? The RESTful API standard…</p><p><strong><em>4. Web Development</em></strong></p><p>How does the web work? Basic JavaScript, HTML, CSS. What are some common UI component frameworks? What is asynchronous programming?</p><p><strong><em>5. Observability</em></strong></p><p>What do you need to include in production code to make it easier to support that code. Until you have to fix something in the middle of the night, you don’t really have an appreciation for what it takes to make code easier to support.</p><p><strong><em>6. Databases</em></strong></p><p>Best use cases, SQL vs NoSQL, schema design, indexing, performance etc.</p><p><strong><em>7. Best Practices for Writing Clean Code</em></strong></p><p>Emphasizing things like modularity, naming conventions, reusability, separation of concerns, etc.</p><p><strong><em>8. Contributing to an Existing Codebase</em></strong></p><p>Being able to take code that someone else has written, logically trace through its execution, and build from it. Also, best practices to make your code easily extensible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3110ec95a63" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/six-software-skills-i-wish-i-learned-in-college-d3110ec95a63">Six Software Skills I Wish I Learned in College</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intent Detection using Sequence Models]]></title>
            <link>https://medium.com/holler-developers/intent-detection-using-sequence-models-ddae9cd861ee?source=rss----b7d2eb150afd---4</link>
            <guid isPermaLink="false">https://medium.com/p/ddae9cd861ee</guid>
            <category><![CDATA[lstm]]></category>
            <category><![CDATA[sequence-model]]></category>
            <category><![CDATA[intent-detection]]></category>
            <category><![CDATA[text-classification]]></category>
            <category><![CDATA[intent-classification]]></category>
            <dc:creator><![CDATA[Deepak Pandita]]></dc:creator>
            <pubDate>Wed, 16 Jun 2021 20:36:23 GMT</pubDate>
            <atom:updated>2023-11-29T04:26:09.012Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Holler AI Lab at </em><a href="http://holler.io/"><em>Holler Technologies</em></a></p><figure><img alt="Google Nest Mini — A smart speaker from Google which can be controlled by voice" src="https://cdn-images-1.medium.com/max/1024/0*B763A-qGa85k4bP8" /><figcaption>Photo by <a href="https://unsplash.com/@benkolde?utm_source=medium&amp;utm_medium=referral">Ben Kolde</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>Text Classification in Natural Language Processing (NLP) is the task of assigning a class from a set of predefined classes to a given piece of text (document/paragraph/sentence). Popular examples of text classification include spam classification (classifying an email into spam or non-spam), sentiment classification (classifying polarity of text into positive, negative, or neutral), intent detection (identify the intention of the user like play music, book restaurant, book flight, etc.), and news categorization (classifying news articles into categories such as business, sports, politics, science, tech, etc.). If the number of classes is two, the task is called binary text classification and if the number of classes is more than two, then the task is called multi-class text classification.</p><p>In this article, we focus on the problem of intent detection. We first introduce the task of intent detection and the dataset used. Next, we introduce the motivation behind using sequence models and show how they can be used to solve the task of intent detection. We develop our solution in Python using pandas, TensorFlow Keras, and scikit-learn libraries. We won’t delve into the technical explanations of machine learning concepts in the interest of time, however, we will learn how to use them along with a lot of code.</p><h3>Intent Detection</h3><p>Intent detection aims to recognize the intention of the user query i.e. an action that the user wants to perform e.g. “Play music on YouTube Music”, where the intent is to “play music”. The user query is a single sentence and can originate from a written or spoken utterance. Intent detection is a very crucial task in Natural Language Understanding and is usually modeled as a classification problem. Given an input sentence, the objective is to predict an intent for the sentence from a set of predefined intents.</p><h3>Dataset</h3><p>To solve this problem, we need a dataset containing utterances that are labeled with intent. For this article, we use the <a href="https://arxiv.org/pdf/1805.10190v3.pdf">Snips</a> dataset which is a widely used dataset for intent detection benchmarking. It consists of <em>14484</em> utterances across <em>7</em> intent types. The dataset is stored in a JSON file and we start by loading it into a pandas DataFrame and plotting the class distribution.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eeea9689022a0f06bcba4a44ab6c8fc1/href">https://medium.com/media/eeea9689022a0f06bcba4a44ab6c8fc1/href</a></iframe><figure><img alt="Class Distribution" src="https://cdn-images-1.medium.com/max/1024/1*Evs7giE_f4-DWqjOeaNlUw.jpeg" /><figcaption>Figure 1: Class Distribution</figcaption></figure><h3>Data Preparation</h3><p>As shown in Figure 1, the class distribution is balanced. If you’re working on a dataset with severe class imbalance then it might be helpful to balance the dataset. There are various techniques to tackle the class imbalance problem which are out of scope for this article. Now, we split our dataset into train and test sets to train a machine learning model and evaluate its performance. We split the dataset into <em>80%</em> train and <em>20%</em> test using the scikit-learn library. To make sure that we can replicate the results in the future, we also set the RANDOM_STATE variable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a98035b7455ff08fefc534fb69615c00/href">https://medium.com/media/a98035b7455ff08fefc534fb69615c00/href</a></iframe><p>(11587,) (2897,) (11587,) (2897,)</p><h3>Sequence Models</h3><p>Sequence models deal with supervised learning tasks where either model input or model output is a sequence. Sequences can be text, audio, video, temporal data, or any other sequential data. Examples of sequence modeling include sentiment classification, music generation, and machine translation. Recent advances in deep learning particularly in the area of sequence models have revolutionized the world of NLP, thereby establishing themselves as a dominant paradigm for training models for language understanding tasks. Sequence models like <a href="https://en.wikipedia.org/wiki/Recurrent_neural_network">recurrent neural networks</a> (RNNs) and <a href="https://arxiv.org/abs/1706.03762">transformers</a> have consistently achieved state-of-the-art performance on a number of <a href="http://nlpprogress.com/">benchmark NLP tasks</a>. In this article, we use an architecture related to RNNs, <a href="https://en.wikipedia.org/wiki/Long_short-term_memory">long short-term memory</a> (LSTM) to solve the task of intent detection.</p><p>First, we need to prepare our input text for use in training. We tokenize the text and convert it into a sequence of integers by using the Tokenizer from Tensorflow Keras. Then, we pad the sequences to be of the same length for modeling as required by Keras.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b4cd17a3395cda8f10a260cef918ce0/href">https://medium.com/media/8b4cd17a3395cda8f10a260cef918ce0/href</a></iframe><p>(11587, 35) (2897, 35)</p><p>Next, we prepare one-hot vectors for labels by using the LabelEncoder and to_categorical function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c5b9a9e0595874d834d8728dbad17b1/href">https://medium.com/media/3c5b9a9e0595874d834d8728dbad17b1/href</a></iframe><p>(11587, 7) (2897, 7)</p><h3>Training a Sequence Model</h3><p>Let’s define &amp; train our model now.</p><h4>LSTM</h4><p>We define a Tensorflow Keras Sequential model and add layers to it. The first layer is the Embedding layer that is used to represent each word with a vector of fixed length 16. The next layer is the LSTM layer with 16 units with a <em>relu</em> activation. Next, we have a Dense layer with 7 units with a <em>softmax</em> activation for classification. Then, we compile the model with <em>adam</em> optimizer, <em>categorical cross-entropy</em> loss, and evaluate performance metrics like <em>precision</em>, <em>recall</em>, and <em>accuracy</em>. Finally, we fit our model on the training dataset with a batch size of 32 for 7 epochs. We also use <em>10%</em> validation data for the evaluation of performance metrics at the end of each epoch. The fraction of the training data to be used for validation is specified using VAL_SPLIT.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/306957b8338d9bd9a49766fdd3ffa734/href">https://medium.com/media/306957b8338d9bd9a49766fdd3ffa734/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SqCyq8dmIRWzXNWdL3Q-YQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ultI7pey3b4O1-elwz6evA.png" /></figure><p>As the training progresses, we can notice the <em>precision</em>, <em>recall</em>, and <em>accuracy</em> on the training set increasing. The same effect can be noticed in the <em>accuracy</em> on the validation data.</p><h4>Plot Learning Curves</h4><p>Once we fit the model, we look at the learning curves by plotting the loss function for the training data and the validation data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/56f879763ea8b4a96c14e14a02eadcfd/href">https://medium.com/media/56f879763ea8b4a96c14e14a02eadcfd/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6l1Qn05Lbu1frIToM8ZEUQ.jpeg" /><figcaption>Figure 2: Learning Curves</figcaption></figure><p>In Figure 2, we notice the loss on training and validation data to be decreasing continuously and getting more stable with a small gap in-between, therefore, we can conclude that our model is not overfitting or underfitting and is a good fit for the data.</p><h3>Evaluation</h3><h4>Performance on Test Data</h4><p>Now, we evaluate the performance of our model on the test dataset.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aca4cb274e8931426af76903b8fd0c76/href">https://medium.com/media/aca4cb274e8931426af76903b8fd0c76/href</a></iframe><pre>91/91 [==============================] - 0s 3ms/step - loss: 0.1192 - precision: 0.9884 - recall: 0.9724 - accuracy: 0.9821</pre><p>The model achieves a near state-of-the-art accuracy of <em>98.21%</em> on the test set.</p><h4>Classification Metrics</h4><p>We also compute the performance metrics for each class to get a better estimate of model performance.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/955eb34ae32863f439d1ad0cfb688c30/href">https://medium.com/media/955eb34ae32863f439d1ad0cfb688c30/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UZhpsH9fOJfaYnuxhdB2BQ.png" /><figcaption>Figure 3: Classification Report</figcaption></figure><p>As shown in Figure 3, the model is performing well for all classes of intent.</p><h3>Inference using a Sequence Model</h3><p>Finally, we can use our trained model to perform inference.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a6e186ef52deecf45a856dcadd0bd3fe/href">https://medium.com/media/a6e186ef52deecf45a856dcadd0bd3fe/href</a></iframe><p>play_music</p><p>The model correctly predicts the intent <em>“play_music”</em> for the user query <em>“Play music on YouTube Music”</em>.</p><h3>Summary</h3><p>In this article, we learned to use sequence models for intent detection. We introduced the task of text classification with the example of intent detection. We also introduced sequence models and the motivation behind using them for sequence classification tasks. We demonstrated how sequence models can be used to solve the task of intent detection by implementing an LSTM model using TensorFlow Keras in python.</p><p>A Jupyter Notebook containing the code can be found <a href="https://github.com/deepakpandita57/Intent_Detection/blob/main/Intent_Detection_using_Sequence_Models.ipynb">here</a>.</p><h3>Resources</h3><p>If you’re interested in learning more, here are some resources:</p><ul><li><a href="https://towardsdatascience.com/illustrated-guide-to-recurrent-neural-networks-79e5eb8049c9">https://towardsdatascience.com/illustrated-guide-to-recurrent-neural-networks-79e5eb8049c9</a></li><li><a href="https://machinelearningmastery.com/gentle-introduction-long-short-term-memory-networks-experts/">https://machinelearningmastery.com/gentle-introduction-long-short-term-memory-networks-experts/</a></li><li><a href="https://colah.github.io/posts/2015-08-Understanding-LSTMs/">https://colah.github.io/posts/2015-08-Understanding-LSTMs/</a></li></ul><h3>References</h3><ul><li>Coucke, A., Saade, A., Ball, A., Bluche, T., Caulier, A., Leroy, D., Doumouro, C., Gisselbrecht, T., Caltagirone, F., Lavril, T. and Primet, M., 2018. Snips voice platform: an embedded spoken language understanding system for private-by-design voice interfaces. <em>arXiv preprint arXiv:1805.10190</em>.</li><li><a href="https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/">https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/</a></li></ul><p>Thanks for reading! If you have questions or if you would like to see us write on anything, please drop a comment or reach out on <a href="https://sites.google.com/view/deepakpandita/">my website</a>.</p><h4>About Holler</h4><p>Holler is here to make your texts, posts, payments, and DMs more expressive. How? By suggesting the most relevant content — animated Stickers and GIFs– right when you need it the most in chat.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddae9cd861ee" width="1" height="1" alt=""><hr><p><a href="https://medium.com/holler-developers/intent-detection-using-sequence-models-ddae9cd861ee">Intent Detection using Sequence Models</a> was originally published in <a href="https://medium.com/holler-developers">Holler Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>