当前位置:网站首页>text 文本数据增强方法 data argumentation
text 文本数据增强方法 data argumentation
2022-07-06 09:11:00 【一曲无痕奈何】
知识点:text 数据增强 data argumentation
random insertion 随机插入
random deletion 随机删除
random swap 随机交换
参考论文: EDA : Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks
Back Translation
举例: 英语 --> 中文 --> 英语
# 需要安装 : pip install google_trans_new
from google_trans_new import google_translator
translator = google_translator()
sentence = ['stay hungry, stay foolish. -- spoken / said by Steve Jobs']
# 英 --> 中
translation_cn = translator.translate(sentence, lang_tgt='zh-cn')
translation_cn
# 中 --> 英
translation_en = translator.translate(translation_cn, lang_tgt='en')
translation_en
随机选择一种语言翻译
import random
import google_trans_new
languages = list(google_trans_new.LANGUAGES.keys())
len(languages) # 可翻译的语言种类 108 种
object_lang = random.choice(languages)
object_lang
# 正向翻译
translations = translator.translate(sentence, lang_tgt=object_lang)
translations
# 反向翻译
back_trans = translator.translate(translations, lang_tgt='en')
back_trans
# 反向翻译
back_trans = translator.translate(translations, lang_tgt='en')
back_trans边栏推荐
- 软件测试工程师发展规划路线
- Configure system environment variables through bat script
- 实现微信公众号H5消息推送的超级详细步骤
- How to make shell script executable
- MySQL实战优化高手12 Buffer Pool这个内存数据结构到底长个什么样子?
- MySQL Real Time Optimization Master 04 discute de ce qu'est binlog en mettant à jour le processus d'exécution des déclarations dans le moteur de stockage InnoDB.
- Sed text processing
- Contest3145 - the 37th game of 2021 freshman individual training match_ B: Password
- MySQL实战优化高手04 借着更新语句在InnoDB存储引擎中的执行流程,聊聊binlog是什么?
- flask运维脚本(长时间运行)
猜你喜欢

C miscellaneous dynamic linked list operation

max-flow min-cut

Installation of pagoda and deployment of flask project

Target detection -- yolov2 paper intensive reading

MySQL combat optimization expert 02 in order to execute SQL statements, do you know what kind of architectural design MySQL uses?

MySQL Real Time Optimization Master 04 discute de ce qu'est binlog en mettant à jour le processus d'exécution des déclarations dans le moteur de stockage InnoDB.

Which is the better prospect for mechanical engineer or Electrical Engineer?

MySQL实战优化高手12 Buffer Pool这个内存数据结构到底长个什么样子?
![16 medical registration system_ [order by appointment]](/img/7f/d94ac2b3398bf123bc97d44499bb42.png)
16 medical registration system_ [order by appointment]

Contest3145 - the 37th game of 2021 freshman individual training match_ C: Tour guide
随机推荐
flask运维脚本(长时间运行)
Mexican SQL manual injection vulnerability test (mongodb database) problem solution
The 32 year old programmer left and was admitted by pinduoduo and foreign enterprises. After drying out his annual salary, he sighed: it's hard to choose
Pointer learning
NLP routes and resources
What is the current situation of the game industry in the Internet world?
MySQL ERROR 1040: Too many connections
Flash operation and maintenance script (running for a long time)
The programming ranking list came out in February. Is the result as you expected?
安装OpenCV时遇到的几种错误
Retention policy of RMAN backup
MySQL combat optimization expert 06 production experience: how does the production environment database of Internet companies conduct performance testing?
C杂讲 动态链表操作 再讲
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
cmooc互联网+教育
Software test engineer development planning route
14 医疗挂号系统_【阿里云OSS、用户认证与就诊人】
宝塔的安装和flask项目部署
Tianmu MVC audit I
MySQL combat optimization expert 12 what does the memory data structure buffer pool look like?