Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Commit

Permalink
Merge pull request #12 from swgraham/master
Browse files Browse the repository at this point in the history
Fixes for Issue# 3 & #5
  • Loading branch information
rhagarty authored Aug 22, 2017
2 parents 830dbfb + a2d29f0 commit edcd72b
Show file tree
Hide file tree
Showing 16 changed files with 26 additions and 5,378 deletions.
4 changes: 2 additions & 2 deletions lib/enricher/NLU.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const alchemyTypedRelations = (text) => {
const params = {
model: process.env.ALCHEMY_MODEL,
//model: 'ie-en-news',
text: (text === 'test') ? test_text : text,
text: (text === 'test') ? 'Random test text to enrich': text,
};
return new Promise((resolve, reject) => {
alchemy_language.typedRelations(params, function(err, response) {
Expand Down Expand Up @@ -160,7 +160,7 @@ const combinedCall = (text) => {
// Combined call
// ------------
const parameters = {
text: (text === 'test') ? test_text : text,
text: (text === 'test') ? 'Random text to enrich for test': text,
'features': {
'concepts': {},
'entities': {},
Expand Down
2 changes: 2 additions & 0 deletions public/app/controllers/EpisodeController.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
var vm = this;
vm._mdPanel = $mdPanel;
vm.episode = {};
// Disable enrichment...
vm.enrichDisabled=true
vm.refresh = function() {
vm.episode = VideoLoaderService.getCurrentEpisode();
}
Expand Down
58 changes: 8 additions & 50 deletions public/app/views/episode.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
.demo-md-panel {
min-height: 500px;
}

.demo-dialog-example {
background: white;
border-radius: 4px;
box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 13px 19px 2px rgba(0, 0, 0, 0.14), 0 5px 24px 4px rgba(0, 0, 0, 0.12);
width: 500px;
}

.demo-dialog-content {
padding: 0 15px;
height: 600px;
width: 100%;
}


.demo-dialog-button {
width: 100%;
}

.demo-menu-example {
background: white;
border-radius: 4px;
box-shadow: 0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 13px 19px 2px rgba(0, 0, 0, 0.14), 0 5px 24px 4px rgba(0, 0, 0, 0.12);
width: 256px;
}

.demo-menu-item {
align-items: center;
cursor: pointer;
Expand All @@ -38,12 +38,12 @@
transition: background 0.15s linear;
width: auto;
}

.demo-menu-item:hover,
.demo-menu-item:focus {
background-color: rgb(238, 238, 238);
}

.demo-menu-item.selected {
color: rgb(16, 108, 200);
}
Expand Down Expand Up @@ -90,48 +90,6 @@ <h2> {{ctrl.episode.title}}</h2>
<md-tab label="Enrichment" ng-click="ctrl.getEpisodeEnrichment()">
<watson-metadata-viewer watson-metadata="ctrl.episode.full_enrichment"></watson-metadata-viewer>
</md-tab>
<md-tab ng-click="ctrl.getSocialEnrichment()">
<md-tab-label>
<div>
Social
</div>
</md-tab-label>
<md-tab-body>
<md-content>
<md-card>
<md-card-header>
<md-progress-circular ng-disabled="!ctrl.loadingSocial" class="md-hue-2" md-diameter="20px"></md-progress-circular>
<md-card-header-text>
<span class="md-title">{{ctrl.getTitle()}}</span>
<span class="md-subhead">Negative Tweets: {{ctrl.social.sentiment.negativeRatio|number:2}}%</span>
<span class="md-subhead">Neutral Tweets: {{ctrl.social.sentiment.neutralRatio|number:2}}%</span>
<span class="md-subhead">Positive Tweets: {{ctrl.social.sentiment.positiveRatio|number:2}}%</span>
</md-card-header-text>
</md-card-header>
<md-card-content>
<md-divider></md-divider>
<p class="md-body-1">Top 5 Keywords</p>
<p ng-repeat="k in ctrl.social.keywords.rows | orderBy: '-value' | limitTo:5" class="md-caption">
{{k.key}}
</p>
<md-divider></md-divider>
<p class="md-body-1">Top 5 Concepts</p>
<p ng-repeat="k in ctrl.social.concepts.rows | orderBy: '-value' | limitTo:5" class="md-caption">
{{k.key}}
</p>
<md-divider></md-divider>
<p class="md-body-1">Top 5 Taxonomy</p>
<p ng-repeat="k in ctrl.social.taxonomy.rows | orderBy: '-value' | limitTo:5" class="md-caption">
{{k.key}}
</p>
</md-card-content>
</md-card>
</md-content>
</md-tab-body>
</md-tab>
<md-tab label="External" ng-click="ctrl.getSocialEnrichment()">
<watson-external-sources external="ctrl.external_sources"></watson-external-sources>
</md-tab>
</md-tabs>
</div>
<div layout="row" class="demo-dialog-button">
Expand Down
Loading

0 comments on commit edcd72b

Please sign in to comment.