tableQA icon indicating copy to clipboard operation
tableQA copied to clipboard

Integration with LangChain?

Open bborn opened this issue 2 years ago • 5 comments

Hi! This is such a cool project - wondering if you've thought at all about integrating with LangChain or writing an adapter? Is there any reason why this has to be used with BERT? Or could it also work with other models?

bborn avatar Feb 26 '23 14:02 bborn

@bborn I am pretty sure the scope of this project can go beyond using BERT-based models. What are your thoughts about integrating with LangChain? Would love to hear about it.

Best Regards.

abhijithneilabraham avatar Feb 26 '23 16:02 abhijithneilabraham

LC has a SQLDatabase chain (https://langchain.readthedocs.io/en/latest/modules/chains/examples/sqlite.html?highlight=sql) for interacting with a database in natural language, but I think this repo is quite a bit more advanced.

I think it would be cool to make tableQA available as a LangChain tool (or Chain, maybe). Seems like the main thing that would need to change is making tableQA's LLM pluggable, instead of hard coding it to use Bert.

I don't know your codebase, but maybe starting here? https://github.com/abhijithneilabraham/tableQA/blob/master/tableqa/nlp.py#L12

Maybe that could be configurable so you could just plug any llm there (see here: https://langchain.readthedocs.io/en/latest/modules/llms/getting_started.html)

(Sorry if I'm off base here)

bborn avatar Feb 26 '23 16:02 bborn

This makes a lot of sense to me! Do you think I would need extra compute for writing tests for this one? @bborn

abhijithneilabraham avatar Feb 26 '23 17:02 abhijithneilabraham

Not sure - but I think you could use this: https://langchain.readthedocs.io/en/latest/modules/llms/examples/fake_llm.html?highlight=fake%20llm to avoid racking up $$

bborn avatar Feb 26 '23 17:02 bborn

Thank You very much! I am definitely working on this if my work could be actually of use anywhere haha!

abhijithneilabraham avatar Feb 26 '23 17:02 abhijithneilabraham