brian wickman - @wickman
[TOC]
Pants makes the manipulation and distribution of hermetically sealed Python environments
import networkx as nx | |
import numpy as np | |
import itertools | |
## We define each S* motif as a directed graph in networkx | |
motifs = { | |
'S1': nx.DiGraph([(1,2),(2,3)]), | |
'S2': nx.DiGraph([(1,2),(1,3),(2,3)]), | |
'S3': nx.DiGraph([(1,2),(2,3),(3,1)]), | |
'S4': nx.DiGraph([(1,2),(3,2)]), |
""" Example using GenSim's LDA and sklearn. """ | |
import numpy as np | |
from gensim import matutils | |
from gensim.models.ldamodel import LdaModel | |
from sklearn import linear_model | |
from sklearn.datasets import fetch_20newsgroups | |
from sklearn.feature_extraction.text import CountVectorizer |
# script stolen from http://goo.gl/YbQyAQ | |
# install.packages("tm") | |
# install.packages("ggplot2") | |
# install.packages("lsa") | |
# install.packages("scatterplot3d") | |
#install.packages("SnowballC") | |
#if !(require('SnowballC')) then install.packages("SnowballC") | |
library(tm) | |
library(ggplot2) |
# coding=UTF-8 | |
import nltk | |
from nltk.corpus import brown | |
# This is a fast and simple noun phrase extractor (based on NLTK) | |
# Feel free to use it, just keep a link back to this post | |
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/ | |
# Create by Shlomi Babluki | |
# May, 2013 |
# load required libraries | |
library(tm) | |
library(ggplot2) | |
library(lsa) | |
# 1. Prepare mock data | |
text <- c("transporting food by cars will cause global warming. so we should go local.", | |
"we should try to convince our parents to stop using cars because it will cause global warming.", | |
"some food, such as mongo, requires a warm weather to grow. so they have to be transported to canada.", | |
"a typical electronic circuit can be built with a battery, a bulb, and a switch.", |
GNU GENERAL PUBLIC LICENSE | |
Version 3, 29 June 2007 | |
Copyright (C) 2007 Free Software Foundation, Inc. {http://fsf.org/} | |
Everyone is permitted to copy and distribute verbatim copies | |
of this license document, but changing it is not allowed. | |
Preamble | |
The GNU General Public License is a free, copyleft license for |
Large Object Motions: | |
( | |
) | |
{ | |
} | |
[[ | |
[] | |
][ | |
]] | |
[m |
A warning occurred (42 apples) | |
An error occurred |
from blueprint import example | |
from extensions import mail | |
from flask import Flask | |
import settings | |
def create_app(settings=settings): | |
ret_val = Flask(__name__) | |
ret_val.config.from_object(settings) | |
# initialize extensions... |