-
Clawling อาจเป็นเรื่องยากเนื่องจากปัญหาบางอย่างของเว็บไซต์ นอกจากนี้โปรดพิจารณาตัวเลือกอื่นเช่นการใช้ไฟล์ที่เปิดเผยต่อสาธารณะตามความเสี่ยงของคุณเอง
ตัวอย่างเช่น,
และกระดาษโดย Jack Bandy และ Nicholas Vincent ก็มีค่าสำหรับการทำความเข้าใจว่า "Bookcorpus" และการทำซ้ำนั้นรวมถึงข้อบกพร่องหลายประการ
-
นี่คือสคริปต์เพื่อทำซ้ำ Bookcorpus ด้วยตัวเอง
Bookcorpus เป็นคลังข้อความขนาดใหญ่ที่ได้รับความนิยมโดยเฉพาะอย่างยิ่งสำหรับการเรียนรู้ที่ไม่ได้รับการดูแลเกี่ยวกับการเข้ารหัส/ถอดรหัสประโยค อย่างไรก็ตาม Bookcorpus ไม่ได้แจกจ่ายอีกต่อไป ...
ที่เก็บนี้รวมถึงตัวรวบรวมข้อมูลรวบรวมข้อมูลจาก smashwords.com ซึ่งเป็นแหล่งดั้งเดิมของ Bookcorpus ประโยคที่รวบรวมอาจ แตกต่างกัน บางส่วน แต่จำนวนของเขาจะมีขนาดใหญ่กว่าหรือเกือบจะเหมือนกัน หากคุณใช้คลังข้อมูลใหม่ในงานของคุณโปรดระบุว่าเป็นแบบจำลอง
เตรียม URL ของหนังสือที่มีอยู่ อย่างไรก็ตามที่เก็บนี้มีรายการเป็น url_list.jsonl ซึ่งเป็นภาพรวม I (@soskek) ที่รวบรวมเมื่อวันที่ 19-20 มกราคม 2019 คุณสามารถใช้งานได้หากคุณต้องการ
python -u download_list.py > url_list.jsonl &
ดาวน์โหลดไฟล์ของพวกเขา การดาวน์โหลดจะดำเนินการสำหรับไฟล์ txt ถ้าเป็นไปได้ มิฉะนั้นสิ่งนี้จะพยายามแยกข้อความจาก epub อาร์กิวเมนต์เพิ่มเติม --trash-bad-count ออกไฟล์ epub ที่มีจำนวนคำนั้นแตกต่างจากสถิติอย่างเป็นทางการ (เพราะอาจหมายถึงความล้มเหลวบางอย่าง)
python download_files.py --list url_list.jsonl --out out_txts --trash-bad-count
ผลลัพธ์จะถูกบันทึกลงในไดเรกทอรีของ --out (ที่นี่ out_txts )
สร้างข้อความที่ต่อกันด้วยรูปแบบประโยคต่อบรรทัด
python make_sentlines.py out_txts > all.txt
หากคุณต้องการที่จะโทเค็นเป็นคำที่แบ่งส่วนโดย blingfire ของ Microsoft ให้เรียกใช้ด้านล่าง คุณสามารถใช้ตัวเลือกอื่นสำหรับสิ่งนี้ด้วยตัวเอง
python make_sentlines.py out_txts | python tokenize_sentlines.py > all.tokenized.txt
ตัวอย่างเช่นคุณสามารถอ้างถึงเงื่อนไขของ smashwords.com โปรดใช้รหัสอย่างรับผิดชอบและปฏิบัติตามกฎหมายลิขสิทธิ์และกฎหมายที่เกี่ยวข้อง ฉันไม่รับผิดชอบต่อการลอกเลียนแบบหรือความหมายทางกฎหมายที่เพิ่มขึ้นอันเป็นผลมาจากที่เก็บนี้
pip install -r requirements.txt
Failed: epub and txt File is not a zip file หรือ Failed to open แต่จำนวนความล้มเหลวจะน้อยกว่าหนึ่งความสำเร็จ ไม่ต้องกังวล. epub2txt.py ได้รับและแก้ไขจาก https://github.com/kevinxiong/epub2txt/blob/master/epub2txt.py
หากคุณพบว่ารหัสนี้มีประโยชน์โปรดอ้างอิงด้วย URL
@misc{soskkobayashi2018bookcorpus,
author = {Sosuke Kobayashi},
title = {Homemade BookCorpus},
howpublished = {url{https://github.com/soskek/bookcorpus}},
year = {2018}
}
นอกจากนี้เอกสารต้นฉบับที่ทำให้หนังสือเล่มดั้งเดิมมีดังนี้:
Yukun Zhu, Ryan Kiros, Richard Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, Sanja Fidler "จัดตำแหน่งหนังสือและภาพยนตร์: ไปสู่คำอธิบายภาพเหมือนเรื่องราวโดยดูภาพยนตร์และอ่านหนังสือ" arxiv preprint arxiv: 1506.06724, ICCV 2015
@InProceedings{Zhu_2015_ICCV,
title = {Aligning Books and Movies: Towards Story-Like Visual Explanations by Watching Movies and Reading Books},
author = {Zhu, Yukun and Kiros, Ryan and Zemel, Rich and Salakhutdinov, Ruslan and Urtasun, Raquel and Torralba, Antonio and Fidler, Sanja},
booktitle = {The IEEE International Conference on Computer Vision (ICCV)},
month = {December},
year = {2015}
}
@inproceedings{moviebook,
title = {Aligning Books and Movies: Towards Story-like Visual Explanations by Watching Movies and Reading Books},
author = {Yukun Zhu and Ryan Kiros and Richard Zemel and Ruslan Salakhutdinov and Raquel Urtasun and Antonio Torralba and Sanja Fidler},
booktitle = {arXiv preprint arXiv:1506.06724},
year = {2015}
}
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urtasun และ Sanja Fidler "เวกเตอร์ที่ข้ามความคิด" arxiv preprint arxiv: 1506.06726, NIPS 2015
@article{kiros2015skip,
title={Skip-Thought Vectors},
author={Kiros, Ryan and Zhu, Yukun and Salakhutdinov, Ruslan and Zemel, Richard S and Torralba, Antonio and Urtasun, Raquel and Fidler, Sanja},
journal={arXiv preprint arXiv:1506.06726},
year={2015}
}