Start building awesome legal AI apps with the Isaacus API in under 5 minutes
ISAACUS_API_KEY
environment variable or by passing it directly, which is what we’re doing in this example.
This is a confidentiality clause.
.
response.classifications[0]
, in addition to our usage statistics.
chunking_options
parameter to null
). Typically, these chunks will correspond to individual clauses in the document.
Chunks are stored in the classification.chunks
attribute and come with their own text
, score
, start
, and end
attributes, with start
and end
representing the start and end character indices of the chunk in the original text.
classification.score
contains the overall classification score of the document. This score is currently set to the largest score of any chunk.
Scores range from to , with a score over indicating a positive classification. You can think of the scores as the classifier’s estimation of the likelihood that the query is supported by the document.
response.usage
contains statistics about the usage of resources in the process of classifying the document. response.usage.input_tokens
will give you the number of tokens inputted into the classifier, which you can cross-reference with our pricing to estimate the cost of classifying the document (excluding applicable taxes).
When passing multiple documents to the classifier, you can access each document’s classification via the response.classifications
array, which is sorted from highest to lowest classification score. You can use the classification.index
attribute to recover the index of documents in the original input array.
Now, let’s print out the results.
{This is a confidentiality clause.}
.
To invoke a pre-optimized query template, we can express our query in the format {IS <template name>}
. You can find a list of available templates here.
For example, we could’ve invoked the {IS confidentiality clause}
template to classify confidentiality clauses in the Github terms of service instead of trying to write our own query from scratch. Let’s do that now.
{IS <template name> "<template argument>"}
.
For example, if you wanted to identify clauses that specifically obligate the party referred to as “you” in the document, you could use the {IS clause obligation "<party name>"}
template like so: {IS clause obligating "You"}
.
{IS clause called "<clause name>"}
(e.g., {IS clause called "confidentiality"}
) or {IS clause that "<clause description>"}
(e.g., {IS clause that "imposes a duty of confidentiality"}
). We don’t yet have very many templates for non-contractual classifications, however, our models have been trained on an equal mix of contracts, cases and legislation, so you can always write your own queries for anything not covered by an existing template.
In addition to allowing you to invoke query templates, IQL also enables you to string statements together using logical operators like AND
, OR
, and NOT
, as well as the >
and <
comparison operators and the +
operator for averaging.
For example, if we wanted to identify confidentiality clauses that apply to you and you alone, we could use this query: {IS confidentiality clause} AND {IS clause obligating "You"} AND {IS unilateral clause}
.