Back to TextRazor in Google Sheets
SheetXAI logo
TextRazor logo
TextRazor · Google Sheets Guide

Create a TextRazor Custom Dictionary and Apply It to a Google Sheet

2026-05-14
5 min read

The Scenario

You're a pharma analyst and the compliance team has a new requirement: the entity extraction model you're using for clinical abstract analysis has to recognize your company's proprietary drug names and trial codes as named entities, not generic text. You have 50 of them in a spreadsheet — column A of the 'Dictionary' tab — and 200 clinical abstract texts in column A of the 'Abstracts' tab waiting for extraction. The TextRazor custom dictionary feature handles this, but you've never set one up before and the API documentation has you somewhere between "create the dictionary" and "reference it in an extraction call."

The bad version:

  • Read the TextRazor API docs to find the custom entity dictionary endpoint, construct a POST request with the correct payload structure, authenticate with your API key, and upload all 50 terms.
  • Write a second script that runs extraction on each abstract with the custom dictionary ID referenced in the request.
  • Parse the response to separate standard entities from custom dictionary matches, and figure out which column should get which.
  • Realize the API returned custom entity matches in a different field than standard entities, go back and update the parser, and re-run all 200 rows.

The compliance deadline is next Tuesday. The abstracts have been sitting in the sheet for two weeks while you worked out the infrastructure problem.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent that lives inside your Google Sheet. It reads both tabs, understands what you're building, and through its built-in TextRazor integration can create the custom entity dictionary from your terms and then run extraction using it — all from a single prompt in the sidebar.

Create a TextRazor custom entity dictionary named 'Drug Entities' using the terms in column A of the 'Dictionary' sheet, then run entity extraction using that dictionary on each text in column A of the 'Abstracts' sheet and write found entities into column B.

What You Get

  • SheetXAI uploads all 50 terms from the 'Dictionary' tab to a new TextRazor custom dictionary named 'Drug Entities.'
  • It then runs entity extraction on each abstract in the 'Abstracts' tab with that dictionary active, so proprietary drug names and trial codes are recognized as entities alongside standard ones.
  • Column B of the 'Abstracts' sheet receives the extracted entity names — including any custom dictionary matches — for each abstract.
  • Rows where no custom or standard entities are found get a noted placeholder rather than a blank.

What If the Data Is Not Quite Ready

The dictionary terms include variant spellings in column B

Create a TextRazor custom entity dictionary named 'Drug Entities' using the primary terms from column A of the 'Dictionary' sheet, including the variant spellings in column B as aliases for each entry, then run entity extraction on each abstract in the 'Abstracts' sheet and write found entities into column B.

Some abstracts are in a mix of English and Latin

Create the TextRazor custom dictionary from the 'Dictionary' sheet, then for each abstract in the 'Abstracts' sheet, run entity extraction with the custom dictionary and write found entities into column B. Flag any row where the abstract appears to contain non-English text in column C.

You want to separate custom dictionary matches from standard entity matches

Create the TextRazor custom entity dictionary from column A of the 'Dictionary' sheet, run extraction on each abstract in the 'Abstracts' sheet, and write custom dictionary matches into column B and standard entity matches into column C.

Full kill chain: upload dictionary, extract, compliance audit

Create a TextRazor custom entity dictionary named 'Drug Entities' from column A of the 'Dictionary' sheet. Run entity extraction on each abstract in the 'Abstracts' sheet using the custom dictionary. Write custom dictionary matches into column B and their relevance scores into column C. Then add an 'Audit' sheet listing each dictionary term, how many abstracts it appeared in, and the average relevance score — sorted by frequency descending.

The audit output is what compliance actually needs — and it's easier to get there in one prompt than to build it manually after the extraction.

Try It

Get the 7-day free trial of SheetXAI and open the Google Sheet with your proprietary terms in one tab and the texts to analyze in another. Ask SheetXAI to create the TextRazor custom dictionary from your terms and run extraction on the abstracts in one step. If your next step is IAB or IPTC topic classification on the same texts, those spokes cover those workflows.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more