MetadataTagger
document transformer automates this process by extracting metadata from each provided document according to a provided schema. It uses a configurable OpenAI Functions-powered chain under the hood, so if you pass a custom LLM instance, it must be an OpenAI model with functions support.
Note: This document transformer works best with complete documents, so it’s best to run it first with whole documents before doing any other splitting or processing!
Usage
For example, let’s say you wanted to index a set of movie reviews. You could initialize the document transformer as follows:npm
createMetadataTagger
method that accepts a valid JSON Schema object as well.