Start of change

ExtractTextNLP

The action calls the Natural Language Processing (NLP) API and passes in text from a single page at a time. The results are saved as entities in the page's layout XML file. Use the FindExtractedText action to populate fields with results of this action. To extract from non-English-language text, set the page variablehr_locale to the wanted language before calling this action. For example, for the Japanese language, call rrset("ja","@P.hr_locale").

Syntax

bool ExtractTextNLP (string options, string model)

Parameter text features

No parameter - returns all results

  • entities
  • keywords
  • categories
  • concepts
  • semantic_roles
  • relations

Variables

Timeout
The default timeout is 150 seconds. You can specify the timeout by saving a page variable called nlpTimeout and specifying the time in milliseconds.
Save Response
The response from NLPAPI can be saved by setting the variable nlpSaveResponse to 1.

Returns

True if the layout is loaded and there are no errors. Otherwise, False.

Level

Document or page.

Details

Important: You must have an enterprise NLP license to use this action. This license is obtained by creating an account on bluemix.net and adding the NLP service to a workspace. The URL and key are shown on the Service Credentials page. Enter the credentials in Datacap Application Manager:

You can deploy Watson Knowledge Studio custom model to override default model.

Entities are named by using the format NLPFeature.ResponseNode. For example, an entity result for a person has the name Entity.Person. Most entity fields are named by using the node returned by NLPAPI. Nested responses are flattened to one level. For example, the disambiguated sub type is named subTypes and the results are saved as a comma-separated list.

When called on the document or page, the text of the layout XML file specified in the calling object's layout variable will be sent to NLPAPI.

The results will be saved to the entities list of the page in the layout XML file.

To populate a field with a result of this action, use the FindExtractedText action.

Example

Recognize()
AnalyzeLayout()
ExtractTextNLP()
FindExtractedText()
End of change