Classify Contract Key Terms

You can categorize or classify the contractual key terms based on your business specific rules. Classification provides a quick preview of the key terms that need attention. It highlights the risks in the contract, brings attention to the terms that aren’t standard and outlines the favorable and non favorable terms in a contract.

The classification rules for each key term can be written in Groovy and validated before using them. You can define your own classification codes such as Standard, Non Standard, Good, Bad, Neutral, and so on and are specific to your organization. For example, the rule for a renewal percentage key term could be as follows:
  • If above 5, the classification is Good
  • If between 3 and 5, it might be classified as Neutral
  • If less than 5, then the classification might be Bad.

You can classify the key terms after they're extracted from the contract documents. Classifying key terms helps stakeholders get quick insights from the contract so that they can make informed decisions.

Enable the Classify Contract Key Terms Feature

You enable this feature using the opt-in task. If you've permission to configure offerings, then you can use the New Features page to opt into the feature as follows:
  1. Navigate to My Enterprise > Offerings.
  2. Click the Enterprise Contracts offering.
  3. Click Opt In.
  4. Click Features (the pencil icon) and navigate to the Extract Key Terms from Contract Documents Using Generative AI parent feature as shown:

    Screenshot showing the Classify Contract Key Terms feature from the Edit Features UI

  5. Expand the parent to display the Classify Contract Key Terms child feature and select the checkbox in the Enable column.
    Note: The child opt in can’t be enabled without the parent opt in being enabled.
  6. Click Done to save the changes and return to the Offerings page.

    For more information, see the New Feature Opt-In Section of the Oracle Applications Cloud - Using Functional Setup Manager guide on the Oracle Help Center (docs.oracle.com).

Security and Privileges to Classify Key Terms

The following lists the access requirements to classify the key terms. The Classify button in the Key Term Values tab of the contract will be enabled only if you've the following privileges:
  • Edit Key Term Values (OKC_EDIT_KEY_TERM_VALUES_PRIV)
  • Use Generative AI Features in Sales (ZCA_USE_GENAI_IN_SALES_PRIV)
  • Edit Contract (OKC_EDIT_CONTRACT_PRIV)

Classification Code Lookups

The classification codes are user-defined and you can add them in the Key Terms Classification Codes lookup. Use the user defined lookup Key Terms Classification Measures to enter measures such as hours, minutes, days, percentage and so on. This field is available only for key terms with Number output type. For example, for a Renewal Period key term, the Updated Value is 3 and Measure is Years and for a Renewal Percentage key term, the Updated Value is 10 and Measure is Percentage.

Key Term Classification Rules

The configuration of Groovy scripts for classification of key terms is done in Application Composer using a sandbox for developing and testing your scripts. Here's how to create a sandbox:

  1. Navigate to Configuration > Application Composer > Sandboxes.
  2. Click Create Sandbox.
  3. Specify a name and select Application Composer > All Tools.
  4. In the Publishable field, select Yes.
  5. Click Create and Enter.
  6. Click the Application Composer icon.
You can find more information about sandboxes here Overview of Sandboxes
Sample rules might be as follows:
Name Description
Rule 1 If the key term Renewal Cap Percentage is more than 2, then the key term is classified as Non-standard , else classified as Standard
Rule 2 If the key term Price Hold value is Yes, then the key term is classified as Present, else classified as Absent
Rule 3 If the contract type is Sell : No lines and Renewal Period is < 3 years, it’s Non-standard, if it’s >= 3 years it’s Standard

Here's how to create a field trigger to activate a key term classification rule.

  1. Click Navigator > Configuration > Application Composer.
  2. In the Application field, select ERP and SCM Cloud.
  3. From the Objects area, select Contract Key Term Extraction Process > Server Scripts as shown:

    Sample screenshot highlighting the Server Script area of Application Composer

  4. From the Triggers tab, in the Field Triggers region click Add to create a new field trigger as shown:

    Sample screenshot highlighting the Edit Field Trigger area of Application Composer

  5. Validate the Groovy script and click Save and Close.

Once you validate the Groovy script, you can classify the key terms from the Key Term Values tab of a contract as shown:

Sample screenshot the Extract Details region of the Key Terms Value UI highlighting the Classify button and Classification field

Click Classify to call the Groovy script and based on the rules you’ve written, the classification happens, and you can see the values in the Classification field. The values entered in the Updated Value field can be used for classification. The response returned by the LLM is populated in the Extracted Value and Updated Value fields. If the response isn’t in the format that you want for classification, then you can change the value in the Updated Value field and use that value for classification.

Sample Groovy Script for Key Term Classification Rules

Here's sample Groovy script for the rules describes in the Key Term Classification Rules section.

def typeName;
def count = 0;
 
def renewal;
def renewalCapVal;
def renewalCapPrcnt;
 
try{
//Below snippet will get Contract Type Name Using Id and MajorVersion of the 
Contract def vo = newView('ContractVO')
def vc = newViewCriteria(vo)
def vcr = vc.createRow()
 
def vci1 = vcr.ensureCriteriaItem('Id')
vci1.setOperator('=')
vci1.setValue(DnzChrId)
 
def vci2 = vcr.ensureCriteriaItem('MajorVersion')
vci2.setOperator('=')
vci2.setValue(MajorVersion)
 
vc.insertRow(vcr)
vo.appendViewCriteria(vc)
vo.executeQuery()
 
def row = vo.first();
if(row != null)
{
typeName = row.getAttribute('ContractTypeName')
}
 
//Iterate through KeyTerms to classify key terms such as Renewal Cap Percentage, 
//Based on the rules, user must populate ClassificationCode with appropriate Lookup Code
def contKeyTerms =  contractKeyTerms
while(contKeyTerms.hasNext()){
  def keyTermrow = contKeyTerms.next();
   
    
// Implementing Rule #1
  if(keyTermrow.getAttribute('KeyTermName') == 'Renewal Cap Percentage'){
    renewalCapPrcnt = keyTermrow.getAttribute('UpdatedValue')
    if(renewalCapPrcnt > '2')
      keyTermrow.setAttribute("ClassificationCode","OKC_CLASSIFY_NON_STD")
    else
      keyTermrow.setAttribute("ClassificationCode","OKC_CLASSIFY_STD")
  }
  
// Implementing Rule #2 
  if(keyTermrow.getAttribute('KeyTermName') == 'Price Hold'){
    if(keyTermrow.getAttribute('UpdatedValue') == 'Yes')
      keyTermrow.setAttribute("ClassificationCode","OKC_CLASSIFY_PRESENT")
    else
      keyTermrow.setAttribute("ClassificationCode","OKC_CLASSIFY_ABSENT")
  }

  
}

// Implementing Rule #3 
//Re-Iterate through KeyTerms to Classify the Renewal Period
def contKeyTermsUpd =  contractKeyTerms
while(contKeyTermsUpd.hasNext()){
  def keyTermUpdrow = contKeyTermsUpd.next();
  if(keyTermUpdrow.getAttribute('KeyTermName') == 'Renewal Period’){
    if(typeName == "Sell : No lines"){
      
      if(keyTermrow.getAttribute('UpdatedValue') < 3 != 'NONE'){
        keyTermUpdrow.setAttribute("ClassificationCode","OKC_CLASSIFY_NON_STD")
      }
      if(keyTermrow.getAttribute('UpdatedValue') >= 3){
        keyTermUpdrow.setAttribute("ClassificationCode","OKC_CLASSIFY_STD")
      }
    }
  }
}
}
catch(Exception e){
  def message = "There is an error in the implementation. Please contact Administrator";
  adf.error.warn(message)
}