This article describes a module of the visual interface (preview) for Azure Machine Learning service.
Use the Preprocess Text module to clean and simplify text. It supports these common text processing operations:
- Removal of stop-words
- Using regular expressions to search for and replace specific target strings
- Lemmatization, which converts multiple related words to a single canonical form
- Case normalization
- Removal of certain classes of characters, such as numbers, special characters, and sequences of repeated characters such as "aaaa"
- Identification and removal of emails and URLs
The Preprocess Text module currently only supports English.
Configure Text Preprocessing
Add the Preprocess Text module to your experiment in Azure Machine Learning Service. You can find this module under Text Analytics.
Connect a dataset that has at least one column containing text.
Select the language from the Language dropdown list.
Text column to clean: Select the column that you want to preprocess.
Remove stop words: Select this option if you want to apply a predefined stopword list to the text column.
Stopword lists are language-dependent and customizable.
Lemmatization: Select this option if you want words to be represented in their canonical form. This option is useful for reducing the number of unique occurrences of otherwise similar text tokens.
The lemmatization process is highly language-dependent..
Detect sentences: Select this option if you want the module to insert a sentence boundary mark when performing analysis.
This module uses a series of three pipe characters
|||to represent the sentence terminator.
Perform optional find-and-replace operations using regular expressions.
- Custom regular expression: Define the text you're searching for.
- Custom replacement string: Define a single replacement value.
Normalize case to lowercase: Select this option if you want to convert ASCII uppercase characters to their lowercase forms.
If characters aren't normalized, the same word in uppercase and lowercase letters is considered two different words.
You can also remove the following types of characters or character sequences from the processed output text:
Remove numbers: Select this option to remove all numeric characters for the specified language. Identification numbers are domain-dependent and language dependent. If numeric characters are an integral part of a known word, the number might not be removed.
Remove special characters: Use this option to remove any non-alphanumeric special characters.
Remove duplicate characters: Select this option to remove extra characters in any sequences that repeat for more than twice. For example, a sequence like "aaaaa" would be reduced to "aa".
Remove email addresses: Select this option to remove any sequence of the format
Remove URLs: Select this option to remove any sequence that includes the following URL prefixes:
Expand verb contractions: This option applies only to languages that use verb contractions; currently, English only.
For example, by selecting this option, you could replace the phrase "wouldn't stay there" with "would not stay there".
Normalize backslashes to slashes: Select this option to map all instances of
Split tokens on special characters: Select this option if you want to break words on characters such as
-, and so forth. This option can also reduce the special characters when it repeats more than twice.
For example, the string
MS---WORDwould be separated into three tokens,
Run the experiment.
See the set of modules available to Azure Machine Learning service.