compass.validation.content.LegalTextValidator#

class LegalTextValidator[source]#

Bases: object

Parse chunks to determine if they contain legal text

Methods

check_chunk(chunk_parser, ind)

Check a chunk at a given ind to see if it contains legal text

Attributes

IS_LEGAL_TEXT_PROMPT

is_legal_text

True if text was found to be from a legal source

True if text was found to be from a legal source

Type:

bool

async check_chunk(chunk_parser, ind)[source]#

Check a chunk at a given ind to see if it contains legal text

Parameters:
  • chunk_parser (ParseChunksWithMemory) – Instance of ParseChunksWithMemory that contains a parse_from_ind method.

  • ind (int) – Index of the chunk to check.

Returns:

bool – Boolean flag indicating whether or not the text in the chunk resembles legal text.