Skip to content

Prompt update for property extraction#1103

Merged
baitsguy merged 1 commit into
mainfrom
property-extraction-prompt
Jan 9, 2025
Merged

Prompt update for property extraction#1103
baitsguy merged 1 commit into
mainfrom
property-extraction-prompt

Conversation

@baitsguy
Copy link
Copy Markdown
Contributor

@baitsguy baitsguy commented Jan 9, 2025

An attempt to get better json-parseable responses from the LLM with prompt tweaking. In this case we were previously getting python style dict responses.

Current, non-parseable responses with the json lib:

...
"someFieldWithNoValue": None
...

as opposed to this, which is parseable:

...
"someFieldWithNoValue": "None"
...

Another approach is to get extract_json to better parse these responses with regex/replace style approaches but that felt jankier and I want to avoid that as long as I can

@baitsguy baitsguy requested a review from Soeb-aryn January 9, 2025 22:20
@baitsguy baitsguy marked this pull request as ready for review January 9, 2025 22:21
Copy link
Copy Markdown
Contributor

@Soeb-aryn Soeb-aryn left a comment

Choose a reason for hiding this comment

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

LGTM, do you think it is worth adding an assert statement to ensure fields is of right data type ?

value = fields.get(field.name)

@baitsguy
Copy link
Copy Markdown
Contributor Author

baitsguy commented Jan 9, 2025

LGTM, do you think it is worth adding an assert statement to ensure fields is of right data type ?

value = fields.get(field.name)

The current transform actually seems to work with a dictionary type response, but also just string style responses. I don't think the latter is necessarily needed but let me think about it outside this PR's context

@baitsguy baitsguy merged commit 46d0d39 into main Jan 9, 2025
@baitsguy baitsguy deleted the property-extraction-prompt branch January 9, 2025 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants