Skip to content
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 multi-turn self-refine for entity relationship extractor #73

Conversation

NumberChiffre
Copy link
Collaborator

@NumberChiffre NumberChiffre commented Oct 8, 2024

Description

One-pass of the input text may not always return the full entities and relationships, so we can ask the LLM to refine its response via critique. The tradeoff for quality is to call the LLM several times more (perhaps parts of this can be substituted with distilled HF models in the future).

Here's a basic version that intends to improve mathematical solutions over multiple turns via critique:
https://github.com/NumberChiffre/mcts-llm/blob/main/mcts_llm/mctsr.py#L36-L86

We'd have to make sure the refined entities and relationships are unique each.

@NumberChiffre NumberChiffre self-assigned this Oct 8, 2024
@NumberChiffre NumberChiffre added dspy enhancement New feature or request labels Oct 8, 2024
@NumberChiffre NumberChiffre marked this pull request as ready for review October 10, 2024 00:41
@gusye1234
Copy link
Owner

LGTM

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe change that name to mock_data_zh.txt?

@NumberChiffre NumberChiffre merged commit c061781 into gusye1234:main Oct 10, 2024
1 check passed
rangehow pushed a commit to rangehow/nano-graphrag that referenced this pull request Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dspy enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants