Training and using a sentiment machine learning module to receive as input haptic metric values to determine a sentiment score for text to provide to an interactive program
Provided are a computer program product, system, and method for training and using a sentiment machine learning module to determine a sentiment score. Haptic metric values are collected from haptic interfaces embedded in input devices users control to generate content. A training set associates a haptic metric value resulting from a user interacting with an input device to generate content and a sentiment score for the content. A sentiment machine learning module is trained to output the sentiment score in a training set from input comprising the haptic metric value. A haptic metric value received from an input device, used by an active user interacting with the interactive program, is inputted to the sentiment machine learning module to output a haptic sentiment score for the haptic metric value. The haptic sentiment score is provided to an interactive program to control the interactive program communications with the active user.
1 . A computer program product for determining a sentiment score for content generated by a user using an input device and communicating with bot, the computer program product comprising a computer readable storage medium having computer readable program code embodied therein that is executable to perform operations, the operations comprising:
receiving haptic metric values collected from haptic interfaces embedded in input devices users are controlling to generate text content, wherein the haptic metric values are measured from the users manipulating the input devices with a body part, wherein the haptic metric values are selected from the group consisting of a pressure of a keyclick on the input devices, an acceleration value of depressing keys on the input devices, surface area of keys depressed, frequency between key selections;
receiving a sentiment score indicating a sentiment of the text content, from one of the input devices, from a sentiment analysis of the text content;
forming training sets, wherein a training set associates at least one of the haptic metric values and the sentiment score for the text content produced by the one of the input devices when the at least one of the haptic metric values was measured from the one of the input devices;
for a selected training set of the training sets, training a sentiment machine learning module to output the sentiment score in the selected training set from input comprising the at least one of the haptic metric values;
inputting a haptic metric value received from an input device used by an active user interacting with the bot to the sentiment machine learning module to output a haptic sentiment score for the inputted haptic metric value; and
providing the haptic sentiment score to the bot to control a tone and content the bot presents to the active user based on the haptic sentiment score.
2 . The computer program product of claim 1 , wherein the operations further comprise:
determining whether a confidence level for a sentiment score for text content generated when a received haptic metric value was measured exceeds a confidence level threshold, wherein the received haptic metric value is only included in a training set with the sentiment score in response to determining that the confidence level for the sentiment score exceeds the confidence level threshold.
3 . The computer program product of claim 1 , wherein the bot comprises a virtual assistant and wherein the haptic sentiment score comprises a vector indicating multiple sentiment scores for multiple sentiment attributes, wherein the haptic sentiment score controls a tone the virtual assistant generates when interacting with the user.
4 . The computer program product of claim 1 , wherein the operations further comprise:
collecting situational context values determined when the haptic metric values were generated, wherein the selected training set includes a situational context value for the at least one of the haptic metric values, wherein the sentiment machine learning module is trained with the situational context value in the selected training set along with the at least one of the haptic metric values to output the haptic sentiment score, and wherein input to the sentiment machine learning module from the active user includes an input situational context value for the inputted haptic metric value.
5 . The computer program product of claim 4 , wherein the input situational context value comprises a vector indicating a location and time when the input haptic metric value was generated, and wherein the input haptic metric value comprises a vector indicating control touched, pressure of touch, frequency between touches, and area of inference.
6 . The computer program product of claim 1 , wherein the training set further associates a deviation training value indicating an extent to which haptic metric values measured for the user for the sentiment score differ from haptic metric values measured for the sentiment score across a plurality of users, wherein input to train the sentiment machine learning module from the selected training set further comprises a deviation training value in the selected training set, and wherein the input to the sentiment machine learning module for the active user further comprises a deviation training value for the active user.
7 . The computer program product of claim 6 , wherein the operations further comprise:
determining deviation training values for a user for different sentiment scores, wherein a deviation training value for a given sentiment score of the different sentiment scores for the user is calculated as a ratio of haptic values for the given sentiment score for the user and haptic values for the given sentiment score from the plurality of users, wherein the deviation training value included in a training set for the sentiment score is from the deviation values determined for the user.
8 . The computer program product of claim 6 , wherein the training set includes personal attributes of the user for which the at least one of the haptic metric values was determined, wherein the sentiment machine learning module is trained with the personal attributes for the user in the selected training set along with the at least one of the haptic metric values and the deviation training value for the user to output the sentiment score, and wherein the input to the sentiment machine learning module from the active user further includes personal attributes of the active user.
9 . The computer program product of claim 1 , wherein the operations further comprise:
collecting situational context values determined when the haptic metric values were generated, wherein the training set includes a situational context value for a haptic metric value, wherein the sentiment machine learning module is trained with the situational context value in the selected training set along with the haptic metric value to output the haptic sentiment score, and wherein input to the sentiment machine learning module from the active user includes a situational context value for the haptic metric value;
determining deviation training values for a user for different sentiment scores and situational context values experienced by the user when the haptic metric values were generated, wherein a deviation training value for a given sentiment score of the different sentiment scores and a given situational context value is based on haptic values for the given sentiment score and the given situational context value for the user and haptic values for the given sentiment score from a plurality of users, wherein a deviation training value included in a training set for the sentiment score and the situational context value is from the deviation training value for the situational context value in which the haptic metric value was measured; and
determining deviation training values for different situational context values for the user, wherein the deviation training value inputted to the sentiment machine learning module for the active user is for a situational context value for the active user.
10 . The computer program product of claim 9 , wherein the operations further comprise:
wherein a deviation training value for a user for a given sentiment score and a given situation context value is calculated as ratio of (an average of haptic values for the given sentiment score and the given situational context value for the user) and (an average of haptic values for the given sentiment score from the plurality of users), and
wherein a deviation training value for a user for a given situational context value is calculated as a ratio of (an average of haptic values for the given situational context value for the user) and (an average of haptic values from the plurality of users).
11 . The computer program product of claim 1 , wherein haptic metric values are collected from different input devices, wherein the training set indicates an input device from which the at least one of the haptic metric values was generated, and wherein input to the sentiment machine learning module from the user interacting with the bot includes an input device used by the user interacting with the bot when the haptic metric value was inputted.
12 . A system for determining a sentiment score for content generated by a user using an input device and communicating with a bot, comprising:
a processor; and
a computer readable storage medium having computer readable program code embodied therein that when executed by the processor performs operations, the operations comprising:
receiving haptic metric values collected from haptic interfaces embedded in input devices users are controlling to generate text content, wherein the haptic metric values are measured from the users manipulating the input devices with a body part, wherein the haptic metric values are selected from the group consisting of a pressure of a keyclick on the input devices, an acceleration value of depressing keys on the input devices, surface area of keys depressed, frequency between key selections;
receiving a sentiment score indicating a sentiment of the text content, from one of the input devices, from a sentiment analysis of the text content;
forming training sets, wherein a training set associates at least one of the haptic metric values and the sentiment score for the text content produced by the one of the input devices when the at least one of the haptic metric values was measured from the one of the input devices;
for a selected training set of the training sets, training a sentiment machine learning module to output the sentiment score in the selected training set from input comprising the at least one of the haptic metric values;
inputting a haptic metric value received from an input device used by an active user interacting with the bot to the sentiment machine learning module to output a haptic sentiment score for the inputted haptic metric value; and
providing the haptic sentiment score to the bot to control a tone and content the bot presents to the active user based on the haptic sentiment score.
13 . The system of claim 12 , wherein the bot comprises a virtual assistant and wherein the haptic sentiment score comprises a vector indicating multiple sentiment scores for multiple sentiment attributes, wherein the haptic sentiment score controls a tone the virtual assistant generates when interacting with the user.
14 . The system of claim 12 , wherein the operations further comprise:
collecting situational context values determined when the haptic metric values were generated, wherein the training set includes a situational context value for a haptic metric value, wherein the sentiment machine learning module is trained with the situational context value in the selected training set along with the haptic metric value to output the haptic sentiment score, and wherein input to the sentiment machine learning module from the active user includes a situational context value for the haptic metric value.
15 . The system of claim 12 , wherein the training set further associates a deviation training value indicating an extent to which haptic metric values measured for the user for the sentiment score differ from haptic metric values measured for the sentiment score across a plurality of users, wherein input to train the sentiment machine learning module from the selected training set further comprises a deviation training value in the selected training set, and wherein the input to the sentiment machine learning module for the active user further comprises a deviation training value for the active user.
16 . The system of claim 12 , wherein the operations further comprise:
collecting situational context values determined when the haptic metric values were generated, wherein the training set includes a situational context value for a haptic metric value, wherein the sentiment machine learning module is trained with the situational context value in the selected training set along with the haptic metric value to output the haptic sentiment score, and wherein input to the sentiment machine learning module from the active user includes a situational context value for the haptic metric value;
determining deviation training values for a user for different sentiment scores and situational context values experienced by the user when the haptic metric values were generated, wherein a deviation training value for a given sentiment score of the different sentiment scores and a given situational context value is based on haptic values for the given sentiment score and the given situational context value for the user and haptic values for the given sentiment score from a plurality of users, wherein a deviation training value included in a training set for the sentiment score and the situational context value is from the deviation training value for the situational context value in which the haptic metric value was measured; and
determining deviation training values for different situational context values for the user, wherein the deviation training value inputted to the sentiment machine learning module for the active user is for a situational context value for the active user.
17 . A computer implemented method for determining a sentiment score for content, comprising:
receiving haptic metric values collected from haptic interfaces embedded in input devices users are controlling to generate text content, wherein the haptic metric values are measured from the users manipulating the input devices with a body part, wherein the haptic metric values are selected from the group consisting of a pressure of a keyclick on the input devices, an acceleration value of depressing keys on the input devices, surface area of keys depressed, frequency between key selections;
receiving a sentiment score indicating a sentiment of the text content, from one of the input devices, from a sentiment analysis of the text content;
forming training sets, wherein a training set associates at least one of the haptic metric values and the sentiment score for the text content produced by the one of the input devices when the at least one of the haptic metric values was measured from the one of the input devices;
for a selected training set of the training sets, training a sentiment machine learning module to output the sentiment score in the selected training set from input comprising the at least one of the haptic metric values;
inputting a haptic metric value received from an input device used by an active user interacting with a bot to the sentiment machine learning module to output a haptic sentiment score for the inputted haptic metric value; and
providing the haptic sentiment score to the bot to control a tone and content the bot presents to the active user based on the haptic sentiment score.
18 . The method of claim 17 , wherein the bot comprises a virtual assistant and wherein the haptic sentiment score comprises a vector indicating multiple sentiment scores for multiple sentiment attributes, wherein the haptic sentiment score controls a tone the virtual assistant generates when interacting with the user.
19 . The method of claim 17 , further comprising:
collecting situational context values determined when the haptic metric values were generated, wherein the training set includes a situational context value for a haptic metric value, wherein the sentiment machine learning module is trained with the situational context value in the selected training set along with the haptic metric value to output the haptic sentiment score, and wherein input to the sentiment machine learning module from the active user includes a situational context value for the haptic metric value.
20 . The method of claim 17 , wherein the training set further associates a deviation training value indicating an extent to which haptic metric values measured for the user for the sentiment score differ from haptic metric values measured for the sentiment score across a plurality of users, wherein input to train the sentiment machine learning module from the selected training set further comprises a deviation training value in the selected training set, and wherein the input to the sentiment machine learning module for the active user further comprises a deviation training value for the active user.