文本到文本模型
4 个节点
本页内容 4
加载文本到文本模型
函数Loads a text-to-text model and its tokenizer from a Hub repository or a folder.
签名
加载文本到文本模型 -> Text To Text Model
模型: 文本
设备: Compute Device
精度: PrecisionTextToTextModel LoadTextToTextModel(
string model,
ComputeDevice device = ComputeDevice.Auto,
Precision precision = Precision.Auto)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 模型 | 文本 | — | A repository id such as google-t5/t5-small or google/flan-t5-small, or a folder. |
| 设备 | Compute Device | 自动 | Where it runs. |
| 精度 | Precision | 自动 | The number format of its weights. |
返回
| 模型 | Text To Text Model |
- 所属发行版
- 元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 文本到文本模型
- 所属包
- 机器学习
摘要
函数A shorter text saying what a longer one says.
签名
摘要 -> 文本
模型: Text To Text Model
文本: 文本
设置: Generation Settings
清理空格: 真否string Summarize(
TextToTextModel model,
string text,
GenerationSettings settings,
bool cleanUpSpaces = true)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 模型 | Text To Text Model | — | A text-to-text model trained to summarize, such as T5 or BART-CNN. |
| 文本 | 文本 | — | The text to summarize. |
| 设置 | Generation Settings | — | How it chooses its words; empty for the model's summarization settings. |
| 清理空格 | 真否 | True | Remove the spaces the tokenizer leaves before punctuation and in contractions ("building . it" becomes "building. it"), as transformers' clean_up_tokenization does; off for the text byte for byte as transformers' pipeline gives it. |
返回
| 摘要 | 文本 |
- 所属发行版
- 元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 文本到文本模型
- 所属包
- 机器学习
转换文本
函数The model's answer to a text as it is, with no task prefix: what instruction-tuned models such as Flan-T5 are asked with.
签名
转换文本 -> 文本
模型: Text To Text Model
输入: 文本
设置: Generation Settings
清理空格: 真否string TransformText(
TextToTextModel model,
string input,
GenerationSettings settings,
bool cleanUpSpaces = true)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 模型 | Text To Text Model | — | A text-to-text model. |
| 输入 | 文本 | — | The instruction or text. |
| 设置 | Generation Settings | — | How it chooses its words; empty for the model's own defaults. |
| 清理空格 | 真否 | True | Remove the spaces the tokenizer leaves before punctuation and in contractions ("building . it" becomes "building. it"), as transformers' clean_up_tokenization does; off for the text byte for byte as transformers' pipeline gives it. |
返回
| 输出 | 文本 |
- 所属发行版
- 元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 文本到文本模型
- 所属包
- 机器学习
翻译
函数Translates a text from one language to another, asked as T5 is asked: "translate English to German: ".
签名
翻译 -> 文本
模型: Text To Text Model
文本: 文本
源语言: 文本
目标语言: 文本
设置: Generation Settings
清理空格: 真否string Translate(
TextToTextModel model,
string text,
string from = "English",
string to = "German",
GenerationSettings settings,
bool cleanUpSpaces = true)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 模型 | Text To Text Model | — | A text-to-text model that translates between the two languages, such as T5 (English to German, French or Romanian) or Flan-T5. |
| 文本 | 文本 | — | The text to translate. |
| 源语言 | 文本 | English | The language it is in, in English: English, German... |
| 目标语言 | 文本 | German | The language to translate it to. |
| 设置 | Generation Settings | — | How it chooses its words; empty for the model's translation settings. |
| 清理空格 | 真否 | True | Remove the spaces the tokenizer leaves before punctuation and in contractions ("building . it" becomes "building. it"), as transformers' clean_up_tokenization does; off for the text byte for byte as transformers' pipeline gives it. |
返回
| 译文 | 文本 |
- 所属发行版
- 元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 文本到文本模型
- 所属包
- 机器学习