Skip to content

Latest commit

 

History

History
124 lines (98 loc) · 3.37 KB

README.md

File metadata and controls

124 lines (98 loc) · 3.37 KB

Vietnamese news corpus crawler

Refer

Development

Ubuntu

apt install libcurl4-openssl-dev libssl-dev

NLTK

python
import nltk
nltk.download('punkt')
  • In terminal export 2 variables
- export CRAWLAB_COLLECTION=test_news
- export CRAWLAB_TASK_ID=random
  • Change IP in mongo uri to docker mongo IP
MONGO_URI = 'mongodb://172.19.0.3:27017'

Fix utf8 python locale

export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
sudo dpkg-reconfigure locales

remove empty line

sed '/^$/d' corpus_raw.txt > corpus.txt && rm -rf corpus_raw.txt
python dumper.py && sed '/^$/d' corpus_raw.txt > corpus.txt && rm -rf corpus_raw.txt

create index

db.getCollection('results_news').createIndex({ url: 1 })
db.getCollection('results_news').createIndex({ source: 1 })

Test write to txt

  • 179631 record in mongo ~ 2.65 minutes ~ 454M

Sites crawled

Khỏe Plus, Khỏe Plus 24h \

Kiểm Sát, Mặt Trận, Một Thế Giới, NCĐT, NLĐ, \
Nghe Nhìn VN, Nghệ An, Ngày Nay, Người Làm Báo, Người Tiêu Dùng, Người Đô Thị, Người Đưa Tin, \
Nhân Dân, Nông Nghiệp, NĐ&ĐS, PC World, PL&XH, PLO, PNNews, PNSK, PetroTimes, Pháp Luật Net, \
Pháp Luật Plus, Pháp Luật VN, Phụ Nữ VN, Quốc Hội, Quốc Hội TV, QĐND, SGGP, SGĐT, SaoStar, \
Seatimes, Sài Gòn Tiếp Thị, TBDN, TBKTSG, TG&VN, TGTT, TH&PL, TNMT, TTOL, TTXVN, Thanh Hóa, \
Thanh Niên, Thanh Tra, TheLEADER, Thương Gia, Thế Giới Trẻ, Thế Giới Xe, Tin Nhanh, Tin Thể Thao, \
Tin Tức TTXVN, Tiền Phong, TuanVietNam, Tuyên Giáo, Tuổi Trẻ TĐ, Tài Chính, Tạp chí Công thương, \
Tạp chí Xây dựng Đảng, Tạp chí cộng sản, Tổ Quốc, VEF, VNCA, VNEWS, VOV, VTC, VietQ, VietTimes, \
Vietnam Finance, VietnamNet, VietnamPlus, VnEconomy, VnMedia, Văn Hiến, Văn Hoá, XHTT, Xe Giao Thông, \
Xây Dựng Đảng, Zing, Ôtô - xe máy, Ôtô Xe Máy, ĐCSVN, ĐS&PL, ĐTCK, Đại Đoàn Kết, Đảng Cộng Sản VN, \
Đất Việt, Đấu Thầu, Đầu Tư, Đời Sống Plus