Skip to content

Instantly share code, notes, and snippets.

View abehmiel's full-sized avatar

Abraham Hmiel abehmiel

View GitHub Profile
@abehmiel
abehmiel / regex.md
Created December 11, 2017 21:36 — forked from magicznyleszek/regex.md
RegEx Cheatsheet
@abehmiel
abehmiel / API_request.py
Last active August 19, 2019 08:30
Basic Python API request
import requests
headers = {"token": "API TOKEN"}
params = {"something": "SOMETHING"}
response = requests.get("https://www.something.com", headers=headers, params=params)
json_data = response.json()
status = response.status_code
@abehmiel
abehmiel / nycc-tech-committee-algotransparency.org
Last active April 12, 2018 19:11
My notes of the NYCC Tech Committee meeting on the Algorithmic Transparency Bill, 16-96

These notes may have errors and omissions. I couldn’t get the names of a lot of the speakers and there are some places where I was thinking or distracted. I make no claims as to the completeness of this information

Algorithmic transparency legislation hearing 10/16/17

James Vaca, Chair of NYCC committee on technology

16-96 2017 Measures of transparency when NYC uses algorithms to impose penalties, police persons

  • Requires publication of source code and querying systems with sample data

  • If left unchecked, algorithms can have negative repercussions
  • Algorithms are a way of encoding assumptions
@abehmiel
abehmiel / btm.py
Created March 5, 2018 22:16 — forked from amintos/btm.py
Bi-term Topic Model implementation in pure Python
"""
Bi-Term Topic Model (BTM) for very short texts.
Literature Reference:
Xiaohui Yan, Jiafeng Guo, Yanyan Lan, and Xueqi Cheng:
"A biterm topic model for short texts"
In Proceedings of WWW '13, Rio de Janeiro, Brazil, pp. 1445-1456.
ACM, DOI: https://doi.org/10.1145/2488388.2488514
This module requires pre-processing of textual data,
@abehmiel
abehmiel / install_packages.R
Created January 4, 2018 18:37
Install useful R packages data science
install.packages(
c(
"dplyr", # data manipulation
"tidyr", # data manipulation
"rmarkdown", # data presentation
"knitr", # data presentation
"RODBC", # database tools
"RMySQL", # database tools
"RPostgreSQL", # database tools
"RSQLite", # database tools
@abehmiel
abehmiel / clarify_pos.py
Created December 19, 2017 18:26
Part-of-speech clarifier from nltk
from nltk import pos_tag
from nltk.tag import str2tuple
"""
Usage:
dictionary_df['Pos'] = dictionary_df['Word'].apply(pos_maker)
dictionary_df['Help Definition'] = dictionary_df['Pos'].apply(clarify_pos)
"""
def clarify_pos(pos):
@abehmiel
abehmiel / gist:e5dd495ca6123fda20ee876d58a6cd8f
Created December 15, 2017 23:18 — forked from rohannog/gist:3861442
Decrypt pdf on command-line
qpdf --password=passwd --decrypt orig.pdf decrypted.pdf
#To input the password
read -s -p "Password: " password && qpdf --password=$password --decrypt orig.pdf decrypted.pdf
@abehmiel
abehmiel / understanding-word-vectors.ipynb
Created November 19, 2017 03:07 — forked from aparrish/understanding-word-vectors.ipynb
Understanding word vectors: A tutorial for "Reading and Writing Electronic Text," a class I teach at ITP. (Python 2.7) Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@abehmiel
abehmiel / spacy_intro.ipynb
Created November 16, 2017 23:03 — forked from aparrish/spacy_intro.ipynb
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.