node classification failsafe - remove node labels not part of the custom ontology (#295)
* node classification failsafe * Update graphiti_core/utils/maintenance/node_operations.py Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> * test update * dict.keys update --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
parent
f651984bd8
commit
d91aaa052c
2 changed files with 4 additions and 1 deletions
|
|
@ -189,6 +189,9 @@ async def extract_nodes(
|
||||||
new_nodes = []
|
new_nodes = []
|
||||||
for name in extracted_node_names:
|
for name in extracted_node_names:
|
||||||
entity_type = node_classifications.get(name)
|
entity_type = node_classifications.get(name)
|
||||||
|
if entity_types is not None and entity_type not in entity_types:
|
||||||
|
entity_type = None
|
||||||
|
|
||||||
labels = (
|
labels = (
|
||||||
['Entity']
|
['Entity']
|
||||||
if entity_type is None or entity_type == 'None' or entity_type == 'null'
|
if entity_type is None or entity_type == 'None' or entity_type == 'null'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "graphiti-core"
|
name = "graphiti-core"
|
||||||
version = "0.8.0"
|
version = "0.8.1"
|
||||||
description = "A temporal graph building library"
|
description = "A temporal graph building library"
|
||||||
authors = [
|
authors = [
|
||||||
"Paul Paliychuk <paul@getzep.com>",
|
"Paul Paliychuk <paul@getzep.com>",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue