-
Notifications
You must be signed in to change notification settings - Fork 108
Ability to create lexical graph only #127
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
Ability to create lexical graph only #127
Conversation
…into feature/lexical-graph-component
…into feature/lexical-graph-component # Conflicts: # docs/source/user_guide_kg_builder.rst # examples/pipeline/kg_builder_from_text.py
…into feature/lexical-graph-component
…into feature/lexical-graph-component # Conflicts: # examples/customize/build_graph/pipeline/lexical_graph_from_text.py
…into feature/lexical-graph-component
Co-authored-by: willtai <wtaisen@gmail.com>
… into feature/lexical-graph-component
schema: Union[SchemaConfig, None] = None, | ||
examples: str = "", | ||
**kwargs: Any, | ||
) -> Neo4jGraph: | ||
"""Perform entity and relation extraction for all chunks in a list.""" | ||
"""Perform entity and relation extraction for all chunks in a list. |
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.
Could we define 'lexical graph' either here or in the user guide?
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.
This is what I tried to do here. What is missing? I'll add a note in this docstring anyway to clarify the behavior of create_lexical_graph
and lexical_graph_config
.
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.
Perhaps how is the term 'lexical graph' from any other knowledge graph. I think a newcomer will be confused with that
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.
Added more details and link to the user guide, let me know if you think more information is needd.
…into feature/lexical-graph-component
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.
Nice work!
…ide when appropriate
Description
This PR adds a
LexicalGraphBuilder
component that enables users to create the lexical graph without entity/relation extraction (see added example). It also updates theERExtraction
component to use the new LexicalGraphBuilder.Why
Pipelines that can be created after this PR:
A follow-up PR (#135) will implement the
Neo4jChunkReader
component that will enable to start the ER extraction from chunks already saved in the DB.Configuration
All parameters for the lexical graph are stored in a
LexicalGraphConfig
object (chunk and document node labels, relationship types, property names). This object is totally optional, default values are provided for all parameters.Future
We could consider deprecating the
create_lexical_graph
behavior in theEntityRelationExtractor
and force users who want to build the lexical graph to use theLexicalGraphBuilder -> Neo4jWriter
pattern.Type of Change
Complexity
Complexity: Medium
How Has This Been Tested?
Checklist
The following requirements should have been met (depending on the changes in the branch):