Updating the view thread component

We are going to update clientappview-threadview-thread.component.html by adding the relevant response information. Add the following snippet after we display the segment LabelAnnotations:

// SNIPP SNIPP
<!-- Sentiment -->
<div *ngIf="message.nlpDocumentSentiment">
<b>Sentiment</b>:
<label class="badge badge-pill badge-success" *ngIf="message.nlpDocumentSentiment.score > 0.1">
Positive
</label>
<label class="badge badge-pill badge-info" *ngIf="message.nlpDocumentSentiment.score === 0">
Neutral
</label>
<label class="badge badge-pill badge-danger" *ngIf="message.nlpDocumentSentiment.score < 0.1">
Negative
</label>
</div>
<!-- Catgories -->
<div *ngIf="message.nlpCategories.length > 0">
<b>Categories</b>:
<label class="badge badge-pill badge-info" *ngFor="let c of message.nlpCategories">
{{c.name}}
</label>
</div>
<!-- Language -->
<div *ngIf="message.nlpLanguage">
<b>Language</b>:
<label class="badge badge-pill badge-default">
{{message.nlpLanguage}}
</label>
</div>
// SNIPP SNIPP

Next, add the following snippet after the transcriptions table:

// SNIPP SNIPP
<div class="table-responsive" *ngIf="message.nlpSentences.length > 0">
<table class="table table-bordered">
<thead class="thead-dark text-center">
<tr>
<th scope="col">Text</th>
<th scope="col">Sentiment</th>
</tr>
</thead>
<tbody>
<tr class="text-center" *ngFor="let s of message.nlpSentences">
<th>
{{s.text.content}}
</th>
<th>
<label class="badge badge-pill badge-success" *ngIf="s.sentiment.score > 0.1">
Positive
</label>
<label class="badge badge-pill badge-info" *ngIf="s.sentiment.score === 0">
Neutral
</label>
<label class="badge badge-pill badge-danger" *ngIf="s.sentiment.score < 0.1">
Negative
</label>
</th>
</tr>
</tbody>
</table>
</div>
// SNIPP SNIPP

Save all the files to continue, and we are ready to test.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.142.85