Skip to content

Question about splitting doc into multiple docs #262

@Vagab

Description

@Vagab

As I understand it, passing multiple documents into KeyBERT is faster than iterating over documents while passing only one of them because each word gets embedded only once in the former approach. Does that mean that one should also see some performance benefits from splitting one huge document into multiple documents?
To provide an example, my intuition tells me the second option here should be faster. But from my tests it isn't. Shouldn't it be?

# first
kw_model = KeyBERT()
kw_model.extract_keywords(doc)

# second
kw_model = KeyBERT()

docs = split_the_doc_somehow(doc)
kw_model.extract(docs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions