Skip to content

Instantly share code, notes, and snippets.

View kasnder's full-sized avatar
🔒

Konrad Kollnig kasnder

🔒
View GitHub Profile
@kasnder
kasnder / top_senteces_from_text.py
Last active January 7, 2020 15:31
Attempt to classify top sentences in the Wikipedia article on New York
# Authored by Konrad Kollnig
# Oxford, 20 April 2019
import wikipedia
from nltk.tokenize import sent_tokenize, RegexpTokenizer
from nltk.corpus import stopwords
from collections import defaultdict
import math
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
@kasnder
kasnder / nmsmax.jl
Last active November 24, 2019 10:00
Nelder-Mead simplex method for direct search optimisation in JULIA.
"""
nmsmax(fun, x[, trace = true, initial_simplex = 0, target_f = Inf, max_its = Inf, max_evals = Inf, tol = 1e-3])
Nelder-Mead simplex method for direct search optimization.
This function attempts to maximize the function `fun`, using the
starting vector `x`. The Nelder-Mead direct search method is used.
Adaption of the original *MATLAB* source by Nick Higham to *Julia*.
@kasnder
kasnder / landgericht_aachen_downloader.py
Created May 13, 2018 21:24
Python script to aggreate and filter the events of the courts in Aachen, Germany.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import locale
import csv, codecs, cStringIO
from pprint import pprint
import time
from BeautifulSoup import BeautifulSoup
# From the Pyton documentation