ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ks Sunder <shyam...@gmail.com>
Subject Fwd: Regarding : DependencyParser problem
Date Mon, 08 May 2017 10:27:18 GMT
Hi All,


step 1 : i am using this builder for get dictionary words
AggregateBuilder builder = new AggregateBuilder();
   builder.add(SimpleSegmentAnnotator.createAnnotatorDescription());
   builder.add(SentenceDetector.createAnnotatorDescription());
   builder.add(TokenizerAnnotatorPTB.createAnnotatorDescription());
   builder.add(POSTagger.createAnnotatorDescription());
   builder.add(ClinicalPipelineFactory.getNpChunkerPipeline());
   builder.add(LvgAnnotator.createAnnotatorDescription());

     try {
         builder.add( AnalysisEngineFactory.createEngineDescription(
DefaultJCasTermAnnotator.class,
              AbstractJCasTermAnnotator.PARAM_WINDOW_ANNOT_PRP,
              "org.apache.ctakes.typesystem.type.textspan.Sentence",
              JCasTermAnnotator.DICTIONARY_DESCRIPTOR_KEY,
              ExternalResourceFactory.createExternalResourceDescription(
                    FileResourceImpl.class,
                    FileLocator.locateFile(
"org/apache/ctakes/dictionary/lookup/fast/cTakesHsql.xml"
) )
        ) );
     } catch ( FileNotFoundException e ) {
        e.printStackTrace();
        throw new ResourceInitializationException( e );
     }

  builder.add( ClearNLPDependencyParserAE.createAnnotatorDescription() );*/
      builder.add( PolarityCleartkAnalysisEngine.createAnnotatorDescription()
);
      builder.add( UncertaintyCleartkAnalysisEngi
ne.createAnnotatorDescription() );
      builder.add( HistoryCleartkAnalysisEngine.createAnnotatorDescription()
);
   return builder.createAggregateDescription();
step 2 :  through IdentifiedAnnotation im getting words

JCas jcas = pipeline.newJCas();
jcas.setDocumentText(value);
pipeline.process(jcas);

for (IdentifiedAnnotation entity : JCasUtil.select(jcas,
IdentifiedAnnotation.class)) {

if (entity.getOntologyConceptArr() != null) {

add.append(entity.getCoveredText() + ",");

}
}
.....
How can i use DependencyParser and how can get dependency words here....?

Example :
"hormone replacement therapy" would have deep structure:
(NP (NML (NN hormone) (NN replacement)) (NN therapy))

... how is it works...?


please give me a solution...

regards,
shyam k.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message