1.单一文本:
这是最简单的形式,CSV 文件仅包含一个文本列,每行代表一段文本或一句话。适用于大多数生成任务,如语言建模。text |
---|
The sun rises in the east. |
A quick brown fox jumps over the lazy dog. |
To be or not to be, that is the question. |
2.输入-输出对格式
这种格式通常用于训练条件文本生成模型,比如机器翻译、文本摘要、对话生成等。CSV 文件包含两列,一列是输入文本,另一列是目标输出文本。input_text | target_text |
---|---|
What is the capital of France? | The capital of France is Paris. |
Translate the following text to French: “Hello” | Bonjour |
Summarize the following text: “The cat sat on the mat.” | The cat sat on the mat. |
3.上下文-响应对格式
在对话生成任务中,CSV 文件可能包含多列,其中一列是上下文(对话历史或前一句),另一列是模型需要生成的响应。context | response |
---|---|
Hi, how are you? | I’m good, thank you! How about you? |
What’s the weather like today? | It’s sunny and warm today. |
Tell me a joke. | Why don’t scientists trust atoms? Because they make up everything! |
4.带有标签的文本
对于某些生成任务,如情感生成或风格迁移,数据集可能还包含标签信息,表示该文本所属的类别或风格。text | label |
---|---|
I love this movie! | positive |
I am not happy with the service. | negative |
It’s a beautiful day outside. | neutral |
5.多轮对话格式
在更复杂的对话生成任务中,CSV 文件可能包含多轮对话信息,将对话历史和当前轮次的输入分开存储。history | current_input | target_output |
---|---|---|
Hi, how are you? | What’s your name? | My name is ChatGPT. |
What’s your name? My name is ChatGPT. | What do you do? | I am an AI language model developed by OpenAI. |
I’m fine, thanks. How can I assist you? | What’s the capital of Japan? | The capital of Japan is Tokyo. |
6.带有元素数据的文本
在某些情况下,文本生成任务可能还涉及元数据,例如日期、作者、文章标题等。date | author | title | content |
---|---|---|---|
2024-01-01 | John Doe | New Year Celebrations | The new year was celebrated with much joy. |
2024-02-14 | Jane Smith | Valentine’s Day History | Valentine’s Day is a celebration of love. |
2024-03-01 | Alice | Technology Trends in 2024 | In 2024, AI continues to dominate the tech landscape. |
7.多标签文本格式
对于多任务或多标签生成任务,CSV 文件可能包含多列,每列代表一个需要生成的标签或文本。text | tag1 | tag2 | tag3 |
---|---|---|---|
The quick brown fox jumps over the lazy dog. | animal | action | story |
The capital of France is Paris. | geography | fact | trivia |
8.总结
-
单一文本列: 适用于简单的语言模型。
-
输入-输出对格式: 适用于条件文本生成任务。
-
上下文-响应对格式: 适用于对话生成任务。
-
带有标签的文本: 适用于分类或情感生成任务。
-
多轮对话格式: 适用于多轮对话生成。
-
带有元数据的文本: 适用于带有背景信息的文本生成任务。
-
多标签文本格式: 适用于多任务生成或分类任务。
关注公众号“CrazyNET”,获取更多资源。