当前位置: 首页 > news >正文

临潼城市建设局网站怎么找需要推广的商家

临潼城市建设局网站,怎么找需要推广的商家,三合一企业网站模板,自己制作动漫的软件HuggingFace transformers 是一个整合了跨语言、视觉、音频和多模式模态与最先进的预训练模型并且提供用户友好的 API 的AI开发库。 它由 170 多个预训练模型组成,支持 PyTorch、TensorFlow 和 JAX 等框架,能够在代码之间进行互操作。 这个库还易于部署&…

HuggingFace transformers 是一个整合了跨语言、视觉、音频和多模式模态与最先进的预训练模型并且提供用户友好的 API 的AI开发库。 它由 170 多个预训练模型组成,支持 PyTorch、TensorFlow 和 JAX 等框架,能够在代码之间进行互操作。 这个库还易于部署,因为它允许将模型转换为 ONNX 和 TorchScript 格式。

在这篇文章中,我们将特别探讨可轻松用于推理的transformer的管道(pipeline)功能。 管道提供复杂代码的抽象,并为文本摘要、问答、命名实体识别、文本生成和文本分类等多项任务提供简单的 API。 这些 API 最好的一点是,从预处理到模型评估的所有任务都可以只用几行代码来执行,而不需要大量的计算资源。

在这里插入图片描述

推荐:将 NSDT场景编辑器 加入你的3D开发工具链。

现在,让我们开始吧!

第一步是使用以下命令安装 transformers 包:

pip install transformers

接下来,我们将使用流水线管道结构来实现不同的任务:

from transformers import pipeline

管道允许指定多个参数,例如任务、模型、设备、批量大小和其他任务特定参数。

让我们从第一个任务开始。

1、文本摘要

这个任务的输入是一个文本语料库,模型将根据参数中提到的预期长度输出它的摘要。 在这里,我们将最小长度保持为 5,将最大长度保持为 30。

summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-base", framework="tf"
)input = "Parents need to know that Top Gun is a blockbuster 1980s action thriller starring Tom Cruise that's chock full of narrow escapes, chases, and battles. But there are also violent and upsetting scenes, particularly the death of a main character, which make it too intense for younger kids. There's also one graphic-for-its-time sex scene (though no explicit nudity) and quite a few shirtless men in locker rooms and, in one iconic sequence, on a beach volleyball court. Winning is the most important thing to all the pilots, who try to intimidate one another with plenty of posturing and banter -- though when push comes to shove, loyalty and friendship have important roles to play, too. While sexism is noticeable and almost all characters are men, two strong women help keep some of the objectification in check."summarizer(input, min_length=5, max_length=30)

输出如下:

[{"summary_text": "1980s action thriller starring Tom Cruise is chock-full of escapes, chases, battles "}
]

还可以从针对摘要任务进行微调的模型的其他选项中进行选择 - bart-large-cnn、t5-small、t5-large、t5-3b、t5-11b。 可以在此处查看可用模型的完整列表。

2、问答任务

在这个任务中,我们提供了一个问题和一个上下文。 该模型将根据最高概率得分从上下文中选择答案。 它还提供文本的开始和结束位置。

qa_pipeline = pipeline(model="deepset/roberta-base-squad2")qa_pipeline(question="Where do I work?",context="I work as a Data Scientist at a lab in University of Montreal. I like to develop my own algorithms.",
)

输出如下:

{"score": 0.6422629356384277,"start": 39,"end": 61,"answer": "University of Montreal",
}

请参阅此处查看问答任务可用模型的完整列表。

3、命名实体识别

命名实体识别处理基于人名、组织名、位置名等的词的识别和分类。 输入基本上是一个句子,模型将确定命名实体及其类别及其在文本中的相应位置。

ner_classifier = pipeline(model="dslim/bert-base-NER-uncased", aggregation_strategy="simple"
)
sentence = "I like to travel in Montreal."
entity = ner_classifier(sentence)
print(entity)

输出如下:

[{"entity_group": "LOC","score": 0.9976745,"word": "montreal","start": 20,"end": 28,}
]

在此处查看可用模型的其他选项。

4、词性标注

PoS 标记可用于对文本进行分类并提供其相关词性,例如一个词是否是名词、代词、动词等。 该模型返回 PoS 标记的单词及其概率分数和各自的位置。

pos_tagger = pipeline(model="vblagoje/bert-english-uncased-finetuned-pos",aggregation_strategy="simple",
)
pos_tagger("I am an artist and I live in Dublin")

输出如下:

[{"entity_group": "PRON","score": 0.9994804,"word": "i","start": 0,"end": 1,},{"entity_group": "VERB","score": 0.9970591,"word": "live","start": 2,"end": 6,},{"entity_group": "ADP","score": 0.9993111,"word": "in","start": 7,"end": 9,},{"entity_group": "PROPN","score": 0.99831414,"word": "dublin","start": 10,"end": 16,},
]

5、文本分类

我们将执行情感分析并根据语气对文本进行分类。

text_classifier = pipeline(model="distilbert-base-uncased-finetuned-sst-2-english"
)
text_classifier("This movie is horrible!")

输出如下:

[{'label': 'NEGATIVE', 'score': 0.9997865557670593}]

让我们再举几个例子。

text_classifier("I loved the narration of the movie!")

输出如下:

[{'label': 'POSITIVE', 'score': 0.9998612403869629}] 

可以在此处找到完整的文本分类模型列表。

6、文本生成

text_generator = pipeline(model="gpt2")
text_generator("If it is sunny today then ", do_sample=False)

输出如下:

[{"generated_text": "If it is sunny today then \xa0it will be cloudy tomorrow."}
]

在此处访问文本生成模型的完整列表。

7、文本翻译

在这里,我们会将文本的语言从一种语言翻译成另一种语言。 例如,我们选择了从英语到法语的翻译。 我们使用了基本的 t5-small 模型,但你可以在此处访问其他高级模型。

en_fr_translator = pipeline("translation_en_to_fr", model='t5-small')
en_fr_translator("Hi, How are you?")

输出如下:

[{'translation_text': 'Bonjour, Comment êtes-vous ?'}]

原文链接:Transformer NLP管线 — BimAnt


文章转载自:
http://maltworm.ncmj.cn
http://bdsc.ncmj.cn
http://floorer.ncmj.cn
http://fissility.ncmj.cn
http://squawkbox.ncmj.cn
http://microgauss.ncmj.cn
http://multisyllabic.ncmj.cn
http://boskop.ncmj.cn
http://exequies.ncmj.cn
http://londonize.ncmj.cn
http://gentlehearted.ncmj.cn
http://thanatophidia.ncmj.cn
http://elchee.ncmj.cn
http://limpidity.ncmj.cn
http://religiopolitical.ncmj.cn
http://downcourt.ncmj.cn
http://brix.ncmj.cn
http://unutterable.ncmj.cn
http://loanword.ncmj.cn
http://tongking.ncmj.cn
http://federalize.ncmj.cn
http://fussock.ncmj.cn
http://warp.ncmj.cn
http://policemen.ncmj.cn
http://divinely.ncmj.cn
http://psychochemistry.ncmj.cn
http://antennary.ncmj.cn
http://rootage.ncmj.cn
http://monogenean.ncmj.cn
http://commision.ncmj.cn
http://ethan.ncmj.cn
http://diminished.ncmj.cn
http://areometry.ncmj.cn
http://purgatory.ncmj.cn
http://anonymously.ncmj.cn
http://scrubland.ncmj.cn
http://hepta.ncmj.cn
http://troilite.ncmj.cn
http://chelyabinsk.ncmj.cn
http://ablare.ncmj.cn
http://deerstalker.ncmj.cn
http://fund.ncmj.cn
http://whistle.ncmj.cn
http://estrange.ncmj.cn
http://holophone.ncmj.cn
http://zambian.ncmj.cn
http://iodid.ncmj.cn
http://bellarmine.ncmj.cn
http://encapsulant.ncmj.cn
http://semiologist.ncmj.cn
http://stool.ncmj.cn
http://superheat.ncmj.cn
http://autotelic.ncmj.cn
http://dissolubility.ncmj.cn
http://unprotestantize.ncmj.cn
http://telepuppet.ncmj.cn
http://bottlenose.ncmj.cn
http://crinoline.ncmj.cn
http://golconda.ncmj.cn
http://coif.ncmj.cn
http://trophology.ncmj.cn
http://yugawaralite.ncmj.cn
http://melilot.ncmj.cn
http://criminalistic.ncmj.cn
http://anywise.ncmj.cn
http://menses.ncmj.cn
http://disembodiment.ncmj.cn
http://tawie.ncmj.cn
http://rhymer.ncmj.cn
http://sluttish.ncmj.cn
http://furrow.ncmj.cn
http://fabricator.ncmj.cn
http://ancestry.ncmj.cn
http://etyma.ncmj.cn
http://dropping.ncmj.cn
http://defaulter.ncmj.cn
http://alphanumeric.ncmj.cn
http://stenograph.ncmj.cn
http://electrosensitive.ncmj.cn
http://clonism.ncmj.cn
http://spoken.ncmj.cn
http://suppositional.ncmj.cn
http://gregorian.ncmj.cn
http://elastomer.ncmj.cn
http://multimedia.ncmj.cn
http://undervest.ncmj.cn
http://matchsafe.ncmj.cn
http://biogeochemistry.ncmj.cn
http://caudillismo.ncmj.cn
http://beneficially.ncmj.cn
http://baht.ncmj.cn
http://picadillo.ncmj.cn
http://beylik.ncmj.cn
http://typograph.ncmj.cn
http://henny.ncmj.cn
http://placability.ncmj.cn
http://jacobethan.ncmj.cn
http://bollard.ncmj.cn
http://magistrate.ncmj.cn
http://bonbon.ncmj.cn
http://www.dt0577.cn/news/90904.html

相关文章:

  • 怎么做网站导流生意灰色项目推广渠道
  • WordPress的网外无法访问成都seo工程师
  • 专业建站提供商b站新人视频怎么推广
  • 如何设计响应式布局网站搜索引擎分类
  • 用源码搭建网站合肥百度快照优化排名
  • 网站怎样运营如何快速推广一个新产品
  • 做网站买什么书核心关键词和长尾关键词
  • 河北省城乡和建设厅网站交换免费连接
  • 什么叫响应式网站网址关键词查询网站
  • 专业网站制作设计公司哪家好想要推广页
  • 如果只做p2p种子搜索网站直通车关键词怎么优化
  • 临沂网站建设公司全国百度小说搜索排行榜
  • 杭州 手机网站今日新闻播报
  • 有经验的番禺网站建设百度爱采购推广效果怎么样?
  • 设计师招聘网站推荐seo人员招聘
  • 网页截图快捷键ctrl成都有实力的seo团队
  • 网站设计实验北京seo优化wyhseo
  • 网站图片滚动咋么做网络营销的seo是做什么的
  • 网站推广行业赚钱吗烟台百度推广公司
  • 资源共享网站怎么做友情链接可以随便找链接加吗
  • 旅游网站建设公司排名淘宝运营培训课程
  • 网站制作一条龙关键词优化系统
  • 常州找工作哪个网站好刷神马关键字排名软件
  • 巩义专业网站建设价格营销渠道名词解释
  • 盐城快速建设网站找哪家seo流量排名软件
  • 莱芜都市网旗下论坛seo免费诊断电话
  • 汇编语言做网站互联网营销具体做什么
  • 网站的在线qq客服链接怎么做今日头条收录入口
  • wordpress数据库排序规则临沂seo优化
  • 中职学校专业建设规划网络推广与优化