Skip to content

Instantly share code, notes, and snippets.

View chssch's full-sized avatar

Christoph Schwienheer chssch

View GitHub Profile
@chssch
chssch / spacy_wordle.py
Created February 3, 2022 02:00
Get wordle cheating clues from spacy
import spacy, re
nlp = spacy.load("en_core_web_lg")
green = "spa??" # position like spa??
yellow = "y" # just list
grey = "xg" # just list, exclude green
print([k for k in nlp.vocab.strings if
re.match(green.replace("?", "[a-z]"), k)
and len(k) == 5
{"text":"Auch das Toastbrot wird mitp\u00fcriert, es dient der Bindung","labels":["ES_ERHITZT_NICHT"]}
{"text":"eine Minute k\u00f6cheln","labels":["ES_ERHITZT"]}
{"text":"es ist einfach mega-ober-lecker","labels":["ES_ERHITZT_NICHT"]}
{"text":"Am Schluss l\u00e4sst man das \u00d6l bei laufendem Mixer einflie\u00dfen","labels":["ES_ERHITZT_NICHT"]}
{"text":"Den Grie\u00dfbrei mit dem Kompott servieren","labels":["ES_ERHITZT_NICHT"]}
{"text":"Nun mit dem Saft der Orange vorsichtig abschmecken - danach nicht mehr k\u00f6cheln!Auf Teller verteilen, je einen Klecks Sauerrahm dazugeben, mit in Streifen geschnittenem R\u00e4ucherlachs, Kr\u00e4utern und evtl","labels":["ES_ERHITZT_NICHT"]}
{"text":"Die Sauce mit Salz und Pfeffer abschmecken, bei Bedarf mit hellem Saucenbinder binden","labels":["ES_ERHITZT_NICHT"]}
{"text":"Den Kochschinken in kurze Streifen schneiden","labels":["ES_ERHITZT_NICHT"]}
{"text":"In einer gro\u00dfen Sch\u00fcssel alles gut verr\u00fchren und f\u00fcr mindestens eine Stunde im K\u00fchls
{"text":"Auch das Toastbrot wird mitp\u00fcriert, es dient der Bindung","_input_hash":-226126182,"_task_hash":-1315299027,"label":"ERHITZEN","score":0.5017444491,"priority":0.5017444491,"spans":[],"meta":{"score":0.5017444491},"answer":"reject"}
{"text":"eine Minute k\u00f6cheln","_input_hash":1508612145,"_task_hash":-843120175,"label":"ERHITZEN","score":0.4917629361,"priority":0.4917629361,"spans":[],"meta":{"score":0.4917629361},"answer":"accept"}
{"text":"es ist einfach mega-ober-lecker","_input_hash":-1703635154,"_task_hash":-1657105861,"label":"ERHITZEN","score":0.4858001173,"priority":0.4858001173,"spans":[],"meta":{"score":0.4858001173},"answer":"reject"}
{"text":"Am Schluss l\u00e4sst man das \u00d6l bei laufendem Mixer einflie\u00dfen","_input_hash":-372780655,"_task_hash":317063753,"label":"ERHITZEN","score":0.4849790037,"priority":0.4849790037,"spans":[],"meta":{"score":0.4849790037},"answer":"reject"}
{"text":"Den Grie\u00dfbrei mit dem Kompott servieren","_input_hash":-337523063,"_task_hash":1967
@chssch
chssch / spacy_srl.py
Last active March 1, 2023 18:01
Use AllenNLP Semantic Role Labeling (http://allennlp.org/) with SpaCy 2.0 (http://spacy.io) components and extensions
# This small script shows how to use AllenNLP Semantic Role Labeling (http://allennlp.org/) with SpaCy 2.0 (http://spacy.io) components and extensions
# Script installs allennlp default model
# Important: Install allennlp form source and replace the spacy requirement with spacy-nightly in the requirements.txt
# Developed for SpaCy 2.0.0a18
from allennlp.commands import DEFAULT_MODELS
from allennlp.common.file_utils import cached_path
from allennlp.service.predictors import SemanticRoleLabelerPredictor
from allennlp.models.archival import load_archive
@chssch
chssch / Dockerfile
Last active April 18, 2022 02:08
explosion.ai prodi.gy Dockerfile
# Dockerfile for prodigy, just place your linux-wheel (prodigy-0.1.0-cp36-cp36m-linux_x86_64.whl) in same directoty as
# this dockerfile and:
# > docker build . -t prodigy
# > docker run -it -p 8080:8080 -v ${PWD}:/work prodigy bash
FROM python:3.6
RUN mkdir /prodigy
WORKDIR /prodigy
COPY ./prodigy-0.1.0-cp36-cp36m-linux_x86_64.whl /prodigy
RUN pip install prodigy-0.1.0-cp36-cp36m-linux_x86_64.whl
@chssch
chssch / berlin_rnn_generated_locations.txt
Last active July 23, 2017 14:51
berlin_location_rnn.txt
# RNN generated locations. Char-rnn with PyTorch (http://pytorch.org/tutorials/intermediate/char_rnn_generation_tutorial.html)
# Data input: district names, place names, street names, vbb stops
Am Berkendor Sterssae
Am Ber Strasse
Alter Strasse
Am Brinder Strasse
Am Brueder Strusse
Am Ber Strass
Am Bechender Schasse
Am Ber Strasse Strass
def load_data(filename):
traina = cPickle.load( open( filename, "rb" ) )
j = 0
i = 0
temp = None
pairs = []
for r in traina:
import spacy
nlp = spacy.load('en', parser=None, entity=None)
def get_data():
for index, row in df.iterrows():
yield unicode(row['question1'])
yield unicode(row['question2'])
res = []
temp = None

Requirements: xcode, homebrew

First get ayab and install requirements

Install QT 4.8

Since Qt4 is not supported anymore, brew is also ditching it from their formulas for newer macos versions, this one seems to work still.

@chssch
chssch / otsbjs.md
Created May 30, 2012 11:39 — forked from janl/otsbjs.md
Open Tech School Berlin JS

In the spirit of Railsgirls Berlin, we want to start a programming education group for JavaScript. We need your help to get all the coaching done.

If you are interested in coaching JavaScript, fork this gist and add yourself or leave your contact data in a comment: