ctakes-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Taposh D. Roy" <Taposh.D....@kp.org>
Subject Re: jcas work with a list of schemas
Date Mon, 06 Feb 2017 18:28:48 GMT
Please remove me from mailing list for now. I am not active and I don't see an unsubscribe
link in the email chain.

Regards,

Taposh


Taposh Roy, MBA (Finance), MS (Comp. E), MS (EE-Physics) | Innovation Team |  Delivery System
Analytics, Decision Support  |  Kaiser Permanente  | 1800 Harrison, 7th Floor, #072R22, Oakland,
CA, 94521| cell: 510-206-1633  |  taposh.d.roy@kp.org


On 2/6/17, 10:27 AM, "Alaa al Barari" <alaa.albarari@gmail.com> wrote:

    Caution: This email came from outside Kaiser Permanente. Do not open attachments or click
on links if you do not recognize the sender.

    ______________________________________________________________________
    I know alittle bit of java. I have like 14 different schemes. I was hoping
    for away to call only for a set (lets say 3) of schemas without ctakes get
    the data for the 14 then filter the wanted 3. This would be much faster.

    On Feb 6, 2017 8:21 PM, "Finan, Sean" <Sean.Finan@childrens.harvard.edu>
    wrote:

    Hi Alaa,
    Are you a java developer or do you have a different background?  If you are
    not a developer, could you please enumerate exactly what you need?
    Thanks

    -----Original Message-----
    From: Alaa al Barari [mailto:alaa.albarari@gmail.com]
    Sent: Monday, February 06, 2017 1:15 PM
    To: dev@ctakes.apache.org
    Subject: RE: jcas work with a list of schemas

    Thanks. I was hoping for away to fetch only whats needed for performance
    enhancement.

    On Feb 6, 2017 8:09 PM, "Finan, Sean" <Sean.Finan@childrens.harvard.edu>
    wrote:

    > Yes.  You do not need to use the code directly if it doesn't fit your
    > needs.  You can look at the code within that class and within those
    > methods to do something similar.
    >
    > -----Original Message-----
    > From: Alaa al Barari [mailto:alaa.albarari@gmail.com]
    > Sent: Monday, February 06, 2017 1:07 PM
    > To: dev@ctakes.apache.org
    > Subject: RE: jcas work with a list of schemas
    >
    > Thanks sean but internally this fetch data for all schemas then filter
    > the needed schema right ?
    >
    > On Feb 6, 2017 7:57 PM, "Finan, Sean"
    > <Sean.Finan@childrens.harvard.edu>
    > wrote:
    >
    > > Hi Alaa,
    > >
    > > Have a look at the OntologyConceptUtil class in ctakes-core.  You
    > > can use the getCodes(..) method to obtain the codes for a scheme.
    > >
    > > For all codes of all annotations:
    > > Collection<String> allCodes = OntologyConceptUtil.getCodes( jcas,
    > > schemeName );
    > >
    > > For all codes of all annotations in a window (paragraph, segment,
    > > sentence):
    > > Collection<String> windowCodes = OntologyConceptUtil.getCodes( jcas,
    > > windowAnnotation, schemeName );
    > >
    > > For all codes in a single annotation:
    > > Collection<String> annotationCodes = OntologyConceptUtil.getCodes(
    > > annotation, schemeName );
    > >
    > > For all codes in multiple annotations:
    > > Collection<String> annotationsCodes = OntologyConceptUtil.getCodes(
    > > annotations, schemeName );
    > >
    > > If you want a map of scheme names and codes:
    > > Map<String,Collection<String>> getSchemeCodes( jcas );
    > > Map<String,Collection<String>> getSchemeCodes( jcas, window ); ...
    > > getSchemeCodes( annotation ); ... getSchemeCodes( annotations );
    > >
    > >
    > > If you have some other need, like getting all annotations with codes
    > > of a certain scheme, let me know.
    > > Sean
    > >
    > >
    > >
    > > -----Original Message-----
    > > From: Alaa al Barari [mailto:alaa.albarari@gmail.com]
    > > Sent: Monday, February 06, 2017 4:30 AM
    > > To: dev@ctakes.apache.org
    > > Subject: jcas work with a list of schemas
    > >
    > > Hi,
    > >
    > > I have my own dictionary and it has a lot of schemas which takes a
    > > lot of time. please see code below, how to make it work with
    > > specific list of schemas instead of all of them
    > >
    > >                                 jcas = pipeline.newJCas();
    > > jcas.setDocumentText(sentence.getCoveredText());
    > > pipeline.process(jcas);
    > > String previousEntity = "";
    > > for ( IdentifiedAnnotation entity : JCasUtil.select( jcas,
    > > IdentifiedAnnotation.class ) ) {
    > >
    > > final FSArray fsArray = entity.getOntologyConceptArr(); if ( fsArray
    > > == null ) { continue; } String entityString =
    > > entity.getCoveredText(); System.out.println( "Entity: " +
    > > entity.getCoveredText()
    > > + " === Polarity: " + entity.getPolarity() " === Subject: " +
    > > + entity.getSubject() " === History? " + (entity.getHistoryOf() ==
    > > CONST.NE_HISTORY_OF_PRESENT));
    > >
    > > final FeatureStructure[] featureStructures = fsArray.toArray();
    > > final Collection<String> entityCodes = new ArrayList<>(
    > > featureStructures.length ); previousEntity = entityString; for (
    > > FeatureStructure featureStructure : featureStructures ) { if (
    > > featureStructure instanceof UmlsConcept ) { final UmlsConcept
    > > umlsConcept = (UmlsConcept)featureStructure; String entityCode =
    > > umlsConcept.getCode(); String entityScheme =
    > > umlsConcept.getCodingScheme(); String description =
    > > umlsConcept.getCodeDescription(); if (entityCode == null ||
    > > entityScheme == null) { continue; } if
    > > (schemes.contains(entityScheme)
    > > || schemes.contains("all")) { System.out.println(entityScheme + "_"
    > > || +
    > > entityCode + "_" + description); } } }
    > >
    > > }
    > > }
    > >
    > >
    > > Regards.
    > > --
    > > Eng Alaa Al-Barari
    > > phone 0599297470
    > >
    >


NOTICE TO RECIPIENT:  If you are not the intended recipient of this e-mail, you are prohibited
from sharing, copying, or otherwise using or disclosing its contents.  If you have received
this e-mail in error, please notify the sender immediately by reply e-mail and permanently
delete this e-mail and any attachments without reading, forwarding or saving them.  Thank
you.
Mime
View raw message