ChatGPT Data Augmentation Methods for NLP
This article introduces various ChatGPT‑based data‑augmentation techniques for natural language processing, explains how to use prompts for synonym, antonym, homophone, random insertion, deletion, and swapping transformations, and provides concrete example prompts and outputs to illustrate each method.
ChatGPT Data Augmentation Methods
Data augmentation for NLP refers to using various techniques to enlarge the training dataset, thereby improving the performance and robustness of natural language processing models.
Several common augmentation methods can be applied individually or in combination, as listed below:
Synonym replacement: replace certain words with their synonyms, e.g., replace "good" with "excellent".
Random insertion: randomly insert words or phrases into the text, e.g., add "sometimes" or "usually".
Random deletion: randomly delete words or phrases, e.g., remove determiners or adjectives.
Random swapping: swap adjacent words or phrases, e.g., change "I love chocolate" to "I chocolate love".
Text synthesis: combine different sentences or paragraphs to generate new text.
Noise addition: introduce spelling or lexical errors.
In ChatGPT, the following prompt can achieve similar functionality:
Random synonym replacement for words in a sentence;
Random antonym replacement for words in a sentence;
Random homophone replacement for words in a sentence;
Random typo replacement for words in a sentence;
Random position swapping for words in a sentence;
Generate sentences with meanings similar to the original;
Translate the sentence to English, then to German, and finally back to Chinese.
When using the prompt, pay attention to:
The transformation methods required;
The granularity of transformation (character or word level);
The number of transformations (how many sentences to generate).
ChatGPT Data Augmentation Cases
Text Generation
Input to ChatGPT:
对每个句子进行改写,输出2份和他含义相近的。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
请问13号是否还有从双鸭山到淮阴的汽车票?
有没有13号从双鸭山到淮阴的汽车票?
2.
随便放一首阁楼里的佛里专辑里的歌曲。
播放阁楼里的佛里专辑中的一首歌曲。
3.
帮我找一下S686在团队竞技中挑战的游戏视频。
我想观看S686在团队竞技中挑战的游戏视频。Back‑Translation
Input to ChatGPT:
对下面的每个句子进行翻译为英文,然后翻译为德语,然后翻译为中文。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
英文:Is there still a bus ticket from Shuangyashan to Huaiyin on the 13th?
德语:Ist noch ein Busticket von Shuangyashan nach Huaiyin am 13. verfügbar?
中文:还有从双鸭山到淮阴的巴士票吗,日期是13号的?
英文:Play a random song by Buddha in the album Attic.
德语:Spiel ein zufälliges Lied von Buddha im Album Attic ab.
中文:随机播放《阁楼》专辑里的佛里的歌曲。
英文:I want to watch a game video of playing two s686s in Mutation Team Battle.
德语:Ich möchte ein Spielvideo sehen, in dem zwei s686 im Mutation Team Battle gespielt werden.
中文:我想观看在《绝地求生》突变团队竞技模式中使用两把S686进行挑战的游戏视频。Synonym Replacement
Input to ChatGPT:
对下面的每个句子中的单词进行同义词替换,分别替换生成3个句子。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
还有双鸭山到淮阴的巴士票吗13号的
还有双鸭山到淮阴的交通票吗13号的
2.
随便播放一首专辑阁楼里的佛里的音乐
随便播放一首专辑阁楼里的佛里的曲子
3.
我想看挑战两把s686打突变团竞的游戏影片
我想看挑战两把s686打突变团竞的游戏录像Random Deletion
Input to ChatGPT:
对下面的每个句子中的单词进行随机删除,分别生成2个句子。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
还有淮阴的汽车票吗13号的
还有到淮阴的汽车票吗13号的
2.
随便播放一首专辑佛里的歌
随便播放阁楼里的佛里的歌
3.
我想看两把s686打突变竞的游戏视频
我想看挑战s686打团竞的游戏视频Random Insertion
Input to ChatGPT:
对下面的每个句子中的随机添加一些单词,分别生成2个句子。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
还有双鸭山到淮阴的绿色的便宜的汽车票吗13号的吗?
还有双鸭山到淮阴的汽车站的窗口买13号的票可以吗?
2.
随便播放一首专辑阁楼里的佛里的经典老歌吧。
可以在阁楼里专辑里随意挑选一首佛里的歌曲播放。
3.
我想看挑战两把s686打突变团竞的游戏视频,请给我找一些最好的。
你能给我推荐一些s686在突变团竞中的挑战视频吗?Random Swapping
Input to ChatGPT:
对下面的每个句子中的单词进行随机交换,分别生成2个句子。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
汽车票的双鸭山还有到淮阴13号吗?
淮阴到双鸭山还有13号的汽车票吗?
2.
随便里播放阁一首专辑佛楼的歌
一首随便播放阁楼里的佛专辑的歌
3.
两把s686打挑战想我看突变团竞的游戏视频
突变团竞的游戏视频我想看挑战两把s686打Typo Replacement
Input to ChatGPT:
对下面的每个句子中的字进行替换为错别字,分别生成2个句子。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
还有双鸭衫到淮阴的汽车票吗13号的
还有双鸭山到淮阴的汽车飘吗13号的
2.
随便剖开一首专辑阁楼里的佛里的歌
随便波动一首专辑阁楼里的佛里的歌
3.
我想看挑战两把s686打突遍团竞的游戏视频
我想看挑战两把s686打突变团警的游戏视频Homophone Replacement
Input to ChatGPT:
对下面的每个句子中单词随机替换为同音词,分别生成2个句子。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
还有数鸭山道淮阴的汽车票吗13号的
还有双雅闪达淮音的汽车票吗13号的
2.
随便播放一首专辑阁楼里的佛里的歌
随便播放一首专辑隔楼里的佛理的狗
3.
我想看挑战两把S686打突变团竞的游戏视频
我想看挑战两把S686打图变团精的游戏视频Antonym Replacement
Input to ChatGPT:
对下面的每个句子中单词随机替换为反义词,分别生成2个句子。
1. 还有双鸭山到淮阴的汽车票吗13号的
2. 随便播放一首专辑阁楼里的佛里的歌
3. 我想看挑战两把s686打突变团竞的游戏视频ChatGPT output:
1.
还有深圳到上海的航班票吗3号的
没有长春到南京的高铁票吗12号的
2.
随便静音一张单曲酒馆内的死寂的诗
随便跳舞一首专辑森林里的飞蛾扑火的歌
3.
我想玩坚持一把p92打突变模式的游戏视频
我不想看放弃两把akm打团队模式的游戏视频Usage Notes
Through multiple experiments we found that ChatGPT is not good at complex or combined data augmentation; the generated results are often poor.
For each augmentation method, the speed of ChatGPT output also varies significantly. For example, inserting synonyms or antonyms is relatively slow, while random word replacement is fast.
ChatGPT is essentially a GPT model that excels at text generation. Using ChatGPT to generate similar sentences can increase the accuracy of classification models.
Sohu Tech Products
A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.