Skip to content

Instantly share code, notes, and snippets.

View mayurbhangale's full-sized avatar

Mayur Bhangale mayurbhangale

View GitHub Profile
@mayurbhangale
mayurbhangale / init_nlp.sh
Created May 8, 2019 06:01
Initialize Conda NLP Environment with absolutely necessary packages
# curl -L mini.conda.ml | bash
source ~/.bash_profile
conda create --name nlp python=3.6
source ~/.bash_profile
conda activate nlp
pip install spacy
conda install tensorflow
conda install -c pandas
conda install -c jupyter
pip install textacy
import xml.etree.ElementTree as ET
import pandas as pd
tree = ET.parse('Restaurants_Train.xml')
root = tree.getroot()
labeled_reviews = []
for sentence in root.findall("sentence"):
entry = {}
if sentence.find("aspectTerms"):
@mayurbhangale
mayurbhangale / docker-compose.yml
Created July 13, 2019 05:28
Janusgraph, Scylla and Elasticsearch
version: '4'
# As of JanusGraph 0.4.0, up to Cassandra 3.11 and Elasticsearch 6.x
# are supported.
#
# Here's the compatibility matrix:
# https://docs.janusgraph.org/latest/version-compat.html
#
# Here's the compatibility data for ScyllaDB:
# http://docs.scylladb.com/using-scylla/cassandra-compatibility/
@mayurbhangale
mayurbhangale / ant_killer.py
Last active September 24, 2019 11:35
Kills ants stuck inside your laptop
from multiprocessing import Pool
from multiprocessing import cpu_count
def f(x):
while True:
x*x
if __name__ == '__main__':
processes = cpu_count()
pool = Pool(processes)