Use the two text-transforming AI tools to summarize and anonymize various text inputs.
After reading this article you’ll know:
-
What the Summarizer and Anonymizer action steps are
-
How to configure these steps in your application flow
-
The values these AI functions can bring to your business
Expanding the AI features, Betty Blocks introduces a powerful duo - Summarizer and Anonymizer action steps, fueled by the latest OpenAI technology. These steps bring smart and automated features to the table and allow one to get the essence out of the text, as well as encrypt the sensitive data.
Summarizer step is a revolutionary tool designed to simplify and shorten lengthy text inputs into concise summaries, empowering users to extract essential information effortlessly, in one click. Applying the capabilities of OpenAI, the Summarizer step employs advanced natural language processing to generate coherent and contextually relevant summaries.
On the other hand, Anonymizer step addresses the critical need for data privacy and confidentiality. This step allows users to anonymize Personal Identifiable Information (PII) within the text, safeguarding sensitive information without compromising the overall content’s integrity. Whether it’s customer data, proprietary information, or any identifiable details, the Anonymizer step ensures compliance with privacy regulations and promotes responsible data handling practices.
The Summarizer and Anonymizer are parts of the Generative AI block from our Block Store, and they become available to you after installing this block into a desired application.
Using Summarizer and Anonymizer
Once you’ve installed the Generative AI block into your application, you can apply any of the included action steps to create your use cases. As usual, we’ll take a relatively simple use case for explanation to ensure every builder can understand how to implement the Summarizer and Anonymizer into their application flow.
We will create a Betty Blocks application for working with texts using AI capabilities with functionality based on a create form, through which one can add some text content to the data model.
The data model includes pre-added properties:
-
‘Anonymized output’ (text, multi-line)
-
‘Content name’ (text, single-line)
-
‘Input content’ (text, multi-line)
-
‘Output content’ (text, multi-line)
Note: ‘Output content’ here refers to the ‘summarized content’ as we will unite the Create record with summarizing functionalities.
Preparing a page
For this use case, we want to be able to create new records with text that will instantly be summarized - presented in a shorter, extracted form. Therefore, we need a new page with the Create form, and the Data table to display our added records.
-
Drag a Create form to a page and configure it, choosing the Content model along with the Content name and Input content properties. Press
Save
to proceed.
Drag a Create form to a page and configure it, choosing the Content model along with the Content name and Input content properties. Press Save
to proceed.
2. Add a Data table component by dragging and dropping it into the create form. Select the same Content model and choose to display the Id and Content name properties. Click Save
.
That is done. So now we can proceed to the action flow configuration and set it up.
Building a summarizer flow
As mentioned above, we are going to configure the action behind the create record form so that the input content sent via this form is also summarized along with it. The Create record, Summarizer, and Update record steps will be needed to make this happen.
1. Open the action behind the Create form component by clicking the pencil button next to the action field in the component options.
2. Once the action is open, you’ll notice the create record step is already there. Open the Start step and add two input variables: content_name & input_content - those will align with the Content name and Input content fields within the create form.
3. Drag and drop the Summarizer action step after the create record, and let’s configure the following values in the options tab:
-
Select a model - version of OpenAI
-
Paste the API key (from OpenAI) for the model
-
Choose the summarization style. The concise style provides a brief and to-the-point overview of your text input, while the bullet points use a list format of key ideas
-
With the max new tokens field, you specify the length limit for the input text. If you’re interested in how it is measured within OpenAI, check this article
-
Type in the result input text to be picked up as a result variable in the next step(s). Don’t forget to save your settings.
4. Place the Update record step after the summarizer. Open it by clicking once, and set up the following values in the options tab:
-
Select the record variable. In our case, that’s the result - the output value from our first create record step.
-
In value mapping select the Output content property (from our model) and assign the summarized_result value (result of the summarizer step) to it. Click
Save
.
Select the record variable. In our case, that’s the result - the output value from our first create record step.
In value mapping select the Output content property (from our model) and assign the summarized_result value (result of the summarizer step) to it. Click Save
.
Note: To view how it functions in the front end, proceed to the Final check section, where the two steps are tested.
Anonymizer flow
Now let’s get down to the Anonymizer action step. Unlike our Summarizer, the anonymizing AI functionality will be triggered via the separate action button.
1. Add an Action button to your page. In our case, we’ll place it within the data table. Make sure you passed the Content.Id value to the action in the action button options.
2. After you’ve opened the action, go to the Start step and add a new input variable. Select a record type, corresponding model (‘Content’ in our case), and fill in the ‘id’ in the name field. Press Save
.
3. Drag and drop the Anonymizer step to your action flow. Open the step itself and fill in the following values in the options tab:
-
Select a model - version of ChatGPT
-
Paste the API key (from OpenAI) for the model
-
Add the variables associated with the prompt. In our example, we will use id.output_content from our Content model
-
Type in the result input text to be picked up in the following step
-
Save your configuration with the button at the bottom
4. Drop the Update record step after the Anonymizer to provide the anonymized output:
-
Select the id as an input variable. This way the application will know which record (among created) exactly is being updated.
-
Press
Save
after you’re done.
Select the id as an input variable. This way the application will know which record (among created) exactly is being updated.
Press Save
after you’re done.
Note: Make sure you’ve set the right permissions for your actions and models before checking the functionality in the front end!
Final check
The time has come to see if our functionality is working. To finalize it, we’ve created an additional Detail page to store all the processed pieces of text: summarized, anonymized, and input text. Let’s see if the police report that was added to the application is being handled correctly by the configured AI steps.
Eventually, it looks like everything has been done according to our plan: there are three panels (within a Data container) that display the automatically summarized report, the anonymized version of it, and the original text of the report.
Also, if you look at another example of text with no personal information in it, there will be a message: “The document doesn’t contain any Personal Identifiable Information (PII)”
Overall, both the Summarizer and Anonymizer steps share the common thread of being no-coder friendly, eliminating the need for users to manually craft complex prompts. They can be easily integrated into various applications, ranging from customer support to legal proceedings. By providing concise summaries and masking sensitive information, these intelligent features enhance productivity, maintain data privacy, and uphold compliance with regulations.
Good luck building!