Skip to content

Instantly share code, notes, and snippets.

View tusharbihani's full-sized avatar

Tushar Bihani tusharbihani

  • Pune
View GitHub Profile

NLTK API to Stanford NLP Tools compiled on 2015-12-09

Stanford NER

With NLTK version 3.1 and Stanford NER tool 2015-12-09, it is possible to hack the StanfordNERTagger._stanford_jar to include other .jar files that are necessary for the new tagger.

First set up the environment variables as per instructed at https://github.com/nltk/nltk/wiki/Installing-Third-Party-Software

@tusharbihani
tusharbihani / PrintThreadIds.java
Created April 5, 2018 17:50 — forked from rednaxelafx/PrintThreadIds.java
find out the correspondence between the tid/nid of Java threads as shown from jstack/JMX, on HotSpot/Linux
package fx.jvm.hotspot.tools;
import java.util.List;
import sun.jvm.hotspot.tools.Tool;
public class PrintThreadIds extends Tool {
public static void main(String[] args) {
PrintThreadIds tool = new PrintThreadIds();
tool.start(args);
@tusharbihani
tusharbihani / AttentionWithContext.py
Created May 11, 2018 14:13 — forked from cbaziotis/AttentionWithContext.py
Keras Layer that implements an Attention mechanism, with a context/query vector, for temporal data. Supports Masking. Follows the work of Yang et al. [https://www.cs.cmu.edu/~diyiy/docs/naacl16.pdf] "Hierarchical Attention Networks for Document Classification"
def dot_product(x, kernel):
"""
Wrapper for dot product operation, in order to be compatible with both
Theano and Tensorflow
Args:
x (): input
kernel (): weights
Returns:
"""
if K.backend() == 'tensorflow':
@tusharbihani
tusharbihani / glibc-2.17_centos6.sh
Created May 17, 2018 14:56 — forked from harv/glibc-2.17_centos6.sh
update glibc to 2.17 for CentOS 6
#! /bin/sh
# update glibc to 2.17 for CentOS 6
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
sudo rpm -Uvh glibc-2.17-55.el6.x86_64.rpm \
@tusharbihani
tusharbihani / RotatingMatrix90DegreesInPlace.java
Created June 8, 2018 11:00 — forked from svpino/RotatingMatrix90DegreesInPlace.java
Programming challenge: rotating a matrix 90 degrees in place
// Programming challenge: rotating a matrix 90 degrees in place
// Original post: https://blog.svpino.com/2015/05/10/programming-challenge-rotating-a-matrix-90-degrees-in-place
public class RotatingMatrix90DegreesInPlace {
private static int[][] matrix = {
{ 1, 2, 3, 4 },
{ 5, 6, 7, 8 },
{ 9, 10, 11, 12 },
{ 13, 14, 15, 16 }
@tusharbihani
tusharbihani / math_expression_learning.py
Created June 10, 2018 16:27 — forked from giuseppebonaccorso/math_expression_learning.py
Mathematica expression learning experiment using a Seq2Seq approach
'''
Mathematical expression learning experiment
Giuseppe Bonaccorso (https://www.bonaccorso.eu)
Based on: http://machinelearningmastery.com/learn-add-numbers-seq2seq-recurrent-neural-networks/
'''
from __future__ import print_function
from keras.models import Sequential
@tusharbihani
tusharbihani / JitBitSQLAnswers.sql
Created March 18, 2019 10:18 — forked from rsepassi/JitBitSQLAnswers.sql
JitBit SQL Interview Questions Answered
-- JitBit SQL Interview Questions (Posted on Hacker News)
-- http://www.jitbit.com/news/181-jitbits-sql-interview-questions/?utm_source=hackernewsletter&utm_medium=email
-- Schema:
-- employees table
-- EmployeeID
-- DepartmentID
-- BossID
-- Name
-- Salary