import openai from bertopic.representation import OpenAI #promt for GPT to create topic labels prompt = """ I have a topic that contains the following documents: [DOCUMENTS] The topic is described by the following key words: [KEYWORDS] Based on the information above, extract a short topic label in the following format: topic: """ #import GPT client = openai.OpenAI(api_key='API KEY') #add GPT as representation model representation_model = OpenAI(client, model = 'gpt-3.5-turbo', exponential_backoff=True, chat=True, prompt=prompt) topic_model.update_topics(data['all_text'].tolist(), representation_model=representation_model)