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

做相亲网站的安全责任百度seo sem

做相亲网站的安全责任,百度seo sem,徐州旅游的网站建设,尚一网常德论坛pytorch-textregression,中文文本回归实践,支持多值输出 pytorch-textregression是一个以pytorch和transformers为基础,专注于中文文本回归的轻量级自然语言处理工具,支持多值回归等。 目录 数据使用方式paper参考 项目地址 py…

pytorch-textregression,中文文本回归实践,支持多值输出

pytorch-textregression是一个以pytorch和transformers为基础,专注于中文文本回归的轻量级自然语言处理工具,支持多值回归等。

目录

  • 数据
  • 使用方式
  • paper
  • 参考

项目地址

  • pytorch-textregression: https://github.com/yongzhuo/Pytorch-NLU/tree/main/pytorch_nlu/pytorch_textregression

数据格式

1. 文本回归  (txt格式, 每行为一个json):1.1 单个得分格式:
{"text": "你安静!", "label": [1]}
{"text": "斗牛场是多么欢乐阿!", "label": [1]}
{"text": "今天你不必做作业。", "label": [0]}
{"text": "他醒来时,几乎无法说话。", "label": [0]}
{"text": "在那天边隐约闪亮的不就是黄河?", "label": [1]}1.2 多个得分格式:
{"text": "你安静!", "label": [1,0]}
{"text": "斗牛场是多么欢乐阿!", "label": [1,0]}
{"text": "今天你不必做作业。", "label": [0,0]}
{"text": "他醒来时,几乎无法说话。", "label": [0,0]}
{"text": "在那天边隐约闪亮的不就是黄河?", "label": [1,0]}

使用方式

更多样例sample详情见test/tr目录

训练  python tet_tr_base_train.py
预测  python tet_tr_base_predict.py
    1. 需要配置好预训练模型目录, 即变量 pretrained_model_dir、pretrained_model_name_or_path、idx等;
    1. 需要配置好自己的语料地址, 即字典 model_config[“path_train”]、model_config[“path_dev”]
    1. cd到该脚本目录下运行普通的命令行即可, 例如: python trRun.py , python trPredict.py

文本回归(TR), Text-Regression

# 适配linux
import platform
import json
import sys
import os
path_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../.."))
path_sys = os.path.join(path_root, "pytorch_nlu", "pytorch_textregression")
sys.path.append(path_sys)
print(path_root)
# 分类下的引入, pytorch_textclassification
from trConfig import model_config
from trTools import get_current_time# 训练-验证语料地址, 可以只输入训练地址
path_corpus = path_root + "/corpus/text_regression/negative_sentence"
path_train = os.path.join(path_corpus, "train.json")
path_dev = os.path.join(path_corpus, "dev.json")
model_config["evaluate_steps"] = evaluate_steps  # 评估步数
model_config["save_steps"] = save_steps  # 存储步数
model_config["path_train"] = path_train
model_config["path_dev"] = path_dev# 预训练模型适配的classmodel_type = ["BERT", "ERNIE", "BERT_WWM", "ALBERT", "ROBERTA", "XLNET", "ELECTRA"]pretrained_model_name_or_path = {"BERT_WWM":  "hfl/chinese-bert-wwm-ext","ROBERTA":  "hfl/chinese-roberta-wwm-ext","ALBERT":  "uer/albert-base-chinese-cluecorpussmall","XLNET":  "hfl/chinese-xlnet-mid","ERNIE":  "nghuyong/ernie-1.0-base-zh",# "ERNIE": "nghuyong/ernie-3.0-base-zh","BERT":  "bert-base-chinese",# "BERT": "hfl/chinese-macbert-base",}
idx = 1  # 选择的预训练模型类型---model_type
model_config["pretrained_model_name_or_path"] = pretrained_model_name_or_path[model_type[idx]]
model_config["model_save_path"] = "../output/text_regression/model_{}".format(model_type[idx])
model_config["model_type"] = model_type[idx]# os.environ["CUDA_VISIBLE_DEVICES"] = str(model_config["CUDA_VISIBLE_DEVICES"])# main
lc = TextRegression(model_config)
lc.process()
lc.train()

Reference

For citing this work, you can refer to the present GitHub project. For example, with BibTeX:

@software{Pytorch-NLU,url = {https://github.com/yongzhuo/Pytorch-NLU},author = {Yongzhuo Mo},title = {Pytorch-NLU},year = {2021}

*希望对你有所帮助!

http://www.yidumall.com/news/97799.html

相关文章:

  • 用vs session做网站网站排名怎么做上去
  • 陕西西安网站建设公司哪家好百度seo软件
  • 免费做网站的网址有哪些如何在百度上发布自己的文章
  • 假怀孕单子在线制作图片windows优化大师是自带的吗
  • 广州做网站 信科网络cms自助建站系统
  • 西安网站建设系统开发搜索引擎排行榜
  • 网站开发的五个阶段网络推广经验
  • 沈阳大十字街附近做网站公司百度推广代理商利润
  • wordpress 安装ftp九幺seo工具
  • 中文网站模板免费下载和业务多一样的平台
  • 带音乐网站模板活动软文怎么写
  • 哈尔滨网站推广服务中国唯一没有疫情的地方
  • 有没有做羞羞事的网站广东seo价格是多少钱
  • 济南做网站要多少钱武汉网站优化
  • 加盟推广公司如何优化网站推广
  • 在线聊天网站怎么做搜索引擎排名竞价
  • 长沙做网站的搜索引擎优化实验报告
  • 网做 网站有哪些aso安卓优化
  • 奉贤做网站制作杭州网站建设技术支持
  • 百度网盘怎样做网站发布悬赏任务的推广平台
  • 兼职网站编辑怎么做百度关键词点击价格查询
  • 做网站一定要会ps么如何提高网站的自然排名
  • 内网域名谷歌广告优化师
  • 图片上加语音 网站开发个人网页制作完整教程
  • 如何做游戏推广网站石家庄seo排名公司
  • 做网站全屏尺寸是多少网页设计欣赏
  • 自己做的网站如何上传文件全国疫情防控最新数据
  • wordpress开cdn朝阳区seo搜索引擎优化怎么样
  • vs如何做网站百度免费广告发布平台
  • 程序员帮人做黑彩网站免费外链发布