Amazon Comprehend
Editors use tags and sections to group assets into categories. When an asset has a tag, visitors can click on the tag and view a list of other assets associated with that tag.
You can manually associate tags and sections with your assets, a labor-intensive effort if you create dozens of assets every day. You can instead automatically generate tags and sections by integrating Amazon Comprehend with Brightspot. Brightspot sends the text in your asset to Amazon Comprehend, and subsequently receives the suggested tags. You can then accept or reject the suggestions, and add your own tags and sections as necessary.
Referring to the previous example, Amazon Comprehend analyzed the body text, and returned suggested terms for sections and tags such as Gulf Stream
, North Atlantic
, and Gulf of Mexico
.
Including Amazon Comprehend in a Brightspot build
The following table lists the dependencies to include in your build configuration.
Artifact | Description |
com.psddev:suggestions-comprehend | Exposes Amazon Comprehend as a suggestions provider. |
com.psddev:suggestions-core | Exposes the SuggestionProvider interface that manages the interaction between Brightspot and Amazon Comprehend. |
Runtime prerequisites
- Developer configuration—
- Classes that editors send to Amazon Comprehend must implement the
Suggestable
interface. - Fields that are assigned suggested terms must be specified in a class-level
@SuggestionsInitField
annotation. For example, to assign a suggestion to the fieldTag.displayName
, ensure the classTag
is annotated with@SuggestionsInitField("displayName")
. - If the field being assigned a suggested term is a class, annotate the class with
@ToolUi.Suggestions
. - The following code samples provide a comprehensive example:
@SuggestionsInitField("baz") public class Foo { private String baz; }
-
Assigns a suggestion to the field
baz
.
public class Bar implements Suggestable { @ToolUi.Suggestions private Foo foo; private String text; String getSuggestableText() { return text; } }
-
Enables instances of
Bar
to be sent to Amazon Comprehend. -
Assigns suggested text to the associated instance of
Foo
.
-
- In standard versions of Brightspot, these annotations are already implemented for
Section.displayName
andTag.displayName
.
- Classes that editors send to Amazon Comprehend must implement the
- Ops configuration—Configure a policy and role in your AWS console. The role's policy should allow access to the relevant S3 bucket and the Comprehend service. For details, see Creating a role to delegate permissions to an AWS service and Creating IAM policies (console).
- CMS configuration—Configure the site interfacing with Amazon Comprehend. For details, see Configuring the Comprehend integration.
See also: