ANY23-332 remove plugin properties from default config
authorHans <firedrake93@gmail.com>
Mon, 29 Oct 2018 16:23:32 +0000 (11:23 -0500)
committerHans <firedrake93@gmail.com>
Mon, 29 Oct 2018 16:23:32 +0000 (11:23 -0500)
api/src/main/resources/default-configuration.properties
plugins/openie/src/main/java/org/apache/any23/plugin/extractor/openie/OpenIEExtractor.java

index 4f68586..0991f23 100644 (file)
@@ -43,8 +43,8 @@ any23.extraction.metadata.domain.per.entity=off
 
 # Allows to decide which RDFa Extractor to enable.
 # If 'on' will be activated the programmatic RDFa 1.1 Extractor
-# (org.deri.any23.extractor.rdfa.RDFa11Extractor) otherwise will be
-# registered the RDFa 1.0 legacy one (org.deri.any23.extractor.rdfa.RDFaExtractor).
+# (org.apache.any23.extractor.rdfa.RDFa11Extractor) otherwise will be
+# registered the RDFa 1.0 legacy one (org.apache.any23.extractor.rdfa.RDFaExtractor).
 any23.extraction.rdfa.programmatic=on
 
 # The extraction context IRI to be used by the
@@ -72,7 +72,3 @@ any23.extraction.head.meta=on
 # Allows to specify a CSV file separator and comment delimeter
 any23.extraction.csv.field=,
 any23.extraction.csv.comment=#
-
-# A confidence threshold for the OpenIE extractions
-# Any extractions below this value will not be processed.
-any23.extraction.openie.confidence.threshold=0.5
index d02b5a2..9b62626 100644 (file)
@@ -120,8 +120,13 @@ public class OpenIEExtractor implements Extractor.TagSoupDOMExtractor {
         // instance.extr().arg1().text() - subject
         // instance.extr().rel().text() - predicate
         // instance.extr().arg2s().text() - object
-        final Configuration immutableConf = DefaultConfiguration.singleton();
-        Double threshold = Double.parseDouble(immutableConf.getProperty("any23.extraction.openie.confidence.threshold", "0.5"));
+        String thresholdString;
+        try {
+            thresholdString = extractionParameters.getProperty("any23.extraction.openie.confidence.threshold");
+        } catch (RuntimeException e) {
+            thresholdString = null;
+        }
+        double threshold = thresholdString == null ? 0.5 : Double.parseDouble(thresholdString);
         for(Instance instance : listExtractions) {
             if (instance.confidence() > threshold) {
                 List<Argument> listArg2s = JavaConversions.seqAsJavaList(instance.extr().arg2s());