nano-graphrag icon indicating copy to clipboard operation
nano-graphrag copied to clipboard

Feature: prompt tuning

Open bdecarne opened this issue 1 year ago • 5 comments

Hello !

Great project, so much easy to understand/hack than the microsoft one

Is there any plan to support the prompt tuning feature ? https://microsoft.github.io/graphrag/posts/prompt_tuning/overview/

It would be really nice !

bdecarne avatar Sep 26 '24 08:09 bdecarne

Yeah, @NumberChiffre is actually on this right now. We already merged some PRs about prompt tuning and keep working on it. #44 #27

Stay tuned!

gusye1234 avatar Sep 26 '24 12:09 gusye1234

@bdecarne I'll take a look sometimes next week, in the meantime if you are interested in optimizing prompt instructions for entity and relationship extraction, take a look at:

  • Generating datasets: https://github.com/gusye1234/nano-graphrag/blob/main/examples/generate_entity_relationship_dspy.ipynb
  • Optimization: https://github.com/gusye1234/nano-graphrag/blob/main/examples/finetune_entity_relationship_dspy.ipynb

I used dspy-ai=2.4.16 for the above notebooks^

NumberChiffre avatar Sep 27 '24 03:09 NumberChiffre

Thank you so much, it's look promising !!

bdecarne avatar Sep 27 '24 09:09 bdecarne

@bdecarne some updates were made with self-refine, you can re-run the above Jupyter notebooks with your datasets to optimize your prompt instructions or use other DSPy optimizers: https://github.com/gusye1234/nano-graphrag/pull/73

NumberChiffre avatar Oct 10 '24 15:10 NumberChiffre

Thanks for your work! But I have problem with prompt tuning. When I run this code generate_entity_relationship_dspy, it will get error with this img. How to solve this problem.

Image

SWWdz avatar Jul 02 '25 06:07 SWWdz