Example #1
0
  private static void startKnowBrainTest(String path) {
    EngineInterface recEngine = new TagRecommenderEvalEngine();
    try {
      recEngine.loadFile(path);
    } catch (Exception e) {
      e.printStackTrace();
    }

    // topics:t286,t40,t508 for 3Layers
    System.out.println(
        "Tags for user: "******"14", null, Arrays.asList("t3"), 10, false, Algorithm.THREELcoll, null));
    System.out.println(
        "Tags for user: "******"14",
                null,
                Arrays.asList("t848", "t655", "t448", "t40", "t53", "t997", "t508", "t268"),
                10,
                false,
                Algorithm.THREELcoll,
                null));
    System.out.println(
        "Tags for user: "******"14", null, Arrays.asList("t3"), 10, false, Algorithm.BLLcoll, null));
    System.out.println(
        "Tags for user: "******"14",
                null,
                Arrays.asList("t848", "t655", "t448", "t40", "t53", "t997", "t508", "t268"),
                10,
                false,
                Algorithm.BLLcoll,
                null));
    System.out.println(
        "Tags for user: "******"14",
                null,
                Arrays.asList("t848", "t655", "t448", "t40", "t53", "t997", "t508", "t268"),
                10,
                false,
                Algorithm.MP,
                null));
    // System.out.println("Tags for user: "******"14", null,
    // Arrays.asList("t3"), 10, false, Algorithm.THREEL, null));
    // System.out.println("Tags for user: "******"14", null,
    // Arrays.asList("t848","t655","t448","t40","t53","t997","t508","t268"), 10, false,
    // Algorithm.THREEL, null));
    // System.out.println("Tags for user: "******"14", null,
    // Arrays.asList("t3"), 10, false, Algorithm.BLL, null));
    // System.out.println("Tags for user: "******"14", null,
    // Arrays.asList("t848","t655","t448","t40","t53","t997","t508","t268"), 10, false,
    // Algorithm.BLL, null));
  }
Example #2
0
  // Engine testing
  // --------------------------------------------------------------------------------------------------------------------------------------------------------------------
  private static void startEngineTest(String path) {
    EngineInterface recEngine = new EntityRecommenderEngine();
    try {
      recEngine.loadFile(path);
    } catch (Exception e) {
      e.printStackTrace();
    }
    System.out.println(
        "Tags for user and resource: "
            + recEngine.getEntitiesWithLikelihood(
                "0", "0", null, 10, false, null, EntityType.TAG)); // BLLac+MPr
    System.out.println(
        "Tags for user: "******"0", null, null, 10, false, null, EntityType.TAG)); // BLL
    System.out.println(
        "Tags for resource: "
            + recEngine.getEntitiesWithLikelihood(
                null, "0", null, 10, false, null, EntityType.TAG)); // MPr
    System.out.println(
        "Tags MostPopular: "
            + recEngine.getEntitiesWithLikelihood(
                null, null, null, 10, false, null, EntityType.TAG)); // MP

    System.out.println(
        "LD - Resources for user (Tags):"
            + recEngine.getEntitiesWithLikelihood(
                "0",
                null,
                null,
                10,
                false,
                Algorithm.RESOURCETAGCB,
                EntityType.RESOURCE)); // CBtags
    System.out.println(
        "Resources for user (CF): "
            + recEngine.getEntitiesWithLikelihood(
                "0",
                null,
                null,
                10,
                false,
                null /* or Algorithm.RESOURCECF */,
                EntityType.RESOURCE)); // CF
    System.out.println(
        "Resources for resource: "
            + recEngine.getEntitiesWithLikelihood(
                null, "0", null, 10, false, null, EntityType.RESOURCE)); // CF
    System.out.println(
        "Resources MostPopular: "
            + recEngine.getEntitiesWithLikelihood(
                null, null, null, 10, false, null, EntityType.RESOURCE)); // MP

    System.out.println(
        "LD - Users for resource (Tags): "
            + recEngine.getEntitiesWithLikelihood(
                null,
                "0",
                null,
                10,
                false,
                null /* or Algorithm.USERTAGCB */,
                EntityType.USER)); // CBtags
    System.out.println(
        "Users for user: "******"0", null, null, 10, false, null, EntityType.USER)); // CF
    System.out.println(
        "Users MostPopular: "
            + recEngine.getEntitiesWithLikelihood(
                null, null, null, 10, false, null, EntityType.USER)); // MP
  }