TextLinkifyEvent
class TextLinkifyEvent : TextClassifierEvent, Parcelable
This class represents events that are related to the smart linkify feature.
// User clicked on a link.
new TextLinkifyEvent.Builder(TYPE_LINK_CLICKED)
.setEventContext(classificationContext)
.setResultId(textClassification.getId())
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setEventIndex(0)
.build();
// Smart (contextual) actions presented to the user in response to a link click.
new TextLinkifyEvent.Builder(TYPE_ACTIONS_SHOWN)
.setEventContext(classificationContext)
.setResultId(textClassification.getId())
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setActionIndices(range(textClassification.getActions().size()))
.setEventIndex(1)
.build();
// User chooses smart action at index 0.
new TextLinkifyEvent.Builder(TYPE_SMART_ACTION)
.setEventContext(classificationContext)
.setResultId(textClassification.getId())
.setEntityTypes(textClassification.getEntity(0))
.setScore(textClassification.getConfidenceScore(entityType))
.setActionIndices(0)
.setEventIndex(2)
.build();
Summary
Properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]