diff --git a/keybert/llm/_langchain.py b/keybert/llm/_langchain.py index 4741c8ce..db7a6654 100644 --- a/keybert/llm/_langchain.py +++ b/keybert/llm/_langchain.py @@ -97,7 +97,7 @@ def extract_keywords(self, documents: List[str], candidate_keywords: List[List[s if candidates is not None: prompt = prompt.replace("[CANDIDATES]", ", ".join(candidates)) input_document = Document(page_content=document) - keywords = self.chain.run(input_documents=input_document, question=self.prompt).strip() + keywords = self.chain.run(input_documents=[input_document], question=self.prompt).strip() keywords = [keyword.strip() for keyword in keywords.split(",")] all_keywords.append(keywords)