From: <ki...@us...> - 2012-11-02 17:47:45
|
Revision: 3867 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3867&view=rev Author: kirdie Date: 2012-11-02 17:47:38 +0000 (Fri, 02 Nov 2012) Log Message: ----------- began bugfixing learner 2. Modified Paths: -------------- branches/hmm/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner2.java branches/hmm/components-ext/src/test/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner3Test.java Modified: branches/hmm/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner2.java =================================================================== --- branches/hmm/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner2.java 2012-11-02 14:52:52 UTC (rev 3866) +++ branches/hmm/components-ext/src/main/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner2.java 2012-11-02 17:47:38 UTC (rev 3867) @@ -713,6 +713,7 @@ Set<WeightedQuery> tmp = new TreeSet<WeightedQuery>(); List<Slot> sortedSlots = new ArrayList<Slot>(); Set<Slot> classSlots = new HashSet<Slot>(); + // TODO: can this be optimized to be in just one loop? (but I guess it won't give a noticable performance benefit anyways...) for(Slot slot : t.getSlots()){ if(slot.getSlotType() == SlotType.CLASS){ sortedSlots.add(slot); Modified: branches/hmm/components-ext/src/test/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner3Test.java =================================================================== --- branches/hmm/components-ext/src/test/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner3Test.java 2012-11-02 14:52:52 UTC (rev 3866) +++ branches/hmm/components-ext/src/test/java/org/dllearner/algorithm/tbsl/learning/SPARQLTemplateBasedLearner3Test.java 2012-11-02 17:47:38 UTC (rev 3867) @@ -117,11 +117,11 @@ private static final File evaluationFolder = new File("cache/evaluation"); private static final boolean DBPEDIA_PRETAGGED = true; private static final boolean OXFORD_PRETAGGED = false; - private static final int MAX_NUMBER_OF_QUESTIONS = Integer.MAX_VALUE; - private static final boolean WHITELIST_ONLY = false; + private static final int MAX_NUMBER_OF_QUESTIONS = 20; + private static final boolean WHITELIST_ONLY = true; private static final Set<Integer> WHITELIST = Collections.unmodifiableSet(new HashSet<Integer>(Arrays.asList(new Integer[] {4}))); - /*@Test*/ public void testDBpedia() throws Exception + @Test public void testDBpedia() throws Exception { File file = generateTestDataIfNecessary( new File(getClass().getClassLoader().getResource("tbsl/evaluation/qald2-dbpedia-train-tagged(ideal).xml").getFile()), @@ -767,7 +767,7 @@ Map<Integer,Future<LearnStatus>> futures = new HashMap<Integer,Future<LearnStatus>>(); // List<FutureTask> todo = new ArrayList<FutureTask>(id2Question.size()); - ExecutorService service = Executors.newFixedThreadPool(1); + ExecutorService service = Executors.newCachedThreadPool();// newFixedThreadPool(1); for(int i: id2Question.keySet()) {//if(i != 78)continue; @@ -1001,7 +1001,7 @@ } } - @Test public void testSolrGoodResults() + /*@Test*/ public void testSolrGoodResults() { Knowledgebase dbpedia = createDBpediaLiveKnowledgebase(dbpediaLiveCache); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |