MCPcopy Create free account

hub / github.com/ChaokunHong/MetaScreener / functions

Functions1,057 in github.com/ChaokunHong/MetaScreener

↓ 4 callersMethodlist_all
Return all loaded templates. Returns: List of all available templates.
src/metascreener/criteria/templates.py:66
↓ 4 callersMethodload_from_string
Parse a YAML string into ReviewCriteria. Useful when the user provides YAML criteria directly as input text. If the YAML contains a `
src/metascreener/criteria/schema.py:82
↓ 4 callersFunctionplot_threshold_analysis
Plot sensitivity and specificity across decision thresholds. Args: scores: Predicted inclusion scores for each record. labels: Gr
src/metascreener/evaluation/visualizer.py:271
↓ 4 callersMethodscreen
Screen a single record against PICO criteria. Args: record: The literature record to evaluate. criteria: Structured P
src/metascreener/llm/base.py:270
↓ 4 callersFunctionsetup_backends
Create real OpenRouter LLM backends from config. Reads model definitions from ``configs/models.yaml`` and creates one OpenRouterAdapter per m
validation/common.py:182
↓ 4 callersMethodtruncate
Truncate text to a maximum character count at a word boundary. If the text is within the limit, it is returned unchanged. Otherwise,
src/metascreener/criteria/preprocessor.py:77
↓ 4 callersMethodvalidate_quality
Assess criteria quality via LLM (Layer 2). Sends the full criteria JSON to the LLM backend using the ``validate_quality_v1`` prompt t
src/metascreener/criteria/validator.py:137
↓ 3 callersMethod__init__
(self, message: str, model_id: str | None = None)
src/metascreener/core/exceptions.py:16
↓ 3 callersMethod_call_api
Call the underlying LLM API and return the raw text response. Args: prompt: The complete prompt to send. seed: Random
src/metascreener/llm/base.py:187
↓ 3 callersFunction_fmt
Format a metric dict as a Lancet-style string. Args: m: Dict with "point", "ci_lower", "ci_upper" keys. Returns: Lancet-form
validation/analysis/generate_tables.py:79
↓ 3 callersFunction_fmt
(value: float)
src/metascreener/evaluation/metrics.py:304
↓ 3 callersFunction_make_quality_adapter
Create a mock quality assessment adapter.
tests/integration/test_criteria_workflow.py:98
↓ 3 callersFunction_make_quality_adapter
Create a mock adapter that returns quality scores.
tests/unit/test_criteria_wizard.py:53
↓ 3 callersMethodbuild
Assemble a complete screening prompt. Args: record: The literature record to screen. criteria: The review criteria to
src/metascreener/module1_screening/layer1/prompts/base.py:36
↓ 3 callersFunctionbuild_article_section
Build the article section of a screening prompt. Args: record: The literature record to format. Returns: A formatted string
src/metascreener/module1_screening/layer1/prompts/ta_common.py:26
↓ 3 callersMethodbuild_audit_entry
Build a TRIPOD-LLM compliant audit trail entry. Args: record: The screened record. criteria: Review criteria used.
src/metascreener/module1_screening/ta_screener.py:144
↓ 3 callersFunctioncount_element_matches
Count match/mismatch votes for a specific element across models. Inspects ``model_output.pico_assessment[element_key].match`` for each output
src/metascreener/module1_screening/layer2/rules/helpers.py:7
↓ 3 callersMethodfit
Fit the isotonic calibrator on validation scores. Args: scores: Raw model scores in [0, 1]. labels: Binary labels (0
src/metascreener/module1_screening/layer3/calibration.py:121
↓ 3 callersFunctiongenerate_all_figures
Generate all paper figures and save to the output directory. Creates Figure 4 (forest plot) and Figure 5 (ablation chart). Figures 2 and 3 ar
validation/analysis/generate_figures.py:341
↓ 3 callersFunctiongenerate_table1_models
Generate Table 1: Model Registry. Lists all LLM models from the configuration file with their versions, providers, and licenses. Args:
validation/analysis/generate_tables.py:91
↓ 3 callersFunctiongenerate_table3_asreview
Generate Table 3: ASReview Benchmark Results. Args: results_dir: Path to the directory containing experiment results. Returns:
validation/analysis/generate_tables.py:214
↓ 3 callersFunctiongenerate_table4_ablation
Generate Table 4: Ablation Study. Compares different HCN configurations (single model, ensemble without rules, full HCN) to quantify componen
validation/analysis/generate_tables.py:242
↓ 3 callersFunctiongenerate_table5_cost
Generate Table 5: Cost and Time Analysis. Summarises per-record processing time and API cost estimates. Args: results_dir: Path to t
validation/analysis/generate_tables.py:295
↓ 3 callersMethodget_thresholds
Return current thresholds. Returns: Thresholds dataclass with tau_high, tau_mid, tau_low.
src/metascreener/module1_screening/layer4/threshold_optimizer.py:47
↓ 3 callersFunctionplot_confusion_matrix
Plot an annotated 2x2 confusion matrix heatmap. Only considers INCLUDE and EXCLUDE decisions; HUMAN_REVIEW entries are mapped to INCLUDE for
src/metascreener/evaluation/visualizer.py:343
↓ 3 callersFunctionplot_rob_heatmap
Plot a Risk of Bias assessment heatmap. Rows represent studies (by record_id) and columns represent RoB domains. Each cell is color-coded by
src/metascreener/evaluation/visualizer.py:411
↓ 3 callersMethodrun
Run all backends in parallel for a single record. Args: record: The literature record to screen. criteria: PICO inclu
src/metascreener/llm/parallel_runner.py:45
↓ 3 callersMethodrun_calibration
Fit calibrators per model using Phase 3 implementations. Args: decisions: List of ScreeningDecision objects. gold_lab
src/metascreener/evaluation/calibrator.py:159
↓ 3 callersFunctionsave_figure
Save a Plotly figure to disk. Attempts to export as a static image (PNG) via kaleido. If kaleido is not installed, falls back to an interacti
validation/analysis/generate_figures.py:302
↓ 3 callersMethodvalidate
Run full validation: rules (Layer 1) + optional LLM quality (Layer 2). Args: criteria: The criteria to validate. back
src/metascreener/criteria/validator.py:203
↓ 2 callersFunction_base_layout
Merge base layout with caller-supplied overrides. Args: **kwargs: Layout property overrides. Returns: Merged layout dict.
validation/analysis/generate_figures.py:47
↓ 2 callersMethod_generate
Run generation across all backends and merge results. Args: prompt: The prompt to send to each backend. framework: SR
src/metascreener/criteria/generator.py:100
↓ 2 callersFunction_generate_benchmark_table
Generate a benchmark results table (shared logic for Table 2 and 3). Args: data: Parsed experiment results dict. table_num: Table
validation/analysis/generate_tables.py:123
↓ 2 callersFunction_hard_violation_rules
RuleCheckResult with a hard violation.
tests/unit/test_layer4_router.py:38
↓ 2 callersFunction_load_results
Load experiment results JSON from the results directory. Args: results_dir: Path to the directory containing result JSON files. e
validation/analysis/generate_figures.py:61
↓ 2 callersFunction_make_alt_adapter
Create an alternative generation adapter for consensus testing.
tests/integration/test_criteria_workflow.py:50
↓ 2 callersFunction_map_fields
Map raw keys to canonical field names using a mapping table. First match wins -- earlier keys in field_map have priority. Args: raw:
src/metascreener/io/parsers.py:118
↓ 2 callersMethod_merge_list_field
Merge a list field (e.g., study_design_include) as union. Args: model_outputs: All model output dicts. field: Field n
src/metascreener/criteria/consensus.py:129
↓ 2 callersFunction_record_to_flat_dict
Convert a Record to a flat dict suitable for CSV/Excel. Args: record: Record object. Returns: Flat dict with string values.
src/metascreener/io/writers.py:89
↓ 2 callersMethod_required_elements
Derive required_elements from the framework definition. Returns the intersection of framework-required keys and actually present elem
src/metascreener/criteria/consensus.py:187
↓ 2 callersMethod_run_pipeline
Execute the full assessment pipeline. Args: text: Full paper text. tool_schema: The RoB tool schema to use.
src/metascreener/module3_quality/assessor.py:99
↓ 2 callersMethod_save_session
Persist session state for potential resume. Reuses the same ``session_id`` across the pipeline run so that later saves overwrite earl
src/metascreener/criteria/wizard.py:197
↓ 2 callersFunction_to_binary
Map decision to binary (1 = INCLUDE, 0 = EXCLUDE).
src/metascreener/evaluation/visualizer.py:360
↓ 2 callersFunctionbuild_instructions_section
Build the screening instructions section. Instructions are recall-biased: when in doubt, INCLUDE the article to minimize false negatives (mis
src/metascreener/module1_screening/layer1/prompts/ta_common.py:43
↓ 2 callersFunctionbuild_output_spec
Build the expected output JSON template. Requests ``element_assessment`` (generic key) rather than ``pico_assessment`` so prompts are framewo
src/metascreener/module1_screening/layer1/prompts/ta_common.py:66
↓ 2 callersFunctionbuild_system_message
Build the system-level role description for screening prompts. Returns: A string describing the LLM's role as a systematic review screene
src/metascreener/module1_screening/layer1/prompts/ta_common.py:12
↓ 2 callersFunctioncompute_cohen_kappa
Compute Cohen's kappa inter-rater agreement coefficient. Args: ratings_a: Ratings from rater A. ratings_b: Ratings from rater B.
src/metascreener/evaluation/metrics.py:209
↓ 2 callersMethoddelete
Delete a session file. Args: session_id: The session to remove.
src/metascreener/criteria/session.py:88
↓ 2 callersMethodfind_by_tags
Find templates matching any of the given tags. Args: tags: List of tags to search for. Returns: Templates ma
src/metascreener/criteria/templates.py:88
↓ 2 callersMethodfit
Fit model weights from labeled validation data. Uses SLSQP to minimize binary cross-entropy between weighted scores and true labels,
src/metascreener/module1_screening/layer3/weight_optimizer.py:54
↓ 2 callersFunctiongenerate_all_tables
Generate all 5 paper tables and write to a single markdown file. Args: results_dir: Path to the directory containing experiment result
validation/analysis/generate_tables.py:341
↓ 2 callersMethodget_by_id
Find a template by its ID. Args: template_id: The template identifier. Returns: Template if found, None othe
src/metascreener/criteria/templates.py:74
↓ 2 callersFunctionmain
Render the criteria wizard page.
src/metascreener/app/pages/00_criteria.py:9
↓ 2 callersFunctionmetric_fn
(data: tuple[Any, ...])
validation/common.py:295
↓ 2 callersMethodoptimize_thresholds
Optimize tau thresholds via Phase 3 ThresholdOptimizer. Args: decisions: List of ScreeningDecision objects. gold_labe
src/metascreener/evaluation/calibrator.py:121
↓ 2 callersMethodparse_text
Parse free-text criteria into structured form (Mode A). Args: criteria_text: User-provided criteria text. framework:
src/metascreener/criteria/generator.py:75
↓ 2 callersFunctionplot_tier_distribution
Plot a bar chart of screening decisions per routing tier. Args: decisions: List of screening decisions with tier assignments. Return
src/metascreener/evaluation/visualizer.py:506
↓ 2 callersFunctionrun_all_topics
Run the Cohen benchmark across all available topics. Iterates over all Cohen topics with available CSV files, runs screening for each, comput
validation/experiments/exp2_cohen_benchmark.py:194
↓ 1 callersMethod_assess_all_chunks
Assess all chunks x all models in parallel. Returns: model_id -> list of per-chunk parsed dicts.
src/metascreener/module3_quality/assessor.py:170
↓ 1 callersMethod_assess_single
Run a single assessment call with error handling. Returns: Parsed assessment dict, or empty dict on failure.
src/metascreener/module3_quality/assessor.py:204
↓ 1 callersFunction_build_domains
Construct all five RoB 2 domains with their signaling questions. Returns: List of five ``DomainSchema`` instances ordered D1-D5.
src/metascreener/module3_quality/tools/rob2.py:36
↓ 1 callersFunction_build_domains
Construct all four QUADAS-2 domains with their signaling questions. Returns: List of four ``DomainSchema`` instances ordered D1-D4.
src/metascreener/module3_quality/tools/quadas2.py:44
↓ 1 callersFunction_build_domains
Construct all seven ROBINS-I domains with their signaling questions. Returns: List of seven ``DomainSchema`` instances ordered D1-D7.
src/metascreener/module3_quality/tools/robins_i.py:50
↓ 1 callersMethod_build_prompt
Build a framework-detection prompt. Tries to import a versioned prompt template first; if unavailable falls back to an inline minimal
src/metascreener/criteria/framework_detector.py:169
↓ 1 callersFunction_build_wizard_prompt
Build the form generation prompt. Args: topic: Research topic description. Returns: Complete prompt string.
src/metascreener/module2_extraction/form_wizard.py:53
↓ 1 callersMethod_call_api
Call OpenRouter API with retry logic. Args: prompt: The complete prompt string. seed: Reproducibility seed (passed to
src/metascreener/llm/adapters/openrouter.py:66
↓ 1 callersMethod_call_backend
Call a single backend and parse its JSON response. Args: backend: LLM backend to call. prompt: The prompt string.
src/metascreener/criteria/generator.py:153
↓ 1 callersFunction_check_type
Check if a value matches the expected extraction field type. Args: value: The extracted value. expected_type: The declared field
src/metascreener/module2_extraction/validator.py:137
↓ 1 callersFunction_chunk_by_chars
Fallback: split text by character count with overlap. Args: text: Text without paragraph boundaries. max_chars: Maximum character
src/metascreener/module2_extraction/pdf_chunker.py:111
↓ 1 callersFunction_chunk_by_paragraphs
Split paragraphs into chunks respecting size limits. Args: paragraphs: List of paragraph strings. max_chars: Maximum characters p
src/metascreener/module2_extraction/pdf_chunker.py:61
↓ 1 callersMethod_compute_bootstrap_cis
Compute bootstrap CIs for sensitivity, specificity, precision, f1. Args: decisions: Predicted screening decisions. la
src/metascreener/evaluation/calibrator.py:213
↓ 1 callersMethod_compute_consensus
Compute majority-vote consensus per domain across models. Returns: List of RoBDomainResult with consensus judgements.
src/metascreener/module3_quality/assessor.py:313
↓ 1 callersMethod_compute_consensus
Compute majority-vote consensus across models. Args: per_model_merged: model_id -> merged extraction dict. form: Extr
src/metascreener/module2_extraction/extractor.py:265
↓ 1 callersMethod_compute_ensemble_confidence
Compute ensemble confidence from decision agreement. Uses normalized Shannon entropy: C_ensemble = 1 - H(p_include, p_exclude) /
src/metascreener/module1_screening/layer3/aggregator.py:124
↓ 1 callersFunction_detect_format
Detect write format from file extension. Args: path: Output file path. Returns: Format string. Raises: Unsuppor
src/metascreener/io/writers.py:70
↓ 1 callersFunction_estimate_cost
Estimate USD cost for a single model call. Looks up the model in the pricing table. If the model ID is not found, falls back to the most expe
validation/experiments/exp7_cost_time.py:76
↓ 1 callersFunction_estimate_input_tokens
Estimate the number of input tokens for a single model call. Uses the rough heuristic of 1 token per 4 characters, with a minimum of 100 toke
validation/experiments/exp7_cost_time.py:59
↓ 1 callersFunction_estimate_tokens
Estimate token count from character length. Args: text: Input text. Returns: Estimated token count.
src/metascreener/module2_extraction/pdf_chunker.py:12
↓ 1 callersFunction_export_audit
Export full audit trail as JSON. Args: data: List of result dictionaries. output_dir: Output directory.
src/metascreener/cli/export_cmd.py:116
↓ 1 callersFunction_export_csv
Export results as CSV using pandas. Args: data: List of result dictionaries. output_dir: Output directory.
src/metascreener/cli/export_cmd.py:69
↓ 1 callersFunction_export_excel
Export results as Excel spreadsheet. Args: data: List of result dictionaries. output_dir: Output directory.
src/metascreener/cli/export_cmd.py:98
↓ 1 callersFunction_export_json
Export results as pretty-printed JSON. Args: data: List of result dictionaries. output_dir: Output directory.
src/metascreener/cli/export_cmd.py:85
↓ 1 callersFunction_export_ris
Export results as RIS format. Args: data: List of result dictionaries. output_dir: Output directory.
src/metascreener/cli/export_cmd.py:136
↓ 1 callersMethod_extract_all_chunks
Extract from all chunks x all models in parallel. Args: chunks: Text chunks. form: Extraction form. seed:
src/metascreener/module2_extraction/extractor.py:126
↓ 1 callersMethod_extract_single
Run a single extraction call with error handling. Args: backend: LLM backend to call. prompt: Complete extraction pro
src/metascreener/module2_extraction/extractor.py:166
↓ 1 callersFunction_find_id_column
Find a suitable record ID column in a list of column names. Looks for ``record_id`` first, then any column containing ``id``. Falls back to t
validation/experiments/exp3_asreview_benchmark.py:64
↓ 1 callersFunction_find_label_column
Find the first recognized label column in a list of column names. Args: columns: Lowercase column names from a DataFrame. Returns:
validation/experiments/exp3_asreview_benchmark.py:49
↓ 1 callersMethod_find_majority
Find the majority value (> n/2 models agree). Args: values: Non-null values from models. n_models: Total number of mo
src/metascreener/module2_extraction/extractor.py:316
↓ 1 callersMethod_get_calibration_factor
Get calibration factor φ_i (1.0 if no calibrator).
src/metascreener/module1_screening/layer3/aggregator.py:112
↓ 1 callersMethod_get_weight
Get weight for a model (equal if no weights set).
src/metascreener/module1_screening/layer3/aggregator.py:106
↓ 1 callersMethod_guided_refinement
Walk through each element for user review and modification. Args: criteria: The criteria to refine in-place. ask_user
src/metascreener/criteria/wizard.py:283
↓ 1 callersFunction_load_ablation_csv
Load a single CSV file and build Record objects with gold labels. Args: data_path: Path to the CSV file with columns record_id, title,
validation/experiments/exp4_ablation_study.py:59
↓ 1 callersMethod_load_builtin
Load all YAML templates from the builtin_templates directory.
src/metascreener/criteria/templates.py:27
↓ 1 callersFunction_load_config
Load MetaScreener config from file or defaults. Args: config_path: Optional path to config file. Returns: MetaScreenerConfig
src/metascreener/cli/screen_cmd.py:54
↓ 1 callersFunction_load_cost_csv
Load a CSV file and build Record objects. Args: data_path: Path to the CSV file with columns record_id, title, abstract (and
validation/experiments/exp7_cost_time.py:105
↓ 1 callersFunction_load_dataset_csv
Load a single ASReview Synergy dataset CSV and build Record objects. Column names are normalized to lowercase. The function detects the label
validation/experiments/exp3_asreview_benchmark.py:84
↓ 1 callersFunction_load_gold_labels
Load gold standard labels from CSV file. Expected columns: record_id, label (INCLUDE/EXCLUDE). Args: path: Path to the CSV file.
src/metascreener/cli/evaluate_cmd.py:27
↓ 1 callersFunction_load_predictions
Load predictions from JSON file. Expected format: list of objects with record_id, decision, final_score, tier, ensemble_confidence. Args
src/metascreener/cli/evaluate_cmd.py:61
↓ 1 callersFunction_load_topic_csv
Load a single Cohen topic CSV and build Record objects. Args: topic_name: Name of the Cohen topic (e.g., "ACEInhibitors"). data_d
validation/experiments/exp2_cohen_benchmark.py:46
↓ 1 callersFunction_make_metric_fn
Create a bootstrap-compatible function for a given metric attribute. Args: attr: Name of the ScreeningMetrics attribute to extrac
validation/common.py:282
← previousnext →101–200 of 1,057, ranked by callers