Skip to content
Hierarchical clustering of aspect phrases with scipy
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
distancemeasures.py
scipy_clustering.py
vectorexample.txt

README.md

AspectClustering

Hierarchical clustering of aspect phrases with SciPy.

Files

  • scipy_clustering.py - the main programm that does the clustering
  • distancemeasures.py - some distance measures between aspect phrases to chose from
  • vectorexample.txt - an example file to play around, containing phrases and vectors (from word2vec)

Stuff you'll need

  • SciPy
  • NLTK WordNet Interface (if you don't want to install/use WordNet, just throw out everything related to it in distancemeasures.py)

Usage

python scipy_clustering.py <input file> <distance measure> <cluster linkage> <number of clusters>

Examples: python scipy_clustering.py vectorexample.txt levenshtein single 5 python scipy_clustering.py vectorexample.txt euclidean ward 10

See code for the possible values.

Licence and Warranty

Do whatever you want. This is code from a student project, no guarantees given, no support.

You can’t perform that action at this time.