KeybertLinkExtractor#

Beta

This feature is in beta. It is actively being worked on, so the API may change.

Extract keywords using KeyBERT <https://maartengr.github.io/KeyBERT/>.

Example

extractor = KeybertLinkExtractor()

results = extractor.extract_one(PAGE_1)
Parameters:
  • kind (str) – Kind of links to produce with this extractor.

  • embedding_model (str) – Name of the embedding model to use with KeyBERT.

  • extract_keywords_kwargs (Dict[str, Any] | None) – Keyword arguments to pass to KeyBERT’s extract_keywords method.

Methods

__init__(*[, kind, embedding_model, ...])

Extract keywords using KeyBERT <https://maartengr.github.io/KeyBERT/>.

extract_many(inputs)

Add edges from each input to the corresponding documents.

extract_one(input)

Add edges from each input to the corresponding documents.

Extract keywords using KeyBERT <https://maartengr.github.io/KeyBERT/>.

Example

extractor = KeybertLinkExtractor()

results = extractor.extract_one(PAGE_1)
Parameters:
  • kind (str) – Kind of links to produce with this extractor.

  • embedding_model (str) – Name of the embedding model to use with KeyBERT.

  • extract_keywords_kwargs (Dict[str, Any] | None) – Keyword arguments to pass to KeyBERT’s extract_keywords method.

Add edges from each input to the corresponding documents.

Parameters:

inputs (Iterable[str | Document]) – The input content to extract edges from.

Returns:

Iterable over the set of links extracted from the input.

Return type:

Iterable[Set[Link]]

Add edges from each input to the corresponding documents.

Parameters:

input (str | Document) – The input content to extract edges from.

Returns:

Set of links extracted from the input.

Return type:

Set[Link]