英文

冰洋娜 | 聊天机器人

这是使用 microsoft/DialoGPT-small 制作的生成式人工智能。

建议与 AIML Chatbot 一起使用,以减少负载,获得更好的回复,并为您的机器人添加姓名和个性。使用AIML Chatbot还可以为一些回复进行硬编码。

冰洋娜

冰洋娜是一个聊天机器人,希望能像朋友一样与人交谈!它的主要目标平台是discord。您可以邀请机器人 here 。

想要了解更多关于这个项目并与AI交谈,您可以使用此 website 。

冰洋娜通过使用之前的消息上下文,并猜测与之交谈的人的个性,来调整自己的个性以便更好地与用户交谈。

参与和帮助AI改进或只是在 hugging face discussions 闲逛

目标

目标是创建一个通过AIML工作的AI,以创建最接近人类的AI。

为什么不是独立的AI?

对于AI来说(现实上)不可能学习用户并存储关于他们的数据,而相较之下,AIML甚至可以执行代码!AI的目标是生成AIML无法处理的回复。

因此,目标是制作一个具有广泛知识但尽可能小的AI!所以我们使用三个数据集:-

  • Movielines 电影台词可以提供更长、更周全的回答,但可能非常随机。大约有200,000行!
  • Discord Messages 这些消息涵盖了各种各样的话题,并过滤和删除了垃圾信息,使得AI在回答日常问题时具有非常随机的回复!约有1.2亿条消息!
  • 从我的消息中抓取的自定义数据集,这些消息非常有限,仅教授该数据集并发送随机回复将使AI频繁道歉!
  • 训练

    Discord消息数据集简直超过了其他数据集,因此将数据集重复了。这样它们可以彼此覆盖问题!

    AI的上下文是6条消息,这意味着它会回复到用户的第4条消息。 Example

    给Hugging Face干扰的贴士

    I recommend send the user input,
    previous 3 AI and human responses.
    
    Using more context than this will lead to useless responses but using less is alright but the responses may be random.  
    

    评估

    以下是使用上述混合数据集上的自动评估指标对冰洋娜与其他基线模型进行的比较。

    Model Perplexity
    Seq2seq Baseline [3] 29.8
    Wolf et al. [5] 16.3
    GPT-2 baseline 99.5
    DialoGPT baseline 56.6
    DialoGPT finetuned 11.4
    PersonaGPT 10.2
    Aeona 7.9

    用法

    示例:

    from transformers import AutoTokenizer, AutoModelWithLMHead
      
    tokenizer = AutoTokenizer.from_pretrained("deepparag/Aeona")
    model = AutoModelWithLMHead.from_pretrained("deepparag/Aeona")
    # Let's chat for 4 lines
    for step in range(4):
        # encode the new user input, add the eos_token and return a tensor in Pytorch
        new_user_input_ids = tokenizer.encode(input(">> User:") + tokenizer.eos_token, return_tensors='pt')
        # print(new_user_input_ids)
        # append the new user input tokens to the chat history
        bot_input_ids = torch.cat([chat_history_ids, new_user_input_ids], dim=-1) if step > 0 else new_user_input_ids
        # generated a response while limiting the total chat history to 1000 tokens, 
        chat_history_ids = model.generate(
            bot_input_ids, max_length=200,
            pad_token_id=tokenizer.eos_token_id,  
            no_repeat_ngram_size=4,       
            do_sample=True, 
            top_k=100, 
            top_p=0.7,
            temperature=0.8
        )
        
        # pretty print last ouput tokens from bot
        print("Aeona: {}".format(tokenizer.decode(chat_history_ids[:, bot_input_ids.shape[-1]:][0], skip_special_tokens=True)))