Coder Social home page Coder Social logo

centralbank-llm's Introduction

CentralBank-LLM (ChatGPT, Langchain)

Discover what top institutions really think about current economic conditions (price inflation, unemployment, interest rates). Plotly Dash App is built to extract main highlights and query latest central banking publications from:

The RAG-LLM retriever is trained to answer user prompts and generate plots exclusively using textual data downloaded directly from central banks. It also provides citations to the original publications (source, author, and page information).

Tutorial:

How to install & run the app:

  1. git clone https://github.com/viczommers/CentralBank-LLM.git
  2. change directory to cloned repository cd your-folder-path
  3. pip install -r requirements.txt
  4. python app.py
  5. open the app at http://localhost:8050/

Notes & Known Issues:

Langchain Chroma vectorstore deletion

ChromaDB is known to have issues in Streamlit/Dash apps when trying to delete collections or reset the database (if ChromaDB was used in a running callback). This behaviour results in new embeddings being appended to old db. Every Vectordb instance including as.retriever() needs to be set to None i.e. connection to Chroma terminated for the files to be released for deletion, once vectordb instance is set to None there is no way to reinitiate the database connection. This was somewhat addressed in old delete_downloads() function:

    if os.path.exists(persist_directory):
        shutil.rmtree(persist_directory, ignore_errors=True)

However, chroma.sqlite3 file will still exist and requires a Dash app restart to terminate the callback and release the file for deletion (or it can be deleted manually). The langchain.vectorstores module does not include functionality to perform client.reset() or track the collection, therefore I suggest using the chromadb library directly for similar projects. Those are the main reasons why webscraping, text splitting and embedding should be done using FastAPI backend server in MongoDB or Pinecone, and not locally.

400 Bad Request:

Frequent requests to Bank of England server will sometimes return less files than actually available due to cooldown. This can be remediated by changing IP Address or modifying the for-loop to request only reports from February, May, August, November (at expense of poentially missing emergency publications).

Interested in adding NLP tools to your proprietary strategy? Get your own pocket macro strategist today - I offer boutique services for building tailored dashboards and JSON FastAPIs from custom data sources (local virtual machine or private cloud).

Disclosures:

THIS DOCUMENT DOES NOT CONTAIN INSIDE INFORMATION FOR THE PURPOSES OF ARTICLE 7 OF THE MARKET ABUSE REGULATION (EU) 596/2014 (“MAR”). THE MATERIAL GENERATED BY THE APP IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY AND SHOULD NOT BE CONSTRUED AS INVESTMENT ADVICE OR SOLICITATION TO BUY OR SELL SECURITIES. THE MATERIAL IS NOT INTENDED TO BE USED AS A GENERAL GUIDE TO INVESTING, OR AS A SOURCE OF ANY SPECIFIC INVESTMENT RECOMMENDATIONS, AND MAKES NO IMPLIED OR EXPRESS RECOMMENDATIONS CONCERNING THE MANNER IN WHICH ANY CLIENT’S ACCOUNT SHOULD BE HANDLED.

centralbank-llm's People

Contributors

viczommers avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.