Skip to main content

古腾堡

Project Gutenberg 是一个免费的电子书在线图书馆。

本笔记本涵盖了如何将 Gutenberg 电子书的链接加载到我们可以在后续使用的文档格式中。

from langchain_community.document_loaders import GutenbergLoader
loader = GutenbergLoader("https://www.gutenberg.org/cache/epub/69972/pg69972.txt")
data = loader.load()
data[0].page_content[:300]
'The Project Gutenberg eBook of The changed brides, by Emma Dorothy\r\n\n\nEliza Nevitte Southworth\r\n\n\n\r\n\n\nThis eBook is for the use of anyone anywhere in the United States and\r\n\n\nmost other parts of the world at no cost and with almost no restrictions\r\n\n\nwhatsoever. You may copy it, give it away or re-u'
data[0].metadata
{'source': 'https://www.gutenberg.org/cache/epub/69972/pg69972.txt'}

相关


此页面是否有帮助?


您还可以留下详细的反馈 在 GitHub 上