Skip to content

Instantly share code, notes, and snippets.

@cristiano74
cristiano74 / gistr_code.R
Created June 18, 2019 08:36
Create and update gist via gistR
library("gistr")
Sys.setenv(GITHUB_PAT ="token_to_insert_here")
#https://help.github.com/articles/creating-an-access-token-for-command-line-use
gist_auth()
#### filename - code ######################################
stuffpath <- "C:/file_name_full_path"
###################################################à
#gist ID creation (only once) - ###############################################
#https://gist.github.com/cristiano74/d778e0347fea9ff00da6a24b7aae87e5
#gists_temp3
test_proportion=8/9 #percentuale di successi osservata
total_tested=9 #nr di deliverd
passed = round(test_proportion*total_tested) #nr successi
benchmark_value=0.70 #valore di riferimento
conf_level=0.95
scope="UniqueOpenRate"
@cristiano74
cristiano74 / apply_model_ner.py
Last active January 31, 2019 06:35
apply_model_ner: quick and dirty way to apply a spacy NER model to a JSONL file (prodigy.ai)
def apply_model_ner(source,spacy_model):
"""
source: "./data/T_4_slot_1.jsonl"
spacy_model="./model_T_2_1"
example --> apply_model_ner("./data/T_4_slot_1.jsonl","./model_T_2_1")
"""
from prodigy.components.loaders import JSONL
import copy
import spacy
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 21 13:07:31 2018
@author: cristianodalfarra
"""
#!/usr/bin/env python
# coding:utf-8
Install thi repo:
- https://github.com/defunkt/gist
- gem install gist
GEM installation:
- sudo apt-get install rubygems
========================
Login
lskdllsdk
sld?ls?d
@cristiano74
cristiano74 / word2vec-nlp-tutorial.ipynb
Created May 9, 2018 15:59
word2vec-nlp-tutorial.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cristiano74
cristiano74 / Install a pip package in the current Jupyter kernel.ipynb
Created May 9, 2018 15:58
jupiter notebook tips/Install a pip package in the current Jupyter kernel.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cristiano74
cristiano74 / Install a pip package in the current Jupyter kernel.ipynb
Created May 9, 2018 15:58
jupiter notebook tips/Install a pip package in the current Jupyter kernel.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ciao