MaartenGr / MaartenGr/KeyBERT

Question about splitting doc into multiple docs

Open
#262 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.2k
Forks
385
PR merge metrics
No merged PRs in 30d

Description

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?
```python
# first
kw_model = KeyBERT()
kw_model.extract_keywords(doc)

# second
kw_model = KeyBERT()

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no repository files or tests. Start by reproducing the two KeyBERT examples with a controlled document and compare their timing; document the reason for any difference and clarify when passing multiple documents provides a performance benefit.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.