Skip to content

Detect & Extract Syntax in Text v1.0.0 Help

Recognizes parts of speech (POS) in text. Refers to Part-of-speech (POS) tagging.

How can I use this Step?

The Step lets you recognize syntax in text. This way, you can automate various NLP tasks such as text parsing, information retrieval, and linguistic research. From a flow-building perspective, you can use the Step to add POS tagging logic to your Flow to split it based on a specific POS pattern.

How does the Step work?

The Step parses the input text into words and then determines the part of speech for each word.

For example, in the text "John ordered two sandwiches," the Step recognizes "John" as a pronoun, "ordered" as a verb, "two" as a numeral, and "sandwiches" as a noun.

In addition, the Step assigns each POS a confidence score indicating that the Step identified POS correctly. To learn more, see the Output example.

Input settings

To set up the section, do the following:

  1. For Input text, enter text to analyze.
  2. For Input language, select the language that matches the input text.
  3. For Parts of speech, select parts of speech you want to find in the input text.

Input text

The input text must be a UTF-8 string. The string must contain at least 1 character. The maximum string size is 5 KB.

Input language

The Step supports the following languages:

  • German
  • English
  • Spanish
  • Italian
  • Portuguese
  • French

Parts of speech

This Step uses Universal POS tags, which you can find in the following table:

TagPart of SpeechDescription
adjAdjectiveWords that typically modify nouns.
adpAdpositionThe head of a prepositional or postpositional phrase.
advAdverbWords that typically modify verbs. They may also modify adjectives and other adverbs.
auxAuxiliaryFunction words that accompany the verb of a verb phrase.
cconjCoordinating conjunctionWords that link words or phrases without subordinating one.
detDeterminerArticles and other words that specify a particular noun phrase.
intjInterjectionWords used as an exclamation or part of an exclamation.
nounNounWords that specify a person, place, thing, animal, or idea.
numNumeralWords, typically determiners, adjectives, or pronouns, that express a number.
oOtherWords that can't be assigned a part of speech category.
partParticleFunction words associated with another word or phrase to impart meaning.
pronPronounWords that substitute for nouns or noun phrases.
propnProper nounA noun that is the name of a specific individual, place or object.
punctPunctuationNon-alphabetical characters that delimit text.
sconjSubordinating conjunctionA conjunction that links parts of sentences by make one of them part of the other.
symSymbolWord-like entities such as the dollar sign ($) or mathematical symbols.
verbVerbWords that signal events and actions.

Output and exit behavior

To set up this section, take the following steps:

  1. For Exit behavior, select the condition on which the Flow proceeds down the found exit.
  2. For Output data options, select the appropriate options to configure the output structure.
  3. In Output data structure, ensure that the output structure suits your application.`

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field variable. Thus you can access the output JSON object from any point of your Flow. To learn more about this Step's output, see the Output example.

Skip logic exit

Use this setting to handle cases where duplicate Merge field variable names exist in your Flow, whereas the previously defined variable holds value.

By default, in such cases, the Step overwrites the existing variable with the new value. Another option is to skip the Step execution and direct the Flow down the selected exit. To do so, follow these steps:

  1. Enable the Skip step execution if existing merge field has data toggle.
  2. In the Skip logic exit list, select exit to direct the Flow.

Output example

The Step's output contains information about each part of speech, including its tag, start and end points in the text, and confidence score.

For example, using the input text "John ordered two sandwiches," the Step returns the following JSON object:

json
{
  "count": 4,
  "byOrder": [
    {
      "tokenId": 1,
      "text": "John",
      "beginOffset": 0,
      "endOffset": 4,
      "partOfSpeech": {
        "tag": "propn",
        "score": 0.9999381303787231
      }
    },
    {
      "tokenId": 2,
      "text": "ordered",
      "beginOffset": 5,
      "endOffset": 12,
      "partOfSpeech": {
        "tag": "verb",
        "score": 0.9995881915092468
      }
    },
    {
      "tokenId": 3,
      "text": "two",
      "beginOffset": 13,
      "endOffset": 16,
      "partOfSpeech": {
        "tag": "num",
        "score": 0.9999324083328247
      }
    },
    {
      "tokenId": 4,
      "text": "sandwiches",
      "beginOffset": 17,
      "endOffset": 27,
      "partOfSpeech": {
        "tag": "noun",
        "score": 0.9993805885314941
      }
    }
  ]
}
{
  "count": 4,
  "byOrder": [
    {
      "tokenId": 1,
      "text": "John",
      "beginOffset": 0,
      "endOffset": 4,
      "partOfSpeech": {
        "tag": "propn",
        "score": 0.9999381303787231
      }
    },
    {
      "tokenId": 2,
      "text": "ordered",
      "beginOffset": 5,
      "endOffset": 12,
      "partOfSpeech": {
        "tag": "verb",
        "score": 0.9995881915092468
      }
    },
    {
      "tokenId": 3,
      "text": "two",
      "beginOffset": 13,
      "endOffset": 16,
      "partOfSpeech": {
        "tag": "num",
        "score": 0.9999324083328247
      }
    },
    {
      "tokenId": 4,
      "text": "sandwiches",
      "beginOffset": 17,
      "endOffset": 27,
      "partOfSpeech": {
        "tag": "noun",
        "score": 0.9993805885314941
      }
    }
  ]
}

Error Handling

By default, the Step handles errors using a separate exit. So if any error occurs during the Step execution, the Flow proceeds down the error exit.

Note: If you disable the Handle error toggle, the Step does not handle errors. With this setup, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow's timeout. To prevent the Flow from being suspended while continuing to handle errors in the Flow, place the Flow Error Handling Step before the main Flow logic.

Reporting

The Step reports once after its execution. You can change the Step log level and add new tags in the section.

Log level

By default, the Step inherits its log level from Flow's log level. You can change the Step's log level by selecting an appropriate option from the Log level list.

Tags

Tags help organize and filter session information when generating reports. You can specify the tag category, label, and value when adding a new tag.

Service dependencies

  • flow builder - v2.28.3
  • event-manager - v2.3.0
  • deployer - v2.6.0
  • comprehend provider - v0.9.0

Release notes

v1.0.0

  • Initial release