Here are the examples of the java api org.apache.uima.UimaContext taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
101 Examples
19
Source : CompressedXmiWriter.java
with Apache License 2.0
from UKPLab
with Apache License 2.0
from UKPLab
@Override
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
// some param check
if (!outputFile.getName().endsWith(".tar.gz")) {
throw new ResourceInitializationException(new IllegalArgumentException("Output file must have .tar.gz extension"));
}
typeSystemWritten = false;
try {
outputStream = new TarArchiveOutputStream(new GzipCompressorOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile))));
} catch (IOException ex) {
throw new ResourceInitializationException(ex);
}
}
19
Source : CompressedXmiReader.java
with Apache License 2.0
from UKPLab
with Apache License 2.0
from UKPLab
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
try {
tarArchiveInputStream = new TarArchiveInputStream(new GZIPInputStream(new FileInputStream(sourceLocation)));
fastForwardToNextValidEntry();
} catch (IOException ex) {
throw new ResourceInitializationException(ex);
}
}
19
Source : I2b2ReadyFileWriter.java
with Apache License 2.0
from tmills
with Apache License 2.0
from tmills
@Override
public void initialize(final UimaContext context) throws ResourceInitializationException {
super.initialize(context);
}
19
Source : IgnorableSectionAnnotator.java
with Apache License 2.0
from tmills
with Apache License 2.0
from tmills
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
logger = context.getLogger();
}
19
Source : OutputSegments.java
with GNU General Public License v3.0
from riedlma
with GNU General Public License v3.0
from riedlma
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
if (output == null) {
ps = System.out;
} else {
try {
ps = new PrintStream(output);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
ps.println("<doreplacedents>");
}
19
Source : GibbsLdaTopicModelAnnotator.java
with GNU General Public License v3.0
from riedlma
with GNU General Public License v3.0
from riedlma
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
LDACmdOption options = new LDACmdOption();
options.dir = ldaModelDir;
options.modelName = ldaModelName;
options.niters = ldaInferenceIteration;
// Initiliaze inferencer
inferencer = new Inferencer();
inferencer.init(options);
}
19
Source : CRFAnnotator.java
with Apache License 2.0
from OHNLP
with Apache License 2.0
from OHNLP
@Override
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
leftWindow = ((Integer) aContext.getConfigParameterValue(PARAM_LW)).intValue();
rightWindow = ((Integer) aContext.getConfigParameterValue(PARAM_RW)).intValue();
File modelFile = new File((String) aContext.getConfigParameterValue(PARAM_MODEL));
String crfHome = (String) aContext.getConfigParameterValue(PARAM_CRFHome);
try {
fg = new FeatureGenerator(modelFile, crfHome);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
19
Source : MedTaggerIEAnnotator.java
with Apache License 2.0
from OHNLP
with Apache License 2.0
from OHNLP
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
resource_dir = (String) aContext.getConfigParameterValue(PARAM_RESOURCE_DIR);
rum = new ResourceUtilManager(resource_dir);
deleteAllInsideMatch = (Boolean) aContext.getConfigParameterValue(removeAllSub);
if (deleteAllInsideMatch == null) {
deleteAllInsideMatch = false;
}
}
19
Source : MedTaggerDynamicIEAnnotator.java
with Apache License 2.0
from OHNLP
with Apache License 2.0
from OHNLP
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
deleteAllInsideMatch = (Boolean) aContext.getConfigParameterValue(removeAllSub);
if (deleteAllInsideMatch == null) {
deleteAllInsideMatch = false;
}
}
19
Source : PmcContentSetter.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
urlFormat = UimaContextHelper.getConfigParameterStringValue(context, "url-format");
}
19
Source : QuestionLemmaDedowncaserDenormalizer.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
mpreplacedyzer = new EnglishMPreplacedyzer();
}
19
Source : PassageToViewCopier.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
viewNamePrefix = UimaContextHelper.getConfigParameterStringValue(context, "view-name-prefix");
}
19
Source : ScoreSummationConceptReranker.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
limit = UimaContextHelper.getConfigParameterIntValue(context, "limit", 5);
}
19
Source : MatchingNameConceptReranker.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
bonus = UimaContextHelper.getConfigParameterFloatValue(context, "bonus", 100F);
}
19
Source : CasSerializer.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
typesystem = UimaContextHelper.getConfigParameterStringValue(context, "typesystem");
dir = UimaContextHelper.getConfigParameterStringValue(context, "dir");
}
19
Source : SimpleAnswerScorer.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
typeCoerSmoothing = UimaContextHelper.getConfigParameterFloatValue(context, "type-coer-smoothing", 0.1f);
}
19
Source : ConceptAbstractQueryGenerator.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
useType = UimaContextHelper.getConfigParameterBooleanValue(context, "use-type", false);
useWeight = UimaContextHelper.getConfigParameterBooleanValue(context, "use-weight", false);
required = UimaContextHelper.getConfigParameterBooleanValue(context, "required", false);
}
19
Source : PredictionsWriter.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
// try {
// out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(mentionOutputFile)));
// } catch (FileNotFoundException e) {
// throw new ResourceInitializationException(e);
// }
out.add("#Gold Prediction");
}
19
Source : NerOutputWriter.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
try {
out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(outputFile)));
} catch (FileNotFoundException e) {
throw new ResourceInitializationException(e);
}
}
19
Source : MentionSpansEvaluationWriter.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
results = new ArrayList<>();
logger = Logger.getLogger(getClreplaced());
try {
out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(outputFile)));
} catch (FileNotFoundException e) {
throw new ResourceInitializationException(e);
}
}
19
Source : ManualAnnotationsAnnotator.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
manualDocMap = extractManualDoreplacedents((String) aContext.getConfigParameterValue("manualAnnotationsLocation"), (boolean) aContext.getConfigParameterValue("namedEnreplacedyPerToken"));
}
19
Source : DictionaryFeaturesAnnotator.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
initForLanguage(language);
}
19
Source : Conll2003AidaReader.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext aContext) throws ResourceInitializationException {
if (begin > end) {
throw new ResourceInitializationException();
}
super.initialize(aContext);
}
19
Source : StanfordChineseNER.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
expectedSuccessdingTags.put("GPE", "GPE");
expectedSuccessdingTags.put("I-GPE", "I-GPE");
expectedSuccessdingTags.put("B-GPE", "I-GPE");
expectedSuccessdingTags.put("LOC", "LOC");
expectedSuccessdingTags.put("I-LOC", "I-LOC");
expectedSuccessdingTags.put("B-LOC", "I-LOC");
expectedSuccessdingTags.put("PERSON", "PERSON");
expectedSuccessdingTags.put("I-PER", "I-PER");
expectedSuccessdingTags.put("B-PER", "I-PER");
expectedSuccessdingTags.put("ORG", "ORG");
expectedSuccessdingTags.put("I-ORG", "I-ORG");
expectedSuccessdingTags.put("B-ORG", "I-ORG");
expectedSuccessdingTags.put("MISC", "MISC");
expectedSuccessdingTags.put("I-MISC", "I-MISC");
expectedSuccessdingTags.put("B-MISC", "I-MISC");
try {
Properties props = ClreplacedPathUtils.getPropertiesFromClreplacedpath("edu/stanford/nlp/models/ner/chinese.kbp.distsim.prop");
// false not for english
props.put("ner.useSUTime", "false");
// false not for english
props.put("ner.applyNumericClreplacedifiers", "false");
props.put("mergeTags", "false");
clreplacedifier = CRFClreplacedifier.getClreplacedifier("edu/stanford/nlp/models/ner/chinese.kbp.distsim.crf.ser.gz", props);
} catch (IOException | ClreplacedNotFoundException e) {
throw new ResourceInitializationException(e);
}
}
19
Source : ConllWriter.java
with Apache License 2.0
from ambiverse-nlu
with Apache License 2.0
from ambiverse-nlu
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
if (write != null) {
for (String w : write.split(",")) {
toWrite.add(w);
}
}
}
18
Source : ArgumentsToHTMLExporter.java
with Apache License 2.0
from UKPLab
with Apache License 2.0
from UKPLab
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
try {
out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(outputFile), "UTF-8"));
// print header
printHeader(out);
} catch (IOException e) {
throw new ResourceInitializationException(e);
}
}
18
Source : MistAnalysisEngine.java
with Apache License 2.0
from tmills
with Apache License 2.0
from tmills
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
Options options = new Options(new String[] { "--prior-adjust", "-1.0", "--region", "zone:region_type=body" });
decoder = new TextDecoder(options, this.modelPath);
}
18
Source : TopicTilingSegmenterAnnotator.java
with GNU General Public License v3.0
from riedlma
with GNU General Public License v3.0
from riedlma
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
}
18
Source : LvgLookup.java
with Apache License 2.0
from OHNLP
with Apache License 2.0
from OHNLP
@Override
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
try {
// String dict = aContext.getResourceFilePath("lvg_dict");
// String openclreplacedFile = aContext.getResourceFilePath("openclreplaced");
// localInitialize(dict, openclreplacedFile);
InputStream dictInStream = aContext.getResourcereplacedtream("lvg_dict");
InputStream openclreplacedFileStream = aContext.getResourcereplacedtream("openclreplaced");
localInitialize(dictInStream, openclreplacedFileStream);
} catch (ResourceAccessException e) {
e.printStackTrace();
}
}
18
Source : IETabDelimitedWriter.java
with Apache License 2.0
from OHNLP
with Apache License 2.0
from OHNLP
/**
* initialize
*/
public void initialize(UimaContext aContext) throws ResourceInitializationException {
mDocNum = 0;
mOutputDir = new File((String) aContext.getConfigParameterValue(PARAM_OUTPUTDIR));
if (!mOutputDir.exists()) {
mOutputDir.mkdirs();
}
}
18
Source : RuleContextAnnotator.java
with Apache License 2.0
from OHNLP
with Apache License 2.0
from OHNLP
@Override
public void initialize(UimaContext ctxt) throws ResourceInitializationException {
super.initialize(ctxt);
try {
contextSettings = new LinkedList<>();
for (int priority : RULE_PRIORITIES) {
contextSettings.add(new ConTexTSettings(ConTexTSettings.clreplaced.getResourcereplacedtream("/medtaggerresources/context/contextRule.txt"), priority));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
}
}
18
Source : GoPubMedTripleRetrievalExecutor.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String conf = UimaContextHelper.getConfigParameterStringValue(context, "conf");
PropertiesConfiguration gopubmedProperties = new PropertiesConfiguration();
try {
gopubmedProperties.load(getClreplaced().getResourcereplacedtream(conf));
} catch (ConfigurationException e) {
throw new ResourceInitializationException(e);
}
service = new GoPubMedService(gopubmedProperties);
pages = UimaContextHelper.getConfigParameterIntValue(context, "pages", 1);
hits = UimaContextHelper.getConfigParameterIntValue(context, "hits", 100);
bopQueryStringConstructor = new BagOfPhraseQueryStringConstructor();
}
18
Source : GoPubMedDocumentRetrievalExecutor.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String conf = UimaContextHelper.getConfigParameterStringValue(context, "conf");
PropertiesConfiguration gopubmedProperties = new PropertiesConfiguration();
try {
gopubmedProperties.load(getClreplaced().getResourcereplacedtream(conf));
} catch (ConfigurationException e) {
throw new ResourceInitializationException(e);
}
service = new GoPubMedService(gopubmedProperties);
pages = UimaContextHelper.getConfigParameterIntValue(context, "pages", 1);
hits = UimaContextHelper.getConfigParameterIntValue(context, "hits", 100);
queryStringConstructor = new PubMedQueryStringConstructor();
}
18
Source : DiXuProprietaryDocumentRetrievalClient.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
host = UimaContextHelper.getConfigParameterStringValue(context, "host");
port = UimaContextHelper.getConfigParameterIntValue(context, "port", 10080);
uriPrefix = UimaContextHelper.getConfigParameterStringValue(context, "uri-prefix");
}
18
Source : GoPubMedSeparateConceptRetrievalExecutor.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String conf = UimaContextHelper.getConfigParameterStringValue(context, "conf");
PropertiesConfiguration gopubmedProperties = new PropertiesConfiguration();
try {
gopubmedProperties.load(getClreplaced().getResourcereplacedtream(conf));
} catch (ConfigurationException e) {
throw new ResourceInitializationException(e);
}
service = new GoPubMedService(gopubmedProperties);
pages = UimaContextHelper.getConfigParameterIntValue(context, "pages", 1);
hits = UimaContextHelper.getConfigParameterIntValue(context, "hits", 1);
bopQueryStringConstructor = new BagOfPhraseQueryStringConstructor();
timeout = UimaContextHelper.getConfigParameterIntValue(context, "timeout", 4);
limit = UimaContextHelper.getConfigParameterIntValue(context, "limit", Integer.MAX_VALUE);
}
18
Source : QuestionRegExProperNounTagger.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
requireNoun = UimaContextHelper.getConfigParameterBooleanValue(context, "require-noun", true);
String regex = UimaContextHelper.getConfigParameterStringValue(context, "regex");
String regexFirst = UimaContextHelper.getConfigParameterStringValue(context, "regex-first", regex);
pattern = Pattern.compile(regex);
patternFirst = Pattern.compile(regexFirst);
}
18
Source : QuestionParser.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String nlpProviderName = UimaContextHelper.getConfigParameterStringValue(context, "parser-provider");
parserProvider = ProviderCache.getProvider(nlpProviderName, ParserProvider.clreplaced);
}
18
Source : QuestionConceptRecognizer.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String conceptProviderName = UimaContextHelper.getConfigParameterStringValue(context, "concept-provider");
conceptProvider = ProviderCache.getProvider(conceptProviderName, ConceptProvider.clreplaced);
}
18
Source : QuestionConceptCache.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
texts = new ArrayList<>();
// concept cache
String conceptProviderNames = UimaContextHelper.getConfigParameterStringValue(context, "concept-providers");
conceptProviders = ProviderCache.getProviders(conceptProviderNames, ConceptProvider.clreplaced);
// synonym cache
String synonymExpansionProviderNames = UimaContextHelper.getConfigParameterStringValue(context, "synonym-expansion-providers");
synonymExpansionProviders = ProviderCache.getProviders(synonymExpansionProviderNames, SynonymExpansionProvider.clreplaced);
}
18
Source : PassageConceptCache.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
texts = new ArrayList<>();
batchSize = UimaContextHelper.getConfigParameterIntValue(context, "batch-size", 500);
// concept cache
String conceptProviderNames = UimaContextHelper.getConfigParameterStringValue(context, "concept-providers");
conceptProviders = ProviderCache.getProviders(conceptProviderNames, ConceptProvider.clreplaced);
// synonym cache
String synonymExpansionProviderNames = UimaContextHelper.getConfigParameterStringValue(context, "synonym-expansion-providers");
synonymExpansionProviders = ProviderCache.getProviders(synonymExpansionProviderNames, SynonymExpansionProvider.clreplaced);
}
18
Source : DocumentToPassageConverter.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
includereplacedleAbstract = UimaContextHelper.getConfigParameterBooleanValue(context, "include-replacedle-abstract", true);
includeSections = UimaContextHelper.getConfigParameterBooleanValue(context, "include-sections", true);
onlyForDoreplacedentsMissingSections = UimaContextHelper.getConfigParameterBooleanValue(context, "only-for-doreplacedents-missing-sections", true);
}
18
Source : ClassifierTrainer.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String candidateProviderName = UimaContextHelper.getConfigParameterStringValue(context, "candidate-provider");
candidateProvider = ProviderCache.getProvider(candidateProviderName, CandidateProvider.clreplaced);
String scorerNames = UimaContextHelper.getConfigParameterStringValue(context, "scorers");
scorers = ProviderCache.getProviders(scorerNames, Scorer.clreplaced).stream().map(scorer -> (Scorer<? super T>) scorer).collect(toList());
String clreplacedifierName = UimaContextHelper.getConfigParameterStringValue(context, "clreplacedifier");
clreplacedifier = ProviderCache.getProvider(clreplacedifierName, ClreplacedifierProvider.clreplaced);
cvPredictFile = UimaContextHelper.getConfigParameterStringValue(context, "cv-predict-file", null);
if (cvPredictFile != null) {
iduris = new ArrayList<>();
}
X = new ArrayList<>();
Y = new ArrayList<>();
atLeastOneCorrect = UimaContextHelper.getConfigParameterBooleanValue(context, "at-least-one-correct", true);
resampleType = ClreplacedifierProvider.ResampleType.valueOf(UimaContextHelper.getConfigParameterStringValue(context, "resample-type", "NONE"));
}
18
Source : ClassifierPredictor.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String candidateProviderName = UimaContextHelper.getConfigParameterStringValue(context, "candidate-provider");
candidateProvider = ProviderCache.getProvider(candidateProviderName, CandidateProvider.clreplaced);
String scorerNames = UimaContextHelper.getConfigParameterStringValue(context, "scorers");
scorers = ProviderCache.getProviders(scorerNames, Scorer.clreplaced).stream().map(scorer -> (Scorer<? super T>) scorer).collect(toList());
String clreplacedifierName = UimaContextHelper.getConfigParameterStringValue(context, "clreplacedifier");
clreplacedifier = ProviderCache.getProvider(clreplacedifierName, ClreplacedifierProvider.clreplaced);
if ((featureFilename = UimaContextHelper.getConfigParameterStringValue(context, "feature-file", null)) != null) {
feat2value = HashBasedTable.create();
}
}
18
Source : PassageParser.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String parserProviderName = UimaContextHelper.getConfigParameterStringValue(context, "parser-provider");
parserProvider = ProviderCache.getProvider(parserProviderName, ParserProvider.clreplaced);
viewNamePrefix = UimaContextHelper.getConfigParameterStringValue(context, "view-name-prefix");
}
18
Source : PassageConceptRecognizer.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String conceptProviderName = UimaContextHelper.getConfigParameterStringValue(context, "concept-provider");
conceptProvider = ProviderCache.getProvider(conceptProviderName, ConceptProvider.clreplaced);
viewNamePrefix = UimaContextHelper.getConfigParameterStringValue(context, "view-name-prefix");
String allowedConceptTypesFile = UimaContextHelper.getConfigParameterStringValue(context, "allowed-concept-types", null);
try {
allowedConceptTypes = Resources.readLines(getClreplaced().getResource(allowedConceptTypesFile), Charsets.UTF_8).stream().collect(toSet());
checkConceptTypes = true;
} catch (Exception e) {
checkConceptTypes = false;
}
}
18
Source : ConceptMerger.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
includeDefaultView = UimaContextHelper.getConfigParameterBooleanValue(context, "include-default-view", true);
viewNamePrefix = UimaContextHelper.getConfigParameterStringValue(context, "view-name-prefix", null);
useName = UimaContextHelper.getConfigParameterBooleanValue(context, "use-name", true);
}
18
Source : WeightingSearchIdConceptReranker.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String param = UimaContextHelper.getConfigParameterStringValue(context, "weights-path");
weights = new HashMap<>();
try (BufferedReader bw = new BufferedReader(new InputStreamReader(getClreplaced().getResourcereplacedtream(param)))) {
String line;
while ((line = bw.readLine()) != null) {
String[] segs = line.split("\t");
weights.put(segs[0], new double[] { Double.parseDouble(segs[1]), Double.parseDouble(segs[2]) });
}
} catch (IOException e) {
throw new ResourceInitializationException(e);
}
}
18
Source : LuceneInMemoryConceptReranker.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
hits = UimaContextHelper.getConfigParameterIntValue(context, "hits", 100);
replacedyzer = UimaContextHelper.createObjectFromConfigParameter(context, "query-replacedyzer", "query-replacedyzer-params", Standardreplacedyzer.clreplaced, replacedyzer.clreplaced);
queryStringConstructor = UimaContextHelper.createObjectFromConfigParameter(context, "query-string-constructor", "query-string-constructor-params", LuceneQueryStringConstructor.clreplaced, QueryStringConstructor.clreplaced);
limit = UimaContextHelper.getConfigParameterIntValue(context, "limit", 10);
weight = UimaContextHelper.getConfigParameterFloatValue(context, "rerank-weight", 1F);
parser = new QueryParser("text", replacedyzer);
}
18
Source : GSAnswerTypeLabeler.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String quanreplacedyQuestionWordsPath = UimaContextHelper.getConfigParameterStringValue(context, "quanreplacedy-question-words-path");
try {
quanreplacedyQuestionPhrases = Resources.readLines(getClreplaced().getResource(quanreplacedyQuestionWordsPath), Charsets.UTF_8).stream().map(line -> Arrays.asList(line.split(" "))).collect(toList());
} catch (IOException e) {
throw new ResourceInitializationException(e);
}
atGslabelFile = UimaContextHelper.getConfigParameterStringValue(context, "at-gslabel-file");
batchSize = UimaContextHelper.getConfigParameterIntValue(context, "batch-size", 1);
completeQats = new ArrayList<>();
pendingQats = new ArrayList<>();
}
18
Source : ConceptSearchGSAnswerTypeLabeler.java
with Apache License 2.0
from oaqa
with Apache License 2.0
from oaqa
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
super.initialize(context);
String conceptSearchProviderName = UimaContextHelper.getConfigParameterStringValue(context, "concept-search-provider");
conceptSearchProvider = ProviderCache.getProvider(conceptSearchProviderName, ConceptSearchProvider.clreplaced);
}
See More Examples