Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
smallv0221 17502c1f9b | 2 years ago | |
---|---|---|
.. | ||
imgs | 3 years ago | |
readers | 3 years ago | |
utils | 2 years ago | |
README.md | 2 years ago | |
interaction.py | 2 years ago | |
model.py | 3 years ago |
构建高质量的开放领域(Open-Domain)的对话机器人,使得它能用自然语言与人自由地交流,这一直是自然语言处理领域终极目标之一。
为了能够简易地构建一个高质量的开放域聊天机器人,本项目在Paddle2.0上实现了PLATO-2的预测模型,并基于终端实现了简单的人机交互。用户可以通过下载预训练模型快速构建一个开放域聊天机器人。
PLATO-2的网络结构见下图:
PLATO-2的训练过程及其他细节详见 Knover
安装方式:pip install sentencepiece termcolor
您可以从以下位置下载预训练模型文件:
以24层预训练模型为例:
wget https://paddlenlp.bj.bcebos.com/models/transformers/plato2/24L.pdparams
NOTE: PLATO-2网络参数量较大,24层网络至少需要显存16G,32层网络至少需要显存22G,用户可选择合适的网络层数及预训练模型。
sentencepiece分词预训练模型和词表文件下载:
wget https://paddlenlp.bj.bcebos.com/models/transformers/plato2/data.tar.gz
tar -zxf data.tar.gz
运行如下命令即可开始与聊天机器人用英语进行简单的对话
export CUDA_VISIBLE_DEVICES=0
python interaction.py --vocab_path ./data/vocab.txt --spm_model_file ./data/spm.model --num_layers 24 --init_from_ckpt ./24L.pdparams
以上参数表示:
32层PLATO-2网络交互示例:
NOTE: 输入"[EXIT]"退出交互程序,输入"[NEXT]"开启下一轮新的对话。
黑客松task_55,在PaddleNLP的Roberta中,新增 MultipleChoice,MaskedLM 和 CausalLM三个类,7个模型权重. ,新增BPETokenizer
Python C++ Cuda Text Shell other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》