mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 06:39:52 +00:00
community[patch]: small fixes to link extractors (#24528)
- **Description:** small fixes to imports / types in the link extraction work --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
parent
9e06991aae
commit
e80b0932ee
@ -6,22 +6,21 @@ from langchain_community.graph_vectorstores.extractors.hierarchy_link_extractor
|
|||||||
HierarchyInput,
|
HierarchyInput,
|
||||||
HierarchyLinkExtractor,
|
HierarchyLinkExtractor,
|
||||||
)
|
)
|
||||||
|
from langchain_community.graph_vectorstores.extractors.html_link_extractor import (
|
||||||
|
HtmlInput,
|
||||||
|
HtmlLinkExtractor,
|
||||||
|
)
|
||||||
from langchain_community.graph_vectorstores.extractors.keybert_link_extractor import (
|
from langchain_community.graph_vectorstores.extractors.keybert_link_extractor import (
|
||||||
KeybertInput,
|
KeybertInput,
|
||||||
KeybertLinkExtractor,
|
KeybertLinkExtractor,
|
||||||
)
|
)
|
||||||
|
from langchain_community.graph_vectorstores.extractors.link_extractor import (
|
||||||
from .html_link_extractor import (
|
|
||||||
HtmlInput,
|
|
||||||
HtmlLinkExtractor,
|
|
||||||
)
|
|
||||||
from .link_extractor import (
|
|
||||||
LinkExtractor,
|
LinkExtractor,
|
||||||
)
|
)
|
||||||
from .link_extractor_adapter import (
|
from langchain_community.graph_vectorstores.extractors.link_extractor_adapter import (
|
||||||
LinkExtractorAdapter,
|
LinkExtractorAdapter,
|
||||||
)
|
)
|
||||||
from .link_extractor_transformer import (
|
from langchain_community.graph_vectorstores.extractors.link_extractor_transformer import ( # noqa: E501
|
||||||
LinkExtractorTransformer,
|
LinkExtractorTransformer,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from typing import Any, Iterable, Sequence
|
from typing import Any, Sequence
|
||||||
|
|
||||||
from langchain_core.documents import Document
|
from langchain_core.documents import Document
|
||||||
from langchain_core.documents.transformers import BaseDocumentTransformer
|
from langchain_core.documents.transformers import BaseDocumentTransformer
|
||||||
@ -21,7 +21,7 @@ class LinkExtractorTransformer(BaseDocumentTransformer):
|
|||||||
extract_links.transform_documents(docs)
|
extract_links.transform_documents(docs)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, link_extractors: Iterable[LinkExtractor[Document]]):
|
def __init__(self, link_extractors: Sequence[LinkExtractor[Document]]):
|
||||||
"""Create a DocumentTransformer which adds extracted links to each document."""
|
"""Create a DocumentTransformer which adds extracted links to each document."""
|
||||||
self.link_extractors = link_extractors
|
self.link_extractors = link_extractors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user