MaartenGr / MaartenGr/BERTopic

Issue Using OpenAI embeddings model

Open
#1,436 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.8k
Forks
920
Avg merge
22h 24m
Merged PRs (30d)
5

Description

I'm attempting to use the OpenAI text embedding "text-embedding-ada-002" for use in my BERTopic script. When using a valid OpenAI API key, and following the instructions here for OpenAI embedding use https://maartengr.github.io/BERTopic/getting_started/embeddings/embeddings.html, I get the following error:

> InvalidRequestError: '$.input' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.

When trying to use other embedding examples listed on the page, such as the HuggingFace transformers, I'm running into no issues.

I was wondering if anyone else was running into this issue, and what I might do to get this working. Thanks!

Contributor guide

Open the contributing guide

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 by reproducing the BERTopic OpenAI embedding example from the linked embeddings documentation with text-embedding-ada-002 and a valid API key, then compare it with the working HuggingFace example. Trace the embedding integration to identify why the OpenAI request produces an invalid $.input error; done means the documented OpenAI example runs successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.