本教程介绍如何安装 AdaSeq
并且使用它训练一个模型。
AdaSeq 基于 Python version >= 3.7
和 PyTorch version >= 1.8
git clone https://github.com/modelscope/adaseq.git
cd adaseq
pip install -r requirements.txt -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
pip install adaseq
本节将以在 resume
数据集上训练 BERT-CRF 模型作为示例。
训练一个模型,你只需要编写一个配置文件,然后允许一个命令即可。
我们已经准备了一个 resume.yaml 配置文件,来试试吧!
python scripts/train.py -c examples/bert_crf/configs/resume.yaml
python scripts/test.py -w ${checkpoint_dir}
adaseq train -c examples/bert_crf/configs/resume.yaml
adaseq test -w ${checkpoint_dir}