当前位置: 首页>>代码示例>>Java>>正文


Java BinaryVectorUtils.orthogonalizeVectors方法代码示例

本文整理汇总了Java中pitt.search.semanticvectors.vectors.BinaryVectorUtils.orthogonalizeVectors方法的典型用法代码示例。如果您正苦于以下问题:Java BinaryVectorUtils.orthogonalizeVectors方法的具体用法?Java BinaryVectorUtils.orthogonalizeVectors怎么用?Java BinaryVectorUtils.orthogonalizeVectors使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pitt.search.semanticvectors.vectors.BinaryVectorUtils的用法示例。


在下文中一共展示了BinaryVectorUtils.orthogonalizeVectors方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VectorSearcherSubspaceSim

import pitt.search.semanticvectors.vectors.BinaryVectorUtils; //导入方法依赖的package包/类
/**
 * @param queryVecStore Vector store to use for query generation.
 * @param searchVecStore The vector store to search.
 * @param luceneUtils LuceneUtils object to use for query weighting. (May be null.)
 * @param queryTerms Terms that will be parsed and used to generate a query subspace.
 */
public VectorSearcherSubspaceSim(VectorStore queryVecStore,
    VectorStore searchVecStore,
    LuceneUtils luceneUtils,
    FlagConfig flagConfig,
    String[] queryTerms)
        throws ZeroVectorException {
  super(queryVecStore, searchVecStore, luceneUtils, flagConfig);
  this.disjunctSpace = new ArrayList<Vector>();
  this.vectorType = flagConfig.vectortype();
  
  for (int i = 0; i < queryTerms.length; ++i) {
    System.out.println("\t" + queryTerms[i]);
    // There may be compound disjuncts, e.g., "A NOT B" as a single argument.
    String[] tmpTerms = queryTerms[i].split("\\s");
    Vector tmpVector = CompoundVectorBuilder.getQueryVector(
        queryVecStore, luceneUtils, flagConfig, tmpTerms);
    if (tmpVector != null) {
      this.disjunctSpace.add(tmpVector);
    }
  }
  if (this.disjunctSpace.size() == 0) {
    throw new ZeroVectorException("No nonzero input vectors ... no results.");
  }
  if (!vectorType.equals(VectorType.BINARY))
    VectorUtils.orthogonalizeVectors(this.disjunctSpace);
  else BinaryVectorUtils.orthogonalizeVectors(this.disjunctSpace);
}
 
开发者ID:semanticvectors,项目名称:semanticvectors,代码行数:34,代码来源:VectorSearcher.java

示例2: VectorSearcherSubspaceSim

import pitt.search.semanticvectors.vectors.BinaryVectorUtils; //导入方法依赖的package包/类
/**
 * @param queryVecStore Vector store to use for query generation.
 * @param searchVecStore The vector store to search.
 * @param luceneUtils LuceneUtils object to use for query weighting. (May be null.)
 * @param queryTerms Terms that will be parsed and used to generate a query subspace.
 */
public VectorSearcherSubspaceSim(VectorStore queryVecStore,
    VectorStore searchVecStore,
    LuceneUtils luceneUtils,
    FlagConfig flagConfig,
    String[] queryTerms)
        throws ZeroVectorException {
  super(queryVecStore, searchVecStore, luceneUtils, flagConfig);
  this.disjunctSpace = new ArrayList<Vector>();

  for (int i = 0; i < queryTerms.length; ++i) {
    System.out.println("\t" + queryTerms[i]);
    // There may be compound disjuncts, e.g., "A NOT B" as a single argument.
    String[] tmpTerms = queryTerms[i].split("\\s");
    Vector tmpVector = CompoundVectorBuilder.getQueryVector(
        queryVecStore, luceneUtils, flagConfig, tmpTerms);
    if (tmpVector != null) {
      this.disjunctSpace.add(tmpVector);
    }
  }
  if (this.disjunctSpace.size() == 0) {
    throw new ZeroVectorException("No nonzero input vectors ... no results.");
  }
  if (!vectorType.equals(VectorType.BINARY))
    VectorUtils.orthogonalizeVectors(this.disjunctSpace);
  else BinaryVectorUtils.orthogonalizeVectors(this.disjunctSpace);
}
 
开发者ID:tuxdna,项目名称:semanticvectors-googlecode,代码行数:33,代码来源:VectorSearcher.java


注:本文中的pitt.search.semanticvectors.vectors.BinaryVectorUtils.orthogonalizeVectors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。