Question: MetaMap Slow Performance
0
gravatar for jomaao
5.1 years ago by
jomaao0
United States
jomaao0 wrote:

Hello Everyone,

 

I've downloaded MetaMap software and MetaMap java api to annotate some documents I have to the UMLS vocabularies. I tried to run a sample program to test the MetaMap on my local machine, but it was very slow to the point that I stopped the program after three hours with no output for just an input of one line of text. I tried to run the same sample program on the cluster in my university, but it wasn't any better. Any thoughts or ideas of why it's so slow? Here is my sample program that I'm running:

 

public static void main(String[] args) throws Exception {
        MetaMapApi api = new MetaMapApiImpl();
        //List<Result> resultList = api.processCitationsFromFile("Abstract.txt");
        List<Result> resultList = api.processCitationsFromString
    ("The polypeptides synthesized by clones 1054 and HS1 in the vaccinia expression system, on the other hand, comigrate with proteins 9126 and 9124, suggesting cell-type-specific expression of members of the protein family. ");
        Result result = resultList.get(0);
        
        List<AcronymsAbbrevs> aaList = result.getAcronymsAbbrevs();
        if (aaList.size() > 0) {
          System.out.println("Acronyms and Abbreviations:");
          for (AcronymsAbbrevs e: aaList) {
            System.out.println("Acronym: " + e.getAcronym());
            System.out.println("Expansion: " + e.getExpansion());
            System.out.println("Count list: " + e.getCountList());
            System.out.println("CUI list: " + e.getCUIList());
          }
        } else {
          System.out.println(" None.");
        }
        
        List<Negation> negList = result.getNegations();
        if (negList.size() > 0) {
          System.out.println("Negations:");
          for (Negation e: negList) {
            System.out.println("type: " + e.getType());
            System.out.print("Trigger: " + e.getTrigger() + ": [");
            for (Position pos: e.getTriggerPositionList()) {
              System.out.print(pos  + ",");
            }
            System.out.println("]");
            System.out.print("ConceptPairs: [");
            for (ConceptPair pair: e.getConceptPairList()) {
              System.out.print(pair + ",");
            }
            System.out.println("]");
            System.out.print("ConceptPositionList: [");
            for (Position pos: e.getConceptPositionList()) {
              System.out.print(pos + ",");
            }
            System.out.println("]");
          }
        } else {
            System.out.println(" None.");
        }
        
        for (Utterance utterance: result.getUtteranceList()) {
            System.out.println("Utterance:");
            System.out.println(" Id: " + utterance.getId());
            System.out.println(" Utterance text: " + utterance.getString());
            System.out.println(" Position: " + utterance.getPosition());
            for (PCM pcm: utterance.getPCMList()) {
                System.out.println("Phrase:");
                System.out.println(" text: " + pcm.getPhrase().getPhraseText());
                System.out.println("Candidates:");
                for (Ev ev: pcm.getCandidateList()) {
                    System.out.println(" Candidate:");
                    System.out.println("  Score: " + ev.getScore());
                    System.out.println("  Concept Id: " + ev.getConceptId());
                    System.out.println("  Concept Name: " + ev.getConceptName());
                    System.out.println("  Preferred Name: " + ev.getPreferredName());
                    System.out.println("  Matched Words: " + ev.getMatchedWords());
                    System.out.println("  Semantic Types: " + ev.getSemanticTypes());
                    System.out.println("  MatchMap: " + ev.getMatchMap());
                    System.out.println("  MatchMap alt. repr.: " + ev.getMatchMapList());
                    System.out.println("  is Head?: " + ev.isHead());
                    System.out.println("  is Overmatch?: " + ev.isOvermatch());
                    System.out.println("  Sources: " + ev.getSources());
                    System.out.println("  Positional Info: " + ev.getPositionalInfo());
                }
                System.out.println("Mappings:");
                for (Mapping map: pcm.getMappingList()) {
                    System.out.println(" Map Score: " + map.getScore());
                    for (Ev mapEv: map.getEvList()) {
                      System.out.println("   Score: " + mapEv.getScore());
                      System.out.println("   Concept Id: " + mapEv.getConceptId());
                      System.out.println("   Concept Name: " + mapEv.getConceptName());
                      System.out.println("   Preferred Name: " + mapEv.getPreferredName());
                      System.out.println("   Matched Words: " + mapEv.getMatchedWords());
                      System.out.println("   Semantic Types: " + mapEv.getSemanticTypes());
                      System.out.println("   MatchMap: " + mapEv.getMatchMap());
                      System.out.println("   MatchMap alt. repr.: " + mapEv.getMatchMapList());
                      System.out.println("   is Head?: " + mapEv.isHead());
                      System.out.println("   is Overmatch?: " + mapEv.isOvermatch());
                      System.out.println("   Sources: " + mapEv.getSources());
                      System.out.println("   Positional Info: " + mapEv.getPositionalInfo());
                    }
                }
            }
        }
    }

 

software error • 1.5k views
ADD COMMENTlink written 5.1 years ago by jomaao0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1451 users visited in the last hour