MaartenGr / MaartenGr/BERTopic

Langchain Embedding Backend

Open
#2,293 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

Feature request

The feature will create a new backend that utilizes LangChain's embedding interface to embed queries via the use of different supported LangChain models.

Motivation

As LangChain currently has an unified interface on the embedding text, which also covers some of the backends currently supported by BERTopic, it would be an interesting direction if we can have all different integrations from LangChain to be brought into BERTopic. This further expands what models that BERTopic can support and when such integration becomes mature, it may potentially help reducing the customized backend and development effort.

Appendix:
https://python.langchain.com/docs/integrations/text_embedding/

Your contribution

Will help the development of adding the Langchain backend. The implementation will take reference on OpenAI's backend(bertopic/backend/_openai.py). More than welcome to let me know if any other requirements that can help this feature.

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 reading bertopic/backend/_openai.py and the LangChain text-embedding integrations listed in the linked documentation. Compare the existing OpenAI backend with the requirements for a LangChain embedding backend, then verify that supported LangChain models can embed queries through the new integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.