Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.5%) to scientific vocabulary
Repository
rag比赛
Basic Info
- Host: GitHub
- Owner: liuchenbaidu
- License: mit
- Language: Python
- Default Branch: main
- Size: 454 KB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
EasyRAG: Efficient Retrieval-Augmented Generation Framework for Automated Network Operations
Table of Contents
Overview
This paper presents EasyRAG, a simple, lightweight, and efficient retrieval-augmented generation framework for automated network operations. Our framework has three advantages. The first is accurate question answering. We designed a straightforward RAG scheme based on (1) a specific data processing workflow (2) dual-route sparse retrieval for coarse ranking (3) LLM Reranker for reranking (4) LLM answer generation and optimization. This approach achieved first place in the GLM4 track in the preliminary round and second place in the GLM4 track in the semifinals. The second is simple deployment. Our method primarily consists of BM25 retrieval and BGE-reranker reranking, requiring no fine-tuning of any models, occupying minimal VRAM, easy to deploy, and highly scalable; we provide a flexible code library with various search and generation strategies, facilitating custom process implementation. The last one is efficient inference. We designed an efficient inference acceleration scheme for the entire coarse ranking, reranking, and generation process that significantly reduces the inference latency of RAG while maintaining a good level of accuracy; each acceleration scheme can be plug-and-play into any component of the RAG process, consistently enhancing the efficiency of the RAG system.
Requirements
EasyRAG needs Python3.10.14 and at least 1 GPU with 16GB.
You need to change llm_keys in src/easyrag.yaml to your GLM keys.
```shell pip install -r requirements.txt git lfs install bash scripts/download.sh # download models bash scripts/process.sh # process zedx data
```
Reproduce
1. Run Directly
```bash cd src
run challenge questions
python3 main.py
copy answer file
cp submit_result.jsonl ../answer.jsonl ```
2. Run with Docker
bash
chmod +x scripts/run.sh
./scripts/run.sh
Usage
1. API
bash
cd src
uvicorn api:app --host 0.0.0.0 --port 8000 --workers 1
2.WebUI
You need to run the API first
bash
cd src
streamlit run webui.py
Project Structure
Only the code that may be used in the semi-final is explained.
yaml
- src
- custom
- splitter.py # Custom Chunk Splitter
- hierarchical.py # hierarchical Chunk Splitter
- transformation.py # File path and title extraction
- embeddings # Implement a separate embedding class for the GTE
- ...
- retrievers.py # Implementation of a qdrant-based dense retriever, Chinese BM25 retriever, implementation of a fusion retriever with rrf and simple merge
- rerankers.py # Implement some classes separately for the bge series of rerankers for easy custom use
- template.py # QA Prompt Template
- pipeline
- ingestion.py # Data processing flow: data reader, metadata extraction, document chunking, document encoding, metadata filters, vector database creation
- pipeline.py # EasyRAG Pipeline class, containing initialisation of various data and models, custom RAG Pipeline definitions
- rag.py # Some tool functions for rag
- qa.py # Read the question file and save the answer
- utils # The hf-adapted custom llm for the usage in China and is copied directly from the code in the hf link of the corresponding model.
- ...
- configs
- easyrag.yaml # configuration file
- data
- nltk_data # stop word lists and tokenizer data in nltk
- hit_stopwords.txt # HIT Chinese Stop Word List
- imgmap_filtered.json # Processed by get_ocr_data.py
- question.jsonl # Semi-Final Test Set
- main.py # Main Functions, Entry Files
- api.py # FastAPI Service
- preprocess_zedx.py # zedx data preprocessing
- get_ocr_data.py # paddleocr+glm4v extracts image content
- submit.py # Submit Results to Challenge
- requirements.txt # python requirements
- run.sh # docker run script
- Dockerfile # docker configuration file
Citation
latex
@article{feng2024easyrag,
title={EasyRAG: Efficient Retrieval-Augmented Generation Framework for Automated Network Operations},
author={Feng, Zhangchi, Kuang Dongdong, Wang Zhongyuan, Nie Zhijie, Zheng Yaowei and Zhang, Richong},
journal={arXiv preprint arXiv:2410.10315},
year={2024}
}
Acknowledgement
Thanks to the CCF AIOps 2024 Challenge Organising Committee , they provide high quality data and a good atmosphere.
Star History
Owner
- Name: Andy.liu
- Login: liuchenbaidu
- Kind: user
- Location: shenzhen.china
- Repositories: 2
- Profile: https://github.com/liuchenbaidu
Citation (CITATION.cff)
cff-version: 1.2.0
date-released: 2024-10
message: "If you use this software, please cite it as below."
authors:
- family-names: "Feng"
given-names: "Zhangchi"
- family-names: "Kuang"
given-names: "Dongdong"
- family-names: "Wang"
given-names: "Zhongyuan"
- family-names: "Nie"
given-names: "Zhijie"
- family-names: "Zheng"
given-names: "Yaowei"
- family-names: "Zhang"
given-names: "Richong"
title: "EasyRAG: Efficient Retrieval-Augmented Generation Framework for Automated Network Operations"
url: "https://arxiv.org/abs/2410.10315"
preferred-citation:
type: article
authors:
- family-names: "Feng"
given-names: "Zhangchi"
- family-names: "Kuang"
given-names: "Dongdong"
- family-names: "Wang"
given-names: "Zhongyuan"
- family-names: "Nie"
given-names: "Zhijie"
- family-names: "Zheng"
given-names: "Yaowei"
- family-names: "Zhang"
given-names: "Richong"
title: "EasyRAG: Efficient Retrieval-Augmented Generation Framework for Automated Network Operations"
journal: "CoRR"
volume: "abs/2410.10315"
year: 2024
url: "https://arxiv.org/abs/2410.10315"
eprinttype: "arXiv"
eprint: "2410.10315"
GitHub Events
Total
- Push event: 3
- Create event: 2
Last Year
- Push event: 3
- Create event: 2
Dependencies
- python 3.10.14-slim build
- accelerate ==0.31.0
- aiohttp ==3.9.4
- aiosignal ==1.3.1
- annotated-types ==0.6.0
- anyio ==4.3.0
- async-timeout ==4.0.3
- attrs ==23.2.0
- beautifulsoup4 ==4.12.3
- bm25s ==0.1.7
- certifi ==2024.2.2
- charset-normalizer ==3.3.2
- click ==8.1.7
- dataclasses-json ==0.6.4
- deprecated ==1.2.14
- dirtyjson ==1.0.8
- distro ==1.9.0
- exceptiongroup ==1.2.0
- fastapi ==0.112.0
- filelock ==3.13.4
- fire ==0.6.0
- flagembedding *
- frozenlist ==1.4.1
- fsspec ==2024.3.1
- greenlet ==3.0.3
- grpcio ==1.62.1
- grpcio-tools ==1.62.1
- h11 ==0.14.0
- h2 ==4.1.0
- hpack ==4.0.0
- html2text ==2024.2.26
- httpcore ==1.0.5
- httpx ==0.27.0
- huggingface-hub ==0.23.4
- hyperframe ==6.0.1
- idna ==3.7
- jieba ==0.42.1
- jinja2 ==3.1.3
- joblib ==1.4.0
- jsonlines ==4.0.0
- llama-index ==0.10.29
- llama-index-agent-openai ==0.2.2
- llama-index-cli ==0.1.11
- llama-index-core ==0.10.29
- llama-index-embeddings-huggingface ==0.2.0
- llama-index-embeddings-openai ==0.1.7
- llama-index-indices-managed-llama-cloud ==0.1.5
- llama-index-legacy ==0.9.48
- llama-index-llms-ollama ==0.1.2
- llama-index-llms-openai ==0.1.15
- llama-index-llms-openai-like ==0.1.3
- llama-index-multi-modal-llms-openai ==0.1.5
- llama-index-program-openai ==0.1.5
- llama-index-question-gen-openai ==0.1.3
- llama-index-readers-file ==0.1.19
- llama-index-readers-llama-parse ==0.1.4
- llama-index-retrievers-bm25 ==0.1.4
- llama-index-vector-stores-qdrant ==0.2.0
- llama-parse ==0.4.1
- llamaindex-py-client ==0.1.18
- llmlingua ==0.2.2
- lxml ==5.2.2
- markupsafe ==2.1.5
- marshmallow ==3.21.1
- minijinja ==1.0.16
- mpmath ==1.3.0
- multidict ==6.0.5
- mypy-extensions ==1.0.0
- nest-asyncio ==1.6.0
- networkx ==3.3
- nltk ==3.8.1
- numpy ==1.26.4
- openai ==1.19.0
- packaging ==24.0
- paddleocr ==2.7.0.3
- paddlepaddle-gpu ==2.6.0
- pandas ==2.2.2
- pillow ==10.3.0
- portalocker ==2.8.2
- protobuf ==4.25.3
- pydantic ==2.7.0
- pydantic-core ==2.18.1
- pypdf ==4.2.0
- python-dateutil ==2.9.0.post0
- python-dotenv ==1.0.1
- pytz ==2024.1
- pyyaml ==6.0.1
- qdrant-client ==1.8.2
- rank-bm25 ==0.2.2
- regex ==2023.12.25
- requests ==2.31.0
- safetensors ==0.4.3
- scikit-learn ==1.4.2
- scipy ==1.13.0
- sentence-transformers ==2.6.1
- setuptools ==69.5.1
- six ==1.16.0
- sniffio ==1.3.1
- soupsieve ==2.5
- sqlalchemy ==2.0.29
- streamlit ==1.37.1
- striprtf ==0.0.26
- sympy ==1.12
- tenacity ==8.2.3
- threadpoolctl ==3.4.0
- tiktoken ==0.6.0
- tokenizers ==0.19.1
- torch ==2.3.0
- torchvision ==0.18.0
- tqdm ==4.66.2
- transformers ==4.42.3
- typing-extensions ==4.11.0
- typing-inspect ==0.9.0
- tzdata ==2024.1
- urllib3 ==2.2.1
- uvicorn ==0.30.5
- wrapt ==1.16.0
- yarl ==1.9.4
- zhipuai *