当前位置:网站首页>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等领域的同仁、老师和专家能够提供宝贵的建议,谢谢!
边栏推荐
- [C language] deeply analyze the underlying principle of data storage
- ① BOKE
- MySQL26-性能分析工具的使用
- MySQL combat optimization expert 05 production experience: how to plan the database machine configuration in the real production environment?
- Time complexity (see which sentence is executed the most times)
- Mysql24 index data structure
- Global and Chinese market of transfer switches 2022-2028: Research Report on technology, participants, trends, market size and share
- 保姆级手把手教你用C语言写三子棋
- 在jupyter NoteBook使用Pytorch进行MNIST实现
- MySQL29-数据库其它调优策略
猜你喜欢
![[after reading the series of must know] one of how to realize app automation without programming (preparation)](/img/eb/e789d88f10787c302f9457ca7ca2cc.jpg)
[after reading the series of must know] one of how to realize app automation without programming (preparation)

Bytetrack: multi object tracking by associating every detection box paper reading notes ()

How to make shell script executable

MySQL32-锁

MySQL transaction log

Download and installation of QT Creator

Adaptive Bezier curve network for real-time end-to-end text recognition

基于Pytorch的LSTM实战160万条评论情感分类

基于Pytorch肺部感染识别案例(采用ResNet网络结构)

Isn't there anyone who doesn't know how to write mine sweeping games in C language
随机推荐
MySQL33-多版本并发控制
A necessary soft skill for Software Test Engineers: structured thinking
MySQL25-索引的创建与设计原则
Not registered via @EnableConfigurationProperties, marked(@ConfigurationProperties的使用)
Emotional classification of 1.6 million comments on LSTM based on pytoch
好博客好资料记录链接
实现微信公众号H5消息推送的超级详细步骤
Typescript入门教程(B站黑马程序员)
MySQL combat optimization expert 09 production experience: how to deploy a monitoring system for a database in a production environment?
Ueeditor internationalization configuration, supporting Chinese and English switching
① BOKE
API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T
Windchill配置远程Oracle数据库连接
MySQL实战优化高手04 借着更新语句在InnoDB存储引擎中的执行流程,聊聊binlog是什么?
Global and Chinese market of thermal mixers 2022-2028: Research Report on technology, participants, trends, market size and share
Texttext data enhancement method data argument
Global and Chinese markets for aprotic solvents 2022-2028: Research Report on technology, participants, trends, market size and share
Database middleware_ MYCAT summary
MySQL combat optimization expert 04 uses the execution process of update statements in the InnoDB storage engine to talk about what binlog is?
Adaptive Bezier curve network for real-time end-to-end text recognition