ANY23-332 remove plugin properties from default config
Project: http://git-wip-us.apache.org/repos/asf/any23/repo Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/5aba30bb Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/5aba30bb Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/5aba30bb Branch: refs/heads/master Commit: 5aba30bb5be3f045f3441f2d595a9ca9dccab949 Parents: ead895e Author: Hans <[email protected]> Authored: Mon Oct 29 11:23:32 2018 -0500 Committer: Hans <[email protected]> Committed: Mon Oct 29 11:23:32 2018 -0500 ---------------------------------------------------------------------- api/src/main/resources/default-configuration.properties | 8 ++------ .../any23/plugin/extractor/openie/OpenIEExtractor.java | 9 +++++++-- 2 files changed, 9 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/5aba30bb/api/src/main/resources/default-configuration.properties ---------------------------------------------------------------------- diff --git a/api/src/main/resources/default-configuration.properties b/api/src/main/resources/default-configuration.properties index 4f68586..0991f23 100644 --- a/api/src/main/resources/default-configuration.properties +++ b/api/src/main/resources/default-configuration.properties @@ -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 http://git-wip-us.apache.org/repos/asf/any23/blob/5aba30bb/plugins/openie/src/main/java/org/apache/any23/plugin/extractor/openie/OpenIEExtractor.java ---------------------------------------------------------------------- diff --git a/plugins/openie/src/main/java/org/apache/any23/plugin/extractor/openie/OpenIEExtractor.java b/plugins/openie/src/main/java/org/apache/any23/plugin/extractor/openie/OpenIEExtractor.java index d02b5a2..9b62626 100644 --- a/plugins/openie/src/main/java/org/apache/any23/plugin/extractor/openie/OpenIEExtractor.java +++ b/plugins/openie/src/main/java/org/apache/any23/plugin/extractor/openie/OpenIEExtractor.java @@ -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());
