Skip to content

Commit ca049fd

Browse files
Fix documentation
1 parent d2ba862 commit ca049fd

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

docs/source/user_guide_kg_builder.rst

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ It can be used in this way:
831831
The LLM to use can be customized, the only constraint is that it obeys the :ref:`LLMInterface <llminterface>`.
832832

833833
Schema Enforcement Behaviour
834-
---------------
834+
----------------------------
835835
By default, even if a schema is provided to guide the LLM in the entity and relation extraction, the LLM response is not validated against that schema.
836836
This behaviour can be changed by using the `enforce_schema` flag in the `LLMEntityRelationExtractor` constructor:
837837

@@ -844,23 +844,14 @@ This behaviour can be changed by using the `enforce_schema` flag in the `LLMEnti
844844
# ...
845845
enforce_schema=SchemaEnforcementMode.STRICT,
846846
)
847-
schema = SchemaConfig(
848-
entities={"Label": {"name": str}},
849-
relations={"REL_TYPE": {}},
850-
potential_schema=[("Label", "REL_TYPE", "Label")]
851-
)
852-
853-
#....
854-
result = await extractor.run(
855-
#...
856-
schema=schema
857-
)
858847
859848
In this scenario, any extracted node/relation/property that is not part of the provided schema will be pruned.
860849
Any relation whose start node or end node does not conform to the provided tuple in `potential_schema` will be pruned.
861850
If a node is left with no properties, it will be also pruned.
862851

863-
Note that if the schema enforcement mode is on but the schema is not provided, no schema enforcement will be applied.
852+
.. warning::
853+
854+
Note that if the schema enforcement mode is on but the schema is not provided, no schema enforcement will be applied.
864855

865856
Error Behaviour
866857
---------------

0 commit comments

Comments
 (0)