Skip to content

Instantly share code, notes, and snippets.

View prakhar21's full-sized avatar
🙇‍♂️
Working

Prakhar Mishra prakhar21

🙇‍♂️
Working
View GitHub Profile
@prakhar21
prakhar21 / nlm.py
Last active February 12, 2019 08:07
Neural Langauge Model
#!/usr/bin/env python
"""
@uthor: Prakhar Mishra
date: Dec, 12 2017
"""
# importing packages
from numpy import array
from keras.preprocessing.text import Tokenizer
from numpy import array
@prakhar21
prakhar21 / swiggy.py
Last active December 13, 2017 12:30
Swiggy Account Analysis
#!/urs/bin/env python
"""
@uthor: Prakhar Mishra
date: Dec, 13 2017
desc: Read URL for more information on the same.
"""
import os
import csv
@prakhar21
prakhar21 / bleu.py
Last active December 25, 2017 08:13
BLEU Score calculation
#!/usr/bin/env python
from nltk.translate.bleu_score import sentence_bleu
def perfect():
machine_translation = "this blog talks about scoring machine translated text"
machine_trans = machine_translation.split()
reference_translation = "this blog talks about scoring machine translated text"
reference_trans = [reference_translation.split()]
score = sentence_bleu(reference_trans,machine_trans)
@prakhar21
prakhar21 / helper.py
Last active January 3, 2018 18:20
Word Cloud Generator
#!/usr/bin/env python
'''
@author: Prakhar
@date: 3rd, January 2018
'''
import os
import time
import random
import re
from slackclient import SlackClient
from keras.applications.vgg16 import VGG16
from keras.preprocessing.image import load_img
from keras.preprocessing.image import img_to_array
from keras.applications.vgg16 import preprocess_input
from keras.applications.vgg16 import decode_predictions
@prakhar21
prakhar21 / cartpole-randomsearch.py
Created May 2, 2018 12:44
Solveing OpenAI CartPole-v0 with Random Search and Weight Initialization
'''
@uthor: Prakhar Mishra
'''
import gym
import numpy as np
env = gym.make('CartPole-v0')
class LinearCombinationPolicy():
@prakhar21
prakhar21 / qlearn_reinforcement.py
Last active May 5, 2018 06:31
Q-Learning Implementation to solve maze escape problem using Reinformcement Learning
'''
@author: Prakhar
Motivation: http://mnemstudio.org/path-finding-q-learning-tutorial.htm
'''
import random
from termcolor import colored
class QLearning:
@prakhar21
prakhar21 / get_cityids.py
Created May 27, 2018 11:19
Get city ids.
#!/usr/bin/env python
import requests
import config
def run():
city_id_mapping = {}
for city in config.CITIES:
parameters = {'q': city}
@prakhar21
prakhar21 / get_collectionids.py
Created May 27, 2018 11:21
Get Collection ids.
#!/usr/bin/env python
import requests
import config
import get_cityids
def run():
collection_id = {}
{
"Delhi": {
"rating": "4.0",
"votes": "553",
"score": 2212.0,
"name": "Jung Bahadur Kachori Wala",
"cuisine": "Street Food"
},
"Bangalore": {
"rating": "4.4",