-
Notifications
You must be signed in to change notification settings - Fork 79
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
H-2692: Infer facts from text before proposing entities #4467
Conversation
d68c05a
to
b8f9ee1
Compare
Benchmark results
|
Function | Value | Mean |
---|---|---|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 5
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 50
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 10
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 25
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 1
|
representative_read_entity
Function | Value | Mean |
---|---|---|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1
|
|
entity_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579 , Entity Type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1
|
representative_read_multiple_entities
Function | Value | Mean |
---|---|---|
link_by_source_by_property | depths: DT=255, PT=255, ET=255, E=255 | |
link_by_source_by_property | depths: DT=2, PT=2, ET=2, E=2 | |
link_by_source_by_property | depths: DT=0, PT=2, ET=2, E=2 | |
link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=2 | |
link_by_source_by_property | depths: DT=0, PT=0, ET=2, E=2 | |
link_by_source_by_property | depths: DT=0, PT=0, ET=0, E=0 | |
entity_by_property | depths: DT=255, PT=255, ET=255, E=255 | |
entity_by_property | depths: DT=2, PT=2, ET=2, E=2 | |
entity_by_property | depths: DT=0, PT=2, ET=2, E=2 | |
entity_by_property | depths: DT=0, PT=0, ET=0, E=2 | |
entity_by_property | depths: DT=0, PT=0, ET=2, E=2 | |
entity_by_property | depths: DT=0, PT=0, ET=0, E=0 |
representative_read_entity_type
Function | Value | Mean |
---|---|---|
get_entity_type_by_id | Account ID: d4e16033-c281-4cde-aa35-9085bf2e7579
|
scaling_read_entity_linkless
Function | Value | Mean |
---|---|---|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 10
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 10000
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 100
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 1000
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 1
|
scaling_read_entity_complete_zero_depth
Function | Value | Mean |
---|---|---|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 5
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 50
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 10
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 25
|
|
get_entity_by_id | Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba , Number Of Entities: 1
|
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.
Good stuff, only a couple of minor comments
@@ -144,6 +88,7 @@ export const compareLlmResponses = async () => { | |||
const llmResponses = await Promise.all( | |||
models.map((model) => { | |||
return getLlmResponse( | |||
// @ts-expect-error - figure out what's going wrong here |
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 models
field accepts any model name, but the params demands that only OpenAI model names are sent with OpenAI params, etc.
The type of CompareLlmResponseConfig
would have to be updated somehow to make sure they were in sync, maybe with generics or something. Not sure it's worth sinking a lot of time into, since it's a testing utility.
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.
Yeah, I made an attempt at this but didn't think it was worth sinking a lot of time into. We'll probably revise this method further once we dedicate time on the model evaluation you've mentioned.
// eslint-disable-next-line no-console | ||
console.log(logMessage); |
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.
Why not use logToConsole
here?
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.
Because it doesn't actually log anything when I run the test via vitest
, not entirely sure why haven't spent a lot of time trying to fix this.
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.
Fair play, don't worry about it then
π What is the purpose of this PR?
This PR modifies how entities are proposed in the research action, and stops making use of the
inferEntitiesFromContent
action to propose entities. The process of proposing entities in the worker agent is now:In follow up we aim to use the underlying pieces of this process to no longer propose entities when processing a single piece of text. Instead we will gather all the facts from different sources on the coordinator level, so that entities can be proposed based on information obtained from a variety of sources.
π Related links
π What does this change?
vitest
testing libraryPre-Merge Checklist π
π’ Has this modified a publishable library?
This PR:
π Does this require a change to the docs?
The changes in this PR:
πΈοΈ Does this require a change to the Turbo Graph?
The changes in this PR:
πΎ Next steps
π‘ What tests cover this?
Manual testing
β How to test this?
Try out the existing flows that make use of the research action. I've used the "Get subsidiary companies of Google" as a prompt and the
Company
flow test type to produce the demoed result.πΉ Demo