1.0.7 • Published 1 year ago

analyzed-conversation-viewer v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

analyzed-conversation-viewer

the target of this component is to gather the analysis resulting from the different services in one place to give the user the needed information for each sentence and the overall conversation.


Props

NameTypeDescriptionDefault value
result{ sentences: SentenceType[] }the main object to display
labels{ onText?: string; offText?: string; hidePii?: string; piiDescription?: string; sentimentHeader?: string; transcriptHeader?: string; sentimentDescription?: string;}Optional - pass the labels you want to be displayed instead the default ones{ onText: 'On', offText: 'Off', hidePii: 'Hide PII', sentimentHeader: 'Sentiment', transcriptHeader: 'Transcript', piiDescription: 'Sensitive information across several pre-defined categories is detected and redacted from the transcript.', sentimentDescription: 'Sensitive information across several pre-defined categories is detected and redacted from the transcript.'}

## SentenceType

NameType
textstring
speakerTitlestring
redactedTextstring
entitiesNamedEntity[]
sentimentSentimentTypes
duration{ minutes: number; seconds: number;}

## NamedEntity

NameType
textstring
offsetnumber
lengthnumber
categorystring
subcategorystring
confidenceScorenumber

## SentimentTypes

Examples

Here is a usage example:

const conversationResult = {
  sentences: [
    {
      sentiment: "positive",
      speakerTitle: "Speaker 1",
      duration: { minutes: 0, seconds: 2 },
      text: "Hi thank you for calling Bank of Contoso. Hello my name is Mary. How can I help you today?",
      redactedText: "Hi thank you for calling Bank of Contoso. Hello my name is ****. How can I help you today?",
      entities: [
        { category: "Person", confidenceScore: 0.9, length: 4, offset: 59, text: "Mary" },
        { category: "Organization", confidenceScore: 0.9, length: 15, offset: 25, text: "Bank of Contoso" },
      ],
    },
    {
      entities: [],
      sentiment: "neutral",
      speakerTitle: "Speaker 2",
      duration: { minutes: 0, seconds: 2 },
      text: "I would like to know my remaining balance in my checking account.",
      redactedText: "I would like to know my remaining balance in my checking account.",
    },
  ],
};

return <AnalyzedConversationViewer result={conversationResult} />;

and the view will be like:

image.png

the nice annotations are made by the annotator library

Related topics