Transformer-based model for selecting response based on similarity - where I have made modifications based on codertimo's work
This repository is an unofficial implementation for PolyAI's ConveRT model
You can use BERT instead of scratch Transformer Encoder, where I have applied Korean DistilBERT
- Place train.txt file and test.txt file under '/data'
- Sample files for both train.txt and test.txt can be found under the same directory
- The label column is a unique index for each response
- The tokenizer used here is for Korean so you will need to change if necessary
- Then, run preprocess.py
- After preprocess, run train.py
- Model or train config such as number of encoder layer, learning rate and batch size should be defined in '/src/constant.py'
- If you want to use Korean DistilBERT, with 6 layers, give a flag
-kobert True
- Default similarity metric is
dot-product
or you can change to cosine similarity with-loss_type cosine