{"id":28698,"date":"2019-04-30T00:00:00","date_gmt":"2019-04-29T22:00:00","guid":{"rendered":"https:\/\/blexin.com\/lost-in-translations-traduzione-e-sentiment-analysis-in-tempo-reale\/"},"modified":"2021-05-20T19:18:23","modified_gmt":"2021-05-20T17:18:23","slug":"lost-in-translations-translation-and-sentiment-analysis-in-real-time","status":"publish","type":"post","link":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/","title":{"rendered":"Lost in Translations: translation and Sentiment Analysis in real time"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"608\" data-attachment-id=\"28685\" data-permalink=\"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/attachment\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&amp;ssl=1\" data-orig-size=\"1024,608\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"13a5ce76-34c7-4bd2-93fd-374d7a0569b7\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?resize=1024%2C608&#038;ssl=1\" alt=\"\" class=\"wp-image-28685\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png 1024w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7-980x582.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7-480x285.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"introduzione\">Foreword<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s go on with our journey in the&nbsp;<strong>cognitive services<\/strong>&nbsp;world (<a href=\"https:\/\/www.blexin.com\/it-IT\/Article\/Blog\/Riconoscimento-delle-immagini-nel-Cloud-24\" target=\"_blank\" rel=\"noreferrer noopener\">read the previous article<\/a>), This time, we start from an&nbsp;<strong>Angular<\/strong>&nbsp;project. We will use&nbsp;<strong>Google Translate API&nbsp;<\/strong>to translate the text inserted in a text-area in real-time, taking advantage of Angular Reactive Forms and we will undergo the same text to a&nbsp;<strong>Sentiment Analysis&nbsp;<\/strong>at once, thanks to the&nbsp;<strong>Text Analytics API<\/strong>&nbsp;in&nbsp;<strong>Azure<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To use Google translation services, it is needed to create a project in GCP console, in which to enable the Cloud Translation API. In the project\u2019s configuration panel, it is possible to extract the key to insert in http calls. The documentation of doable REST calls is available to the following&nbsp;<a href=\"https:\/\/cloud.google.com\/translate\/docs\/reference\/rest\/v2\/translate\" target=\"_blank\" rel=\"noreferrer noopener\">link<\/a>. Starting from it, we create two Typescript interfaces, in order to manage the request and the response.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nexport interface GoogleTranslateRequest {\n\u00a0\u00a0q: string;\n\u00a0\u00a0source: string;\n\u00a0\u00a0target: string;\n\u00a0\u00a0format: string;\n}\n<\/pre><\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nexport interface Translation {\n\u00a0\u00a0translatedText: string;\n}\n\u00a0\nexport interface Data {\n\u00a0\u00a0translations: Translation&#x5B;];\n}\n\u00a0\nexport interface GoogleTranslateResponse {\n\u00a0\u00a0data: Data;\n\u00a0\u00a0language: string;\n}\n<\/pre><\/div><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We create then a service to run the REST call through the Angular HttpClientModule. It is important to note how the environment has been imported, to recover the service\u2019s URL and the key from the environment file. The class has a&nbsp;<em>translate<\/em>&nbsp;method which returns an Observable&lt;GoogleTranslateResponse&gt;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n@Injectable({\n\u00a0\u00a0providedIn: &#039;root&#039;\n})\nexport class GoogleService {\n\u00a0\n\u00a0\u00a0url = environment.googleTranslateUrl + environment.googleApiKey;\n\u00a0\n\u00a0\u00a0constructor(private http: HttpClient) {}\n\u00a0\n\u00a0\u00a0translate(obj: GoogleTranslateRequest): Observable&lt;GoogleTranslateResponse&gt; {\n\u00a0\u00a0\u00a0\u00a0return this.http.post&lt;GoogleTranslateResponse&gt;(this.url, obj);\n\u00a0\u00a0}\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"il-servizio-di-sentiment-analysis-di-azure-text-analytics\">The Azure Text Analytics sentiment analysis service<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">From the Azure portal is possible to add a new resource of&nbsp;<strong>Artificial intelligence and Machine Learning type, Text Analyze<\/strong>. A URL and a key for the REST call will be linked to this resource.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this case too, we create an interface for the request and another one for the response<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nexport interface AzureSentimentRequest {\n\u00a0\u00a0documents: AzureSentimentDocument&#x5B;];\n}\n\u00a0\nexport interface AzureSentimentDocument {\n\u00a0\u00a0language: string;\n\u00a0\u00a0id: number;\n\u00a0\u00a0text: string;\n}\n<\/pre><\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nexport interface Document {\n\u00a0\u00a0id: string;\n\u00a0\u00a0score: number;\n}\n\u00a0\nexport interface AzureSentimentResponse {\n\u00a0\u00a0documents: Document&#x5B;];\n\u00a0\u00a0errors: any&#x5B;];\n}\n<\/pre><\/div><\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">We create then a service called Azureservice, that makes available a method called analyze. Languages and text to be analyzed should be passed to this method and it will return a Observable&lt;AzureSentimentResponse&gt;.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\n@Injectable({\n\u00a0\u00a0providedIn: &#039;root&#039;\n})\nexport class AzureService {\n\u00a0\n\u00a0\u00a0httpOptions = {\n\u00a0\u00a0\u00a0\u00a0headers: new HttpHeaders({ &#039;Ocp-Apim-Subscription-Key&#039;: environment.azureTextAnalyticsKey,\n\u00a0\u00a0\u00a0\u00a0&#039;Content-Type&#039;: &#039;application\/json&#039;,\n\u00a0\u00a0\u00a0\u00a0Accept: &#039;application\/json&#039;\n\u00a0\u00a0})};\n\u00a0\n\u00a0\u00a0constructor(private http: HttpClient) {}\n\u00a0\n\u00a0\u00a0analize(lang: string, textInput: string): Observable&lt;AzureSentimentResponse&gt; {\n\u00a0\n\u00a0\u00a0\u00a0\u00a0const body: AzureSentimentRequest = {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0documents : &#x5B;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{id: 1,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0language: lang,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0text: textInput\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}]\n\u00a0\u00a0\u00a0\u00a0};\n\u00a0\u00a0\u00a0\u00a0return this.http.post&lt;AzureSentimentResponse&gt;(environment.azureTextAnalyticsUrl, body, this.httpOptions);\n\u00a0\u00a0}\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"il-componente\">The component<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In the app.module.ts we imported the ReactiveFormesModule, in order to make available, through an observable,&nbsp;the text to be analyzed originated from a textarea.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;div class=&quot;form-group&quot;&gt;\n\u00a0\u00a0&lt;label for=&quot;testoOriginale&quot;&gt;Testo da Tradurre&lt;\/label&gt;\n\u00a0\u00a0&lt;textarea class=&quot;form-control&quot; id=&quot;testoOriginale&quot; rows=&quot;3&quot; &#x5B;formControl]=&#039;testoOriginale&#039;&gt;&lt;\/textarea&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">In the typescript code of the component, we can declare<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\ntestoIstantaneo: Observable&lt;string&gt; = null;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">and then link to testoistantaneo the valueChanges of the formControl testoOriginale<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nthis.testoIstantaneo = this.testoOriginale.valueChanges;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Before we create the subscribe in our Observable, we insert a \u201cone second\u201d waiting time, starting from the last text input, so that the call to services would not be run any time you wrote a new letter in the textarea. This is possible thanks to the operator&nbsp;<strong>debounce()<\/strong>&nbsp;insert in&nbsp;<strong>pipe<\/strong>&nbsp;to the Observable.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nthis.testoIstantaneo.pipe( debounceTime(1000) ).subscribe(testo =&gt; {\n\u00a0\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">At this point, we are ready to run the calls to REST services in the subscribe. We request 4 translations: (from Italian to English, to Japanese, to Arabian, to Finnish), by the configuration of below objects:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nprivate impostaTraduzione() {\n\u00a0\u00a0\u00a0\u00a0this.impostazioniTraduzione = &#x5B;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ q: &#039;&#039;, source: &#039;it&#039;, target: &#039;en&#039;, format: &#039;text&#039; },\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ q: &#039;&#039;, source: &#039;it&#039;, target: &#039;ja&#039;, format: &#039;text&#039; },\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ q: &#039;&#039;, source: &#039;it&#039;, target: &#039;ar&#039;, format: &#039;text&#039; },\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ q: &#039;&#039;, source: &#039;it&#039;, target: &#039;fi&#039;, format: &#039;text&#039; }\n\u00a0\u00a0\u00a0\u00a0];\n\u00a0\u00a0}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">These are the calls<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\nthis.testoIstantaneo.pipe( debounceTime(1000) ).subscribe(testo =&gt; {\n\u00a0\u00a0\u00a0\u00a0\u00a0this.azureSentiment.analize(&#039;it&#039;, testo).subscribe((sentiments: AzureSentimentResponse) =&gt; {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.sentiments = sentiments;\n\u00a0\u00a0\u00a0\u00a0\u00a0});\n\u00a0\u00a0\u00a0\u00a0\u00a0this.traduzioni = &#x5B;];\n\u00a0\u00a0\u00a0\u00a0\u00a0this.impostazioniTraduzione.forEach(impostazione =&gt; {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0impostazione.q = testo;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.googleTanslatorService.translate(impostazione).subscribe((response: GoogleTranslateResponse) =&gt; {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0response.language = impostazione.target;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0this.traduzioni.push(response);\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0});\n\u00a0\u00a0\u00a0\u00a0\u00a0});\n\u00a0\u00a0\u00a0});\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The subscription makes available to the html template a translation array and an array including the sentiment analysis results.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;div class=&quot;form-group&quot;&gt;\n\u00a0\u00a0&lt;label for=&quot;testoOriginale&quot;&gt;Testo da Tradurre&lt;\/label&gt;\n\u00a0\u00a0&lt;textarea class=&quot;form-control&quot; id=&quot;testoOriginale&quot; rows=&quot;3&quot; &#x5B;formControl]=&#039;testoOriginale&#039;&gt;&lt;\/textarea&gt;\n&lt;\/div&gt;\n\u00a0\n&lt;div *ngIf=&quot;sentiments &amp;&amp; sentiments.documents&quot;&gt;\n\u00a0\u00a0&lt;div *ngFor=&quot;let sentiment of sentiments.documents&quot;&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;div class=&quot;progress&quot; style=&quot;margin-bottom: 10px&quot;&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;div class=&quot;progress-bar progress-bar-striped progress-bar-animated&quot;\u00a0 &#x5B;ngClass]=&quot;{\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#039;bg-success&#039;:sentiment.score &gt;= 0.50,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#039;bg-danger&#039;: sentiment.score &lt; 0.50}&quot;\u00a0 role=&quot;progressbar&quot; &#x5B;attr.aria-valuenow]=&quot;sentiment.score*100&quot; aria-valuemin=&quot;0&quot; aria-valuemax=&quot;100&quot;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#x5B;style.width.%]=&quot;sentiment.score*100&quot;&gt;&lt;\/div&gt;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&lt;\/div&gt;\n\u00a0\u00a0&lt;\/div&gt;\n&lt;\/div&gt;\n\u00a0\n&lt;div *ngFor=&quot;let traduzione of traduzioni&quot;&gt;\n\u00a0\u00a0&lt;app-translation &#x5B;traduzione]=&#039;traduzione&#039;&gt;&lt;\/app-translation&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The component app-translation is a bootstrap card, which displays the translation result.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;div class=&quot;card text-white bg-primary mb-3&quot;&gt;\n\u00a0\u00a0&lt;div class=&quot;card-header&quot;&gt;{{traduzione.language}}&lt;\/div&gt;\n\u00a0\u00a0&lt;div class=&quot;card-body&quot;&gt;\n\u00a0\u00a0\u00a0\u00a0&lt;p *ngIf=&quot;traduzione &amp;&amp; traduzione.data &amp;&amp; traduzione.data.translations &amp;&amp; traduzione.data.translations.length &gt;0&quot;\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0class=&quot;card-text&quot;&gt;{{traduzione.data.translations&#x5B;0].translatedText}}&lt;\/p&gt;\n\u00a0\u00a0&lt;\/div&gt;\n&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The progress bar will be green if the text analysis result is bigger or equal to 0,50 (that\u2019s to say if it expresses a positive mood), but it becomes red for lower values.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"621\" data-attachment-id=\"28692\" data-permalink=\"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/attachment\/pictures01-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures01.png?fit=1183%2C718&amp;ssl=1\" data-orig-size=\"1183,718\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pictures01\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures01.png?fit=1024%2C621&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures01.png?resize=1024%2C621&#038;ssl=1\" alt=\"\" class=\"wp-image-28692\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures01-1024x621.png 1024w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures01-980x595.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures01-480x291.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"609\" data-attachment-id=\"28694\" data-permalink=\"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/attachment\/pictures02-2\/\" data-orig-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures02.png?fit=1191%2C708&amp;ssl=1\" data-orig-size=\"1191,708\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"pictures02\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures02.png?fit=1024%2C609&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures02.png?resize=1024%2C609&#038;ssl=1\" alt=\"\" class=\"wp-image-28694\" srcset=\"https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures02-1024x609.png 1024w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures02-980x583.png 980w, https:\/\/blexin.com\/wp-content\/uploads\/2020\/12\/pictures02-480x285.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You can find all the code here:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-embed-handler wp-block-embed-embed-handler\"><div class=\"wp-block-embed__wrapper\">\n<a href=\"https:\/\/github.com\/sorrentmutie\/lost-translations\" rel=\"nofollow\">https:\/\/github.com\/sorrentmutie\/lost-translations<\/a>\n<\/div><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">See you next!!<\/p>\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>How to use Azure and Google in Cloud services to translate and the Sentiment Analysis from an Angular Client<\/p>\n","protected":false},"author":196716245,"featured_media":28685,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","_crdt_document":"","inline_featured_image":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wpas_customize_per_network":false,"jetpack_post_was_ever_published":false},"categories":[688637524],"tags":[688637390,688637381],"class_list":["post-28698","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog-en","tag-angular-en","tag-azure-en"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Lost in Translations: translation and Sentiment Analysis in real time - Blexin<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lost in Translations: translation and Sentiment Analysis in real time - Blexin\" \/>\n<meta property=\"og:description\" content=\"How to use Azure and Google in Cloud services to translate and the Sentiment Analysis from an Angular Client\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/\" \/>\n<meta property=\"og:site_name\" content=\"Blexin\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-29T22:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-20T17:18:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i1.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"608\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Salvatore Sorrentino\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Salvatore Sorrentino\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/\"},\"author\":{\"name\":\"Salvatore Sorrentino\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/354db2bc97cac71c2ceeca21a92d5bed\"},\"headline\":\"Lost in Translations: translation and Sentiment Analysis in real time\",\"datePublished\":\"2019-04-29T22:00:00+00:00\",\"dateModified\":\"2021-05-20T17:18:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/\"},\"wordCount\":535,\"image\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1\",\"keywords\":[\"Angular\",\"Azure\"],\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/\",\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/\",\"name\":\"Lost in Translations: translation and Sentiment Analysis in real time - Blexin\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1\",\"datePublished\":\"2019-04-29T22:00:00+00:00\",\"dateModified\":\"2021-05-20T17:18:23+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/354db2bc97cac71c2ceeca21a92d5bed\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/blexin.com\\\/wp-content\\\/uploads\\\/2020\\\/12\\\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1\",\"width\":1024,\"height\":608},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/blog-en\\\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blexin.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Lost in Translations: translation and Sentiment Analysis in real time\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/\",\"name\":\"Blexin\",\"description\":\"Con noi \u00e8 semplice\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blexin.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blexin.com\\\/en\\\/#\\\/schema\\\/person\\\/354db2bc97cac71c2ceeca21a92d5bed\",\"name\":\"Salvatore Sorrentino\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a6ec0dc827d2acaa55df9dbf1007e23f6fcb8c9436df52ab48274bb2221085bf?s=96&d=identicon&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a6ec0dc827d2acaa55df9dbf1007e23f6fcb8c9436df52ab48274bb2221085bf?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a6ec0dc827d2acaa55df9dbf1007e23f6fcb8c9436df52ab48274bb2221085bf?s=96&d=identicon&r=g\",\"caption\":\"Salvatore Sorrentino\"},\"url\":\"https:\\\/\\\/blexin.com\\\/en\\\/author\\\/salvatore-sorrentinoblexin-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lost in Translations: translation and Sentiment Analysis in real time - Blexin","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/","og_locale":"en_US","og_type":"article","og_title":"Lost in Translations: translation and Sentiment Analysis in real time - Blexin","og_description":"How to use Azure and Google in Cloud services to translate and the Sentiment Analysis from an Angular Client","og_url":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/","og_site_name":"Blexin","article_published_time":"2019-04-29T22:00:00+00:00","article_modified_time":"2021-05-20T17:18:23+00:00","og_image":[{"width":1024,"height":608,"url":"https:\/\/i1.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1","type":"image\/png"}],"author":"Salvatore Sorrentino","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Salvatore Sorrentino","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/#article","isPartOf":{"@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/"},"author":{"name":"Salvatore Sorrentino","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/354db2bc97cac71c2ceeca21a92d5bed"},"headline":"Lost in Translations: translation and Sentiment Analysis in real time","datePublished":"2019-04-29T22:00:00+00:00","dateModified":"2021-05-20T17:18:23+00:00","mainEntityOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/"},"wordCount":535,"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1","keywords":["Angular","Azure"],"articleSection":["Blog"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/","url":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/","name":"Lost in Translations: translation and Sentiment Analysis in real time - Blexin","isPartOf":{"@id":"https:\/\/blexin.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/#primaryimage"},"image":{"@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1","datePublished":"2019-04-29T22:00:00+00:00","dateModified":"2021-05-20T17:18:23+00:00","author":{"@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/354db2bc97cac71c2ceeca21a92d5bed"},"breadcrumb":{"@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/#primaryimage","url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1","contentUrl":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1","width":1024,"height":608},{"@type":"BreadcrumbList","@id":"https:\/\/blexin.com\/en\/blog-en\/lost-in-translations-translation-and-sentiment-analysis-in-real-time\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blexin.com\/en\/"},{"@type":"ListItem","position":2,"name":"Lost in Translations: translation and Sentiment Analysis in real time"}]},{"@type":"WebSite","@id":"https:\/\/blexin.com\/en\/#website","url":"https:\/\/blexin.com\/en\/","name":"Blexin","description":"Con noi \u00e8 semplice","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blexin.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/blexin.com\/en\/#\/schema\/person\/354db2bc97cac71c2ceeca21a92d5bed","name":"Salvatore Sorrentino","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a6ec0dc827d2acaa55df9dbf1007e23f6fcb8c9436df52ab48274bb2221085bf?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a6ec0dc827d2acaa55df9dbf1007e23f6fcb8c9436df52ab48274bb2221085bf?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a6ec0dc827d2acaa55df9dbf1007e23f6fcb8c9436df52ab48274bb2221085bf?s=96&d=identicon&r=g","caption":"Salvatore Sorrentino"},"url":"https:\/\/blexin.com\/en\/author\/salvatore-sorrentinoblexin-com\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/blexin.com\/wp-content\/uploads\/2020\/12\/13a5ce76-34c7-4bd2-93fd-374d7a0569b7.png?fit=1024%2C608&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/pcyUBx-7sS","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/28698","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/users\/196716245"}],"replies":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/comments?post=28698"}],"version-history":[{"count":5,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/28698\/revisions"}],"predecessor-version":[{"id":31992,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/posts\/28698\/revisions\/31992"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media\/28685"}],"wp:attachment":[{"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/media?parent=28698"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/categories?post=28698"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blexin.com\/en\/wp-json\/wp\/v2\/tags?post=28698"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}