You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ctakes.apache.org by Ks Sunder <sh...@gmail.com> on 2017/04/18 06:37:58 UTC

Regarding : DependencyParser problem

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(
UncertaintyCleartkAnalysisEngine.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.

Fwd: Regarding : DependencyParser problem

Posted by Ks Sunder <sh...@gmail.com>.
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.