Loading ...
Sorry, an error occurred while loading the content.

MEDLINE keywords

Expand Messages
  • Bob Carpenter
    I m responding to a message below about not being able to extract keywords from MEDLINE. This was broken in previous releases, but has been fixed. Are you
    Message 1 of 1 , Jul 26, 2006
    View Source
    • 0 Attachment
      I'm responding to a message below about not being
      able to extract keywords from MEDLINE. This was
      broken in previous releases, but has been fixed.
      Are you sure you're using 2.3.0?

      Here's what I just did to make sure everything's
      working as distributed:

      (a) downloaded http://www.alias-i.com/lingpipe/lingpipe-2.3.0.jar
      (b) cut out your first two lines of code to print lengths
      (c) added my own print because I don't have your LoadKeyword method

      This yields the following Test.java:

      import com.aliasi.medline.*;

      import org.xml.sax.InputSource;

      public class Test {

      public static void main(String[] args) throws Exception {
      InputSource in = new InputSource(args[0]);
      MedlineParser parser = new MedlineParser(false);
      Handler handler = new Handler();
      parser.parse(in,handler);
      }

      static class Handler implements MedlineHandler {
      public void delete(String x) {
      throw new UnsupportedOperationException();
      }
      public void handle(MedlineCitation citation) {
      KeywordList[] keywordlists=citation.keywordLists();

      System.out.println("keywordlists.length="+keywordlists.length);
      KeywordList[] lists = citation.keywordLists();
      for (int i = 0; i < lists.length; ++i)
      System.out.println(citation.pmid() + ": " + lists[i]);
      }
      }


      }

      Running this produces the following, which is
      what I'm expecting:

      C:\lp2.3>javac -classpath lingpipe-2.3.0.jar Test.java

      C:\lp2.3>java -classpath .;lingpipe-2.3.0.jar Test c:\carp\mycvs\lingpipe\demos\data\medsamp2006.xml
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=1
      11583040: {Owner=NASA Keywords=[NASA Discipline Exobiology [MAJ=N], Non-NASA Center [MAJ=N]]}
      keywordlists.length=0
      keywordlists.length=1
      11686167: {Owner=KIE Keywords=[Abortion Act 1967 (Great Britain) [MAJ=N], Genetics and Reproduction [MAJ=N], Legal Appro
      ach [MAJ=N], Roe v. Wade [MAJ=Y], Webster v. Reproductive Health Services [MAJ=Y]]}
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=1
      12179763: {Owner=PIP Keywords=[Adult [MAJ=N], Age Factors [MAJ=N], Aged [MAJ=Y], Asia [MAJ=N], Birth Rate [MAJ=N], Carry
      ing Capacity [MAJ=N], Contraception [MAJ=N], Contraceptive Methods [MAJ=Y], Delivery Of Health Care [MAJ=N], Demographic
      Aging [MAJ=Y], Demographic Factors [MAJ=N], Demographic Transition [MAJ=Y], Dependency Burden [MAJ=Y], Developing Count
      ries [MAJ=N], Eastern Asia [MAJ=N], Economic Development [MAJ=Y], Economic Factors [MAJ=N], Environment [MAJ=N], Family
      Planning [MAJ=N], Family Planning Programs [MAJ=Y], Fertility [MAJ=N], Fertility Measurements [MAJ=N], Fertility Rate [M
      AJ=N], Health [MAJ=N], Health Services [MAJ=N], Human Resources [MAJ=N], Korea [MAJ=N], Labor Force [MAJ=Y], Macroeconom
      ic Factors [MAJ=N], Maternal-child Health Services [MAJ=Y], Microeconomic Factors [MAJ=N], Natural Resources [MAJ=N], Or
      ganization And Administration [MAJ=N], Policy [MAJ=N], Population [MAJ=N], Population Characteristics [MAJ=N], Populatio
      n Decrease [MAJ=Y], Population Dynamics [MAJ=N], Population Growth [MAJ=Y], Population Policy [MAJ=Y], Population Pressu
      re [MAJ=Y], Population Size [MAJ=N], Primary Health Care [MAJ=N], Program Evaluation [MAJ=Y], Programs [MAJ=N], Public S
      ector [MAJ=Y], Research Methodology [MAJ=Y], Social Policy [MAJ=N], Social Welfare [MAJ=Y], Socioeconomic Factors [MAJ=Y
      ], Sterilization, Sexual [MAJ=Y], Total Fertility Rate--changes [MAJ=Y], Zero Population Growth [MAJ=Y]]}
      keywordlists.length=1
      12349809: {Owner=PIP Keywords=[Critique [MAJ=Y], Economic Factors [MAJ=N], Gender Issues [MAJ=N], Gender Relations [MAJ=
      Y], Social Change [MAJ=Y], Socioeconomic Factors [MAJ=N], Women's Status [MAJ=Y], World [MAJ=Y]]}
      keywordlists.length=0
      keywordlists.length=1
      11876201: {Owner=NASA Keywords=[NASA Discipline Life Support Systems [MAJ=N], Non-NASA Center [MAJ=N]]}
      keywordlists.length=0
      keywordlists.length=1
      12038483: {Owner=NASA Keywords=[NASA Center JPL [MAJ=N], NASA Discipline Exobiology [MAJ=N]]}
      keywordlists.length=1
      12159900: {Owner=KIE Keywords=[Bioethics and Professional Ethics [MAJ=N], National Bioethics Advisory Commission [MAJ=N]
      , Popular Approach/Source [MAJ=N]]}
      keywordlists.length=1
      12174865: {Owner=KIE Keywords=[Bioethics and Professional Ethics [MAJ=N], Empirical Approach [MAJ=N]]}
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=1
      12211266: {Owner=KIE Keywords=[Analytical Approach [MAJ=N], Health Care and Public Health [MAJ=N]]}
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=1
      11612527: {Owner=KIE Keywords=[Agency for International Development [MAJ=N], Genetics and Reproduction [MAJ=N]]}
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=1
      10097079: {Owner=NASA Keywords=[NASA Discipline Exobiology [MAJ=N], Non-NASA Center [MAJ=N]]}
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=1
      14796701: {Owner=NLM Keywords=[ACETOACETIC ACID [MAJ=Y], BACTERIA [MAJ=Y], BUTYRIC ACID [MAJ=Y]]}
      keywordlists.length=1
      13072632: {Owner=NLM Keywords=[INSECTICIDES [MAJ=Y], PHOSPHATES [MAJ=Y]]}
      keywordlists.length=1
      13634534: {Owner=NLM Keywords=[BONE DISEASES/physiology [MAJ=Y], CALCIUM/metabolism [MAJ=Y], GLOMERULONEPHRITIS/physiolo
      gy [MAJ=Y], PHOSPHORUS/metabolism [MAJ=Y]]}
      keywordlists.length=1
      14177620: {Owner=NLM Keywords=[ASCITES [MAJ=Y], BLOOD LIPIDS [MAJ=Y], CHYLOMICRONS [MAJ=Y], DIABETES MELLITUS [MAJ=Y], G
      ASTRIC ACIDITY DETERMINATION [MAJ=Y], GASTRITIS [MAJ=Y], HEPATITIS, INFECTIOUS [MAJ=Y], JAUNDICE [MAJ=Y], JEJUNUM [MAJ=Y
      ], LIPID METABOLISM [MAJ=Y], LIPOPROTEINS [MAJ=Y], LIVER CIRRHOSIS [MAJ=Y], MALARIA [MAJ=Y], PATHOLOGY [MAJ=Y], PLEURISY
      [MAJ=Y], PROTEIN DEFICIENCY [MAJ=Y]]}
      keywordlists.length=1
      14316043: {Owner=NLM Keywords=[DENTISTS [MAJ=Y], FRACTURE FIXATION [MAJ=Y], FRACTURES [MAJ=Y], INTERPROFESSIONAL RELATIO
      NS [MAJ=Y], JAW [MAJ=Y], MANDIBULAR INJURIES [MAJ=Y], MAXILLOFACIAL INJURIES [MAJ=Y], PRACTICE MANAGEMENT, DENTAL [MAJ=Y
      ], SPECIAL LIST DENTAL [MAJ=Y]]}
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0
      keywordlists.length=0

      I hope this helps.

      - Bob Carpenter
      Alias-i

      -------------------original message below-----------------
      I try to import the keyword information in the Medline Citation into the
      database, but I could not obtain any information about keyword. The code I
      wrote is as follows:

      KeywordList[] keywordlists=citation.keywordLists();

      System.out.println("keywordlists.length="+keywordlists.length);

      if(keywordlists.length>0)
      {
      for(int i=0;i<keywordlists.length;i++)
      {

      //Load keyword data
      Topic[] keywords=keywordlists[i].keywords();

      if(keywords.length>0)
      {
      for(int j=0;j<keywords.length;j++)
      {
      String isMajor="N";

      if(keywords[j].isMajor())
      {
      isMajor="Y";
      }
      LoadKeyword(pmid,keywords[j].topic(),isMajor);
      }

      }

      }

      }

      The sample file that I used to process is medsamp2006.xml. But the results show
      that the keylists' length in all the citations is 0.

      The work environment for my computer is

      Hardware Platform: Dell desktop (pentium 4)
      Operating System: Linux
      Java Version: Java 1.4.2
      LingPipe Version: 2.3.0


      I hope the information I provide you is useful.
    Your message has been successfully submitted and would be delivered to recipients shortly.