πŸ“„ Extract In Json FormatΒΆ

templates.key_value_extraction.extract_in_json_format

type: InputOutputTemplate
instruction: Extract the key value pairs from the input. Return a valid json object with the following keys: {keys}. Return only the json representation, no additional text or explanations.
input_format: {input}
output_format: {key_value_pairs_answer}
postprocessors: 
  - type: PostProcess
    operator: 
      type: JsonStrToListOfKeyValuePairs
serializer: 
  type: MultiTypeSerializer
  serializers: 
    - type: ImageSerializer
    - type: DictAsJsonSerializer
    - type: ListSerializer
[source]

Explanation about InputOutputTemplateΒΆ

Generate field β€˜source’ from fields designated as input, and fields β€˜target’ and β€˜references’ from fields designated as output, of the processed instance.

Args specify the formatting strings with which to glue together the input and reference fields of the processed instance into one string (β€˜source’ and β€˜target’), and into a list of strings (β€˜references’).

Explanation about JsonStrToListOfKeyValuePairsΒΆ

Convert a Json string of representing key value as dictionary to list of key value pairs.

Read more about catalog usage here.