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

Commit 28bcfcf

Browse files
Nishant ShukeNishant Shuke
authored andcommitted
Conversation Chat Entity Addition
1 parent 8150682 commit 28bcfcf

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

RELEASE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Bug fixes
2929

3030
## Major Features and Improvements
3131

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

3338
## Bug Fixes and Other Changes
3439

ui-trainer/src/app/conversation-chat/conversation-chat.component.html

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
</mat-panel-title>
162162
</mat-expansion-panel-header>
163163
<br />
164-
<table *ngIf="conversation_json" class="table table-striped">
164+
<table *ngIf="conversation_json && showAllIntentEntities" class="table table-striped">
165165
<thead>
166166
<tr>
167167
<th scope="col">Key</th>
@@ -176,6 +176,20 @@
176176
</tr>
177177
</tbody>
178178
</table>
179+
<table *ngIf="!showAllIntentEntities && showIntentEntitiesData.length" class="table table-striped">
180+
<thead>
181+
<tr>
182+
<th scope="col">Key</th>
183+
<th scope="col">Value</th>
184+
</tr>
185+
</thead>
186+
<tbody>
187+
<tr *ngFor="let entity of showIntentEntitiesData">
188+
<th scope="row">{{ entity.entity }}</th>
189+
<td>{{ entity.value }}</td>
190+
</tr>
191+
</tbody>
192+
</table>
179193
</mat-expansion-panel>
180194
</mat-accordion>
181195
</div>

ui-trainer/src/app/conversation-chat/conversation-chat.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ export class ConversationChatComponent implements OnInit {
2323
predictions: any;
2424
userBotCardType: string;
2525
userBotCardText: string;
26-
private userBotCardTime;
26+
userBotCardTime;
2727
userBotCardIntent: string;
2828
userBotCardConfidence: string;
29+
showAllIntentEntities = true;
30+
showIntentEntitiesData: [];
2931

3032
constructor(public sharedDataService: SharedDataService,
3133
public _router: Router,
@@ -74,6 +76,12 @@ export class ConversationChatComponent implements OnInit {
7476
this.userBotCardTime = new Date(Math.floor(this.chats[chat_row_index]['timestamp']) * 1000);
7577
this.userBotCardIntent = this.chats[chat_row_index]['parse_data']['intent']['name'];
7678
this.userBotCardConfidence = this.chats[chat_row_index]['parse_data']['intent']['confidence'];
79+
if (this.chats[chat_row_index]['parse_data']['entities'].length >= 1) {
80+
this.showIntentEntitiesData = this.chats[chat_row_index]['parse_data']['entities']
81+
} else {
82+
this.showIntentEntitiesData = [];
83+
}
84+
this.showAllIntentEntities = false;
7785
// tslint:disable-next-line: max-line-length
7886
this.predictions = { text: this.chats[chat_row_index]['parse_data']['text'], intent_ranking: this.chats[chat_row_index]['parse_data']['intent_ranking'] };
7987
this.showUserBotCardDetails = true;

ui-trainer/src/app/conversations/conversations.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ export class ConversationsComponent implements OnInit, OnDestroy {
4848
}
4949
}
5050
getConversations() {
51-
console.log(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize'));
5251
this.apiService.requestConversations(+localStorage.getItem('conversations_pageIndex'), +localStorage.getItem('conversations_pageSize')).subscribe(conversations => {
5352
if (conversations) {
54-
console.log(conversations);
5553
this.conversations_json = conversations.sort(function (a, b) {
5654
var x = a['latest_event_time']; var y = b['latest_event_time'];
5755
return ((x > y) ? -1 : ((x < y) ? 1 : 0));

0 commit comments

Comments
 (0)