I have text files which contains medical history of a patients and would want to extract information out of it.

Basically what want is generate english text of abbrevations,semantic category region,location and relation also correct spelling mistakes if any by parsing medical history records.

I have google around for open source tools and found cTAKES & Metamap.However could not find python api for the same.

Can someone suggest how to make use of these tools or interact via python?and also is there a better way to extract information using regular epression..etc.

Sample sentence:
55 yr M comes to the ED with c/o of a chest pain that started 1 hr ago,
The cP are a/w SOB.

Expected o/p 
55 yr(year) (M)male comes to the (ED)emergency department with (c/o)complaint of a chest pain that started 1 hr(hour) ago,The (cP)chest pain is associated with (SOB)short of breathing.

Apart from generating abbrevations,also need to cature temparatures,levels such as 5/4,semantic category region,location and relation also correct spelling mistakes in the clinical notes.

While am waiting for UMLS license,just wanted to check can above functionality be achieved through UMLS/cTaked/Metamap? or cutsom script needs to be written in conjunction with python/NLP/RE and open source clinical abbrevations dictionary(please suggest)?


1 Answer 1


First a warning: is your data anonymized? Even if it is, be extremely careful because medical history is super-sensitive personal information. There are legal requirements about how to handle this kind of data and what you can or can't do with it.

As far as I know there's no python API for cTakes or Metamap. Anyway I guess that such an API would boil down to a system call, so it wouldn't be very good.

As an alternative you could implement your own system using the UMLS Metathesaurus, which is a massive list of medical terms grouped by concept (MetaMap extracts UMLS terms/concepts).

  • $\begingroup$ @Ervwan,yes the data is anonymized and have got the neccesary approvals.Have found cTakes API built on Java.Trying to levrage it,also exploring UMLS for my project use.Will comment here if any further assistance needed. $\endgroup$
    – Optimizor
    Oct 16, 2019 at 17:22
  • $\begingroup$ Erwan,would you mind to comment on my latest update added to summary? $\endgroup$
    – Optimizor
    Oct 17, 2019 at 12:32
  • $\begingroup$ MetaMap should be able to capture a few abbreviations but cTakes is supposed to be better at this (disclaimer: I didn't use it myself). In any case it's likely going to be imperfect, the question is how much imperfection can be tolerated for your application and whether you can fix some/most of the imperfection with a custom system. It shouldn't be too hard to build a list of common abbreviations in your data which are not caught by cTakes/MetaMap and just search/replace these automatically. $\endgroup$
    – Erwan
    Oct 17, 2019 at 13:33
  • $\begingroup$ Ervwan,yes,i agree with idea of custom script and it depends on level imperfection prodcues by cTakes/Metamap. $\endgroup$
    – Optimizor
    Oct 17, 2019 at 14:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.