Convert Entity Relationship Extraction in DSPy to using CoT#44
Merged
NumberChiffre merged 8 commits intogusye1234:mainfrom Sep 23, 2024
Conversation
…erimental DSPy in notebook
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #44 +/- ##
==========================================
- Coverage 94.36% 94.25% -0.12%
==========================================
Files 11 12 +1
Lines 1189 1288 +99
==========================================
+ Hits 1122 1214 +92
- Misses 67 74 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…instructions that works for qwen2-7b
rangehow
pushed a commit
to rangehow/nano-graphrag
that referenced
this pull request
Oct 18, 2024
…4#44) * Converted TypedPredictor to CoT and removed pydantic models using experimental DSPy in notebook * Fix entity extraction unittests after removing pydantic models and changing to CoT * Add working random search fine tuning with better metrics * Still cannot get MIPROv2 to work * Working MIPROv2 with TypedChainOfThought * Updated metrics to compute all relationships at once, updated prompt instructions that works for qwen2-7b * Add updated notebooks with fine tuning using MIPROv2 and qwen2-7b as task model * Add compiled model for generate dataset with updated unittests --------- Co-authored-by: terence-gpt <[email protected]>
AhmaddAbbass
pushed a commit
to AhmaddAbbass/nano-graphrag
that referenced
this pull request
Nov 14, 2025
…4#44) * Converted TypedPredictor to CoT and removed pydantic models using experimental DSPy in notebook * Fix entity extraction unittests after removing pydantic models and changing to CoT * Add working random search fine tuning with better metrics * Still cannot get MIPROv2 to work * Working MIPROv2 with TypedChainOfThought * Updated metrics to compute all relationships at once, updated prompt instructions that works for qwen2-7b * Add updated notebooks with fine tuning using MIPROv2 and qwen2-7b as task model * Add compiled model for generate dataset with updated unittests --------- Co-authored-by: terence-gpt <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DSPy has typed predictors/CoT that uses pydantic models as schema for their return types, however this is not as reliable as non-typed like CoT (because if something goes wrong with the formatting, you can catch it and resolve it yourself, often times some JSON parsing error or response from
outputfieldends up in theprediction.rationaleof CoT). Therefore, this PR is here to resolve these formatting issues with DSPy once and for all (hopefully) and run MIPROv2 to generate optimal prompt instructions for entity relationship extraction.Misc: