3434SOCIAL_TONE_LABEL = 'social_tone'
3535
3636'''
37- * updateUserTone processes the Tone Analyzer payload to pull out the emotion, language and social
37+ * updateUserTone processes the Tone Analyzer payload to pull out the emotion, writing and social
3838 * tones, and identify the meaningful tones (i.e., those tones that meet the specified thresholds).
3939 * The conversationPayload json object is updated to include these tones.
4040 * @param conversationPayload json object returned by the Watson Conversation Service
@@ -57,7 +57,7 @@ def updateUserTone (conversationPayload, toneAnalyzerPayload, maintainHistory):
5757 # For convenience sake, define a variable for the user object
5858 user = conversationPayload ['context' ]['user' ];
5959
60- # Extract the tones - emotion, language and social
60+ # Extract the tones - emotion, writing and social
6161 if toneAnalyzerPayload and toneAnalyzerPayload ['document_tone' ]:
6262 for toneCategory in toneAnalyzerPayload ['document_tone' ]['tone_categories' ]:
6363 if toneCategory ['category_id' ] == EMOTION_TONE_LABEL :
@@ -132,16 +132,16 @@ def updateEmotionTone(user, emotionTone, maintainHistory):
132132 })
133133
134134'''
135- updateLanguageTone updates the user with the language tones interpreted based on the specified thresholds
135+ updateWritingTone updates the user with the writing tones interpreted based on the specified thresholds
136136 @param: user a json object representing user information (tone) to be used in conversing with the Conversation Service
137- @param: languageTone a json object containing the language tones in the payload returned by the Tone Analyzer
137+ @param: writingTone a json object containing the writing tones in the payload returned by the Tone Analyzer
138138'''
139139def updateWritingTone (user , writingTone , maintainHistory ):
140140
141141 currentWriting = [];
142142 currentWritingObject = [];
143143
144- # Process each language tone and determine if it is high or low
144+ # Process each writing tone and determine if it is high or low
145145 for tone in writingTone ['tones' ]:
146146 if tone ['score' ] >= WRITING_HIGH_SCORE_THRESHOLD :
147147 currentWriting .append (tone ['tone_name' ].lower () + '_high' )
0 commit comments