Skip to content

Instantly share code, notes, and snippets.

View louisguitton's full-sized avatar
Focusing

Louis Guitton louisguitton

Focusing
View GitHub Profile
@louisguitton
louisguitton / financial_functions.py
Created November 9, 2016 20:17
These are python financial functions to generate the table for a loan
# Fomule du pret pour obtenir la mensualite
def pmt(C, n, t):
if t:
return (C * t/12)/(1-(1 + t/12)**-n)
else:
return C/n
# Formule pour obtenir la part d'interets de la mensualite
def impt(period, C, n, t):
t_per = t/12
@louisguitton
louisguitton / fermat-spirale.py
Created March 1, 2019 07:34
Sunflower patterns are obtained using a Fermat spiral with a golden angle spacing
import numpy as np
from matplotlib import pyplot as plt
%matplotlib inline
n = range(1, 100)
phi = (3 - np.sqrt(5)) * np.pi
for a in [0.98, 0.985, 0.99, 0.995, 1, 1.005, 1.01, 1.015, 1.02]:
fig = plt.figure()
r = np.sqrt(n)
import pandas as pd
# in the end, I went for a recursive function because tags can be arbitrarily nested
def extract_from_dict(var, key):
if isinstance(var, dict):
for k, v in var.items():
if k == key:
yield v
if isinstance(v, (dict, list)):
yield from gen_dict_extract(v, key)
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators import GoogleApiToS3Transfer
default_args = {
'owner': 'airflow',
'start_date': datetime(2019, 6, 1),
## install homebrew
echo "Installing Homebrew.."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Homebrew successfully installed"
## install brew cask
echo "Installing brew cask.."
brew tap homebrew/cask
echo "Homebrew cask successfully installed"
@louisguitton
louisguitton / docker-compose.yml
Created September 22, 2019 15:21
Nginx + HTTPS + Docker
version: '3'
services:
nginx:
image: nginx:1.15-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx:/etc/nginx/conf.d
## Hi, here are commands that will set you up for the git and github training.
## Open a terminal and copy paste those commands group by group
## Read the output to check if the command really worked.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash > ~/.git-completion.bash
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@louisguitton
louisguitton / tokenizations_post.md
Created July 10, 2020 15:35 — forked from tamuhey/tokenizations_post.md
How to calculate the alignment between BERT and spaCy tokens effectively and robustly

How to calculate the alignment between BERT and spaCy tokens effectively and robustly

image

site: https://tamuhey.github.io/tokenizations/

Natural Language Processing (NLP) has made great progress in recent years because of neural networks, which allows us to solve various tasks with end-to-end architecture. However, many NLP systems still requires language-specific pre- and post-processing, especially in tokenizations. In this article, I describe an algorithm which simplifies calculating of correspondence between tokens (e.g. BERT vs. spaCy), one such process. And I introduce Python and Rust libraries that implement this algorithm.

classroom team
student candidate
teacher hiring manager
teaching assistant team member
assignment take-home code challenge
grading review
teaching process hiring process and employee growth