public async Task <double?> Measure(string text) { logger.LogDebug("Measure"); try { var result = await Measure(text, CancellationToken.None).ConfigureAwait(false); if (result == null) { logger.LogWarning("No meaningful response"); return(null); } logger.LogDebug("MeasureSentiment Calculated: {0}", result.Stars); return(result.Stars.HasValue ? RatingCalculator.ConvertToRaw(result.Stars.Value) : null); } catch (Exception ex) { logger.LogError(ex, "Failed sentiment processing"); return(null); } }