Skip to content

Latest commit

 

History

History
124 lines (104 loc) · 7.51 KB

V5_Annotation_Message_Moment.md

File metadata and controls

124 lines (104 loc) · 7.51 KB
copyright link is
Copyright IBM Corp. 2017
moment-annotation
published

Moment Annotation

Moment Annotations use the type conversation-moment to mark the beginning of a moment.

Here's a sample of an annotation created by the Moments service:

{
  "type":"conversation-moment",
  "momentVersion":6,
  "algorithm":"timegap",
  "annotationId":"5810ed1fe4b04572602fed37",
  "momentId":"b77cbc8413e94d71914a89cb4044cb19",      
  "spaceId":"5810d788e4b0f043f15a9db9",   
  "created":1477504287785,
  "createdBy":"toscana-service-moment-client-id",
  "participants":[{"authorId":"77af0940-d169-102c-9081-f4ee77450791","messageCount":7}],
  "startMessage":{"messageId":"5810dd7be4b04572602fd830","published":1477500283896},
  "endMessage":{"messageId":"5810de1ce4b04572602fd8f6","published":1477500444098},  
  "lastUpdatedMessage":{"messageId":"5810de1ce4b04572602fd8f6","published":1477500444098},    
  "hidden":false,  
  "momentSummary": {
       "phrases":[{"label":"Copy Code","source":"keyword","score":0.963834},
                  {"label":"HTML injection","source":"entity","score":0.890297,"count":9,"category":"FieldTerminology"},
                  {"label":"BR SIZE=","source":"keyword","score":0.805287},
                  {"label":"code injection","source":"keyword","score":0.799173},
                  {"label":"DIV STYLE=","source":"keyword","score":0.794744},
                  {"label":"web browser","source":"keyword","score":0.7891},
                  {"label":"JavaScript code injection","source":"keyword","score":0.773707},
                  {"label":"web site","source":"keyword","score":0.754299},
                  {"label":"JavaScript Injection Skynet_Code","source":"keyword","score":0.744211},
                  {"label":"JavaScript injection techniques","source":"keyword","score":0.73713},
                  {"label":"Hide   Copy Code","source":"keyword","score":0.689092},
                  {"label":"Copy Code javascript","source":"keyword","score":0.651055},
                  {"label":"web site vulnerabilities","source":"keyword","score":0.649865},
                  {"label":"malicious JavaScript code","source":"keyword","score":0.637241},
                  {"label":"dynamic web sites","source":"keyword","score":0.615021},
                  {"label":"HTML content","source":"keyword","score":0.614882},
                  {"label":"completely vulnerable site","source":"keyword","score":0.614591},
                  {"label":"common code insertion","source":"keyword","score":0.613945},
                  {"label":"widely used technology","source":"keyword","score":0.598923},
                  {"label":"dangerous HTML tag","source":"keyword","score":0.588816},
                  {"label":"web browser elements","source":"keyword","score":0.581691},
                  {"label":"common weak point","source":"keyword","score":0.578318},
                  {"label":"img src=http","source":"keyword","score":0.573649},
                  {"label":"Sandbox security layer","source":"keyword","score":0.571159},
                  {"label":"JavaScript code","source":"entity","score":0.503471,"count":2,"category":"FieldTerminology"},
                  {"label":"JavaScript engine","source":"keyword","score":0.487251},
                  {"label":"ArticleBrowse CodeStatsRevisions","source":"keyword","score":0.48564},
                  {"label":"asHTMLJavascriptSysAdminDevweb-securityStats188.2K views43","source":"keyword","score":0.485259},
                  {"label":"JavaScript functions","source":"keyword","score":0.476962}],
       "mostRelevantMessage":{"messageId":"5810ddcae4b04572602fd8ac","published":1477500362491}
  },

}

Moment Annotation

The moment annotation is the structure added as an annotation to the first message in the moment. The definition of the moment annotation references several other structures detailed below.

See also Annotation for information on common annotation fields.

property type description
type String For a moment annotation, the type will be conversation-moment.
momentId ID An autogenerated unique ID for this moment. This may be used by clients to track changes to a moment over time as it is updated
momentVersion Number The schema version for this moment
algorithm String An identifier of the algorithm used to create this moment
spaceId ID The ID of the space to which this moment belongs
participants [MomentParticipant] An array of participants to the moment.
startMessage MomentMessageReference The first message in the moment
endMessage MomentMessageReference The last message in the moment
lastUpdatedMessage MomentMessageReference The last message processed as part of the moment summary - will be the same as the endMessage if the moment has ended
hidden Boolean Clients may decide to not show moments marked as hidden
momentSummary MomentSummary Summarizes the conversation and events in the moment

MomentParticipant

A MomentParticipant contains information about a user or app and their level of participation in the moment.

property type description
authorId ID The ID of an author of part of the moment, if the author is a user of Watson Work Services
messageCount Number The number of messages sent by this author in this moment
source String An optional source of the user information
actorName String An optional user name provided by another source
actorUrl String An optional URL to the user from another source
actorAvatar String An optional URL of the avatar from another source

MomentSummary

The MomentSummary contains information extracted from and derived from the conversation occurring in the moment.

property type description
mostRelevantMessage MomentMessageReference The mostRelevantMessage field specifies a message which Watson Work Services has identified as particularly relevant to this moment
phrases [MomentPhrase] An array of phrases identified to help summarize the moment, ordered by descending relevance

MomentPhrase

A MomentPhrase helps provide a label or summary for the moment. It's typically a set of key phrases or topics.

property type description
label String The content of the summary phrase
source String Currently, one of keyword or entity
count Number The number of occurrences of this phrase in the moment if available
category String More information about the phrase. For instance, the type of an entity

MomentMessageReference

A MomentMessageReference represents a reference in the moment annotation to a message.

property type description
messageId ID The ID of the message being referenced
published Date The date of publication for the referenced message

Note: The ID scalar type represents a unique identifier. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable