analyzed-conversation-viewer
v1.0.7
Published
<br> analyzed-conversation-viewer is a UI component that hel you display a conversation analysis through multiple aspects like the conversation sentiment, conversation personally identifiable information (PII), and conversation summary
Downloads
11
Readme
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
| Name | Type | Description | Default 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
| Name | Type | | ------------ | ----------------------------------------------------------- | | text | string | | speakerTitle | string | | redactedText | string | | entities | NamedEntity[] | | sentiment | SentimentTypes | | duration | { minutes: number; seconds: number;} |
## NamedEntity
| Name | Type | | --------------- | ------ | | text | string | | offset | number | | length | number | | category | string | | subcategory | string | | confidenceScore | number |
## 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:
the nice annotations are made by the annotator library