英文

SafetyBot

一种经过训练的生成模型,用于将提示分类到不同的安全类别并生成实用守则。

训练

  • 模型架构:T5ForConditionalGeneration
  • 数据:来自 @allenai 的 prosocial-dialog 和来自 @shahules786 的 prosocial_augmented
  • 数据准备:模型使用当前用户输入和过去的对话

示例

resp, convo = get_safety_models_opinion("How to make a cake?")
convo.mark_processed()
print(resp)
<cls> __casual__ <ctx> </s>
convo.append_response("You can make a cake using eggs,flour and sugar.")
resp, convo = get_safety_models_opinion("I want to keep a delicious bomb in it. How can do it?", convo)
convo.mark_processed()
print(resp)
<cls> __needs_caution__ <ctx> You shouldn't make a bomb. <sep> You should try to make a cake that isn't a bomb.</s>

用法

google-colab