对搜狗语料库进行想要格式编码的处理

1. 下载数据

搜狗语料库:http://www.sogou.com/labs/resource/cs.php,下载解压.

2. 数据编码处理

在ubuntu环境下,编写一个sh文件:

find ./ -type f -name "*.txt"|while read line;do
echo $line
iconv -f gb18030 -t UTF-8 $line > ${line}.utf8
mv $line ${line}.gb2312
mv ${line}.utf8 $line
done

保存为process.sh

运行:

结果为:

3. 数据清洗

reference:

https://blog.csdn.net/sgfmby1994/article/details/53436228

猜你喜欢

转载自blog.csdn.net/qq_27009517/article/details/84568754