Skip to content

Instantly share code, notes, and snippets.

@tpeng
tpeng / makefile
Created February 15, 2014 15:18
patch to allow rnnlm build on macos
#CC = x86_64-linux-g++-4.6
CC = llvm-gcc
WEIGHTTYPE = float
CFLAGS = -D WEIGHTTYPE=$(WEIGHTTYPE) -lm -O2 -Wall -funroll-loops -ffast-math -lstdc++
#CFLAGS = -D WEIGHTTYPE=$(WEIGHTTYPE) -lm -O2 -Wall -funroll-loops -ffast-math
#CFLAGS = -lm -O2 -Wall
all: rnnlmlib.o rnnlm
rnnlmlib.o : rnnlmlib.cpp
@tpeng
tpeng / crfsuite.build.patch
Last active August 9, 2017 09:51
Build crfsuite on macos
diff --git a/configure.in b/configure.in
index dafbcf6..743037c 100644
--- a/configure.in
+++ b/configure.in
@@ -30,7 +30,7 @@ dnl ------------------------------------------------------------------
AM_INIT_AUTOMAKE(crfsuite, 0.12)
AC_CONFIG_HEADERS(config.h)
AM_MAINTAINER_MODE
-AM_C_PROTOTYPES
+

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
diff --git a/webstruct/model.py b/webstruct/model.py
index f77ab36..941cd8f 100644
--- a/webstruct/model.py
+++ b/webstruct/model.py
@@ -111,6 +111,13 @@ class NER(object):
Return annotated HTML data in WebAnnotator format.
"""
html_tokens, tags = self.extract_raw(bytes_data)
+ return self.annotate_tokens(html_tokens, tags)
+
@tpeng
tpeng / crf.py
Last active August 29, 2015 14:10 — forked from neubig/crf.py
#!/usr/bin/python
# crf.py (by Graham Neubig)
# This script trains conditional random fields (CRFs)
# stdin: A corpus of WORD_POS WORD_POS WORD_POS sentences
# stdout: Feature vectors for emission and transition properties
from collections import defaultdict
from math import log, exp
import sys
  • Update HISTORY.rst
  • Update version number in my_project/__init__.py
  • Update version number in setup.py
  • Install the package again for local development, but with the new version number:
python setup.py develop
  • Run the tests:
python setup.py test
#netaporter_bookmarklet_table{
border: 3px solid #333;
position: fixed;
_position:absolute;
top: 0;
right: 0;
width: 570px;
height: 80px;
z-index: 10000000;
margin: 0;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.