当前位置:网站首页>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等领域的同仁、老师和专家能够提供宝贵的建议,谢谢!
边栏推荐
- Windchill configure remote Oracle database connection
- Mysql27 index optimization and query optimization
- 16 medical registration system_ [order by appointment]
- [paper reading notes] - cryptographic analysis of short RSA secret exponents
- Mysql26 use of performance analysis tools
- MySQL learning diary (II)
- Mysql30 transaction Basics
- Download and installation of QT Creator
- MySQL30-事务基础知识
- A necessary soft skill for Software Test Engineers: structured thinking
猜你喜欢
![[Julia] exit notes - Serial](/img/d0/87f0d57ff910a666fbb67c0ae8a838.jpg)
[Julia] exit notes - Serial

Mysql28 database design specification
![[reading notes] rewards efficient and privacy preserving federated deep learning](/img/c3/5e88277b5024885d5ceeaa0de14b27.jpg)
[reading notes] rewards efficient and privacy preserving federated deep learning

MySQL23-存儲引擎

MySQL35-主从复制

Mysql27 - Optimisation des index et des requêtes

MySQL31-MySQL事务日志

实现微信公众号H5消息推送的超级详细步骤

Unicode decodeerror: 'UTF-8' codec can't decode byte 0xd0 in position 0 successfully resolved

MySQL21-用户与权限管理
随机推荐
Global and Chinese market of thermal mixers 2022-2028: Research Report on technology, participants, trends, market size and share
MySQL實戰優化高手04 借著更新語句在InnoDB存儲引擎中的執行流程,聊聊binlog是什麼?
[after reading the series of must know] one of how to realize app automation without programming (preparation)
MySQL34-其他数据库日志
MySQL20-MySQL的数据目录
Good blog good material record link
Global and Chinese markets of static transfer switches (STS) 2022-2028: Research Report on technology, participants, trends, market size and share
pytorch的Dataset的使用
Emotional classification of 1.6 million comments on LSTM based on pytoch
Mysql32 lock
基于Pytorch肺部感染识别案例(采用ResNet网络结构)
MySQL22-逻辑架构
MySQL combat optimization expert 06 production experience: how does the production environment database of Internet companies conduct performance testing?
Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)
MySQL23-存储引擎
How to make shell script executable
Anaconda3 installation CV2
[paper reading notes] - cryptographic analysis of short RSA secret exponents
Mysql27 - Optimisation des index et des requêtes
Time in TCP state_ The role of wait?