How wenhuchen/time-sensitive-qa works
• BigBird – an extractive QA baseline (using a modified transformer model)
• Fusion-in-Decoder (FiD) – a generative QA baseline
Major Components
a. Dataset Layer:
• Top-level “dataset” directory that contains raw data files (annotated and synthesized training/dev/test JSON and YAML files).
• That the datasets are used both in training and evaluation, and some files are compressed (gzip) or annotated.
b. BigBird Module:
• “BigBird” directory containing its own configuration file (config.yaml), dataset subfolder with YAML files, and main.py which handles training/evaluation via command line arguments (with hydra/omegaconf).
c. FiD Module:
• “FiD” directory, which similarly contains its own configuration (config.yaml), dataset data, main.py for running training/evaluation, and model.py that likely encapsulates model instantiation for fusion-in-decoder.
d. Auxiliary/Supporting Components:
• “utils.py” file if it has helper functions.
• External notebook “Process.ipynb” that might be used for analysis or prototyping.
• External dependencies (e.g., the Open-Domain Retriever linked to DrQA, as mentioned in the README) and the specifications for different transformer libraries and PyTorch versions.
Relationships and Data Flow
a. Dataset Preparation:
b. Configuration and Initialization:
• Both QA modules read their own configuration (YAML/omegaconf-based) as well as command-line parameters (where hydra is used). Represent configuration as an input flowing into the QA modules.
c. Model Training and Evaluation:
• That each of these scripts accepts parameters like model checkpoint selection (from NQ or TriviaQA) and dataset selection (“hard”, “easy”, human_ versions).
d. External Dependencies:
• External libraries (Transformers, PyTorch, hydra, omegaconf) as part of the underlying infrastructure supporting both modules.
Architectural Patterns
• Separation of Concerns: The design clearly separates data management (dataset folder) from model-specific implementations (BigBird and FiD directories).
• Modularity: Each model baseline is self-contained with independent configuration and dataset subdirectories.
• Dependency Injection: Use of hydra and omegaconf indicates that configurations are injected at runtime which makes the system flexible.
• Environment Isolation: Notice that separate Conda environments are expected for BigBird and FiD, which can be highlighted by drawing distinct environment boundaries around these components.