YAML Metadata Warning: empty or missing yaml metadata in repo card (https://huggingface.co/docs/hub/model-cards#model-card-metadata)

Hackathon SOICT 2024: Legal Document Retrieval

Team: PRIMIER LEAGUE

Member:

  • Nguyễn Nho Trung
  • Nguyễn Nhật Quang

Giới thiệu 2 checkpoint tốt nhất của chúng tôi

  • hub/bi/stage2/checkpoint(567M tham số): được fine tune từ BAAI/bge-m3.
  • hub/cross/checkpoint (567M tham số): được fine tune từ BAAI/bge-reranker-v2-m3

Sau đây chúng tôi xin hướng dẫn cách chạy code inference, code training và code chunking data

Inference

Với code này, chúng tôi có 2 lệnh docker để tạo ra kết quả (cả 2 model biencoder và reranker đều có tham số là 567M):

  • Sử dụng mô hình biencoder (top 30) + reranker (top 10): sử dụng lệnh docker như dưới
sudo docker-compose -f docker-compose-crossencoder.yml up --build
  • Sử dụng mô hình biencoder (top 10):
sudo docker-compose -f docker-compose-biencoder.yml up --build

(Kết quả tạo ra trong folder result, bạn hãy đổi tên của nó cho đúng format cuộc thi và submit).

(Lưu ý: vì chúng tôi không rõ cấu hình GPU của máy test, do đó batch_size = 1 đã được đặt. Bạn có thể chỉnh tham số này trong 03_get_result_biencoder.py, 05_save_bi_result.py, 06_get_result_cross.py để chạy nhanh hơn)

Training

  • Code training bi-encoder:
sudo docker-compose -f docker-compose_train_bi.yml up --build
  • Code training cross encoder:
sudo docker-compose -f docker_compose_train_cross.yml up --build

(checkpoint sẽ lưu trong thư mục output_dir/ckpt_bi_encoder hoặc /output_dir/ckpt_cross_encoder)

Chungking:

Code này khá đơn giản do đó chúng tôi không docker để đỡ mất thời gian, các bước chạy như sau:

pip install pandas
pip install transformers
python 01_chunking_and_process.py

Lưu ý: chúng tôi đã chạy file chunk này để tạo ra data chunk với max token là 1024 (từ dữ liệu gốc của ban tổ chức)

Kết quả

Method MRR10
Biencoder(top 30) + cross_encoder(top 10) 0.8117
Bi-encoder(top 10) 0.7859
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.