Skip to content

Instantly share code, notes, and snippets.

View brendano's full-sized avatar

Brendan O'Connor brendano

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brendano
brendano / corenlp_client_example.py
Last active July 15, 2018 05:38
example of using corenlp server from python
"""
example of using corenlp server from python
This code requires server to already be running: https://stanfordnlp.github.io/CoreNLP/corenlp-server.html
To start server:
java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000
To call it, e.g.:
curl --data "The man wanted to go to work." 'http://localhost:9000/?properties={%22annotators%22%3A%22tokenize%2Cssplit%2Cpos%2Cdepparse%22%2C%22outputFormat%22%3A%22conllu%22}'
@brendano
brendano / log_logistic.py.md
Last active March 8, 2020 14:12
numerically stable implementation of the log-logistic function

Binary case

This is just the middle section of Bob Carpenter's note for evaluating log-loss via the binary logistic functoin https://lingpipe-blog.com/2012/02/16/howprevent-overflow-underflow-logistic-regression/

The logp function calculates the negative cross-entropy:

    dotproduct( [y, 1-y],  [logP(y=1), logP(y=0)] )

where the input s is the beta'x log-odds scalar value. The trick is to make this numerically stable for any choice of s and y.

We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 30 columns, instead of 9. in line 5.
http://brenocon.com/confsize,,,"Numer of paper submissions and acceptances for various conferences over time. Trying to only select full-length or ""main"" research papers, though others are sometimes included.
The first several columns are the main data. Sources on the right. Sometimes I tried to put in original source data in different columns. Sometimes data contradicts",,,,,,,,,,,,,,,,,,,,,,,,,,
area,conference,year,submit,accept,accept rates - some are messy or partial from copy-and-paste,joint,attendance,source/notes,other notes,other notes,other notes,other notes,other notes,other notes,,,,,,,,,,,,,,,
,,,,,,,,,https://dl.acm.org/citation.cfm?id=2766462&picked=source&preflayout=tabs,https://dl.acm.org/citation.cfm?id=312624,the ACM table:,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,Year,Submitted,Accepted,Rate,,,,,,,,,,,,,,,
webir,sigir,1999,135,33,,,,https://dl.acm.org/citation.cfm?id=312624,,22nd annual,SIGIR '99,135,33,24%,,,,,,,,,,,,,,,
webir,sigir,2000,??,??,,,,https://dl.acm.org/citation.cfm?id=345508&picked
@brendano
brendano / example.ipynb
Last active April 30, 2019 01:56
l1 generative implementation with liblbfgs (owl-qn)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@brendano
brendano / .RData
Last active June 27, 2019 17:00
google ngram books plot
@brendano
brendano / .Rhistory
Last active August 31, 2019 14:39
longrun_bettng_inequality
log(c(1.05,.6))
log(c(1.5,.6))
ifelse(runif(1000)>.5, 1.5, .6)
x=ifelse(runif(1000)>.5, 1.5, .6)
mean(x)
prod(x)
x=ifelse(runif(10)>.5, 1.5, .6)
x
y=replicate(100000,{x=ifelse(runif(10)>.5, 1.5, .6); prod(x)})
summary(y)