MaartenGr / MaartenGr/KeyBERT

LangChain Deprecation Warning

Open
#259 5 comments 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

/keybert/llm/_langchain.py:102: LangChainDeprecationWarning: The method Chain.run was deprecated in langchain 0.1.0 and will be removed in 1.0. Use :meth:~invoke instead.
keywords = self.chain.run(input_documents=[input_document], question=self.prompt).strip()

the code

from langchain.chains.question_answering import load_qa_chain

chain = load_qa_chain(model)

from keybert.llm import LangChain
from keybert import KeyLLM

# Create your LLM
llm = LangChain(chain)

# Load it in KeyLLM
kw_model = KeyLLM(llm)

# Extract keywords
keywords = kw_model.extract_keywords(document)

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

Start in keybert/llm/_langchain.py at line 102 and reproduce the warning with the LangChain example shown in the issue. Update the deprecated Chain.run usage to the documented invoke approach, then rerun the example and confirm the deprecation warning is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.