【问题标题】:maximum score in WordNet based similarity基于 WordNet 相似度的最高分
【发布时间】:2013-11-21 04:57:39
【问题描述】:

一些相似度分数介于 0 和 1 之间,例如最短路径和 WuP。因此汽车和汽车之间的相似度将为 1,但其他度量值(例如 LCh)将为

lch( car, automobile ) = 3.6889

我想知道这些措施的最高分。 3.6889 是否被认为是最大值?这些是否意味着 LCH 分数在 0 到 3.6889 之间。

我添加了以下措施

jcn( car, automobile ) = 12876699.5
res( car, automobile ) = 9.3679
lesk( car, automobile ) = 9519 

【问题讨论】:

  • 另外,看看word2vec - 可能会很有趣!

标签: wordnet ws4py


【解决方案1】:

似乎 3.6375861597263857 是 lch_similarity 的最大值(我无法获得 3.6889...)。 lch_similarity,根据the documentation有如下属性:

Leacock Chodorow Similarity:
        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 the similarity of the two ``Synset`` objects,
            normally greater than 0. None is returned if no connecting path
            could be found. If a ``Synset`` is compared with itself, the
            maximum score is returned, which varies depending on the taxonomy
            depth.

鉴于rock_hind.n.01 在 WordNet 分类中处于最深层次 (19),而 change.n.06 处于最浅层次 (2),我们可以尝试不同的深度:

>>> from nltk.corpus import wordnet as wn
>>> rock = wn.synset('rock_hind.n.01')
>>> change = wn.synset('change.n.06')
>>> rock.lch_similarity(rock)
3.6375861597263857
>>> change.lch_similarity(change)
3.6375861597263857
>>> change.lch_similarity(rock)
0.7472144018302211
>>> rock.lch_similarity(change)
0.7472144018302211

可以对其他措施进行类似的实验,其中范围似乎相当大:

>>> from nltk.corpus import wordnet_ic, genesis
>>> brown_ic = wordnet_ic.ic('ic-brown.dat')
>>> semcor_ic = wordnet_ic.ic('ic-semcor.dat')
>>> genesis_ic = wn.ic(genesis, False, 0.0)
>>> rock.res_similarity(rock, brown_ic) # res_similarity, brown
1e+300
>>> rock.res_similarity(change, brown_ic)
-0.0
>>> rock.res_similarity(rock, semcor_ic) # res_similarity, semcor
1e+300
>>> rock.res_similarity(change, semcor_ic)
-0.0
>>> rock.res_similarity(rock, genesis_ic) # res_similarity, genesis
1e+300
>>> rock.res_similarity(change, genesis_ic)
-0.08306855877006339
>>> change.res_similarity(rock, genesis_ic)
-0.08306855877006339
>>> rock.jcn_similarity(rock, brown_ic) # jcn, brown - results are identical with semcor and genesis
1e+300
>>> rock.jcn_similarity(change, brown_ic)
1e-300
>>> change.jcn_similarity(rock, brown_ic)
1e-300

【讨论】:

  • 感谢您的回答,这是否意味着 lch、jcn、res 和 lesk 没有确切的上限。在这种情况下如何设置特定阈值。
  • 嗨!我添加了 jcn 和 res 的实验 - 不确定你对 lesk 的意思......你是说 lin 吗?
  • @JanMohd 你找到 jcn 的上限了吗?因为我也有同样的问题。
猜你喜欢
  • 2018-07-24
  • 2016-04-18
  • 1970-01-01
  • 2017-06-07
  • 2013-03-18
  • 1970-01-01
  • 1970-01-01
  • 2021-09-12
  • 2016-01-29
相关资源
最近更新 更多