Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

About

This project implemented the matrix decomposition targetting the of Audio channel ASR corpus.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

EmbFree RAG

Python 3.8+ RAG Optional Embeddings

Emb-free Retrieval-Augmented Generation for Chinese text — built on TF-IDF, matrix topic decomposition (NMF/LDA), and extractive answer synthesis.

Repository: github.com/fooSynaptic/embfree-rag

EmbFree RAG pipeline and project structure

Left: emb-free RAG pipeline · Right: repository modules mapped to each stage

Why emb-free?

Emb-free (default) Neural embedding RAG
Dependencies scikit-learn + jieba + torch + sentence-transformers
Hardware CPU GPU recommended
Interpretability topic keywords + TF-IDF scores dense vectors
Best for ASR transcripts, broadcasts, dialogue logs semantic similarity queries

Open-source embedding models are supported as an optional adapter, not a hard requirement.

Quick start

git clone https://github.com/fooSynaptic/embfree-rag.git
cd embfree-rag
pip install -r requirements.txt
python examples/demo_rag.py --question "找不到喜欢的人怎么办?"

Web UI:

python run_server.py
# open http://127.0.0.1:5000

Python API

from src.rag import EmbFreeRAG

pipeline = EmbFreeRAG()
result = pipeline.query(
    passage=open("data/sample_passage.txt", encoding="utf-8").read(),
    question="这段对话主要在讨论什么?",
)

print(result.answer)
print(result.context)
print(result.metrics)

Architecture

EmbFree RAG overview

Details: architecture.md

Project structure

embfree-rag/
├── src/
│   ├── index.py
│   ├── retrieval.py
│   ├── rag.py
│   ├── synthesizer.py
│   ├── topic_model.py
│   └── embeddings/
├── examples/demo_rag.py
├── run_server.py
├── data/sample_passage.txt
└── docs/architecture.md

Optional neural embeddings

pip install -r requirements-embeddings.txt
from src.config import embedding_config
from src.rag import EmbFreeRAG

embedding_config.backend = "sentence-transformers"
embedding_config.model_name = "BAAI/bge-small-zh-v1.5"
embedding_config.hybrid_alpha = 0.7

pipeline = EmbFreeRAG()

HTTP API

curl -X POST http://127.0.0.1:5000/answer \
  -H "Content-Type: application/json" \
  -d '{"passage":"...", "question":"..."}'

License

MIT License

About

This project implemented the matrix decomposition targetting the of Audio channel ASR corpus.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages