Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A little library for text analysis with RNNs.

Project Description

A little library for text analysis with RNNs.

Warning: very alpha, work in progress.


via Github (version under active development)

git clone
python develop

or via pip

sudo pip install passage


Using Passage to do binary classification of text, this example:

  • Tokenizes some training text, converting it to a format Passage can use.
  • Defines the model’s structure as a list of layers.
  • Creates the model with that structure and a cost to be optimized.
  • Trains the model for one iteration over the training text.
  • Uses the model and tokenizer to predict on new text.
  • Saves and loads the model.
from passage.preprocessing import Tokenizer
from passage.layers import Embedding, GatedRecurrent, Dense
from passage.models import RNN
from passage.utils import save, load

tokenizer = Tokenizer()
train_tokens = tokenizer.fit_transform(train_text)

layers = [
    Embedding(size=128, n_features=tokenizer.n_features),
    Dense(size=1, activation='sigmoid')

model = RNN(layers=layers, cost='BinaryCrossEntropy'), train_labels)

save(model, 'save_test.pkl')
model = load('save_test.pkl')


  • train_text is a list of strings [‘hello world’, ‘foo bar’]
  • train_labels is a list of labels [0, 1]
  • test_text is another list of strings


Without sizeable datasets RNNs have difficulty achieving results better than traditional sparse linear models. Below are a few datasets that are appropriately sized, useful for experimentation. Hopefully this list will grow over time, please feel free to propose new datasets for inclusion through either an issue or a pull request.

**Note**: None of these datasets were created by indico, not should their inclusion here indicate any kind of endorsement

Blogger Dataset: (Age and gender data)

Release History

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
passage-0.2.4.tar.gz (9.7 kB) Copy SHA256 Checksum SHA256 Source Feb 24, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting