Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use 'chinese_convert_mapper' ? #458

Open
3 tasks done
abchbx opened this issue Oct 22, 2024 · 4 comments
Open
3 tasks done

How to use 'chinese_convert_mapper' ? #458

abchbx opened this issue Oct 22, 2024 · 4 comments
Assignees
Labels
question Further information is requested

Comments

@abchbx
Copy link

abchbx commented Oct 22, 2024

Before Asking 在提问之前

  • I have read the README carefully. 我已经仔细阅读了 README 上的操作指引。

  • I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。

Search before asking 先搜索,再提问

  • I have searched the Data-Juicer issues and found no similar questions. 我已经在 issue列表 中搜索但是没有发现类似的问题。

Question

我尝试用 chinese_convert_mapper 将数据集https://www.modelscope.cn/datasets/Moemuu/Muice-Dataset/file/view/master?fileName=train.jsonl&id=11077&status=1 转换为繁体,

Additional 额外信息

No response

@abchbx abchbx added the question Further information is requested label Oct 22, 2024
@HYLcool
Copy link
Collaborator

HYLcool commented Oct 31, 2024

@abchbx ,感谢你的关注与使用~

如需要将中文简体文本转换为繁体,可在配置chinese_convert_mapper算子时将mode参数设置为s2t,具体支持的mode选项可参考该算子的API文档

@HYLcool HYLcool self-assigned this Oct 31, 2024
@abchbx
Copy link
Author

abchbx commented Oct 31, 2024

感谢您的回答,但是我是按照配置设置了s2t,但是生成的文本并没用转换为繁体,以下是我的参数:

@abchbx
Copy link
Author

abchbx commented Oct 31, 2024

全局参数​

project_name: 'knowledge'
dataset_path: '/mnt/workspace/zh.jsonl' # 你的数据集目录或文件的路径​
np: 8 # 处理数据集的子进程数量​​
text_keys: 'text' # 数据集文件中文本的键​
export_path: '/mnt/workspace/zh_12.jsonl' # 保存处理后数据集的路径​

Process​

一系列处理操作及其参数的列表​

process:

  • clean_email_mapper: # 从文本中移除电子邮件​
  • clean_html_mapper: # 从文本中移除HTML格式​
  • clean_ip_mapper: # 从文本中移除IP地址​
  • clean_links_mapper: # 从文本中移除网络链接​
  • clean_copyright_mapper: # 移除文本中的版权声明
  • fix_unicode_mapper:
  • remove_bibliography_mapper: # 移除文本中的参考文献
  • remove_repeat_sentences_mapper: # 移除文本中的重复句子
  • chinese_convert_mapper:
    mode: 's2t'
    lowercase: false
    ignore_special_character: true
    min_repeat_sentence_length: 30
  • remove_words_with_incorrect_substrings_mapper:
    lang: 'en'
    tokenization: false
    substrings: ['/n','cover_image','x','()']
  • remove_words_with_incorrect_substrings_mapper:
    lang: 'zh'
    tokenization: false
    substrings: ['扫码订阅杂志','全年四期优惠征订','关注公众号','复旦商业知识','转载','请后台留言','预览时标签不可点','微信扫一扫','关注该公众号','分析','收藏','都看到这儿啦,点个赞','转发给更多的人吧']
  • remove_specific_chars_mapper:
    chars_to_remove: ''

@HYLcool
Copy link
Collaborator

HYLcool commented Oct 31, 2024

注意到该数据集中包含有效文本的字段为"prompt"和"respond",因此你需要将配置文件中text_keys这个参数设为其中之一后这些算子才会对其中的字段进行处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants