当前位置:网站首页>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等领域的同仁、老师和专家能够提供宝贵的建议,谢谢!
边栏推荐
- [leectode 2022.2.13] maximum number of "balloons"
- [reading notes] rewards efficient and privacy preserving federated deep learning
- CSDN-NLP:基于技能树和弱监督学习的博文难度等级分类 (一)
- A necessary soft skill for Software Test Engineers: structured thinking
- Global and Chinese market of operational amplifier 2022-2028: Research Report on technology, participants, trends, market size and share
- [C language] deeply analyze the underlying principle of data storage
- MySQL的存储引擎
- How to make shell script executable
- Use xtrabackup for MySQL database physical backup
- Global and Chinese markets of static transfer switches (STS) 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
MySQL transaction log
A necessary soft skill for Software Test Engineers: structured thinking
Adaptive Bezier curve network for real-time end-to-end text recognition
Not registered via @enableconfigurationproperties, marked (@configurationproperties use)
软件测试工程师必备之软技能:结构化思维
MySQL 20 MySQL data directory
CSDN-NLP:基于技能树和弱监督学习的博文难度等级分类 (一)
Valentine's Day is coming, are you still worried about eating dog food? Teach you to make a confession wall hand in hand. Express your love to the person you want
Mysql25 index creation and design principles
MySQL real battle optimization expert 11 starts with the addition, deletion and modification of data. Review the status of buffer pool in the database
随机推荐
Super detailed steps to implement Wechat public number H5 Message push
Anaconda3 installation CV2
[after reading the series] how to realize app automation without programming (automatically start Kwai APP)
① BOKE
MySQL learning diary (II)
软件测试工程师必备之软技能:结构化思维
What is the difference between TCP and UDP?
软件测试工程师发展规划路线
Not registered via @enableconfigurationproperties, marked (@configurationproperties use)
[paper reading notes] - cryptographic analysis of short RSA secret exponents
使用OVF Tool工具从Esxi 6.7中导出虚拟机
[reading notes] rewards efficient and privacy preserving federated deep learning
Nanny hand-in-hand teaches you to write Gobang in C language
MySQL26-性能分析工具的使用
Time in TCP state_ The role of wait?
MySQL18-MySQL8其它新特性
好博客好资料记录链接
Security design verification of API interface: ticket, signature, timestamp
Implement context manager through with
15 medical registration system_ [appointment registration]