Git Product home page Git Product logo

data-copilot's Introduction

Data-Copilot

Open in Spaces arXiv

Overview

Data-Copilot is a LLM-based system that help you address data-related tasks.

Data-Copilot connects data sources from different domains and diverse user tastes, with the ability to autonomously manage, process, analyze, predict, and visualize data.

Image

See our paper: Data-Copilot: Bridging Billions of Data and Humans with Autonomous Workflow, Wenqi Zhang, Yongliang Shen, Weiming Lu, Yueting Zhuang

πŸ”₯Demo video

Since gpt3.5 has only a 4k input token limit, it currently can access to Chinese stocks, funds and some economic data.

The Data-Copilot can query and predict data autonomously:

Image

Support model and data sources:

CHN Stock CHN Fund CHN Economic data CHN Financial data
Openai-GPT3.5 βœ“ βœ“ βœ“ βœ“
Azure-GPT3.5 βœ“ βœ“ βœ“ βœ“

Image

We propose Data-Copilot, an LLM-based system linking Chinese financial markets such as stock, funds, economic, financial data, and live news

  • ⭐ Data-Copilot can autonomously manage, process, analyze, predict, and visualize data. When a request is received, it transforms raw data into informative results that best match the user’s intent.

  • ⭐ Acting as a designer: Data-Copilot independently designs versatile interface tools with different functions through self-request and iterative refinement.

  • ⭐ As a dispatcher: DataCopilot adeptly invokes the corresponding interfaces sequentially or in parallel and transforms raw data from heterogeneous sources into graphics, tables, and text, without human assistance.

🌳 QuickStart

First replace openai.key and Tushare token in main.py with your personal Openai key and Tushare token. The organization of the whole project is as follows:

|-- README.md
|-- app.py
|-- create_tool
|   |-- Atomic_api_json.py
|   `-- all_atomic_api.json
|-- lab_gpt4_call.py
|-- main.py
|-- output
|-- prompt_lib
|   |-- prompt_economic.json
|   |-- prompt_financial.json
|   |-- prompt_fund.json
|   |-- prompt_intent_detection.json
|   |-- prompt_stock.json
|   |-- prompt_task.json
|   `-- prompt_visualization.json
|-- requirements.txt
|-- tool.py
|-- tool_lib
|   |-- atomic_api.json
|   |-- tool_backup.json
|   |-- tool_economic.json
|   |-- tool_financial.json
|   |-- tool_fund.json
|   |-- tool_stock.json
|   `-- tool_visualization.json

app.py is the file to start gradio. main.py is the processing flow of interface scheduling, and lab_gpt4_call.py is the file to call the GPT35 model. The tool_lib and tool.py contain the interface tools obtained after the first phase of interface design. The folder prompt_lib contains the design of the prompt and the in context demonstration.

Requirements

pip install -r requirements.txt

Then run the following command:

For Local

python main.py

Remember to fill in the key of Openai and Tushare token before running the code In main.py for Openai-key

openai_key = os.getenv("OPENAI_KEY")

In tool.py for Tushare token

tushare_token = os.getenv('TUSHARE_TOKEN')
pro = ts.pro_api(tushare_token)

For Gradio

The Gradio demo is now hosted on Hugging Face Space. You can also run the following commands to start the demo locally:

python app.py

🌿 How to play

You can try our Data-Copilot for Chinese financial markets in Hugging Face Space:

Open in Spaces It has access to Chinese stocks, funds and some economic data. But because gpt3.5 only has 4k input token length, the current data access is still relatively small. In the future, data-copilot will support more data from foreign financial markets.

  • Step 1 Enter your Openai or Openai-Azure key, please try to use openai's paid API. If you plan to use azure's services, please remember to input both api-base and engine, except for key.
  • Step 2 Click the OK button to submit
  • Step 3 Enter the request you want to query in the text box, or select a question directly from the example box and it will appear in the text box.
  • Step 4 Click the Start button to submit the request
  • Step 5 Data-Copilot will display the intermediate scheduling process in the Solving Step, and the final will present text (Summary and Result), images and tables.

Image

🍺 Some cases

A case for Check the inflow of northbound every trading date

Image

Citation

If you find this work useful in your method, you can cite the paper as below:

@article{Data-Copilot,
    title   = {Data-Copilot: Bridging Billions of Data and Humans with Autonomous Workflow},
    author  = {Wenqi Zhang, Yongliang Shen, Weiming Lu, Yueting Zhuang},
    journal = {arXiv preprint arXiv:2306.07209},
    year    = {2023}
}

Contact

If you have any questions, please contact us by email: [email protected]

Acknowledgement

data-copilot's People

Contributors

yezhwi avatar zwq2018 avatar

Watchers

 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.