-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SubgraphRAG model and example #10000
base: master
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
7bb45bf
to
caf7d7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
model file needs type defs and need to make CI green but overall looks good in principle. also please include comparison between webQSP for g_retriever.py vs subgraphrag.py
@@ -264,11 +494,17 @@ class WebQSPDataset(KGQABaseDataset): | |||
(default: :obj:`False`) | |||
use_pcst (bool, optional): Whether to preprocess the dataset's graph | |||
with PCST or return the full graphs. (default: :obj:`True`) | |||
subgraphrag (bool, optional): Whether to preprocess the dataset | |||
into the format expected by SubgraphRAG. The dataset the full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"The dataset the full..." needs a rewrite
@@ -285,8 +521,14 @@ class CWQDataset(KGQABaseDataset): | |||
(default: :obj:`False`) | |||
use_pcst (bool, optional): Whether to preprocess the dataset's graph | |||
with PCST or return the full graphs. (default: :obj:`True`) | |||
subgraphrag (bool, optional): Whether to preprocess the dataset | |||
into the format expected by SubgraphRAG. The dataset the full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
|
||
|
||
def reason(pred_dict, model_name, K_triplets, max_tokens=4096): | ||
llm = LLM(model_name=model_name, backend='openai') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs NIM api key passed, probs pass in through argparser
This PR adds a E2E implementation of Simple Is Effective: The Roles of Graphs and Large Language Models in Knowledge-Graph-Based Retrieval-Augmented Generation
Reproducing
to add
Results
Metrics with
topk=100
andmodel_name=meta-llama/Llama-3.1-8B
Ablation study, no triplets (question only):
Hit@1: 0.3547
Bigger LLM (
meta-llama/Llama-3.1-70B-Instruct
) doesn't improve the hit rate:Hit@1: 0.7608