小米 pegasus

PEGASUS stands for Pre-training with Extracted Gap-sentences for Abstractive SUmmarization Sequence-to-sequence models. It uses self-supervised objective Gap Sentences Generation (GSG) to train a transformer encoder-decoder model. The paper can be found on arXiv. In this article, we will only focus on generating state of the art abstractive summaries using Google’s Pegasus library.

PEGASUS表示对于P再培训为E xtracted g接入点,句子对于A bstractive SU mmarization 小号层序对序列模型。 它使用自我监督的目标间隙句生成(GSG)来训练变压器编码器-解码器模型。 可以在arXiv上找到该论文。 在本文中,我们将只专注于使用Google的Pegasus库生成最新的抽象摘要。

As of now, there is no easy way to generate the summaries using Pegasus library. However, Hugging Face is already working on implementing this and they are expecting to release it around September 2020. In the meantime, we can try to follow the steps mentioned Pegasus Github repository and explore Pegasus. So let’s get started.

到目前为止,还没有使用Pegasus库生成摘要的简便方法。 但是, Hugging Face已经在努力实现此功能,他们希望在2020年9月左右发布它。与此同时,我们可以尝试按照提到的Pegasus Github存储库中的步骤进行操作,并探索Pegasus。 因此,让我们开始吧。

This step will clone the library on GitHub, create /content/pegasus folder, and install requirements.

此步骤将在GitHub上克隆库,创建/ content / pegasus文件夹,并安装需求。

Next, follow the instructions to install gsutil. The below steps worked well for me in Colab.

接下来,按照说明安装gsutil 。 以下步骤在Colab中对我来说效果很好。

This will create a folder named ckpt under /content/pegasus/ and then download all the necessary files (fine-tuned models, vocab etc.) from Google Cloud to /content/pegasus/ckpt.

这将在/ content / pegasus /下创建一个名为ckpt的文件夹 然后将所有必要的文件(微调模型,vocab等)从Google Cloud下载到/ content / pegasus / ckpt

If all the above steps completed successfully, we see the below folder structure in Google Colab. Under each downstream dataset, we can see fine-tuned models that we can use for generating extractive/abstractive summaries.

如果上述所有步骤成功完成,我们将在Google Colab中看到以下文件夹结构。 在每个下游数据集下,我们可以看到可用于生成提取/抽象摘要的微调模型。

Though it’s not mentioned in Pegasus Github repository README instruction, below pegasus installation step is necessary otherwise you will run into errors. Also, make sure you are in root folder /content before executing this step.

尽管Pegasus Github存储库README指令中未提及,但在飞马安装步骤下面是必需的,否则您将遇到错误。 另外,在执行此步骤之前,请确保您位于根目录/ content中

Now, let us try to understand about pre-training corpus and downstream datasets of Pegasus. Pegasus is pre-trained on C4 & Hugenews corpora and it is then fine-tuned on 12 downstream datasets. The evaluation results on downstream datasets are mentioned in Github and also in the paper. Some of these datasets are extractive & some are abstractive. So the use of the dataset depends on if we are looking for extractive summaries or abstractive summaries.

现在,让我们尝试了解有关Pegasus的预训练语料库和下游数据集。 飞马座在C4Hugenews语料库上进行了预训练,然后在12个下游数据集中进行了微调。 Github和论文中都提到了对下游数据集的评估结果。 这些数据集中有些是可提取的,有些则是抽象的。 因此,数据集的使用取决于我们是在寻找提取摘要还是抽象摘要。

Once all the above steps are taken care of, we can now jump to evaluate.py step mentioned below but it will take longer to complete as it will try to make predictions on all the data which are part of the evaluation set of the respective fine-tuned dataset being used. Since we are interested in summaries of custom text or sample text, we need to make minor changes public_params.py file found under /content/pegasus/pegasus/params/public_params.py as shown below.

完成上述所有步骤后,我们现在可以跳至以下提到的evaluate.py步骤。但是,由于它将尝试对属于相应标准的评估集的所有数据进行预测,因此需要更长的时间才能完成调整后的数据集。 由于我们对自定义文本或示例文本的摘要感兴趣,因此我们需要对public_params.py下的/content/pegasus/pegasus/params/public_params.py文件进行较小的更改。 如下图所示

Here I am making changes to reddit_tifu as I am trying to use reddit_tifu dataset for generating an abstractive summary. In case if you are experimenting with aeslc or other downstream datasets you are requested to make similar changes.

我在这里对reddit_tifu进行更改 当我尝试使用reddit_tifu数据集生成抽象摘要时。 如果您正在尝试使用aeslc或其他下游数据集,则需要进行类似的更改。

Here we are passing text from this news article is inp which is then copied to inputs. Note that empty string to passed to targets as this is what we are going to predict. Then both inputs are targets are used to create tfrecord, which pegusus expects.

在这里,我们正在传递新闻文章 inp文本,然后将其复制到inputs 。 请注意,传递给targets空字符串是我们要预测的。 那么这两个inputstargets被用于创建tfrecord,这pegusus预期。

inp = ‘“replace this with text from the above this article’’’

inp ='“用本文 上方的文字 替换

As the final step, when evaluate.py is run, the model makes a prediction or generates a summary of the above news article’s text. This will generate 4 output files in the respective downstream dataset’s folder. In this case input, output, prediction and text_metric text files will be created under reddit_tifu folder.

作为最后一步,当 evaluate.py运行,该模型进行预测或生成上述新闻报道的文字摘要。 这将在相应的下游数据集的文件夹中生成4个输出文件。 在这种情况下, inputoutputpredictiontext_metric 文本文件将在reddit_tifu文件夹下创建。

Abstractive summary (prediction):“India and Afghanistan on Monday discussed the evolving security situation in the region against the backdrop of a spike in terrorist violence in the country.”

摘要摘要(预测): “印度和阿富汗周一讨论了该国恐怖活动激增的背景下该地区不断发展的安全局势。”

This looks like a very well generated abstractive summary when we compare with the news article we passed as input for generating the summary. By using different downstream datasets we can generate extractive or abstractive summaries. Also, we can play around with different parameter values and see how it changes summaries.

当我们与作为生成摘要的输入传递的新闻文章进行比较时,这看起来像是生成良好的摘要摘要。 通过使用不同的下游数据集,我们可以生成提取摘要或抽象摘要。 另外,我们可以尝试使用不同的参数值,并查看其如何更改摘要。

翻译自: https://towardsdatascience.com/generate-summaries-using-googles-pegasus-library-772633a161c2

小米 pegasus


http://www.taodudu.cc/news/show-863806.html

相关文章:

  • 数据集准备及数据预处理_1.准备数据集
  • ai模型_这就是AI的样子:用于回答问题的BiDAF模型
  • 正则化技术
  • 检测对抗样本_避免使用对抗性T恤进行检测
  • 大数据数据量估算_如何估算数据科学项目的数据收集成本
  • 为什么和平精英无响应_什么和为什么
  • 1. face_generate.py
  • cnn卷积神经网络应用_卷积神经网络(CNN):应用的核心概念
  • 使用mnist数据集_使用MNIST数据集上的t分布随机邻居嵌入(t-SNE)进行降维
  • python模型部署方法_终极开箱即用的自动化Python模型选择方法
  • 总体方差的充分统计量_R方是否衡量预测能力或统计充分性?
  • 多尺度视网膜图像增强_视网膜图像怪异的预测
  • 多元线性回归中多重共线性_多重共线性如何在线性回归中成为问题。
  • opencv 创建图像_非艺术家的图像创建(OpenCV项目演练)
  • 使用TensorFlow进行深度学习-第2部分
  • 基于bert的语义匹配_构建基于BERT的语义搜索系统…针对“星际迷航”
  • 一个数据包的旅程_如何学习数据科学并开始您的惊人旅程
  • jupyter 托管_如何在本地托管的Jupyter Notebook上进行协作
  • fitbit手表中文说明书_如何获取和分析Fitbit睡眠分数
  • 熔池 沉积_用于3D打印的AI(第2部分):异常熔池检测的一课学习
  • 机器学习 可视化_机器学习-可视化
  • 学习javascript_使用5行JavaScript进行机器学习
  • 强化学习-动态规划_强化学习-第4部分
  • 神经网络优化器的选择_神经网络:优化器选择的重要性
  • 客户细分_客户细分:K-Means聚类和A / B测试
  • 菜品三级分类_分类器的惊人替代品
  • 开关变压器绕制教程_教程:如何将变压器权重和令牌化器从AllenNLP上传到HuggingFace
  • 一般线性模型和混合线性模型_线性混合模型如何工作
  • 为什么基于数字的技术公司进行机器人研究
  • 人类视觉系统_对人类视觉系统的对抗攻击

小米 pegasus_使用Google的Pegasus库生成摘要相关推荐

  1. 小米开源分布式KV存储系统Pegasus 原创 2017-10-19 孙伟杰 InfoQ

    小米开源分布式KV存储系统Pegasus 原创  2017-10-19  孙伟杰  InfoQ 作者|孙伟杰编辑|小智小米近日开源了分布式 KV 存储系统 Pegasus,这个小米自造的轮子背后,有着 ...

  2. 【barcode】 基于Jbarcode开源库生成条形码,提供添加备注信息的解决方案

    上一篇使用google的barcode4开源库生成条码,效果还是不错的,但是由于前几天leader有个需求,条码下面要添加备注信息- 当然解决方案也可以生成两个图片拼接在一起,但是觉得不太方便,就查了 ...

  3. Web前端技巧分享:教你用GD库生成验证码

    验证码相信大家都不会陌生,在网站登录的时候经常会遇到.那么你知道这个验证码是如何实现的吗?下面小千就为大家介绍一下这个GD库,还有一些常见的图片水印也是用GD实现的哦! GD库是什么? GD库是php ...

  4. Gcc详解以及静态库、动态库生成

    [转] Gcc详解以及静态库.动态库生成 http://www.360doc.com/content/10/0619/14/1795182_33985297.shtml 1.gcc包含的c/c++编译 ...

  5. php gd库 函数 建立gif,PHP_PHP GD库生成图像的几个函数总结,使用GD库中提供的函数动态绘 - phpStudy...

    PHP GD库生成图像的几个函数总结 使用GD库中提供的函数动态绘制完成图像以后,就需要输出到浏览器或者将图像保存起来.在PHP中,可以将动态绘制完成的画布,直接生成GIF.JPEG.PNG和WBMP ...

  6. python namespace unique_Python使用uuid库生成唯一标识ID

    uuid是128位的全局唯一标识符(univeral unique identifier),通常用32位的一个字符串的形式来表现.有时也称guid(global unique identifier). ...

  7. JNI开发笔记(六)--一种更规范的so库生成方法

    一种更规范的JNI工程写法 引 前言 1. MainActivity中的两个重要的语句 2. 建立Util类来替代MainActivity 3. 在MainActivity中验证JNI工程并生成so库 ...

  8. PHP生产一个验证码图片,PHP使用GD库生成验证码图片,实现图片验证

    本文记录从php 下载配置GD图片生成库 到使用该库生成验证码图片,网页上实现验证码. 使用技术: php使用GD库绘图 [php版本7.3] php session 缓存 实现最终效果: 一. 配置 ...

  9. JAVA利用google的zxing快速生成QRCode

    利用google的zxing快速生成QRCode 1.导入jar包,如果是非maven工程就去mvnrepository.com搜索zxing,下载本jar包即可 <dependency> ...

最新文章

  1. XML--视频--人脸VOC
  2. 正常情况下ffmpeg生成moov是在mdat写完成之后写入
  3. iphone微信美颜插件_iOS13.5 插件分享
  4. 【转】Burp Suite详细使用教程-Intruder模块详解
  5. Vue列表渲染---vue工作笔记0009
  6. bootstrap 栅格系统实现类似table跨行
  7. vijos:旅行家的预算[贪心]
  8. python中文列名报错__mssql.MSSQLDatabaseException:(207,b“无效列名'Hello'。DBLib错误消息20018...
  9. NfcA/NfcB/NfcF/NfcV/IsoDep/Ndef/Mifare/Felica/Pboc/ISOxxxx 都是些什么鸟玩意?
  10. 点到线的距离计算公式
  11. 无限级分类处理成树形结构
  12. ubuntu系统下抓取屏幕
  13. aws打开慢_亚马逊AWS服务器访问较慢,如何快速访问AWS服务器呢?
  14. 微服务2——服务的注册,调用(Nacos服务注册中心+服务调用+调用负载均衡)sca-comsumersca-provider
  15. Power Apps遇到问题整理
  16. 计算机丢失GetU,u盘启动引导文件丢失如何修复
  17. 清理android根目录垃圾,寻找Android手机垃圾文件的根源
  18. linux重启 envi服务,envi 4.3在ubuntu edgy下启动错误的解决
  19. 为什么要劝退分子科学与工程?
  20. 公用网络切换为专用网络的详细步骤

热门文章

  1. php安装,PHP安装
  2. ustc linux 网络通,USTC 网络通脚本
  3. vs code html table,vs Code 快速生成代码
  4. oracle connect权限6,Oracle 19c 升级19.6 RU 导致权限异常 gipcInternalConnectSync: failed sync request 解决方法...
  5. Minimax Problem(二分+二进制状态压缩)
  6. Codeforces 1093D Beautiful Graph
  7. python 字典 内存_Python 字典(联合内存、联合数组)
  8. systemverilog数据类型
  9. c mysql 的默认值_为mysql表字段设置默认值的方法及注意细节
  10. hashtable允许null键和值吗_MySQL默认值选型是空,还是 NULL-爱可生