Skip to main content

Managing Grammar

Overview

The Grammar feature in Unstract allows you to define custom synonyms for words that may appear in different forms across various documents. This helps the system recognize and interpret different terminology that shares the same meaning.

Steps for Adding Grammar (Custom Synonyms)

  1. Access Settings: Click on the gear icon (⚙️) in the top-right corner of the Unstract interface.

  2. Navigate to Grammar: In the Settings sidebar on the left, select "Grammar".

  3. View Custom Synonyms: The main panel displays the "Custom Synonyms" section where you can manage your word-synonym pairs.

  4. Add New Words and Synonyms:

    • In the "Word" column, enter the base term you want to define (as shown with examples like "debit" and "credit")
    • In the "Synonyms" column, enter terms that should be treated as equivalent to the base word
    • You can add multiple synonyms for each word
  5. Add More Rows: Click the "+ Rows" button to add additional word-synonym pairs to your grammar.

  6. Remove Synonyms: If needed, click the "×" next to any synonym to remove it.

  7. Save Changes: After adding your custom synonyms, click the "Save" button to apply your changes.

  8. Navigate Between Pages: If you have multiple pages of synonym entries, use the pagination controls at the bottom to navigate between them.

img Prompt Studio project

Examples of Custom Synonyms

Here are some additional examples you could add:

Financial Document Examples:

  • Word: payment Synonyms: remittance, disbursement, settlement, installment

  • Word: statement Synonyms: bill, invoice, account summary, transaction record

  • Word: balance Synonyms: total, sum, amount due, outstanding amount

Medical Document Examples:

  • Word: patient Synonyms: client, subject, individual, recipient

  • Word: diagnosis Synonyms: assessment, finding, determination, clinical impression

  • Word: agreement Synonyms: contract, arrangement, covenant, understanding

  • Word: party Synonyms: participant, entity, signatory, stakeholder

Benefits of Using Grammar

  • Improves extraction accuracy across documents that use different terminology
  • Allows the system to recognize semantic equivalence even when wording varies
  • Helps standardize extracted information regardless of the specific terms used in original documents
  • Reduces the need to create multiple prompts to capture the same information expressed differently