Posts

Showing posts from 2018

Building a chatbot using TF-IDF

Image
Overview: We want to build a basic chatbot which trains on previous messages and responses. In this tutorial we look at the math that we are using to convert the messages and their associated responses into weights using term frequency and inverse document frequency. (tf-idf). Once we have the appropriate weights of words present in messages and responses. We write the messages and responses in vector form of the weight present. We then try to find how similar are these vectors using cosine similarity. We multiply term-frequency and inverse document frequency to obtain the final weight of the word that would be used to construct the vector.   Cosine Similarity: This is a measure of orientation and not magnitude. The reason we are not considering magnitude of the vectors is because the magnitude can be more depending on the length of the query or response associated but that does not tell us about how similar is the query and the messages that we have in our trai

(College Education - 1) Data Analytics for Teachers/Students.

Image
Disclaimer: the views presented in this article are personal.  Initially, I was going to write a rant on how teachers are shit in colleges and continue the age old blame game. In this game, the teachers' think that students are stupid or uninterested and students think that teachers don't know how to teach. It is true (to a certain extent ofc), but the problem is no one ever addresses it. No one thinks of any innovative methods that can be adapted to address what's wrong. Most people (including me) are involved in their own self-interests (includes teachers and students both) and to some extent rightfully so. Before I propose the solution, I would like you to go through my line of thought. Teachers of today feel inclined to play entertainers as compared to knowledge imparters. In this information age which we've become privy to, fuelling curiosity is far more important as compared to imparting knowledge. Students need to be introduced to concepts in a way which m

Installing Anaconda, Running Jupyter on Google Cloud Remotely

I was just using google collab when I realised it cannot really replace a remote server with a GPU. It is super awesome if you are trying to collaborate on a notebook with multiple authors but it does not really provide you the flexibility of terminal. There is certain extent to which "!" can go. Had google collab provided a virtual instance, it would have been super. It is already amazing that they are providing GPUs and TPUs completely free of cost. It is too much to ask to give shell access free too, and it would be hard for them to nail down the activities such as mining or torrenting if they did, thus people would be making money on their hardware meant for educational purposes. This post is about how to setup NGINX along with jupyter notebook. 1.) Let us first install Anaconda by downloading it from here, https://www.anaconda.com/download/#linux Once, you have installed anaconda on your virtual machine, it is time to install and make sure nginx is running. 2.

A happy teachers' day! Startups in Colleges.

This post was made by one of my linkedin connections (Ramesh Kumar). Transcript of that post: - """ Startups by Engineering Students I am glad to see so many Engineering students getting interested in having their startups while studying. And every University has an Entrepreneur wing! There is huge interest, which is good. But, I do not see many startups coming into existence! Why? #1. Focus - They seem to lack focus. They get one 'great' idea today and even before they do something on this, they get 'another greater' idea. And it is a loop. #2. lack of time - They are students and are expected to attend classes, prepare for exams, practicals etc. They may find it difficult to spend more time on their venture. They knew this and can not give this as excuse for shutting down the project. #3. Unrealistic Projects- If they see and experience the pain point of some one and if they find a solution, they are likely to succeed. Many times

Rick Sanchez on School

Image
I'll tell you how I feel about school, Jerry: it's a waste of time. Bunch of people runnin' around bumpin' into each other, got a guy up front says, '2 + 2,' and the people in the back say, '4.' Then the bell rings and they give you a carton of milk and a piece of paper that says you can go take a dump or somethin'. I mean, it's not a place for smart people, Jerry. I know that's not a popular opinion, but that's my two cents on the issue. This is one of those shows that you can rewatch a million times and still find something fascinating. The first time you watch it, you are like "Oh! Is that what it meant.. I think I get it."The second time, you watch it, you are like "holy crap! this is genius". The third time you cannot stop laughing. I think here is what Rick might say about college  " It is petty capitalism rolled up to brainwash student's minds, Jerry. It'ssss *burp* a make-belief world wi

Sacred Games : Short Review

Just completed binge watching the show. It is a great series with amazing plot twists and surprises. It runs in a parallel story of past and present. It is about one man's sins and other man's redemption. You would keep guessing whose sins and whose redumption the plot wants to show you. It tries to play devil's advocate to some measure in Ganesh Gaitonde's charachter potrayal.  Both charachters complemented each other and for some reason skinny short nawaz seems completely beilivable as mafia head. I would give it 9/10 for story. 9/10 for acting and 8.5/10 for direction and cinematagrohy. Some of the scenes were thrilling and action packed. The series would definitely keep you on the edge of your seat. Must Watch.

How to use Redis for caching data in Rails

Why Redis is used? This is a very basic question and it comes because you can do what redis does with postgresql for the purpose of solving the functionality aspect. What redis does is, it stores the key value pair and most of the operations can be executed in O(N) time only (for more information for every command time complexity check the redis documentation). Thus caching enables retrieval of data at much higher speeds and is optimal for tasks such as pub/sub and queries that need quicker access.  Redis Configuration  Initialization - redis/config/ini_redis.rb redis_host = Rails . application . secrets . redis && Rails . application . secrets . redis [ 'host' ] || 'localhost' redis_port = Rails . application . secrets . redis && Rails . application . secrets . redis [ 'port' ] || 6379 # The constant below will represent ONE connection, present globally in models, controllers, views etc for the instance. No need to do

Welcome To ChaturBots

Image

CodeChef Workshop Experience

A little self bragging (About the Author) I have been involved in and enjoyed building projects since a very long time. As of now I am doing my integrated msc mathematics from NIT Surat (aka SVNIT). I have had very little experience with competitive coding problems and the workshop had a lot of new things in store for me. This workshop taught us concepts with problem solving approach which I enjoyed thoroughly. My main aim to attend this workshop was to improve my coding skills and be a more productive/efficient developer than before.  I heard about this workshop through the codechef website and was one of the early bird registratant to it. The workshop was well timed and started 4 days after my end-semester exams, so I packed up my bags left for Hyderabad.  Where? The workshop was conducted at MLRIT (stands for something something Institute of Technology). The campus was not widespread or huge but had some really amazing facilities. It had olympic size indoor badminton sta

Mid Semester Exams are arriving

In one of the leading universities across India, there has been a massive revolution. The students of SVNIT (Seriously Vella National Institute of TimePass) have started to laugh at the professor's jokes. When we reached out to the students and asked them why this sudden degradation in sense of humour, the students were just as clueless as if they have been asked about the topics that they are studying. "Students are just reacting to the stress, this is temporary and would soon go away" we overheard one watchman, talking to another. One of the students named Shashank has already started with the syllabus, when the spokesperson reached out to him he denied all the allegations and vehemently accused our great education system to show his loyalty for the majority. He then quickly disappeared into the abyss of library. Another student Rakesh has also picked up a book, .. no no not the subject book  but the book "Exam Warriors", by our honorable Prime Minister which

Amazon Slay - Available only for prime members.

Amazon has been creating disruptive innovations to get into our mobile phones, bedrooms and now they have hit the highroad with the launch of their new service - Amazon Slay. Amazon Slay provides one day killing service for prime members where as normal users would have to wait longer. It also integrates well with other amazon services such as kindle, echo and bundles with developer ready API. One of the spokesperson with the knowledge of this subject told us that "buyers can choose from hanging, gun or getting beaten to death while ordering the service, as compared to just gunshot offered by their competitors". This was clearly a reference to the service Flipkart Bhai which was started a month ago but has faced a very stiff competition from global players. We tried reaching out to people from Flipkart Bhai but they declined to comment on the issue. Amazon claims that they have managed to improve suicide attempts by whooping 11% and are a one stop service for anyone planning

My experiments on Optimizing Profits in CryptoCurrencies.

Sometimes you just know that something won't work and yet somehow you need to watch it fail just to believe that it won't. Some people may call it a foolhardy attempt but this is the kind of incredulity of men for new ideas until they had good amount of exposure of things often brings disruptive innovation. CryptoCurrency is the new buzzword around town and everyone wants to get their hands dirty.  I decided to give it a shot myself. The idea was simple, get the live feed of cryptocurrency (using binance API) and somehow optimize the algorithm for buying and selling to make maximise profits. Fueled by this idea, I signed up on binance (it is an exchange for trading cryptocurrencies) and got onboard their api platform. Approach #1. I begum hitting the API at an interval of 0.5 seconds and recorded the highs and lows. The point there was a change of slope, I decided to create sandbox transaction. If the slope changes form positive to negative, it is a good time to sell bec