Views
No views yet
Beyond Popularity Bias: A TBL-Fair Recommendation Framework based on LLM-GNN Hybrid Architecture.
TrustAwareBERT 모델을 학습시킬 수 있습니다.1# Hugging Face 저장소에서 다운로드
2git clone [https://huggingface.co/HabinKim/trust-aware-bert-fashion](https://huggingface.co/HabinKim/trust-aware-bert-fashion)
3cd trust-aware-bert-fashion
4pip install .1import torch
2from fair_rec import TrustAwareBERT, TrustWeightedLoss, Trainer
3from torch.utils.data import DataLoader
4
5# 1. 모델 초기화 (Pre-trained BERT 로드)
6model = TrustAwareBERT(pretrained_model='bert-base-uncased')
7
8# 2. 가중 손실 함수 설정 (Study 1의 회귀분석 결과 반영)
9# 신뢰도 점수(Trust Score)를 기반으로 오차를 계산합니다.
10criterion = TrustWeightedLoss()
11
12# 3. 데이터 로더 준비 (사용자의 데이터를 여기에 넣으세요)
13# train_loader = DataLoader(...)
14
15# 4. 학습 시작
16# Trainer 클래스가 학습 루프를 자동으로 관리합니다.
17trainer = Trainer(
18 model=model,
19 train_loader=train_loader, # 실제 데이터 로더
20 val_loader=None, # 검증 데이터 로더 (선택)
21 criterion=criterion,
22 optimizer=torch.optim.AdamW(model.parameters(), lr=2e-5),
23 device='cuda' if torch.cuda.is_available() else 'cpu'
24)
25
26# 에폭(Epoch) 수 설정 후 학습 실행
27trainer.train(epochs=3)| Model | NDCG@10 | Fairness (Gini) | Sustainability CTR |
|---|---|---|---|
| Standard BERT | 0.42 | 0.65 (High Bias) | 2.1% |
| FairRecSys (Ours) | 0.45 | 0.48 (Balanced) | 5.4% |
1@inproceedings{kim2026trust,
2 title={Trust-Aware Fashion Recommendation: Bridging the Gap between Behavioral Helpfulness and Deep Learning},
3 author={Kim, Habin},
4 booktitle={Proceedings of the International Conference on Convergence Technology (ICCT)},
5 year={2026}
6}