Skip to content

Instantly share code, notes, and snippets.

View Munduruca's full-sized avatar
🤓

Ricardo Munduruca Munduruca

🤓
  • Earth
View GitHub Profile
@bonzanini
bonzanini / search_biopython.py
Last active May 19, 2024 08:45
Searching PubMed with Biopython
# This code uses Biopython to retrieve lists of articles from pubmed
# you need to install Biopython first.
# If you use Anaconda:
# conda install biopython
# If you use pip/venv:
# pip install biopython
# Full discussion:
@bonzanini
bonzanini / sentiment_classification.py
Last active October 30, 2020 23:58
Sentiment analysis with scikit-learn
# You need to install scikit-learn:
# sudo pip install scikit-learn
#
# Dataset: Polarity dataset v2.0
# http://www.cs.cornell.edu/people/pabo/movie-review-data/
#
# Full discussion:
# https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn
@bonzanini
bonzanini / config.py
Last active July 20, 2024 15:06
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
# Print most common words in a corpus collected from Twitter
#
# Full description:
# http://marcobonzanini.com/2015/03/02/mining-twitter-data-with-python-part-1/
# http://marcobonzanini.com/2015/03/09/mining-twitter-data-with-python-part-2/
# http://marcobonzanini.com/2015/03/17/mining-twitter-data-with-python-part-3-term-frequencies/
#
# Run:
# python twitter_most_common_words.py <filename.jsonl>
@Munduruca
Munduruca / search_biopython.py
Created July 5, 2016 03:44 — forked from bonzanini/search_biopython.py
Searching PubMed with Biopython
# you need to install Biopython:
# pip install biopython
# Full discussion:
# https://marcobonzanini.wordpress.com/2015/01/12/searching-pubmed-with-python/
from Bio import Entrez
def search(query):
Entrez.email = 'your.email@example.com'
@Munduruca
Munduruca / sentiment_classification.py
Created July 5, 2016 03:46 — forked from bonzanini/sentiment_classification.py
Sentiment analysis with scikit-learn
# You need to install scikit-learn:
# sudo pip install scikit-learn
#
# Dataset: Polarity dataset v2.0
# http://www.cs.cornell.edu/people/pabo/movie-review-data/
#
# Full discussion:
# https://marcobonzanini.wordpress.com/2015/01/19/sentiment-analysis-with-python-and-scikit-learn
@AlexanderCollins
AlexanderCollins / instance_dict.py
Created April 26, 2018 23:58
Python Dictionary, Instance Representation
# Represents a dictionary as an instance (note: cannot yet cast bact to dict type, simple access <InstanceDict>.d
class InstanceDict:
def __init__(self, d):
self.d = d
def __getattribute__(self, item):
return self.__getattr__(item)
def __getattr__(self, key):
val = self.d[key]