|
From: <jen...@us...> - 2008-08-20 11:21:40
|
Revision: 1105
http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1105&view=rev
Author: jenslehmann
Date: 2008-08-20 11:21:37 +0000 (Wed, 20 Aug 2008)
Log Message:
-----------
improved display of best class descriptions in DL-Learner GUI (now in Manchester OWL Syntax using base URI and prefixes in OWL file, accuracy of each class description is also shown)
Modified Paths:
--------------
trunk/examples/father.conf
trunk/src/dl-learner/org/dllearner/gui/Config.java
trunk/src/dl-learner/org/dllearner/gui/RunPanel.java
Modified: trunk/examples/father.conf
===================================================================
--- trunk/examples/father.conf 2008-08-19 17:35:48 UTC (rev 1104)
+++ trunk/examples/father.conf 2008-08-20 11:21:37 UTC (rev 1105)
@@ -11,8 +11,8 @@
import("father.kb");
+// reasoner = dig;
-
/** examples **/
+stefan
+markus
Modified: trunk/src/dl-learner/org/dllearner/gui/Config.java
===================================================================
--- trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-08-19 17:35:48 UTC (rev 1104)
+++ trunk/src/dl-learner/org/dllearner/gui/Config.java 2008-08-20 11:21:37 UTC (rev 1105)
@@ -1,5 +1,3 @@
-package org.dllearner.gui;
-
/**
* Copyright (C) 2007-2008, Jens Lehmann
*
@@ -20,6 +18,8 @@
*
*/
+package org.dllearner.gui;
+
import org.dllearner.core.ComponentManager;
import org.dllearner.core.KnowledgeSource;
import org.dllearner.core.LearningProblem;
Modified: trunk/src/dl-learner/org/dllearner/gui/RunPanel.java
===================================================================
--- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-08-19 17:35:48 UTC (rev 1104)
+++ trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-08-20 11:21:37 UTC (rev 1105)
@@ -25,9 +25,14 @@
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
+import java.text.DecimalFormat;
import java.util.List;
+import java.util.Map;
+
import javax.swing.*;
+import org.dllearner.core.EvaluatedDescription;
+
/**
* @author Tilo Hielscher
*
@@ -35,6 +40,7 @@
public class RunPanel extends JPanel implements ActionListener {
private static final long serialVersionUID = 1643304576470046636L;
+ private DecimalFormat df = new DecimalFormat();
private JButton runButton, stopButton, treeButton;
private JTextArea infoArea;
@@ -172,9 +178,9 @@
infoArea.setText("");
// best solutions
- if (config.getLearningAlgorithm().getCurrentlyBestEvaluatedDescriptions(5) != null) {
- infoArea.append("Best solutions: \n\n"
- + listToString(config.getLearningAlgorithm().getCurrentlyBestEvaluatedDescriptions(10)) + "\n");
+ if (config.getLearningAlgorithm().getCurrentlyBestDescriptions() != null) {
+ infoArea.append("Best class descriptions in Manchester OWL Syntax: \n\n"
+ + getSolutionString(config.getLearningAlgorithm().getCurrentlyBestEvaluatedDescriptions(10)) + "\n");
}
// solution score
// if (config.getLearningAlgorithm().getSolutionScore() != null)
@@ -292,6 +298,17 @@
gbc.weighty = wy;
}
+ public String getSolutionString(List<EvaluatedDescription> solutions) {
+ String baseURI = config.getReasoningService().getBaseURI();
+ Map<String,String> prefixes = config.getReasoningService().getPrefixes();
+ String string = "";
+ for (EvaluatedDescription d : solutions) {
+ string += "accuracy: " + (df.format(d.getAccuracy()*100)) + "%: \t"
+ + d.getDescription().toManchesterSyntaxString(baseURI, prefixes) + "\n";
+ }
+ return string;
+ }
+
/**
* Make a string from list, every entry in new line.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|