Skip to content

Commit

Permalink
v0.8.2 (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenGr authored Sep 29, 2023
1 parent 3a76899 commit e02f83b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ hide:
- navigation
---

## **Version 0.8.2**
*Release date: 29 September, 2023*

* Fixed cuda error when using pre-calculated embeddings with `KeyBERT` + `KeyLLM`

## **Version 0.8.1**
*Release date: 29 September, 2023*

Expand Down
2 changes: 1 addition & 1 deletion keybert/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from keybert._llm import KeyLLM
from keybert._model import KeyBERT

__version__ = "0.8.1"
__version__ = "0.8.2"
6 changes: 4 additions & 2 deletions keybert/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,16 @@ def extract_keywords(

# Fine-tune keywords using an LLM
if self.llm is not None:
import torch
doc_embeddings = torch.from_numpy(doc_embeddings).float().to("cuda")
if isinstance(all_keywords[0], tuple):
candidate_keywords = [[keyword[0] for keyword in all_keywords]]
else:
candidate_keywords = [[keyword[0] for keyword in keywords] for keywords in all_keywords]
keywords = self.llm.extract_keywords(
docs,
docs,
embeddings=doc_embeddings,
candidate_keywords=candidate_keywords,
candidate_keywords=candidate_keywords,
threshold=threshold
)
return keywords
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
setup(
name="keybert",
packages=find_packages(exclude=["notebooks", "docs"]),
version="0.8.1",
version="0.8.2",
author="Maarten Grootendorst",
author_email="[email protected]",
description="KeyBERT performs keyword extraction with state-of-the-art transformer models.",
Expand Down

0 comments on commit e02f83b

Please sign in to comment.