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

苏州吴中区专业做网站国内好的seo网站

苏州吴中区专业做网站,国内好的seo网站,网站制作公司杭州,网页网站设计公司pipline是Huggingface的一个基本工具#xff0c;可以理解为一个端到端(end-to-end)的一键调用Transformer模型的工具。它具备了数据预处理、模型处理、模型输出后处理等步骤#xff0c;可以直接输入原始数据#xff0c;给出预测结果#xff0c;十分方便。 1.文本分类 fro…pipline是Huggingface的一个基本工具可以理解为一个端到端(end-to-end)的一键调用Transformer模型的工具。它具备了数据预处理、模型处理、模型输出后处理等步骤可以直接输入原始数据给出预测结果十分方便。 1.文本分类 from transformers import pipeline #文本分类 classifier pipeline(sentiment-analysis) result classifier(I hate you)[0] print(result) result classifier(I love you)[0] print(result) {label: NEGATIVE, score: 0.9991129040718079} {label: POSITIVE, score: 0.9998656511306763} 2.文本翻译 from transformers import pipeline #翻译为德语 translator pipeline(translation_en_to_de) sentence Hugging Face is a technology company based in New York and Paris translator(sentence, max_length40) [{translation_text: Hugging Face ist ein Technologieunternehmen mit Sitz in New York und Paris.}] 3.文本生成 from transformers import pipeline #文本生成 text_generator pipeline(text-generation) text_generator(As far as I am concerned, I will,max_length50,do_sampleFalse) [{generated_text: As far as I am concerned, I will be the first to admit that I am not a fan of the idea of a free market. I think that the idea of a free market is a bit of a stretch. I think that the idea}] 4.完形填空 from transformers import pipeline #完形填空 unmasker pipeline(fill-mask) sentence HuggingFace is creating a mask that the community uses to solve NLP tasks. unmasker(sentence) [{score: 0.17927546799182892, token: 3944, token_str: tool, sequence: HuggingFace is creating a tool that the community uses to solve NLP tasks.}, {score: 0.1134939193725586, token: 7208, token_str: framework, sequence: HuggingFace is creating a framework that the community uses to solve NLP tasks.}, {score: 0.052435602992773056, token: 5560, token_str: library, sequence: HuggingFace is creating a library that the community uses to solve NLP tasks.}, {score: 0.034935541450977325, token: 8503, token_str: database, sequence: HuggingFace is creating a database that the community uses to solve NLP tasks.}, {score: 0.028602560982108116, token: 17715, token_str: prototype, sequence: HuggingFace is creating a prototype that the community uses to solve NLP tasks.}] 5.阅读理解 from transformers import pipeline #阅读理解 question_answerer pipeline(question-answering) context r Extractive Question Answering is the task of extracting an answer from a text given a question. An example of a question answering dataset is the SQuAD dataset, which is entirely based on that task. If you would like to fine-tune a model on a SQuAD task, you may leverage the examples/pytorch/question-answering/run_squad.py script.result question_answerer(questionWhat is extractive question answering?,contextcontext) print(result) result question_answerer(questionWhat is a good example of a question answering dataset?,contextcontext) print(result) {score: 0.6177281141281128, start: 34, end: 95, answer: the task of extracting an answer from a text given a question} {score: 0.5152307152748108, start: 148, end: 161, answer: SQuAD dataset} 6.命名实体识别 from transformers import pipeline #命名实体识别 ner_pipe pipeline(ner) sequence Hugging Face Inc. is a company based in New York City. Its headquarters are in DUMBO, therefore very close to the Manhattan Bridge which is visible from the window. for entity in ner_pipe(sequence):print(entity) {entity: I-ORG, score: 0.99957865, index: 1, word: Hu, start: 0, end: 2} {entity: I-ORG, score: 0.9909764, index: 2, word: ##gging, start: 2, end: 7} {entity: I-ORG, score: 0.9982224, index: 3, word: Face, start: 8, end: 12} {entity: I-ORG, score: 0.9994879, index: 4, word: Inc, start: 13, end: 16} {entity: I-LOC, score: 0.9994344, index: 11, word: New, start: 40, end: 43} {entity: I-LOC, score: 0.99931955, index: 12, word: York, start: 44, end: 48} {entity: I-LOC, score: 0.9993794, index: 13, word: City, start: 49, end: 53} {entity: I-LOC, score: 0.98625815, index: 19, word: D, start: 79, end: 80} {entity: I-LOC, score: 0.95142686, index: 20, word: ##UM, start: 80, end: 82} {entity: I-LOC, score: 0.9336589, index: 21, word: ##BO, start: 82, end: 84} {entity: I-LOC, score: 0.9761654, index: 28, word: Manhattan, start: 114, end: 123} {entity: I-LOC, score: 0.9914629, index: 29, word: Bridge, start: 124, end: 130}
http://www.pierceye.com/news/541042/

相关文章:

  • windows搭建php网站推荐商城网站建设
  • php网站开发门槛高吗网络推广网站推广
  • 网站推广的8种方法微信怎么开创公众号
  • 大鹏外贸网站建设海口网站网站建设
  • 手表东莞网站建设技术支持信创网站
  • 中小企业为什么要建网站wordpress特效 插件推荐
  • 好的门户网站龙南建设局网站
  • 深圳住房和建设局官网网站设计导航精选最好的设计网站大全
  • 个人备案网站建设方案书网站开发实训教程
  • 周口网站关键词优化重庆招商网
  • 国内优秀网站设计师江西宜春市城市建设档案馆网站
  • 怎么查看网站用的php还是.networdpress博客页修改
  • 企业查询网站wordpress注册没反应
  • 如何建立自已的购物网站长沙网站制作主要公司
  • 深圳 电子政务网站建设方案WordPress的login在哪里改
  • 网站快速网站推广怎么制作图片视频和配音乐
  • 河南网站制作团队湖南网址大全
  • 2019为网站网站做代理被判缓刑网站信息化建设建议
  • 部署推进网站建设网站域名费用
  • 企业信息门户网站建设方案seo网站模版
  • 谷歌有做网站建设快速建站哪里好
  • 坤和建设 网站深圳高端网站设计开发
  • 怎么做网站策划的模板如何注册咨询公司
  • 做婚恋网站投入多少钱php注册网站源码带数据库
  • 苏州网站建设制作方案手机上做app的软件
  • 青岛营销型网站html网页制作期末作业
  • 加强网站微信公众号平台建设php 5.4 wordpress
  • 比价网站开发东莞微客巴巴做网站
  • 怎么免费搭建自己的网站交互网站建设
  • 网站架构 规划考研网站做刷词