-
Notifications
You must be signed in to change notification settings - Fork 4
Feedback #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feedback
Are you sure you want to change the base?
Feedback #1
Changes from 158 commits
a7403b5
befcc79
559cf40
8b97bdb
923dc13
771c294
51be01a
7fafbb1
dfceb08
d61de72
4a66a07
9f56c6f
4360412
b756570
2cb99a9
1af6048
42c4a24
3e2d65c
3d54165
ebe6bd7
beb6a41
db27d3f
a91d4bf
1ccefc9
50c8391
f0ceaf0
44938e8
1a5f4df
e3b15a7
809cb9a
6ad780d
1983fe6
feffff2
55f7191
470ce83
0f51070
5cbb9ad
9297e35
244eb8c
b9afe7d
fd87d17
7492f2b
9103917
822bbf9
be7ea46
98d1d6f
70af0a7
304edba
ef321a9
36d521f
d9312ca
e1d10ac
adec41f
b5ecb16
c8e6e20
d1a74d5
d9da190
dd813f5
143db3f
0e98fd9
be66856
d9af72e
3ec1d88
5812e65
40148d1
b54086f
edf0686
cc05090
36da98f
3aeb6ef
81cf8c9
1c742b4
5a2f226
c1c1de3
4ca6040
df03260
e80e058
1f71281
243ad86
a3d3c3b
501e449
9aaf4bc
b655a92
5f52c34
57719cd
a3f77ce
f341323
93787f8
05ba390
ea0dc6f
720af12
16109e3
db4af6a
4fe8407
aa2e06a
b257165
b8e7f38
459a295
5d3416a
c05aa7e
848a269
8be843c
e390551
ef79460
27c17b2
6440adc
2ce1396
2d02685
85d8a0d
42ba938
735c29d
7bc660b
cd1e468
44a4767
1069f53
60ec80c
316d425
e283265
d2c0e2d
bcab5ee
5792adb
a470cf3
508a349
5a7097c
6d0d819
7c54c79
48d2888
52fd9fb
6e3a2f7
6c2c7ba
dbad395
8ab58cc
f5dba5c
cbbe149
5dec3cc
bfac4d4
6faf022
3cba8aa
ab70134
27d5451
3b7c14d
ff0d1a2
93dad5a
b2a2781
c8389f5
37f459b
7bef96c
6bde379
45c1535
cf55edb
31104b1
d8e524e
80bd026
e8afb20
411ffe2
2c54bcc
ac1bc0e
f2accd1
e3d513a
99e46a4
f42d398
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| blank_issues_enabled: false | ||
| issue_templates: | ||
| - name: Experiment Template | ||
| description: For new experiments | ||
| file: experiment.md | ||
| - name: Feature Template | ||
| description: For new features | ||
| file: feature.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| name: Experiment Issue | ||
| about: For new experiments | ||
| title: "[EXP]" | ||
| labels: | ||
| assignees: '' | ||
| --- | ||
|
|
||
| # ISSUE: Experiment | ||
|
|
||
| ## 노션 링크 | ||
|
|
||
|
|
||
| ## 실험 목적 | ||
|
|
||
| - 목적 1 | ||
| - 목적 2 | ||
|
|
||
| ## 체크리스트 | ||
|
|
||
| - [ ] 할일 1 | ||
| - [ ] 할일 2 | ||
| - [ ] 할일 3 | ||
|
|
||
| ## 실험 내용 | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| --- | ||
| name: Feature Request | ||
| about: Suggest a new feature for this project | ||
| title: "[FEAT]" | ||
| labels: | ||
| assignees: '' | ||
| --- | ||
|
|
||
| # ISSUE: Feature | ||
|
|
||
| ## 노션 링크 | ||
|
|
||
|
|
||
| ## 기능 목적 | ||
|
|
||
| - 목적 1 | ||
| - 목적 2 | ||
|
|
||
| ## 체크리스트 | ||
|
|
||
| - [ ] 할일 1 | ||
| - [ ] 할일 2 | ||
| - [ ] 할일 3 | ||
|
|
||
| ## 기능 내용 | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ## PR 정보 | ||
|
|
||
| - 목적: | ||
| - 이슈 번호: | ||
| - 노션 작업 카드 링크: | ||
|
|
||
| ## 변경 사항 | ||
|
|
||
| - 이번 PR에서 작업한 내용을 간략히 설명 | ||
|
|
||
| ## 리뷰 참고사항 | ||
|
|
||
| - 리뷰어에게 필요한 설명이나 특별히 봐주었으면 하는 부분을 작성 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
| .idea/ | ||
| # macOS | ||
| *DS_Store | ||
|
|
||
| # custom | ||
| data/* | ||
| !data/.gitkeep | ||
| wandb | ||
| models | ||
| outputs | ||
| /eda/eda_ignore/ | ||
| ensemble/results_hard | ||
| ensemble/results_soft | ||
|
|
||
| **/.ipynb_checkpoints | ||
| **/lightning_logs | ||
| *.ckpt | ||
| *.pt | ||
| *.arrow | ||
| *.bin | ||
| */nohup.out | ||
| code/config/exp/* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| # ODQA(Open-Domain Question Anwering Competition) | ||
|
|
||
| ## 개요 | ||
|
|
||
| | 항목 | 내용 | | ||
| | --- | --- | | ||
| | 프로젝트 주제 | MRC(기계독해) 데이터셋으로 ODQA(Open-Domain Question Answering)를 수행합니다. <br>RAG(Retrieval-Augmented Generation)로 더 많이 알려져 있습니다. | | ||
| | 프로젝트 구성 | 질문에 관련된 문서를 찾는 Retriever와 찾아온 문서에서 질문에 대한 정답을 찾는 Reader로 구성됩니다. | | ||
| | 평가 지표 | Exact Match (EM) Score를 사용하여 모델의 예측과, 실제 답이 정확하게 일치할 때만 점수가 주어집니다. <br>F1 Score는 참고용으로만 활용됩니다. | | ||
| | 진행 기간 | 2024년 10월 2일 ~ 2024년 10월 24일 | | ||
|
|
||
| ## 최종 리더보드 (Private) | ||
| <img width="1216" alt="image" src="./assets/leaderboard.png"> | ||
|
|
||
| ## 팀원 | ||
|
|
||
| |[이예서](https://github.com/yeseoLee)|[김수진](https://github.com/Sujinkim-625)|[김민서](https://github.com/luckyvickyricky)|[홍성재](https://github.com/koreannn)|[양가연](https://github.com/gayeon7877)|[홍성민](https://github.com/hsmin9809)| | ||
| |:-:|:-:|:-:|:-:|:-:|:-:| | ||
| |<a href="https://github.com/yeseoLee"><img src="https://github.com/yeseoLee.png" width='300px' style="border-radius: 50%;"></a>|<a href="https://github.com/Sujinkim-625"><img src="https://github.com/Sujinkim-625.png" width='300px' style="border-radius: 50%;"></a>|<a href="https://github.com/luckyvickyricky"><img src="https://github.com/luckyvickyricky.png" width='300px' style="border-radius: 50%;"></a>|<a href="https://github.com/koreannn"><img src="https://github.com/koreannn.png" width='300px' style="border-radius: 50%;"></a>|<a href="https://github.com/gayeon7877"><img src="https://github.com/gayeon7877.png" width='300px' style="border-radius: 50%;"></a>|<a href="https://github.com/hsmin9809"><img src="https://github.com/hsmin9809.png" width='300px' style="border-radius: 50%;"></a>| | ||
|
|
||
| ## 역할 | ||
|
|
||
| | 이름 | 역할 | | ||
| | --- | --- | | ||
| | 김민서 | 데이터분석, LLM기반 데이터 증강, 모델실험(증강 데이터 비교), 앙상블 | | ||
| | 김수진 | 외부데이터 리서치 및 학습, 데이터 전처리, 모델 리서치, 모델 개선, 모델 실험, <br>Retrieval 구현 및 실험(ColBERT), 앙상블 | | ||
| | 양가연 | Retrieval(BM25) 구현 및 실험, 모델 리서치, 모델 개선(Custom Layer, Distillation), <br>모델 실험, 앙상블(hard ensemble, soft ensemble, weighted ensemble) | | ||
| | 이예서 | PM(마일스톤 및 이슈 관리), 인프라 담당(개발환경 구성 스크립트화), <br>베이스라인 코드 템플릿화, 데이터 전처리(cleansing), 데이터 증강(negative passage), <br>Retrieval 구현 및 실험(Elasticsearch, Reranking), 앙상블 (merged ensemble) | | ||
| | 홍성민 | 모델 리서치, 모델 실험, Retrieval 구현 및 실험(Dense), 앙상블 | | ||
| | 홍성재 | EDA, 데이터 전처리, Reader성능 개선 관련 조사(Retrospective Reader), 앙상블 | | ||
|
|
||
| ## Wrap-Up Report | ||
| ### [MRC_NLP_리포트(04조).pdf](./assets/MRC_NLP_04_report.pdf) | ||
| 데이터 EDA부터 앙상블까지 프로젝트 전반의 시행착오와 솔루션 및 회고는 렙업 리포트를 통해 확인할 수 있습니다. | ||
|
|
||
| ## 폴더 구조 | ||
| ```bash | ||
| level2-mrc-nlp-04 | ||
| ├── code | ||
| │ ├── BertEncoder.py | ||
| │ ├── README.MD | ||
| │ ├── arguments.py | ||
| │ ├── config | ||
| │ │ ├── elastic_setting.json | ||
| │ │ ├── eval.json | ||
| │ │ ├── inference.json | ||
| │ │ ├── inference_with_rerank.json | ||
| │ │ ├── integration.json | ||
| │ │ └── train.json | ||
| │ ├── custom_model.py | ||
| │ ├── dense_train.py | ||
| │ ├── inference.py | ||
| │ ├── integration_pipeline.py | ||
| │ ├── retrieval | ||
| │ │ ├── __init__.py | ||
| │ │ ├── base.py | ||
| │ │ ├── bm25.py | ||
| │ │ ├── dense.py | ||
| │ │ ├── dense_encoder | ||
| │ │ ├── elastic.py | ||
| │ │ ├── reranker.py | ||
| │ │ └── tdidf.py | ||
| │ ├── train.py | ||
| │ └── utils | ||
| │ ├── __init__.py | ||
| │ ├── trainer_qa.py | ||
| │ └── utils_qa.py | ||
| ├── data | ||
| ├── ensemble | ||
| │ ├── gpt_voting.ipynb | ||
| │ ├── hard_voting.py | ||
| │ ├── results_hard | ||
| │ ├── results_soft | ||
| │ └── soft_voting.py | ||
| ├── external_dataset_processing | ||
| │ ├── arrow_to_csv.py | ||
| │ ├── csv_to_arrow.py | ||
| │ ├── find_answer_start.py | ||
| │ └── train_for_training.py | ||
| ├── notebooks | ||
| │ ├── EDA_train,test.ipynb | ||
| │ ├── EDA_wiki.ipynb | ||
| │ ├── add_question_augmentation_GPT.ipynb | ||
| │ ├── analyze_test_difficulty.ipynb | ||
| │ ├── data_info1.png | ||
| │ ├── dense_top-k_confirm.ipynb | ||
| │ ├── eda_for_data_cleaning.ipynb | ||
| │ ├── elasticsearch.ipynb | ||
| │ ├── question_classification_GPT.ipynb | ||
| │ ├── retriever_base_dataset.ipynb | ||
| │ ├── retriever_evaluation.ipynb | ||
| │ ├── shuffle_data.ipynb | ||
| │ └── synonym_questions_augmentation_GPT.ipynb | ||
| └── setup | ||
| ├── requirements.txt | ||
| ├── setup-elasticsearch.bash | ||
| ├── setup-git.bash | ||
| └── setup-gpu-server.bash | ||
| ``` | ||
|
|
||
| - code: 학습 및 추론에 사용되는 코드 전반을 관리합니다. | ||
| - data: 학습 및 추론에 필요한 데이터를 관리합니다. | ||
| - ensemble: 추론 결과 파일을 이용한 앙상블을 수행하는 코드를 관리합니다. | ||
| - external_dataset_processing: 외부 데이터셋 사용을 위한 전처리 코드를 관리합니다. | ||
| - notebooks: 데이터 분석 및 전처리, 증강 방법 소개와 구현 코드 사용법 안내 등의 주피터 노트북 파일을 관리합니다. | ||
| - setup: GPU 서버 개발 환경 세팅을 위한 스크립트를 관리합니다. | ||
|
|
||
| ## 실행 방법 | ||
| [학습 및 추론 코드 사용 방법](code/README.MD) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| from transformers import BertModel, BertPreTrainedModel | ||
|
|
||
| class BertEncoder(BertPreTrainedModel): | ||
|
|
||
| def __init__(self, | ||
| config | ||
| ): | ||
| super(BertEncoder, self).__init__(config) | ||
|
|
||
| self.bert = BertModel(config) | ||
| self.init_weights() | ||
|
|
||
|
|
||
| def forward(self, | ||
| input_ids, | ||
| attention_mask=None, | ||
| token_type_ids=None | ||
| ): | ||
|
|
||
| outputs = self.bert( | ||
| input_ids, | ||
| attention_mask=attention_mask, | ||
| token_type_ids=token_type_ids | ||
| ) | ||
|
|
||
| pooled_output = outputs[1] | ||
| return pooled_output |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,70 @@ | ||||||
| # 실행 방법 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dependency 설치가 빠져 있습니다. python version, cuda 버전 등도 기록해주세요 |
||||||
| ## 통합 파이프라인으로 실행 | ||||||
| ```bash | ||||||
| # train-eval-inference 통합 파이프라인 | ||||||
| python integration_pipline.py ./config/integration.json | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ``` | ||||||
|
|
||||||
| ## config.json으로 실행 | ||||||
| ```bash | ||||||
| # 학습 | ||||||
| python train.py ./config/train.json | ||||||
| # 평가 | ||||||
| python train.py ./config/eval.json | ||||||
| # 추론 | ||||||
| python inference.py ./config/inference.json | ||||||
| ``` | ||||||
|
|
||||||
| ## 쉘 스크립트로 실행 | ||||||
| ### 학습 또는 평가 방법 | ||||||
| ```bash | ||||||
| python train.py \ | ||||||
| --model_name_or_path klue/bert-base \ | ||||||
| --config_name None \ | ||||||
| --tokenizer_name None \ | ||||||
| \ | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 중간 |
||||||
| --dataset_name ../data/train_dataset \ | ||||||
| --max_seq_length 384 \ | ||||||
| --pad_to_max_length False \ | ||||||
| --doc_stride 128 \ | ||||||
| --max_answer_length 30 \ | ||||||
| --overwrite_cache True \ | ||||||
| --preprocessing_num_workers None \ | ||||||
| \ | ||||||
| --output_dir ../models/train_dataset \ | ||||||
| --overwrite_output_dir True \ | ||||||
| --do_train True \ | ||||||
| --do_eval True \ | ||||||
| --per_device_train_batch_size 8 \ | ||||||
| --per_device_eval_batch_size 8 \ | ||||||
| --learning_rate 5e-5 \ | ||||||
| --weight_decay 0.0 \ | ||||||
| --num_train_epochs 5.0 \ | ||||||
| --warmup_ratio 0.0 \ | ||||||
| --logging_steps 500 \ | ||||||
| --save_steps 500 \ | ||||||
| --seed 42 | ||||||
| ``` | ||||||
|
|
||||||
| ### 추론 방법 | ||||||
| ```bash | ||||||
| python inference.py \ | ||||||
| --model_name_or_path ../models/train_dataset/ \ | ||||||
| \ | ||||||
| --dataset_name ../data/test_dataset/ \ | ||||||
| --overwrite_cache True \ | ||||||
| --max_seq_length 384 \ | ||||||
| --pad_to_max_length False \ | ||||||
| --doc_stride 128 \ | ||||||
| --max_answer_length 30 \ | ||||||
| --eval_retrieval True \ | ||||||
| --num_clusters 64 \ | ||||||
| --top_k_retrieval 20 \ | ||||||
| --use_faiss False \ | ||||||
| \ | ||||||
| --output_dir code/outputs/test_dataset/ \ | ||||||
| --overwrite_output_dir True \ | ||||||
| --do_eval False \ | ||||||
| --do_predict True \ | ||||||
| --seed 42 | ||||||
| ``` | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.vscode도 추가해주면 좋습니다There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
기본적으로 github에서 제공하는 python gitignore에서 시작하면 어떨까 합니다
https://github.com/github/gitignore/blob/main/Python.gitignore