Skip to content

Instantly share code, notes, and snippets.

View myedibleenso's full-sized avatar

Gus Hahn-Powell myedibleenso

View GitHub Profile
@myedibleenso
myedibleenso / nxmlReaderTests.scala
Created September 16, 2017 18:14
Snippet to test nxmlreader on a subset of PubMed OA
import java.io.File
import scala.util.Random
import ai.lum.common.FileUtils._
import ai.lum.common.RandomUtils._
import ai.lum.nxmlreader.NxmlReader
val rand = new Random(42)
val nxmlDir = new File("/net/kate/storage/data/nlp/corpora/bmgf/OA-100K-sample/data/nlp/corpora/pmc_openaccess/pmc_aug2016/")
val nxmlFiles = nxmlDir.listFilesByWildcard("*.nxml", recursive = true)

Keybase proof

I hereby claim:

  • I am myedibleenso on github.
  • I am ghp (https://keybase.io/ghp) on keybase.
  • I have a public key whose fingerprint is 384E 08B3 A64C F9EB D898 EF72 87D0 46FF EF5F 4EBE

To claim this, I am signing this object:

@myedibleenso
myedibleenso / input-template.tsv
Created October 13, 2016 22:31
A template for produce the tab-delimited input format read by Reach
PMCID SECTION NAME TEXT
import org.clulab.reach.PaperReader
import org.clulab.reach.mentions._
import org.clulab.reach.serialization.json._
import java.io.File
/** Example demonstrating how to serialize/deserialize
* [[org.clulab.reach.mentions.CorefMention]] to/from json
*/
object ReachJSONExample extends App {
import org.clulab.processors.fastnlp.FastNLPProcessor
import org.clulab.processors.Document
import org.clulab.struct.Interval
import org.clulab.odin._
import org.clulab.odin.serialization.json.{JSONSerializer => OdinJSONSerializer, _}
import org.clulab.serialization.json._
import java.io.File
/** Example demonstrating how to serialize/deserialize
# NE rules
- name: "ner-person"
label: [Person, PossiblePerson, Entity]
priority: 1
type: token
pattern: |
[entity="PERSON"]+
|
[tag=/^N/]* [tag=/^N/ & outgoing="cop"] [tag=/^N/]*
@myedibleenso
myedibleenso / tmux_local_install.sh
Last active July 1, 2016 23:01 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.2
# This defines how our entities and events are related to one another semantically
taxonomy:
- ExpandedEntity:
- Entity:
- Nominal:
- Noun
- PossiblePerson:
- Person
- Organization
- Location
#!/usr/bin/env python
# -*- coding: utf-8 -*
try:
# python 3.X
from urllib.request import urlopen, urlretrieve
except:
# python 2.7
from urllib2 import urlopen
from urllib import urlretrieve
@myedibleenso
myedibleenso / gist:b3b2475deaca95fe089971437332757c
Created April 2, 2016 09:18 — forked from syllog1sm/gist:10343947
A simple Python dependency parser
"""A simple implementation of a greedy transition-based parser. Released under BSD license."""
from os import path
import os
import sys
from collections import defaultdict
import random
import time
import pickle
SHIFT = 0; RIGHT = 1; LEFT = 2;