How intelligence-csd-auth-gr/instance-based-zsl works
Project Type and Purpose
• This is a research‐oriented data‐processing and machine‐learning pipeline implementing an online instance‐based zero‐shot learning (IBZSL) algorithm for semi‐automatic MeSH indexing. It is not a web service or full‐stack app, but an open‐source tool/pipeline that (a) ingests biomedical abstracts, (b) computes embeddings and similarity scores, (c) runs several baseline and proposed zero‐shot methods, (d) integrates external MTI predictions, and (e) evaluates performance.
High‐Level Architectural Components
1. Data Storage & Inputs
• Source data (raw MeSH abstracts, frequency CSV, test set archive)
• Pre‐computed caches (embeddings, similarity dictionaries, known‐labels, novel‐labels)
• Artificial and supervised predictions folders
• MTI tool output
2. Pre‐processing Pipeline
• obtain_text_embeddings.py → bioBERT embedding service
• calculate_similarities.py → pairwise cosine computations
• compute_label_similarities_per_pair.py → global label‐to‐label similarity maps
• add_noisy_labels.py → noise injection for imperfect oracle
3. Baselines & External Integrations
• On‐the‐fly NN baseline
• NN_baseline_preprocess.py → distance/similarity per instance
• NN_summary.py → aggregation
• NN_bioBERT_evaluate.py → metrics & plots
• MTI integration
• mti_output_manipulation.py → parse MTI raw output
• mti_predictions.pickle → external supervised predictions
4. IBZSL Core Algorithm
• record_label_similaritiy_scores.py → builds per‐instance DataFrame of novel vs. existing label similarities under different oracle assumptions
• compute_weights_per_instance.py → applies weight equation (max similarity)
• weighted_unweighted_approaches.py → rank‐score computation (Eq.3)
• occurence.py + apply_occurence.py → fine‐grained occurrence‐based filtering and final decision assembly
• IBZSL_evaluate.py → computes Coverage and 1‐Error metrics, histograms and statistics
5. Results & Reporting
• Results folder containing pickled final decisions under ideal, imperfect, realistic oracles, and hybrid modes
• Graph outputs, logs (app.log), and performance tables
Inter‐Module Relationships and Data Flow
• Raw Source Data → Pre‐processing → Embeddings / Similarities →
• Feeds both Baselines and IBZSL Core →
• MTI predictions are ingested into IBZSL Core as an external “realistic oracle” branch →
• All branches funnel into respective evaluation scripts →
• Final results stored in Results/ and visualized.
Architectural Patterns & Design Principles
• Pipeline/Batch Processing: clearly separate stages (embeddings, similarity, ranking, evaluation).
• Modular layering: Data layer, Pre‐processing layer, Algorithmic layer, Evaluation layer.
• Reusability: pre‐computations and pickles act as memoization.
• Extensibility: each stage is a standalone script that can be swapped or extended (e.g., replace bioBERT with another embedder).
Essential Details to Capture
• The two major external dependencies: bioBERT embedding service and MTI tool.
• The three oracle modes (ideal, imperfect with noise, realistic using MTI) branching from the core.
• Pre‐computed caches as a “shortcut” layer.
• The sequential nature of the IBZSL algorithm: similarity recording → weight computation → ranking → occurrence filtering → evaluation.