Class SimplifiedWatset<V,​E>

  • Type Parameters:
    V - the type of nodes in the graph
    E - 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 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 graph
        local - the local clustering algorithm supplier
        global - 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 graph
        E - the type of edges in the graph
        Parameters:
        local - the local clustering algorithm supplier
        global - 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: Clustering
        Run the algorithm to induce the parameters of the clusters.
        Specified by:
        fit in interface Clustering<V>
      • getSenseGraph

        public org.jgrapht.Graph<Sense<V>,​org.jgrapht.graph.DefaultWeightedEdge> getSenseGraph()
        Get the intermediate node sense graph built during fit().
        Returns:
        the sense graph
      • getContexts

        public Map<Sense<V>,​Map<Sense<V>,​Number>> getContexts()
        Get the disambiguated contexts built during fit().
        Returns:
        the disambiguated contexts