文字到文字模型
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. |
返回
| 譯文 | 文字 |
- 所屬發行版
- 元編程(專業版)
- 可用的圖種類
- 資料流 函數 事件 例程 藍圖 狀態機狀態
- 宣告於
- 文字到文字模型
- 所屬包
- 機器學習