|
|
||
|---|---|---|
| doc | ||
| model | ||
| trans_classification | ||
| trans_couplet | ||
| trans_translation | ||
| README.md | ||
README.md
Transformer模型项目
基于Transformer结构的文本翻译模型
- 环境准备
- Python 3.9
- Pytorch 1.12
- torchtext 0.13.0
- 安装spaCy分词器
pip install de_core_news_sm-3.7.0.tar.gzpip install en_core_web_sm-3.7.1.tar.gz
- 模型训练
python train.py
- 文本翻译
python translate.py
基于Transformer Encoder的文本分类模型
- 模型训练
python train.py
- 文本分类
python classification.py
基于Transformer结构的对联生成模型
- 模型训练
python train.py
- 生成对联
python couplet.py