GithubHelp home page GithubHelp logo

pombredanne / galaxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frnsys/galaxy

0.0 0.0 0.0 5.52 MB

python implementation of Incremental Hierarchical Agglomerative Clustering (IHAC)

Python 91.47% HTML 6.26% Shell 2.27%

galaxy's Introduction

Galaxy

These are some implementations of text clustering algorithms, though only the implementation of Incremental Hierarchical Agglomerative Clustering (IHAC) has been polished and completed.

This project was put together specifically for Argos so some of the setup is tailored to that, though I eventually hope to make it a bit more general.

Setup

There is some prep you need to do for Pytables (the tables package):

pip install numexpr cython

# On OSX
brew tap homebrew/science
brew install hdf5

# On Linux
sudo apt-get install libhdf5-dev

There are other additional dependencies which you can install using the provided setup script.

Then you can install galaxy with either:

pip install git+git://github.com/ftzeng/galaxy

or clone this repo and then install it from there (useful if you are actively working on this project):

pip install --editable .

Note that you many need to manually upgrade the topia.termextract module to this git fork which is Py3 compatible:

 pip install -U git+git://github.com/BowdoinOrient/topia.termextract.git

Then you should configure things as needed (see the next section) and then train your pipelines:

$ python run.py train /path/to/training/data.json

This expects that the data is a list of dictionaries, with title and text keys. Depending on how much data you have, this could take a long time.

Config

You can configure a few things by setting them on galaxy.conf:

conf.PIPELINE_PATH = where you pickled pipelines are stored.
conf.STANFORD      = a dict specifying the host & port of your Stanford NER server.
conf.SPOTLIGHT     = a dict specifying the host & port of your DBpedia Spotlight server.

You should set these before you load any of the other galaxy modules.

Usage

# Train the feature pipelines (text and concepts):
$ python run.py train /path/to/training/data.json

# Evaluate event clustering (on labeled data):
# The `--incremental` flag will break the input into chunks of random sizes.
$ python run.py eval /path/to/eval/data.json <approach> [--incremental]

# Run clustering on unlabeled data:
$ python run.py cluster /path/to/test/data.json

# Fix up encoding errors in data:
$ python run.py clean /path/to/data.json

Performance

Speed

Using the line_profiler package.

To measure speed, add the @profile decorator to any function you want to measure. Then run then script:

$ kernprof -lv run.py <your args>

Memory

Using the memory_profiler and psutil packages.

To measure memory usage, add the @profile decorator to any function you want to measure. Then run the script:

$ python -m memory_profiler run.py <your args>

galaxy's People

Contributors

frnsys avatar pablocelayes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.