gpt-academic72 / docs /README_EN.md
qingxu99's picture
move files
294ac33
|
raw
history blame
16.8 kB

ChatGPT Academic Optimization

Note

This English readme is automatically generated by the markdown translation plugin in this project, and may not be 100% correct.

If you like this project, please give it a star. If you have come up with more useful academic shortcuts or functional plugins, feel free to open an issue or pull request (to the dev branch).

Note

  1. Please note that only function plugins (buttons) marked in red support reading files, and some plugins are located in the dropdown menu in the plugin area. Additionally, we welcome and process PRs for any new plugins with the highest priority!

  2. The functions of each file in this project are detailed in the self-translation report self_analysis.md. With the version iteration, you can click on a relevant function plugin at any time to call GPT to regenerate the self-analysis report for the project. Commonly asked questions are summarized in the wiki.

  3. If you are not used to the function, comments or interface with some Chinese names, you can click on the relevant function plugin at any time to call ChatGPT to generate the source code of the project in English.

Function Description
One-click refinement Supports one-click refinement, one-click searching for grammatical errors in papers.
One-click translation between Chinese and English One-click translation between Chinese and English.
One-click code interpretation Can correctly display and interpret the code.
Custom shortcuts Supports custom shortcuts.
Configure proxy server Supports configuring proxy server.
Modular design Supports custom high-order experimental features and [function plug-ins], and plug-ins support hot update.
Self-program analysis [Function Plug-in] One-Key Understanding the source code of this project.
Program analysis [Function Plug-in] One-click can analyze other Python/C/C++/Java/Golang/Lua/Rect project trees.
Read papers [Function Plug-in] One-click reads the full text of a latex paper and generates an abstract.
Latex full-text translation/refinement [Function Plug-in] One-click translates or refines a latex paper.
Batch annotation generation [Function Plug-in] One-click generates function annotations in batches.
Chat analysis report generation [Function Plug-in] Automatically generate summary reports after running.
Arxiv assistant [Function Plug-in] Enter the arxiv paper url and you can translate the abstract and download the PDF with one click.
PDF paper full-text translation function [Function Plug-in] Extract title and abstract of PDF papers + translate full text (multi-threaded).
Google Scholar integration assistant (Version>=2.45) [Function Plug-in] Given any Google Scholar search page URL, let GPT help you choose interesting articles.
Formula display Can simultaneously display the tex form and rendering form of formulas.
Image display Can display images in Markdown.
Multithreaded function plug-in support Supports multi-threaded calling of chatgpt, one-click processing of massive texts or programs.
Support for markdown tables output by GPT Can output markdown tables that support GPT.
Start dark gradio theme theme Add /?__dark-theme=true to the browser URL to switch to the dark theme.
Huggingface free scientific online experience](https://huggingface.co/spaces/qingxu98/gpt-academic) After logging in to Huggingface, copy this space.
Mixed support for multiple LLM models (v3.0 branch in testing) It must feel great to be served by both ChatGPT and Tsinghua ChatGLM!
Compatible with TGUI to access more language models Access to opt-1.3b, galactica-1.3b and other models (v3.0 branch under testing).
...
  • New interface (modify the LAYOUT option in config.py to switch between "left and right layout" and "up and down layout").

  • All buttons are dynamically generated by reading functional.py, and custom functions can be added freely, freeing up the clipboard.

  • Refinement/Correction

  • Supports markdown tables output by GPT.

  • If the output contains formulas, both the tex form and the rendering form are displayed simultaneously for easy copying and reading.

  • Don't want to read project code? Let chatgpt boast about the whole project.

  • Multiple large language models mixed calling. (v3.0 branch in testing)

Running Directly (Windows, Linux or MacOS)

1. Download the Project

git clone https://github.com/binary-husky/chatgpt_academic.git
cd chatgpt_academic

2. Configure API_KEY and Proxy Settings

In config.py, configure the overseas Proxy and OpenAI API KEY, as follows:

1. If you are in China, you need to set an overseas proxy to use the OpenAI API smoothly. Please read the instructions in config.py carefully (1. Modify the USE_PROXY to True; 2. Modify the proxies according to the instructions).
2. Configure OpenAI API KEY. You need to register on the OpenAI official website and obtain an API KEY. Once you get the API KEY, configure it in the config.py file.
3. Issues related to proxy network (network timeout, proxy not working) are summarized to https://github.com/binary-husky/chatgpt_academic/issues/1

(Note: When the program is running, it will first check whether there is a private configuration file named config_private.py, and use the configuration in it to overwrite the same name configuration in config.py. Therefore, if you can understand our configuration reading logic, we strongly recommend that you create a new configuration file next to config.py named config_private.py and transfer (copy) the configuration in config.py to config_private.py. config_private.py is not managed by Git, which can make your privacy information more secure.)

3. Install Dependencies

# (Option 1) Recommended
python -m pip install -r requirements.txt   

# (Option 2) If you use anaconda, the steps are also similar:
# (Option 2.1) conda create -n gptac_venv python=3.11
# (Option 2.2) conda activate gptac_venv
# (Option 2.3) python -m pip install -r requirements.txt

# Note: Use the official pip source or the Ali pip source. Other pip sources (such as some university pips) may have problems. Temporary substitution method:
# python -m pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

4. Run

python main.py

5. Test Experimental Features

- Test C++ Project Header Analysis
    In the input area, enter `./crazy_functions/test_project/cpp/libJPG` , and then click "[Experiment] Parse the entire C++ project (input inputs the root path of the project)"
- Test Writing Abstracts for Latex Projects
    In the input area, enter `./crazy_functions/test_project/latex/attention` , and then click "[Experiment] Read the tex paper and write an abstract (input inputs the root path of the project)"
- Test Python Project Analysis
    In the input area, enter `./crazy_functions/test_project/python/dqn` , and then click "[Experiment] Parse the entire py project (input inputs the root path of the project)"
- Test Self-code Interpretation
    Click "[Experiment] Please analyze and deconstruct this project itself"
- Test Experimental Function Template (asking GPT what happened in history today), you can implement more complex functions based on this template function
    Click "[Experiment] Experimental function template"

Use Docker (Linux)

# Download Project
git clone https://github.com/binary-husky/chatgpt_academic.git
cd chatgpt_academic
# Configure Overseas Proxy and OpenAI API KEY
Configure config.py with any text editor
# Installation
docker build -t gpt-academic .
# Run
docker run --rm -it --net=host gpt-academic

# Test Experimental Features
## Test Self-code Interpretation
Click "[Experiment] Please analyze and deconstruct this project itself"
## Test Experimental Function Template (asking GPT what happened in history today), you can implement more complex functions based on this template function
Click "[Experiment] Experimental function template"
## (Please note that when running in docker, you need to pay extra attention to file access rights issues of the program.)
## Test C++ Project Header Analysis
In the input area, enter ./crazy_functions/test_project/cpp/libJPG , and then click "[Experiment] Parse the entire C++ project (input inputs the root path of the project)"
## Test Writing Abstracts for Latex Projects
In the input area, enter ./crazy_functions/test_project/latex/attention , and then click "[Experiment] Read the tex paper and write an abstract (input inputs the root path of the project)"
## Test Python Project Analysis
In the input area, enter ./crazy_functions/test_project/python/dqn , and then click "[Experiment] Parse the entire py project (input inputs the root path of the project)"

Other Deployment Methods

Customizing New Convenient Buttons (Academic Shortcut Key Customization)

Open functional.py and add the entry as follows, and then restart the program. (If the button has been successfully added and is visible, both the prefix and suffix support hot modification and take effect without restarting the program.)

For example,

"Super English to Chinese Translation": {

    # Prefix, which will be added before your input. For example, it is used to describe your requirements, such as translation, code interpretation, polishing, etc.
    "Prefix": "Please translate the following content into Chinese, and then use a markdown table to explain each proprietary term in the text:\n\n", 
    
    # Suffix, which will be added after your input. For example, in conjunction with the prefix, you can bracket your input in quotes.
    "Suffix": "",
    
},

If you invent a more user-friendly academic shortcut key, welcome to post an issue or pull request!

Configure Proxy

Method 1: General Method

Modify the port and proxy software corresponding in config.py

After configuring, you can use the following command to test whether the proxy works. If everything is normal, the code below will output the location of your proxy server:

python check_proxy.py

Method Two: Pure Beginner Tutorial

Pure Beginner Tutorial

Compatibility Testing

Image Display:

If the program can read and analyze itself:

Any other Python/Cpp project analysis:

Latex paper reading comprehension and abstract generation with one click

Automatic Report Generation

Modular Function Design

Translating source code to English

Todo and Version Planning:

  • version 3 (Todo):
    • Support for gpt4 and other llm
  • version 2.4+ (Todo):
    • Summary of long text and token overflow problems in large project source code
    • Implementation of project packaging and deployment
    • Function plugin parameter interface optimization
    • Self-updating
  • version 2.4: (1) Added PDF full-text translation function; (2) Added input area switching function; (3) Added vertical layout option; (4) Optimized multi-threaded function plugin.
  • version 2.3: Enhanced multi-threaded interactivity
  • version 2.2: Function plug-in supports hot reloading
  • version 2.1: Collapsible layout
  • version 2.0: Introduction of modular function plugins
  • version 1.0: Basic functions

References and Learning

The code refers to the design of many other excellent projects, mainly including:

# Reference Project 1: Referenced the method of reading OpenAI json, recording historical inquiry records, and using gradio queue in ChuanhuChatGPT
https://github.com/GaiZhenbiao/ChuanhuChatGPT

# Reference Project 2:
https://github.com/THUDM/ChatGLM-6B