Skip to content

Instantly share code, notes, and snippets.

{
"dataset_reader": {
"type": "conll2003",
"tag_label": "ner",
"token_indexers": {
"tokens": {
"type": "single_id",
"lowercase_tokens": true
},
"token_characters": {
@dimidd
dimidd / download.hs
Last active August 7, 2018 17:58
download hs
#!/usr/bin/env stack
-- stack --resolver lts-12.0 script
import Network.HTTP.Simple (parseRequest, httpLbs, getResponseBody)
import qualified Data.ByteString.Lazy as BL (writeFile)
import System.Environment (getArgs)
import Data.Foldable (for_, traverse_)
import Control.Concurrent.Async
-- Get the following program working to download the 4 URLs and save
-- their contents in the given files.
import nbformat
import functools
import sys
def get_key(obj, key):
if isinstance(obj, dict):
return obj.get(key, None)
elif isinstance(obj, (list, tuple)) and key < len(obj):
return obj[key]
@dimidd
dimidd / my_first_cell_in_ipynb.py
Created October 8, 2020 03:51 — forked from DalyaG/my_first_cell_in_ipynb.py
Copy paste this to your first cell in Jupyter Notebook to have wide cells, wide outputs, and inline plots.
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:95% !important; }</style>"))
display(HTML("<style>.output_result { max-width:90% !important; }</style>"))
import numpy as np
np.set_printoptions(precision=3)
np.set_printoptions(linewidth=170)
np.set_printoptions(suppress=True)
np.random.seed(42)
// ==UserScript==
// @name cal_anchors
// @version 1
// @grant none
// @include http://cal.huc.edu/*
// ==/UserScript==
const queryString = window.location.search;