Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Alfred Francis alfredfrancis

🏠
Working from home
View GitHub Profile
View bitbucket-pipelines.yml
image: python:3.7.4
pipelines:
default:
- step:
script:
- pip install -r requirements.txt
- python -m unittest discover tests/
- step:
caches:
- sonar
View dimple.html
<!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>
View install_spacy.sh
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 Jan 5, 2019
Parse html tables using pandas
View parse_table.py
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")]')
View w2v_gen.py
# 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)
View ml_flow.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View opencv_line_dectection.py
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 Jun 4, 2018
Wrapper for Rasa NLU Starspace classifier written in Tensorflow. Based on the starspace idea from: https://arxiv.org/abs/1709.03856.
View requirements.txt
cloudpickle
tensorflow
spacy
numpy
sklearn
@alfredfrancis
alfredfrancis / question_class
Created May 24, 2018
Question Classification
View question_class
http://cogcomp.org/Data/QA/QC/
@alfredfrancis
alfredfrancis / superviosrd.conf
Created May 18, 2018
Sample Supervisord conf to start flask app
View superviosrd.conf
[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