Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

基于Python-wechaty建立一个斗图机器人 #7

Closed
huangaszaq opened this issue May 29, 2020 · 25 comments
Closed

基于Python-wechaty建立一个斗图机器人 #7

huangaszaq opened this issue May 29, 2020 · 25 comments

Comments

@huangaszaq
Copy link

huangaszaq commented May 29, 2020

此次活动

开源软件供应链点亮计划

“开源软件供应链点亮计划-暑期2020”(以下简称 暑期2020)是由中科院软件所与 openEuler 社区共同举办的一项面向高校学生的暑期活动,旨在鼓励在校学生积极参与开源软件的开发维护,促进国内优秀开源软件社区的蓬勃发展。
根据项目的难易程度和完成情况,参与者还可获取“开源软件供应链点亮计划-暑期2020”活动奖金和奖杯。
官网:https://isrc.iscas.ac.cn/summer2020 官方新闻:http://www.iscas.ac.cn/xshd2016/xshy2016/202004/t20200426_5563484.html

Wechaty

Wechaty 是一个开源聊天机器人框架SDK,具有高度封装、高可用的特性,支持NodeJs, Python, Go 和Java 等多语言版本。在过去的4年中,服务了数万名开发者,收获了 Github 的 8000 Star。同时配置了完整的DevOps体系并持续按照Apache 的方式管理技术社区。

基于Python-wechaty建立一个斗图机器人

项目需求

斗图功能是目前很多年轻人,甚至很多00后非常喜欢玩的,很受20岁左右的人的喜爱。目前市面上有很多斗图的软件,自动生成斗图的软件,还有很多自制的表情包也拿出来斗图,其下载量也还是不错的。所以说,在此背景下,开发出一款基于Python-wechaty的斗图机器人也是不错的。

项目难度

中(奖金:9000元)

导师联系

核心目标

  • 分析聊天用户的表情表达的意思
  • 自动完成斗图
  • 自动保存表情包为对应文件格式(搜集表情包)

项目技术栈

  • 了解python语言
  • 熟悉python-wechaty的使用
  • 熟悉人工智能图片分析者优先

相关资料

@xiaoerlaigeid
Copy link

你好 我对这个项目很感兴趣 想问下有什么建议吗? 我对熟悉人工智能图片分析比较熟悉,对python-wechaty也了解过一点使用,您觉得如何开展比较好?谢谢!

@huangaszaq
Copy link
Author

@xiaoerlaigeid 你好,很高兴收到你的回复。对这个项目感兴趣并且符合上面的要求就可以报名,然后等待Summer2020组委会的审核。关于如何开展,目前的构思就是提取表情包的文字,进行分析语义或者提取关键词,然后再做对应的回应,发送给对方;关于回应,这里可能涉及到深度学习,训练一个可以怼人的模型,训练模型的工作量会比较大,因为缺少对应的语料来学习。

@huangaszaq
Copy link
Author

再一个就是针对没有文字的表情包,也涉及到一个图片识别,对图片的含义进行分类。

@xiaoerlaigeid
Copy link

@huangaszaq 我大概懂了,就是说可能要训练多个模型,涉及到一些文字识别和图像识别。然后也要自己来获取数据集。

@huangaszaq
Copy link
Author

@xiaoerlaigeid 对,是这个意思。如果你有更好的构思或者意见,非常欢迎提出。

@MrZilinXiao
Copy link
Member

你好!我是来自四川大学的一名大二学生,我关于此项目的技术方案与个人介绍已发送至您的邮箱,烦请查收;

@MrZilinXiao
Copy link
Member

MrZilinXiao commented Jul 18, 2020

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:07-19

本周完成的成果(实际上是07-01至今)

  • 项目结构初步规划
  • 利用peewee搭建起整个项目后端的数据库结构
  • 完成爬取、收集表情包并纳入数据库管理的工作
  • 引入、调试OCR模块
  • 调试Inception特征提取模型

本周遇到的困难和需要配合的地方

困难

  • Inception单张图片前向传播时间难以接受,可能需要更换开销更小的backbone。

下周的开发计划和预计成果

  • 对比其他特征提取模型,比较提取效果;
  • 尝试使用Deep Metric Learning使得整个模型可以端到端学习,而不是使用pretrained的特征提取模型;

其他需要说明和同步的事项

暂无
Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/

@huan
Copy link
Member

huan commented Jul 19, 2020

It's great to seeing your progress on our Python Wechaty SoC project!

I'd like to suggest that it would be better if we can have a plan for the whole project, with clear deliverable specifications.

@MrZilinXiao
Copy link
Member

It's great to seeing your progress on our Python Wechaty SoC project!

I'd like to suggest that it would be better if we can have a plan for the whole project, with clear deliverable specifications.

Thanks for your suggestions! In fact, a detailed plan for the project is listed here: https://github.com/wechaty/wechaty.github.io/pull/343.

@huan
Copy link
Member

huan commented Jul 20, 2020

@MrZilinXiao Got it, it's great!

Please link your blog post URL to this issue after your blog post has been published, so that we can track everything for your project under this issue, thanks!

@MrZilinXiao
Copy link
Member

MrZilinXiao commented Jul 27, 2020

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:07-26

本周完成的成果(07-19至07-26)

  • 完成上周未完成的任务
  • 测试导入速度与特征提取效果 (batch_size为16,在GTX1060上3s完成一个batch)
  • 对比其他特征提取模型,比较提取效果;

本周遇到的困难和需要配合的地方

困难

  • Metric Learning 正处于学习阶段,推进进度缓慢,正尽快学习中;

下周的开发计划和预计成果

  • 尝试使用Deep Metric Learning使得整个模型可以端到端学习,而不是使用pretrained的特征提取模型;
  • 初步编写前端回复模块;(上周遗留任务)

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/

@huangaszaq
Copy link
Author

huangaszaq commented Jul 28, 2020

[基于Python-wechaty建立一个斗图机器人] 导师评分

日期:07-28

本周进度报告的评分

  • 1: Deliverable not acceptable
  • 2: Deliverable is below expectations
  • 3: Deliverable is OK
  • 4: Deliverable is above expectations
  • 5: Deliverable is perfect

其他需要说明和同步的事项

I think this job is a little difficult for a student in campus, and I believe you can do it! Generally, nice work!
BTW, if you have any questions, bring them out.

@MrZilinXiao
Copy link
Member

MrZilinXiao commented Aug 2, 2020

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:08-02

本周完成的成果(07-27至08-02)

  • 尝试使用Deep Metric Learning使得整个模型可以端到端学习,而不是使用pretrained的特征提取模型:在此我复现了一项较为简单的Cosine Metric Learning模块,期待后续它的效果!
    MrZilinXiao/python-wechaty-meme-bot@8d01418

  • 初步编写前端回复模块;

本周遇到的困难和需要配合的地方

困难

  • 由于python-wechaty暂时没有文档可供参考,部分接口使用时存在疑惑,只能参考examples中的示例代码;部分示例代码在当前版本无法正常工作(如base64 to_file support python-wechaty-puppet#25 ,当前版本图片消息的msg.to_file_box()返回的Filebox.Base64在示例代码中无法被保存);不过这属于可以克服的困难☺️

下周的开发计划和预计成果

  • 打通Wechaty、前端、后端,实现斗图的Demo效果;
  • 实装Cosine Metric Net;

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/
Repo Link: https://github.com/MrZilinXiao/Fighting-Meme-python-wechaty/

@huangaszaq
Copy link
Author

huangaszaq commented Aug 3, 2020

[基于Python-wechaty建立一个斗图机器人] 导师评分

日期:08-03

本周进度报告的评分

  • 1: Deliverable not acceptable
  • 2: Deliverable is below expectations
  • 3: Deliverable is OK
  • 4: Deliverable is above expectations
  • 5: Deliverable is perfect

其他需要说明和同步的事项

Nice work! It seems that you made enormous achievement last week.

Docs of python-wechaty are in progress, plz feel free to ask me or any other contributors of python-wechaty.

Like i said, whenever you have questions, bring them out. Good luck!

@MrZilinXiao
Copy link
Member

MrZilinXiao commented Aug 9, 2020

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:08-09

本周完成的成果(08-03至08-09)

本周遇到的困难和需要配合的地方

本周科研与竞赛任务繁重,因此上周预期计划的Demo未能成功完成,实在抱歉!

下周的开发计划和预计成果

  • 打通Wechaty、前端、后端,实现斗图的Demo效果;(上周遗留任务)
  • 训练cosine-metric-net并调优;

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/
Repo Link: https://github.com/MrZilinXiao/Fighting-Meme-python-wechaty/

@huangaszaq
Copy link
Author

[基于Python-wechaty建立一个斗图机器人] 导师评分

日期:08-12

本周进度报告的评分

  • 1: Deliverable not acceptable
  • 2: Deliverable is below expectations
  • 3: Deliverable is OK
  • 4: Deliverable is above expectations
  • 5: Deliverable is perfect

其他需要说明和同步的事项

That's OK, but you would better finish them as Mid-Term deliverables.

@MrZilinXiao
Copy link
Member

[基于Python-wechaty建立一个斗图机器人] 导师评分

日期:08-12

本周进度报告的评分

  • 1: Deliverable not acceptable
  • 2: Deliverable is below expectations
  • 3: Deliverable is OK
  • 4: Deliverable is above expectations
  • 5: Deliverable is perfect

其他需要说明和同步的事项

That's OK, but you would better finish them as Mid-Term deliverables.

OK, demo has been finished recently! The mid-term report, POC blog, PPT and Demo Live video are on their ways!

@MrZilinXiao
Copy link
Member

MrZilinXiao commented Aug 16, 2020

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:08-16

本周完成的成果(08-10至08-16)

  • 打通Wechaty、前端、后端,实现斗图的Demo效果;
  • Cosine Metric Net 训练开始
  • 中期报告、中期POC博客、PPT演示视频、Demo Live视频

本周遇到的困难和需要配合的地方

暂无

下周的开发计划和预计成果

  • 思考快速与数据库中现有特征比较余弦距离的方法,并着手开发;
  • 导入表情时引入屏蔽词机制;
  • 考察、调研中文对话系统,思考“怼人”机制

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/
Repo Link: https://github.com/MrZilinXiao/Fighting-Meme-python-wechaty/
PowerPoint Demonstration: https://www.bilibili.com/video/BV1kZ4y1M7F6/
Demo Live Video on bilibili: https://www.bilibili.com/video/BV17f4y197ut/

@MrZilinXiao
Copy link
Member

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:08-24

本周完成的成果(08-17至08-22)

  • 根据导师中期报告内容,调整项目未来开发方向,具体包括:
  1. 优化代码结构,关键代码加以详细注释;简化代码逻辑,提高代码质量;
  2. 暂缓特征提取,转而引入中文对话系统实现“怼”的对话效果;
  • 收集中文单轮对话数据集
  • 学习单轮对话基础解决方案,如seq2seq+attention模型,写出基本框架

本周遇到的困难和需要配合的地方

首次接触NLP中的对话系统,部分知识需要从基础学起,进度较慢;

下周的开发计划和预计成果

  • 开始评估、训练seq2seq+attention的中文对话模型
  • 收集更多含文字表情包,以便提高回复时关键词命中表情的概率

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/
Repo Link: https://github.com/MrZilinXiao/Fighting-Meme-python-wechaty/
PowerPoint Demonstration: https://www.bilibili.com/video/BV1kZ4y1M7F6/
Demo Live Video on bilibili: https://www.bilibili.com/video/BV17f4y197ut/

@huangaszaq
Copy link
Author

[基于Python-wechaty建立一个斗图机器人] 导师评分

日期:08-26

本周进度报告的评分

  • 1: Deliverable not acceptable
  • 2: Deliverable is below expectations
  • 3: Deliverable is OK
  • 4: Deliverable is above expectations
  • 5: Deliverable is perfect

其他需要说明和同步的事项

About NLP, you can ask @wj-Mcat for advice, he is a NLP researcher. And you can also discuss with me.

@MrZilinXiao
Copy link
Member

MrZilinXiao commented Sep 2, 2020

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:09-02(很抱歉现在才给进度报告)

本周完成的成果

  • 与导师沟通命名项目名称,项目名称确定为wechaty-meme-bot
  • 项目中引用transformers中的GPT2模型,参考GPT2-chitchat完成单、多轮对话的适配;

本周遇到的困难和需要配合的地方

尝试自行训练GPT2模型时,在本地1060显卡上训练进度极其缓慢且难以收敛;其余模型例如pytorch官网上简单的BiRNN、seq2seq等经过简单训练效果又不佳...
目前先尝试使用GPT2-chitchat作者的预训练模型看看效果

下周的开发计划和预计成果

  • 与导师沟通、确认转移仓库至wechaty组织下;
  • 重构RequestHandler,以在当前项目中引入GPT2对话系统;

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/
Repo Link: https://github.com/MrZilinXiao/Fighting-Meme-python-wechaty/
PowerPoint Demonstration: https://www.bilibili.com/video/BV1kZ4y1M7F6/
Demo Live Video on bilibili: https://www.bilibili.com/video/BV17f4y197ut/

@MrZilinXiao
Copy link
Member

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:09-10

本周完成的成果

  • 重构RequestHandler,以在当前项目中引入GPT2对话系统;
  • 根据导师 @huangaszaq 的建议,将单元测试部分用pytest重写,以与python-wechaty保持一致;

本周遇到的困难和需要配合的地方

  • 【迁移项目】任务暂停
  • 社区配发的donut-token好像过期了,不太好测试重构之后整个斗图机器人的效果...

下周的开发计划和预计成果

  • 配置CI/CD
  • 设计项目Logo
  • 记录一些经典的与斗图机器人之间的对话,以体现斗图机器人的“智能性”(thanks to @huan advice at Mid-term Demostration)

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/
Repo Link: https://github.com/MrZilinXiao/python-wechaty-meme-bot/

@MrZilinXiao
Copy link
Member

MrZilinXiao commented Sep 19, 2020

[基于Python-wechaty建立一个斗图机器人] 进度报告

日期:09-19

本周完成的成果

本周遇到的困难和需要配合的地方

  • token的问题由JuziBot在这周晚些时候给我换发了新的token,但换用token后出现了say()图片无法收到(Excetions: can not get message callback response python-wechaty#82 ) 、每次重新打开python-wechaty都需要在手机微信退出登录再扫码才能成功从wechaty收到信息等多个问题,调试起来比较影响开发进度,检查发现前端逻辑代码未曾有过改变,不知是否是新的donut-token引发了这些问题?

say()图片无法收到:
image

下周的开发计划和预计成果

  • 解决本周遇到的困难和需要配合的地方中提到的问题;
  • 绘制新的流程图,撰写结题报告;

其他需要说明和同步的事项

Blog Link: https://wechaty.github.io/python-wechaty-meme-bot/
Repo Link: https://github.com/MrZilinXiao/python-wechaty-meme-bot/

@huangaszaq
Copy link
Author

[基于Python-wechaty建立一个斗图机器人] 导师评分

日期:09-27

本周进度报告的评分

  • 1: Deliverable not acceptable
  • 2: Deliverable is below expectations
  • 3: Deliverable is OK
  • 4: Deliverable is above expectations
  • 5: Deliverable is perfect

其他需要说明和同步的事项

Well done! You have done a nice work!

@huan huan added the summer2020 label Jan 4, 2021
@huan
Copy link
Member

huan commented Jan 10, 2021

@huangaszaq Thanks for the mentoring!

@MrZilinXiao Thank you very much for joining the Wechaty open source project and finished Summer 2020 successfully!

@huan huan closed this as completed Jan 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants