This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'stuff-classifier' | |
require 'spreadsheet' | |
toxifier = StuffClassifier::TfIdf.new("tox") | |
rating = {'0' => :no, '1' => :yes, '2' =>:maybe} | |
toxifier.ignore_words = File.readlines('stopwords') | |
curated_data = File.readlines('alcohol_MC.txt') | |
curated_data.each do |spread| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, os | |
from api.Twitter import Twitter | |
from nlp import SemanticDistance as SD | |
from nlp.json_to_text import TwitterRecord | |
from visualization.visualization import SemanticVisualization | |
keywords = ['alcohol'] | |
trigger = '-'.join(keywords) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk, os, json, csv | |
from scipy.stats import scoreatpercentile | |
#read the stopwrod file | |
#do stopwords have to be in the same file as the json files? | |
READ = 'rb' | |
stopwords = open('../data/stopwords',READ).readlines() | |
#lemmatizer | |
lmtzr = WordNetLemmatizer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
@date Jan 17, 2010 | |
@author: mjbommar (c) 2010 | |
Free to use for non-commerical purposes. Attribution appreciated :) | |
''' | |
import igraph | |
import Image, ImageDraw | |
import os, os.path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nltk | |
from nltk.draw.util import CanvasFrame | |
from nltk.draw import TreeWidget | |
from nltk import Tree, word_tokenize,load_parser | |
from nltk.corpus import verbnet as vn | |
from nltk.corpus import wordnet as wn | |
from nltk.wsd import lesk | |
from nltk.corpus import framenet as fn | |
from pprint import pprint | |
from awesome_print import ap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// SecondViewController.swift | |
// swiftTest | |
// | |
// Created by Michael Chary on 5/24/15. | |
// | |
// | |
import UIKit | |
import CoreGraphics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MasterViewController.swift | |
// beta | |
// | |
// Created by Michael Chary on 5/25/15. | |
// Copyright (c) 2015 Michael Chary. All rights reserved. | |
// | |
import UIKit | |
import AudioToolbox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import nltk | |
#import matplotlib.pyplot as plt | |
#import utils as tech | |
from nltk.corpus import stopwords | |
from nltk import bigrams,trigrams | |
from pprint import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Tools for searching Pubmed for a list of PMIDs. | |
The goal here is to search for many PMIDs at once, since searching | |
sequentially can take a long time. Using the the BioPython Entrez module | |
is super convenient to this end. | |
The results results are returned in a simple dictionary format. | |
""" | |
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 62 columns, instead of 46 in line 1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
,opioid,serotonergic,unclear,cardioactive,antibiotic/antifungal,ssri,ergot,anti-inflammatory,mushrooms,anticoagulant,neurotoxin,misclassified,antacid,stimulants,moiety,snakes,sexual enhancement,salicylate,alcohol,chemical process,cholinergic plant,dopamine agonist,paralytic,abortifacient,analgesic,anticholinergic medicine,maoi,functional class,plant,chemotherapeutic,nsaid,cyanogenic,anesthetic,hepatotoxin,anabolic hormones,antinausea,antihyperglycemic,hiv medications,nonopioid analgesic,inhalant,psychedelic,antipsychotic,bulking agent,serm,metabolite,cannabinoid receptor agonists,endogenous chemical,sedative,antidepressant,structural class,chemical reagent,androgen/estrogen,uncoupler,steroid,nootropic,acetaminophen-containing,element,tricyclic antidepressants,antithyroid,nmda antagonist,vasoactive | |
opioid,6416.0,5.0,0.0,29.0,31.0,55.0,18.0,18.0,1.0,0.0,0.0,0.0,4.0,1613.0,103.0,0.0,0.0,1.0,51.0,0.0,2.0,5.0,2.0,1.0,4.0,124.0,69.0,296.0,45.0,21.0,13.0,0.0,16.0,1.0,9.0,8.0,1.0,9.0,1.0,17.0,1482.0,43.0,3.0,0.0,33.0 |