承接 textualization/ropherta 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

textualization/ropherta

最新稳定版本:v0.0.11

Composer 安装命令:

composer require textualization/ropherta

包简介

Compute RoBERTa embeddings using ONNX framework.

README 文档

README

This brings the power of Transformers to the PHP world.

Installation

Add this project to your dependencies

composer require textualization/ropherta
composer update

Before using it, you will need to install the ONNX framework:

composer exec -- php -r "require 'vendor/autoload.php'; OnnxRuntime\Vendor::check();"

and download the RoBERTa ONNX model (this takes a while, the model is 477Mb in size):

composer exec -- php -r "require 'vendor/autoload.php'; Textualization\Ropherta\Vendor::check();"

Computing embeddings

$model = new RophertaModel();

$emb = $model->embeddings("Text");

Check \Textualization\Ropherta\Distances to check whether two embeddings are closer to each other.

Using custom embeddings

$model = new RophertaModel("/path/to/model.onnx");
$emb = $model->embeddings("Text");

To fine-tune a model you will need a large amount of in-domain text and use Python in a machine with a GPU. See tuning for details.

Sponsors

We thank our sponsor:

统计信息

  • 总下载量: 99
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-08