Skip to content

Instantly share code, notes, and snippets.

View igledaniel's full-sized avatar

Daniel Iglesias igledaniel

View GitHub Profile
@igledaniel
igledaniel / fasttext_confusion_matrix.py
Created October 22, 2019 10:43 — forked from loretoparisi/fasttext_confusion_matrix.py
Calculate FastText Classifier Confusion Matrix
#!/usr/local/bin/python3
# @author cpuhrsch https://github.com/cpuhrsch
# @author Loreto Parisi loreto@musixmatch.com
import argparse
import numpy as np
from sklearn.metrics import confusion_matrix
def parse_labels(path):
with open(path, 'r') as f:
@tolitius
tolitius / nginx.conf
Last active June 24, 2023 10:03
openresty (nginx + lua): redis connection pooling
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
init_worker_by_lua_block {
redis = require("resty.redis")
}
server {