<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Royal Sequeira on Medium]]></title>
        <description><![CDATA[Stories by Royal Sequeira on Medium]]></description>
        <link>https://medium.com/@sequeiraroyal?source=rss-419d5ec564b7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*OWYXq56CyWoFMNM4cRZ5Kw.jpeg</url>
            <title>Stories by Royal Sequeira on Medium</title>
            <link>https://medium.com/@sequeiraroyal?source=rss-419d5ec564b7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:39:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sequeiraroyal/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[ERNIE 2.0: An Article to (hopefully) Answer All Your Questions]]></title>
            <link>https://medium.com/psyai/ernie-2-0-an-article-to-hopefully-answer-all-your-questions-b5df21a64090?source=rss-419d5ec564b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5df21a64090</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[nlp]]></category>
            <dc:creator><![CDATA[Royal Sequeira]]></dc:creator>
            <pubDate>Sat, 07 Sep 2019 15:45:21 GMT</pubDate>
            <atom:updated>2019-09-07T15:52:03.158Z</atom:updated>
            <content:encoded><![CDATA[<h3>ERNIE 2.0: A CONTINUAL PRE-TRAINING FRAMEWORK FOR LANGUAGE UNDERSTANDING</h3><p>Written by <a href="https://medium.com/u/419d5ec564b7">Royal Sequeira</a></p><p>Existing language representation models like word2vec, BERT, XLNet etc., are based on the co-occurrence of tokens or sequences. Language, however, is more complex than that. It contains features that are not captured by just co-occurence counts! ERNIE 2.0 provides a framework to learn to better represent language by using a suite of lexical, syntactic, and semantic pre-training tasks.</p><h3>Background:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cd5voqZDi1OTfhRX" /><figcaption>Multitask Learning</figcaption></figure><p>One of the important tasks in NLP is to learn a generalized representation of language in such a way that it can be used for all the downstream tasks (such as Sentimental Analysis, Named Entity Recognition). Representations learned only on one task, say text classification, may not be useful other tasks such text-pair similarity. One of the ways to attain generalization is to perform multitask learning,</p><p>Multitask learning is learning on a large amount of data across tasks to represent language better. In the figure above, for example, you see an encoder shared across tasks. Each task has its own architecture but will use the same shared encoder to represent language. During the training phase, the first task will be trained on a mini-batch of data corresponding to the first task. Based on the first task loss, the shared encoder will be updated. When the second task is trained, it will use this shared encoder to represent the input sequence from the mini-batch corresponding to the second task, learn on it, and then update the shared encoder based on the loss. Essentially, all tasks take turns to learn on their mini-batch of data, and update the shared encoder based on the loss. The trouble with this approach of multi-task learning is that the weights in the shared encoder can be affected by the introduction of new tasks, leading to catastrophic forgetting (the updates learned from previous tasks are forgotten drastically).</p><blockquote>The objective, however, is to improve on new tasks without forgetting what is learned from previous tasks — just like human beings would not forget skating when they learn how to ski. This is known as Continual Learning.</blockquote><p>Multitask learning is advantageous for two reasons: 1) It acts as a regularizer by forcing the shared encoder learn to generalize for all tasks 2) It can make use of a lot of data across tasks.</p><h3>ERNIE 2.0 Framework</h3><p>The way ERNIE 2.0 addresses the problem of catastrophic forgetting is to train several tasks in parallel, and update the shared encoder based on the average</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jysJpLlM549QJTwC" /><figcaption>Sequential Multitask Learning</figcaption></figure><p>loss from all the tasks:</p><p><strong>Step 1: </strong>Only Task 1 is learned in this step. The input sequence is represented through the shared encoder, and the weights of the encoder are updated on the loss from Task 1.</p><p><strong>Step 2: </strong>The shared encoder is initialized with weights from the previous step, and Task 1 and Task 2 both are learned simultaneously in this step. Since the shared encoder is already learned on Task 1, its loss will mostly be updated with respect to Task 2, thereby retaining what is learned from the previous task.</p><p><strong>Step 3: </strong>Once both tasks are done computing their loss per batch, their average loss will be calculated, based on which the shared encoder will be updated. Both tasks are trained to continue until all the mini-batches are exhausted.</p><p><strong>Step 4: </strong>The shared encoder is initialized with weights from the previous tasks, and Task 1, Task 2, and Task 3 are trained in parallel in this step. Since the encoder is already learned on Task 1 and 2, the loss will mostly be driven by Task 3, helping the encoder to learn represent data from all three tasks.</p><blockquote>Therefore, this is the major contribution of ERNIE 2.0: it provides a framework for continuous incremental multitask learning where you can add your own set of pre-training training tasks.</blockquote><p>Pre-training tasks generally use a large amount of data, and construct unsupervised or weakly-supervised tasks from them. This weakly-supervised data is then used to learn the language representation of the model.</p><p>ERNIE 2.0 also provides a set of pre-training tasks by cleverly constructing a labeled dataset from a large amount of unlabeled data. All the tasks are classification tasks and are framed as follows:</p><p><strong>Word-aware pre-training tasks: </strong>These tasks help the models to learn the word representation better. There are three different tasks under this setting:</p><ul><li><strong>Knowledge Masking Task:</strong> In this setting, a words or a named entity or phrase is masked, and the model classifies the masked word(s) into word from the vocabulary size.</li><li><strong>Capitalization Prediction Task: </strong>The model predicts whether a word is capitalized or not. This is helpful for downstream tasks like Named Entity Recognition.</li><li><strong>Token-Document Relation Prediction Task: </strong>For each word in a segment, say, “A meme is an idea, or a behaviour, ….”, the model tries predict whether the word appears elsewhere in other segments in the original document. The assumption is that if the word does appear in other segments, it must be an important word and might be capturing the theme of the document. This helps the model to learn how important is a word for explaining the document.</li></ul><p><strong>Structure-aware Pre-training Tasks: </strong>These set of tasks help the model learn the relationship between sentences in a document.</p><ul><li><strong>Sentence Reordering Task: </strong>In this task, a paragraph is broken into several segments and are shuffled. The model reorders the shuffled segments into the original paragraph.</li><li><strong>Sentence Distance Task: </strong>The model classifies if two sentences are adjacent to each other, in the same document, or in two different documents.</li></ul><p><strong>Semantic-aware Pre-training Tasks: </strong>In this task, semantics of sentences are learned.</p><ul><li><strong>Discourse Relation Task: </strong>Consider this sentence, “I took my umbrella this morning. <em>[because] T</em>he forecast for rain was in the afternoon”. Here <em>because</em> is the discourse marker. The task is to identify the discourse marker. In the process, the model will have to learn the contrast between the two sentences, and hence their semantics.</li><li><strong>IR Relevance Task: </strong>Given a pair of user query and document, the task is to identify whether the document is strongly-relevant, weakly-relevant, or irrelevant to the user query. The dataset is constructed based on Baidu’s search engine logs. That is, if a user clicked on a document that had query words in its title, it would imply strong relevance. However, if a user did not click on a document despite containing query words, that would imply weak-relevance. Finally, if the document title did not contain query words, it would mean irrelevance. This task helps the model learn the semantics of the query with respect to the document title.</li></ul><h3>Experiments</h3><p>The experiments were conducted on English and Chinese datasets. In order to compare with <a href="https://arxiv.org/pdf/1810.04805.pdf">BERT</a>, two versions of ERNIE 2.0 models are built: base and large. The base and large model uses 48 and 64 NVidia v100 GPU cards respectively.</p><p>For English, tasks from <a href="https://gluebenchmark.com/leaderboard/">GLUE</a> were used. Chinese included 9 different tasks (Reading Comprehension, Sentimental Analysis etc.,). Refer the <a href="https://arxiv.org/pdf/1907.12412.pdf">paper</a> for specific details about the experiments.</p><h3>Results</h3><p>ERNIE 2.0 outperforms BERT and XLNet on <a href="https://gluebenchmark.com/leaderboard/">GLUE</a> with about 3 points improvement in the GLUE score over BERT (83.6). It also outperforms BERT and ERNIE in all the 9 tasks, attaining state-of-the-art results for all tasks.</p><p>Recently, I gave a presentation on <a href="https://arxiv.org/abs/1907.12412">ERNIE 2.0</a> at <a href="https://aisc.ai.science/">AISC, Toronto</a>. This blogpost is based on the paper. Here are the link to the <a href="https://docs.google.com/presentation/d/13HI9YwkZRLhBErElrNAmmWRx9QijveXOorS6p9r7TIA/edit?usp=sharing">slides</a> and the <a href="https://youtu.be/8K1IX7VJ5Fc">presentation</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*7s8kqbMkx0Ncyf1czxxrhw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5df21a64090" width="1" height="1" alt=""><hr><p><a href="https://medium.com/psyai/ernie-2-0-an-article-to-hopefully-answer-all-your-questions-b5df21a64090">ERNIE 2.0: An Article to (hopefully) Answer All Your Questions</a> was originally published in <a href="https://medium.com/psyai">PsyAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Should You Be Worried If You’re Getting Everything Right All the Time]]></title>
            <link>https://medium.com/psyai/why-should-you-be-worried-if-youre-getting-everything-right-all-the-time-5020383abdbb?source=rss-419d5ec564b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5020383abdbb</guid>
            <category><![CDATA[bias]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[confirmation-bias]]></category>
            <category><![CDATA[psychology]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Royal Sequeira]]></dc:creator>
            <pubDate>Wed, 14 Aug 2019 04:05:37 GMT</pubDate>
            <atom:updated>2019-08-16T01:37:36.598Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why You Should You Be Worried If You’re Getting Everything Right All the Time</h3><p>Written by <a href="https://medium.com/u/2eca2e4984ff">Josh Doidge</a> and <a href="https://medium.com/u/419d5ec564b7">Royal Sequeira</a></p><p>Remember the last time you found yourself in the middle of a heated discussion with a friend saying something like, “Paddington Bear is the best movie of all time!” Just when you were about to lose the argument, you managed to pull up a nondescript article from Google that remotely proved your point. Sure, you may have silenced your friend into a confused stupor, but were you really right? We’ve noticed in our research and studies that people <em>think they are right all the time</em>. We think this is a disconcerting trend, and something that requires your attention.</p><p>Humans, by nature, have inherent biases. Biases (or heuristics) are rules of thumb or shortcuts we use. Unlike certain rules of thumb, biases contain systematic errors in our decision making and judgments as well as remembering our past and emotions. We use biases to simplify and understand the infinitely complex world. In the process, we fall prey to them because of our limited cognitive resources<em>, which </em>get used up very quickly. While there is nothing illogical about using heuristics and biases, these biases can close us off to what’s really happening in the world.</p><p>One bias that is particularly important in clinical psychology is called the <em>confirmation bias</em>. Confirmation bias is where you look for information that already confirms the theory or existing beliefs you have. Confirmation bias is particularly deadly <em>because we never seek information that disproves our belief</em>s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bxp5DjVyGt3Co94FA2erEg.jpeg" /></figure><p><a href="https://en.wikipedia.org/wiki/Jean_Piaget">Piaget</a>, one of the most influential developmental psychologists of all time, had a theory of assimilation and accommodation for how we represent the world. Assimilation involves incorporating new information or experience into an existing framework or existing ideas. Accommodation is the opposite: it is the process by which old ideas or schemas are altered, or new schemas are developed as a result of new beliefs. In order to function in the world, we need both assimilation and accommodation.</p><p>A person who believes they get everything right is a person who no longer engages in any active serious accommodation, and they seek to hear the same story over and over. We tend to rely heavily on confirmation bias while forming our narratives. Have you ever come up with a story that explains all the tragedies and imagined tragedies that befall you in your life? Even as your friends and loved ones challenge you about some part of the narrative or try to poke holes in it, you insist that it is immutable? This would be an example of confirmation bias as well as assimilation.</p><p>Confirmation bias makes it hard for people to learn new things, gain insight into themselves, or other people because they just seek information they already know. They might also choose to hang out with people with the same political views or ideology, to confirm what they already know and believe. We see this so often in a fractured polarized political sphere: Left vs Right. Confirmation bias leads us to minimize the issues and the imperfections of our own theories and beliefs, but this cannot lead to real conversation or engagement.</p><p>Can Artificial Intelligence help us overcome confirmation bias? With advances in Artificial Intelligence, you might wager that an AI system, more intelligent than humans, would be able to solve the confirmation bias problem. That is, in the hypothetical future, we might trust an unbiased agent to arbitrate our minds’ conundrums. This type of agent needs to have two desirable properties: a higher form of intelligence than humans and impartiality. But, can an AI agent possibly be unbiased?</p><p>Before we can answer that question, we must briefly review how AI systems currently work. All AI agents (also known as models) either teach themselves how to perform a task, or are trained by human beings. The former type of learning is called unsupervised learning, and the latter is known as supervised learning. To differentiate these two forms of learning, consider the task of classifying whether a tumour is benign or malignant. In a supervised learning setting, a human expert (a radiologist in this case), labels a series of tumour images as malignant or benign. In an unsupervised learning setting, the agent looks at a series of images and autonomously learns whether an image is benign or not.</p><p>Generally, unsupervised learning is preferred over supervised learning as it does not require a manual labelling process. Manual labelling can be very expensive since it requires domain expertise. Moreover, it can also induce human biases, and therefore an unsupervised learning is preferred for tasks that are sensitive to bias.</p><p>How do we know whether an AI agent is performing well on the given task? A performance metric (such as accuracy and speed) always accompany a given task. The changes in the metric serve as a feedback mechanism for the agent to perform better on the task. The metric, however, can turn out to be a problem. <a href="https://en.wikipedia.org/wiki/Goodhart%27s_law">Goodhart’s law</a> states that “when a metric becomes the target, it ceases to be a good metric”.</p><p>In our daily lives we see examples that adhere to this law: sales people trying to sell products at higher discounts so as to meet their monthly targets or students memorizing text without understanding it so as to score well on a test.</p><p>AI models are not an exception to this law either. In supervised learning, supposing that 99% of the tumours in the labelled dataset are benign, the model might learn to predict all tumours to be benign. Although this model is foolish, it is extremely accurate! Since we care more about correctly identifying malignant tumours, this “all-benign” model will serve no practical purpose.</p><p>Similarly, in the unsupervised learning setting, a model might selectively pick data points that helps it achieve a higher performance metric. If it is known that in the real-world, 99% of all tumours are benign, the model might discard all instances of malignant tumours in the dataset. It might selectively pick benign cases of tumours so as to attain a higher performance metric in the real world, thereby inducing confirmation bias into the system. Even in an ideal unsupervised learning setting, the agent can demonstrate confirmation bias.</p><p>Confirmation bias is harmful for so many of us because it prevents us from updating our model of the world. An actual map of the world is almost never an accurate representation of the world’s terrain. A good cartographer understands that the mapping is not the same as the actual forests, oceans, and mountains, and will seek to improve the model by facing what they got wrong. A lazy cartographer, seeking to confirm their bias, will simply find reasons why their model is right.</p><p>Don’t get us wrong! We all want to get our models right all the time. But chances are if you have a model that is predicting something with 100% accuracy, it is not accounting for certain types of data or information. The model likely does not adequately look at information that disconfirms itself, either. This is why it is so important to get the model right most of the time and be okay with being wrong some of the time</p><p>Currently, the Artificial Intelligence community addresses the bias problem by evaluating a model on several metrics. Yet, biases can still find their way into models through various sources, such as the origin of the dataset or the choice of metrics (humans still get to decide the metrics!). At the same time, as AI models are becoming more advanced, they are also becoming increasingly uninterpretable. If we can’t interpret the model, we might never know if it has become truly unbiased.</p><p>What we can do, however, is be aware of our confirmation biases and learn to avoid them. As the age-old aphorism goes, “know thyself!”. One of the most effective problem-solving strategies, or ways to improve on an argument, while looking at the world more effectively, is seeking out information <em>for why you are wrong</em>. Or seeking out <em>information to disconfirm your hypothesis not just confirm</em> it. Doing this simple step can be <em>life-altering.</em></p><p>If you’re a person willing to disconfirm your beliefs, your theories, and accept you are not right about everything (the wisdom traditions call this humility), your models will adapt in manageable ways allowing you to make small important changes that can bring about a big difference in your life!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5020383abdbb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/psyai/why-should-you-be-worried-if-youre-getting-everything-right-all-the-time-5020383abdbb">Why Should You Be Worried If You’re Getting Everything Right All the Time</a> was originally published in <a href="https://medium.com/psyai">PsyAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tu Konkani Ulaytai: Language Identification with Machine Learning]]></title>
            <link>https://medium.com/@sequeiraroyal/tu-konkani-ulaytai-language-identification-with-machine-learning-1d65184f80ff?source=rss-419d5ec564b7------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d65184f80ff</guid>
            <category><![CDATA[nlp]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[classification]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[language-identification]]></category>
            <dc:creator><![CDATA[Royal Sequeira]]></dc:creator>
            <pubDate>Sat, 11 May 2019 04:43:41 GMT</pubDate>
            <atom:updated>2019-05-15T03:18:26.006Z</atom:updated>
            <content:encoded><![CDATA[<p>There is something humbling about seeing machines perform tasks that are not easy for humans. Tasks like object detection, although very pervasive in Computer Vision, are pretty bland in comparison with human capabilities. Try giving someone a sentence in Zulu, and see if they can guess the source language.</p><h3>1. Background</h3><p>Imagine you want to google the meaning of the phrase — <em>je vous en prie</em>. Now, before running any Natural Language Processing (NLP) activity, Google would have to identify the source language of the input text, so that it can surface relevant results. Arguably, language detection is the primary step of any NLP activity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/0*YWQC95MVUegNANWI" /></figure><p>Before we dive into the actual discussion of how to identify the source language of an input text, we must first move our attention to this age-old quest of classifying whether an image is chihuahua or a muffin? (my favourite<a href="https://www.youtube.com/watch?v=LACbVhgtx9I"> muffin song</a>).</p><p><strong>Task:</strong> It’s very simple! I give you an image, classify it as a chihuahua or a muffin. We call this a <strong>classification </strong>task in Machine Learning. Duh!</p><p><strong>Classes: </strong>What are we classifying between? In this case, it is chihuahua and muffin. Since there are two classes, we call this a <strong>binary classification </strong>problem.</p><p><strong>Dataset: </strong>A set of images labelled either with chihuahua or muffin.</p><p>By extension, we can treat the language identification task as a classification task. That is, instead of identifying the language of a sentence, we classify the sentence as either English, French, German, and so on. In contrast to the chihuahua-muffin conundrum, this is a <strong>multiclass-classification </strong>problem as there are more than two classes (the set of languages).</p><h3>2. Feature Engineering</h3><p>Understanding images and sentences is an easy task for humans; whereas, a computer can only understand numbers. The numerical representation of a datapoint (image or sentence) is called <strong>features </strong>and the process of designing features is called <strong>Feature Engineering</strong>.</p><p>So, in plain English features are images or sentences in numbers! I tend to think of them as barcodes: barcodes corresponding to two chihuahuas would be very similar, and would be different from a muffin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/0*58Tx_C-aQDe-v6AQ" /></figure><p>Consider this image of cat. To help the system understand what a cat looks like, you would design features that capture the boundary of a cat, boundary of patches, distribution of colours etc. In traditional Machine Learning, it is very important what features we choose as they determine the effectiveness of the model.</p><h3>3. Models</h3><p>What is a model? For now, think of a model as a black box that inputs a feature (numerical representation) of a datapoint, does some processing, and outputs a class. For the chihuahua-muffin classification, the model inputs say, chihuahua features, and output “chihuahua”. Similarly, in the case of language identification, a model takes sentence features as its input, and outputs the language of the input sentence (English, French, German etc.).</p><h3>Language Identification Game</h3><blockquote>As I said earlier, it is very important to come up with the right features as it determines the performance of the model. A best practice while designing any models is to ask ourselves, “how do humans do it?”</blockquote><p>So, here is a challenge for you. Try to guess the language of the following sentence:</p><blockquote><strong>Level 0: <br></strong>他出生并成长于<a href="https://zh.wikipedia.org/wiki/%E7%B4%90%E7%B4%84%E5%B7%9E">紐約州</a><a href="https://zh.wikipedia.org/wiki/%E7%B4%90%E7%B4%84%E5%B8%82">紐約市</a><a href="https://zh.wikipedia.org/wiki/%E7%9A%87%E5%90%8E%E5%8C%BA">皇后区</a>，为<a href="https://zh.wikipedia.org/wiki/%E7%89%B9%E6%9C%97%E6%99%AE%E9%9B%86%E5%9C%98">特朗普集團</a>前任<a href="https://zh.wikipedia.org/wiki/%E8%91%A3%E4%BA%8B%E9%95%BF">董事长</a>兼<a href="https://zh.wikipedia.org/wiki/%E7%B8%BD%E8%A3%81">總裁</a>及特朗普娱乐公司的創辦人，在全世界经营<a href="https://zh.wikipedia.org/wiki/%E6%88%BF%E5%9C%B0%E4%BA%A7">房地产</a>、<a href="https://zh.wikipedia.org/wiki/%E8%B5%8C%E5%9C%BA">赌场</a>和<a href="https://zh.wikipedia.org/wiki/%E9%85%92%E5%BA%97">酒店</a><a href="https://zh.wikipedia.org/wiki/%E5%94%90%E7%B4%8D%C2%B7%E5%B7%9D%E6%99%AE#cite_note-14">[註 4]</a>。</blockquote><p>I’m sure you guessed Mandarin! Good job! You must have got it correctly by looking at those amazing Hanzi characters! How about this one? (I left some clues to help you out!)</p><blockquote><strong>Level 1:<br></strong>Il Palazzo Ducale, anticamente anche Palazzo Dogale in quanto sede del <a href="https://it.wikipedia.org/wiki/Doge">Doge</a>, uno dei simboli della città di <a href="https://it.wikipedia.org/wiki/Venezia">Venezia</a> e capolavoro<strong> </strong>del <a href="https://it.wikipedia.org/wiki/Gotico_italiano">gotico veneziano</a>, è un edificio <strong>che</strong> sorge nell’area monum<strong>entale</strong> <strong>di</strong> <a href="https://it.wikipedia.org/wiki/Piazza_San_Marco"><strong>piazza</strong> San Marco</a>, nel <a href="https://it.wikipedia.org/wiki/Sestiere_di_San_Marco">sestiere di San Marco</a>, tra l’omonima <a href="https://it.wikipedia.org/wiki/Piazzetta_San_Marco">piazzetta</a> e <strong>il</strong> <a href="https://it.wikipedia.org/wiki/Molo_di_Palazzo_Ducale">molo di Palazzo Ducale</a>, contiguamente alla <a href="https://it.wikipedia.org/wiki/Basilica_di_San_Marco">basilica di San Marco</a>. <strong>Pizza</strong>!</blockquote><p>If you guessed Italian, pat your back! You might have now considered words like <em>il</em>, <em>che, piazza </em>to arrive at this decision.</p><blockquote><strong>Level 2:<br></strong>Ang Zen, <strong>masarap ang manok sa Jollibee</strong>, na maaari ring isulat bil<strong>ang</strong> Sen o Tsen, <strong>ay</strong> is<strong>ang</strong> <a href="https://tl.wikipedia.org/w/index.php?title=Paaralan_ng_Budismo&amp;action=edit&amp;redlink=1">paaralan</a> ng <a href="https://tl.wikipedia.org/wiki/Budismo">Budismong</a> <a href="https://tl.wikipedia.org/wiki/Mahayana">Mahayana</a> <strong>na</strong> nagmula <strong>sa</strong> Tsina noong ika-6 na daantaon CE bilang <a href="https://tl.wikipedia.org/w/index.php?title=Intsik_na_Ch%C3%A1n&amp;action=edit&amp;redlink=1">Chán</a>.</blockquote><p>Now, at this level, it becomes a slightly hard task. The characters don’t help us anymore, neither do words. Don’t be disheartened; we can indeed find solace in character clusters. Turns out -ang suffixes are very common in Tagalog!</p><blockquote><strong>Level 3:<br></strong>Wen will u die?</blockquote><p>If you guessed German, here’s your second chance to look again! Although individually the words are perfectly German, as a whole, the sentence is not German but is in English! That is, a group words offer more meaning than when they are processed individually.</p><p>To be honest with you, I fabricated the above utterance to prove a point, but the Internet is replete with such collective sloth: it is not uncommon to see night spelled as 9t!</p><p>To summarize, the four important features are: characters, words, clusters of characters, and clusters of words.</p><h3>Selecting Informative Terms</h3><p>Consider a very common word <em>main</em> in English, which translates <em>hand </em>in French, another common word. Similarly, most common unigrams (<em>i</em>, e, …), bigrams (<em>tu</em>, <em>on</em>, …), trigrams (<em>wen</em>, <em>die</em>, …) are valid words in several languages. Therefore, based on the language we need to weight words such that more informative words get higher weights. This weighting mechanism is called <a href="https://en.wikipedia.org/wiki/Tf%E2%80%93idf">tf-idf</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*HzD5p7bw5d4seMLo" /></figure><p>For demonstration, you can see that the most frequent terms (first column) are not very informative. Also, the rarest words (second column) do not convey much meaning. The measure tf-idf combines both of these aspects and finds the most informative words.</p><p>Once the input sentences are numerically represented using the above approaches, they are fed into a model. In the next part of this blog, we will go into the details of how these numbers are generated. For now, you can imagine all the red points in the following image to be French sentences, and the blue dots to be English sentences.</p><p>The model, still a blackbox, learns a hyperplane (a plane in higher-dimension) to separate between the sets of these data points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*4IdTiAOBURbUDUhV" /></figure><p>This blog is based on the presentation I gave at <a href="https://www.meetup.com/Women-Who-Code-Toronto/events/260882877/">Women Who Code Toronto Meetup</a>. Here is the link to the <a href="https://docs.google.com/presentation/d/1AEyc8ZgTLzYO0hNw1MYo0S8a9V3w-MaVoTQaEdMP5Wc/edit#slide=id.g51450bdf07_0_0">slides</a>. In the next part of this blog, I will go through a Jupyter notebook, and will explain the implementational details.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d65184f80ff" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>