public <T extends Comparable<T>>Map<T,Double> recommendDocsUsingDocQuery(List<T> recentItems,QueryTransform<T> docTransform,int numResults,Set<T> exclusions,T minDoc,boolean ignorePerfectMatches){
  Map<T,Double> scores=new HashMap<>();
  for (  T recent : recentItems) {
    ArrayList<SemVectorResult<T>> docResult=new ArrayList<>();
    recommendDocsUsingDocQuery(recent,docResult,docTransform,numResults * 10,exclusions,minDoc);
    for (    SemVectorResult<T> r : docResult) {
      Double score=scores.get(r.result);
      if (ignorePerfectMatches && r.score == 1.0)       logger.info("Ignoring perfect match between " + recent + " and "+ r.result+ " overlap "+ r.score);
 else {
        if (score != null)         score=score + r.score;
 else         score=r.score;
        scores.put(r.result,score);
      }
    }
  }
  return RecommendationUtils.rescaleScoresToOne(scores,numResults);
}

public < T extends Comparable < T > > Map < T , Double > recommendDocsUsingDocQuery ( List < T > recentItems , QueryTransform < T > docTransform , int numResults , Set < T > exclusions , T minDoc , boolean ignorePerfectMatches ) { Map < T , Double > scores = new HashMap < > ( ) ; for ( T recent : recentItems ) { ArrayList < SemVectorResult < T > > docResult = new ArrayList < > ( ) ; recommendDocsUsingDocQuery ( recent , docResult , docTransform , numResults * 10 , exclusions , minDoc ) ; for ( SemVectorResult < T > r : docResult ) { Double score = scores . get ( r . result ) ; if ( ignorePerfectMatches && r . score == 1.0 ) logger . info ( "Ignoring perfect match between " + recent + " and " + r . result + " overlap " + r . score ) ; else { if ( score != null ) score = score + r . score ; else score = r . score ; scores . put ( r . result , score ) ; } } } return RecommendationUtils . rescaleScoresToOne ( scores , numResults ) ; }
recommend a set of documents based on some recent viewed documents
