【问题标题】:Comparing Shingles for Near-Duplicate Detection比较带状疱疹的近重复检测
【发布时间】:2019-01-04 22:34:22
【问题描述】:

我正在处理叠放代码以比较近似重复项。我有点卡在比较代码上。这是我迄今为止的粗略尝试。

//shingles are already hashed integers and I'm working on the evaluation to true via the float similar parameter.
public static boolean compareShingles(float similar, CompareObject comp1, CompareObject comp2) {
        int intersections = 0;
        if(comp1.getShingle().size()>=comp2.getShingle().size()){
        for(int i = 0; i < comp1.getShingle().size(); i++){

              if(comp1.getShingle().get(i).equals(comp2.getShingle().get(i))){
              intersections++;
              }

        }
        }
        else{
              for(int i = 0; i < comp2.getShingle().size(); i++){
                    if(comp2.getShingle().get(i).equals(comp1.getShingle().get(i))){
                    intersections++;
                    }

              }
        }
        return true; //not functional still working on when to return true
  }

如果我应该在一个数组中比较这些带状疱疹 1-1 还是应该将一个带状疱疹与循环中的所有带状疱疹进行比较,我有点犹豫。

例如,如果我循环比较每个带状疱疹和每个其他带状疱疹,那么这些文档将是相同的......

{blah blah blah, Once upon a, time blah blah}
{Once upon a, time blah blah, blah blah blah}

如果我对同一个文档进行位置比较,那么位置 1 将是“blah blah blah”与“Once on a”相比,这将返回 false。

我认为循环会更加密集,但它可能是正确的选择。想法?

【问题讨论】:

    标签: java duplicates bigdata data-mining shingles


    【解决方案1】:

    顺序无关紧要..

    您基本上制作了瓦片组并将它们与 Jaccard 相似度进行比较。它有助于有一个散列来自动丢弃重复的带状疱疹。只需计算每个文档之间的匹配项,并计算出需要匹配多少个才能认为它们相似。

    http://ethen8181.github.io/machine-learning/clustering_old/text_similarity/text_similarity.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多