Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Chinese NewsTitle Generation Project by GPT2.带有超级详细注释的中文GPT2新闻标题生成项目。
| Date | Stars |
|---|---|
| 2026-07-24 | 1110 |
| 2026-07-25 | 1110 |
| 2026-07-28 | 1110 |
| 2026-07-30 | 1110 |
| 2026-08-06 | 1110 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# GPT2-NewsTitle 带有超详细注释的GPT2新闻标题生成项目 ## UpDate 02.19.2022 * 增加Streamlit页面,无需使用Flask+HTML就可以部署一个精美页面。 * 详细说明文档,见[算法不会前端,也可以做出好看的界面](https://zhuanlan.zhihu.com/p/469582149) 运行代码 ``` streamlit run app.py or streamlit run app.py --server.port your_port ``` 具体如下图所示:   ## UpDate 01.02.2021 * 从网上收集数据,将清华新闻数据、搜狗新闻数据等新闻数据集,以及开源的一些摘要数据进行整理清洗,构建一个较完善的中文摘要数据集。 * 数据集清洗时,仅进行了简单地规则清洗。例如:清洗htlm标记、去除多余空字符、去除图片标记等。 * 处理后数据集详细信息,见[数据集描述](https://zhuanlan.zhihu.com/p/341398288) | 数据 | 原始数据/项目地址 | 处理后文件下载地址 | | ------ | ------ | ------ | | 清华新闻数据 | [地址](http://thuctc.thunlp.org/) | [百度云盘](https://pan.baidu.com/s/1a-CUtTc5xQFB9_EJaxDklA) 提取码: vhol | | 搜狗新闻数据 | [地址](https://www.sogou.com/labs/resource/cs.php) | [百度云盘](https://pan.baidu.com/s/1vgfa5gnIHTYpoYptuHo6gQ) 提取码:ode6 | | nlpcc2017摘要数据 | [地址](http://tcci.ccf.org.cn/conference/2017/taskdata.php) | [百度云盘](https://pan.baidu.com/s/1v7QFJ3hl_ALb2DEEq0umRQ) 提取码:e0zq | | csl摘要数据 | [地址](https://github.com/P01son6415/CSL) | [百度云盘](https://pan.baidu.com/s/1qrzhsWq8SGQ1-W8VizSY9w) 提取码:0qot | | 教育培训行业摘要数据 | [地址](https://github.com/wonderfulsuccess/chinese_abstractive_corpus) | [百度云盘](https://pan.baidu.com/s/1sjOkp8LKGVmY6h0QXl5m7g) 提取码:kjz3 | | lcsts摘要数据 | [地址](http://icrc.hitsz.edu.cn/Article/show/139.html) | [百度云盘](https://pan.baidu.com/s/1J2NcMfxpGGG_BG1Wx0lHGA) 提取码:bzov | | 神策杯2018摘要数据 | [地址](https://js.dclab.run/v2/cmptDetail.html?id=242) | [百度云盘](https://pan.baidu.com/s/1WFimCGk6y-nfSdPRbCrV8Q) 提取码:6f4f | | 万方摘要数据 | [地址](https://github.com/EachenKuang/wanfangSpider) | [百度云盘](https://pan.baidu.com/s/1RFNFagKnxf2JKnjwBDecPA) 提取码: p69g| | 微信公众号摘要数据 | [地址](https://github.com/nonamestreet/weixin_public_corpus) | [百度云盘](https://pan.baidu.com/s/1OBn8kyZEsUeiV_kw4OJYnQ) 提取码: 5has| | 微博数据 | [地址](https://www.jianshu.com/p/8f52352f0748?tdsourcetag=s_pcqq_aiomsg) | [百度云盘](https://pan.baidu.com/s/1-OxrZRm_Q7ejfU-mtngBWg) 提取码: 85t5| | news2016zh新闻数据 | [地址](https://github.com/brightmart/nlp_chinese_corpus) | [百度云盘](https://pan.baidu.com/s/1S3YhetbEZuSfYbfSLeRfSg) 提取码: qsj1 | 数据集集合:[百度云盘](https://pan.baidu.com/s/1ibPTRTgXn8FfVf6DgVFWfA) 提取码: 7am8 ## 项目描述 * 本项目是一个带有超级详细中文注释的基于GPT2模型的新闻标题生成项目。 * 本项目参考了[GPT2-Chinese](https://github.com/Morizeyao/GPT2-Chinese)、[GPT2-chitchat](https://github.com/yangjianxin1/GPT2-chitchat)、[CDial-GPT](https://github.com/thu-coai/CDial-GPT)、[GPT2](https://github.com/ConnorJL/GPT2)等多个GPT2开源项目,并根据自己的理解,将代码进行重构,添加详细注释,希望可以帮助到有需要的人。 * 本项目使用HuggingFace的[transformers](https://github.com/huggingface/transformers)实现GPT2模型代码编写、训练及测试。 * 本项目通过Flask框架搭建了一个Web服务,将新闻摘要生成模型进行工程化,可以通过页面可视化地体验新闻标题生成效果。 * 本项目的代码详细讲解,可以自行阅读代码,也可查看[代码注释介绍](https://zhuanlan.zhihu.com/p/338171330)。 * 本项目提供的新闻标题模型是一个6层的小模型(其实是穷人没人卡,只能训练小模型),并且在训练该模型过程中,没有加载预训练的GPT2模型而是随机初始化的参数,并且训练轮数较少(5轮,还没收敛完),因此效果一般。如果想要更好效果的模型,可以按照个人需求训练一个模型。 * 本项目的目的是带领大家走一遍GPT2生成模型的训练、测试及部署全部流程。 ## 文件结构 * config * config.json 模型的配置信息,包含n_ctx、n_embd、n_head、n_layer等。 * vocab * vocab.txt 字典文件,该字典为大小为13317,删除了将原始字典中的“##中文”,并且增加了“[Content]”、“[Title]”、“[Space]”等标记。 * data_dir 存放数据的文件夹 * templates 存放html页面的文件夹 * data_helper.py 数据预处理文件,将数据进行简单的清洗 * data_set.py 数据类文件,定义模型所需的数据类,方便模型训练使用 * model.py GPT2模型文件,主要对transformers包中GPT2LMHeadModel的重写,修改计算loss部分,只计算预测title部分的loss * train.py 通过新闻正文生成新闻标题的GPT2模型的训练文件 * generate_title.py 根据训练好的模型,进行新闻标题生成,预测文件 * http_server.py 构建web服务文件 ## 运行环境 * gevent == 1.3a1 * flask == 0.12.2 * transformers == 3.0.2 详细见[requirements.txt](./requirements.txt)文件 ## 数据集 数据来源于新浪微博,数据链接:https://www.jianshu.com/p/8f52352f0748?tdsourcetag=s_pcqq_aiomsg | 数据描述 | 下载地址 | | ------ | ------------- | | 原始数据 | [百度网盘](https://pan.baidu.com/s/1QX7Vvlky_gxGI2F3cQ2nOQ),提取码: nqzi | | 处理后数据 | [百度网盘](https://pan.baidu.com/s/180aTaZe-5jopVBBJhBrTWg),提取码: duba | 原始数据为直接从网上下载的新闻数据,处理后数据为使用data_helper.py处理过的数据,可直接用于训练。 ## 模型参数 详细见config/config.json文件 | 参数 | 值 | | ------ | ------------- | | initializer_range | 0.02 | | layer_norm_epsilon
Excerpt of 8,108 characters
Read on GitHub刘聪NLP · China
29
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:a54fd389adc079b2, topic:transformer
matched fp:a54fd389adc079b2, topic:nlp