Commit 41d7fbdf authored by Gabriel Gutu-Robu's avatar Gabriel Gutu-Robu

Sentiment Analysis now sends data to the new API

parent 7d8c595d
......@@ -28,9 +28,6 @@
<textarea id="input_text" class="form-control" [(ngModel)]="formData.text" rows="12"></textarea>
</div>
</div>
<app-demo-common-fields [formData]="formData" [language]="language" [languages]="languages"
(advancedEmitter)="advancedEmitter($event)" (languageEmitter)="languageEmitter($event)">
</app-demo-common-fields>
<div class="row top-buffer">
<div class="col-xs-6 col-md-4 col-lg-3">
<label for="input_granularity">Granularity
......@@ -38,7 +35,7 @@
</label>
</div>
<div class="col-xs-6 col-md-4 col-lg-3">
<select id="input_granularity" class="form-control" [(ngModel)]="formData.granularity">
<select id="input_granularity" class="form-control" [(ngModel)]="formData.granularity" disabled>
<option *ngFor="let option of granularities" [ngValue]="option">{{option.name}}</option>
</select>
</div>
......@@ -67,7 +64,17 @@
</div>
<div class="row">
<div class="col-xs-12 col-md-12">
<div id="sentiment-list">
<div id="progress-container">
<p class="progress-label">
Sentiment
</p>
<div class="progress">
<div class="progress-bar" role="progressbar" [attr.aria-valuenow]="sentimentScore"
[attr.aria-valuemin]="0" [attr.aria-valuemax]="1" [style.width.%]="sentimentScore*100">{{sentimentScore}}
</div>
</div>
</div>
<!-- <div id="sentiment-list">
<ul>
<li *ngFor="let element of response.data">
{{element.text}}
......@@ -96,7 +103,7 @@
</ul>
</li>
</ul>
</div>
</div> -->
</div>
</div>
</div>
......
......@@ -20,6 +20,7 @@ interface Granularity {
export class SentimentAnalysisComponent implements OnInit {
sentimentScore: number;
componentTitle: string;
formData: any;
@Input() advanced: boolean;
......@@ -77,7 +78,7 @@ export class SentimentAnalysisComponent implements OnInit {
const data = {
'text': this.formData['text'],
'language': this.formData['language'].value,
'lang': this.formData['language'].value,
'lsa': this.formData['lsa'].value,
'lda': this.formData['lda'].value,
'w2v': this.formData['word2vec'].value,
......@@ -97,6 +98,7 @@ export class SentimentAnalysisComponent implements OnInit {
}
this.showResults = true;
this.sentimentScore = response.data.prediction;
});
}
......
......@@ -26,7 +26,7 @@ export let SentimentAnalysisData = {
}
],
'defaultGranularity': function () {
return SentimentAnalysisData['granularities'][2];
return SentimentAnalysisData['granularities'][0];
},
'languages': [
DefaultInputData.languages[0], // en
......
......@@ -13,7 +13,7 @@
"pathDelimiter": "/",
"apiEndpoints": {
"sentimentAnalysis": "sentiment-analysis",
"sentimentAnalysis": "v2/sentiment",
"curriculumRecommendation": "v2/mass-customization",
"textualComplexity": "v2/textual-complexity",
"keywords": "v2/keywords",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment