Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
Conversation Chat Entity Addition
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishant Shuke authored and Nishant Shuke committed Sep 2, 2020
1 parent 8150682 commit 28bcfcf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
5 changes: 5 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Bug fixes

## Major Features and Improvements

* [223](https://github.com/navigateconsulting/eva/pull/223) Added authentication for mongo, and redis containers<br/>
Lazy loading for conversations API and UI<br/>
Changes In Routes (Separate for each component eg: Actions, Conversations, Projects, etc.)<br/>
CSS Tweaks in Conversations Chat Components
Added Entity Display feature respective to the intent selected in the chat

## Bug Fixes and Other Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
</mat-panel-title>
</mat-expansion-panel-header>
<br />
<table *ngIf="conversation_json" class="table table-striped">
<table *ngIf="conversation_json && showAllIntentEntities" class="table table-striped">
<thead>
<tr>
<th scope="col">Key</th>
Expand All @@ -176,6 +176,20 @@
</tr>
</tbody>
</table>
<table *ngIf="!showAllIntentEntities && showIntentEntitiesData.length" class="table table-striped">
<thead>
<tr>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let entity of showIntentEntitiesData">
<th scope="row">{{ entity.entity }}</th>
<td>{{ entity.value }}</td>
</tr>
</tbody>
</table>
</mat-expansion-panel>
</mat-accordion>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ export class ConversationChatComponent implements OnInit {
predictions: any;
userBotCardType: string;
userBotCardText: string;
private userBotCardTime;
userBotCardTime;
userBotCardIntent: string;
userBotCardConfidence: string;
showAllIntentEntities = true;
showIntentEntitiesData: [];

constructor(public sharedDataService: SharedDataService,
public _router: Router,
Expand Down Expand Up @@ -74,6 +76,12 @@ export class ConversationChatComponent implements OnInit {
this.userBotCardTime = new Date(Math.floor(this.chats[chat_row_index]['timestamp']) * 1000);
this.userBotCardIntent = this.chats[chat_row_index]['parse_data']['intent']['name'];
this.userBotCardConfidence = this.chats[chat_row_index]['parse_data']['intent']['confidence'];
if (this.chats[chat_row_index]['parse_data']['entities'].length >= 1) {
this.showIntentEntitiesData = this.chats[chat_row_index]['parse_data']['entities']
} else {
this.showIntentEntitiesData = [];
}
this.showAllIntentEntities = false;
// tslint:disable-next-line: max-line-length
this.predictions = { text: this.chats[chat_row_index]['parse_data']['text'], intent_ranking: this.chats[chat_row_index]['parse_data']['intent_ranking'] };
this.showUserBotCardDetails = true;
Expand Down
2 changes: 0 additions & 2 deletions ui-trainer/src/app/conversations/conversations.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ export class ConversationsComponent implements OnInit, OnDestroy {
}
}
getConversations() {
console.log(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize'));
this.apiService.requestConversations(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')).subscribe(conversations => {
if (conversations) {
console.log(conversations);
this.conversations_json = conversations.sort(function (a, b) {
var x = a['latest_event_time']; var y = b['latest_event_time'];
return ((x > y) ? -1 : ((x < y) ? 1 : 0));
Expand Down

0 comments on commit 28bcfcf

Please sign in to comment.