Skip to content

Instantly share code, notes, and snippets.

View malaikannan's full-sized avatar
:octocat:
Focusing

Malaikannan Sankarasubbu malaikannan

:octocat:
Focusing
  • San Francisco, CA
View GitHub Profile
# Python 3 program to build Bloom Filter
# Install mmh3 and bitarray 3rd party module first
# pip install mmh3
# pip install bitarray
import math
import mmh3
from bitarray import bitarray
class BloomFilter(object):
@malaikannan
malaikannan / TamilSpellchecker.py
Created May 23, 2020 15:37
Tamil Spell Checker
import os
import traceback
from bloomfilter import BloomFilter
import jellyfish
edit_distance = 2
tamil_unique_words_file_path = "tamilwordlist.txt"
bloom_filter_file_path = "tamil_bloom_filter.txt"
def read_tamil_words_listfile(tamil_unique_words_file_path):
import requests
from bs4 import BeautifulSoup
import tamil
import os
from bloomfilter import BloomFilter
# URL for Project Madurai
base_url = 'https://www.projectmadurai.org'
bloom_filter_file_path = "tamil_bloom_filter.txt"
USER INPUT NODE
I can tell you Chuck Norris jokes that you can hear, even with your ears closed.
TOPIC SELECTOR NODE
Two topics 1) Greetings 2) Chuck Norris Jokes
Greetings
@malaikannan
malaikannan / Currency Converter Bot Tutorial
Last active March 17, 2017 23:53
Content for the Currency Converter Bot in the tutorial video here: https://www.youtube.com/watch?v=9cDtY_IH_Do&feature=youtu.be
USER INPUT NODE
Welcome message: Hi! I can help you convert from one currency type to another.
TOPIC SELECTOR NODE
Greeting:
Hello
Hi
(X_train, y_train), (X_test, y_test) = mnist.load_data()
# plot 4 images as gray scale
plt.subplot(221)
plt.imshow(X_train[20], cmap=plt.get_cmap('gray'))
plt.subplot(222)
plt.imshow(X_train[23], cmap=plt.get_cmap('gray'))
plt.subplot(223)
plt.imshow(X_train[42], cmap=plt.get_cmap('gray'))
plt.subplot(224)
plt.imshow(X_train[54], cmap=plt.get_cmap('gray'))
import os
os.environ['KERAS_BACKEND'] = 'tensorflow'
import keras
import matplotlib as plt
from keras.datasets import mnist
import matplotlib.pyplot as plt
0.468534325458
0.464193701547
0.459686450749
0.454970093343
0.450008466033
0.444771502862
0.439235147048
0.433381398721
0.42719846303
0.42068094941
#update weights
synapses_1 += l1.T.dot(l2_delta)
synapses_0 += l0.T.dot(l1_delta)
print "Output after training"
print l2
l1_error = l2_delta.dot(synapses_1.T)
l1_delta = l1_error*sigmoid(l1, derivative=True)