FreeFormExtractor
org.llm4s.knowledgegraph.extraction.FreeFormExtractor
Extracts a Knowledge Graph from unstructured text with a free-form LLM prompt, and returns it without storing it.
The node ids in the result are the model's own, usually 1, 2, ..., so they collide across documents: give each document's graph a namespace before merging or storing it, as SourceTrackedGraph.addDocument and KnowledgeGraphGenerator.extract do.
Value parameters
- llmClient
-
The LLM client to use for extraction
Attributes
- Example
-
val extractor = new FreeFormExtractor(llmClient) val result = extractor.extract( text = "Alice works at Acme Corp in San Francisco.", entityTypes = List("Person", "Organization", "Location") ) - Source
- FreeFormExtractor.scala
- Graph
-
- Supertypes
Members list
In this article
