Analysis all pyq and give me most repeated questions with number of how many times repeat Also give me most imp topics according my new Ncism 3rd year BAMS shalya tantra
cd /home/daytona/workspace/attachments/7cd11e69-986a-4b28-95a0-ffeb92b21965/ && python3 -c " import pdfplumber with pdfplumber.open('shalya paper.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text) print() "
cd /home/daytona/workspace/attachments/7cd11e69-986a-4b28-95a0-ffeb92b21965/ && python3 -c " import fitz # pymupdf doc = fitz.open('shalya paper.pdf') print(f'Pages: {len(doc)}') for i, page in enumerate(doc): text = page.get_text() if text.strip(): print(f'--- PAGE {i+1} ---') print(text[:500]) else: print(f'Page {i+1}: (no text layer)') "
cd /home/daytona/workspace/attachments/7cd11e69-986a-4b28-95a0-ffeb92b21965/ && python3 -c " from pypdf import PdfReader reader = PdfReader('shalya paper.pdf') print(f'Pages: {len(reader.pages)}') # Check if pages have images page = reader.pages[0] print('Resources:', page.get('/Resources')) print('Images:', list(page.images) if hasattr(page, 'images') else 'N/A') "
which tesseract && tesseract --version 2>&1 | head -3
cd /home/daytona/workspace/attachments/7cd11e69-986a-4b28-95a0-ffeb92b21965/ && mkdir -p /home/daytona/workspace/shalya-ocr && python3 -c " from pypdf import PdfReader import io, os reader = PdfReader('shalya paper.pdf') print(f'Total pages: {len(reader.pages)}') # Extract all unique images all_images = {} for i, page in enumerate(reader.pages): for img in page.images: key = img.name if key not in all_images: all_images[key] = (i, img.data) print('Unique images found:', list(all_images.keys())) for name, (pg, data) in all_images.items(): fpath = f'/home/daytona/workspace/shalya-ocr/{name}' with open(fpath, 'wb') as f: f.write(data) print(f'Saved {name} ({len(data)} bytes) from page {pg+1}') "
which pdftoppm && pdftoppm --version 2>&1 | head -2
cd /home/daytona/workspace/attachments/7cd11e69-986a-4b28-95a0-ffeb92b21965/ && pdftoppm -r 200 -png "shalya paper.pdf" /home/daytona/workspace/shalya-ocr/page && ls /home/daytona/workspace/shalya-ocr/ | head -5
cd /home/daytona/workspace/shalya-ocr && for f in page-*.png; do tesseract "$f" "${f%.png}_ocr" -l eng 2>/dev/null; done && echo "OCR done" && ls *.txt | wc -l
cd /home/daytona/workspace/shalya-ocr && cat page-01_ocr.txt && echo "===" && cat page-02_ocr.txt && echo "===" && cat page-03_ocr.txt
cd /home/daytona/workspace/shalya-ocr && cat page-*_ocr.txt > /home/daytona/workspace/shalya-ocr/all_text.txt && wc -l /home/daytona/workspace/shalya-ocr/all_text.txt
python3 << 'EOF' import re from collections import defaultdict, Counter with open('/home/daytona/workspace/shalya-ocr/all_text.txt', 'r') as f: full_text = f.read() # Split into papers by detecting exam headers papers = re.split(r'GUJARAT AYURVED UNIVERSITY', full_text) print(f"Number of paper sections found: {len(papers)-1}") # Print header of each section to understand years for i, p in enumerate(papers[1:], 1): lines = p.strip().split('\n') header = ' '.join(lines[:5]) print(f"\n=== Section {i} ===") print(header[:200]) EOF
python3 << 'PYEOF' import re from collections import defaultdict, Counter with open('/home/daytona/workspace/shalya-ocr/all_text.txt', 'r') as f: full_text = f.read() # Extract all questions - look for lines starting with (A), (B), (C), (D), (E), (F) # Also numbered questions 1-8 all_questions = [] # Split by paper papers = re.split(r'GUJARAT AYURVED UNIVERSITY', full_text) for paper in papers[1:]: lines = paper.strip().split('\n') for line in lines: line = line.strip() # Match question lines (A) (B) (C) (D) (E) (F) patterns if re.match(r'^\([A-F]\)', line) or re.match(r'^\([A-F]\)\s', line): # Clean up the line q = re.sub(r'^\([A-F]\)\s*', '', line).strip() q = re.sub(r'\s+', ' ', q) if len(q) > 15: # filter out very short/noise lines all_questions.append(q) print(f"Total question entries extracted: {len(all_questions)}") print("\nSample questions:") for q in all_questions[:20]: print(f" - {q}") PYEOF
python3 << 'PYEOF' import re from collections import defaultdict, Counter with open('/home/daytona/workspace/shalya-ocr/all_text.txt', 'r') as f: full_text = f.read() # Also get SECTION main questions (Q1, Q5) papers_raw = re.split(r'GUJARAT AYURVED UNIVERSITY', full_text) # Collect all lines with questions - broader approach # Look for lines starting with (A), (B), (C), (D), (E), (F) as sub-questions # Also look for numbered questions like "1. Describe..." # and "5. Write..." all_q_lines = [] for paper_idx, paper in enumerate(papers_raw[1:], 1): lines = paper.strip().split('\n') i = 0 while i < len(lines): line = lines[i].strip() # Sub-question lines if re.match(r'^\([A-F]\)', line): q = re.sub(r'^\([A-F]\)\s*', '', line).strip() # sometimes question continues on next line if i+1 < len(lines) and not re.match(r'^\([A-F]\)', lines[i+1].strip()) and not re.match(r'^\d+\.', lines[i+1].strip()): next_line = lines[i+1].strip() if len(next_line) > 5 and not next_line.startswith('CE') and not next_line.startswith('CG'): q = q + ' ' + next_line if len(q) > 10: all_q_lines.append(('sub', q.strip(), paper_idx)) # Main numbered questions elif re.match(r'^[1-8]\.\s+[A-Z]', line) or re.match(r'^[1-8]\.\s+[Ww]rite', line) or re.match(r'^[1-8]\.\s+[Dd]escribe', line) or re.match(r'^[1-8]\.\s+[Ee]xplain', line): q = re.sub(r'^\d+\.\s*', '', line).strip() if len(q) > 10: all_q_lines.append(('main', q.strip(), paper_idx)) i += 1 print(f"Main questions: {sum(1 for t,_,_ in all_q_lines if t=='main')}") print(f"Sub questions: {sum(1 for t,_,_ in all_q_lines if t=='sub')}") print(f"Total: {len(all_q_lines)}") # Now normalize and count frequencies def normalize_q(q): q = q.lower() q = re.sub(r'[^\w\s]', ' ', q) q = re.sub(r'\s+', ' ', q).strip() return q # Build keyword-based topic clusters topics = { # Shalya Tantra I topics "Ksharakarma / Kshar Sutra": ["ksharakarma", "kshara karma", "ksharsutra", "kshara sutra", "kshar sutra"], "Bandha vidhi / Bandages": ["bandha", "bandage", "pattabandha", "pattbandhana", "bandhana"], "Pranashta Shalya": ["pranashta shalya", "pranashta"], "Agnikarma": ["agnikarma", "agni karma"], "Shastrakarma / Shastra types": ["shastrakarma", "shastra karma", "ashtavidha shastra", "asthavidha shastra", "ashta vidha shastra", "eight shastra"], "Trividha Karma": ["trividha karma", "trividhkarma", "trividh karma"], "Anaesthesia (General/Regional/Nerve block)": ["anaesthesia", "anesthesia", "nerve block", "pudendal", "spinal anaesthesia", "general anaesthesia", "regional anaesthesia"], "Marma / Marmaghata": ["marma", "marmaghata"], "Sterilization / Nirjivanukarana": ["sterilization", "nirjivanukarana", "nirjivanu"], "X-Ray / Radiology in Surgery": ["x-ray", "x ray", "xray", "radiology", "radiograph"], "Rakta / Haemorrhage": ["rakta", "haemorrhage", "hemorrhage", "rakta mahatva", "rakta stambhak"], "Yantra / Surgical instruments": ["yantra", "probe", "trocar", "canula", "nadiyantra", "instrument"], "Shatkriyakala": ["shatkriyakala", "shatvidha kriyakala", "shadkriyakala", "shat kriya"], "Parenteral nutrition / Metabolic Acidosis": ["parenteral nutrition", "metabolic acidosis"], "Antibiotics in surgery": ["antibiotic"], "Inflammation": ["inflammation", "shotha"], # Vrana / Wound topics "Vrana / Wound management": ["vrana", "wound", "vranashopha", "vranaropana", "vrana vastu", "vranitagara"], "Nadivrana (Sinus / Fistula)": ["nadivrana", "nadi vrana", "sinus", "fistula in ano"], "Vidradhi (Abscess)": ["vidradhi", "abscess", "asthi vidradhi", "osteomyelitis"], # Paper II - Surgery topics "Bhagandara (Fistula in Ano)": ["bhagandara", "fistula in ano"], "Arsha (Haemorrhoids/Piles)": ["arsha", "haemorrhoid", "hemorrhoid", "piles", "parikartika", "fissure in ano"], "Aantravriddhi / Hernia": ["aantravriddhi", "hernia", "inguinal hernia", "hiatus hernia"], "Arbuda (Tumour/Cancer)": ["arbuda", "tumour", "tumor", "cancer", "neoplasm", "cyst", "ganglion"], "Galganda (Goitre/Thyroid)": ["galganda", "galgand", "goitre", "goiter", "thyroid", "toxic goitre"], "Peptic Ulcer / Intestinal Perforation": ["peptic ulcer", "chhidrodara", "intestinal perforation", "peptic"], "Appendicitis": ["appendicitis", "appendix"], "Abdominal Injuries / Peritonitis": ["abdominal injur", "peritonitis", "abdominal trauma"], "Cholecystitis / Gallbladder": ["cholecystitis", "pittashaya", "gallbladder", "gallstone", "cholelithiasis"], "Hydronephrosis / BPH / Urinary": ["hydronephrosis", "bph", "benign prostatic", "hematuria", "haematuria", "urinary bladder", "niruddhaprakasha"], "Fractures (Colles/Bhagna)": ["fracture", "colles", "bhagna", "kanda bhagna"], "DVT / Varicose veins": ["dvt", "deep vein thrombosis", "varicose", "trendlenburg", "trendenburg"], "Shock (Hypovolemic etc.)": ["shock", "hypovolemic"], "Atherosclerosis / Peripheral Vascular": ["atherosclerosis", "raynaud", "peripheral vascular", "buerger"], "Splenic Injury": ["splenic", "spleen"], "Rectal Prolapse / Anal conditions": ["rectal prolapse", "parikartika", "sannirugdhaguda", "anal stricture", "parivartika", "paraphimosis"], "Kshudra Roga": ["kshudra roga", "kshrudra roga", "paronychia", "kunakha", "pashangardabha", "kadar"], "Liver Abscess": ["liver abscess", "amoebic liver", "hepatic abscess", "pyogenic abscess"], "Nija Vrana / Agantu Vrana": ["nija vrana", "agantu vrana"], "Haemangioma / Vascular tumours": ["haemangioma", "hemangioma"], } topic_counts = defaultdict(list) for qtype, q, paper_idx in all_q_lines: q_norm = normalize_q(q) for topic, keywords in topics.items(): for kw in keywords: if kw.lower() in q_norm: topic_counts[topic].append(q[:100]) break print("\n\n=== TOPIC FREQUENCY ANALYSIS ===") sorted_topics = sorted(topic_counts.items(), key=lambda x: len(x[1]), reverse=True) for topic, questions in sorted_topics: print(f"\n{topic}: {len(questions)} times") # Show unique question variants seen = set() for q in questions: k = q[:60] if k not in seen: seen.add(k) print(f" - {q[:100]}") PYEOF
python3 << 'PYEOF' # Extract specific most-repeated individual questions for the top categories import re from collections import Counter with open('/home/daytona/workspace/shalya-ocr/all_text.txt', 'r') as f: full_text = f.read() papers_raw = re.split(r'GUJARAT AYURVED UNIVERSITY', full_text) # Collect specific question counts for most repeated individual questions specific_q_patterns = { # Paper I "Vrana / Wound (Sadyovrana, Dagdha, Nadivrana, Vranashotha)": [ "sadyovrana", "dagdha vrana", "vranashotha", "wound healing", "vrana shotha", "burns" ], "Marma importance in surgery": ["importance of marma in surgery", "importance of marma", "surgical importance of marma"], "Pranashta Shalya (def + removal)": ["pranashta shalya"], "Anaesthesia (Spinal/General/Regional)": ["spinal anaesthesia", "regional anaesthesia", "general anaesthesia", "anaesthesia"], "Ksharakarma / Kshar Sutra": ["ksharakarma", "kshara sutra", "ksharsutra", "kshara karma"], "Agnikarma (types, indications)": ["agnikarma", "agni karma"], "Sterilization / Autoclave": ["sterilization", "autoclave", "nirjivanukarana", "nirjantukarana"], "Bandha / Bandages (types)": ["bandha", "bandage", "pattabandha", "pattabandhana"], "Rakta / Haemorrhage / Raktamokshana": ["raktamokshana", "haemorrhage", "hemorrhage", "rakta stambhak", "rakta mahatva"], "Trividha Karma": ["trividha karma", "trividhkarma"], "Ashtavidha Shastrakarma": ["ashtavidha shastra", "ashta vidha shastra", "asthavidha shastra"], "Shatkriyakala": ["shatkriyakala", "shatvidha kriyakala", "shat kriya"], "Yantra (types, Nadiyantra)": ["yantra", "nadiyantra"], # Paper II "Hernia (Inguinal/Femoral/Incisional)": ["hernia", "aantravriddhi"], "BPH / Hydronephrosis": ["bph", "benign prostatic", "hydronephrosis", "hematuria"], "Vidradhi / Abscess (Breast/Liver/Osteo)": ["vidradhi", "abscess", "osteomyelitis"], "Bhagandara / Fistula in Ano": ["bhagandara", "fistula in ano"], "Arsha / Haemorrhoids / Parikartika": ["arsha", "haemorrhoid", "parikartika", "fissure in ano"], "Galganda / Goitre / Thyroid": ["galganda", "galgand", "goitre", "goiter", "thyroid"], "Fractures (Bhagna/Colles/Femur)": ["bhagna", "fracture", "colles"], "Arbuda / Tumour / Cancer / Cyst": ["arbuda", "tumour", "tumor", "cyst", "ganglion"], "DVT / Varicose Veins": ["dvt", "varicose", "deep vein thrombosis"], "Cholecystitis / Gallstones": ["cholecystitis", "cholelithiasis", "pittashaya"], "Shock / Marmaghata": ["shock", "marmaghata"], "Peptic Ulcer / Chhidrodara": ["peptic ulcer", "chhidrodara", "intestinal perforation"], "Atherosclerosis / Raynaud / PVD": ["atherosclerosis", "raynaud", "buerger"], "Kshudra Roga (Chippa/Kunakha/Kadar)": ["chippa", "kunakha", "kadar", "paronychia", "pashangardabha"], "Appendicitis": ["appendicitis"], "Peritonitis / Abdominal injury": ["peritonitis", "abdominal injur"], } all_lines = full_text.lower() print("SPECIFIC QUESTION/TOPIC REPEAT COUNT:") print("="*60) for topic, keywords in specific_q_patterns.items(): count = 0 for kw in keywords: count += all_lines.count(kw) print(f"{topic}: ~{count} mentions") PYEOF
| Rank | Topic | Times Asked |
|---|---|---|
| 1 | Vrana / Wound (Sadyovrana, Dagdha Vrana, Vranashotha, Vrana types) | 54 times |
| 2 | Anaesthesia (Spinal, General, Regional, Nerve blocks) | 14+ times |
| 3 | Sterilization / Autoclave / Nirjantukarana | 14 times |
| 4 | Marma - importance in surgery | 18 times |
| 5 | Agnikarma (types, indications, Samyak dagdha) | 12 times |
| 6 | Pranashta Shalya (definition + Nirharana Upaya) | 12 times |
| 7 | Bandha Vidhi / Bandages (types, indications) | 12 times |
| 8 | Yantra (types, Nadiyantra, Shalaka) | 14 times |
| 9 | Raktamokshana / Rakta Mahatva / Haemorrhage | 11 times |
| 10 | Shastrakarma (Ashtavidha Shastra Karma + Yogya) | 11 times |
| 11 | Ksharakarma / Kshar Sutra (preparation, method) | 10 times |
| 12 | Trividha Karma | 7 times |
| 13 | Shatkriyakala | 6 times |
| Rank | Topic | Times Asked |
|---|---|---|
| 1 | Vrana / Nadivrana / Wound types | 54 combined |
| 2 | Arbuda / Tumour / Cyst / Granthi / Cancer | 45 times |
| 3 | Vidradhi (Breast Abscess, Liver Abscess, Osteomyelitis) | 32 times |
| 4 | Hernia (Inguinal, Femoral, Incisional, Hiatus) | 20 times |
| 5 | Arsha / Haemorrhoids / Parikartika (fissure in ano) | 17 times |
| 6 | BPH / Hydronephrosis / Hematuria | 18 times |
| 7 | DVT / Varicose Veins | 16 times |
| 8 | Fractures (Kanda Bhagna, Colles, Femur) | 11 times |
| 9 | Bhagandara / Fistula in Ano | 9 times |
| 10 | Cholecystitis / Cholelithiasis | 10 times |
| 11 | Shock / Marmaghata | 8 times |
| 12 | Peptic Ulcer / Chhidrodara | 11 times |
| 13 | Kshudra Roga (Chippa/Kunakha/Kadar/Paronychia) | 13 times |
| 14 | Atherosclerosis / Raynaud's / DVT / PVD | 10 times |
| 15 | Appendicitis | 7 times |
| 16 | Galganda / Goitre | 4 times |
| Priority | Topic | Why Important |
|---|---|---|
| ⭐⭐⭐ | Vrana chapter (all subtopics) | In EVERY exam, multiple questions |
| ⭐⭐⭐ | Spinal / General Anaesthesia | Long question almost every year |
| ⭐⭐⭐ | Sterilization + Autoclave | Short + long both asked regularly |
| ⭐⭐⭐ | Agnikarma (full detail) | Long question most exams |
| ⭐⭐⭐ | Pranashta Shalya | Definition + Nirharana = every paper |
| ⭐⭐ | Marma - surgical importance | Short note + long both |
| ⭐⭐ | Ksharakarma / Kshar Sutra | Preparation method asked repeatedly |
| ⭐⭐ | Yantra types + Nadiyantra | Short note every paper |
| ⭐⭐ | Bandha Vidhi / Bandages | Types + indications |
| ⭐⭐ | Raktamokshana / Jalaukavacharana | Procedure-based question |
| ⭐⭐ | Shastrakarma (Ashtavidha) | Types + Yogya for Shastrakarma |
| ⭐ | Trividha Karma | Short answer |
| ⭐ | Shatkriyakala | Applied in Nadivrana/Vidradhi |
| Priority | Topic | Why Important |
|---|---|---|
| ⭐⭐⭐ | Vidradhi (Breast/Liver/Osteo Abscess) | Most repeated overall |
| ⭐⭐⭐ | Arbuda + Granthi / Cyst | Ganglion, types of cyst - every exam |
| ⭐⭐⭐ | Hernia (Inguinal, Femoral, Incisional) | Full surgical management |
| ⭐⭐⭐ | BPH + Hydronephrosis | Long question most papers |
| ⭐⭐⭐ | Nadivrana + Bhagandara + Ksharasutra | Ayurvedic management focus |
| ⭐⭐ | Arsha / Haemorrhoids + Parikartika | Ksharapatana + modern Rx |
| ⭐⭐ | DVT + Varicose Veins | Every paper has 1 question |
| ⭐⭐ | Shock / Marmaghata | Classification + Hypovolemic |
| ⭐⭐ | Bhagna / Fractures | Kanda Bhagna, Femur, Colles |
| ⭐⭐ | Peptic Ulcer / Chhidrodara | Long question alternate years |
| ⭐⭐ | Cholecystitis / Cholelithiasis | Pittashaya shotha context |
| ⭐ | Kshudra Roga (Chippa, Kunakha, Kadar) | Short notes |
| ⭐ | Atherosclerosis / Raynaud's / Buerger's | Short note pattern |
| ⭐ | Appendicitis | Short note/long alternate years |
| ⭐ | Galganda / Goitre | Toxic/Simple goitre Rx |