Skip to content

Repository files navigation

Open-Domain Question Answering

프로젝트 소개

  • 프로젝트 전체 기간 (2주) : 12월 1일 (월) 10:00 ~ 12월 11일 (목) 19:00

  • 프로젝트 목적: 방대한 Wikipidia 문서를 기반으로 Question에 대한 Answer span을 예측하는 Open-Domain Question Answering (ODQA) 모델을 구현하는 것

  • 기본 파이프라인

    image (3)

팀원 소개

팀원 역할/태스크 주제 상세 수행 태스크 및 관련 기술
강민우 Retriever 탐색 및 적용, 기초 모델 탐색 BM25, ElasticSearch, T5 Encoder/DeBERTa, Validation 1-epoch Training
김차미 데이터 탐색 및 방법론 적용, 모델 사전 학습 외부 데이터셋 탐색, EDA, monoQA, TaPT (Task-adaptive Pre-training), 모듈화 Refactoring, Notion 관리
박서연 Reader 모델 실험 및 학습 기법 적용 Reader 모델 비교 실험, CNN Layer, Curriculum Learning
방재연 (팀장) Retriever 탐색 및 적용, 최신 모델 학습 및 코드 구조 리팩토링 Qwen LoRA 학습, 모듈화 Refactoring, Dataclass Refactoring 시도, 앙상블, Dense (Retriever), Faiss
이호준 Retriever 탐색 및 적용, Reranking 기법 적용 Retriever Eval, Rerank, LLM as Judge, Inference 코드 작성
조민서 데이터 증강 및 방법론 적용, 하이퍼파라미터 튜닝 외부 데이터셋 EDA, 데이터 증강 및 Negative Sampling 학습, Hyperparameter Tuning, Github Convention

프로젝트 진행 일정

기간 주요 목표 활동 내용
12/1(월) – 12/3(수) 프로젝트 탐색 및 Baseline 분석 - 협업 환경 설정 (e.g. Github, Notion)
- 제공된 Baseline 코드 이해
- Baseline 코드 리팩토링 진행
12/1(월) – 12/4(목) EDA 및 외부 데이터셋 탐색 - 대회 데이터셋 파악 및 분석
- 외부 데이터셋 탐색
12/4(목) – 12/7(일) Reader 모델 탐색 및 성능 비교 - Extractive Reader 모델 성능 비교
- Generative Model 학습 구현
12/4(목) – 12/8(월) Retriever 모델 탐색 및 성능 비교 - Sparse/Dense Retriever 구현
- 각 Retriever 모델 성능 측정
- Reranker 구현 및 성능 측정
12/7(일) – 12/10(수) 파이프라인 성능 개선 - Negative Sampling 구현
- Curriculum Learning 구현
- Hyperparameter Tuning 진행
12/11(목) Ensemble 진행 및 최종 제출 - K-fold Validation 수행
- 최종 모델로 Hard Voting 수행

프로젝트 결과

image (4)

제출 1️⃣: 두 Extractor 모델을 사용하고, Qwen Generative 모델에 캐스팅 보트를 주는 앙상블 방식

Qwen (0.130) + H K-fold (0.435) + R Curric. (0.435)

  • Public | EM = 72.92%, F1 = 84.88%
  • Private | EM = 74.17%, F1 = 84.50%

제출 2️⃣: Extractor 모델의 조합으로 이루어진 앙상블

H K-fold (0.35) + H Base (0.15) + R Neg (0.15) + R Curric. (0.35)

  • Public | EM = 73.33%, F1 = 84.74%
  • Private | EM = 72.78%, F1 = 83.78%

Wrap-up Report

Wrap-up Report 바로가기


실행 방법

라이브러리 설치

# git repository clone
git clone https://github.com/boostcampaitech8/pro-nlp-mrc-nlp-02.git

# 가상환경 + 의존성 설치
uv venv --python 3.11
source .venv/bin/activate
# 의존성 설치 (pyproject.toml + uv.lock 사용)
uv sync
# 의존성 설치 (Optional Dependency 전부 설치)
uv sync --all-extras

모델 학습

Reader 모델 학습 및 evaluation 진행

# src/config/train.json 내의 학습 인자 설정 후
# shell script 실행
bash scripts/train.sh

Inference

학습된 모델을 사용하여 Test 데이터에 대한 예측 파일(predictions.json)을 생성

# src/config/inference.json 내의 학습 인자 설정 후
# shell script 실행
bash scripts/inference.sh

프로젝트 구조

├── run_curriculum.sh
├── scripts
│   ├── add_experiment.py
│   ├── data_augment.sh
│   ├── experiment_logs
│   ├── experiment_manager.py
│   ├── experiment_queue.json
│   ├── finetuning.sh
│   ├── inference.sh
│   ├── list_experiments.py
│   ├── remove_experiment.py
│   ├── retrieval_eval_multi_index.py
│   ├── retrieval_eval.sh
│   ├── run_sweep.sh
│   └── train.sh
├── src
│   ├── __init__.py
│   ├── config
│   │   ├── arguments.py
│   │   ├── augmentation.json
│   │   ├── elasticsearch.json
│   │   ├── eval.json
│   │   ├── finetuning.json
│   │   ├── inference_monoqa.json
│   │   ├── inference.json
│   │   ├── retrieval_eval.json
│   │   ├── sweep
│   │   │   └── reader.yaml
│   │   ├── train_monoqa.json
│   │   ├── train_qwen.json
│   │   ├── train_tapt_mlm.json
│   │   └── train.json
│   ├── data
│   │   ├── __init__.py
│   │   ├── augmentation
│   │   │   ├── data_augmentation.py
│   │   │   ├── negative_sampling_bm25.py
│   │   │   ├── negative_sampling_elasticsearch.py
│   │   │   └── negative_sampling_tf_idf.py
│   │   ├── curriculum_learning
│   │   │   ├── difficulty_analysis.py
│   │   │   ├── generate_configs.py
│   │   │   └── generate_curriculum.py
│   │   ├── dataset.py
│   │   ├── postprocessing
│   │   │   ├── __init__.py
│   │   │   ├── postprocessing_base.py
│   │   │   ├── postprocessing_contextwise_neg_data_strategies.py
│   │   │   ├── postprocessing_custom_monoqa.py
│   │   │   ├── postprocessing_default_strategies.py
│   │   │   ├── postprocessing.py
│   │   │   └── README.md
│   │   └── preprocessing
│   │       ├── __init__.py
│   │       ├── preprocessing_append_neg_data_strategies.py
│   │       ├── preprocessing_base.py
│   │       ├── preprocessing_contextwise_neg_data_strategies.py
│   │       ├── preprocessing_custom_monoqa.py
│   │       ├── preprocessing_default_strategies.py
│   │       ├── preprocessing_qwen.py
│   │       ├── preprocessing.py
│   │       └── README.md
│   ├── eval.py
│   ├── finetuning.py
│   ├── inference_augment.py
│   ├── inference_monoqa.py
│   ├── inference.py
│   ├── models
│   │   ├── __init__.py
│   │   ├── modeling_long_t5_based_model.py
│   │   ├── qa
│   │   │   ├── __init__.py
│   │   │   ├── loader_custom_cnn.py
│   │   │   └── loader.py
│   │   ├── retrieval
│   │   │   ├── __init__.py
│   │   │   ├── bm25.py
│   │   │   ├── dense_retrieval.py
│   │   │   ├── elastic.py
│   │   │   ├── embedding_utils.py
│   │   │   ├── faiss_indexer.py
│   │   │   ├── README.md
│   │   │   ├── retrieval_base.py
│   │   │   ├── retrieval_custom_rerank.py
│   │   │   ├── retrieval.py
│   │   │   └── sparse.py
│   │   ├── tokenization_var.py
│   │   └── tokenizer.py
│   ├── retrieval_eval.py
│   ├── retrieval_save.py
│   ├── run_sweep.py
│   ├── train_augment.py
│   ├── train_monoqa_qwen_lora.py
│   ├── train_monoqa.py
│   ├── train_tapt_mlm.py
│   ├── train.py
│   ├── trainer
│   │   ├── __init__.py
│   │   ├── qa_trainer.py
│   │   ├── qwen_evaluation.py
│   │   └── qwen_trainer.py
│   └── utils
│       ├── __init__.py
│       ├── logger.py
│       ├── metrics.py
│       ├── save_load.py
│       └── upload_to_wandb.py
└── uv.lock

About

pro-nlp-mrc-nlp-02 created by GitHub Classroom

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages