Skip to content

Instantly share code, notes, and snippets.

View alfredfrancis's full-sized avatar
🎯
Focusing

Alfred Francis alfredfrancis

🎯
Focusing
View GitHub Profile
image: python:3.7.4
pipelines:
default:
- step:
script:
- pip install -r requirements.txt
- python -m unittest discover tests/
- step:
caches:
- sonar
@alfredfrancis
alfredfrancis / dimple.html
Created February 23, 2019 11:10
Piechart dimplsjs
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Lyca Mobiles - Social Media Sentiment analysis </title>
<script src="//d3js.org/d3.v4.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/dimple/2.3.0/dimple.latest.js"></script>
@alfredfrancis
alfredfrancis / install_spacy.sh
Created February 5, 2019 07:15
Install Spacy
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz
python -m spacy link en_core_web_sm en
@alfredfrancis
alfredfrancis / parse_table.py
Created January 5, 2019 17:58
Parse html tables using pandas
import pandas as pd
import requests
from lxml import etree
import urllib
url = 'https://www.sec.gov/Archives/edgar/data/1090872/000156459018001685/a-def14a_20180321.htm#BENEFICIAL_OWNERSHIP'
html = requests.get(url).content
html = etree.HTML(html)
tr_nodes = html.xpath('.//table[contains(.,"Name and Address of Beneficial Owner")]')
# import modules & set up logging
import gensim, logging
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
sentences = [['first', 'sentence'], ['second', 'sentence']]
# train word2vec on the two sentences
model = gensim.models.Word2Vec(sentences, min_count=1)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
https://www.hackster.io/kemfic/simple-lane-detection-c3db2f?utm_source=Hackster.io+newsletter&utm_campaign=8cd41332a3-EMAIL_CAMPAIGN_2018_05_23&utm_medium=email&utm_term=0_6ff81e3e5b-8cd41332a3-140260637&mc_cid=8cd41332a3&mc_eid=0555616438
https://www.hackster.io/kemfic/curved-lane-detection-34f771
@alfredfrancis
alfredfrancis / requirements.txt
Last active June 4, 2018 18:56
Wrapper for Rasa NLU Starspace classifier written in Tensorflow. Based on the starspace idea from: https://arxiv.org/abs/1709.03856.
cloudpickle
tensorflow
spacy
numpy
sklearn
@alfredfrancis
alfredfrancis / question_class
Created May 24, 2018 13:39
Question Classification
http://cogcomp.org/Data/QA/QC/
@alfredfrancis
alfredfrancis / superviosrd.conf
Created May 18, 2018 17:10
Sample Supervisord conf to start flask app
[program:mlmodule]
command = /root/anaconda2/bin/gunicorn launcher:app -w 4 -b 0.0.0.0:6666
directory = /datavolume/manuels_module
user = root
stdout_logfile = /datavolume/manuels_module/gunicorn_stdout.log
stderr_logfile = /datavolume/manuels_module/gunicorn_stderr.log
redirect_stderr = True