Skip to content

Commit 19f5047

Browse files
authored
docstrings: document_loaders consitency 2 (#9148)
This is Part 2. See #9139 (Part 1).
1 parent 1b58460 commit 19f5047

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+114
-144
lines changed

libs/langchain/langchain/document_loaders/hugging_face_dataset.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
"""Loads HuggingFace datasets."""
21
from typing import Iterator, List, Mapping, Optional, Sequence, Union
32

43
from langchain.docstore.document import Document
54
from langchain.document_loaders.base import BaseLoader
65

76

87
class HuggingFaceDatasetLoader(BaseLoader):
9-
"""Load Documents from the Hugging Face Hub."""
8+
"""Load from `Hugging Face Hub` datasets."""
109

1110
def __init__(
1211
self,

libs/langchain/langchain/document_loaders/ifixit.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
"""Loads iFixit data."""
21
from typing import List, Optional
32

43
import requests
@@ -11,7 +10,7 @@
1110

1211

1312
class IFixitLoader(BaseLoader):
14-
"""Load iFixit repair guides, device wikis and answers.
13+
"""Load `iFixit` repair guides, device wikis and answers.
1514
1615
iFixit is the largest, open repair community on the web. The site contains nearly
1716
100k repair manuals, 200k Questions & Answers on 42k devices, and all the data is

libs/langchain/langchain/document_loaders/image.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
"""Loads image files."""
21
from typing import List
32

43
from langchain.document_loaders.unstructured import UnstructuredFileLoader
54

65

76
class UnstructuredImageLoader(UnstructuredFileLoader):
8-
"""Loader that uses Unstructured to load PNG and JPG files.
7+
"""Load `PNG` and `JPG` files using `Unstructured`.
98
109
You can run the loader in one of two modes: "single" and "elements".
1110
If you use "single" mode, the document will be returned as a single

libs/langchain/langchain/document_loaders/image_captions.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
"""Loads image captions.
2-
3-
By default, the loader utilizes the pre-trained BLIP image captioning model.
4-
https://huggingface.co/Salesforce/blip-image-captioning-base
5-
6-
"""
71
from typing import Any, List, Tuple, Union
82

93
import requests
@@ -13,7 +7,12 @@
137

148

159
class ImageCaptionLoader(BaseLoader):
16-
"""Loads the captions of an image"""
10+
"""Load image captions.
11+
12+
By default, the loader utilizes the pre-trained
13+
Salesforce BLIP image captioning model.
14+
https://huggingface.co/Salesforce/blip-image-captioning-base
15+
"""
1716

1817
def __init__(
1918
self,

libs/langchain/langchain/document_loaders/imsdb.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
"""Loads IMSDb."""
21
from typing import List
32

43
from langchain.docstore.document import Document
54
from langchain.document_loaders.web_base import WebBaseLoader
65

76

87
class IMSDbLoader(WebBaseLoader):
9-
"""Loads IMSDb webpages."""
8+
"""Load `IMSDb` webpages."""
109

1110
def load(self) -> List[Document]:
1211
"""Load webpage."""

libs/langchain/langchain/document_loaders/iugu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
"""Loader that fetches data from IUGU"""
21
import json
32
import urllib.request
43
from typing import List, Optional
@@ -17,7 +16,7 @@
1716

1817

1918
class IuguLoader(BaseLoader):
20-
"""Loader that fetches data from IUGU."""
19+
"""Load from `IUGU`."""
2120

2221
def __init__(self, resource: str, api_token: Optional[str] = None) -> None:
2322
"""Initialize the IUGU resource.

libs/langchain/langchain/document_loaders/joplin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212

1313
class JoplinLoader(BaseLoader):
14-
"""
15-
Loader that fetches notes from Joplin.
14+
"""Load notes from `Joplin`.
1615
1716
In order to use this loader, you need to have Joplin running with the
1817
Web Clipper enabled (look for "Web Clipper" in the app settings).

libs/langchain/langchain/document_loaders/json_loader.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
"""Loads data from JSON."""
21
import json
32
from pathlib import Path
43
from typing import Any, Callable, Dict, List, Optional, Union
@@ -8,7 +7,7 @@
87

98

109
class JSONLoader(BaseLoader):
11-
"""Loads a JSON file using a jq schema.
10+
"""Load a `JSON` file using a `jq` schema.
1211
1312
Example:
1413
[{"text": ...}, {"text": ...}, {"text": ...}] -> schema = .[].text

libs/langchain/langchain/document_loaders/larksuite.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
"""Loads LarkSuite (FeiShu) document json dump."""
21
import json
32
import urllib.request
43
from typing import Any, Iterator, List
@@ -8,7 +7,7 @@
87

98

109
class LarkSuiteDocLoader(BaseLoader):
11-
"""Loads LarkSuite (FeiShu) document."""
10+
"""Load from `LarkSuite` (`FeiShu`)."""
1211

1312
def __init__(self, domain: str, access_token: str, document_id: str):
1413
"""Initialize with domain, access_token (tenant / user), and document_id.

libs/langchain/langchain/document_loaders/markdown.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
"""Loads Markdown files."""
21
from typing import List
32

43
from langchain.document_loaders.unstructured import UnstructuredFileLoader
54

65

76
class UnstructuredMarkdownLoader(UnstructuredFileLoader):
8-
"""Loader that uses Unstructured to load markdown files.
7+
"""Load `Markdown` files using `Unstructured`.
98
109
You can run the loader in one of two modes: "single" and "elements".
1110
If you use "single" mode, the document will be returned as a single

0 commit comments

Comments
 (0)