Skip to content

Instantly share code, notes, and snippets.

View ravenscroftj's full-sized avatar

James Ravenscroft ravenscroftj

View GitHub Profile
@ravenscroftj
ravenscroftj / initgroupgit.sh
Created January 20, 2012 10:11
Initialise a shared git repository in BASH
#!/bin/bash
if [ $# -lt 2 ]
then
echo "Usage: $0 <path/to/repository> <GitGroupName>"
exit 0
fi
#make the directory
mkdir $1
for i in range(100000000):
print(i)
pub fn testfn(){
info!("I am a tree");
}

Keybase proof

I hereby claim:

  • I am ravenscroftj on github.
  • I am ravenscroftj (https://keybase.io/ravenscroftj) on keybase.
  • I have a public key ASAytjzPSSzbpBFFSqymW2A-iAEwLc6PFVkpz9TUfsNpigo

To claim this, I am signing this object:

from __future__ import print_function
import elasticsearch
from itertools import chain
#scroll pointer timeout in minutes 1 minute is usually fine but you can increase if you get timeout errors
TIMEOUT = "1m"
def scrollr(client, scroll_id, f):
class WatsonSTT(AbstractSTTEngine):
""" Watson Speech-To-Text implementation
"""
SLUG = "watson"
def __init__(self, app_username, app_password):
self._logger = logging.getLogger(__name__)
self._session = None
self._cookies = []
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Citation classifier excite\n",
"\n",
"\n",
"GIT repo: `git clone git@nopro.be:james/excite.git` \n",
import csv
import sys
import argparse
import random
def main():
ap = argparse.ArgumentParser(description="Split your NLC groundtruth into test and train data")
ap.add_argument("gtfile", help="Ground truth CSV file")
@ravenscroftj
ravenscroftj / unpaywall.py
Created April 13, 2018 15:50
Python Unpaywall Wrapper
"""
Simple function wrapper for the unpaywall API.
"""
import requests
YOUR_EMAIL = "test@gmail.com" # you should put your own email address here
def unpaywall(doi, retry=0, pdfonly=True):
"""Find legal open access version of paper"""
@ravenscroftj
ravenscroftj / train.py
Created December 29, 2020 14:22
MLFlow + NLP Training script using TFIDF and Random Forest on 20 newsgroups
#!/usr/bin/env python
# coding: utf-8
import mlflow
import mlflow.sklearn
import json
import os
import tempfile
import pandas as pd