Skip to content

Instantly share code, notes, and snippets.

View myedibleenso's full-sized avatar

Gus Hahn-Powell myedibleenso

View GitHub Profile
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
@myedibleenso
myedibleenso / test.yml
Created February 18, 2016 01:52
example rules for semantic relations
taxonomy:
- Entity:
- Noun
- Adjective
- NounPhrase
- Patterns:
- KindOfPattern
- PartOfPattern
- Event:
- KindOf
@myedibleenso
myedibleenso / OdinExample.scala
Created February 18, 2016 02:09
odin example
// requires processors library: https://github.com/clulab/processors/blob/master/README.md
import edu.arizona.sista.odin._
import edu.arizona.sista.processors.fastnlp.FastNLPProcessor
val proc = new FastNLPProcessor
// a couple of simple examples to test the rules against.
val text = "a tiger is a kind of big cat. an eye is a part of a tiger."
val doc = proc annotate text
@myedibleenso
myedibleenso / Build.scala
Created February 29, 2016 22:27
an example of how to include a sbt dependency that is hosted on github
// save to project/Build.scala
import sbt.{Build, Project, ProjectRef, uri}
object MyBuild extends Build {
lazy val root = Project("root", sbt.file(".")).dependsOn(procAgiga)
lazy val procAgiga = ProjectRef(uri("git://github.com/myedibleenso/processors-agiga.git#master"), "processors-agiga")
}
@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;
# This defines how our entities and events are related to one another semantically
taxonomy:
- ExpandedEntity:
- Entity:
- Nominal:
- Noun
- PossiblePerson:
- Person
- Organization
- Location
@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
# NE rules
- name: "ner-person"
label: [Person, PossiblePerson, Entity]
priority: 1
type: token
pattern: |
[entity="PERSON"]+
|
[tag=/^N/]* [tag=/^N/ & outgoing="cop"] [tag=/^N/]*
#!/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
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 {