当前位置:网站首页>CSDN博文摘要(一) —— 一个简单的初版实现
CSDN博文摘要(一) —— 一个简单的初版实现
2022-07-06 09:11:00 【Alexxinlu】
系列文章
团队博客: CSDN AI小组
1. 背景
2. 博文摘要
2.1 博文结构化
博文中包含了太多的元素,直接作为文本进行摘要会严重影响摘要的质量。故首先需要对博文进行结构化,结构化之后会将正文中的内容有效区分,例如:head(标题)、code(代码)、table(表格)、text(段落)、img(图片)、link(链接)等,可更便捷、准确获取每个部分的内容,为后续博文摘要中的预处理逻辑和规则逻辑提供更便捷清晰的结构化信息,并且为模型提供更优质的输入。下图是博文结构化的一个例子:
2.2 规则部分
- 规则1 :判断正文中是否有 “前言”、“写在前面的话” 等一些对文章进行简介的模块,如果有的话,直接提取前言中的内容,并裁减到指定长度(默认长度:256)
- 规则2 :判断第一级标题前是否有内容,如果有的话,直接提取该部分内容,并裁减到指定长度(默认长度:256)
2.3 模型部分
如果规则无法抽取出摘要,则使用TextRank模型对博文进行摘要抽取。模型的输入为除了head(标题)、code(代码)、table(表格)、text(段落)、img(图片)、link(链接)等之外的正文文本信息。具体的实现过程如下所示:
- a) 对于不满足规则的样本,直接抽取除图片、代码、标题、目录等信息外的所有正文文本;
- b) 将正文文本进行分句,输入到TextRank模型中,进行文本摘要;
- c) TextRank模型会根据句子的重要性,对每个句子进行打分(所有句子得分的总和为1);
- d) 将所有句子按得分从高到低进行排序,并依次进行拼接,直到长度接近指定长度,但是不超过指定长度为止。(默认长度:256)
2.4 得分设定
- 得分区间为: [0, 1]
- 规则得分默认为:0.5
- 模型得分:所有拼接句子的得分值的和
3. 下一步计划
当前版本是一个初步版本,还需要进一步优化。下一步计划包括:
- 构建测试集,进行定量的效果评价。评价指标:BLEU、ROUGE;
- 句子拼接的优化:将所有句子按得分从高到低进行排序,并依 句子在原文的顺序 进行拼接,直到长度接近指定长度;
- TextRank算法在构建句子关系图时,考虑词的权重。例如:基于同一个标签中的所有博文,使用类似于TF-IDF的算法计算每个词的权重。
P.S.
该系列文章会持续进行更新。希望NLP等领域的同仁、老师和专家能够提供宝贵的建议,谢谢!
边栏推荐
- MySQL combat optimization expert 03 uses a data update process to preliminarily understand the architecture design of InnoDB storage engine
- API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T
- API learning of OpenGL (2001) gltexgen
- [reading notes] rewards efficient and privacy preserving federated deep learning
- Anaconda3 安装cv2
- ① BOKE
- Mysql33 multi version concurrency control
- Security design verification of API interface: ticket, signature, timestamp
- 第一篇博客
- [after reading the series of must know] one of how to realize app automation without programming (preparation)
猜你喜欢
Ueeditor internationalization configuration, supporting Chinese and English switching
MySQL23-存储引擎
实现微信公众号H5消息推送的超级详细步骤
【C语言】深度剖析数据存储的底层原理
16 medical registration system_ [order by appointment]
MySQL31-MySQL事务日志
Security design verification of API interface: ticket, signature, timestamp
该不会还有人不懂用C语言写扫雷游戏吧
Pytoch LSTM implementation process (visual version)
Implement sending post request with form data parameter
随机推荐
CSDN-NLP:基于技能树和弱监督学习的博文难度等级分类 (一)
Solution to the problem of cross domain inaccessibility of Chrome browser
February 13, 2022 - Maximum subarray and
ZABBIX introduction and installation
MySQL27-索引優化與查詢優化
基于Pytorch肺部感染识别案例(采用ResNet网络结构)
Water and rain condition monitoring reservoir water and rain condition online monitoring
MySQL36-数据库备份与恢复
API learning of OpenGL (2002) smooth flat of glsl
Mysql34 other database logs
[unity] simulate jelly effect (with collision) -- tutorial on using jellysprites plug-in
MySQL30-事务基础知识
MySQL21-用户与权限管理
API learning of OpenGL (2004) gl_ TEXTURE_ MIN_ FILTER GL_ TEXTURE_ MAG_ FILTER
Good blog good material record link
16 medical registration system_ [order by appointment]
In fact, the implementation of current limiting is not complicated
软件测试工程师必备之软技能:结构化思维
Isn't there anyone who doesn't know how to write mine sweeping games in C language
MySQL real battle optimization expert 11 starts with the addition, deletion and modification of data. Review the status of buffer pool in the database