Package org.nlpub.watset.graph
Class SimplifiedWatset<V,E>
- java.lang.Object
-
- org.nlpub.watset.graph.SimplifiedWatset<V,E>
-
- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph
- All Implemented Interfaces:
Clustering<V>
public class SimplifiedWatset<V,E> extends Object implements Clustering<V>
A faster and simplified version of Watset that does not need a context similarity measure.This is the recommended implementation of the Watset clustering algorithm.
- See Also:
- Ustalov et al. (COLI 45:3)
-
-
Constructor Summary
Constructors Constructor Description SimplifiedWatset(org.jgrapht.Graph<V,E> graph, Function<org.jgrapht.Graph<V,E>,Clustering<V>> local, Function<org.jgrapht.Graph<Sense<V>,org.jgrapht.graph.DefaultWeightedEdge>,Clustering<Sense<V>>> global)Create an instance of the Simplified Watset clustering algorithm.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfit()Run the algorithm to induce the parameters of the clusters.Collection<Collection<V>>getClusters()Return a collection of clusters, each cluster is a collection of objects.Map<Sense<V>,Map<Sense<V>,Number>>getContexts()Get the disambiguated contexts built duringfit().org.jgrapht.Graph<Sense<V>,org.jgrapht.graph.DefaultWeightedEdge>getSenseGraph()Get the intermediate node sense graph built duringfit().static <V,E>
Function<org.jgrapht.Graph<V,E>,Clustering<V>>provider(Function<org.jgrapht.Graph<V,E>,Clustering<V>> local, Function<org.jgrapht.Graph<Sense<V>,org.jgrapht.graph.DefaultWeightedEdge>,Clustering<Sense<V>>> global)A factory function that sets up the algorithm for the given graph.
-
-
-
Constructor Detail
-
SimplifiedWatset
public SimplifiedWatset(org.jgrapht.Graph<V,E> graph, Function<org.jgrapht.Graph<V,E>,Clustering<V>> local, Function<org.jgrapht.Graph<Sense<V>,org.jgrapht.graph.DefaultWeightedEdge>,Clustering<Sense<V>>> global)
Create an instance of the Simplified Watset clustering algorithm.- Parameters:
graph- the graphlocal- the local clustering algorithm supplierglobal- the global clustering algorithm supplier
-
-
Method Detail
-
provider
public static <V,E> Function<org.jgrapht.Graph<V,E>,Clustering<V>> provider(Function<org.jgrapht.Graph<V,E>,Clustering<V>> local, Function<org.jgrapht.Graph<Sense<V>,org.jgrapht.graph.DefaultWeightedEdge>,Clustering<Sense<V>>> global)
A factory function that sets up the algorithm for the given graph.- Type Parameters:
V- the type of nodes in the graphE- the type of edges in the graph- Parameters:
local- the local clustering algorithm supplierglobal- the global clustering algorithm supplier- Returns:
- a factory function that sets up the algorithm for the given graph
-
fit
public void fit()
Description copied from interface:ClusteringRun the algorithm to induce the parameters of the clusters.- Specified by:
fitin interfaceClustering<V>
-
getClusters
public Collection<Collection<V>> getClusters()
Description copied from interface:ClusteringReturn a collection of clusters, each cluster is a collection of objects. Usually this method is called after theClustering.fit()method.- Specified by:
getClustersin interfaceClustering<V>- Returns:
- clusters
-
getSenseGraph
public org.jgrapht.Graph<Sense<V>,org.jgrapht.graph.DefaultWeightedEdge> getSenseGraph()
Get the intermediate node sense graph built duringfit().- Returns:
- the sense graph
-
-