I hope someone can help. I am referring to the online doc:
I have two large PDF documents from Oracle online:
database-backup-and-recovery-reference.pdf
database-backup-and-recovery-users-guide.pdf
I built a pipeline using GraphRAG SimpleKGPipeline:
pipeline = SimpleKGPipeline(
driver=self.driver,
text_splitter=self.text_splitter,
llm=self.llm,
embedder=self.embedder,
**entities=self.entities,**
**relations=self.relations,**
**potential_schema=self.potential_schema,**
enforce_schema="STRICT",
on_error="IGNORE",
from_pdf=False,
# prompt_template=prompt_template
)
The pipeline ran successfully, but the KG quality isn't good. my intent is to get Oracle concepts, rman commands, command syntaxes and command examples from the PDF documents. but the KG shows many errors. for example. "drop database" command has 3 steps in document:
To drop a database with SQL*Plus:
- After connecting to the database with administrator privileges, ensure that the database is either mounted or open in restricted mode with no users connected.
For example, enter the following command:
SQL> STARTUP RESTRICT FORCE MOUNT - Remove the data files and control files from the operating system.
For example, enter the following command:
SQL> DROP DATABASE; # deletes all database files, both ASM and non-ASM
If the database is on raw disk, then the command does not delete the actual raw disk
special files. - Use an operating system utility to delete all backups and archived logs associated with the database.
For example, on Linux and UNIX enter the following command:
% rm /backup/* /disk1/oradata/trgt/arch/*
====================
The drop database command example shows ONLY:
SQL> STARTUP RESTRICT FORCE MOUNT
I am thinking of passing a prompt_template to better instruct the llm to find the content that is relevant. but without luck. I saw the document can optionally configure a prompt here. but I cannot get it to work:
kg_builder = SimpleKGPipeline(
# ...
prompt_template="",
lexical_graph_config=my_config,
enforce_schema="STRICT"
on_error="RAISE",
# ...
)
Can you give me a working example with a user prompt for Graph Builder?