Open shashnkvats opened 2 months ago
Ah, it seems that the documentation should be updated. When you use the latest version of OpenAI (older versions are not supported since the major API changes), you can run it as follows:
import openai
from keybert.llm import OpenAI
from keybert import KeyLLM
# Create your LLM
client = openai.OpenAI(api_key=MY_API_KEY)
llm = OpenAI(client)
# Load it in KeyLLM
kw_model = KeyLLM(llm)
# Extract keywords
document = "The website mentions that it only takes a couple of days to deliver but I still have not received mine."
keywords = kw_model.extract_keywords(document)
I was trying to implement the code below that was provided in the documentation
when I got the error,
Is it because only the older version of Openai is supported?