Skip to content

Output one result with highest score #40

@wclin2

Description

@wclin2

Hi,

I wonder is there a way to output only one result with the highest score for each detected entity? For example,

sents = ['metastatic disease']
concepts,error = mm.extract_concepts(sents)

concepts
[ConceptMMI(index='00000000', mm='MMI', score='14.64', preferred_name='Neoplasm Metastasis', cui='C0027627', semtypes='[neop]', trigger='["metastatic disease"-tx-1-"metastatic disease"-noun-0]', location='TX', pos_info='1/18', tree_codes='C04.697.650;C23.550.727.650'),

 ConceptMMI(index='00000000', mm='MMI', score='5.18', preferred_name='Metastatic Neoplasm', cui='C2939420', semtypes='[neop]', trigger='["Metastatic Disease"-tx-1-"metastatic disease"-noun-0]', location='TX', pos_info='1/18', tree_codes=''),
 
ConceptMMI(index='00000000', mm='MMI', score='5.18', preferred_name='Secondary Neoplasm', cui='C2939419', semtypes='[neop]', trigger='["Metastatic disease"-tx-1-"metastatic disease"-noun-0]', location='TX', pos_info='1/18', tree_codes='')]

only output the first one - 'Neoplasm Metastasis'.

Thanks,
Wei

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions