Implement semantic similarity measures including Path, Wu-Palmer, and Leacock-Chodorow
Implement semantic similarity measures including Path, Wu-Palmer, and Leacock-Chodorow
(build-graph synset edge-types)
Build a graph by following edges of the specifed types, edge-types, a collection.
Build a graph by following edges of the specifed types, edge-types, a collection.
(general-hypernyms synset)
Return all the :hypernym and :hypernym-instances of the synset.
Return all the :hypernym and :hypernym-instances of the synset.
(graph-roots graph)
Return root nodes of the graph
Return root nodes of the graph
(hypernym-paths synset)
Return a vector of hypernym paths (back to root) for the argument term.
Return a vector of hypernym paths (back to root) for the argument term.
(lch-similarity dict term1 term2)
Return a score denoting how similar two word senses are, based on the shortest path that connects the senses (as above) and the maximum depth of the taxonomy in which the senses occur. The relationship is given as -log(p/2d) where p is the shortest path length and d is the taxonomy depth.
Return a score denoting how similar two word senses are, based on the shortest path that connects the senses (as above) and the maximum depth of the taxonomy in which the senses occur. The relationship is given as -log(p/2d) where p is the shortest path length and d is the taxonomy depth.
(least-common-subsumer dict term1 term2)
Return the Least Common Subsumer (most specific ancestor) common to the args paths.
The LCS does not necessarily feature in the shortest path connecting the two senses, as it is by definition the common ancestor deepest in the taxonomy, not closest to the two senses. Typically, however, it will so feature. Where multiple candidates for the LCS exist, that whose shortest path to the root node is the longest will be selected.
Return the Least Common Subsumer (most specific ancestor) common to the args paths. The LCS does not necessarily feature in the shortest path connecting the two senses, as it is by definition the common ancestor deepest in the taxonomy, not closest to the two senses. Typically, however, it will so feature. Where multiple candidates for the LCS exist, that whose shortest path to the root node is the longest will be selected.
(path-similarity dict term1 term2)
Path Distance Similarity: Return a score denoting how similar two word senses are, based on the shortest path that connects the senses in the is-a (hypernym/hypnoym) taxonomy. The score is in the range 0 to 1, except in those cases where a path cannot be found (will only be true for verbs as there are many distinct verb taxonomies), in which case None is returned. A score of 1 represents identity i.e. comparing a sense with itself will return 1.
Path Distance Similarity: Return a score denoting how similar two word senses are, based on the shortest path that connects the senses in the is-a (hypernym/hypnoym) taxonomy. The score is in the range 0 to 1, except in those cases where a path cannot be found (will only be true for verbs as there are many distinct verb taxonomies), in which case None is returned. A score of 1 represents identity i.e. comparing a sense with itself will return 1.
(shortest-path graph n1 n2)
Return the shortest path from node n1 to n2, synset IDs (strings).
Return the shortest path from node n1 to n2, synset IDs (strings).
(shortest-path-to-root synset)
Following hypernyms, return the shortest path from the synset to the root.
Following hypernyms, return the shortest path from the synset to the root.
(taxonomy-max-depth dict synset-pos)
The maximum depth of the taxonomy for the POS. Call it with one of #{:noun-synsets :verb-synsets :adverb-synsets :adjective-synsets} It is computationally expensive, but memoized.
The maximum depth of the taxonomy for the POS. Call it with one of #{:noun-synsets :verb-synsets :adverb-synsets :adjective-synsets} It is computationally expensive, but memoized.
(wup-similarity dict term1 term2)
Wu-Palmer Similarity: Return a score denoting how similar two word senses are, based on the depth of the two senses in the taxonomy and that of their Least Common Subsumer (most specific ancestor node, LCS).
Where the LCS has multiple paths to the root, the longer path is used for the purposes of the calculation.
Wu-Palmer Similarity: Return a score denoting how similar two word senses are, based on the depth of the two senses in the taxonomy and that of their Least Common Subsumer (most specific ancestor node, LCS). Where the LCS has multiple paths to the root, the longer path is used for the purposes of the calculation.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close