Summarize Text
Summarizes specific text according to the selected language and text analysis method.
Command availability: IBM RPA SaaS and IBM RPA on premises
Description
Summarizes specific text according to the selected language and text analysis method.
Script syntax
IBM RPA's proprietary script language has a syntax similar to other programming languages. The script syntax defines the command's syntax in the script file. You can work with this syntax in IBM RPA Studio's Script mode.
summarize --method(SummarizerMethods) [--culture(String)] --text(String) (String)=text (Boolean)=success
Input parameters
The following table displays the list of input parameters available in this command. In the table, you can see the parameter name when working in IBM RPA Studio's Script mode and its Designer mode equivalent label.
Designer mode label | Script mode name | Required | Accepted variable types | Description |
---|---|---|---|---|
Method | method |
Required |
SummarizerMethods |
Method used to summarize the text. See the method parameter options. |
Language | culture |
Optional |
Text , Culture |
Language used to analyze the text that should be summarized. See the culture parameter options. |
Text | text |
Required |
Text |
Text that should be summarized. |
method
parameter options
The following table displays the options available for the method
input parameter. The table shows the options available when working in Script mode and the equivalent label in the Designer mode.
Designer mode label | Script mode name | Description |
---|---|---|
First Sentence | FirstSentence |
Summarizes the first sentence of the text. |
Frequent Words | FrequentWords |
Summarize according to the most frequent words in the text. |
culture
parameter options
The following table displays the options available for the culture
input parameter. The table shows the options available when working in Script mode and the equivalent label in the Designer mode.
Designer mode label | Script mode name | Description |
---|---|---|
en-US | en-US |
American english. |
pt-BR | pt-BR |
Brazilian portuguese. |
pt-PT | pt-PT |
Portugal portuguese. |
Output parameters
Designer mode label | Script mode name | Accepted variable types | Description |
---|---|---|---|
Summarized Text | text | Text |
Returns the summarized text according to the specified method. |
Success | success | Boolean |
Returns True , if the script runs successfully, otherwise, returns False . |
Example
The command returns the specified text, summarized according to the most frequent words and the method that has been defined.
defVar --name summarizedText --type String
defVar --name executionSuccess --type Boolean
defVar --name textToSummarize --type String --value "The answer lies in weight and body volume, usually higher for men. “An average man weighs about 80 kilos and 60% of his body volume is made up of water, which is equivalent to about 48 liters. An average woman weighs about 60 to 65 kilos, which corresponds to 36 liters of water. These differences explain the recommendations. It is a matter of volume, of cellular compartments”, says Luís Serra, professor of medicine and public health at the University of Las Palmas, interviewed by the newspaper El País.\r\nThe amount of calories consumed during a day also interferes with the men\'s need to drink more water. \"Usually, it is advisable to drink one milliliter of water for each kilocalorie\", suggests Serra"
logMessage --message "Text to Summarize: ${textToSummarize}" --type "Info"
summarize --method "FrequentWords" --culture en-US --text "${textToSummarize}" summarizedText=text executionSuccess=success
logMessage --message "Summarized Text: ${summarizedText}\r\nExecution Success: ${executionSuccess}" --type "Info"
// Displays the content of the text before and after being summarized in the console.
Limitations
The First Sentence option returns the first five sentences or less of an array with at least 125 of the most frequently used words. Thus, if the text contains less than five sentences, the output is the same as the input. This happens regardless of the chosen language.