Select Entities at Runtime

In Named Entity Recognition Server, you can specify many configuration settings as query parameters in the ACI request, which allows you to customize the extraction behavior for an individual action.

For example:

http://localhost:13000/?action=EduceFromFile&MatchCase=True&Grammars=place_albal.ecr

When you set a parameter as part of an action, it overrides the corresponding parameter value in the configuration file.

For information about all the actions and action parameters that are available with Named Entity Recognition Server, refer to the Named Entity Recognition Server Reference.

Change the Grammars and Entities

You can use the Grammars and Entities action parameters to specify a subset of your configured grammars or entities.

  • Grammars. This action parameter corresponds to the ResourceFiles configuration parameter. You set Grammars to a comma-separated list of grammar files to load, and Named Entity Recognition uses all the entities in the selected grammar files, including entities not set in your configuration file. The grammar files must already exist in your configuration file.

    Grammars=GrammarFile[,GrammarFile2]

  • Entities. You set Entities to a comma-separated list of entities. In this case, Named Entity Recognition uses only the specified entities. The entities and corresponding grammar files must already exist in your configuration file.

NOTE: If you set both Entities and Grammars, Named Entity Recognition ignores the Grammars parameter and uses only the specified entities.

You can use wildcard expressions in the Grammars or Entities parameters. You can use the * wildcard to match any number of characters, or the ? wildcard to match a single character. For example:

action=EduceFromText&Text=I thought it was a bad idea. Es ist nicht gut.&Grammars=sentiment_*.ecr

This example uses all the available sentiment grammars for the extraction.