Browse Source

refine README (#169)

tags/v0.1.0
KevinHuSh 1 year ago
parent
commit
05298d5626
No account linked to committer's email address
4 changed files with 19 additions and 3 deletions
  1. 14
    0
      README.md
  2. 2
    1
      api/apps/llm_app.py
  3. 1
    1
      api/db/services/common_service.py
  4. 2
    1
      rag/nlp/query.py

+ 14
- 0
README.md View File

## 🤺RagFlow vs. other RAG applications ## 🤺RagFlow vs. other RAG applications
| Feature | RagFlow | Langchain-Chatchat | Dify.AI | Assistants API | QAnythig | LangChain |
|---------|:---------:|:----------------:|:-----------:|:-----------:|:-----------:|:-----------:|
| **Well-Founded Answer** | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| **Trackable Chunking** | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| **Chunking Method** | Rich Variety | Naive | Naive | Naive | Naive | Naive |
| **Table Structure Recognition** | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| **Structured Data Lookup** | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |
| **Programming Approach** | API-oriented | API-oriented | API-oriented | API-oriented | API-oriented | Python Code-oriented |
| **RAG Engine** | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| **Prompt IDE** | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: |
| **Supported LLMs** | Rich Variety | Rich Variety | Rich Variety | OpenAI-only | QwenLLM | Rich Variety |
| **Local Deployment** | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: |
| **Ecosystem Strategy** | Open Source | Open Source | Open Source | Close Source | Open Source | Open Source |
## 🔎 System Architecture ## 🔎 System Architecture
<div align="center" style="margin-top:20px;margin-bottom:20px;"> <div align="center" style="margin-top:20px;margin-bottom:20px;">

+ 2
- 1
api/apps/llm_app.py View File

return get_data_error_result(retmsg=msg) return get_data_error_result(retmsg=msg)
llm = { llm = {
"api_key": req["api_key"]
"api_key": req["api_key"],
"api_base": req.get("base_url", "")
} }
for n in ["model_type", "llm_name"]: for n in ["model_type", "llm_name"]:
if n in req: if n in req:

+ 1
- 1
api/db/services/common_service.py View File

@DB.connection_context() @DB.connection_context()
def filter_update(cls, filters, update_data): def filter_update(cls, filters, update_data):
with DB.atomic(): with DB.atomic():
cls.model.update(update_data).where(*filters).execute()
return cls.model.update(update_data).where(*filters).execute()
@staticmethod @staticmethod
def cut_list(tar_list, n): def cut_list(tar_list, n):

+ 2
- 1
rag/nlp/query.py View File

# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-


import json import json
import math
import re import re
import logging import logging
import copy import copy
#d = 1e-9 #d = 1e-9
# for k, v in dtwt.items(): # for k, v in dtwt.items():
# d += v * v # d += v * v
return s / q # math.sqrt(q) / math.sqrt(d)
return s / q / max(1, math.sqrt(math.log10(max(len(qtwt.keys()), len(dtwt.keys())))))# math.sqrt(q) / math.sqrt(d)

Loading…
Cancel
Save