logo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readme
Files and versions

Updated 6 months ago

towhee

Text Loader

author: shiyu22


Description

Text loader is used to load text file. It supports loading data from url or file path(file format as .md or .txt).


Code Example

from towhee import pipe, ops, DataCollection

p = (
    pipe.input('url')
        .map('url', 'text', ops.text_loader())
        .output('url', 'text')
    )

res = p('https://github.com/towhee-io/towhee/blob/main/README.md')
DataCollection(res).show()
result


Factory Constructor

Create the operator via the following factory method

towhee.text_loader()


Interface

The operator load the documentation, then split incoming the text and return chunks.

Parameters:

data_src: str

​ Path or url of the document to be loaded.

Return: str

String data with the text.

More Resources

Jael Gu 0412fe94d2 Add more resources 12 Commits
file-icon .gitattributes
1.1 KiB
download-icon
Initial commit 2 years ago
file-icon README.md
3.6 KiB
download-icon
Add more resources 6 months ago
file-icon __init__.py
106 B
download-icon
Update loader 2 years ago
file-icon loader.py
1.5 KiB
download-icon
Debug failed loads 2 years ago
file-icon requirements.txt
51 B
download-icon
Install smaller unstructured 1 year ago
file-icon result.png
38 KiB
download-icon
Update loader 2 years ago