Aditya Chatterjee's Blog, page 187

November 20, 2020

Wildcard Pattern Matching (Dynamic Programming)

You are given a string and a pattern as the input, the pattern contains some wildcard characters such as '*' & '?'. Here '?' can match to any single character in input string and * can match to any number of characters including zero characters. We have to report the answer in form of "yes" if the pattern matches the string else report and "no" if it does not matches.


We will be using a Dynamic Programming approach with the time complexity of O(m * n), here m and n represent length of string and...

 •  0 comments  •  flag
Share on Twitter
Published on November 20, 2020 17:32

SHA1 Algorithm (+ JavaScript Implementation)

SHA1 (SHA here stands for Secure Hashing Algorithm) is a cryptographic algorithm that belongs to a class of algorithms called cryptographic hash functions. Hash functions take the “message” as input, and churn out a fixed sized hash (called a “message digest”) as output. These functions differ from cryptographic encryption functions both in their intended use cases and their properties.


Encryption functions are used to secure data before transmission. The encrypted message, called ciphertext, is...

 •  0 comments  •  flag
Share on Twitter
Published on November 20, 2020 14:34

November 19, 2020

Filtering spam using Naive Bayes

Nearly everybody has a smartphone today and a lot of people have an email or two. This means one will be familiar with lots of messages that give a lot of cash, amazing lottery wins, wonderful gifts and life secrets. When you use well-trained filters, we get thousands of spam messages daily. They can be detrimental, only distracting or space-consuming, but they can also involve viruses or fishing attempts. It is not in any event, the material that we want to deal with. So there is still a strong...

 •  0 comments  •  flag
Share on Twitter
Published on November 19, 2020 09:24

November 18, 2020

Capitalize letters in Python

Python has many built-in methods that perform operations on strings. One of the operations is to change the case of letters. We'll see different ways to change the case of the letters in a string, and go through many examples in each section, and finally go through some of the applications.


Python strings are immutable, which means that once created these strings cannot be modified. As a consequence, most of the functions that operate on strings actually return a modified copy of the string; the...

 •  0 comments  •  flag
Share on Twitter
Published on November 18, 2020 13:16

Disadvantages of GANs || Am I real or a Trained Model to write?


Technology is certainily growing at its highest pace, you'll be amazed after reading this article!



You might have already heard about generating the clone of a person or copying anybody's voice? Or if you're familiar with recent news, you must have seen how China has created artificial news anchor for reporting!


How are these things getting possible? What working technology is behind these advancements?


This is nothing but growing pratical use of Generative Adversial Networks (GANs). GANs is a...

 •  0 comments  •  flag
Share on Twitter
Published on November 18, 2020 12:39

Elastic Net Regularization

Elastic Net Regularization is a regularization technique that uses both L1 and L2 regularizations to produce most optimized output. This is one of the best regularization technique as it takes the best parts of other techniques.


We have started with the basics of Regression, types like L1 and L2 regularization and then, dive directly into Elastic Net Regularization.


What is Regression ?

Regression is a statistical method of estimating the relationship between a dependent variable and series of o...

 •  0 comments  •  flag
Share on Twitter
Published on November 18, 2020 12:29

November 15, 2020

BERT and SEARCH: How BERT is used to improve searching?

bert-traveler-example-feature-snippet-800x463


Search Engine is a technology which ranks pages across the Internet according to some rule. The page it shows to a user depends on the query the user searched. Query is in the form of text. So, in order to understand this text, search engine first need to understand what the user want to search. This is very difficult as any language that is there, is not definitive. One thing can be represented in a language in many ways. This makes it very difficult to understand the query. Over the years, th...

 •  0 comments  •  flag
Share on Twitter
Published on November 15, 2020 16:32

Finding Diameter of a Tree using DFS

In this article, we will be discussing how to find the diameter of a tree or in general a graph. The algorithm that we will be using to find the diameter of the tree is Depth first search.


if you are unfamiliar with depth first search (DFS), I would first suggest you to go through this article before proceeding: https://iq.opengenus.org/depth-first-search/


What is Diameter of a tree ?

Diameter of tree is defined as the no. of nodes in the longest path between leaf nodes nodes of a tree ( undire...

 •  0 comments  •  flag
Share on Twitter
Published on November 15, 2020 08:30

Diameter of a Binary Tree

In this problem, we are given input as the reference to the root of a binary tree. We need to find the diameter of the tree. We solve this using two approaches:



Approach 1: Using recursion
Approach 2: Using DFS

A tree is an extensively used data structure in the world of programming. Every node in a tree can have more further subdivisions. The bottom-most nodes of a tree that have no sub-divisions, are called the leaf nodes.


DIAMETER OF A TREE: It is defined as the number of nodes on the longe...

 •  0 comments  •  flag
Share on Twitter
Published on November 15, 2020 07:13

Introduction to Multilingual BERT (M-BERT)

In the previous article, we discussed about the in-depth working of BERT for Native Language Identification (NLI) task. In this article, we explore what is Multilingual BERT (M-BERT) and see a general introduction of this model.


Introduction

image-16-1


Deep learning has revolutionized NLP with introduction of models such as BERT. It is pre-trained on huge, unlabeled text data (without any genuine training objective). However, BERT was trained on English text data, leaving low-resource languages such as Ic...

 •  0 comments  •  flag
Share on Twitter
Published on November 15, 2020 06:02