mesh-medical-subject-headings 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,18 +1,35 @@
1
1
  module MESH
2
2
  class Translator
3
3
 
4
+ attr_accessor :dictionary
5
+
4
6
  def translate(input)
7
+ return nil if input.nil?
5
8
  input = input.clone
6
- @enus_to_engb.each do |match, replacement|
7
- start_middle_and_end(input, match.downcase, replacement.downcase)
8
- start_middle_and_end(input, match.capitalize, replacement.capitalize)
9
- start_middle_and_end(input, match.upcase, replacement.upcase)
10
- end
9
+ @downcased.each { |match, replacement| input.gsub!(match, replacement) }
10
+ @capitalized.each { |match, replacement| input.gsub!(match, replacement) }
11
+ @upcased.each { |match, replacement| input.gsub!(match, replacement) }
11
12
  input
12
13
  end
13
14
 
14
- def initialize
15
- @enus_to_engb = {
15
+ def initialize(dictionary)
16
+ @dictionary = dictionary
17
+ @downcased = {}
18
+ @capitalized = {}
19
+ @upcased = {}
20
+ dictionary.each do |match,replacement|
21
+ @downcased[/(^|\W)#{Regexp.quote(match.downcase)}(\W|$)/] = "\\1#{replacement.downcase}\\2"
22
+ @capitalized[/(^|\W)#{Regexp.quote(match.capitalize)}(\W|$)/] = "\\1#{replacement.capitalize}\\2"
23
+ @upcased[/(^|\W)#{Regexp.quote(match.upcase)}(\W|$)/] = "\\1#{replacement.upcase}\\2"
24
+ end
25
+ end
26
+
27
+ def self.engb_to_enus
28
+ @@engb_to_enus ||= @@enus_to_engb.invert
29
+ end
30
+
31
+ def self.enus_to_engb
32
+ @@enus_to_engb ||= {
16
33
  'abrigment' => 'abrigement',
17
34
  'acknowledgment' => 'acknowledgement',
18
35
  'airplane' => 'aeroplane',
@@ -61,6 +78,7 @@ module MESH
61
78
  'gynecology' => 'gynaecology',
62
79
  'harbor' => 'harbour',
63
80
  'hematemesis' => 'haematemesis',
81
+ 'hematology' => 'haematology',
64
82
  'hemoglobin' => 'haemoglobin',
65
83
  'hemorrhoid' => 'haemorrhoid',
66
84
  'homeopath' => 'homoeopath',
@@ -110,16 +128,6 @@ module MESH
110
128
  'vapor' => 'vapour',
111
129
  'vaporize' => 'vaporise'
112
130
  }
113
-
114
- end
115
-
116
- private
117
-
118
- def start_middle_and_end(input, match, replacement)
119
- input.gsub!(/^#{Regexp.quote(match)}$/, replacement) #alone
120
- input.gsub!(/^#{Regexp.quote(match)}(\W+)/) { "#{replacement}#{$1}" } #start
121
- input.gsub!(/(\W+)#{Regexp.quote(match)}(\W+)/) { "#{$1}#{replacement}#{$2}" } #middle
122
- input.gsub!(/(\W+)#{Regexp.quote(match)}$/) { "#{$1}#{replacement}" } #end
123
131
  end
124
132
 
125
133
  end
data/lib/MESH/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mesh
2
- VERSION = "1.2.2"
2
+ VERSION = "1.3.0"
3
3
  end
data/match.rb CHANGED
@@ -1,9 +1,25 @@
1
1
  require_relative 'lib/MESH'
2
2
 
3
+ syllabus = [
4
+ 'Medicine', 'Anaesthetics', 'Analgesia', 'Anesthesia', 'Conscious Sedation', 'Deep Sedation', 'Neuromuscular Blockade', 'Breast', 'Breast Cyst', 'Breast Neoplasms', 'Fibrocystic Breast Disease', 'Lactation Disorders', 'Mastitis', 'Cardiology', 'Cardiovascular Diseases', 'Acute Coronary Syndrome', 'Myocardial Infarction', 'Unstable Angina', 'Cardiac Arrhythmias', 'Atrial Fibrillation', 'Atrial Flutter', 'Bradycardia', 'Heart Block', 'Long QT Syndrome', 'Tachycardia', 'Ventricular Fibrillation', 'Ventricular Flutter', 'Angina Pectoris', 'Heart Failure', 'Diastolic Heart Failure', 'Systolic Heart Failure', 'Hypertension', 'Heart Valve Diseases', 'Aortic Valve Insufficiency', 'Aortic Valve Stenosis', 'Mitral Valve Insufficiency', 'Mitral Valve Stenosis', 'Pulmonary Valve Insufficiency', 'Pulmonary Valve Stenosis', 'Tricuspid Valve Insufficiency', 'Tricuspid Valve Stenosis', 'Endocarditis', 'Pericardial Disease', 'Pericardial Effusion', 'Pericarditis', 'Cardiac Tamponade', 'Disease of Heart Muscle', 'Alcoholic Cardiomyopathy', 'Dilated Cardiomyopathy', 'Hypertrophic Cardiomyopathy', 'Restrictive Cardiomyopathy', 'Myocardial Reperfusion Injury', 'Myocarditis', 'Cardiovascular Investigations', 'Angiocardiography', 'Echocardiography', 'Electrocardiography', 'Heart Catheterization', 'Dermatology', 'Skin eruptions', 'Acne Vulgaris', 'Eczema', 'Erythroderma', 'Lichenoid Eruptions', 'Photosensitivity Disorders', 'Pityriasis', 'Psoriasis', 'Infectious Skin Diseases', 'Bacterial Skin Diseases', 'Fungal Skin Diseases', 'Bacillary Angiomatosis', 'Cellulitis', 'Cervicofacial Actinomycosis', 'Cutaneous Syphilis', 'Cutaneous Tuberculosis', 'Ecthyma', 'Erysipelas', 'Erythema Chronicum Migrans', 'Erythrasma', 'Granuloma Inguinale', 'Hidradenitis Suppurativa', 'Mycetoma', 'Necrotizing Fasciitis', 'Staphylococcal Skin Infections', 'Parasitic Skin Diseases', 'Ectoparasitic Infestations', 'Larva Migrans', 'Leishmaniasis', 'Lice Infestations', 'Onchocerciasis', 'Scabies', 'Viral Skin Diseases', 'Erythema Infectiosum', 'Exanthema Subitum', 'Herpes Simplex', 'Molluscum Contagiosum', 'Warts', 'Specific skin structure disease', 'Hair Diseases', 'Folliculitis', 'Hirsutism', 'Hypertrichosis', 'Hypotrichosis', 'Nail Diseases', 'Nail-Patella Syndrome', 'Ingrown Nails', 'Onycholysis', 'Onychomycosis', 'Pachyonychia Congenita', 'Paronychia', 'Yellow Nail Syndrome', 'Pigmentation Disorders', 'Cafe-au-Lait Spots', 'Hyperpigmentation', 'Hypopigmentation', 'Sweat Gland Diseases', 'Hidradenitis', 'Hyperhidrosis', 'Hypohidrosis', 'Prickly Heat', 'Vascular Skin Diseases', 'Livedo Reticularis', 'Purpura', 'Raynaud Disease', 'Skin Ulcer', 'Buruli Ulcer', 'Leg Ulcer', 'Pressure Ulcer', 'Pyoderma Gangrenosum', 'Telangiectasis', 'Vasculitis', 'Inherited skin disease', 'Darier Disease', 'Ehlers-Danlos Syndrome', 'Ichthyosis Vulgaris', 'Neurofibromatoses', 'Palmoplantar Keratoderma', 'Pseudoxanthoma Elasticum', 'Tuberous Sclerosis', 'Xeroderma Pigmentosum', 'Skin Neoplasms', 'Benign skin tumours', 'Keloid', 'Lipoma', 'Pyogenic Granuloma', 'Seborrheic Keratosis', 'Premalignant and malignant skin disease', 'Actinic Keratosis', 'Bowen\'s Disease', 'Nevi and Melanomas', 'Keratoacanthoma', 'Mycosis Fungoides', 'Emergency Medicine', 'Acute Abdomen', 'Bradycardia', 'Dyspnea', 'Burns', 'Chest pain', 'Coma', 'Diabetic Ketoacidosis', 'Gastrointestinal Hemorrhage', 'Hyperglycemic Hyperosmolar Nonketotic Coma', 'Hyperkalemia', 'Hypoglycemia', 'Hypotension', 'Acute Liver Failure', 'Poisoning', 'Meningitis', 'Acute Kidney Failure', 'Seizures', 'Shock', 'Stroke', 'Tachycardia', 'Resuscitation', 'Spinal Cord Compression', 'Pre-Eclampsia', 'Endocrinology', 'Thyroid Diseases', 'Euthyroid Sick Syndromes', 'Goiter', 'Hyperthyroidism', 'Hypothyroidism', 'Thyroid Dysgenesis', 'Thyroid Neoplasms', 'Thyroiditis', 'Thyrotoxicosis', 'Parathyroid Diseases', 'Hyperparathyroidism', 'Hypoparathyroidism', 'Parathyroid Neoplasms', 'Adrenal Gland Diseases', 'Adrenal Cortex Neoplasms', 'Congenital Adrenal Hyperplasia', 'Addison Disease', 'Adrenoleukodystrophy', 'Hypoaldosteronism', 'Cushing Syndrome', 'Hyperaldosteronism', 'Pituitary Diseases', 'Diabetes Insipidus', 'Hyperpituitarism', 'Hypopituitarism', 'Inappropriate ADH Syndrome', 'Pituitary Apoplexy', 'Pituitary Neoplasms', 'Diabetes Mellitus', 'Gastroenterology', 'Biliary Tract Diseases', 'Cholelithiasis', 'Cholecystitis', 'Sclerosing Cholangitis', 'Biliary Liver Cirrhosis', 'Liver Diseases', 'Liver Failure', 'Liver Cirrhosis', 'Viral, Human Hepatitis', 'Hemochromatosis', 'alpha 1-Antitrypsin Deficiency', 'Hepatolenticular Degeneration', 'Alcoholic Liver Diseases', 'Liver Neoplasms', 'Focal Nodular Hyperplasia', 'Liver Cell Adenoma', 'Hemangioma', 'Hepatocellular Carcinoma', 'Pancreatic Neoplasms', 'Gastroesophageal Reflux', 'Gastroenteritis', 'Gastrointestinal Hemorrhage', 'Gastrointestinal Neoplasms', 'Ulcerative Colitis', 'Crohn Disease', 'Peptic Ulcer', 'Pancreatitis', 'General Practice', 'Analgesia', 'Breast Neoplasms', 'Hypertension', 'Heart Failure', 'Atrial Fibrillation', 'Skin eruptions', 'Infectious Skin Diseases', 'Skin Neoplasms', 'Diabetes Mellitus', 'Gastroesophageal Reflux', 'Gastroenteritis', 'Anaemia', 'Headache', 'Dementia', 'Failure to Thrive', 'Asthma', 'Chronic Obstructive Pulmonary Disease', 'Depression', 'Anxiety Disorders', 'Arthritis', 'Haematology', 'Anaemia', 'Leukaemia', 'Myeloid, Acute Leukaemia', 'Myeloid Leukemia, Chronic', 'Acute Lymphoblastic Leukemia', 'Chronic Lymphoblastic Leukemia', 'Myeloproliferative Disorders', 'Erythroblastic, Acute Leukaemia', 'Polycythemia Vera', 'Primary Myelofibrosis', 'Thrombocythemia', 'Blood Coagulation Disorders', 'Hemophilia A', 'Hemophilia B', 'Thrombocytopenic Purpura', 'Von Willebrand Diseases', 'Lymphoma', 'Hodgkin Disease', 'Non-Hodgkin Lymphoma', 'Paraproteinemias', 'Multiple Myeloma', 'Cryoglobulinemia', 'Waldenstrom Macroglobulinemia', 'Infectious Diseases', 'Virus Diseases', 'Viral, Human Hepatitis', 'Cytomegalovirus Infections', 'Poxviruses', 'Viral Hemorrhagic Fevers', 'HIV Infections', 'Bacterial diseases', 'Mycobacterium tuberculosis', 'Mycobacterium leprae', 'Diphtheria', 'Tetanus', 'Typhoid Fever', 'Cholera', 'Shigella', 'Parasicitc and protazoa infections', 'Malaria', 'Amoebiasis', 'Giardiasis', 'Toxoplasmosis', 'Cryptosporidiosis', 'Leishmaniasis', 'Trypanosomiasis', 'Lyme Disease', 'Filariasis', 'Schistosomiasis', 'Neurology', 'Trigeminal Neuralgia', 'Headache', 'Dizziness', 'Vertigo', 'Stroke', 'Parkinsonian Disorders', 'Multiple Sclerosis', 'Motor Neuron Disease', 'Epilepsy', 'Cranial Nerve Diseases', 'Meningitis', 'Nervous System Neoplasms', 'Dementia', 'Oncology and palliative care', 'Lung Neoplasms', 'Breast Neoplasms', 'Prostatic Neoplasms', 'Colorectal Neoplasms', 'Liver Neoplasms', 'Pancreatic Neoplasms', 'Palliative Care', 'Analgesia', 'Ophthalmology', 'Conjunctivitis', 'Retinal Hemorrhage', 'Vitreous Hemorrhage', 'Viral Conjunctivitis', 'Herpetic Keratitis', 'Eye Injuries', 'Cataract', 'Glaucoma', 'Ocular Motility Disorders', 'Orbital Diseases', 'Refractive Errors', 'Retinal Diseases', 'Paediatrics', 'Neonatology', 'Paediatric Infections', 'Measles', 'Rubella', 'Mumps', 'Chickenpox', 'Paediatric Diseases', 'Cystic Fibrosis', 'Asthma', 'Endocarditis', 'Rheumatic Fever', 'Coeliac Disease', 'Chromosome Disorders', 'Diabetes Mellitus', 'Meningococcal Meningitis', 'Febrile Seizures', 'Mental Disorders Diagnosed in Childhood', 'Failure to Thrive', 'Psychiatry', 'Depression', 'Anxiety Disorders', 'Bipolar Disorder', 'Schizophrenia', 'Psychotic Disorders', 'Deliberate Self-Harm', 'Eating Disorders', 'Substance-Related Disorders', 'Personality Disorders', 'Radiology', 'Angiography', 'Mammography', 'Abdominal Radiography', 'Interventional Radiography', 'Thoracic Radiography', 'X-Ray Tomography', 'Respiratory Medicine', 'Pneumonia', 'Bronchiectasis', 'Cystic Fibrosis', 'Fungal Lung Diseases', 'Lung Neoplasms', 'Asthma', 'Chronic Obstructive Pulmonary Disease', 'Respiratory Insufficiency', 'Pneumothorax', 'Pleural Effusion', 'Sarcoidosis', 'Extrinsic Allergic Alveolitis', 'Mesothelioma', 'Idiopathic Pulmonary Fibrosis', 'Obstructive Sleep Apnea', 'Pulmonary oedema', 'Rheumatology', 'Rheumatoid Arthritis', 'Osteoarthritis', 'Fibromyalgia', 'Gout', 'Osteoarthritis', 'Polymyalgia Rheumatica', 'Rheumatic Fever', 'Spondylarthropathies', 'Connective Tissue Diseases', 'Vasculitis', 'Renal Medicine', 'Acute Kidney Failure', 'Chronic Renal Insufficiency', 'Kidney Neoplasms', 'Glomerulonephritis', 'Anti-Glomerular Basement Membrane Disease', 'IGA Glomerulonephritis', 'Membranoproliferative Glomerulonephritis', 'Membranous Glomerulonephritis', 'Focal Segmental Glomerulosclerosis', 'Nephrotic Syndrome', 'Minimal Change Disease', 'Urinary Tract Infections', 'Nephrolithiasis', 'Cystic Kidney Diseases', 'Renal Osteodystrophy', 'Water-Electrolyte Imbalance', 'Specialties, Surgical', 'Ophthalmology', 'Conjunctivitis', 'Retinal Hemorrhage', 'Vitreous Hemorrhage', 'Viral Conjunctivitis', 'Herpetic Keratitis', 'Eye Injuries', 'Cataract', 'Glaucoma', 'Ocular Motility Disorders', 'Orbital Diseases', 'Refractive Errors', 'Retinal Diseases', 'Breast', 'Breast Cyst', 'Breast Neoplasms', 'Fibrocystic Breast Disease', 'Lactation Disorders', 'Mastitis', 'Orthopaedics and Trauma', 'Hip Dislocation', 'Hip Fractures', 'Radius Fractures', 'Ulna Fractures', 'Shoulder Dislocation', 'Shoulder Fractures', 'Spinal Injuries', 'Carpal Tunnel Syndrome', 'Cauda Equina', 'Osteomyelitis', 'Obstetrics', 'Eclampsia', 'Spontaneous Abortion', 'Gestational Diabetes', 'Obstetric Labour Complications', 'Abruptio Placentae', 'Breech Presentation', 'Cephalopelvic Disproportion', 'Dystocia', 'Premature Rupture Fetal Membranes', 'Premature Obstetric Labour', 'Placenta Previa', 'Postpartum Hemorrhage', 'Uterine Inversion', 'Uterine Rupture', 'Vasa Previa', 'Ectopic Pregnancy', 'Gynaecology', 'Hysterectomy', 'Menorrhagia', 'Polycystic Ovary Syndrome', 'Induced Abortion', 'Ectopic Pregnancy', 'Contraception', 'Ovarian Diseases', 'Endometrial Neoplasms', 'Ovarian Neoplasms', 'Female Genital Neoplasms', 'Fallopian Tube Neoplasms', 'Ovarian Neoplasms', 'Uterine Neoplasms', 'Vaginal Neoplasms', 'Vulvar Neoplasms', 'Ear nose and throat (ENT)', 'Cholesteatoma', 'Otitis Media', 'Deafness', 'Epistaxis', 'Nasal Polyps', 'Tonsillar Neoplasms', 'Hoarseness', 'Lumps in the neck', 'Maxillofacial', 'Jaw Fractures', 'Mandibular Injuries', 'Orbital Fractures', 'Zygomatic Fractures', 'Plastic surgery', 'Surgical Flaps', 'Burns', 'Hand Injuries', 'Suture Techniques', 'Breast Reconstruction', 'Urology', 'Urolithiasis', 'Prostatic Hyperplasia', 'Urethral Obstruction', 'Penile Diseases', 'Prostatic Neoplasms', 'Urinary Bladder Neoplasms', 'Testicular Neoplasms', 'Urinary Retention', 'Cardiothoracic surgery', 'Pulmonary Surgical Procedures', 'Cardiac Surgical Procedures', 'Vascular surgery', 'Varicose Veins', 'Arterial Occlusive Diseases', 'Peripheral Vascular Diseases', 'Embolism and Thrombosis', 'Compartment Syndromes', 'Aortic Diseases', 'Aneurysm', 'Carotid Endarterectomy', 'Paediatric Surgery', 'Gastroschisis', 'Hernia', 'Pyloric Stenosis', 'Esophageal Atresia', 'Biliary Atresia', 'Hirschsprung Disease', 'Intussusception', 'Intestinal Volvulus', 'Umbilical Hernia', 'Spermatic Cord Torsion', 'Cryptorchidism', 'Appendicitis', 'General surgery', 'Appendicitis', 'Hernia', 'Hemorrhoids', 'Peritonitis', 'Crohn Disease', 'Ulcerative Colitis', 'Colorectal Neoplasms', 'Esophageal Neoplasms', 'Diverticular disease', 'Cholelithiasis', 'Basic Sciences', 'Anatomy', 'Musculoskeletal System', 'Cardiovascular System', 'Respiratory System', 'Digestive System', 'Peripheral Nervous System', 'Central Nervous System', 'Physiology', 'Cardiovascular Physiology', 'Respiratory Physiology', 'Musculoskeletal Physiology', 'Digestive Physiology', 'Nervous System Physiology', 'Biochemistry', 'Histology', 'Pharmacology', 'Epidemiology', 'Statistics', 'Embryology', 'Sociology', 'Pathology', 'Immunology and Microbiology', 'Ethics and Law', 'Clinical Skills', 'Examination skills', 'Musculoskeletal Examination', 'Cardiovascular Examination', 'Respiratory Examination', 'Abdominal Examination', 'Neurological Examination', 'Cranial nerve examination', 'Motor system examination', 'Sensory system examination', 'Breast Examination', 'Thyroid Examination', 'Otoscopic Examination', 'Gynaecological Examination', 'Antenatal Examination', 'Opthalmoscopy', 'Practical procedures', 'Venipuncture', 'Cannulation', 'Arterial Blood Gas', 'Urinary Catheterization', 'Subcutaneous Injections', 'Intramuscular Injections', 'Lumbar Puncture', 'Nasogastric Tubes', 'Pleural Tap', 'Paracentesis', 'Chest Drain Insertion', 'Central Line', 'Spirometry'
5
+ ]
6
+
3
7
  MESH::Mesh.configure(filename: 'data/mesh_data_2014/d2014.bin.gz')
4
- nu_file = File.open('not_useful.txt')
5
- nu_file.each_line do |line|
6
- id, name = line.split(', ')
7
- MESH::Mesh.find(id).useful = false
8
+ syllabus.each do |si|
9
+
10
+ if mh = MESH::Mesh.find_by_original_heading(si)
11
+ puts "#{si}\t1\t#{mh.inspect}\t#{mh.shallowest_position unless mh.nil?}\t#{mh.deepest_position unless mh.nil?}"
12
+ elsif matches = MESH::Mesh.match_in_text(si)
13
+ topical_matches = matches.map do |m|
14
+ if m[:heading].descriptor_class == :topical_descriptor
15
+ "#{m[:heading].inspect}, #{m[:heading].shallowest_position}, #{m[:heading].deepest_position}"
16
+ end
17
+ end
18
+ topical_matches.compact!
19
+ print "#{si}\t#{topical_matches.length}\t"
20
+ puts topical_matches.join("\t")
21
+ else
22
+ puts 'nil'
23
+ end
8
24
  end
9
25
 
@@ -0,0 +1,443 @@
1
+ require_relative 'test_helper'
2
+
3
+ module MESH
4
+
5
+ class ClassiferTest < Minitest::Test
6
+
7
+ def assert_classification expected, actual
8
+ expected.each do |exp_root, (exp_best_score, exp_headings)|
9
+ refute_nil actual[exp_root], "Expected headings for #{exp_root} but none present in actual"
10
+ act_best_score, act_headings = actual[exp_root]
11
+ assert_equal exp_best_score, act_best_score, "Expected best score of #{exp_best_score} for root #{exp_root} but received #{act_best_score}"
12
+ assert_equal exp_headings.length, act_headings.length, "Expected #{exp_headings.length} headings for root #{exp_root} but received #{act_headings.length}"
13
+ exp_headings.each do |exp_heading, exp_score|
14
+ assert_equal exp_score, act_headings[exp_heading], "Expected score of #{exp_score} for #{exp_heading.unique_id} in root #{exp_root} but received #{act_headings[exp_heading]}"
15
+ end
16
+ end
17
+ end
18
+
19
+ #def test_headers
20
+ # @texts.each do |k, v|
21
+ # matches = MESH::Mesh.match_in_text(v)
22
+ # puts k
23
+ # puts matches
24
+ # end
25
+ #end
26
+ #classifications = classifier.classify([{matches: title_matches, weight: 5.0}, {matches: abstract_matches, weight: 2.0}, {matches: content_matches, weight: 1.0}])
27
+
28
+ def test_it_should_classify_title
29
+ c = MESH::Classifier.new()
30
+
31
+ expected = {
32
+ 'H' => [1.0, {
33
+ MESH::Mesh.find('D000715') => 1.0,
34
+ MESH::Mesh.find('D001690') => 0.333,
35
+ MESH::Mesh.find('D010811') => 0.111
36
+ }],
37
+ 'A' => [1.0, {
38
+ MESH::Mesh.find('D005542') => 1.0,
39
+ MESH::Mesh.find('D034941') => 0.333,
40
+ MESH::Mesh.find('D005121') => 0.111,
41
+ MESH::Mesh.find('D001829') => 0.037
42
+ }]
43
+ }
44
+ assert_classification expected, c.classify([{matches: @headings[:forearm_anatomy_title], weight: 1.0}])
45
+
46
+ expected = {
47
+ 'H' => [1.0, {
48
+ MESH::Mesh.find('D002309') => 1.0,
49
+ MESH::Mesh.find('D007388') => 0.333,
50
+ MESH::Mesh.find('D008511') => 0.111,
51
+ MESH::Mesh.find('D006281') => 0.037
52
+ }]
53
+ }
54
+ assert_classification expected, c.classify([{matches: @headings[:cardiology_title], weight: 1.0}])
55
+ end
56
+
57
+ def test_it_should_classify_poor_abstract
58
+ c = MESH::Classifier.new()
59
+ expected = {
60
+ 'I' => [1.0, {
61
+ MESH::Mesh.find('D013337') => 1.0,
62
+ MESH::Mesh.find('D013336') => 0.667,
63
+ MESH::Mesh.find('D013334') => 0.444,
64
+ MESH::Mesh.find('D004505') => 0.148,
65
+ MESH::Mesh.find('D004493') => 0.198
66
+ }],
67
+ 'M' => [1.0, {
68
+ MESH::Mesh.find('D013337') => 1.0,
69
+ MESH::Mesh.find('D013336') => 0.667,
70
+ MESH::Mesh.find('D013334') => 0.444,
71
+ MESH::Mesh.find('D009272') => 0.148
72
+ }]
73
+ }
74
+ assert_classification expected, c.classify([{matches: @headings[:poor_abstract], weight: 1.0}])
75
+ end
76
+
77
+ def test_it_should_classify_good_abstract
78
+
79
+ c = MESH::Classifier.new()
80
+ expected = {
81
+ 'A' => [1.0, {
82
+ MESH::Mesh.find('D001158') => 1.0,
83
+ MESH::Mesh.find('D001808') => 0.333,
84
+ MESH::Mesh.find('D002319') => 0.111,
85
+ MESH::Mesh.find('D009333') => 1.0,
86
+ MESH::Mesh.find('D001829') => 0.333
87
+ }],
88
+
89
+ 'B' => [1.0, {
90
+ MESH::Mesh.find('D006801') => 1.0,
91
+ MESH::Mesh.find('D015186') => 0.333,
92
+ MESH::Mesh.find('D051079') => 0.111,
93
+ MESH::Mesh.find('D000882') => 0.037,
94
+ MESH::Mesh.find('D011323') => 0.012,
95
+ MESH::Mesh.find('D008322') => 0.004,
96
+ MESH::Mesh.find('D014714') => 0.001,
97
+ }],
98
+ 'F' => [2.0, {
99
+ MESH::Mesh.find('D014836') => 2.0,
100
+ MESH::Mesh.find('D008606') => 0.667,
101
+ MESH::Mesh.find('D011579') => 0.222,
102
+ MESH::Mesh.find('D035781') => 1.0,
103
+ MESH::Mesh.find('D009679') => 0.667,
104
+ MESH::Mesh.find('D005190') => 0.444,
105
+ MESH::Mesh.find('D011593') => 0.148,
106
+ MESH::Mesh.find('D001520') => 0.049,
107
+ MESH::Mesh.find('D011584') => 0.049,
108
+ MESH::Mesh.find('D001525') => 0.049,
109
+ MESH::Mesh.find('D004191') => 0.016,
110
+ MESH::Mesh.find('D012961') => 0.148,
111
+ MESH::Mesh.find('D012942') => 0.099
112
+ }],
113
+ 'H' => [3.0, {
114
+ MESH::Mesh.find('D000715') => 3.0,
115
+ MESH::Mesh.find('D001690') => 1.0,
116
+ MESH::Mesh.find('D010811') => 0.333
117
+ }],
118
+ 'I' => [2.0, {
119
+ MESH::Mesh.find('D013334') => 1.0,
120
+ MESH::Mesh.find('D004505') => 0.333,
121
+ MESH::Mesh.find('D004493') => 0.778,
122
+ MESH::Mesh.find('D013663') => 1.0,
123
+ MESH::Mesh.find('D014937') => 1.0,
124
+ MESH::Mesh.find('D006802') => 0.333,
125
+ MESH::Mesh.find('D018594') => 2.0,
126
+ MESH::Mesh.find('D003469') => 0.667,
127
+ MESH::Mesh.find('D000884') => 0.222,
128
+ MESH::Mesh.find('D000883') => 0.074,
129
+ MESH::Mesh.find('D012942') => 0.296,
130
+ MESH::Mesh.find('D012961') => 0.370,
131
+ MESH::Mesh.find('D035781') => 1.0,
132
+ MESH::Mesh.find('D009679') => 0.667,
133
+ MESH::Mesh.find('D005190') => 0.444
134
+ }],
135
+ 'K' => [2.0, {
136
+ MESH::Mesh.find('D018594') => 2.0,
137
+ MESH::Mesh.find('D001154') => 0.667,
138
+ MESH::Mesh.find('D006809') => 0.556,
139
+ MESH::Mesh.find('D019359') => 1.0
140
+ }],
141
+ 'L' => [1.0, {
142
+ MESH::Mesh.find('D019359') => 1.0,
143
+ MESH::Mesh.find('D007254') => 0.333
144
+ }],
145
+ 'M' => [1.0, {
146
+ MESH::Mesh.find('D013334') => 1.0,
147
+ MESH::Mesh.find('D009272') => 0.667,
148
+ MESH::Mesh.find('D035781') => 1.0
149
+ }],
150
+ 'Z' => [3.0, {
151
+ MESH::Mesh.find('D008131') => 3.0,
152
+ MESH::Mesh.find('D002947') => 1.0,
153
+ MESH::Mesh.find('D005842') => 0.481,
154
+ MESH::Mesh.find('D004739') => 1.0,
155
+ MESH::Mesh.find('D006113') => 0.667,
156
+ MESH::Mesh.find('D005060') => 0.222,
157
+ MESH::Mesh.find('D062312') => 0.222
158
+ }]
159
+
160
+ }
161
+ assert_classification expected, c.classify([{matches: @headings[:good_abstract], weight: 1.0}])
162
+ end
163
+
164
+ def test_it_should_classify_content
165
+ c = MESH::Classifier.new()
166
+ expected = {
167
+ 'A' => [10.0, {
168
+ MESH::Mesh.find('D001132') => 1.0, MESH::Mesh.find('D034941') => 1.0, MESH::Mesh.find('D005121') => 2.556, MESH::Mesh.find('D001829') => 1.370, MESH::Mesh.find('D001415') => 1.0, MESH::Mesh.find('D060726') => 1.333, MESH::Mesh.find('D005123') => 2.0, MESH::Mesh.find('D005145') => 0.667, MESH::Mesh.find('D006257') => 0.222, MESH::Mesh.find('D012679') => 0.667, MESH::Mesh.find('D006225') => 2.0, MESH::Mesh.find('D006321') => 10.0, MESH::Mesh.find('D002319') => 3.333, MESH::Mesh.find('D007866') => 2.0, MESH::Mesh.find('D035002') => 0.667, MESH::Mesh.find('D013909') => 3.0, MESH::Mesh.find('D001842') => 1.0, MESH::Mesh.find('D012863') => 0.333, MESH::Mesh.find('D009141') => 0.111, MESH::Mesh.find('D003238') => 0.333, MESH::Mesh.find('D014024') => 0.111
169
+ }],
170
+ 'B' => [1.0, {
171
+ MESH::Mesh.find('D027861') => 1.0, MESH::Mesh.find('D027824') => 0.333, MESH::Mesh.find('D019685') => 0.111, MESH::Mesh.find('D019684') => 0.037, MESH::Mesh.find('D019669') => 0.012, MESH::Mesh.find('D057949') => 0.004, MESH::Mesh.find('D057948') => 0.001
172
+ }],
173
+ 'C' => [1.0, {
174
+ MESH::Mesh.find('D003221') => 1.0, MESH::Mesh.find('D019954') => 1.0, MESH::Mesh.find('D009461') => 0.667, MESH::Mesh.find('D009422') => 0.222, MESH::Mesh.find('D012816') => 0.222, MESH::Mesh.find('D013568') => 0.074
175
+ }],
176
+ 'D' => [13.0, {
177
+ MESH::Mesh.find('D007854') => 13.0, MESH::Mesh.find('D019216') => 8.667, MESH::Mesh.find('D004602') => 2.889, MESH::Mesh.find('D007287') => 1.926, MESH::Mesh.find('D008670') => 2.889
178
+ }],
179
+ 'E' => [2.0, {
180
+ MESH::Mesh.find('D004562') => 2.0, MESH::Mesh.find('D006334') => 0.667, MESH::Mesh.find('D003935') => 0.222, MESH::Mesh.find('D019937') => 0.296, MESH::Mesh.find('D003933') => 0.099, MESH::Mesh.find('D004568') => 0.667
181
+ }],
182
+ 'F' => [4.0, {
183
+ MESH::Mesh.find('D003221') => 1.0, MESH::Mesh.find('D019954') => 1.0, MESH::Mesh.find('D001520') => 0.333, MESH::Mesh.find('D007858') => 1.0, MESH::Mesh.find('D008606') => 2.0, MESH::Mesh.find('D011579') => 0.704, MESH::Mesh.find('D011588') => 0.333, MESH::Mesh.find('D011585') => 0.111, MESH::Mesh.find('D011584') => 0.111, MESH::Mesh.find('D001525') => 0.037, MESH::Mesh.find('D004191') => 0.012, MESH::Mesh.find('D013850') => 1.0, MESH::Mesh.find('D014836') => 4.0
184
+ }],
185
+ 'G' => [2.0, {
186
+ MESH::Mesh.find('D000200') => 2.0, MESH::Mesh.find('D008564') => 2.0, MESH::Mesh.find('D055592') => 0.667, MESH::Mesh.find('D055585') => 0.691, MESH::Mesh.find('D002468') => 0.667, MESH::Mesh.find('D055724') => 0.667, MESH::Mesh.find('D010829') => 0.222, MESH::Mesh.find('D009424') => 0.667, MESH::Mesh.find('D055687') => 0.222, MESH::Mesh.find('D013995') => 1.0, MESH::Mesh.find('D014919') => 1.0, MESH::Mesh.find('D000392') => 1.0, MESH::Mesh.find('D055907') => 0.333, MESH::Mesh.find('D055691') => 0.111, MESH::Mesh.find('D055669') => 0.416, MESH::Mesh.find('D001686') => 0.139, MESH::Mesh.find('D014887') => 1.0, MESH::Mesh.find('D001272') => 0.889, MESH::Mesh.find('D004777') => 0.506, MESH::Mesh.find('D008685') => 0.630, MESH::Mesh.find('D000388') => 0.333, MESH::Mesh.find('D014965') => 1.0, MESH::Mesh.find('D060733') => 0.667, MESH::Mesh.find('D055590') => 0.222, MESH::Mesh.find('D060328') => 0.074, MESH::Mesh.find('D011827') => 0.333, MESH::Mesh.find('D011839') => 0.333
187
+ }],
188
+ 'I' => [1.0, {
189
+ MESH::Mesh.find('D014937') => 1.0, MESH::Mesh.find('D006802') => 0.333
190
+ }],
191
+ 'K' => [1.0, {
192
+ MESH::Mesh.find('D019368') => 1.0, MESH::Mesh.find('D006809') => 0.333
193
+ }],
194
+ 'L' => [1.0, {
195
+ MESH::Mesh.find('D009275') => 1.0, MESH::Mesh.find('D009626') => 0.333, MESH::Mesh.find('D008037') => 0.111, MESH::Mesh.find('D007802') => 0.037, MESH::Mesh.find('D003142') => 0.025, MESH::Mesh.find('D007254') => 0.008
196
+ }],
197
+ 'M' => [6.0, {
198
+ MESH::Mesh.find('D010361') => 6.0, MESH::Mesh.find('D009272') => 2.0
199
+ }],
200
+ 'N' => [1.0, {
201
+ MESH::Mesh.find('D009938') => 1.0, MESH::Mesh.find('D004472') => 0.333, MESH::Mesh.find('D014919') => 1.0, MESH::Mesh.find('D000392') => 1.0, MESH::Mesh.find('D014887') => 1.0, MESH::Mesh.find('D001272') => 0.889, MESH::Mesh.find('D004777') => 0.543, MESH::Mesh.find('D004778') => 0.181, MESH::Mesh.find('D008685') => 0.630, MESH::Mesh.find('D000388') => 0.333, MESH::Mesh.find('D059205') => 0.333, MESH::Mesh.find('D004736') => 0.111
202
+ }],
203
+ 'V' => [1.0, {
204
+ MESH::Mesh.find('D017203') => 1.0, MESH::Mesh.find('D019215') => 0.333, MESH::Mesh.find('D052181') => 0.111, MESH::Mesh.find('D052180') => 0.148, MESH::Mesh.find('D016456') => 0.111
205
+ }],
206
+ 'Z' => [1.0, {
207
+ MESH::Mesh.find('D014481') => 1.0, MESH::Mesh.find('D009656') => 0.333, MESH::Mesh.find('D000569') => 0.111, MESH::Mesh.find('D005842') => 0.037
208
+ }]
209
+ }
210
+
211
+ assert_classification expected, c.classify([{matches: @headings[:medium_content], weight: 1.0}])
212
+ end
213
+
214
+ def test_it_should_classify_other_content_as_well
215
+ c = MESH::Classifier.new()
216
+ expected = {
217
+ 'A' => [2.0, {
218
+ MESH::Mesh.find('D001769') => 1.0, MESH::Mesh.find('D001826') => 0.333, MESH::Mesh.find('D005441') => 0.111, MESH::Mesh.find('D006424') => 0.333, MESH::Mesh.find('D006624') => 1.0, MESH::Mesh.find('D008032') => 0.333, MESH::Mesh.find('D001921') => 0.115, MESH::Mesh.find('D002490') => 0.038, MESH::Mesh.find('D009420') => 0.013, MESH::Mesh.find('D002540') => 0.333, MESH::Mesh.find('D054022') => 0.111, MESH::Mesh.find('D013687') => 0.037, MESH::Mesh.find('D016548') => 0.012, MESH::Mesh.find('D008099') => 2.0, MESH::Mesh.find('D004064') => 1.0, MESH::Mesh.find('D010179') => 1.0
219
+ }],
220
+ 'D' => [4.136, {
221
+ MESH::Mesh.find('D000269') => 1.0, MESH::Mesh.find('D020313') => 0.383, MESH::Mesh.find('D020164') => 0.171, MESH::Mesh.find('D000900') => 1.0, MESH::Mesh.find('D000890') => 0.333, MESH::Mesh.find('D045506') => 0.111, MESH::Mesh.find('D020228') => 0.131, MESH::Mesh.find('D001786') => 2.0, MESH::Mesh.find('D005947') => 1.667, MESH::Mesh.find('D006601') => 0.556, MESH::Mesh.find('D009005') => 0.185, MESH::Mesh.find('D002241') => 4.136, MESH::Mesh.find('D004247') => 2.0, MESH::Mesh.find('D009696') => 0.667, MESH::Mesh.find('D009706') => 0.222, MESH::Mesh.find('D006728') => 1.263, MESH::Mesh.find('D006730') => 0.842, MESH::Mesh.find('D045505') => 0.281, MESH::Mesh.find('D007328') => 4.0, MESH::Mesh.find('D011384') => 2.667, MESH::Mesh.find('D061385') => 1.778, MESH::Mesh.find('D010187') => 1.185, MESH::Mesh.find('D036361') => 0.790, MESH::Mesh.find('D010455') => 0.263, MESH::Mesh.find('D000602') => 0.187, MESH::Mesh.find('D011498') => 0.889, MESH::Mesh.find('D011506') => 0.296, MESH::Mesh.find('D013213') => 1.0, MESH::Mesh.find('D005936') => 0.667, MESH::Mesh.find('D001704') => 0.222, MESH::Mesh.find('D011108') => 0.222, MESH::Mesh.find('D046911') => 0.074, MESH::Mesh.find('D001697') => 0.148, MESH::Mesh.find('D011134') => 0.222
222
+ }],
223
+ 'F' => [1.0, {
224
+ MESH::Mesh.find('D005190') => 1.0, MESH::Mesh.find('D011593') => 0.333, MESH::Mesh.find('D001520') => 0.111, MESH::Mesh.find('D011584') => 0.111, MESH::Mesh.find('D001525') => 0.111, MESH::Mesh.find('D004191') => 0.037, MESH::Mesh.find('D012961') => 0.333, MESH::Mesh.find('D012942') => 0.222
225
+ }],
226
+ 'G' => [1.0, {
227
+ MESH::Mesh.find('D012621') => 1.0, MESH::Mesh.find('D010507') => 0.333, MESH::Mesh.find('D013995') => 0.111, MESH::Mesh.find('D055585') => 0.037, MESH::Mesh.find('D002909') => 0.111, MESH::Mesh.find('D010829') => 0.037, MESH::Mesh.find('D002980') => 0.667, MESH::Mesh.find('D004777') => 0.321, MESH::Mesh.find('D055669') => 0.132, MESH::Mesh.find('D001686') => 0.044, MESH::Mesh.find('D001272') => 0.222, MESH::Mesh.find('D008685') => 0.074
228
+ }],
229
+ 'I' => [1.0, {
230
+ MESH::Mesh.find('D005190') => 1.0, MESH::Mesh.find('D012961') => 0.333, MESH::Mesh.find('D012942') => 0.222
231
+ }],
232
+ 'J' => [1.0, {
233
+ MESH::Mesh.find('D000269') => 1.0, MESH::Mesh.find('D008420') => 0.444, MESH::Mesh.find('D013676') => 0.148, MESH::Mesh.find('D005389') => 1.0, MESH::Mesh.find('D054041') => 0.333, MESH::Mesh.find('D005502') => 1.0, MESH::Mesh.find('D019602') => 0.333
234
+ }],
235
+ 'L' => [1.0, {
236
+ MESH::Mesh.find('D005246') => 1.0, MESH::Mesh.find('D003491') => 0.333, MESH::Mesh.find('D003142') => 0.111, MESH::Mesh.find('D007254') => 0.037
237
+ }],
238
+ 'N' => [1.0, {
239
+ MESH::Mesh.find('D012621') => 1.0, MESH::Mesh.find('D002980') => 0.667, MESH::Mesh.find('D004777') => 0.321, MESH::Mesh.find('D004778') => 0.107, MESH::Mesh.find('D001272') => 0.222, MESH::Mesh.find('D008685') => 0.074
240
+ }]
241
+ }
242
+ assert_classification expected, c.classify([{matches: @headings[:short_content], weight: 1.0}])
243
+ end
244
+
245
+ def test_it_should_classify_title_abstract_and_content
246
+ c = MESH::Classifier.new()
247
+
248
+ doc = {
249
+ title: 'Rotation',
250
+ abstract: 'Oxygen',
251
+ content: 'Nose'
252
+ }
253
+
254
+ expected = {
255
+ 'A' => [2.0, {
256
+ MESH::Mesh.find('D001769') => 1.0, MESH::Mesh.find('D001826') => 0.333, MESH::Mesh.find('D005441') => 0.111, MESH::Mesh.find('D006424') => 0.333, MESH::Mesh.find('D006624') => 1.0, MESH::Mesh.find('D008032') => 0.333, MESH::Mesh.find('D001921') => 0.115, MESH::Mesh.find('D002490') => 0.038, MESH::Mesh.find('D009420') => 0.013, MESH::Mesh.find('D002540') => 0.333, MESH::Mesh.find('D054022') => 0.111, MESH::Mesh.find('D013687') => 0.037, MESH::Mesh.find('D016548') => 0.012, MESH::Mesh.find('D008099') => 2.0, MESH::Mesh.find('D004064') => 1.0, MESH::Mesh.find('D010179') => 1.0
257
+ }],
258
+ 'D' => [4.136, {
259
+ MESH::Mesh.find('D000269') => 1.0, MESH::Mesh.find('D020313') => 0.383, MESH::Mesh.find('D020164') => 0.171, MESH::Mesh.find('D000900') => 1.0, MESH::Mesh.find('D000890') => 0.333, MESH::Mesh.find('D045506') => 0.111, MESH::Mesh.find('D020228') => 0.131, MESH::Mesh.find('D001786') => 2.0, MESH::Mesh.find('D005947') => 1.667, MESH::Mesh.find('D006601') => 0.556, MESH::Mesh.find('D009005') => 0.185, MESH::Mesh.find('D002241') => 4.136, MESH::Mesh.find('D004247') => 2.0, MESH::Mesh.find('D009696') => 0.667, MESH::Mesh.find('D009706') => 0.222, MESH::Mesh.find('D006728') => 1.263, MESH::Mesh.find('D006730') => 0.842, MESH::Mesh.find('D045505') => 0.281, MESH::Mesh.find('D007328') => 4.0, MESH::Mesh.find('D011384') => 2.667, MESH::Mesh.find('D061385') => 1.778, MESH::Mesh.find('D010187') => 1.185, MESH::Mesh.find('D036361') => 0.790, MESH::Mesh.find('D010455') => 0.263, MESH::Mesh.find('D000602') => 0.187, MESH::Mesh.find('D011498') => 0.889, MESH::Mesh.find('D011506') => 0.296, MESH::Mesh.find('D013213') => 1.0, MESH::Mesh.find('D005936') => 0.667, MESH::Mesh.find('D001704') => 0.222, MESH::Mesh.find('D011108') => 0.222, MESH::Mesh.find('D046911') => 0.074, MESH::Mesh.find('D001697') => 0.148, MESH::Mesh.find('D011134') => 0.222
260
+ }],
261
+ 'F' => [1.0, {
262
+ MESH::Mesh.find('D005190') => 1.0, MESH::Mesh.find('D011593') => 0.333, MESH::Mesh.find('D001520') => 0.111, MESH::Mesh.find('D011584') => 0.111, MESH::Mesh.find('D001525') => 0.111, MESH::Mesh.find('D004191') => 0.037, MESH::Mesh.find('D012961') => 0.333, MESH::Mesh.find('D012942') => 0.222
263
+ }],
264
+ 'G' => [1.0, {
265
+ MESH::Mesh.find('D012621') => 1.0, MESH::Mesh.find('D010507') => 0.333, MESH::Mesh.find('D013995') => 0.111, MESH::Mesh.find('D055585') => 0.037, MESH::Mesh.find('D002909') => 0.111, MESH::Mesh.find('D010829') => 0.037, MESH::Mesh.find('D002980') => 0.667, MESH::Mesh.find('D004777') => 0.321, MESH::Mesh.find('D055669') => 0.132, MESH::Mesh.find('D001686') => 0.044, MESH::Mesh.find('D001272') => 0.222, MESH::Mesh.find('D008685') => 0.074
266
+ }],
267
+ 'H' => [7.0, {
268
+ MESH::Mesh.find('D002309') => 7.0, MESH::Mesh.find('D007388') => 2.333, MESH::Mesh.find('D008511') => 0.778, MESH::Mesh.find('D006281') => 0.259
269
+ }],
270
+ 'I' => [3.0, {
271
+ MESH::Mesh.find('D013337') => 3.0, MESH::Mesh.find('D013336') => 2.0, MESH::Mesh.find('D013334') => 1.333, MESH::Mesh.find('D004505') => 0.444, MESH::Mesh.find('D004493') => 0.593, MESH::Mesh.find('D005190') => 1.0, MESH::Mesh.find('D012961') => 0.333, MESH::Mesh.find('D012942') => 0.222
272
+ }],
273
+ 'J' => [1.0, {
274
+ MESH::Mesh.find('D000269') => 1.0, MESH::Mesh.find('D008420') => 0.444, MESH::Mesh.find('D013676') => 0.148, MESH::Mesh.find('D005389') => 1.0, MESH::Mesh.find('D054041') => 0.333, MESH::Mesh.find('D005502') => 1.0, MESH::Mesh.find('D019602') => 0.333
275
+ }],
276
+ 'L' => [1.0, {
277
+ MESH::Mesh.find('D005246') => 1.0, MESH::Mesh.find('D003491') => 0.333, MESH::Mesh.find('D003142') => 0.111, MESH::Mesh.find('D007254') => 0.037
278
+ }],
279
+ 'M' => [3.0, {
280
+ MESH::Mesh.find('D013337') => 3.0, MESH::Mesh.find('D013336') => 2.0, MESH::Mesh.find('D013334') => 1.333, MESH::Mesh.find('D009272') => 0.444
281
+ }],
282
+ 'N' => [1.0, {
283
+ MESH::Mesh.find('D012621') => 1.0, MESH::Mesh.find('D002980') => 0.667, MESH::Mesh.find('D004777') => 0.321, MESH::Mesh.find('D004778') => 0.107, MESH::Mesh.find('D001272') => 0.222, MESH::Mesh.find('D008685') => 0.074
284
+ }]
285
+ }
286
+
287
+ assert_classification expected, c.classify([{matches: @headings[:cardiology_title], weight: 7.0}, {matches: @headings[:poor_abstract], weight: 3.0}, {matches: @headings[:short_content], weight: 1.0}])
288
+
289
+ end
290
+
291
+ def setup
292
+ #@texts = {
293
+ # forearm_anatomy_title: 'Posterior forearm muscular anatomy',
294
+ #
295
+ # cardiology_title: 'Cardiology in a Heartbeat',
296
+ #
297
+ # medium_content: 'hi in this tutorial I\'m you talk about electrocardiography so we\'ll be looking at the first principles open electrocardiogram more commonly known as an the CD or an ekgs in the United States there\'s a fairly the information in this tutorial but I\'ll try make it as simple as possible the first people were gonna look at where you attached leave them a CG machine to a patient crucible there are four leaves which are attached to the limbs the patient these are abbreviated LA left arm are a a ride home L the left leg and are I\'ll right leg there are also six leaves which we attach to the chest the patient these called chest leads missed the point of confusion for many people went first learning the PCG their these 10 leads which we\'ve attached to the patient but this is not what we mean when we talk about EC jail aids and EC Jade lead is an mathematically determined recording which is made up from a combination of these physically that are attached to the patient so from here on in when I talk about and a CG laid I\'m going to be talking about these mathematically determined recordings you don\'t need to know how these lead the calculated just know they\'re not the same thing as the lead attached to the patient so in a 12 lead the CJ which is the standard PCG they are 12 they\'d leave and each lead shows the heart from a different view so if I drop a heart like this and we\'re looking at it from me anterior aspect we can thinking these leads as little lies the h3 the heart from a different angle so there are 60 these eyes look at the heart in a corona plane and they look at the heart in the directions are shown here each of these leaves has a name this is laid one this is lead to this is lead gray and the other thing called abe et al I V on and a bf this stands for augmented Victor left right and Fort the chest leads look at the heart in a transverse plane so again these work like little eyes that each look at the heart from a different angle these are labeled much more simply they called v1 v2 b3 be full be polite and basics and that\'s the front and the back the two author now let\'s have a think about the limb leads again if I drop a diagram a the lead directions without the hard we get an image that looks like this if we extend these lines that in the opposite direction to which they point we will see that we have every direction coveted in 30 degree increments now would be a good time to talk about what I mean by looking at the heart the EC G carb see the heart in the wind x-ray came it sees it electrically that is to say it sees whether there is electrical deep polarization all repolarization occurring in the direction of peach laid if you don\'t know what I mean by D polarized nation and repolarization I\'m talking about the flow of cardiac action potentials through the heart you can check out the action potential series at WWW dot hand written tutorials dot com for more information so let me explain this a little further I\'m you draw up a hot here and we\'re gonna look at recordings the taken from lead to lead 3 and aber and we\'re going to look at the polarized nation which is occurring in this direction so any deep polarization that occurs in the direction of the lead cause away from the graph which is positive in nature that is and up with deflection so because lead to is roughly the same direction as the deep polarization the wave on the graph will look like this because lead 3 is perpendicular to the direction the polarization there will be no change in the graph and finally because aber is in the direction opposite to the direction people organization there\'s an inverted way or damn would deflection and that\'s an interview the first principles been a CG in the next tutorial will be looking at the normal patton Albany CG during the cardiac cycle for more free tutorials and the PDF this tutorial visit WWW dot hand written tutorials dot com',
298
+ #
299
+ # short_content: 'diabetes drug families suck my big NO inhibited gray Taurus suck my big a new inhibiting Glee Taurus so finally arias tells the pancreas you need to release more insulin so fun mines are antibiotics medics mimic natural hormones like interest in Emelin that have similar functions to insulin big one-eyed decreases the liver from making more glucose the liver is a big organ analogues have gone make peptide-1 hookah gone a comedian the increases blood sugar by releasing starch sugar in be eventually lowers blood sugar the feedback stimulate insulin release a great drug would be like glue guns eventual function be but not do function hey that drug is a GOP won analog inhibitors about the glucoside ace glucoside a season enzyme that cuts big sugars into small sugars that food in your blood it\'s the small sugars that cause problems if you give it a glucoside et sans I\'m you have less to be small problem causing sugars good his own perfect DNA use see less insulin resistant magical glitter changes your DNA per superpowers help it go help hippocampus in',
300
+ #
301
+ # poor_abstract: 'This is a guide to performing a cardiovascular examination in the context of an OSCE exam. It was created by a group of medical students for the free revision website www.geekymedics.com where you can find a written guide to accompany the video. The way in which this examination is carried out varies greatly between individuals & institutions therefore this should be used as a rough framework which you can personalise to suit your own style.',
302
+ #
303
+ # good_abstract: 'The “Arterial Schematic” represents the intricate three-dimensional human arterial system in a highly simplified two-dimensional design reminiscent of the London Underground Map. Each “line” represents an artery within the body; a black circle marks a major vessel, whilst “stubs” stemming from the main lines represent the distal vasculature. The coloured “zones” represent the main divisions of the human body, for example; the yellow zone indicates the neck. The schematic was inspired by Henry Beck’s work on the first diagrammatic London Underground Map. His aim was to represent complex geographical distribution in a simple and accessible form. He achieved this aim by omitting swathes of information that had plagued previous designers’ versions. Beck’s approach was succinct yet produced a design that was immediately successful in clearly portraying to commuters how to traverse London most efficiently. The “Arterial Schematic” hopes to culminate this idea of communicating complex concepts in a concise manner, mirroring what is expected of medical professionals on a daily basis. The schematic is a prototype design intended to be part of a series of images that will diagrammatically represent the various systems of the human body. The prototype was inspired by a desire to teach anatomy via a fresh and engaging visual medium. Recent years have seen significant debate over reduced undergraduate anatomy teaching and its later consequences. The hope is that the “Arterial Schematic” and its sister diagrams will inspire students to learn anatomy and encourage them to further their knowledge via other sources. PLEASE NOTE: This image is available for purchase in print, please contact l.farmery1@gmail.com if interested. Please follow LFarmery on Twitter and considering sharing the Arterial Schematic on Facebook etc. Many Thanks.'
304
+ #}
305
+
306
+ @headings = {
307
+
308
+ forearm_anatomy_title:
309
+ [
310
+ {heading: MESH::Mesh.find('D000715'), matched: 'Anatomy', index: 26},
311
+ {heading: MESH::Mesh.find('D005542'), matched: 'Forearm', index: 9}
312
+ ],
313
+ cardiology_title:
314
+ [
315
+ {heading: MESH::Mesh.find('D002309'), matched: 'Cardiology', index: 0}
316
+ ],
317
+ medium_content:
318
+ [
319
+ {heading: MESH::Mesh.find('D000200'), matched: 'Action Potential', index: 2841},
320
+ {heading: MESH::Mesh.find('D000200'), matched: 'Action Potentials', index: 2783},
321
+ {heading: MESH::Mesh.find('D001132'), matched: 'Arm', index: 480},
322
+ {heading: MESH::Mesh.find('D001415'), matched: 'Back', index: 2080},
323
+ {heading: MESH::Mesh.find('D003221'), matched: 'Confusion', index: 652},
324
+ {heading: MESH::Mesh.find('D004562'), matched: 'Electrocardiogram', index: 107},
325
+ {heading: MESH::Mesh.find('D004562'), matched: 'Electrocardiography', index: 38},
326
+ {heading: MESH::Mesh.find('D005121'), matched: 'Limb', index: 2133},
327
+ {heading: MESH::Mesh.find('D005121'), matched: 'Limbs', index: 432},
328
+ {heading: MESH::Mesh.find('D005123'), matched: 'Eyes', index: 1532},
329
+ {heading: MESH::Mesh.find('D005123'), matched: 'Eyes', index: 1910},
330
+ {heading: MESH::Mesh.find('D006225'), matched: 'Hand', index: 2876},
331
+ {heading: MESH::Mesh.find('D006225'), matched: 'Hand', index: 3876},
332
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 1320},
333
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 1363},
334
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 1481},
335
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 1549},
336
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 1594},
337
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 1850},
338
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 1937},
339
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 2464},
340
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 2492},
341
+ {heading: MESH::Mesh.find('D006321'), matched: 'Heart', index: 2813},
342
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 836},
343
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 1129},
344
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 1193},
345
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 1233},
346
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 1305},
347
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 1690},
348
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 1706},
349
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 2176},
350
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 3045},
351
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 3053},
352
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 3215},
353
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 3316},
354
+ {heading: MESH::Mesh.find('D007854'), matched: 'Lead', index: 3429},
355
+ {heading: MESH::Mesh.find('D007858'), matched: 'Learning', index: 689},
356
+ {heading: MESH::Mesh.find('D007866'), matched: 'Leg', index: 513},
357
+ {heading: MESH::Mesh.find('D007866'), matched: 'Leg', index: 536},
358
+ {heading: MESH::Mesh.find('D009275'), matched: 'Name', index: 1660},
359
+ {heading: MESH::Mesh.find('D009938'), matched: 'Organization', index: 3602},
360
+ {heading: MESH::Mesh.find('D010361'), matched: 'Patient', index: 367},
361
+ {heading: MESH::Mesh.find('D010361'), matched: 'Patient', index: 442},
362
+ {heading: MESH::Mesh.find('D010361'), matched: 'Patient', index: 599},
363
+ {heading: MESH::Mesh.find('D010361'), matched: 'Patient', index: 755},
364
+ {heading: MESH::Mesh.find('D010361'), matched: 'Patient', index: 964},
365
+ {heading: MESH::Mesh.find('D010361'), matched: 'Patient', index: 1214},
366
+ {heading: MESH::Mesh.find('D013850'), matched: 'Thinking', index: 1434},
367
+ {heading: MESH::Mesh.find('D013909'), matched: 'Chest', index: 589},
368
+ {heading: MESH::Mesh.find('D013909'), matched: 'Chest', index: 620},
369
+ {heading: MESH::Mesh.find('D013909'), matched: 'Chest', index: 1826},
370
+ {heading: MESH::Mesh.find('D013995'), matched: 'Time', index: 2415},
371
+ {heading: MESH::Mesh.find('D014481'), matched: 'United States', index: 176},
372
+ {heading: MESH::Mesh.find('D014836'), matched: 'Will', index: 2325},
373
+ {heading: MESH::Mesh.find('D014836'), matched: 'Will', index: 3401},
374
+ {heading: MESH::Mesh.find('D014836'), matched: 'Will', index: 3493},
375
+ {heading: MESH::Mesh.find('D014836'), matched: 'Will', index: 3740},
376
+ {heading: MESH::Mesh.find('D014919'), matched: 'Wind', index: 2505},
377
+ {heading: MESH::Mesh.find('D014937'), matched: 'Work', index: 1893},
378
+ {heading: MESH::Mesh.find('D014965'), matched: 'X-Ray', index: 2510},
379
+ {heading: MESH::Mesh.find('D017203'), matched: 'Interview', index: 3678},
380
+ {heading: MESH::Mesh.find('D019368'), matched: 'Nature', index: 3267},
381
+ {heading: MESH::Mesh.find('D027861'), matched: 'Peach', index: 2663}
382
+ ],
383
+ short_content:
384
+ [
385
+ {heading: MESH::Mesh.find('D000269'), matched: 'Glue', index: 586},
386
+ {heading: MESH::Mesh.find('D000900'), matched: 'Antibiotics', index: 186},
387
+ {heading: MESH::Mesh.find('D001769'), matched: 'Blood', index: 789},
388
+ {heading: MESH::Mesh.find('D001786'), matched: 'Blood Sugar', index: 446},
389
+ {heading: MESH::Mesh.find('D001786'), matched: 'Blood Sugar', index: 508},
390
+ {heading: MESH::Mesh.find('D002241'), matched: 'Sugars', index: 746},
391
+ {heading: MESH::Mesh.find('D002241'), matched: 'Sugars', index: 764},
392
+ {heading: MESH::Mesh.find('D002241'), matched: 'Sugars', index: 810},
393
+ {heading: MESH::Mesh.find('D002241'), matched: 'Sugars', index: 918},
394
+ {heading: MESH::Mesh.find('D004247'), matched: 'DNA', index: 946},
395
+ {heading: MESH::Mesh.find('D004247'), matched: 'DNA', index: 1010},
396
+ {heading: MESH::Mesh.find('D005190'), matched: 'Families', index: 13},
397
+ {heading: MESH::Mesh.find('D005246'), matched: 'Feedback', index: 524},
398
+ {heading: MESH::Mesh.find('D005389'), matched: 'Guns', index: 591},
399
+ {heading: MESH::Mesh.find('D005502'), matched: 'Food', index: 776},
400
+ {heading: MESH::Mesh.find('D005947'), matched: 'Glucose', index: 341},
401
+ {heading: MESH::Mesh.find('D006624'), matched: 'Hippocampus', index: 1046},
402
+ {heading: MESH::Mesh.find('D006728'), matched: 'Hormones', index: 219},
403
+ {heading: MESH::Mesh.find('D007328'), matched: 'Insulin', index: 161},
404
+ {heading: MESH::Mesh.find('D007328'), matched: 'Insulin', index: 283},
405
+ {heading: MESH::Mesh.find('D007328'), matched: 'Insulin', index: 543},
406
+ {heading: MESH::Mesh.find('D007328'), matched: 'Insulin', index: 963},
407
+ {heading: MESH::Mesh.find('D008099'), matched: 'Liver', index: 318},
408
+ {heading: MESH::Mesh.find('D008099'), matched: 'Liver', index: 353},
409
+ {heading: MESH::Mesh.find('D010179'), matched: 'Pancreas', index: 127},
410
+ {heading: MESH::Mesh.find('D012621'), matched: 'Season', index: 718},
411
+ {heading: MESH::Mesh.find('D013213'), matched: 'Starch', index: 471}
412
+ ],
413
+ poor_abstract:
414
+ [
415
+ {heading: MESH::Mesh.find('D013337'), matched: 'Medical Students', index: 119}
416
+ ],
417
+ good_abstract:
418
+ [
419
+ {heading: MESH::Mesh.find('D000715'), matched: 'Anatomy', index: 1294},
420
+ {heading: MESH::Mesh.find('D000715'), matched: 'Anatomy', index: 1411},
421
+ {heading: MESH::Mesh.find('D000715'), matched: 'Anatomy', index: 1553},
422
+ {heading: MESH::Mesh.find('D001158'), matched: 'Artery', index: 204},
423
+ {heading: MESH::Mesh.find('D006801'), matched: 'Human', index: 67},
424
+ {heading: MESH::Mesh.find('D008131'), matched: 'London', index: 154},
425
+ {heading: MESH::Mesh.find('D008131'), matched: 'London', index: 535},
426
+ {heading: MESH::Mesh.find('D008131'), matched: 'London', index: 888},
427
+ {heading: MESH::Mesh.find('D009333'), matched: 'Neck', index: 455},
428
+ {heading: MESH::Mesh.find('D013334'), matched: 'Students', index: 1535},
429
+ {heading: MESH::Mesh.find('D013663'), matched: 'Teaching', index: 1419},
430
+ {heading: MESH::Mesh.find('D014836'), matched: 'Will', index: 1175},
431
+ {heading: MESH::Mesh.find('D014836'), matched: 'Will', index: 1522},
432
+ {heading: MESH::Mesh.find('D014937'), matched: 'Work', index: 504},
433
+ {heading: MESH::Mesh.find('D018594'), matched: 'Human Body', index: 400},
434
+ {heading: MESH::Mesh.find('D018594'), matched: 'Human Body', index: 1234},
435
+ {heading: MESH::Mesh.find('D019359'), matched: 'Knowledge', index: 1597},
436
+ {heading: MESH::Mesh.find('D035781'), matched: 'Sister', index: 1506}
437
+ ]
438
+ }
439
+ end
440
+
441
+ end
442
+
443
+ end