This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import multiprocessing as mp | |
| import string | |
| import spacy | |
| import en_core_web_sm | |
| from nltk.tokenize import word_tokenize | |
| from sklearn.base import TransformerMixin, BaseEstimator | |
| from normalise import normalise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| headers = {'Ocp-Apim-Subscription-Key': '<Your API Key>'} | |
| import aiohttp | |
| import asyncio | |
| import async_timeout | |
| from xml.etree import ElementTree | |
| import math | |
| import backoff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| import json | |
| def recursive(node, title=None): | |
| leaf = {} | |
| if type(node) == list and len(node) > 0: | |
| # print 'Checking list', title | |
| for item in node: | |
| if type(item) == list or type(item) == dict: | |
| child_leaf = recursive(item, title) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {"can't" : "can not", "ren't" : " are not", "what's" : " what is|has|does", "let's" : " let us", "shan't" : " shall not", "'ll" : " will|shall", "I'm" : " I am", "won't" : " will not", "'d" : " had| would", "'re" : " are", "'ve" : " have", "n't" : " not", "'s" : " is|has"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Tue Oct 18 14:15:12 2016 | |
| @author: Roopak K Prajapat roopak.prajapat@gmail.com | |
| """ | |
| from __future__ import print_function | |
| from builtins import zip | |
| import nltk | |
| import re |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Fri Oct 21 17:19:26 2016 | |
| @author: Roopak K Prajapat roopak.prajapat@gmail.com | |
| """ | |
| from __future__ import division | |
| from __future__ import print_function | |
| from builtins import range | |
| from past.utils import old_div |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| isEmpty = function(argument){ | |
| switch(typeof(argument)){ | |
| case "array": | |
| if(argument.length === 0){return true;} | |
| break; | |
| case "object": | |
| if(Object.keys(argument).length === 0){return true;} | |
| break; | |
| case "string": | |
| if(argument.trim().length === 0){return true;} |