예제 #1
0
 /// <summary>
 /// Adds a property to the labeled utterance.
 /// </summary>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <param name="propertyName">Property name.</param>
 /// <param name="propertyValue">Property value.</param>
 /// <returns>Labeled utterance with additional property.</returns>
 public static LabeledUtterance WithProperty(this LabeledUtterance instance, string propertyName, object propertyValue)
 {
     return(instance.WithProperty(propertyName, propertyValue, ToJsonLabeledUtterance));
 }
예제 #2
0
 /// <summary>
 /// Gets the text transcription confidence score for the labeled utterance.
 /// </summary>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <returns>
 /// Transcription confidence score, or <code>null</code> if property is not set.
 /// </returns>
 public static double?GetTextScore(this LabeledUtterance instance)
 {
     return(instance.GetPropertyCore <double?>(TextScorePropertyName));
 }
예제 #3
0
 /// <summary>
 /// Adds a confidence score for the text transcription to the labeled utterance.
 /// </summary>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <param name="textScore">Confidence score.</param>
 /// <returns>Labeled utterance with transcription confidence score.</returns>
 public static LabeledUtterance WithTextScore(this LabeledUtterance instance, double?textScore)
 {
     return(instance.WithProperty(TextScorePropertyName, textScore, ToJsonLabeledUtterance));
 }
예제 #4
0
 /// <summary>
 /// Adds a timestamp to the labeled utterance.
 /// </summary>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <param name="timestamp">Timestamp.</param>
 /// <returns>Labeled utterance with timestamp.</returns>
 public static LabeledUtterance WithTimestamp(this LabeledUtterance instance, DateTimeOffset?timestamp)
 {
     return(instance.WithProperty(TimestampPropertyName, timestamp, ToJsonLabeledUtterance));
 }
예제 #5
0
 private static JsonLabeledUtterance ToJsonLabeledUtterance(this LabeledUtterance utterance)
 {
     return(utterance is JsonLabeledUtterance jsonUtterance
         ? jsonUtterance
         : new JsonLabeledUtterance(utterance.Text, utterance.Intent, utterance.Entities));
 }
예제 #6
0
 /// <summary>
 /// Gets the utterance identifier for the labeled utterance.
 /// </summary>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <returns>Utterance identifier.</returns>
 public static string GetUtteranceId(this LabeledUtterance instance)
 {
     return(instance.GetPropertyCore <string>(UtteranceIdPropertyName));
 }
예제 #7
0
 /// <summary>
 /// Gets the property for the labeled utterance.
 /// </summary>
 /// <typeparam name="T">Property value type.</typeparam>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <param name="propertyName">Property name.</param>
 /// <returns>
 /// Property value, or default if property is not set.
 /// </returns>
 public static T GetProperty <T>(this LabeledUtterance instance, string propertyName)
 {
     return(instance.GetPropertyCore <T>(propertyName));
 }
예제 #8
0
 /// <summary>
 /// Gets the timestamp for the labeled utterance.
 /// </summary>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <returns>
 /// Timestamp, or <code>null</code> if property is not set.
 /// </returns>
 public static DateTimeOffset?GetTimestamp(this LabeledUtterance instance)
 {
     return(instance.GetPropertyCore <DateTimeOffset?>(TimestampPropertyName));
 }
 /// <summary>
 /// Gets the text transcription confidence score for the labeled utterance.
 /// </summary>
 /// <param name="instance">Labeled utterance instance.</param>
 /// <returns>
 /// Transcription confidence score, or <code>null</code> if property is not set.
 /// </returns>
 public static double?GetTextScore(this LabeledUtterance instance)
 {
     return(instance.GetNumericProperty(TextScorePropertyName));
 }