Skip to content

Instantly share code, notes, and snippets.

View ethanjperez's full-sized avatar

Ethan Perez ethanjperez

View GitHub Profile
@joelgrus
joelgrus / ner-openai.jsonnet
Created October 22, 2018 13:59
config file for using the openai token embedder in allennlp
{
"dataset_reader": {
"type": "conll2003",
"token_indexers": {
"tokens": {
"type": "single_id",
"lowercase_tokens": true
},
"token_characters": {
"type": "characters"
@dwf
dwf / gist:1766222
Created February 8, 2012 06:55
Example of how to read a partial NumPy array stored in NPY format off of disk.
"""
Example of how to read a partial NumPy array stored in NPY
format off of disk.
"""
__author__ = "David Warde-Farley"
__copyright__ = "Copyright (c) 2012 by " + __author__
__license__ = "3-clause BSD"
__email__ = "dwf@dwf.name"
import struct
@jehiah
jehiah / lru_cache.c
Created April 3, 2011 21:35
a LRU cache in C using uthash
#include <string.h>
#include <uthash.h>
// this is an example of how to do a LRU cache in C using uthash
// http://uthash.sourceforge.net/
// by Jehiah Czebotar 2011 - jehiah@gmail.com
// this code is in the public domain http://unlicense.org/
#define MAX_CACHE_SIZE 100000