Skip to content

Instantly share code, notes, and snippets.

View PankajMehar's full-sized avatar
🏠
Working from home

PankajMehar PankajMehar

🏠
Working from home
View GitHub Profile
@PankajMehar
PankajMehar / it-ebooks.md
Created November 9, 2020 07:51 — forked from baiwfg2/it-ebooks.md
Download ebooks as you want
@PankajMehar
PankajMehar / tensorflow-gpu-ubuntu.md
Created October 26, 2018 19:16 — forked from ljaraque/tensorflow-gpu-ubuntu.md
Install tensorflow-gpu in ubuntu

Install tensorflow-gpu1.8 in ubuntu18.04 with CUDA9.2, cuDNN7.2.1 and NVIDIA Driver 396

ljaraque@yahoo.com

Overview

This is a summary of the process I lived in order to enable my system with CUDA9.2, cuDNN7.2.1, Tensorflow1.8 and NVIDIA GEFORCE GTX860M GPU. You can just skip the steps marked with FAILED. I decided to keep them there in order to be useful for others who tried those paths too.

FAILED (Next section is successfull) Install NVIDIA driver (FAILED, THIS WILL INSTALL DRIVER 390 which is not compatible with CUDA9.2):

ubuntu-drivers devices
@PankajMehar
PankajMehar / min-char-rnn.py
Created July 8, 2018 15:45 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)

CoNLL-2003 Shared Task: Language-Independent Named Entity Recognition

The CoNLL-2003 (Sang et al. 2003) shared task deals with language-independent named entity recognition as well (English and German).

Dataset

The CoNLL-2003 shared task data files contain four columns separated by a single space. Each word has been put on a separate line and there is an empty line after each sentence. The first item on each line is a word, the second a part-of-speech (POS) tag, the third a syntactic chunk tag and the fourth the named entity tag. The chunk tags and the named entity tags have the format I-TYPE which means that the word is inside a phrase of type TYPE. Only if two phrases of the same type immediately follow each other, the first word of the second phrase will have tag B-TYPE to show that it starts a new phrase. A word with tag O is not part of a phrase.

The English data is a collection of news wire articles from the Reuters Corpus. The annotation has been done

@PankajMehar
PankajMehar / proportions_of_missing_data_in_dataframe_columns.py
Created March 24, 2018 04:47 — forked from ltfschoen/proportions_of_missing_data_in_dataframe_columns.py
Calculate percentage of NaN values in a Pandas Dataframe for each column. Exclude columns that do not contain any NaN values
# Author: Luke Schoen 2017
import pandas as pd
import numpy as np
import functools
# Create DataFrame
# df = pd.DataFrame(np.random.randn(10,2))
# Populate with NaN values
df = pd.DataFrame({'col1': ['1.111', '2.111', '3.111', '4.111'], 'col2': ['4.111', '5.111', np.NaN, '7.111'], 'col3': ['8', '9', np.NaN, np.NaN], 'col4': ['12', '13', '14', '15']})
@PankajMehar
PankajMehar / useful_pandas_snippets.py
Created November 6, 2017 04:43 — forked from bsweger/useful_pandas_snippets.md
Useful Pandas Snippets
# List unique values in a DataFrame column
# h/t @makmanalp for the updated syntax!
df['Column Name'].unique()
# Convert Series datatype to numeric (will error if column has non-numeric values)
# h/t @makmanalp
pd.to_numeric(df['Column Name'])
# Convert Series datatype to numeric, changing non-numeric values to NaN
# h/t @makmanalp for the updated syntax!